summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
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();