diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-08-28 09:04:43 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-08-28 09:04:43 +0200 |
commit | 5dd01a9a8ba94a61462340446031904629d12792 (patch) | |
tree | 33c75420f92890c14b8e25a704ee02a95dd055a7 /facetracknoir/ui.cpp | |
parent | 418c2f4f98ecac56098153e61e38d9694c4eb32c (diff) |
ui: really don't switch profiles while refreshing combobox
Diffstat (limited to 'facetracknoir/ui.cpp')
-rw-r--r-- | facetracknoir/ui.cpp | 9 |
1 files changed, 6 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(); |