summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorisanae <14251494+isanae@users.noreply.github.com>2020-12-29 02:42:07 -0500
committerisanae <14251494+isanae@users.noreply.github.com>2020-12-29 02:42:07 -0500
commit33a177f1eda90b4d1fff92976635beaa59f85172 (patch)
treef8a62cc4ac8fb318ef4e86053e389a3187968940 /src/mainwindow.cpp
parentcc997c370465629c11b72ebef3ffde1bbd1fa46e (diff)
profiles dialog:
- added select button - select new profile in the list after creating
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 08c8ef7c..cfce9bef 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -1713,9 +1713,22 @@ void MainWindow::on_profileBox_currentIndexChanged(int index)
if (ui->profileBox->currentIndex() == 0) {
ui->profileBox->setCurrentIndex(previousIndex);
- ProfilesDialog(ui->profileBox->currentText(), m_OrganizerCore, this).exec();
+
+ std::optional<QString> newSelection;
+
+ ProfilesDialog dlg(ui->profileBox->currentText(), m_OrganizerCore, this);
+ dlg.exec();
+ newSelection = dlg.selectedProfile();
+
while (!refreshProfiles()) {
- ProfilesDialog(ui->profileBox->currentText(), m_OrganizerCore, this).exec();
+ ProfilesDialog dlg(ui->profileBox->currentText(), m_OrganizerCore, this);
+ dlg.exec();
+ newSelection = dlg.selectedProfile();
+ }
+
+ if (newSelection) {
+ ui->profileBox->setCurrentText(*newSelection);
+ activateSelectedProfile();
}
} else {
activateSelectedProfile();