From e02d939c269d0a1b0d387b74f1d767e7c65c14b8 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 22 Aug 2015 11:04:33 +0200 Subject: close dialogs on switch to new module Don't preemptively close dialog on tracking stop, that's annoying for users. --- facetracknoir/ui.cpp | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) (limited to 'facetracknoir') diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 7d8ae302..3f87ca2f 100755 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -80,6 +80,18 @@ MainWindow::MainWindow() : tie_setting(s.protocol_dll, ui.iconcomboProtocol); tie_setting(s.filter_dll, ui.iconcomboFilter); + connect(ui.iconcomboTrackerSource, + static_cast(&QComboBox::currentIndexChanged), + [&](int) -> void { if (pTrackerDialog) pTrackerDialog = nullptr; }); + + connect(ui.iconcomboProtocol, + static_cast(&QComboBox::currentIndexChanged), + [&](int) -> void { if (pProtocolDialog) pProtocolDialog = nullptr; }); + + connect(ui.iconcomboFilter, + static_cast(&QComboBox::currentIndexChanged), + [&](int) -> void { if (pFilterDialog) pFilterDialog = nullptr; }); + connect(ui.btnStartTracker, SIGNAL(clicked()), this, SLOT(startTracker())); connect(ui.btnStopTracker, SIGNAL(clicked()), this, SLOT(stopTracker())); connect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int))); @@ -270,22 +282,13 @@ void MainWindow::stopTracker( ) { ui.pose_display->rotateBy(0, 0, 0, 0, 0, 0); if (pTrackerDialog) - { pTrackerDialog->unregister_tracker(); - pTrackerDialog = nullptr; - } if (pProtocolDialog) - { pProtocolDialog->unregister_protocol(); - pProtocolDialog = nullptr; - } if (pFilterDialog) - { pFilterDialog->unregister_filter(); - pFilterDialog = nullptr; - } work = nullptr; libs = SelectedLibraries(); -- cgit v1.2.3