diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-29 02:42:07 -0500 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2020-12-29 02:42:07 -0500 |
| commit | 33a177f1eda90b4d1fff92976635beaa59f85172 (patch) | |
| tree | f8a62cc4ac8fb318ef4e86053e389a3187968940 /src/mainwindow.cpp | |
| parent | cc997c370465629c11b72ebef3ffde1bbd1fa46e (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.cpp | 17 |
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(); |
