summaryrefslogtreecommitdiffhomepage
path: root/gui/main-window.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/main-window.cpp')
-rw-r--r--gui/main-window.cpp51
1 files changed, 38 insertions, 13 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp
index 4daf7560..89316f9e 100644
--- a/gui/main-window.cpp
+++ b/gui/main-window.cpp
@@ -349,34 +349,59 @@ void MainWindow::refresh_config_list(bool warn)
return;
}
+ bool file_ok = false;
+
QString current = group::ini_filename();
+ QIcon icon(":/images/settings16.png");
{
- inhibit_qt_signals l(*ui.iconcomboProfile);
+ {
+ inhibit_qt_signals l(*ui.iconcomboProfile);
- ui.iconcomboProfile->clear();
- ui.iconcomboProfile->addItems(ini_list);
+ ui.iconcomboProfile->clear();
+ ui.iconcomboProfile->addItems(ini_list);
- QIcon icon(":/images/settings16.png");
+ {
+ const int sz = ini_list.size();
- {
- const int sz = ini_list.size();
+ for (int i = 0; i < sz; i++)
+ ui.iconcomboProfile->setItemIcon(i, icon);
+ }
- for (int i = 0; i < sz; i++)
- ui.iconcomboProfile->setItemIcon(i, icon);
+ ui.iconcomboProfile->setCurrentText(current);
}
- {
- const QString pathname = group::ini_pathname();
+ const QString pathname = group::ini_pathname();
- if (!QFile(pathname).exists())
+ if (!QFile(pathname).exists())
+ {
{
QFile file(pathname);
(void) file.open(QFile::ReadWrite);
}
- }
- ui.iconcomboProfile->setCurrentText(current);
+ const QStringList ini_list = group::ini_list();
+
+ if (ini_list.contains(current))
+ {
+ {
+ inhibit_qt_signals q(ui.iconcomboProfile);
+
+ ui.iconcomboProfile->clear();
+ ui.iconcomboProfile->addItems(ini_list);
+ for (int i = 0; i < ini_list.size(); i++)
+ ui.iconcomboProfile->setItemIcon(i, icon);
+ ui.iconcomboProfile->setCurrentText(current);
+ }
+
+ options::detail::bundler::refresh_all_bundles(true);
+ }
+ }
+ else
+ {
+ file_ok = true;
+ ui.iconcomboProfile->setCurrentText(current);
+ }
}
set_title();