mirror of
https://github.com/tnodir/fort
synced 2024-11-15 09:45:44 +00:00
UI: Fix loading app groups' enabled state
This commit is contained in:
parent
c6cb09a6d1
commit
d82394d223
@ -173,6 +173,12 @@ void FirewallConf::setAppGroupBits(quint32 groupBits)
|
||||
m_appGroupBits = groupBits;
|
||||
}
|
||||
|
||||
void FirewallConf::setupAppGroupBits(quint32 groupBits)
|
||||
{
|
||||
setAppGroupBits(groupBits);
|
||||
applyAppGroupBits();
|
||||
}
|
||||
|
||||
bool FirewallConf::appGroupWildcard() const
|
||||
{
|
||||
for (const AppGroup *appGroup : appGroups()) {
|
||||
@ -353,8 +359,7 @@ void FirewallConf::copyFlags(const FirewallConf &o)
|
||||
m_activePeriodFrom = o.activePeriodFrom();
|
||||
m_activePeriodTo = o.activePeriodTo();
|
||||
|
||||
m_appGroupBits = o.appGroupBits();
|
||||
applyAppGroupBits();
|
||||
setupAppGroupBits(o.appGroupBits());
|
||||
}
|
||||
|
||||
void FirewallConf::copy(const FirewallConf &o)
|
||||
@ -433,7 +438,7 @@ void FirewallConf::flagsFromVariant(const QVariant &v)
|
||||
m_activePeriodFrom = map["activePeriodFrom"].toString();
|
||||
m_activePeriodTo = map["activePeriodTo"].toString();
|
||||
|
||||
m_appGroupBits = map["appGroupBits"].toUInt();
|
||||
setupAppGroupBits(map["appGroupBits"].toUInt());
|
||||
}
|
||||
|
||||
QVariant FirewallConf::addressesToVariant() const
|
||||
@ -541,7 +546,6 @@ void FirewallConf::fromVariant(const QVariant &v, bool onlyFlags)
|
||||
|
||||
if (flagsEdited()) {
|
||||
flagsFromVariant(map["flags"]);
|
||||
applyAppGroupBits();
|
||||
}
|
||||
|
||||
if (iniEdited() || taskEdited()) {
|
||||
|
@ -106,6 +106,8 @@ public:
|
||||
quint32 appGroupBits() const { return m_appGroupBits; }
|
||||
void setAppGroupBits(quint32 groupBits);
|
||||
|
||||
void setupAppGroupBits(quint32 groupBits);
|
||||
|
||||
bool appGroupWildcard() const;
|
||||
|
||||
bool appGroupEnabled(int groupIndex) const;
|
||||
|
@ -334,7 +334,7 @@ void FortSettings::readConfIni(FirewallConf &conf) const
|
||||
conf.setLogAlertedBlockedIp(iniBool("logAlertedBlockedIp"));
|
||||
conf.setAppBlockAll(iniBool("appBlockAll", true));
|
||||
conf.setAppAllowAll(iniBool("appAllowAll"));
|
||||
conf.setAppGroupBits(iniUInt("appGroupBits", DEFAULT_APP_GROUP_BITS));
|
||||
conf.setupAppGroupBits(iniUInt("appGroupBits", DEFAULT_APP_GROUP_BITS));
|
||||
ini()->endGroup();
|
||||
|
||||
ini()->beginGroup("stat");
|
||||
|
Loading…
Reference in New Issue
Block a user