diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-09 21:22:42 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-09-09 21:34:11 +0200 |
commit | b0444b30957fe80b06d4129548cbd98442a4b02e (patch) | |
tree | a2132f9226b8a503322f1e464a9066507a4fbef3 /gui/main-window.cpp | |
parent | d78b9f2688239e199faab57fd5c93054c729b097 (diff) |
gui/main-window: minor fixes
Diffstat (limited to 'gui/main-window.cpp')
-rw-r--r-- | gui/main-window.cpp | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/gui/main-window.cpp b/gui/main-window.cpp index c943f89d..8d65c738 100644 --- a/gui/main-window.cpp +++ b/gui/main-window.cpp @@ -97,7 +97,8 @@ MainWindow::MainWindow() : else set_profile(group::ini_filename()); - // only tie and connect main screen options after migrations are done. + // only tie and connect main screen options after migrations are done + // below is fine, set_profile() is called already // dylibs { @@ -363,10 +364,21 @@ void MainWindow::refresh_config_list(bool warn) ui.iconcomboProfile->setItemIcon(i, icon); } + { + const QString pathname = group::ini_pathname(); + + if (!QFile(pathname).exists()) + { + QFile file(pathname); + (void) file.open(QFile::ReadWrite); + } + } + ui.iconcomboProfile->setCurrentText(current); } set_title(); + if (warn) warn_on_config_not_writable(); } @@ -374,11 +386,11 @@ void MainWindow::refresh_config_list(bool warn) void MainWindow::updateButtonState(bool running, bool inertialp) { bool not_running = !running; - ui.iconcomboProfile->setEnabled ( not_running ); - ui.btnStartTracker->setEnabled ( not_running ); - ui.btnStopTracker->setEnabled ( running ); - ui.iconcomboProtocol->setEnabled ( not_running ); - ui.iconcomboFilter->setEnabled ( not_running ); + ui.iconcomboProfile->setEnabled(not_running); + ui.btnStartTracker->setEnabled(not_running); + ui.btnStopTracker->setEnabled(running); + ui.iconcomboProtocol->setEnabled(not_running); + ui.iconcomboFilter->setEnabled(not_running); ui.iconcomboTrackerSource->setEnabled(not_running); ui.profile_button->setEnabled(not_running); ui.video_frame_label->setVisible(not_running || inertialp); |