refact fixes
This commit is contained in:
parent
16e887dcf0
commit
6516a84986
27 changed files with 558 additions and 561 deletions
|
|
@ -13,25 +13,25 @@ ServerContainersLogic::ServerContainersLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_progressBarProtocolsContainerReinstallValue{0},
|
m_progressBarProtocolsContainerReinstallValue{0},
|
||||||
m_progressBarProtocolsContainerReinstallMaximium{100},
|
m_progressBarProtocolsContainerReinstallMaximium{100},
|
||||||
m_pushButtonOpenvpnContInstallChecked{false},
|
m_pushButtonOpenVpnContInstallChecked{false},
|
||||||
m_pushButtonSsOpenvpnContInstallChecked{false},
|
m_pushButtonSsOpenVpnContInstallChecked{false},
|
||||||
m_pushButtonCloakOpenvpnContInstallChecked{false},
|
m_pushButtonCloakOpenVpnContInstallChecked{false},
|
||||||
m_pushButtonWireguardContInstallChecked{false},
|
m_pushButtonWireguardContInstallChecked{false},
|
||||||
m_pushButtonOpenvpnContInstallEnabled{false},
|
m_pushButtonOpenVpnContInstallEnabled{false},
|
||||||
m_pushButtonSsOpenvpnContInstallEnabled{false},
|
m_pushButtonSsOpenVpnContInstallEnabled{false},
|
||||||
m_pushButtonCloakOpenvpnContInstallEnabled{false},
|
m_pushButtonCloakOpenVpnContInstallEnabled{false},
|
||||||
m_pushButtonWireguardContInstallEnabled{false},
|
m_pushButtonWireguardContInstallEnabled{false},
|
||||||
m_pushButtonOpenvpnContDefaultChecked{false},
|
m_pushButtonOpenVpnContDefaultChecked{false},
|
||||||
m_pushButtonSsOpenvpnContDefaultChecked{false},
|
m_pushButtonSsOpenVpnContDefaultChecked{false},
|
||||||
m_pushButtonCloakOpenvpnContDefaultChecked{false},
|
m_pushButtonCloakOpenVpnContDefaultChecked{false},
|
||||||
m_pushButtonWireguardContDefaultChecked{false},
|
m_pushButtonWireguardContDefaultChecked{false},
|
||||||
m_pushButtonOpenvpnContDefaultVisible{true},
|
m_pushButtonOpenVpnContDefaultVisible{true},
|
||||||
m_pushButtonSsOpenvpnContDefaultVisible{false},
|
m_pushButtonSsOpenVpnContDefaultVisible{false},
|
||||||
m_pushButtonCloakOpenvpnContDefaultVisible{false},
|
m_pushButtonCloakOpenVpnContDefaultVisible{false},
|
||||||
m_pushButtonWireguardContDefaultVisible{false},
|
m_pushButtonWireguardContDefaultVisible{false},
|
||||||
m_pushButtonOpenvpnContShareVisible{false},
|
m_pushButtonOpenVpnContShareVisible{false},
|
||||||
m_pushButtonSsOpenvpnContShareVisible{false},
|
m_pushButtonSsOpenVpnContShareVisible{false},
|
||||||
m_pushButtonCloakOpenvpnContShareVisible{false},
|
m_pushButtonCloakOpenVpnContShareVisible{false},
|
||||||
m_pushButtonWireguardContShareVisible{false},
|
m_pushButtonWireguardContShareVisible{false},
|
||||||
m_frameOpenvpnSettingsVisible{true},
|
m_frameOpenvpnSettingsVisible{true},
|
||||||
m_frameOpenvpnSsSettingsVisible{true},
|
m_frameOpenvpnSsSettingsVisible{true},
|
||||||
|
|
@ -66,35 +66,35 @@ void ServerContainersLogic::updateServerContainersPage()
|
||||||
using SetCheckedFunc = std::function<void(bool)>;
|
using SetCheckedFunc = std::function<void(bool)>;
|
||||||
using SetEnabledFunc = std::function<void(bool)>;
|
using SetEnabledFunc = std::function<void(bool)>;
|
||||||
QList<SetCheckedFunc> installButtonsCheckedFunc {
|
QList<SetCheckedFunc> installButtonsCheckedFunc {
|
||||||
[this](bool checked) ->void {set_pushButtonOpenvpnContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonOpenVpnContInstallChecked(checked);},
|
||||||
[this](bool checked) ->void {set_pushButtonSsOpenvpnContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonSsOpenVpnContInstallChecked(checked);},
|
||||||
[this](bool checked) ->void {set_pushButtonCloakOpenvpnContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonCloakOpenVpnContInstallChecked(checked);},
|
||||||
[this](bool checked) ->void {set_pushButtonWireguardContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonWireguardContInstallChecked(checked);},
|
||||||
};
|
};
|
||||||
QList<SetEnabledFunc> installButtonsEnabledFunc {
|
QList<SetEnabledFunc> installButtonsEnabledFunc {
|
||||||
[this](bool enabled) ->void {set_pushButtonOpenvpnContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonOpenVpnContInstallEnabled(enabled);},
|
||||||
[this](bool enabled) ->void {set_pushButtonSsOpenvpnContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonSsOpenVpnContInstallEnabled(enabled);},
|
||||||
[this](bool enabled) ->void {set_pushButtonCloakOpenvpnContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonCloakOpenVpnContInstallEnabled(enabled);},
|
||||||
[this](bool enabled) ->void {set_pushButtonWireguardContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonWireguardContInstallEnabled(enabled);},
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<SetCheckedFunc> defaultButtonsCheckedFunc {
|
QList<SetCheckedFunc> defaultButtonsCheckedFunc {
|
||||||
[this](bool checked) ->void {set_pushButtonOpenvpnContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonOpenVpnContDefaultChecked(checked);},
|
||||||
[this](bool checked) ->void {set_pushButtonSsOpenvpnContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonSsOpenVpnContDefaultChecked(checked);},
|
||||||
[this](bool checked) ->void {set_pushButtonCloakOpenvpnContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonCloakOpenVpnContDefaultChecked(checked);},
|
||||||
[this](bool checked) ->void {set_pushButtonWireguardContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonWireguardContDefaultChecked(checked);},
|
||||||
};
|
};
|
||||||
QList<SetVisibleFunc> defaultButtonsVisibleFunc {
|
QList<SetVisibleFunc> defaultButtonsVisibleFunc {
|
||||||
[this](bool visible) ->void {set_pushButtonOpenvpnContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonOpenVpnContDefaultVisible(visible);},
|
||||||
[this](bool visible) ->void {set_pushButtonSsOpenvpnContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonSsOpenVpnContDefaultVisible(visible);},
|
||||||
[this](bool visible) ->void {set_pushButtonCloakOpenvpnContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonCloakOpenVpnContDefaultVisible(visible);},
|
||||||
[this](bool visible) ->void {set_pushButtonWireguardContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonWireguardContDefaultVisible(visible);},
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<SetVisibleFunc> shareButtonsVisibleFunc {
|
QList<SetVisibleFunc> shareButtonsVisibleFunc {
|
||||||
[this](bool visible) ->void {set_pushButtonOpenvpnContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonOpenVpnContShareVisible(visible);},
|
||||||
[this](bool visible) ->void {set_pushButtonSsOpenvpnContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonSsOpenVpnContShareVisible(visible);},
|
||||||
[this](bool visible) ->void {set_pushButtonCloakOpenvpnContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonCloakOpenVpnContShareVisible(visible);},
|
||||||
[this](bool visible) ->void {set_pushButtonWireguardContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonWireguardContShareVisible(visible);},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -132,9 +132,9 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
|
|
||||||
// default buttons
|
// default buttons
|
||||||
QList<ButtonClickedFunc> defaultButtonClickedSig {
|
QList<ButtonClickedFunc> defaultButtonClickedSig {
|
||||||
&ServerContainersLogic::pushButtonOpenvpnContDefaultClicked,
|
&ServerContainersLogic::pushButtonOpenVpnContDefaultClicked,
|
||||||
&ServerContainersLogic::pushButtonSsOpenvpnContDefaultClicked,
|
&ServerContainersLogic::pushButtonSsOpenVpnContDefaultClicked,
|
||||||
&ServerContainersLogic::pushButtonCloakOpenvpnContDefaultClicked,
|
&ServerContainersLogic::pushButtonCloakOpenVpnContDefaultClicked,
|
||||||
&ServerContainersLogic::pushButtonWireguardContDefaultClicked
|
&ServerContainersLogic::pushButtonWireguardContDefaultClicked
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -148,20 +148,20 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
|
|
||||||
// install buttons
|
// install buttons
|
||||||
QList<ButtonClickedFunc> installButtonsClickedSig {
|
QList<ButtonClickedFunc> installButtonsClickedSig {
|
||||||
&ServerContainersLogic::pushButtonOpenvpnContInstallClicked,
|
&ServerContainersLogic::pushButtonOpenVpnContInstallClicked,
|
||||||
&ServerContainersLogic::pushButtonSsOpenvpnContInstallClicked,
|
&ServerContainersLogic::pushButtonSsOpenVpnContInstallClicked,
|
||||||
&ServerContainersLogic::pushButtonCloakOpenvpnContInstallClicked,
|
&ServerContainersLogic::pushButtonCloakOpenVpnContInstallClicked,
|
||||||
&ServerContainersLogic::pushButtonWireguardContInstallClicked,
|
&ServerContainersLogic::pushButtonWireguardContInstallClicked,
|
||||||
};
|
};
|
||||||
QList<ButtonSetEnabledFunc> installButtonsSetEnabledFunc {
|
QList<ButtonSetEnabledFunc> installButtonsSetEnabledFunc {
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
set_pushButtonOpenvpnContInstallEnabled(enabled);
|
set_pushButtonOpenVpnContInstallEnabled(enabled);
|
||||||
},
|
},
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
set_pushButtonSsOpenvpnContInstallEnabled(enabled);
|
set_pushButtonSsOpenVpnContInstallEnabled(enabled);
|
||||||
},
|
},
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
set_pushButtonCloakOpenvpnContInstallEnabled(enabled);
|
set_pushButtonCloakOpenVpnContInstallEnabled(enabled);
|
||||||
},
|
},
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
set_pushButtonWireguardContInstallEnabled(enabled);
|
set_pushButtonWireguardContInstallEnabled(enabled);
|
||||||
|
|
@ -225,9 +225,9 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
|
|
||||||
// share buttons
|
// share buttons
|
||||||
QList<ButtonClickedFunc> shareButtonsClickedSig {
|
QList<ButtonClickedFunc> shareButtonsClickedSig {
|
||||||
&ServerContainersLogic::pushButtonOpenvpnContShareClicked,
|
&ServerContainersLogic::pushButtonOpenVpnContShareClicked,
|
||||||
&ServerContainersLogic::pushButtonSsOpenvpnContShareClicked,
|
&ServerContainersLogic::pushButtonSsOpenVpnContShareClicked,
|
||||||
&ServerContainersLogic::pushButtonCloakOpenvpnContShareClicked,
|
&ServerContainersLogic::pushButtonCloakOpenVpnContShareClicked,
|
||||||
&ServerContainersLogic::pushButtonWireguardContShareClicked,
|
&ServerContainersLogic::pushButtonWireguardContShareClicked,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -242,7 +242,7 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContOpenvpnConfigClicked()
|
void ServerContainersLogic::onPushButtonProtoCloakOpenVpnContOpenvpnConfigClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
||||||
uiLogic()->openVpnLogic()->updateOpenVpnPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn),
|
uiLogic()->openVpnLogic()->updateOpenVpnPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn),
|
||||||
|
|
@ -250,7 +250,7 @@ void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContOpenvpnConfigClicke
|
||||||
uiLogic()->goToPage(Page::OpenVpnSettings);
|
uiLogic()->goToPage(Page::OpenVpnSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContSsConfigClicked()
|
void ServerContainersLogic::onPushButtonProtoCloakOpenVpnContSsConfigClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
||||||
uiLogic()->shadowSocksLogic()->updateShadowSocksPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::ShadowSocks),
|
uiLogic()->shadowSocksLogic()->updateShadowSocksPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::ShadowSocks),
|
||||||
|
|
@ -258,7 +258,7 @@ void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContSsConfigClicked()
|
||||||
uiLogic()->goToPage(Page::ShadowSocksSettings);
|
uiLogic()->goToPage(Page::ShadowSocksSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContCloakConfigClicked()
|
void ServerContainersLogic::onPushButtonProtoCloakOpenVpnContCloakConfigClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
||||||
uiLogic()->cloakLogic()->updateCloakPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::Cloak),
|
uiLogic()->cloakLogic()->updateCloakPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::Cloak),
|
||||||
|
|
@ -266,7 +266,7 @@ void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContCloakConfigClicked(
|
||||||
uiLogic()->goToPage(Page::CloakSettings);
|
uiLogic()->goToPage(Page::CloakSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerContainersLogic::onPushButtonProtoOpenvpnContOpenvpnConfigClicked()
|
void ServerContainersLogic::onPushButtonProtoOpenVpnContOpenvpnConfigClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpn;
|
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpn;
|
||||||
uiLogic()->openVpnLogic()->updateOpenVpnPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn),
|
uiLogic()->openVpnLogic()->updateOpenVpnPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn),
|
||||||
|
|
@ -274,7 +274,7 @@ void ServerContainersLogic::onPushButtonProtoOpenvpnContOpenvpnConfigClicked()
|
||||||
uiLogic()->goToPage(Page::OpenVpnSettings);
|
uiLogic()->goToPage(Page::OpenVpnSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerContainersLogic::onPushButtonProtoSsOpenvpnContOpenvpnConfigClicked()
|
void ServerContainersLogic::onPushButtonProtoSsOpenVpnContOpenvpnConfigClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverShadowSocks;
|
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverShadowSocks;
|
||||||
uiLogic()->openVpnLogic()->updateOpenVpnPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn),
|
uiLogic()->openVpnLogic()->updateOpenVpnPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn),
|
||||||
|
|
@ -282,7 +282,7 @@ void ServerContainersLogic::onPushButtonProtoSsOpenvpnContOpenvpnConfigClicked()
|
||||||
uiLogic()->goToPage(Page::OpenVpnSettings);
|
uiLogic()->goToPage(Page::OpenVpnSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerContainersLogic::onPushButtonProtoSsOpenvpnContSsConfigClicked()
|
void ServerContainersLogic::onPushButtonProtoSsOpenVpnContSsConfigClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverShadowSocks;
|
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverShadowSocks;
|
||||||
uiLogic()->shadowSocksLogic()->updateShadowSocksPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::ShadowSocks),
|
uiLogic()->shadowSocksLogic()->updateShadowSocksPage(m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::ShadowSocks),
|
||||||
|
|
|
||||||
|
|
@ -12,25 +12,25 @@ class ServerContainersLogic : public PageLogicBase
|
||||||
AUTO_PROPERTY(int, progressBarProtocolsContainerReinstallValue)
|
AUTO_PROPERTY(int, progressBarProtocolsContainerReinstallValue)
|
||||||
AUTO_PROPERTY(int, progressBarProtocolsContainerReinstallMaximium)
|
AUTO_PROPERTY(int, progressBarProtocolsContainerReinstallMaximium)
|
||||||
|
|
||||||
AUTO_PROPERTY(bool, pushButtonOpenvpnContInstallChecked)
|
AUTO_PROPERTY(bool, pushButtonOpenVpnContInstallChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContInstallChecked)
|
AUTO_PROPERTY(bool, pushButtonSsOpenVpnContInstallChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContInstallChecked)
|
AUTO_PROPERTY(bool, pushButtonCloakOpenVpnContInstallChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonWireguardContInstallChecked)
|
AUTO_PROPERTY(bool, pushButtonWireguardContInstallChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonOpenvpnContInstallEnabled)
|
AUTO_PROPERTY(bool, pushButtonOpenVpnContInstallEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContInstallEnabled)
|
AUTO_PROPERTY(bool, pushButtonSsOpenVpnContInstallEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContInstallEnabled)
|
AUTO_PROPERTY(bool, pushButtonCloakOpenVpnContInstallEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonWireguardContInstallEnabled)
|
AUTO_PROPERTY(bool, pushButtonWireguardContInstallEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonOpenvpnContDefaultChecked)
|
AUTO_PROPERTY(bool, pushButtonOpenVpnContDefaultChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContDefaultChecked)
|
AUTO_PROPERTY(bool, pushButtonSsOpenVpnContDefaultChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContDefaultChecked)
|
AUTO_PROPERTY(bool, pushButtonCloakOpenVpnContDefaultChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonWireguardContDefaultChecked)
|
AUTO_PROPERTY(bool, pushButtonWireguardContDefaultChecked)
|
||||||
AUTO_PROPERTY(bool, pushButtonOpenvpnContDefaultVisible)
|
AUTO_PROPERTY(bool, pushButtonOpenVpnContDefaultVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContDefaultVisible)
|
AUTO_PROPERTY(bool, pushButtonSsOpenVpnContDefaultVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContDefaultVisible)
|
AUTO_PROPERTY(bool, pushButtonCloakOpenVpnContDefaultVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonWireguardContDefaultVisible)
|
AUTO_PROPERTY(bool, pushButtonWireguardContDefaultVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonOpenvpnContShareVisible)
|
AUTO_PROPERTY(bool, pushButtonOpenVpnContShareVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContShareVisible)
|
AUTO_PROPERTY(bool, pushButtonSsOpenVpnContShareVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContShareVisible)
|
AUTO_PROPERTY(bool, pushButtonCloakOpenVpnContShareVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonWireguardContShareVisible)
|
AUTO_PROPERTY(bool, pushButtonWireguardContShareVisible)
|
||||||
AUTO_PROPERTY(bool, frameOpenvpnSettingsVisible)
|
AUTO_PROPERTY(bool, frameOpenvpnSettingsVisible)
|
||||||
AUTO_PROPERTY(bool, frameOpenvpnSsSettingsVisible)
|
AUTO_PROPERTY(bool, frameOpenvpnSsSettingsVisible)
|
||||||
|
|
@ -43,12 +43,12 @@ class ServerContainersLogic : public PageLogicBase
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateServerContainersPage();
|
Q_INVOKABLE void updateServerContainersPage();
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonProtoCloakOpenvpnContOpenvpnConfigClicked();
|
Q_INVOKABLE void onPushButtonProtoCloakOpenVpnContOpenvpnConfigClicked();
|
||||||
Q_INVOKABLE void onPushButtonProtoCloakOpenvpnContSsConfigClicked();
|
Q_INVOKABLE void onPushButtonProtoCloakOpenVpnContSsConfigClicked();
|
||||||
Q_INVOKABLE void onPushButtonProtoCloakOpenvpnContCloakConfigClicked();
|
Q_INVOKABLE void onPushButtonProtoCloakOpenVpnContCloakConfigClicked();
|
||||||
Q_INVOKABLE void onPushButtonProtoOpenvpnContOpenvpnConfigClicked();
|
Q_INVOKABLE void onPushButtonProtoOpenVpnContOpenvpnConfigClicked();
|
||||||
Q_INVOKABLE void onPushButtonProtoSsOpenvpnContOpenvpnConfigClicked();
|
Q_INVOKABLE void onPushButtonProtoSsOpenVpnContOpenvpnConfigClicked();
|
||||||
Q_INVOKABLE void onPushButtonProtoSsOpenvpnContSsConfigClicked();
|
Q_INVOKABLE void onPushButtonProtoSsOpenVpnContSsConfigClicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ServerContainersLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit ServerContainersLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
@ -57,17 +57,17 @@ public:
|
||||||
void setupProtocolsPageConnections();
|
void setupProtocolsPageConnections();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void pushButtonOpenvpnContDefaultClicked(bool checked);
|
void pushButtonOpenVpnContDefaultClicked(bool checked);
|
||||||
void pushButtonSsOpenvpnContDefaultClicked(bool checked);
|
void pushButtonSsOpenVpnContDefaultClicked(bool checked);
|
||||||
void pushButtonCloakOpenvpnContDefaultClicked(bool checked);
|
void pushButtonCloakOpenVpnContDefaultClicked(bool checked);
|
||||||
void pushButtonWireguardContDefaultClicked(bool checked);
|
void pushButtonWireguardContDefaultClicked(bool checked);
|
||||||
void pushButtonOpenvpnContInstallClicked(bool checked);
|
void pushButtonOpenVpnContInstallClicked(bool checked);
|
||||||
void pushButtonSsOpenvpnContInstallClicked(bool checked);
|
void pushButtonSsOpenVpnContInstallClicked(bool checked);
|
||||||
void pushButtonCloakOpenvpnContInstallClicked(bool checked);
|
void pushButtonCloakOpenVpnContInstallClicked(bool checked);
|
||||||
void pushButtonWireguardContInstallClicked(bool checked);
|
void pushButtonWireguardContInstallClicked(bool checked);
|
||||||
void pushButtonOpenvpnContShareClicked(bool checked);
|
void pushButtonOpenVpnContShareClicked(bool checked);
|
||||||
void pushButtonSsOpenvpnContShareClicked(bool checked);
|
void pushButtonSsOpenVpnContShareClicked(bool checked);
|
||||||
void pushButtonCloakOpenvpnContShareClicked(bool checked);
|
void pushButtonCloakOpenVpnContShareClicked(bool checked);
|
||||||
void pushButtonWireguardContShareClicked(bool checked);
|
void pushButtonWireguardContShareClicked(bool checked);
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@ ServerListLogic::ServerListLogic(UiLogic *logic, QObject *parent):
|
||||||
void ServerListLogic::onServerListPushbuttonDefaultClicked(int index)
|
void ServerListLogic::onServerListPushbuttonDefaultClicked(int index)
|
||||||
{
|
{
|
||||||
m_settings.setDefaultServer(index);
|
m_settings.setDefaultServer(index);
|
||||||
updateServersListPage();
|
updatePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerListLogic::onServerListPushbuttonSettingsClicked(int index)
|
void ServerListLogic::onServerListPushbuttonSettingsClicked(int index)
|
||||||
|
|
@ -23,7 +23,7 @@ void ServerListLogic::onServerListPushbuttonSettingsClicked(int index)
|
||||||
uiLogic()->goToPage(Page::ServerSettings);
|
uiLogic()->goToPage(Page::ServerSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerListLogic::updateServersListPage()
|
void ServerListLogic::updatePage()
|
||||||
{
|
{
|
||||||
const QJsonArray &servers = m_settings.serversArray();
|
const QJsonArray &servers = m_settings.serversArray();
|
||||||
int defaultServer = m_settings.defaultServerIndex();
|
int defaultServer = m_settings.defaultServerIndex();
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class ServerListLogic : public PageLogicBase
|
||||||
READONLY_PROPERTY(QObject *, serverListModel)
|
READONLY_PROPERTY(QObject *, serverListModel)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateServersListPage();
|
Q_INVOKABLE void updatePage() override;
|
||||||
Q_INVOKABLE void onServerListPushbuttonDefaultClicked(int index);
|
Q_INVOKABLE void onServerListPushbuttonDefaultClicked(int index);
|
||||||
Q_INVOKABLE void onServerListPushbuttonSettingsClicked(int index);
|
Q_INVOKABLE void onServerListPushbuttonSettingsClicked(int index);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -11,40 +11,39 @@
|
||||||
|
|
||||||
ServerSettingsLogic::ServerSettingsLogic(UiLogic *logic, QObject *parent):
|
ServerSettingsLogic::ServerSettingsLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_pageServerSettingsEnabled{true},
|
m_labelWaitInfoVisible{true},
|
||||||
m_labelServerSettingsWaitInfoVisible{true},
|
m_pushButtonClearVisible{true},
|
||||||
m_pushButtonServerSettingsClearVisible{true},
|
m_pushButtonClearClientCacheVisible{true},
|
||||||
m_pushButtonServerSettingsClearClientCacheVisible{true},
|
m_pushButtonShareFullVisible{true},
|
||||||
m_pushButtonServerSettingsShareFullVisible{true},
|
m_pushButtonClearText{tr("Clear server from Amnezia software")},
|
||||||
m_pushButtonServerSettingsClearText{tr("Clear server from Amnezia software")},
|
m_pushButtonClearClientCacheText{tr("Clear client cached profile")}
|
||||||
m_pushButtonServerSettingsClearClientCacheText{tr("Clear client cached profile")}
|
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::updateServerSettingsPage()
|
void ServerSettingsLogic::updatePage()
|
||||||
{
|
{
|
||||||
set_labelServerSettingsWaitInfoVisible(false);
|
set_labelWaitInfoVisible(false);
|
||||||
set_labelServerSettingsWaitInfoText("");
|
set_labelWaitInfoText("");
|
||||||
set_pushButtonServerSettingsClearVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
set_pushButtonClearVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
||||||
set_pushButtonServerSettingsClearClientCacheVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
set_pushButtonClearClientCacheVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
||||||
set_pushButtonServerSettingsShareFullVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
set_pushButtonShareFullVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
||||||
QJsonObject server = m_settings.server(uiLogic()->selectedServerIndex);
|
QJsonObject server = m_settings.server(uiLogic()->selectedServerIndex);
|
||||||
QString port = server.value(config_key::port).toString();
|
QString port = server.value(config_key::port).toString();
|
||||||
set_labelServerSettingsServerText(QString("%1@%2%3%4")
|
set_labelServerText(QString("%1@%2%3%4")
|
||||||
.arg(server.value(config_key::userName).toString())
|
.arg(server.value(config_key::userName).toString())
|
||||||
.arg(server.value(config_key::hostName).toString())
|
.arg(server.value(config_key::hostName).toString())
|
||||||
.arg(port.isEmpty() ? "" : ":")
|
.arg(port.isEmpty() ? "" : ":")
|
||||||
.arg(port));
|
.arg(port));
|
||||||
set_lineEditServerSettingsDescriptionText(server.value(config_key::description).toString());
|
set_lineEditDescriptionText(server.value(config_key::description).toString());
|
||||||
QString selectedContainerName = m_settings.defaultContainerName(uiLogic()->selectedServerIndex);
|
QString selectedContainerName = m_settings.defaultContainerName(uiLogic()->selectedServerIndex);
|
||||||
set_labelServerSettingsCurrentVpnProtocolText(tr("Protocol: ") + selectedContainerName);
|
set_labelCurrentVpnProtocolText(tr("Protocol: ") + selectedContainerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsClearServer()
|
void ServerSettingsLogic::onPushButtonClearServer()
|
||||||
{
|
{
|
||||||
set_pageServerSettingsEnabled(false);
|
set_pageEnabled(false);
|
||||||
set_pushButtonServerSettingsClearText(tr("Uninstalling Amnezia software..."));
|
set_pushButtonClearText(tr("Uninstalling Amnezia software..."));
|
||||||
|
|
||||||
if (m_settings.defaultServerIndex() == uiLogic()->selectedServerIndex) {
|
if (m_settings.defaultServerIndex() == uiLogic()->selectedServerIndex) {
|
||||||
uiLogic()->vpnLogic()->onDisconnect();
|
uiLogic()->vpnLogic()->onDisconnect();
|
||||||
|
|
@ -60,18 +59,18 @@ void ServerSettingsLogic::onPushButtonServerSettingsClearServer()
|
||||||
emit uiLogic()->showConnectErrorDialog();
|
emit uiLogic()->showConnectErrorDialog();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
set_labelServerSettingsWaitInfoVisible(true);
|
set_labelWaitInfoVisible(true);
|
||||||
set_labelServerSettingsWaitInfoText(tr("Amnezia server successfully uninstalled"));
|
set_labelWaitInfoText(tr("Amnezia server successfully uninstalled"));
|
||||||
}
|
}
|
||||||
|
|
||||||
m_settings.setContainers(uiLogic()->selectedServerIndex, {});
|
m_settings.setContainers(uiLogic()->selectedServerIndex, {});
|
||||||
m_settings.setDefaultContainer(uiLogic()->selectedServerIndex, DockerContainer::None);
|
m_settings.setDefaultContainer(uiLogic()->selectedServerIndex, DockerContainer::None);
|
||||||
|
|
||||||
set_pageServerSettingsEnabled(true);
|
set_pageEnabled(true);
|
||||||
set_pushButtonServerSettingsClearText(tr("Clear server from Amnezia software"));
|
set_pushButtonClearText(tr("Clear server from Amnezia software"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsForgetServer()
|
void ServerSettingsLogic::onPushButtonForgetServer()
|
||||||
{
|
{
|
||||||
if (m_settings.defaultServerIndex() == uiLogic()->selectedServerIndex && uiLogic()->m_vpnConnection->isConnected()) {
|
if (m_settings.defaultServerIndex() == uiLogic()->selectedServerIndex && uiLogic()->m_vpnConnection->isConnected()) {
|
||||||
uiLogic()->vpnLogic()->onDisconnect();
|
uiLogic()->vpnLogic()->onDisconnect();
|
||||||
|
|
@ -92,7 +91,7 @@ void ServerSettingsLogic::onPushButtonServerSettingsForgetServer()
|
||||||
|
|
||||||
uiLogic()->selectedServerIndex = -1;
|
uiLogic()->selectedServerIndex = -1;
|
||||||
|
|
||||||
uiLogic()->serverListLogic()->updateServersListPage();
|
uiLogic()->serverListLogic()->updatePage();
|
||||||
|
|
||||||
if (m_settings.serversCount() == 0) {
|
if (m_settings.serversCount() == 0) {
|
||||||
uiLogic()->setStartPage(Page::Start);
|
uiLogic()->setStartPage(Page::Start);
|
||||||
|
|
@ -102,9 +101,9 @@ void ServerSettingsLogic::onPushButtonServerSettingsForgetServer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsClearClientCacheClicked()
|
void ServerSettingsLogic::onPushButtonClearClientCacheClicked()
|
||||||
{
|
{
|
||||||
set_pushButtonServerSettingsClearClientCacheText(tr("Cache cleared"));
|
set_pushButtonClearClientCacheText(tr("Cache cleared"));
|
||||||
|
|
||||||
const auto &containers = m_settings.containers(uiLogic()->selectedServerIndex);
|
const auto &containers = m_settings.containers(uiLogic()->selectedServerIndex);
|
||||||
for (DockerContainer container: containers.keys()) {
|
for (DockerContainer container: containers.keys()) {
|
||||||
|
|
@ -112,20 +111,20 @@ void ServerSettingsLogic::onPushButtonServerSettingsClearClientCacheClicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
set_pushButtonServerSettingsClearClientCacheText(tr("Clear client cached profile"));
|
set_pushButtonClearClientCacheText(tr("Clear client cached profile"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::onLineEditServerSettingsDescriptionEditingFinished()
|
void ServerSettingsLogic::onLineEditDescriptionEditingFinished()
|
||||||
{
|
{
|
||||||
const QString &newText = lineEditServerSettingsDescriptionText();
|
const QString &newText = lineEditDescriptionText();
|
||||||
QJsonObject server = m_settings.server(uiLogic()->selectedServerIndex);
|
QJsonObject server = m_settings.server(uiLogic()->selectedServerIndex);
|
||||||
server.insert(config_key::description, newText);
|
server.insert(config_key::description, newText);
|
||||||
m_settings.editServer(uiLogic()->selectedServerIndex, server);
|
m_settings.editServer(uiLogic()->selectedServerIndex, server);
|
||||||
uiLogic()->serverListLogic()->updateServersListPage();
|
uiLogic()->serverListLogic()->updatePage();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsShareFullClicked()
|
void ServerSettingsLogic::onPushButtonShareFullClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->shareConnectionLogic()->updateSharingPage(uiLogic()->selectedServerIndex, m_settings.serverCredentials(uiLogic()->selectedServerIndex), DockerContainer::None);
|
uiLogic()->shareConnectionLogic()->updateSharingPage(uiLogic()->selectedServerIndex, m_settings.serverCredentials(uiLogic()->selectedServerIndex), DockerContainer::None);
|
||||||
uiLogic()->goToPage(Page::ShareConnection);
|
uiLogic()->goToPage(Page::ShareConnection);
|
||||||
|
|
|
||||||
|
|
@ -9,26 +9,25 @@ class ServerSettingsLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
AUTO_PROPERTY(bool, pageServerSettingsEnabled)
|
AUTO_PROPERTY(bool, labelWaitInfoVisible)
|
||||||
AUTO_PROPERTY(bool, labelServerSettingsWaitInfoVisible)
|
AUTO_PROPERTY(QString, labelWaitInfoText)
|
||||||
AUTO_PROPERTY(QString, labelServerSettingsWaitInfoText)
|
AUTO_PROPERTY(QString, pushButtonClearText)
|
||||||
AUTO_PROPERTY(QString, pushButtonServerSettingsClearText)
|
AUTO_PROPERTY(QString, pushButtonClearClientCacheText)
|
||||||
AUTO_PROPERTY(QString, pushButtonServerSettingsClearClientCacheText)
|
AUTO_PROPERTY(bool, pushButtonClearVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonServerSettingsClearVisible)
|
AUTO_PROPERTY(bool, pushButtonClearClientCacheVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonServerSettingsClearClientCacheVisible)
|
AUTO_PROPERTY(bool, pushButtonShareFullVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonServerSettingsShareFullVisible)
|
AUTO_PROPERTY(QString, labelServerText)
|
||||||
AUTO_PROPERTY(QString, labelServerSettingsServerText)
|
AUTO_PROPERTY(QString, lineEditDescriptionText)
|
||||||
AUTO_PROPERTY(QString, lineEditServerSettingsDescriptionText)
|
AUTO_PROPERTY(QString, labelCurrentVpnProtocolText)
|
||||||
AUTO_PROPERTY(QString, labelServerSettingsCurrentVpnProtocolText)
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateServerSettingsPage();
|
Q_INVOKABLE void updatePage() override;
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonServerSettingsClearServer();
|
Q_INVOKABLE void onPushButtonClearServer();
|
||||||
Q_INVOKABLE void onPushButtonServerSettingsForgetServer();
|
Q_INVOKABLE void onPushButtonForgetServer();
|
||||||
Q_INVOKABLE void onPushButtonServerSettingsShareFullClicked();
|
Q_INVOKABLE void onPushButtonShareFullClicked();
|
||||||
Q_INVOKABLE void onPushButtonServerSettingsClearClientCacheClicked();
|
Q_INVOKABLE void onPushButtonClearClientCacheClicked();
|
||||||
Q_INVOKABLE void onLineEditServerSettingsDescriptionEditingFinished();
|
Q_INVOKABLE void onLineEditDescriptionEditingFinished();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
|
||||||
|
|
@ -22,35 +22,35 @@
|
||||||
ShareConnectionLogic::ShareConnectionLogic(UiLogic *logic, QObject *parent):
|
ShareConnectionLogic::ShareConnectionLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_pageShareAmneziaVisible{true},
|
m_pageShareAmneziaVisible{true},
|
||||||
m_pageShareOpenvpnVisible{true},
|
m_pageShareOpenVpnVisible{true},
|
||||||
m_pageShareShadowsocksVisible{true},
|
m_pageShareShadowSocksVisible{true},
|
||||||
m_pageShareCloakVisible{true},
|
m_pageShareCloakVisible{true},
|
||||||
m_pageShareFullAccessVisible{true},
|
m_pageShareFullAccessVisible{true},
|
||||||
m_textEditShareOpenvpnCodeText{},
|
m_textEditShareOpenVpnCodeText{},
|
||||||
m_pushButtonShareOpenvpnCopyEnabled{false},
|
m_pushButtonShareOpenVpnCopyEnabled{false},
|
||||||
m_pushButtonShareOpenvpnSaveEnabled{false},
|
m_pushButtonShareOpenVpnSaveEnabled{false},
|
||||||
m_toolBoxShareConnectionCurrentIndex{-1},
|
m_toolBoxShareConnectionCurrentIndex{-1},
|
||||||
m_pushButtonShareSsCopyEnabled{false},
|
m_pushButtonShareShadowSocksCopyEnabled{false},
|
||||||
m_lineEditShareSsStringText{},
|
m_lineEditShareShadowSocksStringText{},
|
||||||
m_labelShareSsQrCodeText{},
|
m_labelShareShadowSocksQrCodeText{},
|
||||||
m_labelShareSsServerText{},
|
m_labelShareShadowSocksServerText{},
|
||||||
m_labelShareSsPortText{},
|
m_labelShareShadowSocksPortText{},
|
||||||
m_labelShareSsMethodText{},
|
m_labelShareShadowSocksMethodText{},
|
||||||
m_labelShareSsPasswordText{},
|
m_labelShareShadowSocksPasswordText{},
|
||||||
m_plainTextEditShareCloakText{},
|
m_plainTextEditShareCloakText{},
|
||||||
m_pushButtonShareCloakCopyEnabled{false},
|
m_pushButtonShareCloakCopyEnabled{false},
|
||||||
m_textEditShareFullCodeText{},
|
m_textEditShareFullCodeText{},
|
||||||
m_textEditShareAmneziaCodeText{},
|
m_textEditShareAmneziaCodeText{},
|
||||||
m_pushButtonShareFullCopyText{tr("Copy")},
|
m_pushButtonShareFullCopyText{tr("Copy")},
|
||||||
m_pushButtonShareAmneziaCopyText{tr("Copy")},
|
m_pushButtonShareAmneziaCopyText{tr("Copy")},
|
||||||
m_pushButtonShareOpenvpnCopyText{tr("Copy")},
|
m_pushButtonShareOpenVpnCopyText{tr("Copy")},
|
||||||
m_pushButtonShareSsCopyText{tr("Copy")},
|
m_pushButtonShareShadowSocksCopyText{tr("Copy")},
|
||||||
m_pushButtonShareCloakCopyText{tr("Copy")},
|
m_pushButtonShareCloakCopyText{tr("Copy")},
|
||||||
m_pushButtonShareAmneziaGenerateEnabled{true},
|
m_pushButtonShareAmneziaGenerateEnabled{true},
|
||||||
m_pushButtonShareAmneziaCopyEnabled{true},
|
m_pushButtonShareAmneziaCopyEnabled{true},
|
||||||
m_pushButtonShareAmneziaGenerateText{tr("Generate config")},
|
m_pushButtonShareAmneziaGenerateText{tr("Generate config")},
|
||||||
m_pushButtonShareOpenvpnGenerateEnabled{true},
|
m_pushButtonShareOpenVpnGenerateEnabled{true},
|
||||||
m_pushButtonShareOpenvpnGenerateText{tr("Generate config")}
|
m_pushButtonShareOpenVpnGenerateText{tr("Generate config")}
|
||||||
{
|
{
|
||||||
// TODO consider move to Component.onCompleted
|
// TODO consider move to Component.onCompleted
|
||||||
updateSharingPage(uiLogic()->selectedServerIndex, m_settings.serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer);
|
updateSharingPage(uiLogic()->selectedServerIndex, m_settings.serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer);
|
||||||
|
|
@ -103,23 +103,23 @@ void ShareConnectionLogic::onPushButtonShareAmneziaSaveClicked()
|
||||||
save.commit();
|
save.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareOpenvpnCopyClicked()
|
void ShareConnectionLogic::onPushButtonShareOpenVpnCopyClicked()
|
||||||
{
|
{
|
||||||
QGuiApplication::clipboard()->setText(textEditShareOpenvpnCodeText());
|
QGuiApplication::clipboard()->setText(textEditShareOpenVpnCodeText());
|
||||||
set_pushButtonShareOpenvpnCopyText(tr("Copied"));
|
set_pushButtonShareOpenVpnCopyText(tr("Copied"));
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
set_pushButtonShareOpenvpnCopyText(tr("Copy"));
|
set_pushButtonShareOpenVpnCopyText(tr("Copy"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareSsCopyClicked()
|
void ShareConnectionLogic::onPushButtonShareShadowSocksCopyClicked()
|
||||||
{
|
{
|
||||||
QGuiApplication::clipboard()->setText(lineEditShareSsStringText());
|
QGuiApplication::clipboard()->setText(lineEditShareShadowSocksStringText());
|
||||||
set_pushButtonShareSsCopyText(tr("Copied"));
|
set_pushButtonShareShadowSocksCopyText(tr("Copied"));
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
set_pushButtonShareSsCopyText(tr("Copy"));
|
set_pushButtonShareShadowSocksCopyText(tr("Copy"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -180,12 +180,12 @@ void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
||||||
set_pushButtonShareAmneziaGenerateText(tr("Generate config"));
|
set_pushButtonShareAmneziaGenerateText(tr("Generate config"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareOpenvpnGenerateClicked()
|
void ShareConnectionLogic::onPushButtonShareOpenVpnGenerateClicked()
|
||||||
{
|
{
|
||||||
set_pushButtonShareOpenvpnGenerateEnabled(false);
|
set_pushButtonShareOpenVpnGenerateEnabled(false);
|
||||||
set_pushButtonShareOpenvpnCopyEnabled(false);
|
set_pushButtonShareOpenVpnCopyEnabled(false);
|
||||||
set_pushButtonShareOpenvpnSaveEnabled(false);
|
set_pushButtonShareOpenVpnSaveEnabled(false);
|
||||||
set_pushButtonShareOpenvpnGenerateText(tr("Generating..."));
|
set_pushButtonShareOpenVpnGenerateText(tr("Generating..."));
|
||||||
|
|
||||||
ServerCredentials credentials = m_settings.serverCredentials(uiLogic()->selectedServerIndex);
|
ServerCredentials credentials = m_settings.serverCredentials(uiLogic()->selectedServerIndex);
|
||||||
const QJsonObject &containerConfig = m_settings.containerConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer);
|
const QJsonObject &containerConfig = m_settings.containerConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer);
|
||||||
|
|
@ -194,22 +194,22 @@ void ShareConnectionLogic::onPushButtonShareOpenvpnGenerateClicked()
|
||||||
QString cfg = OpenVpnConfigurator::genOpenVpnConfig(credentials, uiLogic()->selectedDockerContainer, containerConfig, &e);
|
QString cfg = OpenVpnConfigurator::genOpenVpnConfig(credentials, uiLogic()->selectedDockerContainer, containerConfig, &e);
|
||||||
cfg = OpenVpnConfigurator::processConfigWithExportSettings(cfg);
|
cfg = OpenVpnConfigurator::processConfigWithExportSettings(cfg);
|
||||||
|
|
||||||
set_textEditShareOpenvpnCodeText(cfg);
|
set_textEditShareOpenVpnCodeText(cfg);
|
||||||
|
|
||||||
set_pushButtonShareOpenvpnGenerateEnabled(true);
|
set_pushButtonShareOpenVpnGenerateEnabled(true);
|
||||||
set_pushButtonShareOpenvpnCopyEnabled(true);
|
set_pushButtonShareOpenVpnCopyEnabled(true);
|
||||||
set_pushButtonShareOpenvpnSaveEnabled(true);
|
set_pushButtonShareOpenVpnSaveEnabled(true);
|
||||||
set_pushButtonShareOpenvpnGenerateText(tr("Generate config"));
|
set_pushButtonShareOpenVpnGenerateText(tr("Generate config"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareOpenvpnSaveClicked()
|
void ShareConnectionLogic::onPushButtonShareOpenVpnSaveClicked()
|
||||||
{
|
{
|
||||||
QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save OpenVPN config"),
|
QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save OpenVPN config"),
|
||||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.ovpn");
|
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.ovpn");
|
||||||
|
|
||||||
QSaveFile save(fileName);
|
QSaveFile save(fileName);
|
||||||
save.open(QIODevice::WriteOnly);
|
save.open(QIODevice::WriteOnly);
|
||||||
save.write(textEditShareOpenvpnCodeText().toUtf8());
|
save.write(textEditShareOpenVpnCodeText().toUtf8());
|
||||||
save.commit();
|
save.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -223,8 +223,8 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
//const QJsonObject &containerConfig = m_settings.containerConfig(serverIndex, container);
|
//const QJsonObject &containerConfig = m_settings.containerConfig(serverIndex, container);
|
||||||
|
|
||||||
set_pageShareAmneziaVisible(false);
|
set_pageShareAmneziaVisible(false);
|
||||||
set_pageShareOpenvpnVisible(false);
|
set_pageShareOpenVpnVisible(false);
|
||||||
set_pageShareShadowsocksVisible(false);
|
set_pageShareShadowSocksVisible(false);
|
||||||
set_pageShareCloakVisible(false);
|
set_pageShareCloakVisible(false);
|
||||||
set_pageShareFullAccessVisible(false);
|
set_pageShareFullAccessVisible(false);
|
||||||
|
|
||||||
|
|
@ -238,12 +238,12 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
|
|
||||||
if (container == DockerContainer::OpenVpn) {
|
if (container == DockerContainer::OpenVpn) {
|
||||||
set_pageShareAmneziaVisible(true);
|
set_pageShareAmneziaVisible(true);
|
||||||
set_pageShareOpenvpnVisible(true);
|
set_pageShareOpenVpnVisible(true);
|
||||||
|
|
||||||
QString cfg = tr("Press Generate config");
|
QString cfg = tr("Press Generate config");
|
||||||
set_textEditShareOpenvpnCodeText(cfg);
|
set_textEditShareOpenVpnCodeText(cfg);
|
||||||
set_pushButtonShareOpenvpnCopyEnabled(false);
|
set_pushButtonShareOpenVpnCopyEnabled(false);
|
||||||
set_pushButtonShareOpenvpnSaveEnabled(false);
|
set_pushButtonShareOpenVpnSaveEnabled(false);
|
||||||
|
|
||||||
set_toolBoxShareConnectionCurrentIndex(share_openvpn);
|
set_toolBoxShareConnectionCurrentIndex(share_openvpn);
|
||||||
}
|
}
|
||||||
|
|
@ -251,7 +251,7 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
if (container == DockerContainer::OpenVpnOverShadowSocks ||
|
if (container == DockerContainer::OpenVpnOverShadowSocks ||
|
||||||
container == DockerContainer::OpenVpnOverCloak) {
|
container == DockerContainer::OpenVpnOverCloak) {
|
||||||
set_pageShareAmneziaVisible(true);
|
set_pageShareAmneziaVisible(true);
|
||||||
set_pageShareShadowsocksVisible(true);
|
set_pageShareShadowSocksVisible(true);
|
||||||
|
|
||||||
QJsonObject protoConfig = m_settings.protocolConfig(serverIndex, container, Protocol::ShadowSocks);
|
QJsonObject protoConfig = m_settings.protocolConfig(serverIndex, container, Protocol::ShadowSocks);
|
||||||
QString cfg = protoConfig.value(config_key::last_config).toString();
|
QString cfg = protoConfig.value(config_key::last_config).toString();
|
||||||
|
|
@ -262,7 +262,7 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
ErrorCode e = ErrorCode::NoError;
|
ErrorCode e = ErrorCode::NoError;
|
||||||
cfg = ShadowSocksConfigurator::genShadowSocksConfig(credentials, container, containerConfig, &e);
|
cfg = ShadowSocksConfigurator::genShadowSocksConfig(credentials, container, containerConfig, &e);
|
||||||
|
|
||||||
set_pushButtonShareSsCopyEnabled(true);
|
set_pushButtonShareShadowSocksCopyEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject ssConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
QJsonObject ssConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
||||||
|
|
@ -274,15 +274,15 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
.arg(ssConfig.value("server_port").toString());
|
.arg(ssConfig.value("server_port").toString());
|
||||||
|
|
||||||
ssString = "ss://" + ssString.toUtf8().toBase64();
|
ssString = "ss://" + ssString.toUtf8().toBase64();
|
||||||
set_lineEditShareSsStringText(ssString);
|
set_lineEditShareShadowSocksStringText(ssString);
|
||||||
updateQRCodeImage(ssString, [this](const QString& labelText) ->void {
|
updateQRCodeImage(ssString, [this](const QString& labelText) ->void {
|
||||||
set_labelShareSsQrCodeText(labelText);
|
set_labelShareShadowSocksQrCodeText(labelText);
|
||||||
});
|
});
|
||||||
|
|
||||||
set_labelShareSsServerText(ssConfig.value("server").toString());
|
set_labelShareShadowSocksServerText(ssConfig.value("server").toString());
|
||||||
set_labelShareSsPortText(ssConfig.value("server_port").toString());
|
set_labelShareShadowSocksPortText(ssConfig.value("server_port").toString());
|
||||||
set_labelShareSsMethodText(ssConfig.value("method").toString());
|
set_labelShareShadowSocksMethodText(ssConfig.value("method").toString());
|
||||||
set_labelShareSsPasswordText(ssConfig.value("password").toString());
|
set_labelShareShadowSocksPasswordText(ssConfig.value("password").toString());
|
||||||
|
|
||||||
set_toolBoxShareConnectionCurrentIndex(share_shadowshock);
|
set_toolBoxShareConnectionCurrentIndex(share_shadowshock);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,47 +12,47 @@ class ShareConnectionLogic: public PageLogicBase
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AUTO_PROPERTY(bool, pageShareAmneziaVisible)
|
AUTO_PROPERTY(bool, pageShareAmneziaVisible)
|
||||||
AUTO_PROPERTY(bool, pageShareOpenvpnVisible)
|
AUTO_PROPERTY(bool, pageShareOpenVpnVisible)
|
||||||
AUTO_PROPERTY(bool, pageShareShadowsocksVisible)
|
AUTO_PROPERTY(bool, pageShareShadowSocksVisible)
|
||||||
AUTO_PROPERTY(bool, pageShareCloakVisible)
|
AUTO_PROPERTY(bool, pageShareCloakVisible)
|
||||||
AUTO_PROPERTY(bool, pageShareFullAccessVisible)
|
AUTO_PROPERTY(bool, pageShareFullAccessVisible)
|
||||||
AUTO_PROPERTY(QString, textEditShareOpenvpnCodeText)
|
AUTO_PROPERTY(QString, textEditShareOpenVpnCodeText)
|
||||||
AUTO_PROPERTY(bool, pushButtonShareOpenvpnCopyEnabled)
|
AUTO_PROPERTY(bool, pushButtonShareOpenVpnCopyEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonShareOpenvpnSaveEnabled)
|
AUTO_PROPERTY(bool, pushButtonShareOpenVpnSaveEnabled)
|
||||||
AUTO_PROPERTY(int, toolBoxShareConnectionCurrentIndex)
|
AUTO_PROPERTY(int, toolBoxShareConnectionCurrentIndex)
|
||||||
AUTO_PROPERTY(bool, pushButtonShareSsCopyEnabled)
|
AUTO_PROPERTY(bool, pushButtonShareShadowSocksCopyEnabled)
|
||||||
AUTO_PROPERTY(QString, lineEditShareSsStringText)
|
AUTO_PROPERTY(QString, lineEditShareShadowSocksStringText)
|
||||||
AUTO_PROPERTY(QString, labelShareSsQrCodeText)
|
AUTO_PROPERTY(QString, labelShareShadowSocksQrCodeText)
|
||||||
AUTO_PROPERTY(QString, labelShareSsServerText)
|
AUTO_PROPERTY(QString, labelShareShadowSocksServerText)
|
||||||
AUTO_PROPERTY(QString, labelShareSsPortText)
|
AUTO_PROPERTY(QString, labelShareShadowSocksPortText)
|
||||||
AUTO_PROPERTY(QString, labelShareSsMethodText)
|
AUTO_PROPERTY(QString, labelShareShadowSocksMethodText)
|
||||||
AUTO_PROPERTY(QString, labelShareSsPasswordText)
|
AUTO_PROPERTY(QString, labelShareShadowSocksPasswordText)
|
||||||
AUTO_PROPERTY(QString, plainTextEditShareCloakText)
|
AUTO_PROPERTY(QString, plainTextEditShareCloakText)
|
||||||
AUTO_PROPERTY(bool, pushButtonShareCloakCopyEnabled)
|
AUTO_PROPERTY(bool, pushButtonShareCloakCopyEnabled)
|
||||||
AUTO_PROPERTY(QString, textEditShareFullCodeText)
|
AUTO_PROPERTY(QString, textEditShareFullCodeText)
|
||||||
AUTO_PROPERTY(QString, textEditShareAmneziaCodeText)
|
AUTO_PROPERTY(QString, textEditShareAmneziaCodeText)
|
||||||
AUTO_PROPERTY(QString, pushButtonShareFullCopyText)
|
AUTO_PROPERTY(QString, pushButtonShareFullCopyText)
|
||||||
AUTO_PROPERTY(QString, pushButtonShareAmneziaCopyText)
|
AUTO_PROPERTY(QString, pushButtonShareAmneziaCopyText)
|
||||||
AUTO_PROPERTY(QString, pushButtonShareOpenvpnCopyText)
|
AUTO_PROPERTY(QString, pushButtonShareOpenVpnCopyText)
|
||||||
AUTO_PROPERTY(QString, pushButtonShareSsCopyText)
|
AUTO_PROPERTY(QString, pushButtonShareShadowSocksCopyText)
|
||||||
AUTO_PROPERTY(QString, pushButtonShareCloakCopyText)
|
AUTO_PROPERTY(QString, pushButtonShareCloakCopyText)
|
||||||
AUTO_PROPERTY(bool, pushButtonShareAmneziaGenerateEnabled)
|
AUTO_PROPERTY(bool, pushButtonShareAmneziaGenerateEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonShareAmneziaCopyEnabled)
|
AUTO_PROPERTY(bool, pushButtonShareAmneziaCopyEnabled)
|
||||||
AUTO_PROPERTY(QString, pushButtonShareAmneziaGenerateText)
|
AUTO_PROPERTY(QString, pushButtonShareAmneziaGenerateText)
|
||||||
AUTO_PROPERTY(bool, pushButtonShareOpenvpnGenerateEnabled)
|
AUTO_PROPERTY(bool, pushButtonShareOpenVpnGenerateEnabled)
|
||||||
AUTO_PROPERTY(QString, pushButtonShareOpenvpnGenerateText)
|
AUTO_PROPERTY(QString, pushButtonShareOpenVpnGenerateText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void onPushButtonShareFullCopyClicked();
|
Q_INVOKABLE void onPushButtonShareFullCopyClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareFullSaveClicked();
|
Q_INVOKABLE void onPushButtonShareFullSaveClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareAmneziaCopyClicked();
|
Q_INVOKABLE void onPushButtonShareAmneziaCopyClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareAmneziaSaveClicked();
|
Q_INVOKABLE void onPushButtonShareAmneziaSaveClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareOpenvpnCopyClicked();
|
Q_INVOKABLE void onPushButtonShareOpenVpnCopyClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareSsCopyClicked();
|
Q_INVOKABLE void onPushButtonShareShadowSocksCopyClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareCloakCopyClicked();
|
Q_INVOKABLE void onPushButtonShareCloakCopyClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareAmneziaGenerateClicked();
|
Q_INVOKABLE void onPushButtonShareAmneziaGenerateClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareOpenvpnGenerateClicked();
|
Q_INVOKABLE void onPushButtonShareOpenVpnGenerateClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareOpenvpnSaveClicked();
|
Q_INVOKABLE void onPushButtonShareOpenVpnSaveClicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ShareConnectionLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit ShareConnectionLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
|
||||||
|
|
@ -5,65 +5,67 @@
|
||||||
|
|
||||||
StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent):
|
StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_pushButtonNewServerConnectEnabled{true},
|
m_pushButtonConnectEnabled{true},
|
||||||
m_pushButtonNewServerConnectText{tr("Connect")},
|
m_pushButtonConnectText{tr("Connect")},
|
||||||
m_pushButtonNewServerConnectKeyChecked{false},
|
m_pushButtonConnectKeyChecked{false},
|
||||||
m_lineEditStartExistingCodeText{},
|
m_lineEditStartExistingCodeText{},
|
||||||
m_textEditNewServerSshKeyText{},
|
m_textEditSshKeyText{},
|
||||||
m_lineEditNewServerIpText{},
|
m_lineEditIpText{},
|
||||||
m_lineEditNewServerPasswordText{},
|
m_lineEditPasswordText{},
|
||||||
m_lineEditNewServerLoginText{},
|
m_lineEditLoginText{},
|
||||||
m_labelNewServerWaitInfoVisible{true},
|
m_labelWaitInfoVisible{true},
|
||||||
m_labelNewServerWaitInfoText{},
|
m_labelWaitInfoText{},
|
||||||
m_pushButtonBackFromStartVisible{true},
|
m_pushButtonBackFromStartVisible{true},
|
||||||
m_pushButtonNewServerConnectVisible{true}
|
m_pushButtonConnectVisible{true}
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartPageLogic::updateStartPage()
|
void StartPageLogic::updatePage()
|
||||||
{
|
{
|
||||||
set_lineEditStartExistingCodeText("");
|
set_lineEditStartExistingCodeText("");
|
||||||
set_textEditNewServerSshKeyText("");
|
set_textEditSshKeyText("");
|
||||||
set_lineEditNewServerIpText("");
|
set_lineEditIpText("");
|
||||||
set_lineEditNewServerPasswordText("");
|
set_lineEditPasswordText("");
|
||||||
set_textEditNewServerSshKeyText("");
|
set_textEditSshKeyText("");
|
||||||
set_lineEditNewServerLoginText("");
|
set_lineEditLoginText("");
|
||||||
|
|
||||||
set_labelNewServerWaitInfoVisible(false);
|
set_labelWaitInfoVisible(false);
|
||||||
set_labelNewServerWaitInfoText("");
|
set_labelWaitInfoText("");
|
||||||
set_pushButtonNewServerConnectVisible(true);
|
set_pushButtonConnectVisible(true);
|
||||||
|
|
||||||
|
set_pushButtonConnectKeyChecked(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartPageLogic::onPushButtonNewServerConnect()
|
void StartPageLogic::onPushButtonConnect()
|
||||||
{
|
{
|
||||||
if (pushButtonNewServerConnectKeyChecked()){
|
if (pushButtonConnectKeyChecked()){
|
||||||
if (lineEditNewServerIpText().isEmpty() ||
|
if (lineEditIpText().isEmpty() ||
|
||||||
lineEditNewServerLoginText().isEmpty() ||
|
lineEditLoginText().isEmpty() ||
|
||||||
textEditNewServerSshKeyText().isEmpty() ) {
|
textEditSshKeyText().isEmpty() ) {
|
||||||
set_labelNewServerWaitInfoText(tr("Please fill in all fields"));
|
set_labelWaitInfoText(tr("Please fill in all fields"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (lineEditNewServerIpText().isEmpty() ||
|
if (lineEditIpText().isEmpty() ||
|
||||||
lineEditNewServerLoginText().isEmpty() ||
|
lineEditLoginText().isEmpty() ||
|
||||||
lineEditNewServerPasswordText().isEmpty() ) {
|
lineEditPasswordText().isEmpty() ) {
|
||||||
set_labelNewServerWaitInfoText(tr("Please fill in all fields"));
|
set_labelWaitInfoText(tr("Please fill in all fields"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDebug() << "UiLogic::onPushButtonNewServerConnect checking new server";
|
qDebug() << "UiLogic::onPushButtonConnect checking new server";
|
||||||
|
|
||||||
ServerCredentials serverCredentials;
|
ServerCredentials serverCredentials;
|
||||||
serverCredentials.hostName = lineEditNewServerIpText();
|
serverCredentials.hostName = lineEditIpText();
|
||||||
if (serverCredentials.hostName.contains(":")) {
|
if (serverCredentials.hostName.contains(":")) {
|
||||||
serverCredentials.port = serverCredentials.hostName.split(":").at(1).toInt();
|
serverCredentials.port = serverCredentials.hostName.split(":").at(1).toInt();
|
||||||
serverCredentials.hostName = serverCredentials.hostName.split(":").at(0);
|
serverCredentials.hostName = serverCredentials.hostName.split(":").at(0);
|
||||||
}
|
}
|
||||||
serverCredentials.userName = lineEditNewServerLoginText();
|
serverCredentials.userName = lineEditLoginText();
|
||||||
if (pushButtonNewServerConnectKeyChecked()){
|
if (pushButtonConnectKeyChecked()){
|
||||||
QString key = textEditNewServerSshKeyText();
|
QString key = textEditSshKeyText();
|
||||||
if (key.startsWith("ssh-rsa")) {
|
if (key.startsWith("ssh-rsa")) {
|
||||||
emit uiLogic()->showPublicKeyWarning();
|
emit uiLogic()->showPublicKeyWarning();
|
||||||
return;
|
return;
|
||||||
|
|
@ -76,11 +78,11 @@ void StartPageLogic::onPushButtonNewServerConnect()
|
||||||
serverCredentials.password = key;
|
serverCredentials.password = key;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
serverCredentials.password = lineEditNewServerPasswordText();
|
serverCredentials.password = lineEditPasswordText();
|
||||||
}
|
}
|
||||||
|
|
||||||
set_pushButtonNewServerConnectEnabled(false);
|
set_pushButtonConnectEnabled(false);
|
||||||
set_pushButtonNewServerConnectText(tr("Connecting..."));
|
set_pushButtonConnectText(tr("Connecting..."));
|
||||||
|
|
||||||
ErrorCode e = ErrorCode::NoError;
|
ErrorCode e = ErrorCode::NoError;
|
||||||
#ifdef Q_DEBUG
|
#ifdef Q_DEBUG
|
||||||
|
|
@ -91,27 +93,27 @@ void StartPageLogic::onPushButtonNewServerConnect()
|
||||||
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
if (e) {
|
if (e) {
|
||||||
set_labelNewServerWaitInfoVisible(true);
|
set_labelWaitInfoVisible(true);
|
||||||
set_labelNewServerWaitInfoText(errorString(e));
|
set_labelWaitInfoText(errorString(e));
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (output.contains("Please login as the user")) {
|
if (output.contains("Please login as the user")) {
|
||||||
output.replace("\n", "");
|
output.replace("\n", "");
|
||||||
set_labelNewServerWaitInfoVisible(true);
|
set_labelWaitInfoVisible(true);
|
||||||
set_labelNewServerWaitInfoText(output);
|
set_labelWaitInfoText(output);
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
set_pushButtonNewServerConnectEnabled(true);
|
set_pushButtonConnectEnabled(true);
|
||||||
set_pushButtonNewServerConnectText(tr("Connect"));
|
set_pushButtonConnectText(tr("Connect"));
|
||||||
|
|
||||||
uiLogic()->installCredentials = serverCredentials;
|
uiLogic()->installCredentials = serverCredentials;
|
||||||
if (ok) uiLogic()->goToPage(Page::NewServer);
|
if (ok) uiLogic()->goToPage(Page::NewServer);
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartPageLogic::onPushButtonNewServerImport()
|
void StartPageLogic::onPushButtonImport()
|
||||||
{
|
{
|
||||||
QString s = lineEditStartExistingCodeText();
|
QString s = lineEditStartExistingCodeText();
|
||||||
s.replace("vpn://", "");
|
s.replace("vpn://", "");
|
||||||
|
|
|
||||||
|
|
@ -9,31 +9,28 @@ class StartPageLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
AUTO_PROPERTY(bool, pushButtonNewServerConnectEnabled)
|
AUTO_PROPERTY(bool, pushButtonConnectEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonNewServerConnectKeyChecked)
|
AUTO_PROPERTY(bool, pushButtonConnectKeyChecked)
|
||||||
AUTO_PROPERTY(QString, pushButtonNewServerConnectText)
|
AUTO_PROPERTY(QString, pushButtonConnectText)
|
||||||
AUTO_PROPERTY(QString, lineEditStartExistingCodeText)
|
AUTO_PROPERTY(QString, lineEditStartExistingCodeText)
|
||||||
AUTO_PROPERTY(QString, textEditNewServerSshKeyText)
|
AUTO_PROPERTY(QString, textEditSshKeyText)
|
||||||
AUTO_PROPERTY(QString, lineEditNewServerIpText)
|
AUTO_PROPERTY(QString, lineEditIpText)
|
||||||
AUTO_PROPERTY(QString, lineEditNewServerPasswordText)
|
AUTO_PROPERTY(QString, lineEditPasswordText)
|
||||||
AUTO_PROPERTY(QString, lineEditNewServerLoginText)
|
AUTO_PROPERTY(QString, lineEditLoginText)
|
||||||
AUTO_PROPERTY(bool, labelNewServerWaitInfoVisible)
|
AUTO_PROPERTY(bool, labelWaitInfoVisible)
|
||||||
AUTO_PROPERTY(QString, labelNewServerWaitInfoText)
|
AUTO_PROPERTY(QString, labelWaitInfoText)
|
||||||
AUTO_PROPERTY(bool, pushButtonBackFromStartVisible)
|
AUTO_PROPERTY(bool, pushButtonBackFromStartVisible)
|
||||||
AUTO_PROPERTY(bool, pushButtonNewServerConnectVisible)
|
AUTO_PROPERTY(bool, pushButtonConnectVisible)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateStartPage();
|
Q_INVOKABLE void updatePage() override;
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonNewServerConnect();
|
Q_INVOKABLE void onPushButtonConnect();
|
||||||
Q_INVOKABLE void onPushButtonNewServerImport();
|
Q_INVOKABLE void onPushButtonImport();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit StartPageLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit StartPageLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~StartPageLogic() = default;
|
~StartPageLogic() = default;
|
||||||
|
|
||||||
QString getPushButtonNewServerConnectText() const;
|
|
||||||
void setPushButtonNewServerConnectText(const QString &pushButtonNewServerConnectText);
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // START_PAGE_LOGIC_H
|
#endif // START_PAGE_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -3,18 +3,18 @@
|
||||||
|
|
||||||
WizardLogic::WizardLogic(UiLogic *logic, QObject *parent):
|
WizardLogic::WizardLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_radioButtonSetupWizardHighChecked{false},
|
m_radioButtonHighChecked{false},
|
||||||
m_radioButtonSetupWizardMediumChecked{true},
|
m_radioButtonMediumChecked{true},
|
||||||
m_radioButtonSetupWizardLowChecked{false},
|
m_radioButtonLowChecked{false},
|
||||||
m_lineEditSetupWizardHighWebsiteMaskingText{},
|
m_lineEditHighWebsiteMaskingText{},
|
||||||
m_checkBoxSetupWizardVpnModeChecked{false}
|
m_checkBoxVpnModeChecked{false}
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void WizardLogic::updateWizardHighPage()
|
void WizardLogic::updatePage()
|
||||||
{
|
{
|
||||||
set_lineEditSetupWizardHighWebsiteMaskingText(protocols::cloak::defaultRedirSite);
|
set_lineEditHighWebsiteMaskingText(protocols::cloak::defaultRedirSite);
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage() const
|
QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage() const
|
||||||
|
|
@ -22,7 +22,7 @@ QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage(
|
||||||
QJsonObject cloakConfig {
|
QJsonObject cloakConfig {
|
||||||
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverCloak) },
|
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverCloak) },
|
||||||
{ config_key::cloak, QJsonObject {
|
{ config_key::cloak, QJsonObject {
|
||||||
{ config_key::site, lineEditSetupWizardHighWebsiteMaskingText() }}
|
{ config_key::site, lineEditHighWebsiteMaskingText() }}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
QJsonObject ssConfig {
|
QJsonObject ssConfig {
|
||||||
|
|
@ -34,32 +34,32 @@ QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage(
|
||||||
|
|
||||||
QMap<DockerContainer, QJsonObject> containers;
|
QMap<DockerContainer, QJsonObject> containers;
|
||||||
|
|
||||||
if (radioButtonSetupWizardHighChecked()) {
|
if (radioButtonHighChecked()) {
|
||||||
containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
|
containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radioButtonSetupWizardMediumChecked()) {
|
if (radioButtonMediumChecked()) {
|
||||||
containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
|
containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (radioButtonSetupWizardLowChecked()) {
|
if (radioButtonLowChecked()) {
|
||||||
containers.insert(DockerContainer::OpenVpn, openVpnConfig);
|
containers.insert(DockerContainer::OpenVpn, openVpnConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
return containers;
|
return containers;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WizardLogic::onPushButtonSetupWizardVpnModeFinishClicked()
|
void WizardLogic::onPushButtonVpnModeFinishClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->installServer(getInstallConfigsFromWizardPage());
|
uiLogic()->installServer(getInstallConfigsFromWizardPage());
|
||||||
if (checkBoxSetupWizardVpnModeChecked()) {
|
if (checkBoxVpnModeChecked()) {
|
||||||
m_settings.setRouteMode(Settings::VpnOnlyForwardSites);
|
m_settings.setRouteMode(Settings::VpnOnlyForwardSites);
|
||||||
} else {
|
} else {
|
||||||
m_settings.setRouteMode(Settings::VpnAllSites);
|
m_settings.setRouteMode(Settings::VpnAllSites);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void WizardLogic::onPushButtonSetupWizardLowFinishClicked()
|
void WizardLogic::onPushButtonLowFinishClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->installServer(getInstallConfigsFromWizardPage());
|
uiLogic()->installServer(getInstallConfigsFromWizardPage());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,16 @@ class WizardLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
AUTO_PROPERTY(bool, radioButtonSetupWizardHighChecked)
|
AUTO_PROPERTY(bool, radioButtonHighChecked)
|
||||||
AUTO_PROPERTY(bool, radioButtonSetupWizardMediumChecked)
|
AUTO_PROPERTY(bool, radioButtonMediumChecked)
|
||||||
AUTO_PROPERTY(bool, radioButtonSetupWizardLowChecked)
|
AUTO_PROPERTY(bool, radioButtonLowChecked)
|
||||||
AUTO_PROPERTY(bool, checkBoxSetupWizardVpnModeChecked)
|
AUTO_PROPERTY(bool, checkBoxVpnModeChecked)
|
||||||
AUTO_PROPERTY(QString, lineEditSetupWizardHighWebsiteMaskingText)
|
AUTO_PROPERTY(QString, lineEditHighWebsiteMaskingText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateWizardHighPage();
|
Q_INVOKABLE void updatePage() override;
|
||||||
Q_INVOKABLE void onPushButtonSetupWizardVpnModeFinishClicked();
|
Q_INVOKABLE void onPushButtonVpnModeFinishClicked();
|
||||||
Q_INVOKABLE void onPushButtonSetupWizardLowFinishClicked();
|
Q_INVOKABLE void onPushButtonLowFinishClicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit WizardLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit WizardLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
|
||||||
|
|
@ -8,84 +8,84 @@ using namespace PageEnumNS;
|
||||||
|
|
||||||
OpenVpnLogic::OpenVpnLogic(UiLogic *logic, QObject *parent):
|
OpenVpnLogic::OpenVpnLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_lineEditProtoOpenvpnSubnetText{},
|
m_lineEditProtoOpenVpnSubnetText{},
|
||||||
m_radioButtonProtoOpenvpnUdpChecked{false},
|
m_radioButtonProtoOpenVpnUdpChecked{false},
|
||||||
m_checkBoxProtoOpenvpnAutoEncryptionChecked{},
|
m_checkBoxProtoOpenVpnAutoEncryptionChecked{},
|
||||||
m_comboBoxProtoOpenvpnCipherText{"AES-256-GCM"},
|
m_comboBoxProtoOpenVpnCipherText{"AES-256-GCM"},
|
||||||
m_comboBoxProtoOpenvpnHashText{"SHA512"},
|
m_comboBoxProtoOpenVpnHashText{"SHA512"},
|
||||||
m_checkBoxProtoOpenvpnBlockDnsChecked{false},
|
m_checkBoxProtoOpenVpnBlockDnsChecked{false},
|
||||||
m_lineEditProtoOpenvpnPortText{},
|
m_lineEditProtoOpenVpnPortText{},
|
||||||
m_checkBoxProtoOpenvpnTlsAuthChecked{false},
|
m_checkBoxProtoOpenVpnTlsAuthChecked{false},
|
||||||
m_widgetProtoOpenvpnEnabled{false},
|
m_widgetProtoOpenVpnEnabled{false},
|
||||||
m_pushButtonOpenvpnSaveVisible{false},
|
m_pushButtonOpenvpnSaveVisible{false},
|
||||||
m_progressBarProtoOpenvpnResetVisible{false},
|
m_progressBarProtoOpenVpnResetVisible{false},
|
||||||
m_radioButtonProtoOpenvpnUdpEnabled{false},
|
m_radioButtonProtoOpenVpnUdpEnabled{false},
|
||||||
m_radioButtonProtoOpenvpnTcpEnabled{false},
|
m_radioButtonProtoOpenVpnTcpEnabled{false},
|
||||||
m_radioButtonProtoOpenvpnTcpChecked{false},
|
m_radioButtonProtoOpenVpnTcpChecked{false},
|
||||||
m_lineEditProtoOpenvpnPortEnabled{false},
|
m_lineEditProtoOpenVpnPortEnabled{false},
|
||||||
m_comboBoxProtoOpenvpnCipherEnabled{true},
|
m_comboBoxProtoOpenVpnCipherEnabled{true},
|
||||||
m_comboBoxProtoOpenvpnHashEnabled{true},
|
m_comboBoxProtoOpenVpnHashEnabled{true},
|
||||||
m_pageProtoOpenvpnEnabled{true},
|
m_pageProtoOpenVpnEnabled{true},
|
||||||
m_labelProtoOpenvpnInfoVisible{true},
|
m_labelProtoOpenVpnInfoVisible{true},
|
||||||
m_labelProtoOpenvpnInfoText{},
|
m_labelProtoOpenVpnInfoText{},
|
||||||
m_progressBarProtoOpenvpnResetValue{0},
|
m_progressBarProtoOpenVpnResetValue{0},
|
||||||
m_progressBarProtoOpenvpnResetMaximium{100}
|
m_progressBarProtoOpenVpnResetMaximium{100}
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenVpnLogic::updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerContainer container, bool haveAuthData)
|
void OpenVpnLogic::updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerContainer container, bool haveAuthData)
|
||||||
{
|
{
|
||||||
set_widgetProtoOpenvpnEnabled(haveAuthData);
|
set_widgetProtoOpenVpnEnabled(haveAuthData);
|
||||||
set_pushButtonOpenvpnSaveVisible(haveAuthData);
|
set_pushButtonOpenvpnSaveVisible(haveAuthData);
|
||||||
set_progressBarProtoOpenvpnResetVisible(haveAuthData);
|
set_progressBarProtoOpenVpnResetVisible(haveAuthData);
|
||||||
|
|
||||||
set_radioButtonProtoOpenvpnUdpEnabled(true);
|
set_radioButtonProtoOpenVpnUdpEnabled(true);
|
||||||
set_radioButtonProtoOpenvpnTcpEnabled(true);
|
set_radioButtonProtoOpenVpnTcpEnabled(true);
|
||||||
|
|
||||||
set_lineEditProtoOpenvpnSubnetText(openvpnConfig.value(config_key::subnet_address).
|
set_lineEditProtoOpenVpnSubnetText(openvpnConfig.value(config_key::subnet_address).
|
||||||
toString(protocols::openvpn::defaultSubnetAddress));
|
toString(protocols::openvpn::defaultSubnetAddress));
|
||||||
|
|
||||||
QString trasnsport = openvpnConfig.value(config_key::transport_proto).
|
QString trasnsport = openvpnConfig.value(config_key::transport_proto).
|
||||||
toString(protocols::openvpn::defaultTransportProto);
|
toString(protocols::openvpn::defaultTransportProto);
|
||||||
|
|
||||||
set_radioButtonProtoOpenvpnUdpChecked(trasnsport == protocols::openvpn::defaultTransportProto);
|
set_radioButtonProtoOpenVpnUdpChecked(trasnsport == protocols::openvpn::defaultTransportProto);
|
||||||
set_radioButtonProtoOpenvpnTcpChecked(trasnsport != protocols::openvpn::defaultTransportProto);
|
set_radioButtonProtoOpenVpnTcpChecked(trasnsport != protocols::openvpn::defaultTransportProto);
|
||||||
|
|
||||||
set_comboBoxProtoOpenvpnCipherText(openvpnConfig.value(config_key::cipher).
|
set_comboBoxProtoOpenVpnCipherText(openvpnConfig.value(config_key::cipher).
|
||||||
toString(protocols::openvpn::defaultCipher));
|
toString(protocols::openvpn::defaultCipher));
|
||||||
|
|
||||||
set_comboBoxProtoOpenvpnHashText(openvpnConfig.value(config_key::hash).
|
set_comboBoxProtoOpenVpnHashText(openvpnConfig.value(config_key::hash).
|
||||||
toString(protocols::openvpn::defaultHash));
|
toString(protocols::openvpn::defaultHash));
|
||||||
|
|
||||||
bool blockOutsideDns = openvpnConfig.value(config_key::block_outside_dns).toBool(protocols::openvpn::defaultBlockOutsideDns);
|
bool blockOutsideDns = openvpnConfig.value(config_key::block_outside_dns).toBool(protocols::openvpn::defaultBlockOutsideDns);
|
||||||
set_checkBoxProtoOpenvpnBlockDnsChecked(blockOutsideDns);
|
set_checkBoxProtoOpenVpnBlockDnsChecked(blockOutsideDns);
|
||||||
|
|
||||||
bool isNcpDisabled = openvpnConfig.value(config_key::ncp_disable).toBool(protocols::openvpn::defaultNcpDisable);
|
bool isNcpDisabled = openvpnConfig.value(config_key::ncp_disable).toBool(protocols::openvpn::defaultNcpDisable);
|
||||||
set_checkBoxProtoOpenvpnAutoEncryptionChecked(!isNcpDisabled);
|
set_checkBoxProtoOpenVpnAutoEncryptionChecked(!isNcpDisabled);
|
||||||
|
|
||||||
bool isTlsAuth = openvpnConfig.value(config_key::tls_auth).toBool(protocols::openvpn::defaultTlsAuth);
|
bool isTlsAuth = openvpnConfig.value(config_key::tls_auth).toBool(protocols::openvpn::defaultTlsAuth);
|
||||||
set_checkBoxProtoOpenvpnTlsAuthChecked(isTlsAuth);
|
set_checkBoxProtoOpenVpnTlsAuthChecked(isTlsAuth);
|
||||||
|
|
||||||
if (container == DockerContainer::OpenVpnOverShadowSocks) {
|
if (container == DockerContainer::OpenVpnOverShadowSocks) {
|
||||||
set_radioButtonProtoOpenvpnUdpEnabled(false);
|
set_radioButtonProtoOpenVpnUdpEnabled(false);
|
||||||
set_radioButtonProtoOpenvpnTcpEnabled(false);
|
set_radioButtonProtoOpenVpnTcpEnabled(false);
|
||||||
set_radioButtonProtoOpenvpnTcpChecked(true);
|
set_radioButtonProtoOpenVpnTcpChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
set_lineEditProtoOpenvpnPortText(openvpnConfig.value(config_key::port).
|
set_lineEditProtoOpenVpnPortText(openvpnConfig.value(config_key::port).
|
||||||
toString(protocols::openvpn::defaultPort));
|
toString(protocols::openvpn::defaultPort));
|
||||||
|
|
||||||
set_lineEditProtoOpenvpnPortEnabled(container == DockerContainer::OpenVpn);
|
set_lineEditProtoOpenVpnPortEnabled(container == DockerContainer::OpenVpn);
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenVpnLogic::onCheckBoxProtoOpenvpnAutoEncryptionClicked()
|
void OpenVpnLogic::onCheckBoxProtoOpenVpnAutoEncryptionClicked()
|
||||||
{
|
{
|
||||||
set_comboBoxProtoOpenvpnCipherEnabled(!checkBoxProtoOpenvpnAutoEncryptionChecked());
|
set_comboBoxProtoOpenVpnCipherEnabled(!checkBoxProtoOpenVpnAutoEncryptionChecked());
|
||||||
set_comboBoxProtoOpenvpnHashEnabled(!checkBoxProtoOpenvpnAutoEncryptionChecked());
|
set_comboBoxProtoOpenVpnHashEnabled(!checkBoxProtoOpenVpnAutoEncryptionChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenVpnLogic::onPushButtonProtoOpenvpnSaveClicked()
|
void OpenVpnLogic::onPushButtonProtoOpenVpnSaveClicked()
|
||||||
{
|
{
|
||||||
QJsonObject protocolConfig = m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn);
|
QJsonObject protocolConfig = m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::OpenVpn);
|
||||||
protocolConfig = getOpenVpnConfigFromPage(protocolConfig);
|
protocolConfig = getOpenVpnConfigFromPage(protocolConfig);
|
||||||
|
|
@ -96,7 +96,7 @@ void OpenVpnLogic::onPushButtonProtoOpenvpnSaveClicked()
|
||||||
|
|
||||||
UiLogic::PageFunc page_proto_openvpn;
|
UiLogic::PageFunc page_proto_openvpn;
|
||||||
page_proto_openvpn.setEnabledFunc = [this] (bool enabled) -> void {
|
page_proto_openvpn.setEnabledFunc = [this] (bool enabled) -> void {
|
||||||
set_pageProtoOpenvpnEnabled(enabled);
|
set_pageProtoOpenVpnEnabled(enabled);
|
||||||
};
|
};
|
||||||
UiLogic::ButtonFunc pushButton_proto_openvpn_save;
|
UiLogic::ButtonFunc pushButton_proto_openvpn_save;
|
||||||
pushButton_proto_openvpn_save.setVisibleFunc = [this] (bool visible) ->void {
|
pushButton_proto_openvpn_save.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
|
|
@ -104,23 +104,23 @@ void OpenVpnLogic::onPushButtonProtoOpenvpnSaveClicked()
|
||||||
};
|
};
|
||||||
UiLogic::LabelFunc label_proto_openvpn_info;
|
UiLogic::LabelFunc label_proto_openvpn_info;
|
||||||
label_proto_openvpn_info.setVisibleFunc = [this] (bool visible) ->void {
|
label_proto_openvpn_info.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
set_labelProtoOpenvpnInfoVisible(visible);
|
set_labelProtoOpenVpnInfoVisible(visible);
|
||||||
};
|
};
|
||||||
label_proto_openvpn_info.setTextFunc = [this] (const QString& text) ->void {
|
label_proto_openvpn_info.setTextFunc = [this] (const QString& text) ->void {
|
||||||
set_labelProtoOpenvpnInfoText(text);
|
set_labelProtoOpenVpnInfoText(text);
|
||||||
};
|
};
|
||||||
UiLogic::ProgressFunc progressBar_proto_openvpn_reset;
|
UiLogic::ProgressFunc progressBar_proto_openvpn_reset;
|
||||||
progressBar_proto_openvpn_reset.setVisibleFunc = [this] (bool visible) ->void {
|
progressBar_proto_openvpn_reset.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
set_progressBarProtoOpenvpnResetVisible(visible);
|
set_progressBarProtoOpenVpnResetVisible(visible);
|
||||||
};
|
};
|
||||||
progressBar_proto_openvpn_reset.setValueFunc = [this] (int value) ->void {
|
progressBar_proto_openvpn_reset.setValueFunc = [this] (int value) ->void {
|
||||||
set_progressBarProtoOpenvpnResetValue(value);
|
set_progressBarProtoOpenVpnResetValue(value);
|
||||||
};
|
};
|
||||||
progressBar_proto_openvpn_reset.getValueFunc = [this] (void) -> int {
|
progressBar_proto_openvpn_reset.getValueFunc = [this] (void) -> int {
|
||||||
return progressBarProtoOpenvpnResetValue();
|
return progressBarProtoOpenVpnResetValue();
|
||||||
};
|
};
|
||||||
progressBar_proto_openvpn_reset.getMaximiumFunc = [this] (void) -> int {
|
progressBar_proto_openvpn_reset.getMaximiumFunc = [this] (void) -> int {
|
||||||
return progressBarProtoOpenvpnResetMaximium();
|
return progressBarProtoOpenVpnResetMaximium();
|
||||||
};
|
};
|
||||||
|
|
||||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
||||||
|
|
@ -138,13 +138,13 @@ void OpenVpnLogic::onPushButtonProtoOpenvpnSaveClicked()
|
||||||
|
|
||||||
QJsonObject OpenVpnLogic::getOpenVpnConfigFromPage(QJsonObject oldConfig)
|
QJsonObject OpenVpnLogic::getOpenVpnConfigFromPage(QJsonObject oldConfig)
|
||||||
{
|
{
|
||||||
oldConfig.insert(config_key::subnet_address, lineEditProtoOpenvpnSubnetText());
|
oldConfig.insert(config_key::subnet_address, lineEditProtoOpenVpnSubnetText());
|
||||||
oldConfig.insert(config_key::transport_proto, radioButtonProtoOpenvpnUdpChecked() ? protocols::UDP : protocols::TCP);
|
oldConfig.insert(config_key::transport_proto, radioButtonProtoOpenVpnUdpChecked() ? protocols::UDP : protocols::TCP);
|
||||||
oldConfig.insert(config_key::ncp_disable, ! checkBoxProtoOpenvpnAutoEncryptionChecked());
|
oldConfig.insert(config_key::ncp_disable, ! checkBoxProtoOpenVpnAutoEncryptionChecked());
|
||||||
oldConfig.insert(config_key::cipher, comboBoxProtoOpenvpnCipherText());
|
oldConfig.insert(config_key::cipher, comboBoxProtoOpenVpnCipherText());
|
||||||
oldConfig.insert(config_key::hash, comboBoxProtoOpenvpnHashText());
|
oldConfig.insert(config_key::hash, comboBoxProtoOpenVpnHashText());
|
||||||
oldConfig.insert(config_key::block_outside_dns, checkBoxProtoOpenvpnBlockDnsChecked());
|
oldConfig.insert(config_key::block_outside_dns, checkBoxProtoOpenVpnBlockDnsChecked());
|
||||||
oldConfig.insert(config_key::port, lineEditProtoOpenvpnPortText());
|
oldConfig.insert(config_key::port, lineEditProtoOpenVpnPortText());
|
||||||
oldConfig.insert(config_key::tls_auth, checkBoxProtoOpenvpnTlsAuthChecked());
|
oldConfig.insert(config_key::tls_auth, checkBoxProtoOpenVpnTlsAuthChecked());
|
||||||
return oldConfig;
|
return oldConfig;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,34 +9,34 @@ class OpenVpnLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
AUTO_PROPERTY(QString, lineEditProtoOpenvpnSubnetText)
|
AUTO_PROPERTY(QString, lineEditProtoOpenVpnSubnetText)
|
||||||
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnUdpChecked)
|
AUTO_PROPERTY(bool, radioButtonProtoOpenVpnUdpChecked)
|
||||||
AUTO_PROPERTY(bool, checkBoxProtoOpenvpnAutoEncryptionChecked)
|
AUTO_PROPERTY(bool, checkBoxProtoOpenVpnAutoEncryptionChecked)
|
||||||
AUTO_PROPERTY(QString, comboBoxProtoOpenvpnCipherText)
|
AUTO_PROPERTY(QString, comboBoxProtoOpenVpnCipherText)
|
||||||
AUTO_PROPERTY(QString, comboBoxProtoOpenvpnHashText)
|
AUTO_PROPERTY(QString, comboBoxProtoOpenVpnHashText)
|
||||||
AUTO_PROPERTY(bool, checkBoxProtoOpenvpnBlockDnsChecked)
|
AUTO_PROPERTY(bool, checkBoxProtoOpenVpnBlockDnsChecked)
|
||||||
AUTO_PROPERTY(QString, lineEditProtoOpenvpnPortText)
|
AUTO_PROPERTY(QString, lineEditProtoOpenVpnPortText)
|
||||||
AUTO_PROPERTY(bool, checkBoxProtoOpenvpnTlsAuthChecked)
|
AUTO_PROPERTY(bool, checkBoxProtoOpenVpnTlsAuthChecked)
|
||||||
|
|
||||||
AUTO_PROPERTY(bool, widgetProtoOpenvpnEnabled)
|
AUTO_PROPERTY(bool, widgetProtoOpenVpnEnabled)
|
||||||
AUTO_PROPERTY(bool, pushButtonOpenvpnSaveVisible)
|
AUTO_PROPERTY(bool, pushButtonOpenvpnSaveVisible)
|
||||||
AUTO_PROPERTY(bool, progressBarProtoOpenvpnResetVisible)
|
AUTO_PROPERTY(bool, progressBarProtoOpenVpnResetVisible)
|
||||||
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnUdpEnabled)
|
AUTO_PROPERTY(bool, radioButtonProtoOpenVpnUdpEnabled)
|
||||||
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnTcpEnabled)
|
AUTO_PROPERTY(bool, radioButtonProtoOpenVpnTcpEnabled)
|
||||||
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnTcpChecked)
|
AUTO_PROPERTY(bool, radioButtonProtoOpenVpnTcpChecked)
|
||||||
AUTO_PROPERTY(bool, lineEditProtoOpenvpnPortEnabled)
|
AUTO_PROPERTY(bool, lineEditProtoOpenVpnPortEnabled)
|
||||||
|
|
||||||
AUTO_PROPERTY(bool, comboBoxProtoOpenvpnCipherEnabled)
|
AUTO_PROPERTY(bool, comboBoxProtoOpenVpnCipherEnabled)
|
||||||
AUTO_PROPERTY(bool, comboBoxProtoOpenvpnHashEnabled)
|
AUTO_PROPERTY(bool, comboBoxProtoOpenVpnHashEnabled)
|
||||||
AUTO_PROPERTY(bool, pageProtoOpenvpnEnabled)
|
AUTO_PROPERTY(bool, pageProtoOpenVpnEnabled)
|
||||||
AUTO_PROPERTY(bool, labelProtoOpenvpnInfoVisible)
|
AUTO_PROPERTY(bool, labelProtoOpenVpnInfoVisible)
|
||||||
AUTO_PROPERTY(QString, labelProtoOpenvpnInfoText)
|
AUTO_PROPERTY(QString, labelProtoOpenVpnInfoText)
|
||||||
AUTO_PROPERTY(int, progressBarProtoOpenvpnResetValue)
|
AUTO_PROPERTY(int, progressBarProtoOpenVpnResetValue)
|
||||||
AUTO_PROPERTY(int, progressBarProtoOpenvpnResetMaximium)
|
AUTO_PROPERTY(int, progressBarProtoOpenVpnResetMaximium)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void onCheckBoxProtoOpenvpnAutoEncryptionClicked();
|
Q_INVOKABLE void onCheckBoxProtoOpenVpnAutoEncryptionClicked();
|
||||||
Q_INVOKABLE void onPushButtonProtoOpenvpnSaveClicked();
|
Q_INVOKABLE void onPushButtonProtoOpenVpnSaveClicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit OpenVpnLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit OpenVpnLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
|
||||||
|
|
@ -8,45 +8,45 @@ using namespace PageEnumNS;
|
||||||
|
|
||||||
ShadowSocksLogic::ShadowSocksLogic(UiLogic *logic, QObject *parent):
|
ShadowSocksLogic::ShadowSocksLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_widgetProtoSsEnabled{false},
|
m_widgetProtoShadowSocksEnabled{false},
|
||||||
m_comboBoxProtoShadowsocksCipherText{"chacha20-poly1305"},
|
m_comboBoxProtoShadowSocksCipherText{"chacha20-poly1305"},
|
||||||
m_lineEditProtoShadowsocksPortText{},
|
m_lineEditProtoShadowSocksPortText{},
|
||||||
m_pushButtonShadowsocksSaveVisible{false},
|
m_pushButtonShadowSocksSaveVisible{false},
|
||||||
m_progressBarProtoShadowsocksResetVisible{false},
|
m_progressBarProtoShadowSocksResetVisible{false},
|
||||||
m_lineEditProtoShadowsocksPortEnabled{false},
|
m_lineEditProtoShadowSocksPortEnabled{false},
|
||||||
m_pageProtoShadowsocksEnabled{true},
|
m_pageProtoShadowSocksEnabled{true},
|
||||||
m_labelProtoShadowsocksInfoVisible{true},
|
m_labelProtoShadowSocksInfoVisible{true},
|
||||||
m_labelProtoShadowsocksInfoText{},
|
m_labelProtoShadowSocksInfoText{},
|
||||||
m_progressBarProtoShadowsocksResetValue{0},
|
m_progressBarProtoShadowSocksResetValue{0},
|
||||||
m_progressBarProtoShadowsocksResetMaximium{100}
|
m_progressBarProtoShadowSocksResetMaximium{100}
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShadowSocksLogic::updateShadowSocksPage(const QJsonObject &ssConfig, DockerContainer container, bool haveAuthData)
|
void ShadowSocksLogic::updateShadowSocksPage(const QJsonObject &ssConfig, DockerContainer container, bool haveAuthData)
|
||||||
{
|
{
|
||||||
set_widgetProtoSsEnabled(haveAuthData);
|
set_widgetProtoShadowSocksEnabled(haveAuthData);
|
||||||
set_pushButtonShadowsocksSaveVisible(haveAuthData);
|
set_pushButtonShadowSocksSaveVisible(haveAuthData);
|
||||||
set_progressBarProtoShadowsocksResetVisible(haveAuthData);
|
set_progressBarProtoShadowSocksResetVisible(haveAuthData);
|
||||||
|
|
||||||
set_comboBoxProtoShadowsocksCipherText(ssConfig.value(config_key::cipher).
|
set_comboBoxProtoShadowSocksCipherText(ssConfig.value(config_key::cipher).
|
||||||
toString(protocols::shadowsocks::defaultCipher));
|
toString(protocols::shadowsocks::defaultCipher));
|
||||||
|
|
||||||
set_lineEditProtoShadowsocksPortText(ssConfig.value(config_key::port).
|
set_lineEditProtoShadowSocksPortText(ssConfig.value(config_key::port).
|
||||||
toString(protocols::shadowsocks::defaultPort));
|
toString(protocols::shadowsocks::defaultPort));
|
||||||
|
|
||||||
set_lineEditProtoShadowsocksPortEnabled(container == DockerContainer::OpenVpnOverShadowSocks);
|
set_lineEditProtoShadowSocksPortEnabled(container == DockerContainer::OpenVpnOverShadowSocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject ShadowSocksLogic::getShadowSocksConfigFromPage(QJsonObject oldConfig)
|
QJsonObject ShadowSocksLogic::getShadowSocksConfigFromPage(QJsonObject oldConfig)
|
||||||
{
|
{
|
||||||
oldConfig.insert(config_key::cipher, comboBoxProtoShadowsocksCipherText());
|
oldConfig.insert(config_key::cipher, comboBoxProtoShadowSocksCipherText());
|
||||||
oldConfig.insert(config_key::port, lineEditProtoShadowsocksPortText());
|
oldConfig.insert(config_key::port, lineEditProtoShadowSocksPortText());
|
||||||
|
|
||||||
return oldConfig;
|
return oldConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShadowSocksLogic::onPushButtonProtoShadowsocksSaveClicked()
|
void ShadowSocksLogic::onPushButtonProtoShadowSocksSaveClicked()
|
||||||
{
|
{
|
||||||
QJsonObject protocolConfig = m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::ShadowSocks);
|
QJsonObject protocolConfig = m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::ShadowSocks);
|
||||||
protocolConfig = getShadowSocksConfigFromPage(protocolConfig);
|
protocolConfig = getShadowSocksConfigFromPage(protocolConfig);
|
||||||
|
|
@ -56,31 +56,31 @@ void ShadowSocksLogic::onPushButtonProtoShadowsocksSaveClicked()
|
||||||
newContainerConfig.insert(config_key::shadowsocks, protocolConfig);
|
newContainerConfig.insert(config_key::shadowsocks, protocolConfig);
|
||||||
UiLogic::PageFunc page_proto_shadowsocks;
|
UiLogic::PageFunc page_proto_shadowsocks;
|
||||||
page_proto_shadowsocks.setEnabledFunc = [this] (bool enabled) -> void {
|
page_proto_shadowsocks.setEnabledFunc = [this] (bool enabled) -> void {
|
||||||
set_pageProtoShadowsocksEnabled(enabled);
|
set_pageProtoShadowSocksEnabled(enabled);
|
||||||
};
|
};
|
||||||
UiLogic::ButtonFunc pushButton_proto_shadowsocks_save;
|
UiLogic::ButtonFunc pushButton_proto_shadowsocks_save;
|
||||||
pushButton_proto_shadowsocks_save.setVisibleFunc = [this] (bool visible) ->void {
|
pushButton_proto_shadowsocks_save.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
set_pushButtonShadowsocksSaveVisible(visible);
|
set_pushButtonShadowSocksSaveVisible(visible);
|
||||||
};
|
};
|
||||||
UiLogic::LabelFunc label_proto_shadowsocks_info;
|
UiLogic::LabelFunc label_proto_shadowsocks_info;
|
||||||
label_proto_shadowsocks_info.setVisibleFunc = [this] (bool visible) ->void {
|
label_proto_shadowsocks_info.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
set_labelProtoShadowsocksInfoVisible(visible);
|
set_labelProtoShadowSocksInfoVisible(visible);
|
||||||
};
|
};
|
||||||
label_proto_shadowsocks_info.setTextFunc = [this] (const QString& text) ->void {
|
label_proto_shadowsocks_info.setTextFunc = [this] (const QString& text) ->void {
|
||||||
set_labelProtoShadowsocksInfoText(text);
|
set_labelProtoShadowSocksInfoText(text);
|
||||||
};
|
};
|
||||||
UiLogic::ProgressFunc progressBar_proto_shadowsocks_reset;
|
UiLogic::ProgressFunc progressBar_proto_shadowsocks_reset;
|
||||||
progressBar_proto_shadowsocks_reset.setVisibleFunc = [this] (bool visible) ->void {
|
progressBar_proto_shadowsocks_reset.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
set_progressBarProtoShadowsocksResetVisible(visible);
|
set_progressBarProtoShadowSocksResetVisible(visible);
|
||||||
};
|
};
|
||||||
progressBar_proto_shadowsocks_reset.setValueFunc = [this] (int value) ->void {
|
progressBar_proto_shadowsocks_reset.setValueFunc = [this] (int value) ->void {
|
||||||
set_progressBarProtoShadowsocksResetValue(value);
|
set_progressBarProtoShadowSocksResetValue(value);
|
||||||
};
|
};
|
||||||
progressBar_proto_shadowsocks_reset.getValueFunc = [this] (void) -> int {
|
progressBar_proto_shadowsocks_reset.getValueFunc = [this] (void) -> int {
|
||||||
return progressBarProtoShadowsocksResetValue();
|
return progressBarProtoShadowSocksResetValue();
|
||||||
};
|
};
|
||||||
progressBar_proto_shadowsocks_reset.getMaximiumFunc = [this] (void) -> int {
|
progressBar_proto_shadowsocks_reset.getMaximiumFunc = [this] (void) -> int {
|
||||||
return progressBarProtoShadowsocksResetMaximium();
|
return progressBarProtoShadowSocksResetMaximium();
|
||||||
};
|
};
|
||||||
|
|
||||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
||||||
|
|
|
||||||
|
|
@ -9,20 +9,20 @@ class ShadowSocksLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
AUTO_PROPERTY(bool, widgetProtoSsEnabled)
|
AUTO_PROPERTY(bool, widgetProtoShadowSocksEnabled)
|
||||||
AUTO_PROPERTY(QString, comboBoxProtoShadowsocksCipherText)
|
AUTO_PROPERTY(QString, comboBoxProtoShadowSocksCipherText)
|
||||||
AUTO_PROPERTY(QString, lineEditProtoShadowsocksPortText)
|
AUTO_PROPERTY(QString, lineEditProtoShadowSocksPortText)
|
||||||
AUTO_PROPERTY(bool, pushButtonShadowsocksSaveVisible)
|
AUTO_PROPERTY(bool, pushButtonShadowSocksSaveVisible)
|
||||||
AUTO_PROPERTY(bool, progressBarProtoShadowsocksResetVisible)
|
AUTO_PROPERTY(bool, progressBarProtoShadowSocksResetVisible)
|
||||||
AUTO_PROPERTY(bool, lineEditProtoShadowsocksPortEnabled)
|
AUTO_PROPERTY(bool, lineEditProtoShadowSocksPortEnabled)
|
||||||
AUTO_PROPERTY(bool, pageProtoShadowsocksEnabled)
|
AUTO_PROPERTY(bool, pageProtoShadowSocksEnabled)
|
||||||
AUTO_PROPERTY(bool, labelProtoShadowsocksInfoVisible)
|
AUTO_PROPERTY(bool, labelProtoShadowSocksInfoVisible)
|
||||||
AUTO_PROPERTY(QString, labelProtoShadowsocksInfoText)
|
AUTO_PROPERTY(QString, labelProtoShadowSocksInfoText)
|
||||||
AUTO_PROPERTY(int, progressBarProtoShadowsocksResetValue)
|
AUTO_PROPERTY(int, progressBarProtoShadowSocksResetValue)
|
||||||
AUTO_PROPERTY(int, progressBarProtoShadowsocksResetMaximium)
|
AUTO_PROPERTY(int, progressBarProtoShadowSocksResetMaximium)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void onPushButtonProtoShadowsocksSaveClicked();
|
Q_INVOKABLE void onPushButtonProtoShadowSocksSaveClicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ShadowSocksLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit ShadowSocksLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
|
||||||
|
|
@ -105,15 +105,15 @@ Item {
|
||||||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
checked: ServerContainersLogic.pushButtonCloakOpenvpnContDefaultChecked
|
checked: ServerContainersLogic.pushButtonCloakOpenVpnContDefaultChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonCloakOpenvpnContDefaultChecked = checked
|
ServerContainersLogic.pushButtonCloakOpenVpnContDefaultChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContDefaultClicked(checked)
|
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContDefaultClicked(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: ServerContainersLogic.pushButtonCloakOpenvpnContDefaultVisible
|
visible: ServerContainersLogic.pushButtonCloakOpenVpnContDefaultVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -123,9 +123,9 @@ Item {
|
||||||
icon.source: "qrc:/images/share.png"
|
icon.source: "qrc:/images/share.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
visible: ServerContainersLogic.pushButtonCloakOpenvpnContShareVisible
|
visible: ServerContainersLogic.pushButtonCloakOpenVpnContShareVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContShareClicked(false)
|
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContShareClicked(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -136,14 +136,14 @@ Item {
|
||||||
: "qrc:/images/connect_button_disconnected.png"
|
: "qrc:/images/connect_button_disconnected.png"
|
||||||
width: 36
|
width: 36
|
||||||
height: 24
|
height: 24
|
||||||
checked: ServerContainersLogic.pushButtonCloakOpenvpnContInstallChecked
|
checked: ServerContainersLogic.pushButtonCloakOpenVpnContInstallChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonCloakOpenvpnContInstallChecked = checked
|
ServerContainersLogic.pushButtonCloakOpenVpnContInstallChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContInstallClicked(checked)
|
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContInstallClicked(checked)
|
||||||
}
|
}
|
||||||
enabled: ServerContainersLogic.pushButtonCloakOpenvpnContInstallEnabled
|
enabled: ServerContainersLogic.pushButtonCloakOpenVpnContInstallEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -162,7 +162,7 @@ Item {
|
||||||
text: qsTr("OpenVPN settings")
|
text: qsTr("OpenVPN settings")
|
||||||
icon.source: "qrc:/images/settings.png"
|
icon.source: "qrc:/images/settings.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContOpenvpnConfigClicked()
|
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContOpenvpnConfigClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SettingButtonType {
|
SettingButtonType {
|
||||||
|
|
@ -173,7 +173,7 @@ Item {
|
||||||
text: qsTr("ShadowSocks settings")
|
text: qsTr("ShadowSocks settings")
|
||||||
icon.source: "qrc:/images/settings.png"
|
icon.source: "qrc:/images/settings.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContSsConfigClicked()
|
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContSsConfigClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SettingButtonType {
|
SettingButtonType {
|
||||||
|
|
@ -184,7 +184,7 @@ Item {
|
||||||
text: qsTr("Cloak settings")
|
text: qsTr("Cloak settings")
|
||||||
icon.source: "qrc:/images/settings.png"
|
icon.source: "qrc:/images/settings.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContCloakConfigClicked()
|
ServerContainersLogic.onPushButtonProtoCloakOpenVpnContCloakConfigClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -217,15 +217,15 @@ Item {
|
||||||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
checked: ServerContainersLogic.pushButtonSsOpenvpnContDefaultChecked
|
checked: ServerContainersLogic.pushButtonSsOpenVpnContDefaultChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonSsOpenvpnContDefaultChecked = checked
|
ServerContainersLogic.pushButtonSsOpenVpnContDefaultChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContDefaultClicked(checked)
|
ServerContainersLogic.onPushButtonProtoSsOpenVpnContDefaultClicked(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: ServerContainersLogic.pushButtonSsOpenvpnContDefaultVisible
|
visible: ServerContainersLogic.pushButtonSsOpenVpnContDefaultVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -235,9 +235,9 @@ Item {
|
||||||
icon.source: "qrc:/images/share.png"
|
icon.source: "qrc:/images/share.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
visible: ServerContainersLogic.pushButtonSsOpenvpnContShareVisible
|
visible: ServerContainersLogic.pushButtonSsOpenVpnContShareVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContShareClicked(false)
|
ServerContainersLogic.onPushButtonProtoSsOpenVpnContShareClicked(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -248,14 +248,14 @@ Item {
|
||||||
: "qrc:/images/connect_button_disconnected.png"
|
: "qrc:/images/connect_button_disconnected.png"
|
||||||
width: 36
|
width: 36
|
||||||
height: 24
|
height: 24
|
||||||
checked: ServerContainersLogic.pushButtonSsOpenvpnContInstallChecked
|
checked: ServerContainersLogic.pushButtonSsOpenVpnContInstallChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonSsOpenvpnContInstallChecked = checked
|
ServerContainersLogic.pushButtonSsOpenVpnContInstallChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContInstallClicked(checked)
|
ServerContainersLogic.onPushButtonProtoSsOpenVpnContInstallClicked(checked)
|
||||||
}
|
}
|
||||||
enabled: ServerContainersLogic.pushButtonSsOpenvpnContInstallEnabled
|
enabled: ServerContainersLogic.pushButtonSsOpenVpnContInstallEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -274,7 +274,7 @@ Item {
|
||||||
text: qsTr("OpenVPN settings")
|
text: qsTr("OpenVPN settings")
|
||||||
icon.source: "qrc:/images/settings.png"
|
icon.source: "qrc:/images/settings.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContOpenvpnConfigClicked()
|
ServerContainersLogic.onPushButtonProtoSsOpenVpnContOpenvpnConfigClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SettingButtonType {
|
SettingButtonType {
|
||||||
|
|
@ -285,7 +285,7 @@ Item {
|
||||||
text: qsTr("ShadowSocks settings")
|
text: qsTr("ShadowSocks settings")
|
||||||
icon.source: "qrc:/images/settings.png"
|
icon.source: "qrc:/images/settings.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContSsConfigClicked()
|
ServerContainersLogic.onPushButtonProtoSsOpenVpnContSsConfigClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -318,15 +318,15 @@ Item {
|
||||||
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
icon.source: checked ? "qrc:/images/check.png" : "qrc:/images/uncheck.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
checked: ServerContainersLogic.pushButtonOpenvpnContDefaultChecked
|
checked: ServerContainersLogic.pushButtonOpenVpnContDefaultChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonOpenvpnContDefaultChecked = checked
|
ServerContainersLogic.pushButtonOpenVpnContDefaultChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoOpenvpnContDefaultClicked(checked)
|
ServerContainersLogic.onPushButtonProtoOpenVpnContDefaultClicked(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: ServerContainersLogic.pushButtonOpenvpnContDefaultVisible
|
visible: ServerContainersLogic.pushButtonOpenVpnContDefaultVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -336,9 +336,9 @@ Item {
|
||||||
icon.source: "qrc:/images/share.png"
|
icon.source: "qrc:/images/share.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
visible: ServerContainersLogic.pushButtonOpenvpnContShareVisible
|
visible: ServerContainersLogic.pushButtonOpenVpnContShareVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoOpenvpnContShareClicked(false)
|
ServerContainersLogic.onPushButtonProtoOpenVpnContShareClicked(false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -349,14 +349,14 @@ Item {
|
||||||
: "qrc:/images/connect_button_disconnected.png"
|
: "qrc:/images/connect_button_disconnected.png"
|
||||||
width: 36
|
width: 36
|
||||||
height: 24
|
height: 24
|
||||||
checked: ServerContainersLogic.pushButtonOpenvpnContInstallChecked
|
checked: ServerContainersLogic.pushButtonOpenVpnContInstallChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonOpenvpnContInstallChecked = checked
|
ServerContainersLogic.pushButtonOpenVpnContInstallChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoOpenvpnContInstallClicked(checked)
|
ServerContainersLogic.onPushButtonProtoOpenVpnContInstallClicked(checked)
|
||||||
}
|
}
|
||||||
enabled: ServerContainersLogic.pushButtonOpenvpnContInstallEnabled
|
enabled: ServerContainersLogic.pushButtonOpenVpnContInstallEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -375,7 +375,7 @@ Item {
|
||||||
text: qsTr("OpenVPN settings")
|
text: qsTr("OpenVPN settings")
|
||||||
icon.source: "qrc:/images/settings.png"
|
icon.source: "qrc:/images/settings.png"
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoOpenvpnContOpenvpnConfigClicked()
|
ServerContainersLogic.onPushButtonProtoOpenVpnContOpenvpnConfigClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ import "../Config"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
enabled: ServerSettingsLogic.pageServerSettingsEnabled
|
enabled: ServerSettingsLogic.pageEnabled
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
id: back
|
id: back
|
||||||
|
|
@ -47,7 +47,7 @@ Item {
|
||||||
height: 31
|
height: 31
|
||||||
font.pixelSize: 20
|
font.pixelSize: 20
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: ServerSettingsLogic.labelServerSettingsCurrentVpnProtocolText
|
text: ServerSettingsLogic.labelCurrentVpnProtocolText
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
|
@ -56,25 +56,25 @@ Item {
|
||||||
height: 31
|
height: 31
|
||||||
font.pixelSize: 20
|
font.pixelSize: 20
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: ServerSettingsLogic.labelServerSettingsServerText
|
text: ServerSettingsLogic.labelServerText
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
y: 530
|
y: 530
|
||||||
width: 301
|
width: 301
|
||||||
height: 41
|
height: 41
|
||||||
text: ServerSettingsLogic.labelServerSettingsWaitInfoText
|
text: ServerSettingsLogic.labelWaitInfoText
|
||||||
visible: ServerSettingsLogic.labelServerSettingsWaitInfoVisible
|
visible: ServerSettingsLogic.labelWaitInfoVisible
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
y: 80
|
y: 80
|
||||||
width: 251
|
width: 251
|
||||||
height: 31
|
height: 31
|
||||||
text: ServerSettingsLogic.lineEditServerSettingsDescriptionText
|
text: ServerSettingsLogic.lineEditDescriptionText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
ServerSettingsLogic.lineEditServerSettingsDescriptionText = text
|
ServerSettingsLogic.lineEditDescriptionText = text
|
||||||
ServerSettingsLogic.onLineEditServerSettingsDescriptionEditingFinished()
|
ServerSettingsLogic.onLineEditDescriptionEditingFinished()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlueButtonType {
|
BlueButtonType {
|
||||||
|
|
@ -82,10 +82,10 @@ Item {
|
||||||
y: 410
|
y: 410
|
||||||
width: 300
|
width: 300
|
||||||
height: 40
|
height: 40
|
||||||
text: ServerSettingsLogic.pushButtonServerSettingsClearText
|
text: ServerSettingsLogic.pushButtonClearText
|
||||||
visible: ServerSettingsLogic.pushButtonServerSettingsClearVisible
|
visible: ServerSettingsLogic.pushButtonClearVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerSettingsLogic.onPushButtonServerSettingsClearServer()
|
ServerSettingsLogic.onPushButtonClearServer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlueButtonType {
|
BlueButtonType {
|
||||||
|
|
@ -93,10 +93,10 @@ Item {
|
||||||
y: 350
|
y: 350
|
||||||
width: 300
|
width: 300
|
||||||
height: 40
|
height: 40
|
||||||
text: ServerSettingsLogic.pushButtonServerSettingsClearClientCacheText
|
text: ServerSettingsLogic.pushButtonClearClientCacheText
|
||||||
visible: ServerSettingsLogic.pushButtonServerSettingsClearClientCacheVisible
|
visible: ServerSettingsLogic.pushButtonClearClientCacheVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerSettingsLogic.onPushButtonServerSettingsClearClientCacheClicked()
|
ServerSettingsLogic.onPushButtonClearClientCacheClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlueButtonType {
|
BlueButtonType {
|
||||||
|
|
@ -106,7 +106,7 @@ Item {
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Forget this server")
|
text: qsTr("Forget this server")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerSettingsLogic.onPushButtonServerSettingsForgetServer()
|
ServerSettingsLogic.onPushButtonForgetServer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlueButtonType {
|
BlueButtonType {
|
||||||
|
|
@ -125,9 +125,9 @@ Item {
|
||||||
width: 300
|
width: 300
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Share Server (FULL ACCESS)")
|
text: qsTr("Share Server (FULL ACCESS)")
|
||||||
visible: ServerSettingsLogic.pushButtonServerSettingsShareFullVisible
|
visible: ServerSettingsLogic.pushButtonShareFullVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerSettingsLogic.onPushButtonServerSettingsShareFullClicked()
|
ServerSettingsLogic.onPushButtonShareFullClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -89,9 +89,9 @@ Item {
|
||||||
width: 331
|
width: 331
|
||||||
height: 25
|
height: 25
|
||||||
text: qsTr("High censorship level")
|
text: qsTr("High censorship level")
|
||||||
checked: WizardLogic.radioButtonSetupWizardHighChecked
|
checked: WizardLogic.radioButtonHighChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
WizardLogic.radioButtonSetupWizardHighChecked = checked
|
WizardLogic.radioButtonHighChecked = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RadioButtonType {
|
RadioButtonType {
|
||||||
|
|
@ -101,9 +101,9 @@ Item {
|
||||||
width: 331
|
width: 331
|
||||||
height: 25
|
height: 25
|
||||||
text: qsTr("Low censorship level")
|
text: qsTr("Low censorship level")
|
||||||
checked: WizardLogic.radioButtonSetupWizardLowChecked
|
checked: WizardLogic.radioButtonLowChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
WizardLogic.radioButtonSetupWizardLowChecked = checked
|
WizardLogic.radioButtonLowChecked = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RadioButtonType {
|
RadioButtonType {
|
||||||
|
|
@ -113,9 +113,9 @@ Item {
|
||||||
width: 331
|
width: 331
|
||||||
height: 25
|
height: 25
|
||||||
text: qsTr("Medium censorship level")
|
text: qsTr("Medium censorship level")
|
||||||
checked: WizardLogic.radioButtonSetupWizardMediumChecked
|
checked: WizardLogic.radioButtonMediumChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
WizardLogic.radioButtonSetupWizardMediumChecked = checked
|
WizardLogic.radioButtonMediumChecked = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ Item {
|
||||||
y: 360
|
y: 360
|
||||||
width: 301
|
width: 301
|
||||||
height: 41
|
height: 41
|
||||||
text: WizardLogic.lineEditSetupWizardHighWebsiteMaskingText
|
text: WizardLogic.lineEditHighWebsiteMaskingText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
let _text = website_masking.text
|
let _text = website_masking.text
|
||||||
_text.replace("http://", "");
|
_text.replace("http://", "");
|
||||||
|
|
@ -72,7 +72,7 @@ Item {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
_text = _text.split("/").first();
|
_text = _text.split("/").first();
|
||||||
WizardLogic.lineEditSetupWizardHighWebsiteMaskingText = _text
|
WizardLogic.lineEditHighWebsiteMaskingText = _text
|
||||||
}
|
}
|
||||||
onAccepted: {
|
onAccepted: {
|
||||||
next_button.clicked()
|
next_button.clicked()
|
||||||
|
|
|
||||||
|
|
@ -59,7 +59,7 @@ Item {
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Start configuring")
|
text: qsTr("Start configuring")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
WizardLogic.onPushButtonSetupWizardLowFinishClicked()
|
WizardLogic.onPushButtonLowFinishClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,9 +41,9 @@ Item {
|
||||||
width: 301
|
width: 301
|
||||||
height: 71
|
height: 71
|
||||||
text: qsTr('Turn on mode "VPN for selected sites"')
|
text: qsTr('Turn on mode "VPN for selected sites"')
|
||||||
checked: WizardLogic.checkBoxSetupWizardVpnModeChecked
|
checked: WizardLogic.checkBoxVpnModeChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
WizardLogic.checkBoxSetupWizardVpnModeChecked = checked
|
WizardLogic.checkBoxVpnModeChecked = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
|
|
@ -61,7 +61,7 @@ Item {
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Start configuring")
|
text: qsTr("Start configuring")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
WizardLogic.onPushButtonSetupWizardVpnModeFinishClicked()
|
WizardLogic.onPushButtonVpnModeFinishClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -200,7 +200,7 @@ Item {
|
||||||
id: share_openvpn
|
id: share_openvpn
|
||||||
x: 0
|
x: 0
|
||||||
text: qsTr("Share for OpenVPN client")
|
text: qsTr("Share for OpenVPN client")
|
||||||
visible: ShareConnectionLogic.pageShareOpenvpnVisible
|
visible: ShareConnectionLogic.pageShareOpenVpnVisible
|
||||||
content: Component {
|
content: Component {
|
||||||
Item {
|
Item {
|
||||||
width: 360
|
width: 360
|
||||||
|
|
@ -210,10 +210,10 @@ Item {
|
||||||
y: 180
|
y: 180
|
||||||
width: 341
|
width: 341
|
||||||
height: 40
|
height: 40
|
||||||
text: ShareConnectionLogic.pushButtonShareOpenvpnCopyText
|
text: ShareConnectionLogic.pushButtonShareOpenVpnCopyText
|
||||||
enabled: ShareConnectionLogic.pushButtonShareOpenvpnCopyEnabled
|
enabled: ShareConnectionLogic.pushButtonShareOpenVpnCopyEnabled
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ShareConnectionLogic.onPushButtonShareOpenvpnCopyClicked()
|
ShareConnectionLogic.onPushButtonShareOpenVpnCopyClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ShareConnectionButtonType {
|
ShareConnectionButtonType {
|
||||||
|
|
@ -221,11 +221,11 @@ Item {
|
||||||
y: 130
|
y: 130
|
||||||
width: 341
|
width: 341
|
||||||
height: 40
|
height: 40
|
||||||
text: ShareConnectionLogic.pushButtonShareOpenvpnGenerateText
|
text: ShareConnectionLogic.pushButtonShareOpenVpnGenerateText
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ShareConnectionLogic.onPushButtonShareOpenvpnGenerateClicked()
|
ShareConnectionLogic.onPushButtonShareOpenVpnGenerateClicked()
|
||||||
}
|
}
|
||||||
enabled: ShareConnectionLogic.pushButtonShareOpenvpnGenerateEnabled
|
enabled: ShareConnectionLogic.pushButtonShareOpenVpnGenerateEnabled
|
||||||
}
|
}
|
||||||
ShareConnectionButtonType {
|
ShareConnectionButtonType {
|
||||||
x: 10
|
x: 10
|
||||||
|
|
@ -233,9 +233,9 @@ Item {
|
||||||
width: 341
|
width: 341
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Save file")
|
text: qsTr("Save file")
|
||||||
enabled: ShareConnectionLogic.pushButtonShareOpenvpnSaveEnabled
|
enabled: ShareConnectionLogic.pushButtonShareOpenVpnSaveEnabled
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ShareConnectionLogic.onPushButtonShareOpenvpnSaveClicked()
|
ShareConnectionLogic.onPushButtonShareOpenVpnSaveClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
|
|
@ -244,9 +244,9 @@ Item {
|
||||||
width: 341
|
width: 341
|
||||||
height: 100
|
height: 100
|
||||||
verticalAlignment: Text.AlignTop
|
verticalAlignment: Text.AlignTop
|
||||||
text: ShareConnectionLogic.textEditShareOpenvpnCodeText
|
text: ShareConnectionLogic.textEditShareOpenVpnCodeText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
ShareConnectionLogic.textEditShareOpenvpnCodeText = text
|
ShareConnectionLogic.textEditShareOpenVpnCodeText = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -264,7 +264,7 @@ Item {
|
||||||
id: share_shadowshock
|
id: share_shadowshock
|
||||||
x: 0
|
x: 0
|
||||||
text: qsTr("Share for ShadowSocks client")
|
text: qsTr("Share for ShadowSocks client")
|
||||||
visible: ShareConnectionLogic.pageShareShadowsocksVisible
|
visible: ShareConnectionLogic.pageShareShadowSocksVisible
|
||||||
content: Component {
|
content: Component {
|
||||||
Item {
|
Item {
|
||||||
width: 360
|
width: 360
|
||||||
|
|
@ -309,28 +309,28 @@ Item {
|
||||||
y: 70
|
y: 70
|
||||||
width: 100
|
width: 100
|
||||||
height: 20
|
height: 20
|
||||||
text: ShareConnectionLogic.labelShareSsPasswordText
|
text: ShareConnectionLogic.labelShareShadowSocksPasswordText
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
x: 130
|
x: 130
|
||||||
y: 10
|
y: 10
|
||||||
width: 100
|
width: 100
|
||||||
height: 20
|
height: 20
|
||||||
text: ShareConnectionLogic.labelShareSsServerText
|
text: ShareConnectionLogic.labelShareShadowSocksServerText
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
x: 130
|
x: 130
|
||||||
y: 50
|
y: 50
|
||||||
width: 100
|
width: 100
|
||||||
height: 20
|
height: 20
|
||||||
text: ShareConnectionLogic.labelShareSsMethodText
|
text: ShareConnectionLogic.labelShareShadowSocksMethodText
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
x: 130
|
x: 130
|
||||||
y: 30
|
y: 30
|
||||||
width: 100
|
width: 100
|
||||||
height: 20
|
height: 20
|
||||||
text: ShareConnectionLogic.labelShareSsPortText
|
text: ShareConnectionLogic.labelShareShadowSocksPortText
|
||||||
}
|
}
|
||||||
Image {
|
Image {
|
||||||
id: label_share_ss_qr_code
|
id: label_share_ss_qr_code
|
||||||
|
|
@ -338,17 +338,17 @@ Item {
|
||||||
y: 235
|
y: 235
|
||||||
width: 200
|
width: 200
|
||||||
height: 200
|
height: 200
|
||||||
source: ShareConnectionLogic.labelShareSsQrCodeText === "" ? "" : "data:image/png;base64," + UiLogic.labelShareSsQrCodeText
|
source: ShareConnectionLogic.labelShareShadowSocksQrCodeText === "" ? "" : "data:image/png;base64," + UiLogic.labelShareShadowSocksQrCodeText
|
||||||
}
|
}
|
||||||
ShareConnectionButtonType {
|
ShareConnectionButtonType {
|
||||||
x: 10
|
x: 10
|
||||||
y: 180
|
y: 180
|
||||||
width: 331
|
width: 331
|
||||||
height: 40
|
height: 40
|
||||||
text: ShareConnectionLogic.pushButtonShareSsCopyText
|
text: ShareConnectionLogic.pushButtonShareShadowSocksCopyText
|
||||||
enabled: ShareConnectionLogic.pushButtonShareSsCopyEnabled
|
enabled: ShareConnectionLogic.pushButtonShareShadowSocksCopyEnabled
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ShareConnectionLogic.onPushButtonShareSsCopyClicked()
|
ShareConnectionLogic.onPushButtonShareShadowSocksCopyClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
|
|
@ -357,9 +357,9 @@ Item {
|
||||||
width: 331
|
width: 331
|
||||||
height: 100
|
height: 100
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
text: ShareConnectionLogic.lineEditShareSsStringText
|
text: ShareConnectionLogic.lineEditShareShadowSocksStringText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
ShareConnectionLogic.lineEditShareSsStringText = text
|
ShareConnectionLogic.lineEditShareShadowSocksStringText = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -110,7 +110,7 @@ Item {
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Connect")
|
text: qsTr("Connect")
|
||||||
onClicked: {
|
onClicked: {
|
||||||
StartPageLogic.onPushButtonNewServerImport()
|
StartPageLogic.onPushButtonImport()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -165,8 +165,8 @@ Item {
|
||||||
y: 390
|
y: 390
|
||||||
width: 301
|
width: 301
|
||||||
height: 41
|
height: 41
|
||||||
text: StartPageLogic.labelNewServerWaitInfoText
|
text: StartPageLogic.labelWaitInfoText
|
||||||
visible: StartPageLogic.labelNewServerWaitInfoVisible
|
visible: StartPageLogic.labelWaitInfoVisible
|
||||||
wrapMode: Text.Wrap
|
wrapMode: Text.Wrap
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
|
|
@ -175,9 +175,9 @@ Item {
|
||||||
y: 100
|
y: 100
|
||||||
width: 300
|
width: 300
|
||||||
height: 40
|
height: 40
|
||||||
text: StartPageLogic.lineEditNewServerIpText
|
text: StartPageLogic.lineEditIpText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
StartPageLogic.lineEditNewServerIpText = text
|
StartPageLogic.lineEditIpText = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
|
|
@ -186,9 +186,9 @@ Item {
|
||||||
y: 180
|
y: 180
|
||||||
width: 300
|
width: 300
|
||||||
height: 40
|
height: 40
|
||||||
text: StartPageLogic.lineEditNewServerLoginText
|
text: StartPageLogic.lineEditLoginText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
StartPageLogic.lineEditNewServerLoginText = text
|
StartPageLogic.lineEditLoginText = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
|
|
@ -198,9 +198,9 @@ Item {
|
||||||
width: 300
|
width: 300
|
||||||
height: 40
|
height: 40
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
text: StartPageLogic.lineEditNewServerPasswordText
|
text: StartPageLogic.lineEditPasswordText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
StartPageLogic.lineEditNewServerPasswordText = text
|
StartPageLogic.lineEditPasswordText = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
BlueButtonType {
|
BlueButtonType {
|
||||||
|
|
@ -209,12 +209,12 @@ Item {
|
||||||
y: 350
|
y: 350
|
||||||
width: 301
|
width: 301
|
||||||
height: 40
|
height: 40
|
||||||
text: StartPageLogic.pushButtonNewServerConnectText
|
text: StartPageLogic.pushButtonConnectText
|
||||||
visible: StartPageLogic.pushButtonNewServerConnectVisible
|
visible: StartPageLogic.pushButtonConnectVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
StartPageLogic.onPushButtonNewServerConnect()
|
StartPageLogic.onPushButtonConnect()
|
||||||
}
|
}
|
||||||
enabled: StartPageLogic.pushButtonNewServerConnectEnabled
|
enabled: StartPageLogic.pushButtonConnectEnabled
|
||||||
}
|
}
|
||||||
BasicButtonType {
|
BasicButtonType {
|
||||||
id: new_sever_connect_key
|
id: new_sever_connect_key
|
||||||
|
|
@ -239,9 +239,9 @@ Item {
|
||||||
}
|
}
|
||||||
antialiasing: true
|
antialiasing: true
|
||||||
checkable: true
|
checkable: true
|
||||||
checked: StartPageLogic.pushButtonNewServerConnectKeyChecked
|
checked: StartPageLogic.pushButtonConnectKeyChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
StartPageLogic.pushButtonNewServerConnectKeyChecked = checked
|
StartPageLogic.pushButtonConnectKeyChecked = checked
|
||||||
label_new_server_password.text = checked ? qsTr("Private key") : qsTr("Password")
|
label_new_server_password.text = checked ? qsTr("Private key") : qsTr("Password")
|
||||||
new_sever_connect_key.text = checked ? qsTr("Connect using SSH password") : qsTr("Connect using SSH key")
|
new_sever_connect_key.text = checked ? qsTr("Connect using SSH password") : qsTr("Connect using SSH key")
|
||||||
new_server_password.visible = !checked
|
new_server_password.visible = !checked
|
||||||
|
|
@ -285,9 +285,9 @@ Item {
|
||||||
echoMode: TextInput.Password
|
echoMode: TextInput.Password
|
||||||
font.pixelSize: 9
|
font.pixelSize: 9
|
||||||
verticalAlignment: Text.AlignTop
|
verticalAlignment: Text.AlignTop
|
||||||
text: StartPageLogic.textEditNewServerSshKeyText
|
text: StartPageLogic.textEditSshKeyText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
StartPageLogic.textEditNewServerSshKeyText = text
|
StartPageLogic.textEditSshKeyText = text
|
||||||
}
|
}
|
||||||
visible: false
|
visible: false
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import "../../Config"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
enabled: OpenVpnLogic.pageProtoOpenvpnEnabled
|
enabled: OpenVpnLogic.pageProtoOpenVpnEnabled
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
id: back
|
id: back
|
||||||
x: 10
|
x: 10
|
||||||
|
|
@ -23,19 +23,19 @@ Item {
|
||||||
y: 40
|
y: 40
|
||||||
width: 380
|
width: 380
|
||||||
height: 600
|
height: 600
|
||||||
enabled: OpenVpnLogic.widgetProtoOpenvpnEnabled
|
enabled: OpenVpnLogic.widgetProtoOpenVpnEnabled
|
||||||
CheckBoxType {
|
CheckBoxType {
|
||||||
x: 30
|
x: 30
|
||||||
y: 280
|
y: 280
|
||||||
width: 321
|
width: 321
|
||||||
height: 21
|
height: 21
|
||||||
text: qsTr("Auto-negotiate encryption")
|
text: qsTr("Auto-negotiate encryption")
|
||||||
checked: OpenVpnLogic.checkBoxProtoOpenvpnAutoEncryptionChecked
|
checked: OpenVpnLogic.checkBoxProtoOpenVpnAutoEncryptionChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
OpenVpnLogic.checkBoxProtoOpenvpnAutoEncryptionChecked = checked
|
OpenVpnLogic.checkBoxProtoOpenVpnAutoEncryptionChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
OpenVpnLogic.checkBoxProtoOpenvpnAutoEncryptionClicked()
|
OpenVpnLogic.checkBoxProtoOpenVpnAutoEncryptionClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CheckBoxType {
|
CheckBoxType {
|
||||||
|
|
@ -44,9 +44,9 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 21
|
height: 21
|
||||||
text: qsTr("Block DNS requests outside of VPN")
|
text: qsTr("Block DNS requests outside of VPN")
|
||||||
checked: OpenVpnLogic.checkBoxProtoOpenvpnBlockDnsChecked
|
checked: OpenVpnLogic.checkBoxProtoOpenVpnBlockDnsChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
OpenVpnLogic.checkBoxProtoOpenvpnBlockDnsChecked = checked
|
OpenVpnLogic.checkBoxProtoOpenVpnBlockDnsChecked = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
CheckBoxType {
|
CheckBoxType {
|
||||||
|
|
@ -55,9 +55,9 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 21
|
height: 21
|
||||||
text: qsTr("Enable TLS auth")
|
text: qsTr("Enable TLS auth")
|
||||||
checked: OpenVpnLogic.checkBoxProtoOpenvpnTlsAuthChecked
|
checked: OpenVpnLogic.checkBoxProtoOpenVpnTlsAuthChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
OpenVpnLogic.checkBoxProtoOpenvpnTlsAuthChecked = checked
|
OpenVpnLogic.checkBoxProtoOpenVpnTlsAuthChecked = checked
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
@ -80,16 +80,16 @@ Item {
|
||||||
]
|
]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
for (let i = 0; i < model.length; ++i) {
|
for (let i = 0; i < model.length; ++i) {
|
||||||
if (OpenVpnLogic.comboBoxProtoOpenvpnCipherText === model[i]) {
|
if (OpenVpnLogic.comboBoxProtoOpenVpnCipherText === model[i]) {
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
onCurrentTextChanged: {
|
onCurrentTextChanged: {
|
||||||
OpenVpnLogic.comboBoxProtoOpenvpnCipherText = currentText
|
OpenVpnLogic.comboBoxProtoOpenVpnCipherText = currentText
|
||||||
}
|
}
|
||||||
enabled: OpenVpnLogic.comboBoxProtoOpenvpnCipherEnabled
|
enabled: OpenVpnLogic.comboBoxProtoOpenVpnCipherEnabled
|
||||||
}
|
}
|
||||||
ComboBoxType {
|
ComboBoxType {
|
||||||
x: 200
|
x: 200
|
||||||
|
|
@ -110,16 +110,16 @@ Item {
|
||||||
]
|
]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
for (let i = 0; i < model.length; ++i) {
|
for (let i = 0; i < model.length; ++i) {
|
||||||
if (OpenVpnLogic.comboBoxProtoOpenvpnHashText === model[i]) {
|
if (OpenVpnLogic.comboBoxProtoOpenVpnHashText === model[i]) {
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
onCurrentTextChanged: {
|
onCurrentTextChanged: {
|
||||||
OpenVpnLogic.comboBoxProtoOpenvpnHashText = currentText
|
OpenVpnLogic.comboBoxProtoOpenVpnHashText = currentText
|
||||||
}
|
}
|
||||||
enabled: OpenVpnLogic.comboBoxProtoOpenvpnHashEnabled
|
enabled: OpenVpnLogic.comboBoxProtoOpenVpnHashEnabled
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
x: 30
|
x: 30
|
||||||
|
|
@ -135,10 +135,10 @@ Item {
|
||||||
width: 171
|
width: 171
|
||||||
height: 19
|
height: 19
|
||||||
text: qsTr("TCP")
|
text: qsTr("TCP")
|
||||||
enabled: OpenVpnLogic.radioButtonProtoOpenvpnTcpEnabled
|
enabled: OpenVpnLogic.radioButtonProtoOpenVpnTcpEnabled
|
||||||
checked: OpenVpnLogic.radioButtonProtoOpenvpnTcpChecked
|
checked: OpenVpnLogic.radioButtonProtoOpenVpnTcpChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
UiLogic.radioButtonProtoOpenvpnTcpChecked = checked
|
UiLogic.radioButtonProtoOpenVpnTcpChecked = checked
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
RadioButtonType {
|
RadioButtonType {
|
||||||
|
|
@ -147,11 +147,11 @@ Item {
|
||||||
width: 171
|
width: 171
|
||||||
height: 19
|
height: 19
|
||||||
text: qsTr("UDP")
|
text: qsTr("UDP")
|
||||||
checked: OpenVpnLogic.radioButtonProtoOpenvpnUdpChecked
|
checked: OpenVpnLogic.radioButtonProtoOpenVpnUdpChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
OpenVpnLogic.radioButtonProtoOpenvpnUdpChecked = checked
|
OpenVpnLogic.radioButtonProtoOpenVpnUdpChecked = checked
|
||||||
}
|
}
|
||||||
enabled: OpenVpnLogic.radioButtonProtoOpenvpnUdpEnabled
|
enabled: OpenVpnLogic.radioButtonProtoOpenVpnUdpEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
|
|
@ -208,8 +208,8 @@ Item {
|
||||||
y: 550
|
y: 550
|
||||||
width: 321
|
width: 321
|
||||||
height: 41
|
height: 41
|
||||||
visible: OpenVpnLogic.labelProtoOpenvpnInfoVisible
|
visible: OpenVpnLogic.labelProtoOpenVpnInfoVisible
|
||||||
text: OpenVpnLogic.labelProtoOpenvpnInfoText
|
text: OpenVpnLogic.labelProtoOpenVpnInfoText
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
id: lineEdit_proto_openvpn_port
|
id: lineEdit_proto_openvpn_port
|
||||||
|
|
@ -217,11 +217,11 @@ Item {
|
||||||
y: 230
|
y: 230
|
||||||
width: 151
|
width: 151
|
||||||
height: 31
|
height: 31
|
||||||
text: OpenVpnLogic.lineEditProtoOpenvpnPortText
|
text: OpenVpnLogic.lineEditProtoOpenVpnPortText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
OpenVpnLogic.lineEditProtoOpenvpnPortText = text
|
OpenVpnLogic.lineEditProtoOpenVpnPortText = text
|
||||||
}
|
}
|
||||||
enabled: OpenVpnLogic.lineEditProtoOpenvpnPortEnabled
|
enabled: OpenVpnLogic.lineEditProtoOpenVpnPortEnabled
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
id: lineEdit_proto_openvpn_subnet
|
id: lineEdit_proto_openvpn_subnet
|
||||||
|
|
@ -229,9 +229,9 @@ Item {
|
||||||
y: 65
|
y: 65
|
||||||
width: 321
|
width: 321
|
||||||
height: 31
|
height: 31
|
||||||
text: OpenVpnLogic.lineEditProtoOpenvpnSubnetText
|
text: OpenVpnLogic.lineEditProtoOpenVpnSubnetText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
OpenVpnLogic.lineEditProtoOpenvpnSubnetText = text
|
OpenVpnLogic.lineEditProtoOpenVpnSubnetText = text
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ProgressBar {
|
ProgressBar {
|
||||||
|
|
@ -241,9 +241,9 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 40
|
height: 40
|
||||||
from: 0
|
from: 0
|
||||||
to: OpenVpnLogic.progressBarProtoOpenvpnResetMaximium
|
to: OpenVpnLogic.progressBarProtoOpenVpnResetMaximium
|
||||||
value: OpenVpnLogic.progressBarProtoOpenvpnResetValue
|
value: OpenVpnLogic.progressBarProtoOpenVpnResetValue
|
||||||
visible: OpenVpnLogic.progressBarProtoOpenvpnResetVisible
|
visible: OpenVpnLogic.progressBarProtoOpenVpnResetVisible
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
|
@ -270,7 +270,7 @@ Item {
|
||||||
text: qsTr("Save and restart VPN")
|
text: qsTr("Save and restart VPN")
|
||||||
visible: OpenVpnLogic.pushButtonOpenvpnSaveVisible
|
visible: OpenVpnLogic.pushButtonOpenvpnSaveVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
OpenVpnLogic.onPushButtonProtoOpenvpnSaveClicked()
|
OpenVpnLogic.onPushButtonProtoOpenVpnSaveClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import "../../Config"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
enabled: ShadowSocksLogic.pageProtoShadowsocksEnabled
|
enabled: ShadowSocksLogic.pageProtoShadowSocksEnabled
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
id: back
|
id: back
|
||||||
x: 10
|
x: 10
|
||||||
|
|
@ -23,7 +23,7 @@ Item {
|
||||||
y: 40
|
y: 40
|
||||||
width: 380
|
width: 380
|
||||||
height: 600
|
height: 600
|
||||||
enabled: ShadowSocksLogic.widgetProtoSsEnabled
|
enabled: ShadowSocksLogic.widgetProtoShadowSocksEnabled
|
||||||
ComboBoxType {
|
ComboBoxType {
|
||||||
x: 190
|
x: 190
|
||||||
y: 60
|
y: 60
|
||||||
|
|
@ -36,14 +36,14 @@ Item {
|
||||||
]
|
]
|
||||||
currentIndex: {
|
currentIndex: {
|
||||||
for (let i = 0; i < model.length; ++i) {
|
for (let i = 0; i < model.length; ++i) {
|
||||||
if (ShadowSocksLogic.comboBoxProtoShadowsocksCipherText === model[i]) {
|
if (ShadowSocksLogic.comboBoxProtoShadowSocksCipherText === model[i]) {
|
||||||
return i
|
return i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return -1
|
return -1
|
||||||
}
|
}
|
||||||
onCurrentTextChanged: {
|
onCurrentTextChanged: {
|
||||||
ShadowSocksLogic.comboBoxProtoShadowsocksCipherText = currentText
|
ShadowSocksLogic.comboBoxProtoShadowSocksCipherText = currentText
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
LabelType {
|
LabelType {
|
||||||
|
|
@ -79,8 +79,8 @@ Item {
|
||||||
y: 550
|
y: 550
|
||||||
width: 321
|
width: 321
|
||||||
height: 41
|
height: 41
|
||||||
visible: ShadowSocksLogic.labelProtoShadowsocksInfoVisible
|
visible: ShadowSocksLogic.labelProtoShadowSocksInfoVisible
|
||||||
text: ShadowSocksLogic.labelProtoShadowsocksInfoText
|
text: ShadowSocksLogic.labelProtoShadowSocksInfoText
|
||||||
}
|
}
|
||||||
TextFieldType {
|
TextFieldType {
|
||||||
id: lineEdit_proto_shadowsocks_port
|
id: lineEdit_proto_shadowsocks_port
|
||||||
|
|
@ -88,11 +88,11 @@ Item {
|
||||||
y: 110
|
y: 110
|
||||||
width: 151
|
width: 151
|
||||||
height: 31
|
height: 31
|
||||||
text: ShadowSocksLogic.lineEditProtoShadowsocksPortText
|
text: ShadowSocksLogic.lineEditProtoShadowSocksPortText
|
||||||
onEditingFinished: {
|
onEditingFinished: {
|
||||||
ShadowSocksLogic.lineEditProtoShadowsocksPortText = text
|
ShadowSocksLogic.lineEditProtoShadowSocksPortText = text
|
||||||
}
|
}
|
||||||
enabled: ShadowSocksLogic.lineEditProtoShadowsocksPortEnabled
|
enabled: ShadowSocksLogic.lineEditProtoShadowSocksPortEnabled
|
||||||
}
|
}
|
||||||
ProgressBar {
|
ProgressBar {
|
||||||
id: progressBar_proto_shadowsocks_reset
|
id: progressBar_proto_shadowsocks_reset
|
||||||
|
|
@ -101,9 +101,9 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 40
|
height: 40
|
||||||
from: 0
|
from: 0
|
||||||
to: ShadowSocksLogic.progressBarProtoShadowsocksResetMaximium
|
to: ShadowSocksLogic.progressBarProtoShadowSocksResetMaximium
|
||||||
value: ShadowSocksLogic.progressBarProtoShadowsocksResetValue
|
value: ShadowSocksLogic.progressBarProtoShadowSocksResetValue
|
||||||
visible: ShadowSocksLogic.progressBarProtoShadowsocksResetVisible
|
visible: ShadowSocksLogic.progressBarProtoShadowSocksResetVisible
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: parent.width
|
implicitWidth: parent.width
|
||||||
implicitHeight: parent.height
|
implicitHeight: parent.height
|
||||||
|
|
@ -128,9 +128,9 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Save and restart VPN")
|
text: qsTr("Save and restart VPN")
|
||||||
visible: ShadowSocksLogic.pushButtonShadowsocksSaveVisible
|
visible: ShadowSocksLogic.pushButtonShadowSocksSaveVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ShadowSocksLogic.onPushButtonProtoShadowsocksSaveClicked()
|
ShadowSocksLogic.onPushButtonProtoShadowSocksSaveClicked()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -144,27 +144,28 @@ Window {
|
||||||
console.debug(pageComponent)
|
console.debug(pageComponent)
|
||||||
if (reset) {
|
if (reset) {
|
||||||
if (page === PageEnum.ServerSettings) {
|
if (page === PageEnum.ServerSettings) {
|
||||||
ServerSettingsLogic.updateServerSettingsPage();
|
ServerSettingsLogic.updatePage();
|
||||||
|
}
|
||||||
|
if (page === PageEnum.ShareConnection) {
|
||||||
}
|
}
|
||||||
if (page === PageEnum.ShareConnection) {}
|
|
||||||
if (page === PageEnum.Wizard) {
|
if (page === PageEnum.Wizard) {
|
||||||
UiLogic.radioButtonSetupWizardMediumChecked = true
|
WizardLogic.radioButtonMediumChecked = true
|
||||||
}
|
}
|
||||||
if (page === PageEnum.WizardHigh) {
|
if (page === PageEnum.WizardHigh) {
|
||||||
UiLogic.updateWizardHighPage();
|
WizardLogic.updatePage();
|
||||||
}
|
}
|
||||||
if (page === PageEnum.ServerConfiguring) {
|
if (page === PageEnum.ServerConfiguring) {
|
||||||
UiLogic.progressBarValue = 0;
|
ServerConfiguringLogic.progressBarValue = 0;
|
||||||
}
|
}
|
||||||
if (page === PageEnum.GeneralSettings) {
|
if (page === PageEnum.GeneralSettings) {
|
||||||
GeneralSettingsLogic.updatePage();
|
GeneralSettingsLogic.updatePage();
|
||||||
}
|
}
|
||||||
if (page === PageEnum.ServersList) {
|
if (page === PageEnum.ServersList) {
|
||||||
ServerListLogic.updateServersListPage();
|
ServerListLogic.updatePage();
|
||||||
}
|
}
|
||||||
if (page === PageEnum.Start) {
|
if (page === PageEnum.Start) {
|
||||||
StartPageLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
StartPageLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
||||||
StartPageLogic.updateStartPage();
|
StartPageLogic.updatePage();
|
||||||
}
|
}
|
||||||
if (page === PageEnum.NewServerProtocols) {
|
if (page === PageEnum.NewServerProtocols) {
|
||||||
NewServerProtocolsLogic.updatePage()
|
NewServerProtocolsLogic.updatePage()
|
||||||
|
|
@ -184,7 +185,6 @@ Window {
|
||||||
if (page === PageEnum.Vpn) {
|
if (page === PageEnum.Vpn) {
|
||||||
VpnLogic.updateVpnPage()
|
VpnLogic.updateVpnPage()
|
||||||
}
|
}
|
||||||
UiLogic.pushButtonNewServerConnectKeyChecked = false
|
|
||||||
}
|
}
|
||||||
if (slide) {
|
if (slide) {
|
||||||
pageLoader.push(pageComponent, {}, StackView.PushTransition)
|
pageLoader.push(pageComponent, {}, StackView.PushTransition)
|
||||||
|
|
@ -210,7 +210,7 @@ Window {
|
||||||
}
|
}
|
||||||
if (page === PageEnum.Start) {
|
if (page === PageEnum.Start) {
|
||||||
UiLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
UiLogic.pushButtonBackFromStartVisible = !pageLoader.empty
|
||||||
UiLogic.updateStartPage();
|
UiLogic.updatePage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue