Commit 690cee59 authored by Boudewijn Rempt's avatar Boudewijn Rempt

Set the preferences when closing the preferences dialog

Since many users simply close the preferences dialog thinking
their changes will be saved, apply the changes also when the
dialog is closed.

Now only the Cancel button will really close the dialog and
not set the changed preferences.
parent e27ab3a7
......@@ -696,7 +696,9 @@ void KisMainWindow::showView(KisView *imageView, QMdiSubWindow *subwin)
void KisMainWindow::slotPreferences()
{
if (KisDlgPreferences::editPreferences()) {
QScopedPointer<KisDlgPreferences> dlgPreferences(new KisDlgPreferences(this));
if (!dlgPreferences->editPreferences()) {
KisConfigNotifier::instance()->notifyConfigChanged();
KisConfigNotifier::instance()->notifyPixelGridModeChanged();
KisImageConfigNotifier::instance()->notifyConfigChanged();
......
This diff is collapsed.
......@@ -323,17 +323,14 @@ class KisDlgPreferences : public KPageDialog
public:
static bool editPreferences();
protected:
KisDlgPreferences(QWidget *parent = 0, const char *name = 0);
~KisDlgPreferences() override;
bool editPreferences();
void showEvent(QShowEvent *event) override;
protected:
private:
GeneralTab *m_general;
ShortcutSettingsTab *m_shortcutSettings;
......@@ -347,10 +344,14 @@ protected:
QList<KPageWidgetItem*> m_pages;
protected Q_SLOTS:
private Q_SLOTS:
void slotButtonClicked(QAbstractButton *button);
void slotDefault();
private:
bool m_cancelClicked {false};
};
#endif
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