FirewallConf.appLogBlocked is effective for UI only.

This commit is contained in:
Nodir Temirkhodjaev 2017-09-02 18:48:33 +05:00
parent 45af8d2167
commit bb4c80c391
6 changed files with 16 additions and 5 deletions

View File

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

View File

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

View File

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

View File

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

View File

@ -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());

View File

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