Commit bd6c098f authored by Dmitry Kazakov's avatar Dmitry Kazakov
Browse files

Fix undoing shortcut changes when pressing Cancel button

BUG:362869
parent 413c1900
...@@ -308,9 +308,9 @@ void ShortcutSettingsTab::saveChanges() ...@@ -308,9 +308,9 @@ void ShortcutSettingsTab::saveChanges()
KisActionRegistry::instance()->settingsPageSaved(); KisActionRegistry::instance()->settingsPageSaved();
} }
void ShortcutSettingsTab::revertChanges() void ShortcutSettingsTab::cancelChanges()
{ {
m_page->allDefault(); m_page->undo();
} }
ColorSettingsTab::ColorSettingsTab(QWidget *parent, const char *name) ColorSettingsTab::ColorSettingsTab(QWidget *parent, const char *name)
...@@ -858,6 +858,7 @@ KisDlgPreferences::KisDlgPreferences(QWidget* parent, const char* name) ...@@ -858,6 +858,7 @@ KisDlgPreferences::KisDlgPreferences(QWidget* parent, const char* name)
addPage(page); addPage(page);
m_shortcutSettings = new ShortcutSettingsTab(vbox); m_shortcutSettings = new ShortcutSettingsTab(vbox);
connect(this, SIGNAL(accepted()), m_shortcutSettings, SLOT(saveChanges())); connect(this, SIGNAL(accepted()), m_shortcutSettings, SLOT(saveChanges()));
connect(this, SIGNAL(rejected()), m_shortcutSettings, SLOT(cancelChanges()));
// Canvas input settings // Canvas input settings
m_inputConfiguration = new KisInputConfigurationPage(); m_inputConfiguration = new KisInputConfigurationPage();
......
...@@ -124,7 +124,7 @@ public: ...@@ -124,7 +124,7 @@ public:
public Q_SLOTS: public Q_SLOTS:
void saveChanges(); void saveChanges();
void revertChanges(); void cancelChanges();
}; };
......
...@@ -119,6 +119,11 @@ void KisShortcutsDialog::allDefault() ...@@ -119,6 +119,11 @@ void KisShortcutsDialog::allDefault()
d->m_shortcutsEditor->allDefault(); d->m_shortcutsEditor->allDefault();
} }
void KisShortcutsDialog::undo()
{
d->undo();
}
void KisShortcutsDialog::importConfiguration(const QString &path) void KisShortcutsDialog::importConfiguration(const QString &path)
{ {
auto config = KSharedConfig::openConfig(path); auto config = KSharedConfig::openConfig(path);
......
...@@ -141,6 +141,8 @@ public: ...@@ -141,6 +141,8 @@ public:
* Called when the "OK" button in the main configuration page is pressed. * Called when the "OK" button in the main configuration page is pressed.
*/ */
void save(); void save();
void allDefault();
void undo();
/** /**
* Import shortcut scheme file from @p path * Import shortcut scheme file from @p path
...@@ -162,10 +164,6 @@ public: ...@@ -162,10 +164,6 @@ public:
*/ */
void saveCustomShortcuts(const QString &path) const; void saveCustomShortcuts(const QString &path) const;
public Q_SLOTS:
void allDefault();
private: private:
Q_PRIVATE_SLOT(d, void changeShortcutScheme(const QString &)) Q_PRIVATE_SLOT(d, void changeShortcutScheme(const QString &))
Q_PRIVATE_SLOT(d, void undo()) Q_PRIVATE_SLOT(d, void undo())
......
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