Some Linux updates
This commit is contained in:
parent
84d95477cb
commit
8e2e3a916a
2 changed files with 20 additions and 1 deletions
|
|
@ -55,7 +55,20 @@ void VpnConnection::onBytesChanged(quint64 receivedBytes, quint64 sentBytes)
|
||||||
void VpnConnection::onKillSwitchModeChanged(bool enabled)
|
void VpnConnection::onKillSwitchModeChanged(bool enabled)
|
||||||
{
|
{
|
||||||
#ifdef AMNEZIA_DESKTOP
|
#ifdef AMNEZIA_DESKTOP
|
||||||
|
if (!m_IpcClient) {
|
||||||
|
m_IpcClient = new IpcClient(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!m_IpcClient->isSocketConnected()) {
|
||||||
|
if (!IpcClient::init(m_IpcClient)) {
|
||||||
|
qWarning() << "Error occurred when init IPC client";
|
||||||
|
emit serviceIsNotReady();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (IpcClient::Interface()) {
|
if (IpcClient::Interface()) {
|
||||||
|
qDebug() << "Set KillSwitch Strict mode enabled " << enabled;
|
||||||
IpcClient::Interface()->refreshKillSwitch(enabled);
|
IpcClient::Interface()->refreshKillSwitch(enabled);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
||||||
|
|
@ -37,15 +37,18 @@ bool KillSwitch::init()
|
||||||
if (!LinuxFirewall::isInstalled()) {
|
if (!LinuxFirewall::isInstalled()) {
|
||||||
LinuxFirewall::install();
|
LinuxFirewall::install();
|
||||||
}
|
}
|
||||||
|
m_appSettigns = QSharedPointer<SecureQSettings>(new SecureQSettings(ORGANIZATION_NAME, APPLICATION_NAME, nullptr));
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_MACOS
|
#ifdef Q_OS_MACOS
|
||||||
if (!MacOSFirewall::isInstalled()) {
|
if (!MacOSFirewall::isInstalled()) {
|
||||||
MacOSFirewall::install();
|
MacOSFirewall::install();
|
||||||
}
|
}
|
||||||
|
m_appSettigns = QSharedPointer<SecureQSettings>(new SecureQSettings(ORGANIZATION_NAME, APPLICATION_NAME, nullptr));
|
||||||
#endif
|
#endif
|
||||||
if (isStrictKillSwitchEnabled()) {
|
if (isStrictKillSwitchEnabled()) {
|
||||||
return disableAllTraffic();
|
return disableAllTraffic();
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -56,6 +59,9 @@ bool KillSwitch::refresh(bool enabled)
|
||||||
+ "\\" + QString(APPLICATION_NAME), QSettings::NativeFormat);
|
+ "\\" + QString(APPLICATION_NAME), QSettings::NativeFormat);
|
||||||
RegHLM.setValue("strictKillSwitchEnabled", enabled);
|
RegHLM.setValue("strictKillSwitchEnabled", enabled);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
m_appSettigns->setValue("Conf/strictKillSwitchEnabled", enabled);
|
||||||
|
|
||||||
if (isStrictKillSwitchEnabled()) {
|
if (isStrictKillSwitchEnabled()) {
|
||||||
return disableAllTraffic();
|
return disableAllTraffic();
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -70,7 +76,7 @@ bool KillSwitch::isStrictKillSwitchEnabled()
|
||||||
+ "\\" + QString(APPLICATION_NAME), QSettings::NativeFormat);
|
+ "\\" + QString(APPLICATION_NAME), QSettings::NativeFormat);
|
||||||
return RegHLM.value("strictKillSwitchEnabled", false).toBool();
|
return RegHLM.value("strictKillSwitchEnabled", false).toBool();
|
||||||
#endif
|
#endif
|
||||||
m_appSettigns = QSharedPointer<SecureQSettings>(new SecureQSettings(ORGANIZATION_NAME, APPLICATION_NAME, nullptr));
|
m_appSettigns->sync();
|
||||||
return m_appSettigns->value("Conf/strictKillSwitchEnabled", false).toBool();
|
return m_appSettigns->value("Conf/strictKillSwitchEnabled", false).toBool();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue