Commit 936e30ac authored by Peter Mühlenpfordt's avatar Peter Mühlenpfordt

Fix shortcut config changes sometimes not updating until restart

Summary:
After setting or resetting custom shortcuts for actions in Browse or
Start Page Mode and then switching to View Mode these changes are not
active until next Gwenview restart.
This patch adds a `refreshActionProperties()` call after the shortcut
config dialog is closed to fix this.

BUG: 389331
FIXED-IN: 18.04.0

Test Plan:
* Start Gwenview in Browse Mode or Start Page Mode
* {nav Settings > Configure Shortcuts...}
* Set custom shortcut for {nav Quit} to e.g. {key Esc}
* Switch to View Mode displaying any image
* {key Esc} should quit Gwenview
* Restart Gwenview in Browse Mode or Start Page Mode
* {nav Settings > Configure Shortcuts...}
* Reset shortcuts with {nav Defaults}
* Switch to View Mode displaying any image
* {key Ctrl Q} should quit Gwenview

Reviewers: #gwenview, rkflx

Reviewed By: #gwenview, rkflx

Subscribers: rkflx, huoni

Differential Revision: https://phabricator.kde.org/D12023
parent f78e5e4b
......@@ -478,8 +478,8 @@ struct MainWindow::Private
actionCollection->setDefaultShortcut(mShowStatusBarAction, Qt::Key_F3);
view->addAction(KStandardAction::KeyBindings, q->guiFactory(),
SLOT(configureShortcuts()));
view->addAction(KStandardAction::name(KStandardAction::KeyBindings),
KStandardAction::keyBindings(q, &MainWindow::configureShortcuts, actionCollection));
view->addAction(KStandardAction::Preferences, q,
SLOT(showConfigDialog()));
......@@ -1488,6 +1488,12 @@ void MainWindow::showConfigDialog()
dialog->exec();
}
void MainWindow::configureShortcuts()
{
guiFactory()->configureShortcuts();
guiFactory()->refreshActionProperties();
}
void MainWindow::toggleMenuBar()
{
if (!d->mFullScreenAction->isChecked()) {
......
......@@ -135,6 +135,7 @@ private:
void openSelectedDocuments();
void saveConfig();
void configureShortcuts();
void folderViewUrlChanged(const QUrl &url);
};
......
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