diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2015-08-30 08:48:24 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2015-08-30 08:49:43 +0200 |
commit | 8b08d5800354a5dcedfd7811447ea76e09c31d03 (patch) | |
tree | abe44b6cc28c616bd47459f90da4713b4c564ae3 | |
parent | be000a8a9aad1d6804ee27b02b12b531029427cb (diff) |
ui: save profile when combobox text changes, not merely index
-rw-r--r-- | facetracknoir/ui.cpp | 8 | ||||
-rw-r--r-- | facetracknoir/ui.h | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/facetracknoir/ui.cpp b/facetracknoir/ui.cpp index 7b84de72..0c104553 100644 --- a/facetracknoir/ui.cpp +++ b/facetracknoir/ui.cpp @@ -71,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))); + connect(ui.iconcomboProfile, SIGNAL(currentTextChanged(QString)), this, SLOT(profileSelected(QString))); connect(&pose_update_timer, SIGNAL(timeout()), this, SLOT(showHeadPose())); connect(&kbd_quit, SIGNAL(activated()), this, SLOT(exit())); @@ -434,13 +434,13 @@ void MainWindow::exit() { QCoreApplication::exit(0); } -void MainWindow::profileSelected(int index) +void MainWindow::profileSelected(QString name) { - if (index == -1 || is_refreshing_profiles) + if (name == "" || is_refreshing_profiles) return; const auto old_name = group::ini_filename(); - const auto new_name = ui.iconcomboProfile->itemText(index); + const auto new_name = name; if (old_name != new_name) { diff --git a/facetracknoir/ui.h b/facetracknoir/ui.h index 5d81507f..65a7647a 100644 --- a/facetracknoir/ui.h +++ b/facetracknoir/ui.h @@ -77,7 +77,7 @@ class MainWindow : public QMainWindow, private State void set_profile(const QString& profile); private slots: void exit(); - void profileSelected(int index); + void profileSelected(QString name); void showTrackerSettings(); void showProtocolSettings(); |