mirror of
https://github.com/tnodir/fort
synced 2024-11-15 05:46:03 +00:00
UI: IniUser: Refactor HotKey::filterModes
This commit is contained in:
parent
30f520e89b
commit
8d2f12bf92
@ -479,7 +479,7 @@ void TrayIcon::setupTrayMenuFilterMode()
|
||||
const QStringList iconPaths = FirewallConf::filterModeIconPaths();
|
||||
for (const QString &name : FirewallConf::filterModeNames()) {
|
||||
const QString iconPath = iconPaths.at(index);
|
||||
const QString hotKey = HotKey::filterModeHotKeys[index];
|
||||
const QString hotKey = HotKey::filterModes[index];
|
||||
|
||||
QAction *a = addAction(m_filterModeMenu, iconPath, /*receiver=*/nullptr, /*member=*/nullptr,
|
||||
ActionNone, /*checkable=*/true);
|
||||
|
@ -1,5 +1,17 @@
|
||||
#include "iniuser.h"
|
||||
|
||||
namespace HotKey {
|
||||
|
||||
const char *const filterModes[] = {
|
||||
filterModeAutoLearn,
|
||||
filterModeAskToConnect,
|
||||
filterModeBlock,
|
||||
filterModeAllow,
|
||||
filterModeIgnore,
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
IniUser::IniUser(Settings *settings) : MapSettings(settings) { }
|
||||
|
||||
void IniUser::saveDefaultIni()
|
||||
|
@ -18,13 +18,13 @@ const char *const blockInetTraffic = "blockInetTraffic";
|
||||
const char *const appGroupModifier = "appGroupModifier";
|
||||
const char *const quit = "quit";
|
||||
|
||||
const char *const filterModeHotKeys[] = {
|
||||
"filterModeAutoLearn",
|
||||
"filterModeAskToConnect",
|
||||
"filterModeBlock",
|
||||
"filterModeAllow",
|
||||
"filterModeIgnore",
|
||||
};
|
||||
const char *const filterModeAutoLearn = "filterModeAutoLearn";
|
||||
const char *const filterModeAskToConnect = "filterModeAskToConnect";
|
||||
const char *const filterModeBlock = "filterModeBlock";
|
||||
const char *const filterModeAllow = "filterModeAllow";
|
||||
const char *const filterModeIgnore = "filterModeIgnore";
|
||||
|
||||
extern const char *const filterModes[];
|
||||
|
||||
namespace Default {
|
||||
const char *const filter = "Ctrl+Alt+Shift+F";
|
||||
|
Loading…
Reference in New Issue
Block a user