From 8b08d5800354a5dcedfd7811447ea76e09c31d03 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sun, 30 Aug 2015 08:48:24 +0200 Subject: ui: save profile when combobox text changes, not merely index --- facetracknoir/ui.cpp | 8 ++++---- facetracknoir/ui.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'facetracknoir') 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(); -- cgit v1.2.3