Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 83a00a9a authored by Leslie Zhai's avatar Leslie Zhai

Implement enable "apply" button only when some setting is changed.

But there are too many widgets had been connect with changed SIGNAL..

CCBUG: 382776
parent 52a2493f
......@@ -56,6 +56,8 @@ K3b::MiscOptionTab::MiscOptionTab(QWidget *parent )
"project dialog):"),
i18n("One of these sets is loaded once an action dialog is opened. "
"This setting defines which set it will be.") );
connect(m_checkSaveOnExit, &QCheckBox::stateChanged, [this]{ Q_EMIT changed(); });
}
......
......@@ -30,6 +30,9 @@ namespace K3b {
void readSettings();
bool saveSettings();
Q_SIGNALS:
void changed();
};
}
......
......@@ -70,6 +70,7 @@ K3b::OptionDialog::OptionDialog(QWidget *parent )
// because of the label in the device-tab
setFixedSize(700, 582);
buttonBox()->button(QDialogButtonBox::Apply)->setDefault(false);
connect( this->buttonBox()->button( QDialogButtonBox::Ok ), SIGNAL(clicked()), SLOT(slotOk()) );
connect( this->buttonBox()->button( QDialogButtonBox::RestoreDefaults ), SIGNAL(clicked()), SLOT(slotDefault()) );
connect( this->buttonBox()->button( QDialogButtonBox::Apply ), SIGNAL(clicked()), SLOT(slotApply()) );
......@@ -131,6 +132,9 @@ void K3b::OptionDialog::slotDefault()
void K3b::OptionDialog::setupMiscPage()
{
m_miscOptionTab = new K3b::MiscOptionTab;
connect(m_miscOptionTab, &K3b::MiscOptionTab::changed, [this](){
buttonBox()->button(QDialogButtonBox::Apply)->setDefault(true);
});
m_miscPage = addPage( m_miscOptionTab, i18n("Misc") );
m_miscPage->setHeader( i18n("Miscellaneous Settings") );
m_miscPage->setIcon( QIcon::fromTheme( "preferences-other" ) );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment