summaryrefslogtreecommitdiffhomepage
path: root/gui/main-window.cpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-08-17 22:10:35 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-08-17 22:32:04 +0200
commit2eafc288d95d750f3a8282ebb503a340cb50a32c (patch)
tree7877d6c20c8cf31121710d0f76c919787f973df3 /gui/main-window.cpp
parentfdef1901054e61e5996c59ac09d9a2646cc76341 (diff)
gui: reload keybindings immediately
Previously the old global keybindings stuck when options dialog got cancelled.
Diffstat (limited to 'gui/main-window.cpp')
-rw-r--r--gui/main-window.cpp11
1 files changed, 2 insertions, 9 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp
index b09b70d0..7de95f98 100644
--- a/gui/main-window.cpp
+++ b/gui/main-window.cpp
@@ -374,12 +374,6 @@ void MainWindow::updateButtonState(bool running, bool inertialp)
}
}
-void MainWindow::reload_options()
-{
- if (work)
- work->reload_shortcuts();
-}
-
void MainWindow::startTracker()
{
if (work)
@@ -408,8 +402,7 @@ void MainWindow::startTracker()
save_modules();
work = std::make_shared<Work>(pose, libs, winId());
-
- reload_options();
+ work->reload_shortcuts();
if (pTrackerDialog)
pTrackerDialog->register_tracker(libs.pTracker.get());
@@ -598,7 +591,7 @@ void MainWindow::show_options_dialog()
{
if (mk_window(&options_widget, [&](bool flag) -> void { set_keys_enabled(!flag); }))
{
- connect(options_widget.get(), &OptionsDialog::saving, this, &MainWindow::reload_options);
+ connect(options_widget.get(), &OptionsDialog::closing, this, &MainWindow::register_shortcuts);
options_widget->update_widgets_states(work != nullptr);
}
}