From bb4c80c3919570cbb57f757931b4e899cb65f76f Mon Sep 17 00:00:00 2001 From: Nodir Temirkhodjaev Date: Sat, 2 Sep 2017 18:48:33 +0500 Subject: [PATCH] FirewallConf.appLogBlocked is effective for UI only. --- src/common/fortconf.c | 3 ++- src/ui/FortFirewall.pro | 2 ++ src/ui/conf/firewallconf.cpp | 2 +- src/ui/conf/firewallconf.h | 3 ++- src/ui/fortsettings.cpp | 2 -- src/ui/qml/pages/ActivityPage.qml | 9 +++++++++ 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/common/fortconf.c b/src/common/fortconf.c index 4fb73a00..df303c0a 100644 --- a/src/common/fortconf.c +++ b/src/common/fortconf.c @@ -117,7 +117,8 @@ fort_conf_app_blocked (const PFORT_CONF conf, const BOOL app_perm_allowed = (app_perm & conf->app_perms_allow_mask); const BOOL app_allowed = conf->flags.app_allow_all ? TRUE : app_perm_allowed; - *notify = app_blocked && !app_perm_blocked; + *notify = app_blocked && !app_perm_blocked + && conf->flags.app_log_blocked; return app_blocked && !app_allowed; } diff --git a/src/ui/FortFirewall.pro b/src/ui/FortFirewall.pro index ce39d65c..89722a9b 100644 --- a/src/ui/FortFirewall.pro +++ b/src/ui/FortFirewall.pro @@ -40,8 +40,10 @@ HEADERS += \ QML_FILES += \ qml/*.qml \ + qml/controls/*.qml qml/pages/*.qml qml/pages/addresses/*.qml + qml/pages/apps/*.qml OTHER_FILES += \ $${QML_FILES} \ diff --git a/src/ui/conf/firewallconf.cpp b/src/ui/conf/firewallconf.cpp index 31384610..27cf04ec 100644 --- a/src/ui/conf/firewallconf.cpp +++ b/src/ui/conf/firewallconf.cpp @@ -6,7 +6,7 @@ FirewallConf::FirewallConf(QObject *parent) : QObject(parent), m_filterEnabled(true), - m_appLogBlocked(true), + m_appLogBlocked(false), m_appBlockAll(true), m_appAllowAll(false), m_ipInclude(new AddressGroup(this)), diff --git a/src/ui/conf/firewallconf.h b/src/ui/conf/firewallconf.h index 452c540b..06e7c614 100644 --- a/src/ui/conf/firewallconf.h +++ b/src/ui/conf/firewallconf.h @@ -63,7 +63,8 @@ public slots: private: uint m_filterEnabled : 1; - uint m_appLogBlocked : 1; + uint m_appLogBlocked : 1; // transient + uint m_appBlockAll : 1; uint m_appAllowAll : 1; diff --git a/src/ui/fortsettings.cpp b/src/ui/fortsettings.cpp index c3eea2c5..093c2e22 100644 --- a/src/ui/fortsettings.cpp +++ b/src/ui/fortsettings.cpp @@ -121,7 +121,6 @@ bool FortSettings::readConfFlags(FirewallConf &conf) const conf.setFilterEnabled(iniBool("filterEnabled", true)); conf.ipInclude()->setUseAll(iniBool("ipIncludeAll")); conf.ipExclude()->setUseAll(iniBool("ipExcludeAll")); - conf.setAppLogBlocked(iniBool("appLogBlocked", true)); conf.setAppBlockAll(iniBool("appBlockAll", true)); conf.setAppAllowAll(iniBool("appAllowAll")); conf.setAppGroupBits(iniUInt("appGroupBits", 0xFFFF)); @@ -136,7 +135,6 @@ bool FortSettings::writeConfFlags(const FirewallConf &conf) setIniValue("filterEnabled", conf.filterEnabled()); setIniValue("ipIncludeAll", conf.ipInclude()->useAll()); setIniValue("ipExcludeAll", conf.ipExclude()->useAll()); - setIniValue("appLogBlocked", conf.appLogBlocked()); setIniValue("appBlockAll", conf.appBlockAll()); setIniValue("appAllowAll", conf.appAllowAll()); setIniValue("appGroupBits", conf.appGroupBits()); diff --git a/src/ui/qml/pages/ActivityPage.qml b/src/ui/qml/pages/ActivityPage.qml index d5a9d4d9..9867507d 100644 --- a/src/ui/qml/pages/ActivityPage.qml +++ b/src/ui/qml/pages/ActivityPage.qml @@ -5,4 +5,13 @@ import com.fortfirewall 1.0 BasePage { + ColumnLayout { + CheckBox { + text: QT_TRANSLATE_NOOP("qml", "Enabled") + checked: firewallConf.appLogBlocked + onToggled: { + firewallConf.appLogBlocked = checked; + } + } + } }