diff options
-rw-r--r-- | facetracknoir/ui.cpp | 9 | ||||
-rw-r--r-- | facetracknoir/ui.h | 1 |
2 files changed, 7 insertions, 3 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 04baaf5a..89b25fe4 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -22,7 +22,8 @@ MainWindow::MainWindow() : pose_update_timer(this), kbd_quit(QKeySequence("Ctrl+Q"), this), - no_feed_pixmap(":/images/no-feed.png") + no_feed_pixmap(":/images/no-feed.png"), + is_refreshing_profiles(false) { ui.setupUi(this); @@ -70,7 +71,7 @@ MainWindow::MainWindow() : 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)), Qt::QueuedConnection); + connect(ui.iconcomboProfile, SIGNAL(currentIndexChanged(int)), this, SLOT(profileSelected(int))); connect(&pose_update_timer, SIGNAL(timeout()), this, SLOT(showHeadPose())); connect(&kbd_quit, SIGNAL(activated()), this, SLOT(exit())); @@ -204,9 +205,11 @@ void MainWindow::refresh_config_list() QStringList ini_list = group::ini_list(); set_title(); QString current = group::ini_filename(); + is_refreshing_profiles = true; ui.iconcomboProfile->clear(); for (auto x : ini_list) ui.iconcomboProfile->addItem(QIcon(":/images/settings16.png"), x); + is_refreshing_profiles = false; ui.iconcomboProfile->setCurrentText(current); } @@ -434,7 +437,7 @@ void MainWindow::exit() { void MainWindow::profileSelected(int index) { - if (index == -1) + if (index == -1 || is_refreshing_profiles) return; const auto old_name = group::ini_filename(); diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h index 021f327d..5d81507f 100644 --- a/facetracknoir/ui.h +++ b/facetracknoir/ui.h @@ -50,6 +50,7 @@ class MainWindow : public QMainWindow, private State mem<ITrackerDialog> pTrackerDialog; process_detector_worker det; QMenu profile_menu; + bool is_refreshing_profiles; mem<dylib> current_tracker() { |