diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-09 21:08:46 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-09 21:08:46 +0200 |
commit | c4b50ed21a657f1b58d997dad82e5240b7ed9e61 (patch) | |
tree | 8764250ae1c97abcadf3aeddf426e1f20d9ccda1 /gui | |
parent | e4ea50f431e8efbfb572c441d00d5539db516820 (diff) |
gui/main-window: only tie and connect options after migration is done
Otherwise tied version overwrites given migration before it's run.
Diffstat (limited to 'gui')
-rw-r--r-- | gui/main-window.cpp | 40 |
1 files changed, 21 insertions, 19 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp index 39d97a22..c943f89d 100644 --- a/gui/main-window.cpp +++ b/gui/main-window.cpp @@ -68,25 +68,6 @@ MainWindow::MainWindow() : ui.iconcomboFilter->addItem(x->icon, x->name); } - // dylibs - { - tie_setting(m.tracker_dll, ui.iconcomboTrackerSource); - tie_setting(m.protocol_dll, ui.iconcomboProtocol); - tie_setting(m.filter_dll, ui.iconcomboFilter); - - connect(ui.iconcomboTrackerSource, - &QComboBox::currentTextChanged, - [&](QString) -> void { if (pTrackerDialog) pTrackerDialog = nullptr; save_modules(); }); - - connect(ui.iconcomboProtocol, - &QComboBox::currentTextChanged, - [&](QString) -> void { if (pProtocolDialog) pProtocolDialog = nullptr; save_modules(); }); - - connect(ui.iconcomboFilter, - &QComboBox::currentTextChanged, - [&](QString) -> void { if (pFilterDialog) pFilterDialog = nullptr; save_modules(); }); - } - // timers connect(&config_list_timer, &QTimer::timeout, this, [this]() { refresh_config_list(false); }); connect(&pose_update_timer, SIGNAL(timeout()), this, SLOT(showHeadPose())); @@ -116,6 +97,27 @@ MainWindow::MainWindow() : else set_profile(group::ini_filename()); + // only tie and connect main screen options after migrations are done. + + // dylibs + { + connect(ui.iconcomboTrackerSource, + &QComboBox::currentTextChanged, + [&](QString) -> void { if (pTrackerDialog) pTrackerDialog = nullptr; save_modules(); }); + + connect(ui.iconcomboProtocol, + &QComboBox::currentTextChanged, + [&](QString) -> void { if (pProtocolDialog) pProtocolDialog = nullptr; save_modules(); }); + + connect(ui.iconcomboFilter, + &QComboBox::currentTextChanged, + [&](QString) -> void { if (pFilterDialog) pFilterDialog = nullptr; save_modules(); }); + } + + tie_setting(m.tracker_dll, ui.iconcomboTrackerSource); + tie_setting(m.protocol_dll, ui.iconcomboProtocol); + tie_setting(m.filter_dll, ui.iconcomboFilter); + connect(this, &MainWindow::emit_start_tracker, this, [&]() -> void { qDebug() << "start tracker"; startTracker(); }, Qt::QueuedConnection); |