UI: OptionsPage: Add ability to disable hot keys.

This commit is contained in:
Nodir Temirkhodjaev 2018-03-15 17:04:27 +05:00
parent 74a6fa04b6
commit a582f8db34
2 changed files with 14 additions and 0 deletions

View File

@ -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"); }

View File

@ -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