added killSwitch switcher (#746)
* added killSwitch switcher * KillSwitch toggle for OpenVPN and XRay * killSwitch toggle for AWG/WG protocol * Some fixes for killSwitch
This commit is contained in:
parent
477d7214c5
commit
87b738ef16
21 changed files with 144 additions and 58 deletions
|
|
@ -223,3 +223,13 @@ void SettingsController::checkIfNeedDisableLogs()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool SettingsController::isKillSwitchEnabled()
|
||||
{
|
||||
return m_settings->isKillSwitchEnabled();
|
||||
}
|
||||
|
||||
void SettingsController::toggleKillSwitch(bool enable)
|
||||
{
|
||||
m_settings->setKillSwitchEnabled(enable);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -63,6 +63,9 @@ public slots:
|
|||
|
||||
bool isCameraPresent();
|
||||
|
||||
bool isKillSwitchEnabled();
|
||||
void toggleKillSwitch(bool enable);
|
||||
|
||||
signals:
|
||||
void primaryDnsChanged();
|
||||
void secondaryDnsChanged();
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
AppSplitTunnelingModel::AppSplitTunnelingModel(std::shared_ptr<Settings> settings, QObject *parent)
|
||||
: QAbstractListModel(parent), m_settings(settings)
|
||||
{
|
||||
m_isSplitTunnelingEnabled = m_settings->getAppsSplitTunnelingEnabled();
|
||||
m_isSplitTunnelingEnabled = m_settings->isAppsSplitTunnelingEnabled();
|
||||
m_currentRouteMode = m_settings->getAppsRouteMode();
|
||||
if (m_currentRouteMode == Settings::VpnAllApps) { // for old split tunneling configs
|
||||
m_settings->setAppsRouteMode(static_cast<Settings::AppsRouteMode>(Settings::VpnAllExceptApps));
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
SitesModel::SitesModel(std::shared_ptr<Settings> settings, QObject *parent)
|
||||
: QAbstractListModel(parent), m_settings(settings)
|
||||
{
|
||||
m_isSplitTunnelingEnabled = m_settings->getSitesSplitTunnelingEnabled();
|
||||
m_isSplitTunnelingEnabled = m_settings->isSitesSplitTunnelingEnabled();
|
||||
m_currentRouteMode = m_settings->routeMode();
|
||||
if (m_currentRouteMode == Settings::VpnAllSites) { // for old split tunneling configs
|
||||
m_settings->setRouteMode(static_cast<Settings::RouteMode>(Settings::VpnOnlyForwardSites));
|
||||
|
|
|
|||
|
|
@ -149,10 +149,9 @@ PageType {
|
|||
var noButtonText = qsTr("Cancel")
|
||||
|
||||
var yesButtonFunction = function() {
|
||||
if (ServersModel.isDefaultServerCurrentlyProcessed() && ConnectionController.isConnected) {
|
||||
if (ConnectionController.isConnected) {
|
||||
PageController.showNotificationMessage(qsTr("Cannot restore backup settings during active connection"))
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
PageController.showBusyIndicator(true)
|
||||
SettingsController.restoreAppConfig(filePath)
|
||||
PageController.showBusyIndicator(false)
|
||||
|
|
|
|||
|
|
@ -130,6 +130,31 @@ PageType {
|
|||
DividerType {
|
||||
visible: root.isAppSplitTinnelingEnabled
|
||||
}
|
||||
|
||||
SwitcherType {
|
||||
Layout.fillWidth: true
|
||||
Layout.margins: 16
|
||||
|
||||
text: qsTr("KillSwitch")
|
||||
descriptionText: qsTr("Disables your internet if your encrypted VPN connection drops out for any reason.")
|
||||
|
||||
checked: SettingsController.isKillSwitchEnabled()
|
||||
checkable: !ConnectionController.isConnected
|
||||
onCheckedChanged: {
|
||||
if (checked !== SettingsController.isKillSwitchEnabled()) {
|
||||
SettingsController.toggleKillSwitch(checked)
|
||||
}
|
||||
}
|
||||
onClicked: {
|
||||
if (!checkable) {
|
||||
PageController.showNotificationMessage(qsTr("Cannot change killSwitch settings during active connection"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
DividerType {
|
||||
visible: GC.isDesktop()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue