Refresh killswitch mode when it toggled
This commit is contained in:
parent
1fa96a09a0
commit
7a3520cb20
8 changed files with 28 additions and 4 deletions
|
|
@ -43,15 +43,24 @@ bool KillSwitch::init()
|
|||
MacOSFirewall::install();
|
||||
}
|
||||
#endif
|
||||
m_appSettigns = QSharedPointer<SecureQSettings>(new SecureQSettings(ORGANIZATION_NAME, APPLICATION_NAME, nullptr));
|
||||
if (isStrictKillSwitchEnabled()) {
|
||||
return disableAllTraffic();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool KillSwitch::refresh()
|
||||
{
|
||||
if (isStrictKillSwitchEnabled()) {
|
||||
return disableAllTraffic();
|
||||
} else {
|
||||
return disableKillSwitch();
|
||||
}
|
||||
}
|
||||
|
||||
bool KillSwitch::isStrictKillSwitchEnabled()
|
||||
{
|
||||
m_appSettigns = QSharedPointer<SecureQSettings>(new SecureQSettings(ORGANIZATION_NAME, APPLICATION_NAME, nullptr));
|
||||
return m_appSettigns->value("Conf/strictKillSwitchEnabled", false).toBool();
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +107,6 @@ bool KillSwitch::disableKillSwitch() {
|
|||
#endif
|
||||
|
||||
return true;
|
||||
|
||||
}
|
||||
|
||||
bool KillSwitch::disableAllTraffic() {
|
||||
|
|
|
|||
|
|
@ -12,6 +12,7 @@ class KillSwitch : public QObject
|
|||
public:
|
||||
static KillSwitch *instance();
|
||||
bool init();
|
||||
bool refresh();
|
||||
bool disableKillSwitch();
|
||||
bool disableAllTraffic();
|
||||
bool enablePeerTraffic( const QJsonObject &configStr);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue