From a582f8db342d9666244303323917cf4540a52b44 Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Thu, 15 Mar 2018 17:04:27 +0500 Subject: [PATCH] UI: OptionsPage: Add ability to disable hot keys. --- src/ui/fortsettings.h | 3 +++ src/ui/qml/pages/OptionsPage.qml | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/src/ui/fortsettings.h b/src/ui/fortsettings.h index 0f4266de..978b55c6 100644 --- a/src/ui/fortsettings.h +++ b/src/ui/fortsettings.h @@ -18,6 +18,7 @@ class FortSettings : public QObject Q_PROPERTY(bool debug READ debug WRITE setDebug NOTIFY iniChanged) Q_PROPERTY(QString language READ language WRITE setLanguage NOTIFY iniChanged) Q_PROPERTY(bool startWithWindows READ startWithWindows WRITE setStartWithWindows NOTIFY startWithWindowsChanged) + Q_PROPERTY(bool hotKeyEnabled READ hotKeyEnabled WRITE setHotKeyEnabled NOTIFY iniChanged) Q_PROPERTY(QString logsPath READ logsPath CONSTANT) Q_PROPERTY(QString profilePath READ profilePath CONSTANT) Q_PROPERTY(QString statPath READ statPath CONSTANT) @@ -55,6 +56,8 @@ public: void setQuotaMonthAlerted(qint32 v) { setIniValue("quota/monthAlerted", v); } bool hotKeyEnabled() const { return iniBool("hotKey/enabled", true); } + void setHotKeyEnabled(bool on) { setIniValue("hotKey/enabled", on, true); } + QString hotKeyOptions() const { return iniText("hotKey/options"); } QString hotKeyFilter() const { return iniText("hotKey/filter", "Ctrl+Alt+Shift+F"); } QString hotKeyStopTraffic() const { return iniText("hotKey/stopTraffic"); } diff --git a/src/ui/qml/pages/OptionsPage.qml b/src/ui/qml/pages/OptionsPage.qml index 11f827c1..24481cba 100644 --- a/src/ui/qml/pages/OptionsPage.qml +++ b/src/ui/qml/pages/OptionsPage.qml @@ -16,6 +16,7 @@ BasePage { function onSaved() { // override fortSettings.startWithWindows = cbStart.checked; + fortSettings.hotKeyEnabled = cbHotKeys.checked; } Frame { @@ -95,6 +96,16 @@ BasePage { } } + CheckBox { + id: cbHotKeys + text: translationManager.trTrigger + && qsTranslate("qml", "Hot Keys") + checked: fortSettings.hotKeyEnabled + onToggled: { + setConfFlagsEdited(); + } + } + Row { spacing: 4