diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-11 14:36:07 +0100 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2018-01-11 14:36:07 +0100 |
commit | e1d6232217120be879bb639681f61e46e2d48580 (patch) | |
tree | d186ffc3dd72de6e4703d584a41971107ca8389b /gui/process_detector.cpp | |
parent | 98ef185a5c9075720acb54ec1c2e5fec6e4ab440 (diff) |
cmake, gui, main: make user interface reusable
The work isn't complete. We need moving out all non-reusable parts away
and only keeping user interface logic in a class.
Diffstat (limited to 'gui/process_detector.cpp')
-rw-r--r-- | gui/process_detector.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/gui/process_detector.cpp b/gui/process_detector.cpp index 806f0b47..e9f58aad 100644 --- a/gui/process_detector.cpp +++ b/gui/process_detector.cpp @@ -20,35 +20,35 @@ static constexpr inline auto RECORD_SEPARATOR = QChar(char(0x1e)); // RS ^] static constexpr inline auto UNIT_SEPARATOR = QChar(char(0x1f)); // US ^_ -void settings::set_game_list(const QString &game_list) +void proc_detector_settings::set_game_list(const QString &game_list) { group::with_global_settings_object([&](QSettings& settings) { settings.setValue("executable-list", game_list); }); } -QString settings::get_game_list() +QString proc_detector_settings::get_game_list() { return group::with_global_settings_object([&](QSettings& settings) { return settings.value("executable-list").toString(); }); } -bool settings::is_enabled() +bool proc_detector_settings::is_enabled() { return group::with_global_settings_object([&](QSettings& settings) { return settings.value("executable-detector-enabled", false).toBool(); }); } -void settings::set_is_enabled(bool enabled) +void proc_detector_settings::set_is_enabled(bool enabled) { group::with_global_settings_object([&](QSettings& settings) { settings.setValue("executable-detector-enabled", enabled); }); } -QHash<QString, QString> settings::split_process_names() +QHash<QString, QString> proc_detector_settings::split_process_names() { QHash<QString, QString> ret; QString str = get_game_list(); @@ -79,7 +79,7 @@ void BrowseButton::browse() tr("Set executable name"), dir_path, tr("Executable (*.exe);;All Files (*)")); - MainWindow::set_working_directory(); + main_window::set_working_directory(); filename = QFileInfo(filename).fileName(); if (!filename.isNull()) twi->setText(filename); @@ -132,7 +132,7 @@ process_detector::process_detector(QWidget* parent) : QWidget(parent) QResizeEvent e(ui.tableWidget->size(), ui.tableWidget->size()); ui.tableWidget->resizeEvent(&e); - settings s; + proc_detector_settings s; ui.enabled->setChecked(s.is_enabled()); } @@ -173,7 +173,7 @@ bool process_detector_worker::should_stop() if (last_exe_name == "") return false; - settings s; + proc_detector_settings s; if (!s.is_enabled()) { @@ -193,7 +193,7 @@ bool process_detector_worker::should_stop() bool process_detector_worker::config_to_start(QString& str) { - settings s; + proc_detector_settings s; if (!s.is_enabled()) { last_exe_name = ""; |