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