summaryrefslogtreecommitdiffhomepage
path: root/gui/main-window.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:39:15 +0200
committerStanislaw Halik <sthalik@misaki.pl>2016-09-16 17:54:12 +0200
commitaf8d6f769c26d4d260d6fc430165b51aebbd0733 (patch)
tree2129d44b18bc919b339d7bfd9de9da6b3c921669 /gui/main-window.hpp
parenta781170550b4354e0f5551e0b20560d84e4108ce (diff)
gui/main-window: exit program when config not writable
Note, it opens the config in read-write mode to check if it's writable. This might present a race condition when config is saved. However, we're expecting all config saving to be done in the user interface thread. Add a check for it however.
Diffstat (limited to 'gui/main-window.hpp')
-rw-r--r--gui/main-window.hpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/gui/main-window.hpp b/gui/main-window.hpp
index 7cd94e93..b33b22fe 100644
--- a/gui/main-window.hpp
+++ b/gui/main-window.hpp
@@ -85,9 +85,10 @@ class MainWindow : public QMainWindow, private State
void ensure_tray();
void set_title(const QString& game_title = QStringLiteral(""));
static bool get_new_config_name_from_dialog(QString &ret);
- void set_profile(const QString& profile);
+ void set_profile_in_registry(const QString& profile);
void register_shortcuts();
void set_keys_enabled(bool flag);
+ bool is_config_listed(const QString& name);
void init_tray_menu();
@@ -98,7 +99,7 @@ class MainWindow : public QMainWindow, private State
private slots:
void save_modules();
void exit();
- void profile_selected(const QString& name);
+ bool set_profile(const QString& new_name);
void showTrackerSettings();
void showProtocolSettings();
@@ -112,7 +113,7 @@ private slots:
void make_empty_config();
void make_copied_config();
void open_config_directory();
- void refresh_config_list(bool warn);
+ bool refresh_config_list();
void startTracker();
void stopTracker();
@@ -128,6 +129,7 @@ public:
MainWindow();
~MainWindow();
static void set_working_directory();
- bool warn_on_config_not_writable();
+ bool maybe_die_on_config_not_writable(const QString& current, QStringList* ini_list);
+ void die_on_config_not_writable();
bool is_tray_enabled();
};