AUTO_PROPERTY finished
This commit is contained in:
parent
63ffa4a212
commit
16e887dcf0
34 changed files with 510 additions and 3156 deletions
|
|
@ -25,9 +25,5 @@ public:
|
||||||
explicit AppSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit AppSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~AppSettingsLogic() = default;
|
~AppSettingsLogic() = default;
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // APP_SETTINGS_LOGIC_H
|
#endif // APP_SETTINGS_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ GeneralSettingsLogic::GeneralSettingsLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GeneralSettingsLogic::updateGeneralSettingPage()
|
void GeneralSettingsLogic::updatePage()
|
||||||
{
|
{
|
||||||
set_pushButtonGeneralSettingsShareConnectionEnable(m_settings.haveAuthData(m_settings.defaultServerIndex()));
|
set_pushButtonGeneralSettingsShareConnectionEnable(m_settings.haveAuthData(m_settings.defaultServerIndex()));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ class GeneralSettingsLogic : public PageLogicBase
|
||||||
AUTO_PROPERTY(bool, pushButtonGeneralSettingsShareConnectionEnable)
|
AUTO_PROPERTY(bool, pushButtonGeneralSettingsShareConnectionEnable)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateGeneralSettingPage();
|
Q_INVOKABLE void updatePage() override;
|
||||||
Q_INVOKABLE void onPushButtonGeneralSettingsServerSettingsClicked();
|
Q_INVOKABLE void onPushButtonGeneralSettingsServerSettingsClicked();
|
||||||
Q_INVOKABLE void onPushButtonGeneralSettingsShareConnectionClicked();
|
Q_INVOKABLE void onPushButtonGeneralSettingsShareConnectionClicked();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,6 @@
|
||||||
NewServerConfiguringLogic::NewServerConfiguringLogic(UiLogic *logic, QObject *parent):
|
NewServerConfiguringLogic::NewServerConfiguringLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_progressBarValue{0},
|
m_progressBarValue{0},
|
||||||
m_pageEnabled{true},
|
|
||||||
m_labelWaitInfoVisible{true},
|
m_labelWaitInfoVisible{true},
|
||||||
m_labelWaitInfoText{tr("Please wait, configuring process may take up to 5 minutes")},
|
m_labelWaitInfoText{tr("Please wait, configuring process may take up to 5 minutes")},
|
||||||
m_progressBarVisible{true},
|
m_progressBarVisible{true},
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,6 @@ class NewServerConfiguringLogic : public PageLogicBase
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
AUTO_PROPERTY(double, progressBarValue)
|
AUTO_PROPERTY(double, progressBarValue)
|
||||||
AUTO_PROPERTY(bool, pageEnabled)
|
|
||||||
AUTO_PROPERTY(bool, labelWaitInfoVisible)
|
AUTO_PROPERTY(bool, labelWaitInfoVisible)
|
||||||
AUTO_PROPERTY(QString, labelWaitInfoText)
|
AUTO_PROPERTY(QString, labelWaitInfoText)
|
||||||
AUTO_PROPERTY(bool, progressBarVisible)
|
AUTO_PROPERTY(bool, progressBarVisible)
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@
|
||||||
|
|
||||||
PageLogicBase::PageLogicBase(UiLogic *logic, QObject *parent):
|
PageLogicBase::PageLogicBase(UiLogic *logic, QObject *parent):
|
||||||
QObject(parent),
|
QObject(parent),
|
||||||
|
m_pageEnabled{true},
|
||||||
m_uiLogic(logic)
|
m_uiLogic(logic)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ class UiLogic;
|
||||||
class PageLogicBase : public QObject
|
class PageLogicBase : public QObject
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
AUTO_PROPERTY(bool, pageEnabled)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit PageLogicBase(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit PageLogicBase(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
|
|
@ -26,13 +27,5 @@ protected:
|
||||||
Settings m_settings;
|
Settings m_settings;
|
||||||
UiLogic *m_uiLogic;
|
UiLogic *m_uiLogic;
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // PAGE_LOGIC_BASE_H
|
#endif // PAGE_LOGIC_BASE_H
|
||||||
|
|
|
||||||
|
|
@ -11,29 +11,28 @@
|
||||||
|
|
||||||
ServerContainersLogic::ServerContainersLogic(UiLogic *logic, QObject *parent):
|
ServerContainersLogic::ServerContainersLogic(UiLogic *logic, QObject *parent):
|
||||||
PageLogicBase(logic, parent),
|
PageLogicBase(logic, parent),
|
||||||
m_pageServerContainersEnabled{true},
|
|
||||||
m_progressBarProtocolsContainerReinstallValue{0},
|
m_progressBarProtocolsContainerReinstallValue{0},
|
||||||
m_progressBarProtocolsContainerReinstallMaximium{100},
|
m_progressBarProtocolsContainerReinstallMaximium{100},
|
||||||
m_pushButtonProtoOpenvpnContInstallChecked{false},
|
m_pushButtonOpenvpnContInstallChecked{false},
|
||||||
m_pushButtonProtoSsOpenvpnContInstallChecked{false},
|
m_pushButtonSsOpenvpnContInstallChecked{false},
|
||||||
m_pushButtonProtoCloakOpenvpnContInstallChecked{false},
|
m_pushButtonCloakOpenvpnContInstallChecked{false},
|
||||||
m_pushButtonProtoWireguardContInstallChecked{false},
|
m_pushButtonWireguardContInstallChecked{false},
|
||||||
m_pushButtonProtoOpenvpnContInstallEnabled{false},
|
m_pushButtonOpenvpnContInstallEnabled{false},
|
||||||
m_pushButtonProtoSsOpenvpnContInstallEnabled{false},
|
m_pushButtonSsOpenvpnContInstallEnabled{false},
|
||||||
m_pushButtonProtoCloakOpenvpnContInstallEnabled{false},
|
m_pushButtonCloakOpenvpnContInstallEnabled{false},
|
||||||
m_pushButtonProtoWireguardContInstallEnabled{false},
|
m_pushButtonWireguardContInstallEnabled{false},
|
||||||
m_pushButtonProtoOpenvpnContDefaultChecked{false},
|
m_pushButtonOpenvpnContDefaultChecked{false},
|
||||||
m_pushButtonProtoSsOpenvpnContDefaultChecked{false},
|
m_pushButtonSsOpenvpnContDefaultChecked{false},
|
||||||
m_pushButtonProtoCloakOpenvpnContDefaultChecked{false},
|
m_pushButtonCloakOpenvpnContDefaultChecked{false},
|
||||||
m_pushButtonProtoWireguardContDefaultChecked{false},
|
m_pushButtonWireguardContDefaultChecked{false},
|
||||||
m_pushButtonProtoOpenvpnContDefaultVisible{true},
|
m_pushButtonOpenvpnContDefaultVisible{true},
|
||||||
m_pushButtonProtoSsOpenvpnContDefaultVisible{false},
|
m_pushButtonSsOpenvpnContDefaultVisible{false},
|
||||||
m_pushButtonProtoCloakOpenvpnContDefaultVisible{false},
|
m_pushButtonCloakOpenvpnContDefaultVisible{false},
|
||||||
m_pushButtonProtoWireguardContDefaultVisible{false},
|
m_pushButtonWireguardContDefaultVisible{false},
|
||||||
m_pushButtonProtoOpenvpnContShareVisible{false},
|
m_pushButtonOpenvpnContShareVisible{false},
|
||||||
m_pushButtonProtoSsOpenvpnContShareVisible{false},
|
m_pushButtonSsOpenvpnContShareVisible{false},
|
||||||
m_pushButtonProtoCloakOpenvpnContShareVisible{false},
|
m_pushButtonCloakOpenvpnContShareVisible{false},
|
||||||
m_pushButtonProtoWireguardContShareVisible{false},
|
m_pushButtonWireguardContShareVisible{false},
|
||||||
m_frameOpenvpnSettingsVisible{true},
|
m_frameOpenvpnSettingsVisible{true},
|
||||||
m_frameOpenvpnSsSettingsVisible{true},
|
m_frameOpenvpnSsSettingsVisible{true},
|
||||||
m_frameOpenvpnSsCloakSettingsVisible{true},
|
m_frameOpenvpnSsCloakSettingsVisible{true},
|
||||||
|
|
@ -43,13 +42,13 @@ ServerContainersLogic::ServerContainersLogic(UiLogic *logic, QObject *parent):
|
||||||
{
|
{
|
||||||
setupProtocolsPageConnections();
|
setupProtocolsPageConnections();
|
||||||
|
|
||||||
setFrameWireguardSettingsVisible(false);
|
set_frameWireguardSettingsVisible(false);
|
||||||
setFrameWireguardVisible(false);
|
set_frameWireguardVisible(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerContainersLogic::updateServerContainersPage()
|
void ServerContainersLogic::updateServerContainersPage()
|
||||||
{
|
{
|
||||||
setProgressBarProtocolsContainerReinstallVisible(false);
|
set_progressBarProtocolsContainerReinstallVisible(false);
|
||||||
|
|
||||||
auto containers = m_settings.containers(uiLogic()->selectedServerIndex);
|
auto containers = m_settings.containers(uiLogic()->selectedServerIndex);
|
||||||
DockerContainer defaultContainer = m_settings.defaultContainer(uiLogic()->selectedServerIndex);
|
DockerContainer defaultContainer = m_settings.defaultContainer(uiLogic()->selectedServerIndex);
|
||||||
|
|
@ -67,43 +66,43 @@ 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 {setPushButtonProtoOpenvpnContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonOpenvpnContInstallChecked(checked);},
|
||||||
[this](bool checked) ->void {setPushButtonProtoSsOpenvpnContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonSsOpenvpnContInstallChecked(checked);},
|
||||||
[this](bool checked) ->void {setPushButtonProtoCloakOpenvpnContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonCloakOpenvpnContInstallChecked(checked);},
|
||||||
[this](bool checked) ->void {setPushButtonProtoWireguardContInstallChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonWireguardContInstallChecked(checked);},
|
||||||
};
|
};
|
||||||
QList<SetEnabledFunc> installButtonsEnabledFunc {
|
QList<SetEnabledFunc> installButtonsEnabledFunc {
|
||||||
[this](bool enabled) ->void {setPushButtonProtoOpenvpnContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonOpenvpnContInstallEnabled(enabled);},
|
||||||
[this](bool enabled) ->void {setPushButtonProtoSsOpenvpnContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonSsOpenvpnContInstallEnabled(enabled);},
|
||||||
[this](bool enabled) ->void {setPushButtonProtoCloakOpenvpnContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonCloakOpenvpnContInstallEnabled(enabled);},
|
||||||
[this](bool enabled) ->void {setPushButtonProtoWireguardContInstallEnabled(enabled);},
|
[this](bool enabled) ->void {set_pushButtonWireguardContInstallEnabled(enabled);},
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<SetCheckedFunc> defaultButtonsCheckedFunc {
|
QList<SetCheckedFunc> defaultButtonsCheckedFunc {
|
||||||
[this](bool checked) ->void {setPushButtonProtoOpenvpnContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonOpenvpnContDefaultChecked(checked);},
|
||||||
[this](bool checked) ->void {setPushButtonProtoSsOpenvpnContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonSsOpenvpnContDefaultChecked(checked);},
|
||||||
[this](bool checked) ->void {setPushButtonProtoCloakOpenvpnContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonCloakOpenvpnContDefaultChecked(checked);},
|
||||||
[this](bool checked) ->void {setPushButtonProtoWireguardContDefaultChecked(checked);},
|
[this](bool checked) ->void {set_pushButtonWireguardContDefaultChecked(checked);},
|
||||||
};
|
};
|
||||||
QList<SetVisibleFunc> defaultButtonsVisibleFunc {
|
QList<SetVisibleFunc> defaultButtonsVisibleFunc {
|
||||||
[this](bool visible) ->void {setPushButtonProtoOpenvpnContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonOpenvpnContDefaultVisible(visible);},
|
||||||
[this](bool visible) ->void {setPushButtonProtoSsOpenvpnContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonSsOpenvpnContDefaultVisible(visible);},
|
||||||
[this](bool visible) ->void {setPushButtonProtoCloakOpenvpnContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonCloakOpenvpnContDefaultVisible(visible);},
|
||||||
[this](bool visible) ->void {setPushButtonProtoWireguardContDefaultVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonWireguardContDefaultVisible(visible);},
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<SetVisibleFunc> shareButtonsVisibleFunc {
|
QList<SetVisibleFunc> shareButtonsVisibleFunc {
|
||||||
[this](bool visible) ->void {setPushButtonProtoOpenvpnContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonOpenvpnContShareVisible(visible);},
|
||||||
[this](bool visible) ->void {setPushButtonProtoSsOpenvpnContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonSsOpenvpnContShareVisible(visible);},
|
||||||
[this](bool visible) ->void {setPushButtonProtoCloakOpenvpnContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonCloakOpenvpnContShareVisible(visible);},
|
||||||
[this](bool visible) ->void {setPushButtonProtoWireguardContShareVisible(visible);},
|
[this](bool visible) ->void {set_pushButtonWireguardContShareVisible(visible);},
|
||||||
};
|
};
|
||||||
|
|
||||||
QList<SetVisibleFunc> framesVisibleFunc {
|
QList<SetVisibleFunc> framesVisibleFunc {
|
||||||
[this](bool visible) ->void {setFrameOpenvpnSettingsVisible(visible);},
|
[this](bool visible) ->void {set_frameOpenvpnSettingsVisible(visible);},
|
||||||
[this](bool visible) ->void {setFrameOpenvpnSsSettingsVisible(visible);},
|
[this](bool visible) ->void {set_frameOpenvpnSsSettingsVisible(visible);},
|
||||||
[this](bool visible) ->void {setFrameOpenvpnSsCloakSettingsVisible(visible);},
|
[this](bool visible) ->void {set_frameOpenvpnSsCloakSettingsVisible(visible);},
|
||||||
[this](bool visible) ->void {setFrameWireguardSettingsVisible(visible);},
|
[this](bool visible) ->void {set_frameWireguardSettingsVisible(visible);},
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < allContainers.size(); ++i) {
|
for (int i = 0; i < allContainers.size(); ++i) {
|
||||||
|
|
@ -133,10 +132,10 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
|
|
||||||
// default buttons
|
// default buttons
|
||||||
QList<ButtonClickedFunc> defaultButtonClickedSig {
|
QList<ButtonClickedFunc> defaultButtonClickedSig {
|
||||||
&ServerContainersLogic::pushButtonProtoOpenvpnContDefaultClicked,
|
&ServerContainersLogic::pushButtonOpenvpnContDefaultClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoSsOpenvpnContDefaultClicked,
|
&ServerContainersLogic::pushButtonSsOpenvpnContDefaultClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoCloakOpenvpnContDefaultClicked,
|
&ServerContainersLogic::pushButtonCloakOpenvpnContDefaultClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoWireguardContDefaultClicked
|
&ServerContainersLogic::pushButtonWireguardContDefaultClicked
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < containers.size(); ++i) {
|
for (int i = 0; i < containers.size(); ++i) {
|
||||||
|
|
@ -149,23 +148,23 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
|
|
||||||
// install buttons
|
// install buttons
|
||||||
QList<ButtonClickedFunc> installButtonsClickedSig {
|
QList<ButtonClickedFunc> installButtonsClickedSig {
|
||||||
&ServerContainersLogic::pushButtonProtoOpenvpnContInstallClicked,
|
&ServerContainersLogic::pushButtonOpenvpnContInstallClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoSsOpenvpnContInstallClicked,
|
&ServerContainersLogic::pushButtonSsOpenvpnContInstallClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoCloakOpenvpnContInstallClicked,
|
&ServerContainersLogic::pushButtonCloakOpenvpnContInstallClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoWireguardContInstallClicked,
|
&ServerContainersLogic::pushButtonWireguardContInstallClicked,
|
||||||
};
|
};
|
||||||
QList<ButtonSetEnabledFunc> installButtonsSetEnabledFunc {
|
QList<ButtonSetEnabledFunc> installButtonsSetEnabledFunc {
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
setPushButtonProtoOpenvpnContInstallEnabled(enabled);
|
set_pushButtonOpenvpnContInstallEnabled(enabled);
|
||||||
},
|
},
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
setPushButtonProtoSsOpenvpnContInstallEnabled(enabled);
|
set_pushButtonSsOpenvpnContInstallEnabled(enabled);
|
||||||
},
|
},
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
setPushButtonProtoCloakOpenvpnContInstallEnabled(enabled);
|
set_pushButtonCloakOpenvpnContInstallEnabled(enabled);
|
||||||
},
|
},
|
||||||
[this] (bool enabled) -> void {
|
[this] (bool enabled) -> void {
|
||||||
setPushButtonProtoWireguardContInstallEnabled(enabled);
|
set_pushButtonWireguardContInstallEnabled(enabled);
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -178,22 +177,22 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
if (checked) {
|
if (checked) {
|
||||||
UiLogic::PageFunc page_server_containers;
|
UiLogic::PageFunc page_server_containers;
|
||||||
page_server_containers.setEnabledFunc = [this] (bool enabled) -> void {
|
page_server_containers.setEnabledFunc = [this] (bool enabled) -> void {
|
||||||
setPageServerContainersEnabled(enabled);
|
set_pageEnabled(enabled);
|
||||||
};
|
};
|
||||||
UiLogic::ButtonFunc no_button;
|
UiLogic::ButtonFunc no_button;
|
||||||
UiLogic::LabelFunc no_label;
|
UiLogic::LabelFunc no_label;
|
||||||
UiLogic::ProgressFunc progressBar_protocols_container_reinstall;
|
UiLogic::ProgressFunc progressBar_protocols_container_reinstall;
|
||||||
progressBar_protocols_container_reinstall.setVisibleFunc = [this] (bool visible) ->void {
|
progressBar_protocols_container_reinstall.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
setProgressBarProtocolsContainerReinstallVisible(visible);
|
set_progressBarProtocolsContainerReinstallVisible(visible);
|
||||||
};
|
};
|
||||||
progressBar_protocols_container_reinstall.setValueFunc = [this] (int value) ->void {
|
progressBar_protocols_container_reinstall.setValueFunc = [this] (int value) ->void {
|
||||||
setProgressBarProtocolsContainerReinstallValue(value);
|
set_progressBarProtocolsContainerReinstallValue(value);
|
||||||
};
|
};
|
||||||
progressBar_protocols_container_reinstall.getValueFunc = [this] (void) -> int {
|
progressBar_protocols_container_reinstall.getValueFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtocolsContainerReinstallValue();
|
return progressBarProtocolsContainerReinstallValue();
|
||||||
};
|
};
|
||||||
progressBar_protocols_container_reinstall.getMaximiumFunc = [this] (void) -> int {
|
progressBar_protocols_container_reinstall.getMaximiumFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtocolsContainerReinstallMaximium();
|
return progressBarProtocolsContainerReinstallMaximium();
|
||||||
};
|
};
|
||||||
|
|
||||||
ErrorCode e = uiLogic()->doInstallAction([this, container](){
|
ErrorCode e = uiLogic()->doInstallAction([this, container](){
|
||||||
|
|
@ -226,10 +225,10 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
|
|
||||||
// share buttons
|
// share buttons
|
||||||
QList<ButtonClickedFunc> shareButtonsClickedSig {
|
QList<ButtonClickedFunc> shareButtonsClickedSig {
|
||||||
&ServerContainersLogic::pushButtonProtoOpenvpnContShareClicked,
|
&ServerContainersLogic::pushButtonOpenvpnContShareClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoSsOpenvpnContShareClicked,
|
&ServerContainersLogic::pushButtonSsOpenvpnContShareClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoCloakOpenvpnContShareClicked,
|
&ServerContainersLogic::pushButtonCloakOpenvpnContShareClicked,
|
||||||
&ServerContainersLogic::pushButtonProtoWireguardContShareClicked,
|
&ServerContainersLogic::pushButtonWireguardContShareClicked,
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < containers.size(); ++i) {
|
for (int i = 0; i < containers.size(); ++i) {
|
||||||
|
|
@ -243,383 +242,6 @@ void ServerContainersLogic::setupProtocolsPageConnections()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServerContainersLogic::getPageServerContainersEnabled() const
|
|
||||||
{
|
|
||||||
return m_pageServerContainersEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPageServerContainersEnabled(bool pageServerContainersEnabled)
|
|
||||||
{
|
|
||||||
if (m_pageServerContainersEnabled != pageServerContainersEnabled) {
|
|
||||||
m_pageServerContainersEnabled = pageServerContainersEnabled;
|
|
||||||
emit pageServerContainersEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int ServerContainersLogic::getProgressBarProtocolsContainerReinstallValue() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtocolsContainerReinstallValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setProgressBarProtocolsContainerReinstallValue(int progressBarProtocolsContainerReinstallValue)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtocolsContainerReinstallValue != progressBarProtocolsContainerReinstallValue) {
|
|
||||||
m_progressBarProtocolsContainerReinstallValue = progressBarProtocolsContainerReinstallValue;
|
|
||||||
emit progressBarProtocolsContainerReinstallValueChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int ServerContainersLogic::getProgressBarProtocolsContainerReinstallMaximium() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtocolsContainerReinstallMaximium;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setProgressBarProtocolsContainerReinstallMaximium(int progressBarProtocolsContainerReinstallMaximium)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtocolsContainerReinstallMaximium != progressBarProtocolsContainerReinstallMaximium) {
|
|
||||||
m_progressBarProtocolsContainerReinstallMaximium = progressBarProtocolsContainerReinstallMaximium;
|
|
||||||
emit progressBarProtocolsContainerReinstallMaximiumChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoOpenvpnContInstallChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoOpenvpnContInstallChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoOpenvpnContInstallChecked(bool pushButtonProtoOpenvpnContInstallChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoOpenvpnContInstallChecked != pushButtonProtoOpenvpnContInstallChecked) {
|
|
||||||
m_pushButtonProtoOpenvpnContInstallChecked = pushButtonProtoOpenvpnContInstallChecked;
|
|
||||||
emit pushButtonProtoOpenvpnContInstallCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoSsOpenvpnContInstallChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoSsOpenvpnContInstallChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoSsOpenvpnContInstallChecked(bool pushButtonProtoSsOpenvpnContInstallChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoSsOpenvpnContInstallChecked != pushButtonProtoSsOpenvpnContInstallChecked) {
|
|
||||||
m_pushButtonProtoSsOpenvpnContInstallChecked = pushButtonProtoSsOpenvpnContInstallChecked;
|
|
||||||
emit pushButtonProtoSsOpenvpnContInstallCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoCloakOpenvpnContInstallChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoCloakOpenvpnContInstallChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoCloakOpenvpnContInstallChecked(bool pushButtonProtoCloakOpenvpnContInstallChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoCloakOpenvpnContInstallChecked != pushButtonProtoCloakOpenvpnContInstallChecked) {
|
|
||||||
m_pushButtonProtoCloakOpenvpnContInstallChecked = pushButtonProtoCloakOpenvpnContInstallChecked;
|
|
||||||
emit pushButtonProtoCloakOpenvpnContInstallCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoWireguardContInstallChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoWireguardContInstallChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoWireguardContInstallChecked(bool pushButtonProtoWireguardContInstallChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoWireguardContInstallChecked != pushButtonProtoWireguardContInstallChecked) {
|
|
||||||
m_pushButtonProtoWireguardContInstallChecked = pushButtonProtoWireguardContInstallChecked;
|
|
||||||
emit pushButtonProtoWireguardContInstallCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoOpenvpnContInstallEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoOpenvpnContInstallEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoOpenvpnContInstallEnabled(bool pushButtonProtoOpenvpnContInstallEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoOpenvpnContInstallEnabled != pushButtonProtoOpenvpnContInstallEnabled) {
|
|
||||||
m_pushButtonProtoOpenvpnContInstallEnabled = pushButtonProtoOpenvpnContInstallEnabled;
|
|
||||||
emit pushButtonProtoOpenvpnContInstallEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoSsOpenvpnContInstallEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoSsOpenvpnContInstallEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoSsOpenvpnContInstallEnabled(bool pushButtonProtoSsOpenvpnContInstallEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoSsOpenvpnContInstallEnabled != pushButtonProtoSsOpenvpnContInstallEnabled) {
|
|
||||||
m_pushButtonProtoSsOpenvpnContInstallEnabled = pushButtonProtoSsOpenvpnContInstallEnabled;
|
|
||||||
emit pushButtonProtoSsOpenvpnContInstallEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoCloakOpenvpnContInstallEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoCloakOpenvpnContInstallEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoCloakOpenvpnContInstallEnabled(bool pushButtonProtoCloakOpenvpnContInstallEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoCloakOpenvpnContInstallEnabled != pushButtonProtoCloakOpenvpnContInstallEnabled) {
|
|
||||||
m_pushButtonProtoCloakOpenvpnContInstallEnabled = pushButtonProtoCloakOpenvpnContInstallEnabled;
|
|
||||||
emit pushButtonProtoCloakOpenvpnContInstallEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoWireguardContInstallEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoWireguardContInstallEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoWireguardContInstallEnabled(bool pushButtonProtoWireguardContInstallEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoWireguardContInstallEnabled != pushButtonProtoWireguardContInstallEnabled) {
|
|
||||||
m_pushButtonProtoWireguardContInstallEnabled = pushButtonProtoWireguardContInstallEnabled;
|
|
||||||
emit pushButtonProtoWireguardContInstallEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoOpenvpnContDefaultChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoOpenvpnContDefaultChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoOpenvpnContDefaultChecked(bool pushButtonProtoOpenvpnContDefaultChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoOpenvpnContDefaultChecked != pushButtonProtoOpenvpnContDefaultChecked) {
|
|
||||||
m_pushButtonProtoOpenvpnContDefaultChecked = pushButtonProtoOpenvpnContDefaultChecked;
|
|
||||||
emit pushButtonProtoOpenvpnContDefaultCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoSsOpenvpnContDefaultChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoSsOpenvpnContDefaultChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoSsOpenvpnContDefaultChecked(bool pushButtonProtoSsOpenvpnContDefaultChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoSsOpenvpnContDefaultChecked != pushButtonProtoSsOpenvpnContDefaultChecked) {
|
|
||||||
m_pushButtonProtoSsOpenvpnContDefaultChecked = pushButtonProtoSsOpenvpnContDefaultChecked;
|
|
||||||
emit pushButtonProtoSsOpenvpnContDefaultCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoCloakOpenvpnContDefaultChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoCloakOpenvpnContDefaultChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoCloakOpenvpnContDefaultChecked(bool pushButtonProtoCloakOpenvpnContDefaultChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoCloakOpenvpnContDefaultChecked != pushButtonProtoCloakOpenvpnContDefaultChecked) {
|
|
||||||
m_pushButtonProtoCloakOpenvpnContDefaultChecked = pushButtonProtoCloakOpenvpnContDefaultChecked;
|
|
||||||
emit pushButtonProtoCloakOpenvpnContDefaultCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoWireguardContDefaultChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoWireguardContDefaultChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoWireguardContDefaultChecked(bool pushButtonProtoWireguardContDefaultChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoWireguardContDefaultChecked != pushButtonProtoWireguardContDefaultChecked) {
|
|
||||||
m_pushButtonProtoWireguardContDefaultChecked = pushButtonProtoWireguardContDefaultChecked;
|
|
||||||
emit pushButtonProtoWireguardContDefaultCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoOpenvpnContDefaultVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoOpenvpnContDefaultVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoOpenvpnContDefaultVisible(bool pushButtonProtoOpenvpnContDefaultVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoOpenvpnContDefaultVisible != pushButtonProtoOpenvpnContDefaultVisible) {
|
|
||||||
m_pushButtonProtoOpenvpnContDefaultVisible = pushButtonProtoOpenvpnContDefaultVisible;
|
|
||||||
emit pushButtonProtoOpenvpnContDefaultVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoSsOpenvpnContDefaultVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoSsOpenvpnContDefaultVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoSsOpenvpnContDefaultVisible(bool pushButtonProtoSsOpenvpnContDefaultVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoSsOpenvpnContDefaultVisible != pushButtonProtoSsOpenvpnContDefaultVisible) {
|
|
||||||
m_pushButtonProtoSsOpenvpnContDefaultVisible = pushButtonProtoSsOpenvpnContDefaultVisible;
|
|
||||||
emit pushButtonProtoSsOpenvpnContDefaultVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoCloakOpenvpnContDefaultVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoCloakOpenvpnContDefaultVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoCloakOpenvpnContDefaultVisible(bool pushButtonProtoCloakOpenvpnContDefaultVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoCloakOpenvpnContDefaultVisible != pushButtonProtoCloakOpenvpnContDefaultVisible) {
|
|
||||||
m_pushButtonProtoCloakOpenvpnContDefaultVisible = pushButtonProtoCloakOpenvpnContDefaultVisible;
|
|
||||||
emit pushButtonProtoCloakOpenvpnContDefaultVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoWireguardContDefaultVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoWireguardContDefaultVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoWireguardContDefaultVisible(bool pushButtonProtoWireguardContDefaultVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoWireguardContDefaultVisible != pushButtonProtoWireguardContDefaultVisible) {
|
|
||||||
m_pushButtonProtoWireguardContDefaultVisible = pushButtonProtoWireguardContDefaultVisible;
|
|
||||||
emit pushButtonProtoWireguardContDefaultVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoOpenvpnContShareVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoOpenvpnContShareVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoOpenvpnContShareVisible(bool pushButtonProtoOpenvpnContShareVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoOpenvpnContShareVisible != pushButtonProtoOpenvpnContShareVisible) {
|
|
||||||
m_pushButtonProtoOpenvpnContShareVisible = pushButtonProtoOpenvpnContShareVisible;
|
|
||||||
emit pushButtonProtoOpenvpnContShareVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoSsOpenvpnContShareVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoSsOpenvpnContShareVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoSsOpenvpnContShareVisible(bool pushButtonProtoSsOpenvpnContShareVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoSsOpenvpnContShareVisible != pushButtonProtoSsOpenvpnContShareVisible) {
|
|
||||||
m_pushButtonProtoSsOpenvpnContShareVisible = pushButtonProtoSsOpenvpnContShareVisible;
|
|
||||||
emit pushButtonProtoSsOpenvpnContShareVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoCloakOpenvpnContShareVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoCloakOpenvpnContShareVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoCloakOpenvpnContShareVisible(bool pushButtonProtoCloakOpenvpnContShareVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoCloakOpenvpnContShareVisible != pushButtonProtoCloakOpenvpnContShareVisible) {
|
|
||||||
m_pushButtonProtoCloakOpenvpnContShareVisible = pushButtonProtoCloakOpenvpnContShareVisible;
|
|
||||||
emit pushButtonProtoCloakOpenvpnContShareVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getPushButtonProtoWireguardContShareVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoWireguardContShareVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setPushButtonProtoWireguardContShareVisible(bool pushButtonProtoWireguardContShareVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoWireguardContShareVisible != pushButtonProtoWireguardContShareVisible) {
|
|
||||||
m_pushButtonProtoWireguardContShareVisible = pushButtonProtoWireguardContShareVisible;
|
|
||||||
emit pushButtonProtoWireguardContShareVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getFrameOpenvpnSettingsVisible() const
|
|
||||||
{
|
|
||||||
return m_frameOpenvpnSettingsVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setFrameOpenvpnSettingsVisible(bool frameOpenvpnSettingsVisible)
|
|
||||||
{
|
|
||||||
if (m_frameOpenvpnSettingsVisible != frameOpenvpnSettingsVisible) {
|
|
||||||
m_frameOpenvpnSettingsVisible = frameOpenvpnSettingsVisible;
|
|
||||||
emit frameOpenvpnSettingsVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getFrameOpenvpnSsSettingsVisible() const
|
|
||||||
{
|
|
||||||
return m_frameOpenvpnSsSettingsVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setFrameOpenvpnSsSettingsVisible(bool frameOpenvpnSsSettingsVisible)
|
|
||||||
{
|
|
||||||
if (m_frameOpenvpnSsSettingsVisible != frameOpenvpnSsSettingsVisible) {
|
|
||||||
m_frameOpenvpnSsSettingsVisible = frameOpenvpnSsSettingsVisible;
|
|
||||||
emit frameOpenvpnSsSettingsVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getFrameOpenvpnSsCloakSettingsVisible() const
|
|
||||||
{
|
|
||||||
return m_frameOpenvpnSsCloakSettingsVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setFrameOpenvpnSsCloakSettingsVisible(bool frameOpenvpnSsCloakSettingsVisible)
|
|
||||||
{
|
|
||||||
if (m_frameOpenvpnSsCloakSettingsVisible != frameOpenvpnSsCloakSettingsVisible) {
|
|
||||||
m_frameOpenvpnSsCloakSettingsVisible = frameOpenvpnSsCloakSettingsVisible;
|
|
||||||
emit frameOpenvpnSsCloakSettingsVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getProgressBarProtocolsContainerReinstallVisible() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtocolsContainerReinstallVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setProgressBarProtocolsContainerReinstallVisible(bool progressBarProtocolsContainerReinstallVisible)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtocolsContainerReinstallVisible != progressBarProtocolsContainerReinstallVisible) {
|
|
||||||
m_progressBarProtocolsContainerReinstallVisible = progressBarProtocolsContainerReinstallVisible;
|
|
||||||
emit progressBarProtocolsContainerReinstallVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getFrameWireguardSettingsVisible() const
|
|
||||||
{
|
|
||||||
return m_frameWireguardSettingsVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setFrameWireguardSettingsVisible(bool frameWireguardSettingsVisible)
|
|
||||||
{
|
|
||||||
if (m_frameWireguardSettingsVisible != frameWireguardSettingsVisible) {
|
|
||||||
m_frameWireguardSettingsVisible = frameWireguardSettingsVisible;
|
|
||||||
emit frameWireguardSettingsVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerContainersLogic::getFrameWireguardVisible() const
|
|
||||||
{
|
|
||||||
return m_frameWireguardVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::setFrameWireguardVisible(bool frameWireguardVisible)
|
|
||||||
{
|
|
||||||
if (m_frameWireguardVisible != frameWireguardVisible) {
|
|
||||||
m_frameWireguardVisible = frameWireguardVisible;
|
|
||||||
emit frameWireguardVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContOpenvpnConfigClicked()
|
void ServerContainersLogic::onPushButtonProtoCloakOpenvpnContOpenvpnConfigClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
uiLogic()->selectedDockerContainer = DockerContainer::OpenVpnOverCloak;
|
||||||
|
|
|
||||||
|
|
@ -9,45 +9,43 @@ class ServerContainersLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
AUTO_PROPERTY(int, progressBarProtocolsContainerReinstallValue)
|
||||||
|
AUTO_PROPERTY(int, progressBarProtocolsContainerReinstallMaximium)
|
||||||
|
|
||||||
|
AUTO_PROPERTY(bool, pushButtonOpenvpnContInstallChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContInstallChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContInstallChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonWireguardContInstallChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonOpenvpnContInstallEnabled)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContInstallEnabled)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContInstallEnabled)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonWireguardContInstallEnabled)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonOpenvpnContDefaultChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContDefaultChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContDefaultChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonWireguardContDefaultChecked)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonOpenvpnContDefaultVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContDefaultVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContDefaultVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonWireguardContDefaultVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonOpenvpnContShareVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonSsOpenvpnContShareVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonCloakOpenvpnContShareVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonWireguardContShareVisible)
|
||||||
|
AUTO_PROPERTY(bool, frameOpenvpnSettingsVisible)
|
||||||
|
AUTO_PROPERTY(bool, frameOpenvpnSsSettingsVisible)
|
||||||
|
AUTO_PROPERTY(bool, frameOpenvpnSsCloakSettingsVisible)
|
||||||
|
AUTO_PROPERTY(bool, progressBarProtocolsContainerReinstallVisible)
|
||||||
|
|
||||||
|
AUTO_PROPERTY(bool, frameWireguardSettingsVisible)
|
||||||
|
AUTO_PROPERTY(bool, frameWireguardVisible)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateServerContainersPage();
|
Q_INVOKABLE void updateServerContainersPage();
|
||||||
|
|
||||||
Q_PROPERTY(bool pageServerContainersEnabled READ getPageServerContainersEnabled WRITE setPageServerContainersEnabled NOTIFY pageServerContainersEnabledChanged)
|
|
||||||
Q_PROPERTY(int progressBarProtocolsContainerReinstallValue READ getProgressBarProtocolsContainerReinstallValue WRITE setProgressBarProtocolsContainerReinstallValue NOTIFY progressBarProtocolsContainerReinstallValueChanged)
|
|
||||||
Q_PROPERTY(int progressBarProtocolsContainerReinstallMaximium READ getProgressBarProtocolsContainerReinstallMaximium WRITE setProgressBarProtocolsContainerReinstallMaximium NOTIFY progressBarProtocolsContainerReinstallMaximiumChanged)
|
|
||||||
|
|
||||||
Q_PROPERTY(bool pushButtonProtoOpenvpnContInstallChecked READ getPushButtonProtoOpenvpnContInstallChecked WRITE setPushButtonProtoOpenvpnContInstallChecked NOTIFY pushButtonProtoOpenvpnContInstallCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoSsOpenvpnContInstallChecked READ getPushButtonProtoSsOpenvpnContInstallChecked WRITE setPushButtonProtoSsOpenvpnContInstallChecked NOTIFY pushButtonProtoSsOpenvpnContInstallCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoCloakOpenvpnContInstallChecked READ getPushButtonProtoCloakOpenvpnContInstallChecked WRITE setPushButtonProtoCloakOpenvpnContInstallChecked NOTIFY pushButtonProtoCloakOpenvpnContInstallCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoWireguardContInstallChecked READ getPushButtonProtoWireguardContInstallChecked WRITE setPushButtonProtoWireguardContInstallChecked NOTIFY pushButtonProtoWireguardContInstallCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoOpenvpnContInstallEnabled READ getPushButtonProtoOpenvpnContInstallEnabled WRITE setPushButtonProtoOpenvpnContInstallEnabled NOTIFY pushButtonProtoOpenvpnContInstallEnabledChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoSsOpenvpnContInstallEnabled READ getPushButtonProtoSsOpenvpnContInstallEnabled WRITE setPushButtonProtoSsOpenvpnContInstallEnabled NOTIFY pushButtonProtoSsOpenvpnContInstallEnabledChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoCloakOpenvpnContInstallEnabled READ getPushButtonProtoCloakOpenvpnContInstallEnabled WRITE setPushButtonProtoCloakOpenvpnContInstallEnabled NOTIFY pushButtonProtoCloakOpenvpnContInstallEnabledChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoWireguardContInstallEnabled READ getPushButtonProtoWireguardContInstallEnabled WRITE setPushButtonProtoWireguardContInstallEnabled NOTIFY pushButtonProtoWireguardContInstallEnabledChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoOpenvpnContDefaultChecked READ getPushButtonProtoOpenvpnContDefaultChecked WRITE setPushButtonProtoOpenvpnContDefaultChecked NOTIFY pushButtonProtoOpenvpnContDefaultCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoSsOpenvpnContDefaultChecked READ getPushButtonProtoSsOpenvpnContDefaultChecked WRITE setPushButtonProtoSsOpenvpnContDefaultChecked NOTIFY pushButtonProtoSsOpenvpnContDefaultCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoCloakOpenvpnContDefaultChecked READ getPushButtonProtoCloakOpenvpnContDefaultChecked WRITE setPushButtonProtoCloakOpenvpnContDefaultChecked NOTIFY pushButtonProtoCloakOpenvpnContDefaultCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoWireguardContDefaultChecked READ getPushButtonProtoWireguardContDefaultChecked WRITE setPushButtonProtoWireguardContDefaultChecked NOTIFY pushButtonProtoWireguardContDefaultCheckedChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoOpenvpnContDefaultVisible READ getPushButtonProtoOpenvpnContDefaultVisible WRITE setPushButtonProtoOpenvpnContDefaultVisible NOTIFY pushButtonProtoOpenvpnContDefaultVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoSsOpenvpnContDefaultVisible READ getPushButtonProtoSsOpenvpnContDefaultVisible WRITE setPushButtonProtoSsOpenvpnContDefaultVisible NOTIFY pushButtonProtoSsOpenvpnContDefaultVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoCloakOpenvpnContDefaultVisible READ getPushButtonProtoCloakOpenvpnContDefaultVisible WRITE setPushButtonProtoCloakOpenvpnContDefaultVisible NOTIFY pushButtonProtoCloakOpenvpnContDefaultVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoWireguardContDefaultVisible READ getPushButtonProtoWireguardContDefaultVisible WRITE setPushButtonProtoWireguardContDefaultVisible NOTIFY pushButtonProtoWireguardContDefaultVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoOpenvpnContShareVisible READ getPushButtonProtoOpenvpnContShareVisible WRITE setPushButtonProtoOpenvpnContShareVisible NOTIFY pushButtonProtoOpenvpnContShareVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoSsOpenvpnContShareVisible READ getPushButtonProtoSsOpenvpnContShareVisible WRITE setPushButtonProtoSsOpenvpnContShareVisible NOTIFY pushButtonProtoSsOpenvpnContShareVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoCloakOpenvpnContShareVisible READ getPushButtonProtoCloakOpenvpnContShareVisible WRITE setPushButtonProtoCloakOpenvpnContShareVisible NOTIFY pushButtonProtoCloakOpenvpnContShareVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoWireguardContShareVisible READ getPushButtonProtoWireguardContShareVisible WRITE setPushButtonProtoWireguardContShareVisible NOTIFY pushButtonProtoWireguardContShareVisibleChanged)
|
|
||||||
Q_PROPERTY(bool frameOpenvpnSettingsVisible READ getFrameOpenvpnSettingsVisible WRITE setFrameOpenvpnSettingsVisible NOTIFY frameOpenvpnSettingsVisibleChanged)
|
|
||||||
Q_PROPERTY(bool frameOpenvpnSsSettingsVisible READ getFrameOpenvpnSsSettingsVisible WRITE setFrameOpenvpnSsSettingsVisible NOTIFY frameOpenvpnSsSettingsVisibleChanged)
|
|
||||||
Q_PROPERTY(bool frameOpenvpnSsCloakSettingsVisible READ getFrameOpenvpnSsCloakSettingsVisible WRITE setFrameOpenvpnSsCloakSettingsVisible NOTIFY frameOpenvpnSsCloakSettingsVisibleChanged)
|
|
||||||
Q_PROPERTY(bool progressBarProtocolsContainerReinstallVisible READ getProgressBarProtocolsContainerReinstallVisible WRITE setProgressBarProtocolsContainerReinstallVisible NOTIFY progressBarProtocolsContainerReinstallVisibleChanged)
|
|
||||||
|
|
||||||
Q_PROPERTY(bool frameWireguardSettingsVisible READ getFrameWireguardSettingsVisible WRITE setFrameWireguardSettingsVisible NOTIFY frameWireguardSettingsVisibleChanged)
|
|
||||||
Q_PROPERTY(bool frameWireguardVisible READ getFrameWireguardVisible WRITE setFrameWireguardVisible NOTIFY frameWireguardVisibleChanged)
|
|
||||||
|
|
||||||
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();
|
||||||
|
|
@ -58,150 +56,19 @@ public:
|
||||||
|
|
||||||
void setupProtocolsPageConnections();
|
void setupProtocolsPageConnections();
|
||||||
|
|
||||||
bool getPageServerContainersEnabled() const;
|
|
||||||
void setPageServerContainersEnabled(bool pageServerContainersEnabled);
|
|
||||||
int getProgressBarProtocolsContainerReinstallValue() const;
|
|
||||||
void setProgressBarProtocolsContainerReinstallValue(int progressBarProtocolsContainerReinstallValue);
|
|
||||||
int getProgressBarProtocolsContainerReinstallMaximium() const;
|
|
||||||
void setProgressBarProtocolsContainerReinstallMaximium(int progressBarProtocolsContainerReinstallMaximium);
|
|
||||||
|
|
||||||
bool getPushButtonProtoOpenvpnContInstallChecked() const;
|
|
||||||
void setPushButtonProtoOpenvpnContInstallChecked(bool pushButtonProtoOpenvpnContInstallChecked);
|
|
||||||
bool getPushButtonProtoSsOpenvpnContInstallChecked() const;
|
|
||||||
void setPushButtonProtoSsOpenvpnContInstallChecked(bool pushButtonProtoSsOpenvpnContInstallChecked);
|
|
||||||
bool getPushButtonProtoCloakOpenvpnContInstallChecked() const;
|
|
||||||
void setPushButtonProtoCloakOpenvpnContInstallChecked(bool pushButtonProtoCloakOpenvpnContInstallChecked);
|
|
||||||
bool getPushButtonProtoWireguardContInstallChecked() const;
|
|
||||||
void setPushButtonProtoWireguardContInstallChecked(bool pushButtonProtoWireguardContInstallChecked);
|
|
||||||
bool getPushButtonProtoOpenvpnContInstallEnabled() const;
|
|
||||||
void setPushButtonProtoOpenvpnContInstallEnabled(bool pushButtonProtoOpenvpnContInstallEnabled);
|
|
||||||
bool getPushButtonProtoSsOpenvpnContInstallEnabled() const;
|
|
||||||
void setPushButtonProtoSsOpenvpnContInstallEnabled(bool pushButtonProtoSsOpenvpnContInstallEnabled);
|
|
||||||
bool getPushButtonProtoCloakOpenvpnContInstallEnabled() const;
|
|
||||||
void setPushButtonProtoCloakOpenvpnContInstallEnabled(bool pushButtonProtoCloakOpenvpnContInstallEnabled);
|
|
||||||
bool getPushButtonProtoWireguardContInstallEnabled() const;
|
|
||||||
void setPushButtonProtoWireguardContInstallEnabled(bool pushButtonProtoWireguardContInstallEnabled);
|
|
||||||
bool getPushButtonProtoOpenvpnContDefaultChecked() const;
|
|
||||||
void setPushButtonProtoOpenvpnContDefaultChecked(bool pushButtonProtoOpenvpnContDefaultChecked);
|
|
||||||
bool getPushButtonProtoSsOpenvpnContDefaultChecked() const;
|
|
||||||
void setPushButtonProtoSsOpenvpnContDefaultChecked(bool pushButtonProtoSsOpenvpnContDefaultChecked);
|
|
||||||
bool getPushButtonProtoCloakOpenvpnContDefaultChecked() const;
|
|
||||||
void setPushButtonProtoCloakOpenvpnContDefaultChecked(bool pushButtonProtoCloakOpenvpnContDefaultChecked);
|
|
||||||
bool getPushButtonProtoWireguardContDefaultChecked() const;
|
|
||||||
void setPushButtonProtoWireguardContDefaultChecked(bool pushButtonProtoWireguardContDefaultChecked);
|
|
||||||
bool getPushButtonProtoOpenvpnContDefaultVisible() const;
|
|
||||||
void setPushButtonProtoOpenvpnContDefaultVisible(bool pushButtonProtoOpenvpnContDefaultVisible);
|
|
||||||
bool getPushButtonProtoSsOpenvpnContDefaultVisible() const;
|
|
||||||
void setPushButtonProtoSsOpenvpnContDefaultVisible(bool pushButtonProtoSsOpenvpnContDefaultVisible);
|
|
||||||
bool getPushButtonProtoCloakOpenvpnContDefaultVisible() const;
|
|
||||||
void setPushButtonProtoCloakOpenvpnContDefaultVisible(bool pushButtonProtoCloakOpenvpnContDefaultVisible);
|
|
||||||
bool getPushButtonProtoWireguardContDefaultVisible() const;
|
|
||||||
void setPushButtonProtoWireguardContDefaultVisible(bool pushButtonProtoWireguardContDefaultVisible);
|
|
||||||
bool getPushButtonProtoOpenvpnContShareVisible() const;
|
|
||||||
void setPushButtonProtoOpenvpnContShareVisible(bool pushButtonProtoOpenvpnContShareVisible);
|
|
||||||
bool getPushButtonProtoSsOpenvpnContShareVisible() const;
|
|
||||||
void setPushButtonProtoSsOpenvpnContShareVisible(bool pushButtonProtoSsOpenvpnContShareVisible);
|
|
||||||
bool getPushButtonProtoCloakOpenvpnContShareVisible() const;
|
|
||||||
void setPushButtonProtoCloakOpenvpnContShareVisible(bool pushButtonProtoCloakOpenvpnContShareVisible);
|
|
||||||
bool getPushButtonProtoWireguardContShareVisible() const;
|
|
||||||
void setPushButtonProtoWireguardContShareVisible(bool pushButtonProtoWireguardContShareVisible);
|
|
||||||
bool getFrameOpenvpnSettingsVisible() const;
|
|
||||||
void setFrameOpenvpnSettingsVisible(bool frameOpenvpnSettingsVisible);
|
|
||||||
bool getFrameOpenvpnSsSettingsVisible() const;
|
|
||||||
void setFrameOpenvpnSsSettingsVisible(bool frameOpenvpnSsSettingsVisible);
|
|
||||||
bool getFrameOpenvpnSsCloakSettingsVisible() const;
|
|
||||||
void setFrameOpenvpnSsCloakSettingsVisible(bool frameOpenvpnSsCloakSettingsVisible);
|
|
||||||
bool getProgressBarProtocolsContainerReinstallVisible() const;
|
|
||||||
void setProgressBarProtocolsContainerReinstallVisible(bool progressBarProtocolsContainerReinstallVisible);
|
|
||||||
|
|
||||||
bool getFrameWireguardSettingsVisible() const;
|
|
||||||
void setFrameWireguardSettingsVisible(bool frameWireguardSettingsVisible);
|
|
||||||
bool getFrameWireguardVisible() const;
|
|
||||||
void setFrameWireguardVisible(bool frameWireguardVisible);
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void pageServerContainersEnabledChanged();
|
void pushButtonOpenvpnContDefaultClicked(bool checked);
|
||||||
void progressBarProtocolsContainerReinstallValueChanged();
|
void pushButtonSsOpenvpnContDefaultClicked(bool checked);
|
||||||
void progressBarProtocolsContainerReinstallMaximiumChanged();
|
void pushButtonCloakOpenvpnContDefaultClicked(bool checked);
|
||||||
|
void pushButtonWireguardContDefaultClicked(bool checked);
|
||||||
|
void pushButtonOpenvpnContInstallClicked(bool checked);
|
||||||
|
void pushButtonSsOpenvpnContInstallClicked(bool checked);
|
||||||
|
void pushButtonCloakOpenvpnContInstallClicked(bool checked);
|
||||||
|
void pushButtonWireguardContInstallClicked(bool checked);
|
||||||
|
void pushButtonOpenvpnContShareClicked(bool checked);
|
||||||
|
void pushButtonSsOpenvpnContShareClicked(bool checked);
|
||||||
|
void pushButtonCloakOpenvpnContShareClicked(bool checked);
|
||||||
|
void pushButtonWireguardContShareClicked(bool checked);
|
||||||
|
|
||||||
void pushButtonProtoOpenvpnContInstallCheckedChanged();
|
|
||||||
void pushButtonProtoSsOpenvpnContInstallCheckedChanged();
|
|
||||||
void pushButtonProtoCloakOpenvpnContInstallCheckedChanged();
|
|
||||||
void pushButtonProtoWireguardContInstallCheckedChanged();
|
|
||||||
void pushButtonProtoOpenvpnContInstallEnabledChanged();
|
|
||||||
void pushButtonProtoSsOpenvpnContInstallEnabledChanged();
|
|
||||||
void pushButtonProtoCloakOpenvpnContInstallEnabledChanged();
|
|
||||||
void pushButtonProtoWireguardContInstallEnabledChanged();
|
|
||||||
void pushButtonProtoOpenvpnContDefaultCheckedChanged();
|
|
||||||
void pushButtonProtoSsOpenvpnContDefaultCheckedChanged();
|
|
||||||
void pushButtonProtoCloakOpenvpnContDefaultCheckedChanged();
|
|
||||||
void pushButtonProtoWireguardContDefaultCheckedChanged();
|
|
||||||
void pushButtonProtoOpenvpnContDefaultVisibleChanged();
|
|
||||||
void pushButtonProtoSsOpenvpnContDefaultVisibleChanged();
|
|
||||||
void pushButtonProtoCloakOpenvpnContDefaultVisibleChanged();
|
|
||||||
void pushButtonProtoWireguardContDefaultVisibleChanged();
|
|
||||||
void pushButtonProtoOpenvpnContShareVisibleChanged();
|
|
||||||
void pushButtonProtoSsOpenvpnContShareVisibleChanged();
|
|
||||||
void pushButtonProtoCloakOpenvpnContShareVisibleChanged();
|
|
||||||
void pushButtonProtoWireguardContShareVisibleChanged();
|
|
||||||
void frameOpenvpnSettingsVisibleChanged();
|
|
||||||
void frameOpenvpnSsSettingsVisibleChanged();
|
|
||||||
void frameOpenvpnSsCloakSettingsVisibleChanged();
|
|
||||||
void progressBarProtocolsContainerReinstallVisibleChanged();
|
|
||||||
|
|
||||||
void frameWireguardSettingsVisibleChanged();
|
|
||||||
void frameWireguardVisibleChanged();
|
|
||||||
|
|
||||||
void pushButtonProtoOpenvpnContDefaultClicked(bool checked);
|
|
||||||
void pushButtonProtoSsOpenvpnContDefaultClicked(bool checked);
|
|
||||||
void pushButtonProtoCloakOpenvpnContDefaultClicked(bool checked);
|
|
||||||
void pushButtonProtoWireguardContDefaultClicked(bool checked);
|
|
||||||
void pushButtonProtoOpenvpnContInstallClicked(bool checked);
|
|
||||||
void pushButtonProtoSsOpenvpnContInstallClicked(bool checked);
|
|
||||||
void pushButtonProtoCloakOpenvpnContInstallClicked(bool checked);
|
|
||||||
void pushButtonProtoWireguardContInstallClicked(bool checked);
|
|
||||||
void pushButtonProtoOpenvpnContShareClicked(bool checked);
|
|
||||||
void pushButtonProtoSsOpenvpnContShareClicked(bool checked);
|
|
||||||
void pushButtonProtoCloakOpenvpnContShareClicked(bool checked);
|
|
||||||
void pushButtonProtoWireguardContShareClicked(bool checked);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_pageServerContainersEnabled;
|
|
||||||
int m_progressBarProtocolsContainerReinstallValue;
|
|
||||||
int m_progressBarProtocolsContainerReinstallMaximium;
|
|
||||||
|
|
||||||
bool m_pushButtonProtoOpenvpnContInstallChecked;
|
|
||||||
bool m_pushButtonProtoSsOpenvpnContInstallChecked;
|
|
||||||
bool m_pushButtonProtoCloakOpenvpnContInstallChecked;
|
|
||||||
bool m_pushButtonProtoWireguardContInstallChecked;
|
|
||||||
bool m_pushButtonProtoOpenvpnContInstallEnabled;
|
|
||||||
bool m_pushButtonProtoSsOpenvpnContInstallEnabled;
|
|
||||||
bool m_pushButtonProtoCloakOpenvpnContInstallEnabled;
|
|
||||||
bool m_pushButtonProtoWireguardContInstallEnabled;
|
|
||||||
bool m_pushButtonProtoOpenvpnContDefaultChecked;
|
|
||||||
bool m_pushButtonProtoSsOpenvpnContDefaultChecked;
|
|
||||||
bool m_pushButtonProtoCloakOpenvpnContDefaultChecked;
|
|
||||||
bool m_pushButtonProtoWireguardContDefaultChecked;
|
|
||||||
bool m_pushButtonProtoOpenvpnContDefaultVisible;
|
|
||||||
bool m_pushButtonProtoSsOpenvpnContDefaultVisible;
|
|
||||||
bool m_pushButtonProtoCloakOpenvpnContDefaultVisible;
|
|
||||||
bool m_pushButtonProtoWireguardContDefaultVisible;
|
|
||||||
bool m_pushButtonProtoOpenvpnContShareVisible;
|
|
||||||
bool m_pushButtonProtoSsOpenvpnContShareVisible;
|
|
||||||
bool m_pushButtonProtoCloakOpenvpnContShareVisible;
|
|
||||||
bool m_pushButtonProtoWireguardContShareVisible;
|
|
||||||
bool m_frameOpenvpnSettingsVisible;
|
|
||||||
bool m_frameOpenvpnSsSettingsVisible;
|
|
||||||
bool m_frameOpenvpnSsCloakSettingsVisible;
|
|
||||||
bool m_progressBarProtocolsContainerReinstallVisible;
|
|
||||||
|
|
||||||
bool m_frameWireguardSettingsVisible;
|
|
||||||
bool m_frameWireguardVisible;
|
|
||||||
};
|
};
|
||||||
#endif // SERVER_CONTAINERS_LOGIC_H
|
#endif // SERVER_CONTAINERS_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
#include "ServerListLogic.h"
|
#include "ServerListLogic.h"
|
||||||
|
|
||||||
#include "vpnconnection.h"
|
#include "vpnconnection.h"
|
||||||
|
#include "../serversmodel.h"
|
||||||
#include "../uilogic.h"
|
#include "../uilogic.h"
|
||||||
|
|
||||||
ServerListLogic::ServerListLogic(UiLogic *logic, QObject *parent):
|
ServerListLogic::ServerListLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
@ -10,11 +11,6 @@ ServerListLogic::ServerListLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QObject* ServerListLogic::getServerListModel() const
|
|
||||||
{
|
|
||||||
return m_serverListModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerListLogic::onServerListPushbuttonDefaultClicked(int index)
|
void ServerListLogic::onServerListPushbuttonDefaultClicked(int index)
|
||||||
{
|
{
|
||||||
m_settings.setDefaultServer(index);
|
m_settings.setDefaultServer(index);
|
||||||
|
|
@ -43,5 +39,5 @@ void ServerListLogic::updateServersListPage()
|
||||||
c.isDefault = (i == defaultServer);
|
c.isDefault = (i == defaultServer);
|
||||||
serverListContent.push_back(c);
|
serverListContent.push_back(c);
|
||||||
}
|
}
|
||||||
m_serverListModel->setContent(serverListContent);
|
qobject_cast<ServersModel*>(m_serverListModel)->setContent(serverListContent);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,6 @@
|
||||||
#define SERVER_LIST_LOGIC_H
|
#define SERVER_LIST_LOGIC_H
|
||||||
|
|
||||||
#include "PageLogicBase.h"
|
#include "PageLogicBase.h"
|
||||||
#include "../serversmodel.h"
|
|
||||||
|
|
||||||
class UiLogic;
|
class UiLogic;
|
||||||
|
|
||||||
|
|
@ -10,11 +9,10 @@ class ServerListLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
READONLY_PROPERTY(QObject *, serverListModel)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateServersListPage();
|
Q_INVOKABLE void updateServersListPage();
|
||||||
|
|
||||||
Q_PROPERTY(QObject* serverListModel READ getServerListModel CONSTANT)
|
|
||||||
|
|
||||||
Q_INVOKABLE void onServerListPushbuttonDefaultClicked(int index);
|
Q_INVOKABLE void onServerListPushbuttonDefaultClicked(int index);
|
||||||
Q_INVOKABLE void onServerListPushbuttonSettingsClicked(int index);
|
Q_INVOKABLE void onServerListPushbuttonSettingsClicked(int index);
|
||||||
|
|
||||||
|
|
@ -22,20 +20,5 @@ public:
|
||||||
explicit ServerListLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit ServerListLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~ServerListLogic() = default;
|
~ServerListLogic() = default;
|
||||||
|
|
||||||
QObject* getServerListModel() const;
|
|
||||||
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
ServersModel* m_serverListModel;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // SERVER_LIST_LOGIC_H
|
#endif // SERVER_LIST_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -24,41 +24,27 @@ ServerSettingsLogic::ServerSettingsLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
void ServerSettingsLogic::updateServerSettingsPage()
|
void ServerSettingsLogic::updateServerSettingsPage()
|
||||||
{
|
{
|
||||||
setLabelServerSettingsWaitInfoVisible(false);
|
set_labelServerSettingsWaitInfoVisible(false);
|
||||||
setLabelServerSettingsWaitInfoText("");
|
set_labelServerSettingsWaitInfoText("");
|
||||||
setPushButtonServerSettingsClearVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
set_pushButtonServerSettingsClearVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
||||||
setPushButtonServerSettingsClearClientCacheVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
set_pushButtonServerSettingsClearClientCacheVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
||||||
setPushButtonServerSettingsShareFullVisible(m_settings.haveAuthData(uiLogic()->selectedServerIndex));
|
set_pushButtonServerSettingsShareFullVisible(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();
|
||||||
setLabelServerSettingsServerText(QString("%1@%2%3%4")
|
set_labelServerSettingsServerText(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));
|
||||||
setLineEditServerSettingsDescriptionText(server.value(config_key::description).toString());
|
set_lineEditServerSettingsDescriptionText(server.value(config_key::description).toString());
|
||||||
QString selectedContainerName = m_settings.defaultContainerName(uiLogic()->selectedServerIndex);
|
QString selectedContainerName = m_settings.defaultContainerName(uiLogic()->selectedServerIndex);
|
||||||
setLabelServerSettingsCurrentVpnProtocolText(tr("Protocol: ") + selectedContainerName);
|
set_labelServerSettingsCurrentVpnProtocolText(tr("Protocol: ") + selectedContainerName);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ServerSettingsLogic::getPageServerSettingsEnabled() const
|
|
||||||
{
|
|
||||||
return m_pageServerSettingsEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setPageServerSettingsEnabled(bool pageServerSettingsEnabled)
|
|
||||||
{
|
|
||||||
if (m_pageServerSettingsEnabled != pageServerSettingsEnabled) {
|
|
||||||
m_pageServerSettingsEnabled = pageServerSettingsEnabled;
|
|
||||||
emit pageServerSettingsEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsClearServer()
|
void ServerSettingsLogic::onPushButtonServerSettingsClearServer()
|
||||||
{
|
{
|
||||||
setPageServerSettingsEnabled(false);
|
set_pageServerSettingsEnabled(false);
|
||||||
setPushButtonServerSettingsClearText(tr("Uninstalling Amnezia software..."));
|
set_pushButtonServerSettingsClearText(tr("Uninstalling Amnezia software..."));
|
||||||
|
|
||||||
if (m_settings.defaultServerIndex() == uiLogic()->selectedServerIndex) {
|
if (m_settings.defaultServerIndex() == uiLogic()->selectedServerIndex) {
|
||||||
uiLogic()->vpnLogic()->onDisconnect();
|
uiLogic()->vpnLogic()->onDisconnect();
|
||||||
|
|
@ -74,15 +60,15 @@ void ServerSettingsLogic::onPushButtonServerSettingsClearServer()
|
||||||
emit uiLogic()->showConnectErrorDialog();
|
emit uiLogic()->showConnectErrorDialog();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setLabelServerSettingsWaitInfoVisible(true);
|
set_labelServerSettingsWaitInfoVisible(true);
|
||||||
setLabelServerSettingsWaitInfoText(tr("Amnezia server successfully uninstalled"));
|
set_labelServerSettingsWaitInfoText(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);
|
||||||
|
|
||||||
setPageServerSettingsEnabled(true);
|
set_pageServerSettingsEnabled(true);
|
||||||
setPushButtonServerSettingsClearText(tr("Clear server from Amnezia software"));
|
set_pushButtonServerSettingsClearText(tr("Clear server from Amnezia software"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsForgetServer()
|
void ServerSettingsLogic::onPushButtonServerSettingsForgetServer()
|
||||||
|
|
@ -116,128 +102,9 @@ void ServerSettingsLogic::onPushButtonServerSettingsForgetServer()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool ServerSettingsLogic::getLabelServerSettingsWaitInfoVisible() const
|
|
||||||
{
|
|
||||||
return m_labelServerSettingsWaitInfoVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setLabelServerSettingsWaitInfoVisible(bool labelServerSettingsWaitInfoVisible)
|
|
||||||
{
|
|
||||||
if (m_labelServerSettingsWaitInfoVisible != labelServerSettingsWaitInfoVisible) {
|
|
||||||
m_labelServerSettingsWaitInfoVisible = labelServerSettingsWaitInfoVisible;
|
|
||||||
emit labelServerSettingsWaitInfoVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ServerSettingsLogic::getLabelServerSettingsWaitInfoText() const
|
|
||||||
{
|
|
||||||
return m_labelServerSettingsWaitInfoText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setLabelServerSettingsWaitInfoText(const QString &labelServerSettingsWaitInfoText)
|
|
||||||
{
|
|
||||||
if (m_labelServerSettingsWaitInfoText != labelServerSettingsWaitInfoText) {
|
|
||||||
m_labelServerSettingsWaitInfoText = labelServerSettingsWaitInfoText;
|
|
||||||
emit labelServerSettingsWaitInfoTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerSettingsLogic::getPushButtonServerSettingsClearVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonServerSettingsClearVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setPushButtonServerSettingsClearVisible(bool pushButtonServerSettingsClearVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonServerSettingsClearVisible != pushButtonServerSettingsClearVisible) {
|
|
||||||
m_pushButtonServerSettingsClearVisible = pushButtonServerSettingsClearVisible;
|
|
||||||
emit pushButtonServerSettingsClearVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerSettingsLogic::getPushButtonServerSettingsClearClientCacheVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonServerSettingsClearClientCacheVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setPushButtonServerSettingsClearClientCacheVisible(bool pushButtonServerSettingsClearClientCacheVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonServerSettingsClearClientCacheVisible != pushButtonServerSettingsClearClientCacheVisible) {
|
|
||||||
m_pushButtonServerSettingsClearClientCacheVisible = pushButtonServerSettingsClearClientCacheVisible;
|
|
||||||
emit pushButtonServerSettingsClearClientCacheVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ServerSettingsLogic::getPushButtonServerSettingsShareFullVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonServerSettingsShareFullVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setPushButtonServerSettingsShareFullVisible(bool pushButtonServerSettingsShareFullVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonServerSettingsShareFullVisible != pushButtonServerSettingsShareFullVisible) {
|
|
||||||
m_pushButtonServerSettingsShareFullVisible = pushButtonServerSettingsShareFullVisible;
|
|
||||||
emit pushButtonServerSettingsShareFullVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ServerSettingsLogic::getLabelServerSettingsServerText() const
|
|
||||||
{
|
|
||||||
return m_labelServerSettingsServerText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setLabelServerSettingsServerText(const QString &labelServerSettingsServerText)
|
|
||||||
{
|
|
||||||
if (m_labelServerSettingsServerText != labelServerSettingsServerText) {
|
|
||||||
m_labelServerSettingsServerText = labelServerSettingsServerText;
|
|
||||||
emit labelServerSettingsServerTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ServerSettingsLogic::getLineEditServerSettingsDescriptionText() const
|
|
||||||
{
|
|
||||||
return m_lineEditServerSettingsDescriptionText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setLineEditServerSettingsDescriptionText(const QString &lineEditServerSettingsDescriptionText)
|
|
||||||
{
|
|
||||||
if (m_lineEditServerSettingsDescriptionText != lineEditServerSettingsDescriptionText) {
|
|
||||||
m_lineEditServerSettingsDescriptionText = lineEditServerSettingsDescriptionText;
|
|
||||||
emit lineEditServerSettingsDescriptionTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ServerSettingsLogic::getLabelServerSettingsCurrentVpnProtocolText() const
|
|
||||||
{
|
|
||||||
return m_labelServerSettingsCurrentVpnProtocolText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setLabelServerSettingsCurrentVpnProtocolText(const QString &labelServerSettingsCurrentVpnProtocolText)
|
|
||||||
{
|
|
||||||
if (m_labelServerSettingsCurrentVpnProtocolText != labelServerSettingsCurrentVpnProtocolText) {
|
|
||||||
m_labelServerSettingsCurrentVpnProtocolText = labelServerSettingsCurrentVpnProtocolText;
|
|
||||||
emit labelServerSettingsCurrentVpnProtocolTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ServerSettingsLogic::getPushButtonServerSettingsClearText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonServerSettingsClearText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setPushButtonServerSettingsClearText(const QString &pushButtonServerSettingsClearText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonServerSettingsClearText != pushButtonServerSettingsClearText) {
|
|
||||||
m_pushButtonServerSettingsClearText = pushButtonServerSettingsClearText;
|
|
||||||
emit pushButtonServerSettingsClearTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsClearClientCacheClicked()
|
void ServerSettingsLogic::onPushButtonServerSettingsClearClientCacheClicked()
|
||||||
{
|
{
|
||||||
setPushButtonServerSettingsClearClientCacheText(tr("Cache cleared"));
|
set_pushButtonServerSettingsClearClientCacheText(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()) {
|
||||||
|
|
@ -245,32 +112,19 @@ void ServerSettingsLogic::onPushButtonServerSettingsClearClientCacheClicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
setPushButtonServerSettingsClearClientCacheText(tr("Clear client cached profile"));
|
set_pushButtonServerSettingsClearClientCacheText(tr("Clear client cached profile"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServerSettingsLogic::onLineEditServerSettingsDescriptionEditingFinished()
|
void ServerSettingsLogic::onLineEditServerSettingsDescriptionEditingFinished()
|
||||||
{
|
{
|
||||||
const QString &newText = getLineEditServerSettingsDescriptionText();
|
const QString &newText = lineEditServerSettingsDescriptionText();
|
||||||
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()->updateServersListPage();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ServerSettingsLogic::getPushButtonServerSettingsClearClientCacheText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonServerSettingsClearClientCacheText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::setPushButtonServerSettingsClearClientCacheText(const QString &pushButtonServerSettingsClearClientCacheText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonServerSettingsClearClientCacheText != pushButtonServerSettingsClearClientCacheText) {
|
|
||||||
m_pushButtonServerSettingsClearClientCacheText = pushButtonServerSettingsClearClientCacheText;
|
|
||||||
emit pushButtonServerSettingsClearClientCacheTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ServerSettingsLogic::onPushButtonServerSettingsShareFullClicked()
|
void ServerSettingsLogic::onPushButtonServerSettingsShareFullClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->shareConnectionLogic()->updateSharingPage(uiLogic()->selectedServerIndex, m_settings.serverCredentials(uiLogic()->selectedServerIndex), DockerContainer::None);
|
uiLogic()->shareConnectionLogic()->updateSharingPage(uiLogic()->selectedServerIndex, m_settings.serverCredentials(uiLogic()->selectedServerIndex), DockerContainer::None);
|
||||||
|
|
|
||||||
|
|
@ -9,23 +9,21 @@ class ServerSettingsLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
AUTO_PROPERTY(bool, pageServerSettingsEnabled)
|
||||||
|
AUTO_PROPERTY(bool, labelServerSettingsWaitInfoVisible)
|
||||||
|
AUTO_PROPERTY(QString, labelServerSettingsWaitInfoText)
|
||||||
|
AUTO_PROPERTY(QString, pushButtonServerSettingsClearText)
|
||||||
|
AUTO_PROPERTY(QString, pushButtonServerSettingsClearClientCacheText)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonServerSettingsClearVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonServerSettingsClearClientCacheVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonServerSettingsShareFullVisible)
|
||||||
|
AUTO_PROPERTY(QString, labelServerSettingsServerText)
|
||||||
|
AUTO_PROPERTY(QString, lineEditServerSettingsDescriptionText)
|
||||||
|
AUTO_PROPERTY(QString, labelServerSettingsCurrentVpnProtocolText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateServerSettingsPage();
|
Q_INVOKABLE void updateServerSettingsPage();
|
||||||
|
|
||||||
Q_PROPERTY(bool pageServerSettingsEnabled READ getPageServerSettingsEnabled WRITE setPageServerSettingsEnabled NOTIFY pageServerSettingsEnabledChanged)
|
|
||||||
|
|
||||||
Q_PROPERTY(bool labelServerSettingsWaitInfoVisible READ getLabelServerSettingsWaitInfoVisible WRITE setLabelServerSettingsWaitInfoVisible NOTIFY labelServerSettingsWaitInfoVisibleChanged)
|
|
||||||
Q_PROPERTY(QString labelServerSettingsWaitInfoText READ getLabelServerSettingsWaitInfoText WRITE setLabelServerSettingsWaitInfoText NOTIFY labelServerSettingsWaitInfoTextChanged)
|
|
||||||
Q_PROPERTY(QString pushButtonServerSettingsClearText READ getPushButtonServerSettingsClearText WRITE setPushButtonServerSettingsClearText NOTIFY pushButtonServerSettingsClearTextChanged)
|
|
||||||
Q_PROPERTY(QString pushButtonServerSettingsClearClientCacheText READ getPushButtonServerSettingsClearClientCacheText WRITE setPushButtonServerSettingsClearClientCacheText NOTIFY pushButtonServerSettingsClearClientCacheTextChanged)
|
|
||||||
|
|
||||||
Q_PROPERTY(bool pushButtonServerSettingsClearVisible READ getPushButtonServerSettingsClearVisible WRITE setPushButtonServerSettingsClearVisible NOTIFY pushButtonServerSettingsClearVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonServerSettingsClearClientCacheVisible READ getPushButtonServerSettingsClearClientCacheVisible WRITE setPushButtonServerSettingsClearClientCacheVisible NOTIFY pushButtonServerSettingsClearClientCacheVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonServerSettingsShareFullVisible READ getPushButtonServerSettingsShareFullVisible WRITE setPushButtonServerSettingsShareFullVisible NOTIFY pushButtonServerSettingsShareFullVisibleChanged)
|
|
||||||
Q_PROPERTY(QString labelServerSettingsServerText READ getLabelServerSettingsServerText WRITE setLabelServerSettingsServerText NOTIFY labelServerSettingsServerTextChanged)
|
|
||||||
Q_PROPERTY(QString lineEditServerSettingsDescriptionText READ getLineEditServerSettingsDescriptionText WRITE setLineEditServerSettingsDescriptionText NOTIFY lineEditServerSettingsDescriptionTextChanged)
|
|
||||||
Q_PROPERTY(QString labelServerSettingsCurrentVpnProtocolText READ getLabelServerSettingsCurrentVpnProtocolText WRITE setLabelServerSettingsCurrentVpnProtocolText NOTIFY labelServerSettingsCurrentVpnProtocolTextChanged)
|
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonServerSettingsClearServer();
|
Q_INVOKABLE void onPushButtonServerSettingsClearServer();
|
||||||
Q_INVOKABLE void onPushButtonServerSettingsForgetServer();
|
Q_INVOKABLE void onPushButtonServerSettingsForgetServer();
|
||||||
Q_INVOKABLE void onPushButtonServerSettingsShareFullClicked();
|
Q_INVOKABLE void onPushButtonServerSettingsShareFullClicked();
|
||||||
|
|
@ -36,63 +34,5 @@ public:
|
||||||
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit ServerSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~ServerSettingsLogic() = default;
|
~ServerSettingsLogic() = default;
|
||||||
|
|
||||||
bool getPageServerSettingsEnabled() const;
|
|
||||||
void setPageServerSettingsEnabled(bool pageServerSettingsEnabled);
|
|
||||||
|
|
||||||
bool getLabelServerSettingsWaitInfoVisible() const;
|
|
||||||
void setLabelServerSettingsWaitInfoVisible(bool labelServerSettingsWaitInfoVisible);
|
|
||||||
QString getLabelServerSettingsWaitInfoText() const;
|
|
||||||
void setLabelServerSettingsWaitInfoText(const QString &labelServerSettingsWaitInfoText);
|
|
||||||
bool getPushButtonServerSettingsClearVisible() const;
|
|
||||||
void setPushButtonServerSettingsClearVisible(bool pushButtonServerSettingsClearVisible);
|
|
||||||
bool getPushButtonServerSettingsClearClientCacheVisible() const;
|
|
||||||
void setPushButtonServerSettingsClearClientCacheVisible(bool pushButtonServerSettingsClearClientCacheVisible);
|
|
||||||
bool getPushButtonServerSettingsShareFullVisible() const;
|
|
||||||
void setPushButtonServerSettingsShareFullVisible(bool pushButtonServerSettingsShareFullVisible);
|
|
||||||
QString getLabelServerSettingsServerText() const;
|
|
||||||
void setLabelServerSettingsServerText(const QString &labelServerSettingsServerText);
|
|
||||||
QString getLineEditServerSettingsDescriptionText() const;
|
|
||||||
void setLineEditServerSettingsDescriptionText(const QString &lineEditServerSettingsDescriptionText);
|
|
||||||
QString getLabelServerSettingsCurrentVpnProtocolText() const;
|
|
||||||
void setLabelServerSettingsCurrentVpnProtocolText(const QString &labelServerSettingsCurrentVpnProtocolText);
|
|
||||||
|
|
||||||
QString getPushButtonServerSettingsClearText() const;
|
|
||||||
void setPushButtonServerSettingsClearText(const QString &pushButtonServerSettingsClearText);
|
|
||||||
QString getPushButtonServerSettingsClearClientCacheText() const;
|
|
||||||
void setPushButtonServerSettingsClearClientCacheText(const QString &pushButtonServerSettingsClearClientCacheText);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void pageServerSettingsEnabledChanged();
|
|
||||||
void labelServerSettingsWaitInfoVisibleChanged();
|
|
||||||
void labelServerSettingsWaitInfoTextChanged();
|
|
||||||
void pushButtonServerSettingsClearTextChanged();
|
|
||||||
void pushButtonServerSettingsClearVisibleChanged();
|
|
||||||
void pushButtonServerSettingsClearClientCacheVisibleChanged();
|
|
||||||
void pushButtonServerSettingsShareFullVisibleChanged();
|
|
||||||
void pushButtonServerSettingsClearClientCacheTextChanged();
|
|
||||||
void labelServerSettingsServerTextChanged();
|
|
||||||
void lineEditServerSettingsDescriptionTextChanged();
|
|
||||||
void labelServerSettingsCurrentVpnProtocolTextChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_pageServerSettingsEnabled;
|
|
||||||
bool m_labelServerSettingsWaitInfoVisible;
|
|
||||||
bool m_pushButtonServerSettingsClearVisible;
|
|
||||||
bool m_pushButtonServerSettingsClearClientCacheVisible;
|
|
||||||
bool m_pushButtonServerSettingsShareFullVisible;
|
|
||||||
|
|
||||||
QString m_lineEditServerSettingsDescriptionText;
|
|
||||||
QString m_labelServerSettingsCurrentVpnProtocolText;
|
|
||||||
QString m_labelServerSettingsServerText;
|
|
||||||
QString m_labelServerSettingsWaitInfoText;
|
|
||||||
QString m_pushButtonServerSettingsClearText;
|
|
||||||
QString m_pushButtonServerSettingsClearClientCacheText;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // SERVER_SETTINGS_LOGIC_H
|
#endif // SERVER_SETTINGS_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -57,476 +57,87 @@ ShareConnectionLogic::ShareConnectionLogic(UiLogic *logic, QObject *parent):
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPageShareAmneziaVisible() const
|
|
||||||
{
|
|
||||||
return m_pageShareAmneziaVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPageShareAmneziaVisible(bool pageShareAmneziaVisible)
|
|
||||||
{
|
|
||||||
if (m_pageShareAmneziaVisible != pageShareAmneziaVisible) {
|
|
||||||
m_pageShareAmneziaVisible = pageShareAmneziaVisible;
|
|
||||||
emit pageShareAmneziaVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPageShareOpenvpnVisible() const
|
|
||||||
{
|
|
||||||
return m_pageShareOpenvpnVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPageShareOpenvpnVisible(bool pageShareOpenvpnVisible)
|
|
||||||
{
|
|
||||||
if (m_pageShareOpenvpnVisible != pageShareOpenvpnVisible) {
|
|
||||||
m_pageShareOpenvpnVisible = pageShareOpenvpnVisible;
|
|
||||||
emit pageShareOpenvpnVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPageShareShadowsocksVisible() const
|
|
||||||
{
|
|
||||||
return m_pageShareShadowsocksVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPageShareShadowsocksVisible(bool pageShareShadowsocksVisible)
|
|
||||||
{
|
|
||||||
if (m_pageShareShadowsocksVisible != pageShareShadowsocksVisible) {
|
|
||||||
m_pageShareShadowsocksVisible = pageShareShadowsocksVisible;
|
|
||||||
emit pageShareShadowsocksVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPageShareCloakVisible() const
|
|
||||||
{
|
|
||||||
return m_pageShareCloakVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPageShareCloakVisible(bool pageShareCloakVisible)
|
|
||||||
{
|
|
||||||
if (m_pageShareCloakVisible != pageShareCloakVisible) {
|
|
||||||
m_pageShareCloakVisible = pageShareCloakVisible;
|
|
||||||
emit pageShareCloakVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPageShareFullAccessVisible() const
|
|
||||||
{
|
|
||||||
return m_pageShareFullAccessVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPageShareFullAccessVisible(bool pageShareFullAccessVisible)
|
|
||||||
{
|
|
||||||
if (m_pageShareFullAccessVisible != pageShareFullAccessVisible) {
|
|
||||||
m_pageShareFullAccessVisible = pageShareFullAccessVisible;
|
|
||||||
emit pageShareFullAccessVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getTextEditShareOpenvpnCodeText() const
|
|
||||||
{
|
|
||||||
return m_textEditShareOpenvpnCodeText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setTextEditShareOpenvpnCodeText(const QString &textEditShareOpenvpnCodeText)
|
|
||||||
{
|
|
||||||
if (m_textEditShareOpenvpnCodeText != textEditShareOpenvpnCodeText) {
|
|
||||||
m_textEditShareOpenvpnCodeText = textEditShareOpenvpnCodeText;
|
|
||||||
emit textEditShareOpenvpnCodeTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPushButtonShareOpenvpnCopyEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareOpenvpnCopyEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareOpenvpnCopyEnabled(bool pushButtonShareOpenvpnCopyEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareOpenvpnCopyEnabled != pushButtonShareOpenvpnCopyEnabled) {
|
|
||||||
m_pushButtonShareOpenvpnCopyEnabled = pushButtonShareOpenvpnCopyEnabled;
|
|
||||||
emit pushButtonShareOpenvpnCopyEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPushButtonShareOpenvpnSaveEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareOpenvpnSaveEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareOpenvpnSaveEnabled(bool pushButtonShareOpenvpnSaveEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareOpenvpnSaveEnabled != pushButtonShareOpenvpnSaveEnabled) {
|
|
||||||
m_pushButtonShareOpenvpnSaveEnabled = pushButtonShareOpenvpnSaveEnabled;
|
|
||||||
emit pushButtonShareOpenvpnSaveEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int ShareConnectionLogic::getToolBoxShareConnectionCurrentIndex() const
|
|
||||||
{
|
|
||||||
return m_toolBoxShareConnectionCurrentIndex;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setToolBoxShareConnectionCurrentIndex(int toolBoxShareConnectionCurrentIndex)
|
|
||||||
{
|
|
||||||
if (m_toolBoxShareConnectionCurrentIndex != toolBoxShareConnectionCurrentIndex) {
|
|
||||||
m_toolBoxShareConnectionCurrentIndex = toolBoxShareConnectionCurrentIndex;
|
|
||||||
emit toolBoxShareConnectionCurrentIndexChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPushButtonShareSsCopyEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareSsCopyEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareSsCopyEnabled(bool pushButtonShareSsCopyEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareSsCopyEnabled != pushButtonShareSsCopyEnabled) {
|
|
||||||
m_pushButtonShareSsCopyEnabled = pushButtonShareSsCopyEnabled;
|
|
||||||
emit pushButtonShareSsCopyEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getLineEditShareSsStringText() const
|
|
||||||
{
|
|
||||||
return m_lineEditShareSsStringText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setLineEditShareSsStringText(const QString &lineEditShareSsStringText)
|
|
||||||
{
|
|
||||||
if (m_lineEditShareSsStringText != lineEditShareSsStringText) {
|
|
||||||
m_lineEditShareSsStringText = lineEditShareSsStringText;
|
|
||||||
emit lineEditShareSsStringTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getLabelShareSsQrCodeText() const
|
|
||||||
{
|
|
||||||
return m_labelShareSsQrCodeText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setLabelShareSsQrCodeText(const QString &labelShareSsQrCodeText)
|
|
||||||
{
|
|
||||||
if (m_labelShareSsQrCodeText != labelShareSsQrCodeText) {
|
|
||||||
m_labelShareSsQrCodeText = labelShareSsQrCodeText;
|
|
||||||
emit labelShareSsQrCodeTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getLabelShareSsServerText() const
|
|
||||||
{
|
|
||||||
return m_labelShareSsServerText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setLabelShareSsServerText(const QString &labelShareSsServerText)
|
|
||||||
{
|
|
||||||
if (m_labelShareSsServerText != labelShareSsServerText) {
|
|
||||||
m_labelShareSsServerText = labelShareSsServerText;
|
|
||||||
emit labelShareSsServerTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getLabelShareSsPortText() const
|
|
||||||
{
|
|
||||||
return m_labelShareSsPortText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setLabelShareSsPortText(const QString &labelShareSsPortText)
|
|
||||||
{
|
|
||||||
if (m_labelShareSsPortText != labelShareSsPortText) {
|
|
||||||
m_labelShareSsPortText = labelShareSsPortText;
|
|
||||||
emit labelShareSsPortTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getLabelShareSsMethodText() const
|
|
||||||
{
|
|
||||||
return m_labelShareSsMethodText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setLabelShareSsMethodText(const QString &labelShareSsMethodText)
|
|
||||||
{
|
|
||||||
if (m_labelShareSsMethodText != labelShareSsMethodText) {
|
|
||||||
m_labelShareSsMethodText = labelShareSsMethodText;
|
|
||||||
emit labelShareSsMethodTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getLabelShareSsPasswordText() const
|
|
||||||
{
|
|
||||||
return m_labelShareSsPasswordText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setLabelShareSsPasswordText(const QString &labelShareSsPasswordText)
|
|
||||||
{
|
|
||||||
if (m_labelShareSsPasswordText != labelShareSsPasswordText) {
|
|
||||||
m_labelShareSsPasswordText = labelShareSsPasswordText;
|
|
||||||
emit labelShareSsPasswordTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getPlainTextEditShareCloakText() const
|
|
||||||
{
|
|
||||||
return m_plainTextEditShareCloakText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPlainTextEditShareCloakText(const QString &plainTextEditShareCloakText)
|
|
||||||
{
|
|
||||||
if (m_plainTextEditShareCloakText != plainTextEditShareCloakText) {
|
|
||||||
m_plainTextEditShareCloakText = plainTextEditShareCloakText;
|
|
||||||
emit plainTextEditShareCloakTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPushButtonShareCloakCopyEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareCloakCopyEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareCloakCopyEnabled(bool pushButtonShareCloakCopyEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareCloakCopyEnabled != pushButtonShareCloakCopyEnabled) {
|
|
||||||
m_pushButtonShareCloakCopyEnabled = pushButtonShareCloakCopyEnabled;
|
|
||||||
emit pushButtonShareCloakCopyEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getTextEditShareFullCodeText() const
|
|
||||||
{
|
|
||||||
return m_textEditShareFullCodeText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setTextEditShareFullCodeText(const QString &textEditShareFullCodeText)
|
|
||||||
{
|
|
||||||
if (m_textEditShareFullCodeText != textEditShareFullCodeText) {
|
|
||||||
m_textEditShareFullCodeText = textEditShareFullCodeText;
|
|
||||||
emit textEditShareFullCodeTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getTextEditShareAmneziaCodeText() const
|
|
||||||
{
|
|
||||||
return m_textEditShareAmneziaCodeText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setTextEditShareAmneziaCodeText(const QString &textEditShareAmneziaCodeText)
|
|
||||||
{
|
|
||||||
if (m_textEditShareAmneziaCodeText != textEditShareAmneziaCodeText) {
|
|
||||||
m_textEditShareAmneziaCodeText = textEditShareAmneziaCodeText;
|
|
||||||
emit textEditShareAmneziaCodeTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getPushButtonShareFullCopyText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareFullCopyText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareFullCopyText(const QString &pushButtonShareFullCopyText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareFullCopyText != pushButtonShareFullCopyText) {
|
|
||||||
m_pushButtonShareFullCopyText = pushButtonShareFullCopyText;
|
|
||||||
emit pushButtonShareFullCopyTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
QString ShareConnectionLogic::getPushButtonShareAmneziaCopyText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareAmneziaCopyText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareAmneziaCopyText(const QString &pushButtonShareAmneziaCopyText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareAmneziaCopyText != pushButtonShareAmneziaCopyText) {
|
|
||||||
m_pushButtonShareAmneziaCopyText = pushButtonShareAmneziaCopyText;
|
|
||||||
emit pushButtonShareAmneziaCopyTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getPushButtonShareOpenvpnCopyText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareOpenvpnCopyText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareOpenvpnCopyText(const QString &pushButtonShareOpenvpnCopyText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareOpenvpnCopyText != pushButtonShareOpenvpnCopyText) {
|
|
||||||
m_pushButtonShareOpenvpnCopyText = pushButtonShareOpenvpnCopyText;
|
|
||||||
emit pushButtonShareOpenvpnCopyTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getPushButtonShareSsCopyText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareSsCopyText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareSsCopyText(const QString &pushButtonShareSsCopyText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareSsCopyText != pushButtonShareSsCopyText) {
|
|
||||||
m_pushButtonShareSsCopyText = pushButtonShareSsCopyText;
|
|
||||||
emit pushButtonShareSsCopyTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getPushButtonShareCloakCopyText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareCloakCopyText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareCloakCopyText(const QString &pushButtonShareCloakCopyText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareCloakCopyText != pushButtonShareCloakCopyText) {
|
|
||||||
m_pushButtonShareCloakCopyText = pushButtonShareCloakCopyText;
|
|
||||||
emit pushButtonShareCloakCopyTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPushButtonShareAmneziaGenerateEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareAmneziaGenerateEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareAmneziaGenerateEnabled(bool pushButtonShareAmneziaGenerateEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareAmneziaGenerateEnabled != pushButtonShareAmneziaGenerateEnabled) {
|
|
||||||
m_pushButtonShareAmneziaGenerateEnabled = pushButtonShareAmneziaGenerateEnabled;
|
|
||||||
emit pushButtonShareAmneziaGenerateEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPushButtonShareAmneziaCopyEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareAmneziaCopyEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareAmneziaCopyEnabled(bool pushButtonShareAmneziaCopyEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareAmneziaCopyEnabled != pushButtonShareAmneziaCopyEnabled) {
|
|
||||||
m_pushButtonShareAmneziaCopyEnabled = pushButtonShareAmneziaCopyEnabled;
|
|
||||||
emit pushButtonShareAmneziaCopyEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getPushButtonShareAmneziaGenerateText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareAmneziaGenerateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareAmneziaGenerateText(const QString &pushButtonShareAmneziaGenerateText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareAmneziaGenerateText != pushButtonShareAmneziaGenerateText) {
|
|
||||||
m_pushButtonShareAmneziaGenerateText = pushButtonShareAmneziaGenerateText;
|
|
||||||
emit pushButtonShareAmneziaGenerateTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShareConnectionLogic::getPushButtonShareOpenvpnGenerateEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareOpenvpnGenerateEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareOpenvpnGenerateEnabled(bool pushButtonShareOpenvpnGenerateEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareOpenvpnGenerateEnabled != pushButtonShareOpenvpnGenerateEnabled) {
|
|
||||||
m_pushButtonShareOpenvpnGenerateEnabled = pushButtonShareOpenvpnGenerateEnabled;
|
|
||||||
emit pushButtonShareOpenvpnGenerateEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShareConnectionLogic::getPushButtonShareOpenvpnGenerateText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonShareOpenvpnGenerateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::setPushButtonShareOpenvpnGenerateText(const QString &pushButtonShareOpenvpnGenerateText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonShareOpenvpnGenerateText != pushButtonShareOpenvpnGenerateText) {
|
|
||||||
m_pushButtonShareOpenvpnGenerateText = pushButtonShareOpenvpnGenerateText;
|
|
||||||
emit pushButtonShareOpenvpnGenerateTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareFullCopyClicked()
|
void ShareConnectionLogic::onPushButtonShareFullCopyClicked()
|
||||||
{
|
{
|
||||||
QGuiApplication::clipboard()->setText(getTextEditShareFullCodeText());
|
QGuiApplication::clipboard()->setText(textEditShareFullCodeText());
|
||||||
setPushButtonShareFullCopyText(tr("Copied"));
|
set_pushButtonShareFullCopyText(tr("Copied"));
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
setPushButtonShareFullCopyText(tr("Copy"));
|
set_pushButtonShareFullCopyText(tr("Copy"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareFullSaveClicked()
|
void ShareConnectionLogic::onPushButtonShareFullSaveClicked()
|
||||||
{
|
{
|
||||||
if (getTextEditShareFullCodeText().isEmpty()) return;
|
if (textEditShareFullCodeText().isEmpty()) return;
|
||||||
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save AmneziaVPN config"),
|
QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save AmneziaVPN config"),
|
||||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.amnezia");
|
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.amnezia");
|
||||||
QSaveFile save(fileName);
|
QSaveFile save(fileName);
|
||||||
save.open(QIODevice::WriteOnly);
|
save.open(QIODevice::WriteOnly);
|
||||||
save.write(getTextEditShareFullCodeText().toUtf8());
|
save.write(textEditShareFullCodeText().toUtf8());
|
||||||
save.commit();
|
save.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareAmneziaCopyClicked()
|
void ShareConnectionLogic::onPushButtonShareAmneziaCopyClicked()
|
||||||
{
|
{
|
||||||
if (getTextEditShareAmneziaCodeText().isEmpty()) return;
|
if (textEditShareAmneziaCodeText().isEmpty()) return;
|
||||||
|
|
||||||
QGuiApplication::clipboard()->setText(getTextEditShareAmneziaCodeText());
|
QGuiApplication::clipboard()->setText(textEditShareAmneziaCodeText());
|
||||||
setPushButtonShareAmneziaCopyText(tr("Copied"));
|
set_pushButtonShareAmneziaCopyText(tr("Copied"));
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
setPushButtonShareAmneziaCopyText(tr("Copy"));
|
set_pushButtonShareAmneziaCopyText(tr("Copy"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareAmneziaSaveClicked()
|
void ShareConnectionLogic::onPushButtonShareAmneziaSaveClicked()
|
||||||
{
|
{
|
||||||
if (getTextEditShareAmneziaCodeText().isEmpty()) return;
|
if (textEditShareAmneziaCodeText().isEmpty()) return;
|
||||||
|
|
||||||
QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save AmneziaVPN config"),
|
QString fileName = QFileDialog::getSaveFileName(nullptr, tr("Save AmneziaVPN config"),
|
||||||
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.amnezia");
|
QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.amnezia");
|
||||||
QSaveFile save(fileName);
|
QSaveFile save(fileName);
|
||||||
save.open(QIODevice::WriteOnly);
|
save.open(QIODevice::WriteOnly);
|
||||||
save.write(getTextEditShareAmneziaCodeText().toUtf8());
|
save.write(textEditShareAmneziaCodeText().toUtf8());
|
||||||
save.commit();
|
save.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareOpenvpnCopyClicked()
|
void ShareConnectionLogic::onPushButtonShareOpenvpnCopyClicked()
|
||||||
{
|
{
|
||||||
QGuiApplication::clipboard()->setText(getTextEditShareOpenvpnCodeText());
|
QGuiApplication::clipboard()->setText(textEditShareOpenvpnCodeText());
|
||||||
setPushButtonShareOpenvpnCopyText(tr("Copied"));
|
set_pushButtonShareOpenvpnCopyText(tr("Copied"));
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
setPushButtonShareOpenvpnCopyText(tr("Copy"));
|
set_pushButtonShareOpenvpnCopyText(tr("Copy"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareSsCopyClicked()
|
void ShareConnectionLogic::onPushButtonShareSsCopyClicked()
|
||||||
{
|
{
|
||||||
QGuiApplication::clipboard()->setText(getLineEditShareSsStringText());
|
QGuiApplication::clipboard()->setText(lineEditShareSsStringText());
|
||||||
setPushButtonShareSsCopyText(tr("Copied"));
|
set_pushButtonShareSsCopyText(tr("Copied"));
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
setPushButtonShareSsCopyText(tr("Copy"));
|
set_pushButtonShareSsCopyText(tr("Copy"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareCloakCopyClicked()
|
void ShareConnectionLogic::onPushButtonShareCloakCopyClicked()
|
||||||
{
|
{
|
||||||
QGuiApplication::clipboard()->setText(getPlainTextEditShareCloakText());
|
QGuiApplication::clipboard()->setText(plainTextEditShareCloakText());
|
||||||
setPushButtonShareCloakCopyText(tr("Copied"));
|
set_pushButtonShareCloakCopyText(tr("Copied"));
|
||||||
|
|
||||||
QTimer::singleShot(3000, this, [this]() {
|
QTimer::singleShot(3000, this, [this]() {
|
||||||
setPushButtonShareCloakCopyText(tr("Copy"));
|
set_pushButtonShareCloakCopyText(tr("Copy"));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
||||||
{
|
{
|
||||||
setPushButtonShareAmneziaGenerateEnabled(false);
|
set_pushButtonShareAmneziaGenerateEnabled(false);
|
||||||
setPushButtonShareAmneziaCopyEnabled(false);
|
set_pushButtonShareAmneziaCopyEnabled(false);
|
||||||
setPushButtonShareAmneziaGenerateText(tr("Generating..."));
|
set_pushButtonShareAmneziaGenerateText(tr("Generating..."));
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
ServerCredentials credentials = m_settings.serverCredentials(uiLogic()->selectedServerIndex);
|
ServerCredentials credentials = m_settings.serverCredentials(uiLogic()->selectedServerIndex);
|
||||||
|
|
@ -558,23 +169,23 @@ void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
||||||
|
|
||||||
|
|
||||||
ba = QJsonDocument(serverConfig).toJson().toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
ba = QJsonDocument(serverConfig).toJson().toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
||||||
setTextEditShareAmneziaCodeText(QString("vpn://%1").arg(QString(ba)));
|
set_textEditShareAmneziaCodeText(QString("vpn://%1").arg(QString(ba)));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
setTextEditShareAmneziaCodeText(tr("Error while generating connection profile"));
|
set_textEditShareAmneziaCodeText(tr("Error while generating connection profile"));
|
||||||
}
|
}
|
||||||
|
|
||||||
setPushButtonShareAmneziaGenerateEnabled(true);
|
set_pushButtonShareAmneziaGenerateEnabled(true);
|
||||||
setPushButtonShareAmneziaCopyEnabled(true);
|
set_pushButtonShareAmneziaCopyEnabled(true);
|
||||||
setPushButtonShareAmneziaGenerateText(tr("Generate config"));
|
set_pushButtonShareAmneziaGenerateText(tr("Generate config"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareOpenvpnGenerateClicked()
|
void ShareConnectionLogic::onPushButtonShareOpenvpnGenerateClicked()
|
||||||
{
|
{
|
||||||
setPushButtonShareOpenvpnGenerateEnabled(false);
|
set_pushButtonShareOpenvpnGenerateEnabled(false);
|
||||||
setPushButtonShareOpenvpnCopyEnabled(false);
|
set_pushButtonShareOpenvpnCopyEnabled(false);
|
||||||
setPushButtonShareOpenvpnSaveEnabled(false);
|
set_pushButtonShareOpenvpnSaveEnabled(false);
|
||||||
setPushButtonShareOpenvpnGenerateText(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);
|
||||||
|
|
@ -583,12 +194,12 @@ 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);
|
||||||
|
|
||||||
setTextEditShareOpenvpnCodeText(cfg);
|
set_textEditShareOpenvpnCodeText(cfg);
|
||||||
|
|
||||||
setPushButtonShareOpenvpnGenerateEnabled(true);
|
set_pushButtonShareOpenvpnGenerateEnabled(true);
|
||||||
setPushButtonShareOpenvpnCopyEnabled(true);
|
set_pushButtonShareOpenvpnCopyEnabled(true);
|
||||||
setPushButtonShareOpenvpnSaveEnabled(true);
|
set_pushButtonShareOpenvpnSaveEnabled(true);
|
||||||
setPushButtonShareOpenvpnGenerateText(tr("Generate config"));
|
set_pushButtonShareOpenvpnGenerateText(tr("Generate config"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void ShareConnectionLogic::onPushButtonShareOpenvpnSaveClicked()
|
void ShareConnectionLogic::onPushButtonShareOpenvpnSaveClicked()
|
||||||
|
|
@ -598,7 +209,7 @@ void ShareConnectionLogic::onPushButtonShareOpenvpnSaveClicked()
|
||||||
|
|
||||||
QSaveFile save(fileName);
|
QSaveFile save(fileName);
|
||||||
save.open(QIODevice::WriteOnly);
|
save.open(QIODevice::WriteOnly);
|
||||||
save.write(getTextEditShareOpenvpnCodeText().toUtf8());
|
save.write(textEditShareOpenvpnCodeText().toUtf8());
|
||||||
save.commit();
|
save.commit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -611,11 +222,11 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
|
|
||||||
//const QJsonObject &containerConfig = m_settings.containerConfig(serverIndex, container);
|
//const QJsonObject &containerConfig = m_settings.containerConfig(serverIndex, container);
|
||||||
|
|
||||||
setPageShareAmneziaVisible(false);
|
set_pageShareAmneziaVisible(false);
|
||||||
setPageShareOpenvpnVisible(false);
|
set_pageShareOpenvpnVisible(false);
|
||||||
setPageShareShadowsocksVisible(false);
|
set_pageShareShadowsocksVisible(false);
|
||||||
setPageShareCloakVisible(false);
|
set_pageShareCloakVisible(false);
|
||||||
setPageShareFullAccessVisible(false);
|
set_pageShareFullAccessVisible(false);
|
||||||
|
|
||||||
enum currentWidget {
|
enum currentWidget {
|
||||||
full_access = 0,
|
full_access = 0,
|
||||||
|
|
@ -626,21 +237,21 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
};
|
};
|
||||||
|
|
||||||
if (container == DockerContainer::OpenVpn) {
|
if (container == DockerContainer::OpenVpn) {
|
||||||
setPageShareAmneziaVisible(true);
|
set_pageShareAmneziaVisible(true);
|
||||||
setPageShareOpenvpnVisible(true);
|
set_pageShareOpenvpnVisible(true);
|
||||||
|
|
||||||
QString cfg = tr("Press Generate config");
|
QString cfg = tr("Press Generate config");
|
||||||
setTextEditShareOpenvpnCodeText(cfg);
|
set_textEditShareOpenvpnCodeText(cfg);
|
||||||
setPushButtonShareOpenvpnCopyEnabled(false);
|
set_pushButtonShareOpenvpnCopyEnabled(false);
|
||||||
setPushButtonShareOpenvpnSaveEnabled(false);
|
set_pushButtonShareOpenvpnSaveEnabled(false);
|
||||||
|
|
||||||
setToolBoxShareConnectionCurrentIndex(share_openvpn);
|
set_toolBoxShareConnectionCurrentIndex(share_openvpn);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container == DockerContainer::OpenVpnOverShadowSocks ||
|
if (container == DockerContainer::OpenVpnOverShadowSocks ||
|
||||||
container == DockerContainer::OpenVpnOverCloak) {
|
container == DockerContainer::OpenVpnOverCloak) {
|
||||||
setPageShareAmneziaVisible(true);
|
set_pageShareAmneziaVisible(true);
|
||||||
setPageShareShadowsocksVisible(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();
|
||||||
|
|
@ -651,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);
|
||||||
|
|
||||||
setPushButtonShareSsCopyEnabled(true);
|
set_pushButtonShareSsCopyEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject ssConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
QJsonObject ssConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
||||||
|
|
@ -663,23 +274,23 @@ 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();
|
||||||
setLineEditShareSsStringText(ssString);
|
set_lineEditShareSsStringText(ssString);
|
||||||
updateQRCodeImage(ssString, [this](const QString& labelText) ->void {
|
updateQRCodeImage(ssString, [this](const QString& labelText) ->void {
|
||||||
setLabelShareSsQrCodeText(labelText);
|
set_labelShareSsQrCodeText(labelText);
|
||||||
});
|
});
|
||||||
|
|
||||||
setLabelShareSsServerText(ssConfig.value("server").toString());
|
set_labelShareSsServerText(ssConfig.value("server").toString());
|
||||||
setLabelShareSsPortText(ssConfig.value("server_port").toString());
|
set_labelShareSsPortText(ssConfig.value("server_port").toString());
|
||||||
setLabelShareSsMethodText(ssConfig.value("method").toString());
|
set_labelShareSsMethodText(ssConfig.value("method").toString());
|
||||||
setLabelShareSsPasswordText(ssConfig.value("password").toString());
|
set_labelShareSsPasswordText(ssConfig.value("password").toString());
|
||||||
|
|
||||||
setToolBoxShareConnectionCurrentIndex(share_shadowshock);
|
set_toolBoxShareConnectionCurrentIndex(share_shadowshock);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container == DockerContainer::OpenVpnOverCloak) {
|
if (container == DockerContainer::OpenVpnOverCloak) {
|
||||||
//ui->toolBox_share_connection->addItem(ui->page_share_amnezia, tr(" Share for Amnezia client"));
|
//ui->toolBox_share_connection->addItem(ui->page_share_amnezia, tr(" Share for Amnezia client"));
|
||||||
setPageShareCloakVisible(true);
|
set_pageShareCloakVisible(true);
|
||||||
setPlainTextEditShareCloakText(QString(""));
|
set_plainTextEditShareCloakText(QString(""));
|
||||||
|
|
||||||
QJsonObject protoConfig = m_settings.protocolConfig(serverIndex, container, Protocol::Cloak);
|
QJsonObject protoConfig = m_settings.protocolConfig(serverIndex, container, Protocol::Cloak);
|
||||||
QString cfg = protoConfig.value(config_key::last_config).toString();
|
QString cfg = protoConfig.value(config_key::last_config).toString();
|
||||||
|
|
@ -690,26 +301,26 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
ErrorCode e = ErrorCode::NoError;
|
ErrorCode e = ErrorCode::NoError;
|
||||||
cfg = CloakConfigurator::genCloakConfig(credentials, container, containerConfig, &e);
|
cfg = CloakConfigurator::genCloakConfig(credentials, container, containerConfig, &e);
|
||||||
|
|
||||||
setPushButtonShareCloakCopyEnabled(true);
|
set_pushButtonShareCloakCopyEnabled(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject cloakConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
QJsonObject cloakConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
||||||
cloakConfig.remove(config_key::transport_proto);
|
cloakConfig.remove(config_key::transport_proto);
|
||||||
cloakConfig.insert("ProxyMethod", "shadowsocks");
|
cloakConfig.insert("ProxyMethod", "shadowsocks");
|
||||||
|
|
||||||
setPlainTextEditShareCloakText(QJsonDocument(cloakConfig).toJson());
|
set_plainTextEditShareCloakText(QJsonDocument(cloakConfig).toJson());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Full access
|
// Full access
|
||||||
if (container == DockerContainer::None) {
|
if (container == DockerContainer::None) {
|
||||||
setPageShareFullAccessVisible(true);
|
set_pageShareFullAccessVisible(true);
|
||||||
|
|
||||||
const QJsonObject &server = m_settings.server(uiLogic()->selectedServerIndex);
|
const QJsonObject &server = m_settings.server(uiLogic()->selectedServerIndex);
|
||||||
|
|
||||||
QByteArray ba = QJsonDocument(server).toJson().toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
QByteArray ba = QJsonDocument(server).toJson().toBase64(QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals);
|
||||||
|
|
||||||
setTextEditShareFullCodeText(QString("vpn://%1").arg(QString(ba)));
|
set_textEditShareFullCodeText(QString("vpn://%1").arg(QString(ba)));
|
||||||
setToolBoxShareConnectionCurrentIndex(full_access);
|
set_toolBoxShareConnectionCurrentIndex(full_access);
|
||||||
}
|
}
|
||||||
|
|
||||||
//ui->toolBox_share_connection->addItem(ui->page_share_amnezia, tr(" Share for Amnezia client"));
|
//ui->toolBox_share_connection->addItem(ui->page_share_amnezia, tr(" Share for Amnezia client"));
|
||||||
|
|
@ -725,11 +336,11 @@ void ShareConnectionLogic::updateSharingPage(int serverIndex, const ServerCreden
|
||||||
|
|
||||||
// ui->textEdit_share_amnezia_code->setPlainText(QJsonDocument(exportContainer).toJson());
|
// ui->textEdit_share_amnezia_code->setPlainText(QJsonDocument(exportContainer).toJson());
|
||||||
|
|
||||||
setTextEditShareAmneziaCodeText(tr(""));
|
set_textEditShareAmneziaCodeText(tr(""));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ShareConnectionLogic::updateQRCodeImage(const QString &text, const std::function<void(const QString&)>& setLabelFunc)
|
void ShareConnectionLogic::updateQRCodeImage(const QString &text, const std::function<void(const QString&)>& set_labelFunc)
|
||||||
{
|
{
|
||||||
int levelIndex = 1;
|
int levelIndex = 1;
|
||||||
int versionIndex = 0;
|
int versionIndex = 0;
|
||||||
|
|
@ -755,5 +366,5 @@ void ShareConnectionLogic::updateQRCodeImage(const QString &text, const std::fun
|
||||||
encodeImage.save(&buffer, "PNG"); // writes the image in PNG format inside the buffer
|
encodeImage.save(&buffer, "PNG"); // writes the image in PNG format inside the buffer
|
||||||
QString iconBase64 = QString::fromLatin1(byteArray.toBase64().data());
|
QString iconBase64 = QString::fromLatin1(byteArray.toBase64().data());
|
||||||
|
|
||||||
setLabelFunc(iconBase64);
|
set_labelFunc(iconBase64);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -11,107 +11,38 @@ class ShareConnectionLogic: public PageLogicBase
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_PROPERTY(bool pageShareAmneziaVisible READ getPageShareAmneziaVisible WRITE setPageShareAmneziaVisible NOTIFY pageShareAmneziaVisibleChanged)
|
AUTO_PROPERTY(bool, pageShareAmneziaVisible)
|
||||||
Q_PROPERTY(bool pageShareOpenvpnVisible READ getPageShareOpenvpnVisible WRITE setPageShareOpenvpnVisible NOTIFY pageShareOpenvpnVisibleChanged)
|
AUTO_PROPERTY(bool, pageShareOpenvpnVisible)
|
||||||
Q_PROPERTY(bool pageShareShadowsocksVisible READ getPageShareShadowsocksVisible WRITE setPageShareShadowsocksVisible NOTIFY pageShareShadowsocksVisibleChanged)
|
AUTO_PROPERTY(bool, pageShareShadowsocksVisible)
|
||||||
Q_PROPERTY(bool pageShareCloakVisible READ getPageShareCloakVisible WRITE setPageShareCloakVisible NOTIFY pageShareCloakVisibleChanged)
|
AUTO_PROPERTY(bool, pageShareCloakVisible)
|
||||||
Q_PROPERTY(bool pageShareFullAccessVisible READ getPageShareFullAccessVisible WRITE setPageShareFullAccessVisible NOTIFY pageShareFullAccessVisibleChanged)
|
AUTO_PROPERTY(bool, pageShareFullAccessVisible)
|
||||||
Q_PROPERTY(QString textEditShareOpenvpnCodeText READ getTextEditShareOpenvpnCodeText WRITE setTextEditShareOpenvpnCodeText NOTIFY textEditShareOpenvpnCodeTextChanged)
|
AUTO_PROPERTY(QString, textEditShareOpenvpnCodeText)
|
||||||
Q_PROPERTY(bool pushButtonShareOpenvpnCopyEnabled READ getPushButtonShareOpenvpnCopyEnabled WRITE setPushButtonShareOpenvpnCopyEnabled NOTIFY pushButtonShareOpenvpnCopyEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonShareOpenvpnCopyEnabled)
|
||||||
Q_PROPERTY(bool pushButtonShareOpenvpnSaveEnabled READ getPushButtonShareOpenvpnSaveEnabled WRITE setPushButtonShareOpenvpnSaveEnabled NOTIFY pushButtonShareOpenvpnSaveEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonShareOpenvpnSaveEnabled)
|
||||||
Q_PROPERTY(int toolBoxShareConnectionCurrentIndex READ getToolBoxShareConnectionCurrentIndex WRITE setToolBoxShareConnectionCurrentIndex NOTIFY toolBoxShareConnectionCurrentIndexChanged)
|
AUTO_PROPERTY(int, toolBoxShareConnectionCurrentIndex)
|
||||||
Q_PROPERTY(bool pushButtonShareSsCopyEnabled READ getPushButtonShareSsCopyEnabled WRITE setPushButtonShareSsCopyEnabled NOTIFY pushButtonShareSsCopyEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonShareSsCopyEnabled)
|
||||||
Q_PROPERTY(QString lineEditShareSsStringText READ getLineEditShareSsStringText WRITE setLineEditShareSsStringText NOTIFY lineEditShareSsStringTextChanged)
|
AUTO_PROPERTY(QString, lineEditShareSsStringText)
|
||||||
Q_PROPERTY(QString labelShareSsQrCodeText READ getLabelShareSsQrCodeText WRITE setLabelShareSsQrCodeText NOTIFY labelShareSsQrCodeTextChanged)
|
AUTO_PROPERTY(QString, labelShareSsQrCodeText)
|
||||||
Q_PROPERTY(QString labelShareSsServerText READ getLabelShareSsServerText WRITE setLabelShareSsServerText NOTIFY labelShareSsServerTextChanged)
|
AUTO_PROPERTY(QString, labelShareSsServerText)
|
||||||
Q_PROPERTY(QString labelShareSsPortText READ getLabelShareSsPortText WRITE setLabelShareSsPortText NOTIFY labelShareSsPortTextChanged)
|
AUTO_PROPERTY(QString, labelShareSsPortText)
|
||||||
Q_PROPERTY(QString labelShareSsMethodText READ getLabelShareSsMethodText WRITE setLabelShareSsMethodText NOTIFY labelShareSsMethodTextChanged)
|
AUTO_PROPERTY(QString, labelShareSsMethodText)
|
||||||
Q_PROPERTY(QString labelShareSsPasswordText READ getLabelShareSsPasswordText WRITE setLabelShareSsPasswordText NOTIFY labelShareSsPasswordTextChanged)
|
AUTO_PROPERTY(QString, labelShareSsPasswordText)
|
||||||
Q_PROPERTY(QString plainTextEditShareCloakText READ getPlainTextEditShareCloakText WRITE setPlainTextEditShareCloakText NOTIFY plainTextEditShareCloakTextChanged)
|
AUTO_PROPERTY(QString, plainTextEditShareCloakText)
|
||||||
Q_PROPERTY(bool pushButtonShareCloakCopyEnabled READ getPushButtonShareCloakCopyEnabled WRITE setPushButtonShareCloakCopyEnabled NOTIFY pushButtonShareCloakCopyEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonShareCloakCopyEnabled)
|
||||||
Q_PROPERTY(QString textEditShareFullCodeText READ getTextEditShareFullCodeText WRITE setTextEditShareFullCodeText NOTIFY textEditShareFullCodeTextChanged)
|
AUTO_PROPERTY(QString, textEditShareFullCodeText)
|
||||||
Q_PROPERTY(QString textEditShareAmneziaCodeText READ getTextEditShareAmneziaCodeText WRITE setTextEditShareAmneziaCodeText NOTIFY textEditShareAmneziaCodeTextChanged)
|
AUTO_PROPERTY(QString, textEditShareAmneziaCodeText)
|
||||||
Q_PROPERTY(QString pushButtonShareFullCopyText READ getPushButtonShareFullCopyText WRITE setPushButtonShareFullCopyText NOTIFY pushButtonShareFullCopyTextChanged)
|
AUTO_PROPERTY(QString, pushButtonShareFullCopyText)
|
||||||
Q_PROPERTY(QString pushButtonShareAmneziaCopyText READ getPushButtonShareAmneziaCopyText WRITE setPushButtonShareAmneziaCopyText NOTIFY pushButtonShareAmneziaCopyTextChanged)
|
AUTO_PROPERTY(QString, pushButtonShareAmneziaCopyText)
|
||||||
Q_PROPERTY(QString pushButtonShareOpenvpnCopyText READ getPushButtonShareOpenvpnCopyText WRITE setPushButtonShareOpenvpnCopyText NOTIFY pushButtonShareOpenvpnCopyTextChanged)
|
AUTO_PROPERTY(QString, pushButtonShareOpenvpnCopyText)
|
||||||
Q_PROPERTY(QString pushButtonShareSsCopyText READ getPushButtonShareSsCopyText WRITE setPushButtonShareSsCopyText NOTIFY pushButtonShareSsCopyTextChanged)
|
AUTO_PROPERTY(QString, pushButtonShareSsCopyText)
|
||||||
Q_PROPERTY(QString pushButtonShareCloakCopyText READ getPushButtonShareCloakCopyText WRITE setPushButtonShareCloakCopyText NOTIFY pushButtonShareCloakCopyTextChanged)
|
AUTO_PROPERTY(QString, pushButtonShareCloakCopyText)
|
||||||
Q_PROPERTY(bool pushButtonShareAmneziaGenerateEnabled READ getPushButtonShareAmneziaGenerateEnabled WRITE setPushButtonShareAmneziaGenerateEnabled NOTIFY pushButtonShareAmneziaGenerateEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonShareAmneziaGenerateEnabled)
|
||||||
Q_PROPERTY(bool pushButtonShareAmneziaCopyEnabled READ getPushButtonShareAmneziaCopyEnabled WRITE setPushButtonShareAmneziaCopyEnabled NOTIFY pushButtonShareAmneziaCopyEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonShareAmneziaCopyEnabled)
|
||||||
Q_PROPERTY(QString pushButtonShareAmneziaGenerateText READ getPushButtonShareAmneziaGenerateText WRITE setPushButtonShareAmneziaGenerateText NOTIFY pushButtonShareAmneziaGenerateTextChanged)
|
AUTO_PROPERTY(QString, pushButtonShareAmneziaGenerateText)
|
||||||
Q_PROPERTY(bool pushButtonShareOpenvpnGenerateEnabled READ getPushButtonShareOpenvpnGenerateEnabled WRITE setPushButtonShareOpenvpnGenerateEnabled NOTIFY pushButtonShareOpenvpnGenerateEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonShareOpenvpnGenerateEnabled)
|
||||||
Q_PROPERTY(QString pushButtonShareOpenvpnGenerateText READ getPushButtonShareOpenvpnGenerateText WRITE setPushButtonShareOpenvpnGenerateText NOTIFY pushButtonShareOpenvpnGenerateTextChanged)
|
AUTO_PROPERTY(QString, pushButtonShareOpenvpnGenerateText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ShareConnectionLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
|
||||||
~ShareConnectionLogic() = default;
|
|
||||||
|
|
||||||
void updateSharingPage(int serverIndex, const ServerCredentials &credentials,
|
|
||||||
DockerContainer container);
|
|
||||||
void updateQRCodeImage(const QString &text, const std::function<void(const QString&)>& setLabelFunc);
|
|
||||||
|
|
||||||
bool getPageShareAmneziaVisible() const;
|
|
||||||
void setPageShareAmneziaVisible(bool pageShareAmneziaVisible);
|
|
||||||
bool getPageShareOpenvpnVisible() const;
|
|
||||||
void setPageShareOpenvpnVisible(bool pageShareOpenvpnVisible);
|
|
||||||
bool getPageShareShadowsocksVisible() const;
|
|
||||||
void setPageShareShadowsocksVisible(bool pageShareShadowsocksVisible);
|
|
||||||
bool getPageShareCloakVisible() const;
|
|
||||||
void setPageShareCloakVisible(bool pageShareCloakVisible);
|
|
||||||
bool getPageShareFullAccessVisible() const;
|
|
||||||
void setPageShareFullAccessVisible(bool pageShareFullAccessVisible);
|
|
||||||
QString getTextEditShareOpenvpnCodeText() const;
|
|
||||||
void setTextEditShareOpenvpnCodeText(const QString &textEditShareOpenvpnCodeText);
|
|
||||||
bool getPushButtonShareOpenvpnCopyEnabled() const;
|
|
||||||
void setPushButtonShareOpenvpnCopyEnabled(bool pushButtonShareOpenvpnCopyEnabled);
|
|
||||||
bool getPushButtonShareOpenvpnSaveEnabled() const;
|
|
||||||
void setPushButtonShareOpenvpnSaveEnabled(bool pushButtonShareOpenvpnSaveEnabled);
|
|
||||||
int getToolBoxShareConnectionCurrentIndex() const;
|
|
||||||
void setToolBoxShareConnectionCurrentIndex(int toolBoxShareConnectionCurrentIndex);
|
|
||||||
bool getPushButtonShareSsCopyEnabled() const;
|
|
||||||
void setPushButtonShareSsCopyEnabled(bool pushButtonShareSsCopyEnabled);
|
|
||||||
QString getLineEditShareSsStringText() const;
|
|
||||||
void setLineEditShareSsStringText(const QString &lineEditShareSsStringText);
|
|
||||||
QString getLabelShareSsQrCodeText() const;
|
|
||||||
void setLabelShareSsQrCodeText(const QString &labelShareSsQrCodeText);
|
|
||||||
QString getLabelShareSsServerText() const;
|
|
||||||
void setLabelShareSsServerText(const QString &labelShareSsServerText);
|
|
||||||
QString getLabelShareSsPortText() const;
|
|
||||||
void setLabelShareSsPortText(const QString &labelShareSsPortText);
|
|
||||||
QString getLabelShareSsMethodText() const;
|
|
||||||
void setLabelShareSsMethodText(const QString &labelShareSsMethodText);
|
|
||||||
QString getLabelShareSsPasswordText() const;
|
|
||||||
void setLabelShareSsPasswordText(const QString &labelShareSsPasswordText);
|
|
||||||
QString getPlainTextEditShareCloakText() const;
|
|
||||||
void setPlainTextEditShareCloakText(const QString &plainTextEditShareCloakText);
|
|
||||||
bool getPushButtonShareCloakCopyEnabled() const;
|
|
||||||
void setPushButtonShareCloakCopyEnabled(bool pushButtonShareCloakCopyEnabled);
|
|
||||||
QString getTextEditShareFullCodeText() const;
|
|
||||||
void setTextEditShareFullCodeText(const QString &textEditShareFullCodeText);
|
|
||||||
QString getTextEditShareAmneziaCodeText() const;
|
|
||||||
void setTextEditShareAmneziaCodeText(const QString &textEditShareAmneziaCodeText);
|
|
||||||
QString getPushButtonShareFullCopyText() const;
|
|
||||||
void setPushButtonShareFullCopyText(const QString &pushButtonShareFullCopyText);
|
|
||||||
QString getPushButtonShareAmneziaCopyText() const;
|
|
||||||
void setPushButtonShareAmneziaCopyText(const QString &pushButtonShareAmneziaCopyText);
|
|
||||||
QString getPushButtonShareOpenvpnCopyText() const;
|
|
||||||
void setPushButtonShareOpenvpnCopyText(const QString &pushButtonShareOpenvpnCopyText);
|
|
||||||
QString getPushButtonShareSsCopyText() const;
|
|
||||||
void setPushButtonShareSsCopyText(const QString &pushButtonShareSsCopyText);
|
|
||||||
QString getPushButtonShareCloakCopyText() const;
|
|
||||||
void setPushButtonShareCloakCopyText(const QString &pushButtonShareCloakCopyText);
|
|
||||||
bool getPushButtonShareAmneziaGenerateEnabled() const;
|
|
||||||
void setPushButtonShareAmneziaGenerateEnabled(bool pushButtonShareAmneziaGenerateEnabled);
|
|
||||||
bool getPushButtonShareAmneziaCopyEnabled() const;
|
|
||||||
void setPushButtonShareAmneziaCopyEnabled(bool pushButtonShareAmneziaCopyEnabled);
|
|
||||||
QString getPushButtonShareAmneziaGenerateText() const;
|
|
||||||
void setPushButtonShareAmneziaGenerateText(const QString &pushButtonShareAmneziaGenerateText);
|
|
||||||
bool getPushButtonShareOpenvpnGenerateEnabled() const;
|
|
||||||
void setPushButtonShareOpenvpnGenerateEnabled(bool pushButtonShareOpenvpnGenerateEnabled);
|
|
||||||
QString getPushButtonShareOpenvpnGenerateText() const;
|
|
||||||
void setPushButtonShareOpenvpnGenerateText(const QString &pushButtonShareOpenvpnGenerateText);
|
|
||||||
|
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonShareFullCopyClicked();
|
Q_INVOKABLE void onPushButtonShareFullCopyClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareFullSaveClicked();
|
Q_INVOKABLE void onPushButtonShareFullSaveClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareAmneziaCopyClicked();
|
Q_INVOKABLE void onPushButtonShareAmneziaCopyClicked();
|
||||||
|
|
@ -123,77 +54,16 @@ public:
|
||||||
Q_INVOKABLE void onPushButtonShareOpenvpnGenerateClicked();
|
Q_INVOKABLE void onPushButtonShareOpenvpnGenerateClicked();
|
||||||
Q_INVOKABLE void onPushButtonShareOpenvpnSaveClicked();
|
Q_INVOKABLE void onPushButtonShareOpenvpnSaveClicked();
|
||||||
|
|
||||||
signals:
|
public:
|
||||||
void pageShareAmneziaVisibleChanged();
|
explicit ShareConnectionLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
void pageShareOpenvpnVisibleChanged();
|
~ShareConnectionLogic() = default;
|
||||||
void pageShareShadowsocksVisibleChanged();
|
|
||||||
void pageShareCloakVisibleChanged();
|
|
||||||
void pageShareFullAccessVisibleChanged();
|
|
||||||
void textEditShareOpenvpnCodeTextChanged();
|
|
||||||
void pushButtonShareOpenvpnCopyEnabledChanged();
|
|
||||||
void pushButtonShareOpenvpnSaveEnabledChanged();
|
|
||||||
void toolBoxShareConnectionCurrentIndexChanged();
|
|
||||||
void pushButtonShareSsCopyEnabledChanged();
|
|
||||||
void lineEditShareSsStringTextChanged();
|
|
||||||
void labelShareSsQrCodeTextChanged();
|
|
||||||
void labelShareSsServerTextChanged();
|
|
||||||
void labelShareSsPortTextChanged();
|
|
||||||
void labelShareSsMethodTextChanged();
|
|
||||||
void labelShareSsPasswordTextChanged();
|
|
||||||
void plainTextEditShareCloakTextChanged();
|
|
||||||
void pushButtonShareCloakCopyEnabledChanged();
|
|
||||||
void textEditShareFullCodeTextChanged();
|
|
||||||
void textEditShareAmneziaCodeTextChanged();
|
|
||||||
void pushButtonShareFullCopyTextChanged();
|
|
||||||
void pushButtonShareAmneziaCopyTextChanged();
|
|
||||||
void pushButtonShareOpenvpnCopyTextChanged();
|
|
||||||
void pushButtonShareSsCopyTextChanged();
|
|
||||||
void pushButtonShareCloakCopyTextChanged();
|
|
||||||
void pushButtonShareAmneziaGenerateEnabledChanged();
|
|
||||||
void pushButtonShareAmneziaCopyEnabledChanged();
|
|
||||||
void pushButtonShareAmneziaGenerateTextChanged();
|
|
||||||
void pushButtonShareOpenvpnGenerateEnabledChanged();
|
|
||||||
void pushButtonShareOpenvpnGenerateTextChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
void updateSharingPage(int serverIndex, const ServerCredentials &credentials,
|
||||||
|
DockerContainer container);
|
||||||
|
void updateQRCodeImage(const QString &text, const std::function<void(const QString&)>& setLabelFunc);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CQR_Encode m_qrEncode;
|
CQR_Encode m_qrEncode;
|
||||||
|
|
||||||
bool m_pageShareAmneziaVisible;
|
|
||||||
bool m_pageShareOpenvpnVisible;
|
|
||||||
bool m_pageShareShadowsocksVisible;
|
|
||||||
bool m_pageShareCloakVisible;
|
|
||||||
bool m_pageShareFullAccessVisible;
|
|
||||||
QString m_textEditShareOpenvpnCodeText;
|
|
||||||
bool m_pushButtonShareOpenvpnCopyEnabled;
|
|
||||||
bool m_pushButtonShareOpenvpnSaveEnabled;
|
|
||||||
int m_toolBoxShareConnectionCurrentIndex;
|
|
||||||
bool m_pushButtonShareSsCopyEnabled;
|
|
||||||
QString m_lineEditShareSsStringText;
|
|
||||||
QString m_labelShareSsQrCodeText;
|
|
||||||
QString m_labelShareSsServerText;
|
|
||||||
QString m_labelShareSsPortText;
|
|
||||||
QString m_labelShareSsMethodText;
|
|
||||||
QString m_labelShareSsPasswordText;
|
|
||||||
QString m_plainTextEditShareCloakText;
|
|
||||||
bool m_pushButtonShareCloakCopyEnabled;
|
|
||||||
QString m_textEditShareFullCodeText;
|
|
||||||
QString m_textEditShareAmneziaCodeText;
|
|
||||||
QString m_pushButtonShareFullCopyText;
|
|
||||||
QString m_pushButtonShareAmneziaCopyText;
|
|
||||||
QString m_pushButtonShareOpenvpnCopyText;
|
|
||||||
QString m_pushButtonShareSsCopyText;
|
|
||||||
QString m_pushButtonShareCloakCopyText;
|
|
||||||
bool m_pushButtonShareAmneziaGenerateEnabled;
|
|
||||||
bool m_pushButtonShareAmneziaCopyEnabled;
|
|
||||||
QString m_pushButtonShareAmneziaGenerateText;
|
|
||||||
bool m_pushButtonShareOpenvpnGenerateEnabled;
|
|
||||||
QString m_pushButtonShareOpenvpnGenerateText;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // SHARE_CONNECTION_LOGIC_H
|
#endif // SHARE_CONNECTION_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -28,63 +28,24 @@ void SitesLogic::updateSitesPage()
|
||||||
if (m == Settings::VpnAllSites) return;
|
if (m == Settings::VpnAllSites) return;
|
||||||
|
|
||||||
if (m == Settings::VpnOnlyForwardSites) {
|
if (m == Settings::VpnOnlyForwardSites) {
|
||||||
setLabelSitesAddCustomText(tr("These sites will be opened using VPN"));
|
set_labelSitesAddCustomText(tr("These sites will be opened using VPN"));
|
||||||
}
|
}
|
||||||
if (m == Settings::VpnAllExceptSites) {
|
if (m == Settings::VpnAllExceptSites) {
|
||||||
setLabelSitesAddCustomText(tr("These sites will be excepted from VPN"));
|
set_labelSitesAddCustomText(tr("These sites will be excepted from VPN"));
|
||||||
}
|
}
|
||||||
|
|
||||||
setTableViewSitesModel(sitesModels.value(m));
|
set_tableViewSitesModel(sitesModels.value(m));
|
||||||
sitesModels.value(m)->resetCache();
|
sitesModels.value(m)->resetCache();
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SitesLogic::getLabelSitesAddCustomText() const
|
|
||||||
{
|
|
||||||
return m_labelSitesAddCustomText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SitesLogic::setLabelSitesAddCustomText(const QString &labelSitesAddCustomText)
|
|
||||||
{
|
|
||||||
if (m_labelSitesAddCustomText != labelSitesAddCustomText) {
|
|
||||||
m_labelSitesAddCustomText = labelSitesAddCustomText;
|
|
||||||
emit labelSitesAddCustomTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QObject* SitesLogic::getTableViewSitesModel() const
|
|
||||||
{
|
|
||||||
return m_tableViewSitesModel;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SitesLogic::setTableViewSitesModel(QObject* tableViewSitesModel)
|
|
||||||
{
|
|
||||||
if (m_tableViewSitesModel != tableViewSitesModel) {
|
|
||||||
m_tableViewSitesModel = tableViewSitesModel;
|
|
||||||
emit tableViewSitesModelChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString SitesLogic::getLineEditSitesAddCustomText() const
|
|
||||||
{
|
|
||||||
return m_lineEditSitesAddCustomText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SitesLogic::setLineEditSitesAddCustomText(const QString &lineEditSitesAddCustomText)
|
|
||||||
{
|
|
||||||
if (m_lineEditSitesAddCustomText != lineEditSitesAddCustomText) {
|
|
||||||
m_lineEditSitesAddCustomText = lineEditSitesAddCustomText;
|
|
||||||
emit lineEditSitesAddCustomTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SitesLogic::onPushButtonAddCustomSitesClicked()
|
void SitesLogic::onPushButtonAddCustomSitesClicked()
|
||||||
{
|
{
|
||||||
if (uiLogic()->vpnLogic()->getRadioButtonVpnModeAllSitesChecked()) {
|
if (uiLogic()->vpnLogic()->radioButtonVpnModeAllSitesChecked()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Settings::RouteMode mode = m_settings.routeMode();
|
Settings::RouteMode mode = m_settings.routeMode();
|
||||||
|
|
||||||
QString newSite = getLineEditSitesAddCustomText();
|
QString newSite = lineEditSitesAddCustomText();
|
||||||
|
|
||||||
if (newSite.isEmpty()) return;
|
if (newSite.isEmpty()) return;
|
||||||
if (!newSite.contains(".")) return;
|
if (!newSite.contains(".")) return;
|
||||||
|
|
@ -124,7 +85,7 @@ void SitesLogic::onPushButtonAddCustomSitesClicked()
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
setLineEditSitesAddCustomText("");
|
set_lineEditSitesAddCustomText("");
|
||||||
|
|
||||||
if (Utils::ipAddressWithSubnetRegExp().exactMatch(newSite)) {
|
if (Utils::ipAddressWithSubnetRegExp().exactMatch(newSite)) {
|
||||||
cbProcess(newSite, "");
|
cbProcess(newSite, "");
|
||||||
|
|
@ -141,7 +102,7 @@ void SitesLogic::onPushButtonSitesDeleteClicked(int row)
|
||||||
{
|
{
|
||||||
Settings::RouteMode mode = m_settings.routeMode();
|
Settings::RouteMode mode = m_settings.routeMode();
|
||||||
|
|
||||||
auto siteModel = qobject_cast<SitesModel*> (getTableViewSitesModel());
|
auto siteModel = qobject_cast<SitesModel*> (tableViewSitesModel());
|
||||||
if (!siteModel) {
|
if (!siteModel) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,13 +10,13 @@ class SitesLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
AUTO_PROPERTY(QString, labelSitesAddCustomText)
|
||||||
|
AUTO_PROPERTY(QObject*, tableViewSitesModel)
|
||||||
|
AUTO_PROPERTY(QString, lineEditSitesAddCustomText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateSitesPage();
|
Q_INVOKABLE void updateSitesPage();
|
||||||
|
|
||||||
Q_PROPERTY(QString labelSitesAddCustomText READ getLabelSitesAddCustomText WRITE setLabelSitesAddCustomText NOTIFY labelSitesAddCustomTextChanged)
|
|
||||||
Q_PROPERTY(QObject* tableViewSitesModel READ getTableViewSitesModel NOTIFY tableViewSitesModelChanged)
|
|
||||||
Q_PROPERTY(QString lineEditSitesAddCustomText READ getLineEditSitesAddCustomText WRITE setLineEditSitesAddCustomText NOTIFY lineEditSitesAddCustomTextChanged)
|
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonAddCustomSitesClicked();
|
Q_INVOKABLE void onPushButtonAddCustomSitesClicked();
|
||||||
Q_INVOKABLE void onPushButtonSitesDeleteClicked(int row);
|
Q_INVOKABLE void onPushButtonSitesDeleteClicked(int row);
|
||||||
Q_INVOKABLE void onPushButtonSitesImportClicked(const QString &fileName);
|
Q_INVOKABLE void onPushButtonSitesImportClicked(const QString &fileName);
|
||||||
|
|
@ -25,32 +25,6 @@ public:
|
||||||
explicit SitesLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit SitesLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~SitesLogic() = default;
|
~SitesLogic() = default;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QString getLabelSitesAddCustomText() const;
|
|
||||||
void setLabelSitesAddCustomText(const QString &labelSitesAddCustomText);
|
|
||||||
QObject* getTableViewSitesModel() const;
|
|
||||||
void setTableViewSitesModel(QObject *tableViewSitesModel);
|
|
||||||
QString getLineEditSitesAddCustomText() const;
|
|
||||||
void setLineEditSitesAddCustomText(const QString &lineEditSitesAddCustomText);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void labelSitesAddCustomTextChanged();
|
|
||||||
void tableViewSitesModelChanged();
|
|
||||||
void lineEditSitesAddCustomTextChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_labelSitesAddCustomText;
|
|
||||||
QObject* m_tableViewSitesModel;
|
|
||||||
QString m_lineEditSitesAddCustomText;
|
|
||||||
|
|
||||||
QMap<Settings::RouteMode, SitesModel *> sitesModels;
|
QMap<Settings::RouteMode, SitesModel *> sitesModels;
|
||||||
};
|
};
|
||||||
#endif // SITES_LOGIC_H
|
#endif // SITES_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -23,177 +23,47 @@ StartPageLogic::StartPageLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
void StartPageLogic::updateStartPage()
|
void StartPageLogic::updateStartPage()
|
||||||
{
|
{
|
||||||
setLineEditStartExistingCodeText("");
|
set_lineEditStartExistingCodeText("");
|
||||||
setTextEditNewServerSshKeyText("");
|
set_textEditNewServerSshKeyText("");
|
||||||
setLineEditNewServerIpText("");
|
set_lineEditNewServerIpText("");
|
||||||
setLineEditNewServerPasswordText("");
|
set_lineEditNewServerPasswordText("");
|
||||||
setTextEditNewServerSshKeyText("");
|
set_textEditNewServerSshKeyText("");
|
||||||
setLineEditNewServerLoginText("");
|
set_lineEditNewServerLoginText("");
|
||||||
|
|
||||||
setLabelNewServerWaitInfoVisible(false);
|
set_labelNewServerWaitInfoVisible(false);
|
||||||
setLabelNewServerWaitInfoText("");
|
set_labelNewServerWaitInfoText("");
|
||||||
setPushButtonNewServerConnectVisible(true);
|
set_pushButtonNewServerConnectVisible(true);
|
||||||
}
|
|
||||||
|
|
||||||
bool StartPageLogic::getPushButtonNewServerConnectKeyChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonNewServerConnectKeyChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setPushButtonNewServerConnectKeyChecked(bool pushButtonNewServerConnectKeyChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonNewServerConnectKeyChecked != pushButtonNewServerConnectKeyChecked) {
|
|
||||||
m_pushButtonNewServerConnectKeyChecked = pushButtonNewServerConnectKeyChecked;
|
|
||||||
emit pushButtonNewServerConnectKeyCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString StartPageLogic::getLineEditStartExistingCodeText() const
|
|
||||||
{
|
|
||||||
return m_lineEditStartExistingCodeText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setLineEditStartExistingCodeText(const QString &lineEditStartExistingCodeText)
|
|
||||||
{
|
|
||||||
if (m_lineEditStartExistingCodeText != lineEditStartExistingCodeText) {
|
|
||||||
m_lineEditStartExistingCodeText = lineEditStartExistingCodeText;
|
|
||||||
emit lineEditStartExistingCodeTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString StartPageLogic::getTextEditNewServerSshKeyText() const
|
|
||||||
{
|
|
||||||
return m_textEditNewServerSshKeyText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setTextEditNewServerSshKeyText(const QString &textEditNewServerSshKeyText)
|
|
||||||
{
|
|
||||||
if (m_textEditNewServerSshKeyText != textEditNewServerSshKeyText) {
|
|
||||||
m_textEditNewServerSshKeyText = textEditNewServerSshKeyText;
|
|
||||||
emit textEditNewServerSshKeyTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString StartPageLogic::getLineEditNewServerIpText() const
|
|
||||||
{
|
|
||||||
return m_lineEditNewServerIpText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setLineEditNewServerIpText(const QString &lineEditNewServerIpText)
|
|
||||||
{
|
|
||||||
if (m_lineEditNewServerIpText != lineEditNewServerIpText) {
|
|
||||||
m_lineEditNewServerIpText = lineEditNewServerIpText;
|
|
||||||
emit lineEditNewServerIpTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString StartPageLogic::getLineEditNewServerPasswordText() const
|
|
||||||
{
|
|
||||||
return m_lineEditNewServerPasswordText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setLineEditNewServerPasswordText(const QString &lineEditNewServerPasswordText)
|
|
||||||
{
|
|
||||||
if (m_lineEditNewServerPasswordText != lineEditNewServerPasswordText) {
|
|
||||||
m_lineEditNewServerPasswordText = lineEditNewServerPasswordText;
|
|
||||||
emit lineEditNewServerPasswordTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString StartPageLogic::getLineEditNewServerLoginText() const
|
|
||||||
{
|
|
||||||
return m_lineEditNewServerLoginText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setLineEditNewServerLoginText(const QString &lineEditNewServerLoginText)
|
|
||||||
{
|
|
||||||
if (m_lineEditNewServerLoginText != lineEditNewServerLoginText) {
|
|
||||||
m_lineEditNewServerLoginText = lineEditNewServerLoginText;
|
|
||||||
emit lineEditNewServerLoginTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StartPageLogic::getLabelNewServerWaitInfoVisible() const
|
|
||||||
{
|
|
||||||
return m_labelNewServerWaitInfoVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setLabelNewServerWaitInfoVisible(bool labelNewServerWaitInfoVisible)
|
|
||||||
{
|
|
||||||
if (m_labelNewServerWaitInfoVisible != labelNewServerWaitInfoVisible) {
|
|
||||||
m_labelNewServerWaitInfoVisible = labelNewServerWaitInfoVisible;
|
|
||||||
emit labelNewServerWaitInfoVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString StartPageLogic::getLabelNewServerWaitInfoText() const
|
|
||||||
{
|
|
||||||
return m_labelNewServerWaitInfoText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setLabelNewServerWaitInfoText(const QString &labelNewServerWaitInfoText)
|
|
||||||
{
|
|
||||||
if (m_labelNewServerWaitInfoText != labelNewServerWaitInfoText) {
|
|
||||||
m_labelNewServerWaitInfoText = labelNewServerWaitInfoText;
|
|
||||||
emit labelNewServerWaitInfoTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StartPageLogic::getPushButtonNewServerConnectVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonNewServerConnectVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setPushButtonNewServerConnectVisible(bool pushButtonNewServerConnectVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonNewServerConnectVisible != pushButtonNewServerConnectVisible) {
|
|
||||||
m_pushButtonNewServerConnectVisible = pushButtonNewServerConnectVisible;
|
|
||||||
emit pushButtonNewServerConnectVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool StartPageLogic::getPushButtonBackFromStartVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonBackFromStartVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setPushButtonBackFromStartVisible(bool pushButtonBackFromStartVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonBackFromStartVisible != pushButtonBackFromStartVisible) {
|
|
||||||
m_pushButtonBackFromStartVisible = pushButtonBackFromStartVisible;
|
|
||||||
emit pushButtonBackFromStartVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StartPageLogic::onPushButtonNewServerConnect()
|
void StartPageLogic::onPushButtonNewServerConnect()
|
||||||
{
|
{
|
||||||
if (getPushButtonNewServerConnectKeyChecked()){
|
if (pushButtonNewServerConnectKeyChecked()){
|
||||||
if (getLineEditNewServerIpText().isEmpty() ||
|
if (lineEditNewServerIpText().isEmpty() ||
|
||||||
getLineEditNewServerLoginText().isEmpty() ||
|
lineEditNewServerLoginText().isEmpty() ||
|
||||||
getTextEditNewServerSshKeyText().isEmpty() ) {
|
textEditNewServerSshKeyText().isEmpty() ) {
|
||||||
setLabelNewServerWaitInfoText(tr("Please fill in all fields"));
|
set_labelNewServerWaitInfoText(tr("Please fill in all fields"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (getLineEditNewServerIpText().isEmpty() ||
|
if (lineEditNewServerIpText().isEmpty() ||
|
||||||
getLineEditNewServerLoginText().isEmpty() ||
|
lineEditNewServerLoginText().isEmpty() ||
|
||||||
getLineEditNewServerPasswordText().isEmpty() ) {
|
lineEditNewServerPasswordText().isEmpty() ) {
|
||||||
setLabelNewServerWaitInfoText(tr("Please fill in all fields"));
|
set_labelNewServerWaitInfoText(tr("Please fill in all fields"));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
qDebug() << "UiLogic::onPushButtonNewServerConnect checking new server";
|
qDebug() << "UiLogic::onPushButtonNewServerConnect checking new server";
|
||||||
|
|
||||||
ServerCredentials serverCredentials;
|
ServerCredentials serverCredentials;
|
||||||
serverCredentials.hostName = getLineEditNewServerIpText();
|
serverCredentials.hostName = lineEditNewServerIpText();
|
||||||
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 = getLineEditNewServerLoginText();
|
serverCredentials.userName = lineEditNewServerLoginText();
|
||||||
if (getPushButtonNewServerConnectKeyChecked()){
|
if (pushButtonNewServerConnectKeyChecked()){
|
||||||
QString key = getTextEditNewServerSshKeyText();
|
QString key = textEditNewServerSshKeyText();
|
||||||
if (key.startsWith("ssh-rsa")) {
|
if (key.startsWith("ssh-rsa")) {
|
||||||
emit uiLogic()->showPublicKeyWarning();
|
emit uiLogic()->showPublicKeyWarning();
|
||||||
return;
|
return;
|
||||||
|
|
@ -206,11 +76,11 @@ void StartPageLogic::onPushButtonNewServerConnect()
|
||||||
serverCredentials.password = key;
|
serverCredentials.password = key;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
serverCredentials.password = getLineEditNewServerPasswordText();
|
serverCredentials.password = lineEditNewServerPasswordText();
|
||||||
}
|
}
|
||||||
|
|
||||||
setPushButtonNewServerConnectEnabled(false);
|
set_pushButtonNewServerConnectEnabled(false);
|
||||||
setPushButtonNewServerConnectText(tr("Connecting..."));
|
set_pushButtonNewServerConnectText(tr("Connecting..."));
|
||||||
|
|
||||||
ErrorCode e = ErrorCode::NoError;
|
ErrorCode e = ErrorCode::NoError;
|
||||||
#ifdef Q_DEBUG
|
#ifdef Q_DEBUG
|
||||||
|
|
@ -221,21 +91,21 @@ void StartPageLogic::onPushButtonNewServerConnect()
|
||||||
|
|
||||||
bool ok = true;
|
bool ok = true;
|
||||||
if (e) {
|
if (e) {
|
||||||
setLabelNewServerWaitInfoVisible(true);
|
set_labelNewServerWaitInfoVisible(true);
|
||||||
setLabelNewServerWaitInfoText(errorString(e));
|
set_labelNewServerWaitInfoText(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", "");
|
||||||
setLabelNewServerWaitInfoVisible(true);
|
set_labelNewServerWaitInfoVisible(true);
|
||||||
setLabelNewServerWaitInfoText(output);
|
set_labelNewServerWaitInfoText(output);
|
||||||
ok = false;
|
ok = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
setPushButtonNewServerConnectEnabled(true);
|
set_pushButtonNewServerConnectEnabled(true);
|
||||||
setPushButtonNewServerConnectText(tr("Connect"));
|
set_pushButtonNewServerConnectText(tr("Connect"));
|
||||||
|
|
||||||
uiLogic()->installCredentials = serverCredentials;
|
uiLogic()->installCredentials = serverCredentials;
|
||||||
if (ok) uiLogic()->goToPage(Page::NewServer);
|
if (ok) uiLogic()->goToPage(Page::NewServer);
|
||||||
|
|
@ -243,7 +113,7 @@ void StartPageLogic::onPushButtonNewServerConnect()
|
||||||
|
|
||||||
void StartPageLogic::onPushButtonNewServerImport()
|
void StartPageLogic::onPushButtonNewServerImport()
|
||||||
{
|
{
|
||||||
QString s = getLineEditStartExistingCodeText();
|
QString s = lineEditStartExistingCodeText();
|
||||||
s.replace("vpn://", "");
|
s.replace("vpn://", "");
|
||||||
QJsonObject o = QJsonDocument::fromJson(QByteArray::fromBase64(s.toUtf8(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals)).object();
|
QJsonObject o = QJsonDocument::fromJson(QByteArray::fromBase64(s.toUtf8(), QByteArray::Base64UrlEncoding | QByteArray::OmitTrailingEquals)).object();
|
||||||
|
|
||||||
|
|
@ -296,29 +166,3 @@ void StartPageLogic::onPushButtonNewServerImport()
|
||||||
uiLogic()->goToPage(Page::ServerContainers);
|
uiLogic()->goToPage(Page::ServerContainers);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool StartPageLogic::getPushButtonNewServerConnectEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonNewServerConnectEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setPushButtonNewServerConnectEnabled(bool pushButtonNewServerConnectEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonNewServerConnectEnabled != pushButtonNewServerConnectEnabled) {
|
|
||||||
m_pushButtonNewServerConnectEnabled = pushButtonNewServerConnectEnabled;
|
|
||||||
emit pushButtonNewServerConnectEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString StartPageLogic::getPushButtonNewServerConnectText() const
|
|
||||||
{
|
|
||||||
return m_pushButtonNewServerConnectText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void StartPageLogic::setPushButtonNewServerConnectText(const QString &pushButtonNewServerConnectText)
|
|
||||||
{
|
|
||||||
if (m_pushButtonNewServerConnectText != pushButtonNewServerConnectText) {
|
|
||||||
m_pushButtonNewServerConnectText = pushButtonNewServerConnectText;
|
|
||||||
emit pushButtonNewServerConnectTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -9,22 +9,22 @@ class StartPageLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
AUTO_PROPERTY(bool, pushButtonNewServerConnectEnabled)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonNewServerConnectKeyChecked)
|
||||||
|
AUTO_PROPERTY(QString, pushButtonNewServerConnectText)
|
||||||
|
AUTO_PROPERTY(QString, lineEditStartExistingCodeText)
|
||||||
|
AUTO_PROPERTY(QString, textEditNewServerSshKeyText)
|
||||||
|
AUTO_PROPERTY(QString, lineEditNewServerIpText)
|
||||||
|
AUTO_PROPERTY(QString, lineEditNewServerPasswordText)
|
||||||
|
AUTO_PROPERTY(QString, lineEditNewServerLoginText)
|
||||||
|
AUTO_PROPERTY(bool, labelNewServerWaitInfoVisible)
|
||||||
|
AUTO_PROPERTY(QString, labelNewServerWaitInfoText)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonBackFromStartVisible)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonNewServerConnectVisible)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateStartPage();
|
Q_INVOKABLE void updateStartPage();
|
||||||
|
|
||||||
Q_PROPERTY(bool pushButtonNewServerConnectEnabled READ getPushButtonNewServerConnectEnabled WRITE setPushButtonNewServerConnectEnabled NOTIFY pushButtonNewServerConnectEnabledChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonNewServerConnectKeyChecked READ getPushButtonNewServerConnectKeyChecked WRITE setPushButtonNewServerConnectKeyChecked NOTIFY pushButtonNewServerConnectKeyCheckedChanged)
|
|
||||||
Q_PROPERTY(QString pushButtonNewServerConnectText READ getPushButtonNewServerConnectText WRITE setPushButtonNewServerConnectText NOTIFY pushButtonNewServerConnectTextChanged)
|
|
||||||
Q_PROPERTY(QString lineEditStartExistingCodeText READ getLineEditStartExistingCodeText WRITE setLineEditStartExistingCodeText NOTIFY lineEditStartExistingCodeTextChanged)
|
|
||||||
Q_PROPERTY(QString textEditNewServerSshKeyText READ getTextEditNewServerSshKeyText WRITE setTextEditNewServerSshKeyText NOTIFY textEditNewServerSshKeyTextChanged)
|
|
||||||
Q_PROPERTY(QString lineEditNewServerIpText READ getLineEditNewServerIpText WRITE setLineEditNewServerIpText NOTIFY lineEditNewServerIpTextChanged)
|
|
||||||
Q_PROPERTY(QString lineEditNewServerPasswordText READ getLineEditNewServerPasswordText WRITE setLineEditNewServerPasswordText NOTIFY lineEditNewServerPasswordTextChanged)
|
|
||||||
Q_PROPERTY(QString lineEditNewServerLoginText READ getLineEditNewServerLoginText WRITE setLineEditNewServerLoginText NOTIFY lineEditNewServerLoginTextChanged)
|
|
||||||
Q_PROPERTY(bool labelNewServerWaitInfoVisible READ getLabelNewServerWaitInfoVisible WRITE setLabelNewServerWaitInfoVisible NOTIFY labelNewServerWaitInfoVisibleChanged)
|
|
||||||
Q_PROPERTY(QString labelNewServerWaitInfoText READ getLabelNewServerWaitInfoText WRITE setLabelNewServerWaitInfoText NOTIFY labelNewServerWaitInfoTextChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonBackFromStartVisible READ getPushButtonBackFromStartVisible WRITE setPushButtonBackFromStartVisible NOTIFY pushButtonBackFromStartVisibleChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonNewServerConnectVisible READ getPushButtonNewServerConnectVisible WRITE setPushButtonNewServerConnectVisible NOTIFY pushButtonNewServerConnectVisibleChanged)
|
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonNewServerConnect();
|
Q_INVOKABLE void onPushButtonNewServerConnect();
|
||||||
Q_INVOKABLE void onPushButtonNewServerImport();
|
Q_INVOKABLE void onPushButtonNewServerImport();
|
||||||
|
|
||||||
|
|
@ -32,65 +32,8 @@ public:
|
||||||
explicit StartPageLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit StartPageLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~StartPageLogic() = default;
|
~StartPageLogic() = default;
|
||||||
|
|
||||||
bool getPushButtonBackFromStartVisible() const;
|
|
||||||
void setPushButtonBackFromStartVisible(bool pushButtonBackFromStartVisible);
|
|
||||||
bool getPushButtonNewServerConnectEnabled() const;
|
|
||||||
void setPushButtonNewServerConnectEnabled(bool pushButtonNewServerConnectEnabled);
|
|
||||||
|
|
||||||
bool getPushButtonNewServerConnectVisible() const;
|
|
||||||
void setPushButtonNewServerConnectVisible(bool pushButtonNewServerConnectVisible);
|
|
||||||
bool getPushButtonNewServerConnectKeyChecked() const;
|
|
||||||
void setPushButtonNewServerConnectKeyChecked(bool pushButtonNewServerConnectKeyChecked);
|
|
||||||
QString getLineEditStartExistingCodeText() const;
|
|
||||||
void setLineEditStartExistingCodeText(const QString &lineEditStartExistingCodeText);
|
|
||||||
QString getTextEditNewServerSshKeyText() const;
|
|
||||||
void setTextEditNewServerSshKeyText(const QString &textEditNewServerSshKeyText);
|
|
||||||
QString getLineEditNewServerIpText() const;
|
|
||||||
void setLineEditNewServerIpText(const QString &lineEditNewServerIpText);
|
|
||||||
QString getLineEditNewServerPasswordText() const;
|
|
||||||
void setLineEditNewServerPasswordText(const QString &lineEditNewServerPasswordText);
|
|
||||||
QString getLineEditNewServerLoginText() const;
|
|
||||||
void setLineEditNewServerLoginText(const QString &lineEditNewServerLoginText);
|
|
||||||
bool getLabelNewServerWaitInfoVisible() const;
|
|
||||||
void setLabelNewServerWaitInfoVisible(bool labelNewServerWaitInfoVisible);
|
|
||||||
QString getLabelNewServerWaitInfoText() const;
|
|
||||||
void setLabelNewServerWaitInfoText(const QString &labelNewServerWaitInfoText);
|
|
||||||
|
|
||||||
QString getPushButtonNewServerConnectText() const;
|
QString getPushButtonNewServerConnectText() const;
|
||||||
void setPushButtonNewServerConnectText(const QString &pushButtonNewServerConnectText);
|
void setPushButtonNewServerConnectText(const QString &pushButtonNewServerConnectText);
|
||||||
|
|
||||||
signals:
|
|
||||||
void pushButtonNewServerConnectKeyCheckedChanged();
|
|
||||||
void lineEditStartExistingCodeTextChanged();
|
|
||||||
void textEditNewServerSshKeyTextChanged();
|
|
||||||
void lineEditNewServerIpTextChanged();
|
|
||||||
void lineEditNewServerPasswordTextChanged();
|
|
||||||
void lineEditNewServerLoginTextChanged();
|
|
||||||
void labelNewServerWaitInfoVisibleChanged();
|
|
||||||
void labelNewServerWaitInfoTextChanged();
|
|
||||||
void pushButtonBackFromStartVisibleChanged();
|
|
||||||
void pushButtonNewServerConnectVisibleChanged();
|
|
||||||
void pushButtonNewServerConnectEnabledChanged();
|
|
||||||
void pushButtonNewServerConnectTextChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_pushButtonNewServerConnectEnabled;
|
|
||||||
QString m_pushButtonNewServerConnectText;
|
|
||||||
bool m_pushButtonNewServerConnectKeyChecked;
|
|
||||||
QString m_lineEditStartExistingCodeText;
|
|
||||||
QString m_textEditNewServerSshKeyText;
|
|
||||||
QString m_lineEditNewServerIpText;
|
|
||||||
QString m_lineEditNewServerPasswordText;
|
|
||||||
QString m_lineEditNewServerLoginText;
|
|
||||||
bool m_labelNewServerWaitInfoVisible;
|
|
||||||
QString m_labelNewServerWaitInfoText;
|
|
||||||
bool m_pushButtonBackFromStartVisible;
|
|
||||||
bool m_pushButtonNewServerConnectVisible;
|
|
||||||
};
|
};
|
||||||
#endif // START_PAGE_LOGIC_H
|
#endif // START_PAGE_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@ VpnLogic::VpnLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
if (m_settings.isAutoConnect() && m_settings.defaultServerIndex() >= 0) {
|
if (m_settings.isAutoConnect() && m_settings.defaultServerIndex() >= 0) {
|
||||||
QTimer::singleShot(1000, this, [this](){
|
QTimer::singleShot(1000, this, [this](){
|
||||||
setPushButtonConnectEnabled(false);
|
set_pushButtonConnectEnabled(false);
|
||||||
onConnect();
|
onConnect();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -71,10 +71,10 @@ VpnLogic::VpnLogic(UiLogic *logic, QObject *parent):
|
||||||
void VpnLogic::updateVpnPage()
|
void VpnLogic::updateVpnPage()
|
||||||
{
|
{
|
||||||
Settings::RouteMode mode = m_settings.routeMode();
|
Settings::RouteMode mode = m_settings.routeMode();
|
||||||
setRadioButtonVpnModeAllSitesChecked(mode == Settings::VpnAllSites);
|
set_radioButtonVpnModeAllSitesChecked(mode == Settings::VpnAllSites);
|
||||||
setRadioButtonVpnModeForwardSitesChecked(mode == Settings::VpnOnlyForwardSites);
|
set_radioButtonVpnModeForwardSitesChecked(mode == Settings::VpnOnlyForwardSites);
|
||||||
setRadioButtonVpnModeExceptSitesChecked(mode == Settings::VpnAllExceptSites);
|
set_radioButtonVpnModeExceptSitesChecked(mode == Settings::VpnAllExceptSites);
|
||||||
setPushButtonVpnAddSiteEnabled(mode != Settings::VpnAllSites);
|
set_pushButtonVpnAddSiteEnabled(mode != Settings::VpnAllSites);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -99,153 +99,10 @@ void VpnLogic::onRadioButtonVpnModeExceptSitesToggled(bool checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
bool VpnLogic::getRadioButtonVpnModeAllSitesChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonVpnModeAllSitesChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VpnLogic::getRadioButtonVpnModeForwardSitesChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonVpnModeForwardSitesChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VpnLogic::getRadioButtonVpnModeExceptSitesChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonVpnModeExceptSitesChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setRadioButtonVpnModeAllSitesChecked(bool radioButtonVpnModeAllSitesChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonVpnModeAllSitesChecked != radioButtonVpnModeAllSitesChecked) {
|
|
||||||
m_radioButtonVpnModeAllSitesChecked = radioButtonVpnModeAllSitesChecked;
|
|
||||||
emit radioButtonVpnModeAllSitesCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setRadioButtonVpnModeForwardSitesChecked(bool radioButtonVpnModeForwardSitesChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonVpnModeForwardSitesChecked != radioButtonVpnModeForwardSitesChecked) {
|
|
||||||
m_radioButtonVpnModeForwardSitesChecked = radioButtonVpnModeForwardSitesChecked;
|
|
||||||
emit radioButtonVpnModeForwardSitesCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setRadioButtonVpnModeExceptSitesChecked(bool radioButtonVpnModeExceptSitesChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonVpnModeExceptSitesChecked != radioButtonVpnModeExceptSitesChecked) {
|
|
||||||
m_radioButtonVpnModeExceptSitesChecked = radioButtonVpnModeExceptSitesChecked;
|
|
||||||
emit radioButtonVpnModeExceptSitesCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VpnLogic::getPushButtonConnectChecked() const
|
|
||||||
{
|
|
||||||
return m_pushButtonConnectChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setPushButtonConnectChecked(bool pushButtonConnectChecked)
|
|
||||||
{
|
|
||||||
if (m_pushButtonConnectChecked != pushButtonConnectChecked) {
|
|
||||||
m_pushButtonConnectChecked = pushButtonConnectChecked;
|
|
||||||
emit pushButtonConnectCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VpnLogic::getPushButtonVpnAddSiteEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonVpnAddSiteEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setPushButtonVpnAddSiteEnabled(bool pushButtonVpnAddSiteEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonVpnAddSiteEnabled != pushButtonVpnAddSiteEnabled) {
|
|
||||||
m_pushButtonVpnAddSiteEnabled = pushButtonVpnAddSiteEnabled;
|
|
||||||
emit pushButtonVpnAddSiteEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VpnLogic::getLabelSpeedReceivedText() const
|
|
||||||
{
|
|
||||||
return m_labelSpeedReceivedText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setLabelSpeedReceivedText(const QString &labelSpeedReceivedText)
|
|
||||||
{
|
|
||||||
if (m_labelSpeedReceivedText != labelSpeedReceivedText) {
|
|
||||||
m_labelSpeedReceivedText = labelSpeedReceivedText;
|
|
||||||
emit labelSpeedReceivedTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VpnLogic::getLabelSpeedSentText() const
|
|
||||||
{
|
|
||||||
return m_labelSpeedSentText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setLabelSpeedSentText(const QString &labelSpeedSentText)
|
|
||||||
{
|
|
||||||
if (m_labelSpeedSentText != labelSpeedSentText) {
|
|
||||||
m_labelSpeedSentText = labelSpeedSentText;
|
|
||||||
emit labelSpeedSentTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VpnLogic::getLabelStateText() const
|
|
||||||
{
|
|
||||||
return m_labelStateText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setLabelStateText(const QString &labelStateText)
|
|
||||||
{
|
|
||||||
if (m_labelStateText != labelStateText) {
|
|
||||||
m_labelStateText = labelStateText;
|
|
||||||
emit labelStateTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VpnLogic::getPushButtonConnectEnabled() const
|
|
||||||
{
|
|
||||||
return m_pushButtonConnectEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setPushButtonConnectEnabled(bool pushButtonConnectEnabled)
|
|
||||||
{
|
|
||||||
if (m_pushButtonConnectEnabled != pushButtonConnectEnabled) {
|
|
||||||
m_pushButtonConnectEnabled = pushButtonConnectEnabled;
|
|
||||||
emit pushButtonConnectEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VpnLogic::getWidgetVpnModeEnabled() const
|
|
||||||
{
|
|
||||||
return m_widgetVpnModeEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setWidgetVpnModeEnabled(bool widgetVpnModeEnabled)
|
|
||||||
{
|
|
||||||
if (m_widgetVpnModeEnabled != widgetVpnModeEnabled) {
|
|
||||||
m_widgetVpnModeEnabled = widgetVpnModeEnabled;
|
|
||||||
emit widgetVpnModeEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString VpnLogic::getLabelErrorText() const
|
|
||||||
{
|
|
||||||
return m_labelErrorText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::setLabelErrorText(const QString &labelErrorText)
|
|
||||||
{
|
|
||||||
if (m_labelErrorText != labelErrorText) {
|
|
||||||
m_labelErrorText = labelErrorText;
|
|
||||||
emit labelErrorTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void VpnLogic::onBytesChanged(quint64 receivedData, quint64 sentData)
|
void VpnLogic::onBytesChanged(quint64 receivedData, quint64 sentData)
|
||||||
{
|
{
|
||||||
setLabelSpeedReceivedText(VpnConnection::bytesPerSecToText(receivedData));
|
set_labelSpeedReceivedText(VpnConnection::bytesPerSecToText(receivedData));
|
||||||
setLabelSpeedSentText(VpnConnection::bytesPerSecToText(sentData));
|
set_labelSpeedSentText(VpnConnection::bytesPerSecToText(sentData));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VpnLogic::onConnectionStateChanged(VpnProtocol::ConnectionState state)
|
void VpnLogic::onConnectionStateChanged(VpnProtocol::ConnectionState state)
|
||||||
|
|
@ -254,14 +111,14 @@ void VpnLogic::onConnectionStateChanged(VpnProtocol::ConnectionState state)
|
||||||
|
|
||||||
bool pushButtonConnectEnabled = false;
|
bool pushButtonConnectEnabled = false;
|
||||||
bool radioButtonsModeEnabled = false;
|
bool radioButtonsModeEnabled = false;
|
||||||
setLabelStateText(VpnProtocol::textConnectionState(state));
|
set_labelStateText(VpnProtocol::textConnectionState(state));
|
||||||
|
|
||||||
uiLogic()->setTrayState(state);
|
uiLogic()->setTrayState(state);
|
||||||
|
|
||||||
switch (state) {
|
switch (state) {
|
||||||
case VpnProtocol::Disconnected:
|
case VpnProtocol::Disconnected:
|
||||||
onBytesChanged(0,0);
|
onBytesChanged(0,0);
|
||||||
setPushButtonConnectChecked(false);
|
set_pushButtonConnectChecked(false);
|
||||||
pushButtonConnectEnabled = true;
|
pushButtonConnectEnabled = true;
|
||||||
radioButtonsModeEnabled = true;
|
radioButtonsModeEnabled = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -286,7 +143,7 @@ void VpnLogic::onConnectionStateChanged(VpnProtocol::ConnectionState state)
|
||||||
radioButtonsModeEnabled = false;
|
radioButtonsModeEnabled = false;
|
||||||
break;
|
break;
|
||||||
case VpnProtocol::Error:
|
case VpnProtocol::Error:
|
||||||
setPushButtonConnectEnabled(false);
|
set_pushButtonConnectEnabled(false);
|
||||||
pushButtonConnectEnabled = true;
|
pushButtonConnectEnabled = true;
|
||||||
radioButtonsModeEnabled = true;
|
radioButtonsModeEnabled = true;
|
||||||
break;
|
break;
|
||||||
|
|
@ -295,13 +152,13 @@ void VpnLogic::onConnectionStateChanged(VpnProtocol::ConnectionState state)
|
||||||
radioButtonsModeEnabled = true;
|
radioButtonsModeEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPushButtonConnectEnabled(pushButtonConnectEnabled);
|
set_pushButtonConnectEnabled(pushButtonConnectEnabled);
|
||||||
setWidgetVpnModeEnabled(radioButtonsModeEnabled);
|
set_widgetVpnModeEnabled(radioButtonsModeEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VpnLogic::onVpnProtocolError(ErrorCode errorCode)
|
void VpnLogic::onVpnProtocolError(ErrorCode errorCode)
|
||||||
{
|
{
|
||||||
setLabelErrorText(errorString(errorCode));
|
set_labelErrorText(errorString(errorCode));
|
||||||
}
|
}
|
||||||
|
|
||||||
void VpnLogic::onPushButtonConnectClicked(bool checked)
|
void VpnLogic::onPushButtonConnectClicked(bool checked)
|
||||||
|
|
@ -320,14 +177,14 @@ void VpnLogic::onConnect()
|
||||||
DockerContainer container = m_settings.defaultContainer(serverIndex);
|
DockerContainer container = m_settings.defaultContainer(serverIndex);
|
||||||
|
|
||||||
if (m_settings.containers(serverIndex).isEmpty()) {
|
if (m_settings.containers(serverIndex).isEmpty()) {
|
||||||
setLabelErrorText(tr("VPN Protocols is not installed.\n Please install VPN container at first"));
|
set_labelErrorText(tr("VPN Protocols is not installed.\n Please install VPN container at first"));
|
||||||
setPushButtonConnectChecked(false);
|
set_pushButtonConnectChecked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (container == DockerContainer::None) {
|
if (container == DockerContainer::None) {
|
||||||
setLabelErrorText(tr("VPN Protocol not choosen"));
|
set_labelErrorText(tr("VPN Protocol not choosen"));
|
||||||
setPushButtonConnectChecked(false);
|
set_pushButtonConnectChecked(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -338,8 +195,8 @@ void VpnLogic::onConnect()
|
||||||
|
|
||||||
void VpnLogic::onConnectWorker(int serverIndex, const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig)
|
void VpnLogic::onConnectWorker(int serverIndex, const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig)
|
||||||
{
|
{
|
||||||
setLabelErrorText("");
|
set_labelErrorText("");
|
||||||
setPushButtonConnectChecked(true);
|
set_pushButtonConnectChecked(true);
|
||||||
qApp->processEvents();
|
qApp->processEvents();
|
||||||
|
|
||||||
ErrorCode errorCode = uiLogic()->m_vpnConnection->connectToVpn(
|
ErrorCode errorCode = uiLogic()->m_vpnConnection->connectToVpn(
|
||||||
|
|
@ -353,11 +210,11 @@ void VpnLogic::onConnectWorker(int serverIndex, const ServerCredentials &credent
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
setPushButtonConnectEnabled(false);
|
set_pushButtonConnectEnabled(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void VpnLogic::onDisconnect()
|
void VpnLogic::onDisconnect()
|
||||||
{
|
{
|
||||||
setPushButtonConnectChecked(false);
|
set_pushButtonConnectChecked(false);
|
||||||
uiLogic()->m_vpnConnection->disconnectFromVpn();
|
uiLogic()->m_vpnConnection->disconnectFromVpn();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -10,18 +10,18 @@ class VpnLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
Q_PROPERTY(bool pushButtonConnectChecked READ getPushButtonConnectChecked WRITE setPushButtonConnectChecked NOTIFY pushButtonConnectCheckedChanged)
|
AUTO_PROPERTY(bool, pushButtonConnectChecked)
|
||||||
Q_PROPERTY(QString labelSpeedReceivedText READ getLabelSpeedReceivedText WRITE setLabelSpeedReceivedText NOTIFY labelSpeedReceivedTextChanged)
|
AUTO_PROPERTY(QString, labelSpeedReceivedText)
|
||||||
Q_PROPERTY(QString labelSpeedSentText READ getLabelSpeedSentText WRITE setLabelSpeedSentText NOTIFY labelSpeedSentTextChanged)
|
AUTO_PROPERTY(QString, labelSpeedSentText)
|
||||||
Q_PROPERTY(QString labelStateText READ getLabelStateText WRITE setLabelStateText NOTIFY labelStateTextChanged)
|
AUTO_PROPERTY(QString, labelStateText)
|
||||||
Q_PROPERTY(bool pushButtonConnectEnabled READ getPushButtonConnectEnabled WRITE setPushButtonConnectEnabled NOTIFY pushButtonConnectEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonConnectEnabled)
|
||||||
Q_PROPERTY(bool widgetVpnModeEnabled READ getWidgetVpnModeEnabled WRITE setWidgetVpnModeEnabled NOTIFY widgetVpnModeEnabledChanged)
|
AUTO_PROPERTY(bool, widgetVpnModeEnabled)
|
||||||
Q_PROPERTY(QString labelErrorText READ getLabelErrorText WRITE setLabelErrorText NOTIFY labelErrorTextChanged)
|
AUTO_PROPERTY(QString, labelErrorText)
|
||||||
Q_PROPERTY(bool pushButtonVpnAddSiteEnabled READ getPushButtonVpnAddSiteEnabled WRITE setPushButtonVpnAddSiteEnabled NOTIFY pushButtonVpnAddSiteEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonVpnAddSiteEnabled)
|
||||||
|
|
||||||
Q_PROPERTY(bool radioButtonVpnModeAllSitesChecked READ getRadioButtonVpnModeAllSitesChecked WRITE setRadioButtonVpnModeAllSitesChecked NOTIFY radioButtonVpnModeAllSitesCheckedChanged)
|
AUTO_PROPERTY(bool, radioButtonVpnModeAllSitesChecked)
|
||||||
Q_PROPERTY(bool radioButtonVpnModeForwardSitesChecked READ getRadioButtonVpnModeForwardSitesChecked WRITE setRadioButtonVpnModeForwardSitesChecked NOTIFY radioButtonVpnModeForwardSitesCheckedChanged)
|
AUTO_PROPERTY(bool, radioButtonVpnModeForwardSitesChecked)
|
||||||
Q_PROPERTY(bool radioButtonVpnModeExceptSitesChecked READ getRadioButtonVpnModeExceptSitesChecked WRITE setRadioButtonVpnModeExceptSitesChecked NOTIFY radioButtonVpnModeExceptSitesCheckedChanged)
|
AUTO_PROPERTY(bool, radioButtonVpnModeExceptSitesChecked)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateVpnPage();
|
Q_INVOKABLE void updateVpnPage();
|
||||||
|
|
@ -39,29 +39,6 @@ public:
|
||||||
bool getPushButtonConnectChecked() const;
|
bool getPushButtonConnectChecked() const;
|
||||||
void setPushButtonConnectChecked(bool pushButtonConnectChecked);
|
void setPushButtonConnectChecked(bool pushButtonConnectChecked);
|
||||||
|
|
||||||
|
|
||||||
QString getLabelSpeedReceivedText() const;
|
|
||||||
void setLabelSpeedReceivedText(const QString &labelSpeedReceivedText);
|
|
||||||
QString getLabelSpeedSentText() const;
|
|
||||||
void setLabelSpeedSentText(const QString &labelSpeedSentText);
|
|
||||||
QString getLabelStateText() const;
|
|
||||||
void setLabelStateText(const QString &labelStateText);
|
|
||||||
bool getPushButtonConnectEnabled() const;
|
|
||||||
void setPushButtonConnectEnabled(bool pushButtonConnectEnabled);
|
|
||||||
bool getWidgetVpnModeEnabled() const;
|
|
||||||
void setWidgetVpnModeEnabled(bool widgetVpnModeEnabled);
|
|
||||||
QString getLabelErrorText() const;
|
|
||||||
void setLabelErrorText(const QString &labelErrorText);
|
|
||||||
|
|
||||||
bool getRadioButtonVpnModeAllSitesChecked() const;
|
|
||||||
void setRadioButtonVpnModeAllSitesChecked(bool radioButtonVpnModeAllSitesChecked);
|
|
||||||
bool getRadioButtonVpnModeForwardSitesChecked() const;
|
|
||||||
void setRadioButtonVpnModeForwardSitesChecked(bool radioButtonVpnModeForwardSitesChecked);
|
|
||||||
bool getRadioButtonVpnModeExceptSitesChecked() const;
|
|
||||||
void setRadioButtonVpnModeExceptSitesChecked(bool radioButtonVpnModeExceptSitesChecked);
|
|
||||||
bool getPushButtonVpnAddSiteEnabled() const;
|
|
||||||
void setPushButtonVpnAddSiteEnabled(bool pushButtonVpnAddSiteEnabled);
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void onConnect();
|
void onConnect();
|
||||||
void onConnectWorker(int serverIndex, const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig);
|
void onConnectWorker(int serverIndex, const ServerCredentials &credentials, DockerContainer container, const QJsonObject &containerConfig);
|
||||||
|
|
@ -71,34 +48,5 @@ public slots:
|
||||||
void onConnectionStateChanged(VpnProtocol::ConnectionState state);
|
void onConnectionStateChanged(VpnProtocol::ConnectionState state);
|
||||||
void onVpnProtocolError(amnezia::ErrorCode errorCode);
|
void onVpnProtocolError(amnezia::ErrorCode errorCode);
|
||||||
|
|
||||||
signals:
|
|
||||||
void radioButtonVpnModeAllSitesCheckedChanged();
|
|
||||||
void radioButtonVpnModeForwardSitesCheckedChanged();
|
|
||||||
void radioButtonVpnModeExceptSitesCheckedChanged();
|
|
||||||
void pushButtonVpnAddSiteEnabledChanged();
|
|
||||||
|
|
||||||
void pushButtonConnectCheckedChanged();
|
|
||||||
|
|
||||||
void labelSpeedReceivedTextChanged();
|
|
||||||
void labelSpeedSentTextChanged();
|
|
||||||
void labelStateTextChanged();
|
|
||||||
void pushButtonConnectEnabledChanged();
|
|
||||||
void widgetVpnModeEnabledChanged();
|
|
||||||
void labelErrorTextChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_pushButtonConnectChecked;
|
|
||||||
|
|
||||||
bool m_radioButtonVpnModeAllSitesChecked;
|
|
||||||
bool m_radioButtonVpnModeForwardSitesChecked;
|
|
||||||
bool m_radioButtonVpnModeExceptSitesChecked;
|
|
||||||
bool m_pushButtonVpnAddSiteEnabled;
|
|
||||||
QString m_labelSpeedReceivedText;
|
|
||||||
QString m_labelSpeedSentText;
|
|
||||||
QString m_labelStateText;
|
|
||||||
bool m_pushButtonConnectEnabled;
|
|
||||||
bool m_widgetVpnModeEnabled;
|
|
||||||
QString m_labelErrorText;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // VPN_LOGIC_H
|
#endif // VPN_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -12,74 +12,9 @@ WizardLogic::WizardLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
bool WizardLogic::getRadioButtonSetupWizardMediumChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonSetupWizardMediumChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WizardLogic::setRadioButtonSetupWizardMediumChecked(bool radioButtonSetupWizardMediumChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonSetupWizardMediumChecked != radioButtonSetupWizardMediumChecked) {
|
|
||||||
m_radioButtonSetupWizardMediumChecked = radioButtonSetupWizardMediumChecked;
|
|
||||||
emit radioButtonSetupWizardMediumCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void WizardLogic::updateWizardHighPage()
|
void WizardLogic::updateWizardHighPage()
|
||||||
{
|
{
|
||||||
setLineEditSetupWizardHighWebsiteMaskingText(protocols::cloak::defaultRedirSite);
|
set_lineEditSetupWizardHighWebsiteMaskingText(protocols::cloak::defaultRedirSite);
|
||||||
}
|
|
||||||
|
|
||||||
QString WizardLogic::getLineEditSetupWizardHighWebsiteMaskingText() const
|
|
||||||
{
|
|
||||||
return m_lineEditSetupWizardHighWebsiteMaskingText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WizardLogic::setLineEditSetupWizardHighWebsiteMaskingText(const QString &lineEditSetupWizardHighWebsiteMaskingText)
|
|
||||||
{
|
|
||||||
if (m_lineEditSetupWizardHighWebsiteMaskingText != lineEditSetupWizardHighWebsiteMaskingText) {
|
|
||||||
m_lineEditSetupWizardHighWebsiteMaskingText = lineEditSetupWizardHighWebsiteMaskingText;
|
|
||||||
emit lineEditSetupWizardHighWebsiteMaskingTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WizardLogic::getRadioButtonSetupWizardHighChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonSetupWizardHighChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WizardLogic::setRadioButtonSetupWizardHighChecked(bool radioButtonSetupWizardHighChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonSetupWizardHighChecked != radioButtonSetupWizardHighChecked) {
|
|
||||||
m_radioButtonSetupWizardHighChecked = radioButtonSetupWizardHighChecked;
|
|
||||||
emit radioButtonSetupWizardHighCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WizardLogic::getRadioButtonSetupWizardLowChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonSetupWizardLowChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WizardLogic::setRadioButtonSetupWizardLowChecked(bool radioButtonSetupWizardLowChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonSetupWizardLowChecked != radioButtonSetupWizardLowChecked) {
|
|
||||||
m_radioButtonSetupWizardLowChecked = radioButtonSetupWizardLowChecked;
|
|
||||||
emit radioButtonSetupWizardLowCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool WizardLogic::getCheckBoxSetupWizardVpnModeChecked() const
|
|
||||||
{
|
|
||||||
return m_checkBoxSetupWizardVpnModeChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void WizardLogic::setCheckBoxSetupWizardVpnModeChecked(bool checkBoxSetupWizardVpnModeChecked)
|
|
||||||
{
|
|
||||||
if (m_checkBoxSetupWizardVpnModeChecked != checkBoxSetupWizardVpnModeChecked) {
|
|
||||||
m_checkBoxSetupWizardVpnModeChecked = checkBoxSetupWizardVpnModeChecked;
|
|
||||||
emit checkBoxSetupWizardVpnModeCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage() const
|
QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage() const
|
||||||
|
|
@ -87,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, getLineEditSetupWizardHighWebsiteMaskingText() }}
|
{ config_key::site, lineEditSetupWizardHighWebsiteMaskingText() }}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
QJsonObject ssConfig {
|
QJsonObject ssConfig {
|
||||||
|
|
@ -99,15 +34,15 @@ QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage(
|
||||||
|
|
||||||
QMap<DockerContainer, QJsonObject> containers;
|
QMap<DockerContainer, QJsonObject> containers;
|
||||||
|
|
||||||
if (getRadioButtonSetupWizardHighChecked()) {
|
if (radioButtonSetupWizardHighChecked()) {
|
||||||
containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
|
containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getRadioButtonSetupWizardMediumChecked()) {
|
if (radioButtonSetupWizardMediumChecked()) {
|
||||||
containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
|
containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getRadioButtonSetupWizardLowChecked()) {
|
if (radioButtonSetupWizardLowChecked()) {
|
||||||
containers.insert(DockerContainer::OpenVpn, openVpnConfig);
|
containers.insert(DockerContainer::OpenVpn, openVpnConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -117,7 +52,7 @@ QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage(
|
||||||
void WizardLogic::onPushButtonSetupWizardVpnModeFinishClicked()
|
void WizardLogic::onPushButtonSetupWizardVpnModeFinishClicked()
|
||||||
{
|
{
|
||||||
uiLogic()->installServer(getInstallConfigsFromWizardPage());
|
uiLogic()->installServer(getInstallConfigsFromWizardPage());
|
||||||
if (getCheckBoxSetupWizardVpnModeChecked()) {
|
if (checkBoxSetupWizardVpnModeChecked()) {
|
||||||
m_settings.setRouteMode(Settings::VpnOnlyForwardSites);
|
m_settings.setRouteMode(Settings::VpnOnlyForwardSites);
|
||||||
} else {
|
} else {
|
||||||
m_settings.setRouteMode(Settings::VpnAllSites);
|
m_settings.setRouteMode(Settings::VpnAllSites);
|
||||||
|
|
|
||||||
|
|
@ -9,15 +9,14 @@ class WizardLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
AUTO_PROPERTY(bool, radioButtonSetupWizardHighChecked)
|
||||||
|
AUTO_PROPERTY(bool, radioButtonSetupWizardMediumChecked)
|
||||||
|
AUTO_PROPERTY(bool, radioButtonSetupWizardLowChecked)
|
||||||
|
AUTO_PROPERTY(bool, checkBoxSetupWizardVpnModeChecked)
|
||||||
|
AUTO_PROPERTY(QString, lineEditSetupWizardHighWebsiteMaskingText)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_INVOKABLE void updateWizardHighPage();
|
Q_INVOKABLE void updateWizardHighPage();
|
||||||
|
|
||||||
Q_PROPERTY(bool radioButtonSetupWizardHighChecked READ getRadioButtonSetupWizardHighChecked WRITE setRadioButtonSetupWizardHighChecked NOTIFY radioButtonSetupWizardHighCheckedChanged)
|
|
||||||
Q_PROPERTY(bool radioButtonSetupWizardMediumChecked READ getRadioButtonSetupWizardMediumChecked WRITE setRadioButtonSetupWizardMediumChecked NOTIFY radioButtonSetupWizardMediumCheckedChanged)
|
|
||||||
Q_PROPERTY(bool radioButtonSetupWizardLowChecked READ getRadioButtonSetupWizardLowChecked WRITE setRadioButtonSetupWizardLowChecked NOTIFY radioButtonSetupWizardLowCheckedChanged)
|
|
||||||
Q_PROPERTY(bool checkBoxSetupWizardVpnModeChecked READ getCheckBoxSetupWizardVpnModeChecked WRITE setCheckBoxSetupWizardVpnModeChecked NOTIFY checkBoxSetupWizardVpnModeCheckedChanged)
|
|
||||||
Q_PROPERTY(QString lineEditSetupWizardHighWebsiteMaskingText READ getLineEditSetupWizardHighWebsiteMaskingText WRITE setLineEditSetupWizardHighWebsiteMaskingText NOTIFY lineEditSetupWizardHighWebsiteMaskingTextChanged)
|
|
||||||
|
|
||||||
Q_INVOKABLE void onPushButtonSetupWizardVpnModeFinishClicked();
|
Q_INVOKABLE void onPushButtonSetupWizardVpnModeFinishClicked();
|
||||||
Q_INVOKABLE void onPushButtonSetupWizardLowFinishClicked();
|
Q_INVOKABLE void onPushButtonSetupWizardLowFinishClicked();
|
||||||
|
|
||||||
|
|
@ -25,40 +24,7 @@ public:
|
||||||
explicit WizardLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit WizardLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~WizardLogic() = default;
|
~WizardLogic() = default;
|
||||||
|
|
||||||
bool getRadioButtonSetupWizardMediumChecked() const;
|
|
||||||
void setRadioButtonSetupWizardMediumChecked(bool radioButtonSetupWizardMediumChecked);
|
|
||||||
QString getLineEditSetupWizardHighWebsiteMaskingText() const;
|
|
||||||
void setLineEditSetupWizardHighWebsiteMaskingText(const QString &lineEditSetupWizardHighWebsiteMaskingText);
|
|
||||||
|
|
||||||
bool getRadioButtonSetupWizardHighChecked() const;
|
|
||||||
void setRadioButtonSetupWizardHighChecked(bool radioButtonSetupWizardHighChecked);
|
|
||||||
bool getRadioButtonSetupWizardLowChecked() const;
|
|
||||||
void setRadioButtonSetupWizardLowChecked(bool radioButtonSetupWizardLowChecked);
|
|
||||||
bool getCheckBoxSetupWizardVpnModeChecked() const;
|
|
||||||
void setCheckBoxSetupWizardVpnModeChecked(bool checkBoxSetupWizardVpnModeChecked);
|
|
||||||
|
|
||||||
QMap<DockerContainer, QJsonObject> getInstallConfigsFromWizardPage() const;
|
QMap<DockerContainer, QJsonObject> getInstallConfigsFromWizardPage() const;
|
||||||
|
|
||||||
signals:
|
|
||||||
void lineEditSetupWizardHighWebsiteMaskingTextChanged();
|
|
||||||
void radioButtonSetupWizardHighCheckedChanged();
|
|
||||||
void radioButtonSetupWizardMediumCheckedChanged();
|
|
||||||
void radioButtonSetupWizardLowCheckedChanged();
|
|
||||||
void checkBoxSetupWizardVpnModeCheckedChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_radioButtonSetupWizardHighChecked;
|
|
||||||
bool m_radioButtonSetupWizardMediumChecked;
|
|
||||||
bool m_radioButtonSetupWizardLowChecked;
|
|
||||||
QString m_lineEditSetupWizardHighWebsiteMaskingText;
|
|
||||||
bool m_checkBoxSetupWizardVpnModeChecked;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // WIZARD_LOGIC_H
|
#endif // WIZARD_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ CloakLogic::CloakLogic(UiLogic *logic, QObject *parent):
|
||||||
m_lineEditProtoCloakSiteText{"tile.openstreetmap.org"},
|
m_lineEditProtoCloakSiteText{"tile.openstreetmap.org"},
|
||||||
m_lineEditProtoCloakPortText{},
|
m_lineEditProtoCloakPortText{},
|
||||||
m_widgetProtoCloakEnabled{false},
|
m_widgetProtoCloakEnabled{false},
|
||||||
m_pushButtonProtoCloakSaveVisible{false},
|
m_pushButtonCloakSaveVisible{false},
|
||||||
m_progressBarProtoCloakResetVisible{false},
|
m_progressBarProtoCloakResetVisible{false},
|
||||||
m_lineEditProtoCloakPortEnabled{false},
|
m_lineEditProtoCloakPortEnabled{false},
|
||||||
m_pageProtoCloakEnabled{true},
|
m_pageProtoCloakEnabled{true},
|
||||||
|
|
@ -26,190 +26,31 @@ CloakLogic::CloakLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
void CloakLogic::updateCloakPage(const QJsonObject &ckConfig, DockerContainer container, bool haveAuthData)
|
void CloakLogic::updateCloakPage(const QJsonObject &ckConfig, DockerContainer container, bool haveAuthData)
|
||||||
{
|
{
|
||||||
setWidgetProtoCloakEnabled(haveAuthData);
|
set_widgetProtoCloakEnabled(haveAuthData);
|
||||||
setPushButtonProtoCloakSaveVisible(haveAuthData);
|
set_pushButtonCloakSaveVisible(haveAuthData);
|
||||||
setProgressBarProtoCloakResetVisible(haveAuthData);
|
set_progressBarProtoCloakResetVisible(haveAuthData);
|
||||||
|
|
||||||
setComboBoxProtoCloakCipherText(ckConfig.value(config_key::cipher).
|
set_comboBoxProtoCloakCipherText(ckConfig.value(config_key::cipher).
|
||||||
toString(protocols::cloak::defaultCipher));
|
toString(protocols::cloak::defaultCipher));
|
||||||
|
|
||||||
setLineEditProtoCloakSiteText(ckConfig.value(config_key::site).
|
set_lineEditProtoCloakSiteText(ckConfig.value(config_key::site).
|
||||||
toString(protocols::cloak::defaultRedirSite));
|
toString(protocols::cloak::defaultRedirSite));
|
||||||
|
|
||||||
setLineEditProtoCloakPortText(ckConfig.value(config_key::port).
|
set_lineEditProtoCloakPortText(ckConfig.value(config_key::port).
|
||||||
toString(protocols::cloak::defaultPort));
|
toString(protocols::cloak::defaultPort));
|
||||||
|
|
||||||
setLineEditProtoCloakPortEnabled(container == DockerContainer::OpenVpnOverCloak);
|
set_lineEditProtoCloakPortEnabled(container == DockerContainer::OpenVpnOverCloak);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
QJsonObject CloakLogic::getCloakConfigFromPage(QJsonObject oldConfig)
|
QJsonObject CloakLogic::getCloakConfigFromPage(QJsonObject oldConfig)
|
||||||
{
|
{
|
||||||
oldConfig.insert(config_key::cipher, getComboBoxProtoCloakCipherText());
|
oldConfig.insert(config_key::cipher, comboBoxProtoCloakCipherText());
|
||||||
oldConfig.insert(config_key::site, getLineEditProtoCloakSiteText());
|
oldConfig.insert(config_key::site, lineEditProtoCloakSiteText());
|
||||||
oldConfig.insert(config_key::port, getLineEditProtoCloakPortText());
|
oldConfig.insert(config_key::port, lineEditProtoCloakPortText());
|
||||||
|
|
||||||
return oldConfig;
|
return oldConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString CloakLogic::getComboBoxProtoCloakCipherText() const
|
|
||||||
{
|
|
||||||
return m_comboBoxProtoCloakCipherText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setComboBoxProtoCloakCipherText(const QString &comboBoxProtoCloakCipherText)
|
|
||||||
{
|
|
||||||
if (m_comboBoxProtoCloakCipherText != comboBoxProtoCloakCipherText) {
|
|
||||||
m_comboBoxProtoCloakCipherText = comboBoxProtoCloakCipherText;
|
|
||||||
emit comboBoxProtoCloakCipherTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloakLogic::getLineEditProtoCloakPortText() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoCloakPortText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setLineEditProtoCloakPortText(const QString &lineEditProtoCloakPortText)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoCloakPortText != lineEditProtoCloakPortText) {
|
|
||||||
m_lineEditProtoCloakPortText = lineEditProtoCloakPortText;
|
|
||||||
emit lineEditProtoCloakPortTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloakLogic::getLineEditProtoCloakSiteText() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoCloakSiteText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setLineEditProtoCloakSiteText(const QString &lineEditProtoCloakSiteText)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoCloakSiteText != lineEditProtoCloakSiteText) {
|
|
||||||
m_lineEditProtoCloakSiteText = lineEditProtoCloakSiteText;
|
|
||||||
emit lineEditProtoCloakSiteTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CloakLogic::getWidgetProtoCloakEnabled() const
|
|
||||||
{
|
|
||||||
return m_widgetProtoCloakEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setWidgetProtoCloakEnabled(bool widgetProtoCloakEnabled)
|
|
||||||
{
|
|
||||||
if (m_widgetProtoCloakEnabled != widgetProtoCloakEnabled) {
|
|
||||||
m_widgetProtoCloakEnabled = widgetProtoCloakEnabled;
|
|
||||||
emit widgetProtoCloakEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CloakLogic::getPushButtonProtoCloakSaveVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoCloakSaveVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setPushButtonProtoCloakSaveVisible(bool pushButtonProtoCloakSaveVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoCloakSaveVisible != pushButtonProtoCloakSaveVisible) {
|
|
||||||
m_pushButtonProtoCloakSaveVisible = pushButtonProtoCloakSaveVisible;
|
|
||||||
emit pushButtonProtoCloakSaveVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CloakLogic::getProgressBarProtoCloakResetVisible() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoCloakResetVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setProgressBarProtoCloakResetVisible(bool progressBarProtoCloakResetVisible)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoCloakResetVisible != progressBarProtoCloakResetVisible) {
|
|
||||||
m_progressBarProtoCloakResetVisible = progressBarProtoCloakResetVisible;
|
|
||||||
emit progressBarProtoCloakResetVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CloakLogic::getLineEditProtoCloakPortEnabled() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoCloakPortEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setLineEditProtoCloakPortEnabled(bool lineEditProtoCloakPortEnabled)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoCloakPortEnabled != lineEditProtoCloakPortEnabled) {
|
|
||||||
m_lineEditProtoCloakPortEnabled = lineEditProtoCloakPortEnabled;
|
|
||||||
emit lineEditProtoCloakPortEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CloakLogic::getPageProtoCloakEnabled() const
|
|
||||||
{
|
|
||||||
return m_pageProtoCloakEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setPageProtoCloakEnabled(bool pageProtoCloakEnabled)
|
|
||||||
{
|
|
||||||
if (m_pageProtoCloakEnabled != pageProtoCloakEnabled) {
|
|
||||||
m_pageProtoCloakEnabled = pageProtoCloakEnabled;
|
|
||||||
emit pageProtoCloakEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool CloakLogic::getLabelProtoCloakInfoVisible() const
|
|
||||||
{
|
|
||||||
return m_labelProtoCloakInfoVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setLabelProtoCloakInfoVisible(bool labelProtoCloakInfoVisible)
|
|
||||||
{
|
|
||||||
if (m_labelProtoCloakInfoVisible != labelProtoCloakInfoVisible) {
|
|
||||||
m_labelProtoCloakInfoVisible = labelProtoCloakInfoVisible;
|
|
||||||
emit labelProtoCloakInfoVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString CloakLogic::getLabelProtoCloakInfoText() const
|
|
||||||
{
|
|
||||||
return m_labelProtoCloakInfoText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setLabelProtoCloakInfoText(const QString &labelProtoCloakInfoText)
|
|
||||||
{
|
|
||||||
if (m_labelProtoCloakInfoText != labelProtoCloakInfoText) {
|
|
||||||
m_labelProtoCloakInfoText = labelProtoCloakInfoText;
|
|
||||||
emit labelProtoCloakInfoTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int CloakLogic::getProgressBarProtoCloakResetValue() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoCloakResetValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setProgressBarProtoCloakResetValue(int progressBarProtoCloakResetValue)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoCloakResetValue != progressBarProtoCloakResetValue) {
|
|
||||||
m_progressBarProtoCloakResetValue = progressBarProtoCloakResetValue;
|
|
||||||
emit progressBarProtoCloakResetValueChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int CloakLogic::getProgressBarProtoCloakResetMaximium() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoCloakResetMaximium;
|
|
||||||
}
|
|
||||||
|
|
||||||
void CloakLogic::setProgressBarProtoCloakResetMaximium(int progressBarProtoCloakResetMaximium)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoCloakResetMaximium != progressBarProtoCloakResetMaximium) {
|
|
||||||
m_progressBarProtoCloakResetMaximium = progressBarProtoCloakResetMaximium;
|
|
||||||
emit progressBarProtoCloakResetMaximiumChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void CloakLogic::onPushButtonProtoCloakSaveClicked()
|
void CloakLogic::onPushButtonProtoCloakSaveClicked()
|
||||||
{
|
{
|
||||||
QJsonObject protocolConfig = m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::Cloak);
|
QJsonObject protocolConfig = m_settings.protocolConfig(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer, Protocol::Cloak);
|
||||||
|
|
@ -221,31 +62,31 @@ void CloakLogic::onPushButtonProtoCloakSaveClicked()
|
||||||
|
|
||||||
UiLogic::PageFunc page_proto_cloak;
|
UiLogic::PageFunc page_proto_cloak;
|
||||||
page_proto_cloak.setEnabledFunc = [this] (bool enabled) -> void {
|
page_proto_cloak.setEnabledFunc = [this] (bool enabled) -> void {
|
||||||
setPageProtoCloakEnabled(enabled);
|
set_pageProtoCloakEnabled(enabled);
|
||||||
};
|
};
|
||||||
UiLogic::ButtonFunc pushButton_proto_cloak_save;
|
UiLogic::ButtonFunc pushButton_proto_cloak_save;
|
||||||
pushButton_proto_cloak_save.setVisibleFunc = [this] (bool visible) ->void {
|
pushButton_proto_cloak_save.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
setPushButtonProtoCloakSaveVisible(visible);
|
set_pushButtonCloakSaveVisible(visible);
|
||||||
};
|
};
|
||||||
UiLogic::LabelFunc label_proto_cloak_info;
|
UiLogic::LabelFunc label_proto_cloak_info;
|
||||||
label_proto_cloak_info.setVisibleFunc = [this] (bool visible) ->void {
|
label_proto_cloak_info.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
setLabelProtoCloakInfoVisible(visible);
|
set_labelProtoCloakInfoVisible(visible);
|
||||||
};
|
};
|
||||||
label_proto_cloak_info.setTextFunc = [this] (const QString& text) ->void {
|
label_proto_cloak_info.setTextFunc = [this] (const QString& text) ->void {
|
||||||
setLabelProtoCloakInfoText(text);
|
set_labelProtoCloakInfoText(text);
|
||||||
};
|
};
|
||||||
UiLogic::ProgressFunc progressBar_proto_cloak_reset;
|
UiLogic::ProgressFunc progressBar_proto_cloak_reset;
|
||||||
progressBar_proto_cloak_reset.setVisibleFunc = [this] (bool visible) ->void {
|
progressBar_proto_cloak_reset.setVisibleFunc = [this] (bool visible) ->void {
|
||||||
setProgressBarProtoCloakResetVisible(visible);
|
set_progressBarProtoCloakResetVisible(visible);
|
||||||
};
|
};
|
||||||
progressBar_proto_cloak_reset.setValueFunc = [this] (int value) ->void {
|
progressBar_proto_cloak_reset.setValueFunc = [this] (int value) ->void {
|
||||||
setProgressBarProtoCloakResetValue(value);
|
set_progressBarProtoCloakResetValue(value);
|
||||||
};
|
};
|
||||||
progressBar_proto_cloak_reset.getValueFunc = [this] (void) -> int {
|
progressBar_proto_cloak_reset.getValueFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtoCloakResetValue();
|
return progressBarProtoCloakResetValue();
|
||||||
};
|
};
|
||||||
progressBar_proto_cloak_reset.getMaximiumFunc = [this] (void) -> int {
|
progressBar_proto_cloak_reset.getMaximiumFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtoCloakResetMaximium();
|
return progressBarProtoCloakResetMaximium();
|
||||||
};
|
};
|
||||||
|
|
||||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
||||||
|
|
|
||||||
|
|
@ -9,21 +9,22 @@ class CloakLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
AUTO_PROPERTY(QString, comboBoxProtoCloakCipherText)
|
||||||
Q_PROPERTY(QString comboBoxProtoCloakCipherText READ getComboBoxProtoCloakCipherText WRITE setComboBoxProtoCloakCipherText NOTIFY comboBoxProtoCloakCipherTextChanged)
|
AUTO_PROPERTY(QString, lineEditProtoCloakSiteText)
|
||||||
Q_PROPERTY(QString lineEditProtoCloakSiteText READ getLineEditProtoCloakSiteText WRITE setLineEditProtoCloakSiteText NOTIFY lineEditProtoCloakSiteTextChanged)
|
AUTO_PROPERTY(QString, lineEditProtoCloakPortText)
|
||||||
Q_PROPERTY(QString lineEditProtoCloakPortText READ getLineEditProtoCloakPortText WRITE setLineEditProtoCloakPortText NOTIFY lineEditProtoCloakPortTextChanged)
|
AUTO_PROPERTY(bool, widgetProtoCloakEnabled)
|
||||||
Q_PROPERTY(bool widgetProtoCloakEnabled READ getWidgetProtoCloakEnabled WRITE setWidgetProtoCloakEnabled NOTIFY widgetProtoCloakEnabledChanged)
|
AUTO_PROPERTY(bool, pushButtonCloakSaveVisible)
|
||||||
Q_PROPERTY(bool pushButtonProtoCloakSaveVisible READ getPushButtonProtoCloakSaveVisible WRITE setPushButtonProtoCloakSaveVisible NOTIFY pushButtonProtoCloakSaveVisibleChanged)
|
AUTO_PROPERTY(bool, progressBarProtoCloakResetVisible)
|
||||||
Q_PROPERTY(bool progressBarProtoCloakResetVisible READ getProgressBarProtoCloakResetVisible WRITE setProgressBarProtoCloakResetVisible NOTIFY progressBarProtoCloakResetVisibleChanged)
|
AUTO_PROPERTY(bool, lineEditProtoCloakPortEnabled)
|
||||||
Q_PROPERTY(bool lineEditProtoCloakPortEnabled READ getLineEditProtoCloakPortEnabled WRITE setLineEditProtoCloakPortEnabled NOTIFY lineEditProtoCloakPortEnabledChanged)
|
AUTO_PROPERTY(bool, pageProtoCloakEnabled)
|
||||||
Q_PROPERTY(bool pageProtoCloakEnabled READ getPageProtoCloakEnabled WRITE setPageProtoCloakEnabled NOTIFY pageProtoCloakEnabledChanged)
|
AUTO_PROPERTY(bool, labelProtoCloakInfoVisible)
|
||||||
Q_PROPERTY(bool labelProtoCloakInfoVisible READ getLabelProtoCloakInfoVisible WRITE setLabelProtoCloakInfoVisible NOTIFY labelProtoCloakInfoVisibleChanged)
|
AUTO_PROPERTY(QString, labelProtoCloakInfoText)
|
||||||
Q_PROPERTY(QString labelProtoCloakInfoText READ getLabelProtoCloakInfoText WRITE setLabelProtoCloakInfoText NOTIFY labelProtoCloakInfoTextChanged)
|
AUTO_PROPERTY(int, progressBarProtoCloakResetValue)
|
||||||
Q_PROPERTY(int progressBarProtoCloakResetValue READ getProgressBarProtoCloakResetValue WRITE setProgressBarProtoCloakResetValue NOTIFY progressBarProtoCloakResetValueChanged)
|
AUTO_PROPERTY(int, progressBarProtoCloakResetMaximium)
|
||||||
Q_PROPERTY(int progressBarProtoCloakResetMaximium READ getProgressBarProtoCloakResetMaximium WRITE setProgressBarProtoCloakResetMaximium NOTIFY progressBarProtoCloakResetMaximiumChanged)
|
|
||||||
|
|
||||||
|
public:
|
||||||
Q_INVOKABLE void onPushButtonProtoCloakSaveClicked();
|
Q_INVOKABLE void onPushButtonProtoCloakSaveClicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit CloakLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
explicit CloakLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||||
~CloakLogic() = default;
|
~CloakLogic() = default;
|
||||||
|
|
@ -31,68 +32,9 @@ public:
|
||||||
void updateCloakPage(const QJsonObject &ckConfig, DockerContainer container, bool haveAuthData);
|
void updateCloakPage(const QJsonObject &ckConfig, DockerContainer container, bool haveAuthData);
|
||||||
QJsonObject getCloakConfigFromPage(QJsonObject oldConfig);
|
QJsonObject getCloakConfigFromPage(QJsonObject oldConfig);
|
||||||
|
|
||||||
QString getComboBoxProtoCloakCipherText() const;
|
|
||||||
void setComboBoxProtoCloakCipherText(const QString &comboBoxProtoCloakCipherText);
|
|
||||||
QString getLineEditProtoCloakSiteText() const;
|
|
||||||
void setLineEditProtoCloakSiteText(const QString &lineEditProtoCloakSiteText);
|
|
||||||
QString getLineEditProtoCloakPortText() const;
|
|
||||||
void setLineEditProtoCloakPortText(const QString &lineEditProtoCloakPortText);
|
|
||||||
bool getWidgetProtoCloakEnabled() const;
|
|
||||||
void setWidgetProtoCloakEnabled(bool widgetProtoCloakEnabled);
|
|
||||||
bool getPushButtonProtoCloakSaveVisible() const;
|
|
||||||
void setPushButtonProtoCloakSaveVisible(bool pushButtonProtoCloakSaveVisible);
|
|
||||||
bool getProgressBarProtoCloakResetVisible() const;
|
|
||||||
void setProgressBarProtoCloakResetVisible(bool progressBarProtoCloakResetVisible);
|
|
||||||
bool getLineEditProtoCloakPortEnabled() const;
|
|
||||||
void setLineEditProtoCloakPortEnabled(bool lineEditProtoCloakPortEnabled);
|
|
||||||
bool getPageProtoCloakEnabled() const;
|
|
||||||
void setPageProtoCloakEnabled(bool pageProtoCloakEnabled);
|
|
||||||
bool getLabelProtoCloakInfoVisible() const;
|
|
||||||
void setLabelProtoCloakInfoVisible(bool labelProtoCloakInfoVisible);
|
|
||||||
QString getLabelProtoCloakInfoText() const;
|
|
||||||
void setLabelProtoCloakInfoText(const QString &labelProtoCloakInfoText);
|
|
||||||
int getProgressBarProtoCloakResetValue() const;
|
|
||||||
void setProgressBarProtoCloakResetValue(int progressBarProtoCloakResetValue);
|
|
||||||
int getProgressBarProtoCloakResetMaximium() const;
|
|
||||||
void setProgressBarProtoCloakResetMaximium(int progressBarProtoCloakResetMaximium);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void comboBoxProtoCloakCipherTextChanged();
|
|
||||||
void lineEditProtoCloakSiteTextChanged();
|
|
||||||
void lineEditProtoCloakPortTextChanged();
|
|
||||||
void widgetProtoCloakEnabledChanged();
|
|
||||||
void pushButtonProtoCloakSaveVisibleChanged();
|
|
||||||
void progressBarProtoCloakResetVisibleChanged();
|
|
||||||
void lineEditProtoCloakPortEnabledChanged();
|
|
||||||
void pageProtoCloakEnabledChanged();
|
|
||||||
void labelProtoCloakInfoVisibleChanged();
|
|
||||||
void labelProtoCloakInfoTextChanged();
|
|
||||||
void progressBarProtoCloakResetValueChanged();
|
|
||||||
void progressBarProtoCloakResetMaximiumChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Settings m_settings;
|
Settings m_settings;
|
||||||
UiLogic *m_uiLogic;
|
UiLogic *m_uiLogic;
|
||||||
|
|
||||||
QString m_comboBoxProtoCloakCipherText;
|
|
||||||
QString m_lineEditProtoCloakSiteText;
|
|
||||||
QString m_lineEditProtoCloakPortText;
|
|
||||||
bool m_widgetProtoCloakEnabled;
|
|
||||||
bool m_pushButtonProtoCloakSaveVisible;
|
|
||||||
bool m_progressBarProtoCloakResetVisible;
|
|
||||||
bool m_lineEditProtoCloakPortEnabled;
|
|
||||||
bool m_pageProtoCloakEnabled;
|
|
||||||
bool m_labelProtoCloakInfoVisible;
|
|
||||||
QString m_labelProtoCloakInfoText;
|
|
||||||
int m_progressBarProtoCloakResetValue;
|
|
||||||
int m_progressBarProtoCloakResetMaximium;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // CLOAK_LOGIC_H
|
#endif // CLOAK_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ OpenVpnLogic::OpenVpnLogic(UiLogic *logic, QObject *parent):
|
||||||
m_lineEditProtoOpenvpnPortText{},
|
m_lineEditProtoOpenvpnPortText{},
|
||||||
m_checkBoxProtoOpenvpnTlsAuthChecked{false},
|
m_checkBoxProtoOpenvpnTlsAuthChecked{false},
|
||||||
m_widgetProtoOpenvpnEnabled{false},
|
m_widgetProtoOpenvpnEnabled{false},
|
||||||
m_pushButtonProtoOpenvpnSaveVisible{false},
|
m_pushButtonOpenvpnSaveVisible{false},
|
||||||
m_progressBarProtoOpenvpnResetVisible{false},
|
m_progressBarProtoOpenvpnResetVisible{false},
|
||||||
m_radioButtonProtoOpenvpnUdpEnabled{false},
|
m_radioButtonProtoOpenvpnUdpEnabled{false},
|
||||||
m_radioButtonProtoOpenvpnTcpEnabled{false},
|
m_radioButtonProtoOpenvpnTcpEnabled{false},
|
||||||
|
|
@ -36,340 +36,53 @@ OpenVpnLogic::OpenVpnLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
void OpenVpnLogic::updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerContainer container, bool haveAuthData)
|
void OpenVpnLogic::updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerContainer container, bool haveAuthData)
|
||||||
{
|
{
|
||||||
setWidgetProtoOpenvpnEnabled(haveAuthData);
|
set_widgetProtoOpenvpnEnabled(haveAuthData);
|
||||||
setPushButtonProtoOpenvpnSaveVisible(haveAuthData);
|
set_pushButtonOpenvpnSaveVisible(haveAuthData);
|
||||||
setProgressBarProtoOpenvpnResetVisible(haveAuthData);
|
set_progressBarProtoOpenvpnResetVisible(haveAuthData);
|
||||||
|
|
||||||
setRadioButtonProtoOpenvpnUdpEnabled(true);
|
set_radioButtonProtoOpenvpnUdpEnabled(true);
|
||||||
setRadioButtonProtoOpenvpnTcpEnabled(true);
|
set_radioButtonProtoOpenvpnTcpEnabled(true);
|
||||||
|
|
||||||
setLineEditProtoOpenvpnSubnetText(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);
|
||||||
|
|
||||||
setRadioButtonProtoOpenvpnUdpChecked(trasnsport == protocols::openvpn::defaultTransportProto);
|
set_radioButtonProtoOpenvpnUdpChecked(trasnsport == protocols::openvpn::defaultTransportProto);
|
||||||
setRadioButtonProtoOpenvpnTcpChecked(trasnsport != protocols::openvpn::defaultTransportProto);
|
set_radioButtonProtoOpenvpnTcpChecked(trasnsport != protocols::openvpn::defaultTransportProto);
|
||||||
|
|
||||||
setComboBoxProtoOpenvpnCipherText(openvpnConfig.value(config_key::cipher).
|
set_comboBoxProtoOpenvpnCipherText(openvpnConfig.value(config_key::cipher).
|
||||||
toString(protocols::openvpn::defaultCipher));
|
toString(protocols::openvpn::defaultCipher));
|
||||||
|
|
||||||
setComboBoxProtoOpenvpnHashText(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);
|
||||||
setCheckBoxProtoOpenvpnBlockDnsChecked(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);
|
||||||
setCheckBoxProtoOpenvpnAutoEncryptionChecked(!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);
|
||||||
setCheckBoxProtoOpenvpnTlsAuthChecked(isTlsAuth);
|
set_checkBoxProtoOpenvpnTlsAuthChecked(isTlsAuth);
|
||||||
|
|
||||||
if (container == DockerContainer::OpenVpnOverShadowSocks) {
|
if (container == DockerContainer::OpenVpnOverShadowSocks) {
|
||||||
setRadioButtonProtoOpenvpnUdpEnabled(false);
|
set_radioButtonProtoOpenvpnUdpEnabled(false);
|
||||||
setRadioButtonProtoOpenvpnTcpEnabled(false);
|
set_radioButtonProtoOpenvpnTcpEnabled(false);
|
||||||
setRadioButtonProtoOpenvpnTcpChecked(true);
|
set_radioButtonProtoOpenvpnTcpChecked(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
setLineEditProtoOpenvpnPortText(openvpnConfig.value(config_key::port).
|
set_lineEditProtoOpenvpnPortText(openvpnConfig.value(config_key::port).
|
||||||
toString(protocols::openvpn::defaultPort));
|
toString(protocols::openvpn::defaultPort));
|
||||||
|
|
||||||
setLineEditProtoOpenvpnPortEnabled(container == DockerContainer::OpenVpn);
|
set_lineEditProtoOpenvpnPortEnabled(container == DockerContainer::OpenVpn);
|
||||||
}
|
|
||||||
|
|
||||||
QString OpenVpnLogic::getLineEditProtoOpenvpnSubnetText() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoOpenvpnSubnetText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setLineEditProtoOpenvpnSubnetText(const QString &lineEditProtoOpenvpnSubnetText)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoOpenvpnSubnetText != lineEditProtoOpenvpnSubnetText) {
|
|
||||||
m_lineEditProtoOpenvpnSubnetText = lineEditProtoOpenvpnSubnetText;
|
|
||||||
emit lineEditProtoOpenvpnSubnetTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getRadioButtonProtoOpenvpnUdpChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonProtoOpenvpnUdpChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setRadioButtonProtoOpenvpnUdpChecked(bool radioButtonProtoOpenvpnUdpChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonProtoOpenvpnUdpChecked != radioButtonProtoOpenvpnUdpChecked) {
|
|
||||||
m_radioButtonProtoOpenvpnUdpChecked = radioButtonProtoOpenvpnUdpChecked;
|
|
||||||
emit radioButtonProtoOpenvpnUdpCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getCheckBoxProtoOpenvpnAutoEncryptionChecked() const
|
|
||||||
{
|
|
||||||
return m_checkBoxProtoOpenvpnAutoEncryptionChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setCheckBoxProtoOpenvpnAutoEncryptionChecked(bool checkBoxProtoOpenvpnAutoEncryptionChecked)
|
|
||||||
{
|
|
||||||
if (m_checkBoxProtoOpenvpnAutoEncryptionChecked != checkBoxProtoOpenvpnAutoEncryptionChecked) {
|
|
||||||
m_checkBoxProtoOpenvpnAutoEncryptionChecked = checkBoxProtoOpenvpnAutoEncryptionChecked;
|
|
||||||
emit checkBoxProtoOpenvpnAutoEncryptionCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString OpenVpnLogic::getComboBoxProtoOpenvpnCipherText() const
|
|
||||||
{
|
|
||||||
return m_comboBoxProtoOpenvpnCipherText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setComboBoxProtoOpenvpnCipherText(const QString &comboBoxProtoOpenvpnCipherText)
|
|
||||||
{
|
|
||||||
if (m_comboBoxProtoOpenvpnCipherText != comboBoxProtoOpenvpnCipherText) {
|
|
||||||
m_comboBoxProtoOpenvpnCipherText = comboBoxProtoOpenvpnCipherText;
|
|
||||||
emit comboBoxProtoOpenvpnCipherTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString OpenVpnLogic::getComboBoxProtoOpenvpnHashText() const
|
|
||||||
{
|
|
||||||
return m_comboBoxProtoOpenvpnHashText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setComboBoxProtoOpenvpnHashText(const QString &comboBoxProtoOpenvpnHashText)
|
|
||||||
{
|
|
||||||
if (m_comboBoxProtoOpenvpnHashText != comboBoxProtoOpenvpnHashText) {
|
|
||||||
m_comboBoxProtoOpenvpnHashText = comboBoxProtoOpenvpnHashText;
|
|
||||||
emit comboBoxProtoOpenvpnHashTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getCheckBoxProtoOpenvpnBlockDnsChecked() const
|
|
||||||
{
|
|
||||||
return m_checkBoxProtoOpenvpnBlockDnsChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setCheckBoxProtoOpenvpnBlockDnsChecked(bool checkBoxProtoOpenvpnBlockDnsChecked)
|
|
||||||
{
|
|
||||||
if (m_checkBoxProtoOpenvpnBlockDnsChecked != checkBoxProtoOpenvpnBlockDnsChecked) {
|
|
||||||
m_checkBoxProtoOpenvpnBlockDnsChecked = checkBoxProtoOpenvpnBlockDnsChecked;
|
|
||||||
emit checkBoxProtoOpenvpnBlockDnsCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString OpenVpnLogic::getLineEditProtoOpenvpnPortText() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoOpenvpnPortText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setLineEditProtoOpenvpnPortText(const QString &lineEditProtoOpenvpnPortText)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoOpenvpnPortText != lineEditProtoOpenvpnPortText) {
|
|
||||||
m_lineEditProtoOpenvpnPortText = lineEditProtoOpenvpnPortText;
|
|
||||||
emit lineEditProtoOpenvpnPortTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getCheckBoxProtoOpenvpnTlsAuthChecked() const
|
|
||||||
{
|
|
||||||
return m_checkBoxProtoOpenvpnTlsAuthChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setCheckBoxProtoOpenvpnTlsAuthChecked(bool checkBoxProtoOpenvpnTlsAuthChecked)
|
|
||||||
{
|
|
||||||
if (m_checkBoxProtoOpenvpnTlsAuthChecked != checkBoxProtoOpenvpnTlsAuthChecked) {
|
|
||||||
m_checkBoxProtoOpenvpnTlsAuthChecked = checkBoxProtoOpenvpnTlsAuthChecked;
|
|
||||||
emit checkBoxProtoOpenvpnTlsAuthCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getWidgetProtoOpenvpnEnabled() const
|
|
||||||
{
|
|
||||||
return m_widgetProtoOpenvpnEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setWidgetProtoOpenvpnEnabled(bool widgetProtoOpenvpnEnabled)
|
|
||||||
{
|
|
||||||
if (m_widgetProtoOpenvpnEnabled != widgetProtoOpenvpnEnabled) {
|
|
||||||
m_widgetProtoOpenvpnEnabled = widgetProtoOpenvpnEnabled;
|
|
||||||
emit widgetProtoOpenvpnEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getPushButtonProtoOpenvpnSaveVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoOpenvpnSaveVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setPushButtonProtoOpenvpnSaveVisible(bool pushButtonProtoOpenvpnSaveVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoOpenvpnSaveVisible != pushButtonProtoOpenvpnSaveVisible) {
|
|
||||||
m_pushButtonProtoOpenvpnSaveVisible = pushButtonProtoOpenvpnSaveVisible;
|
|
||||||
emit pushButtonProtoOpenvpnSaveVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getProgressBarProtoOpenvpnResetVisible() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoOpenvpnResetVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setProgressBarProtoOpenvpnResetVisible(bool progressBarProtoOpenvpnResetVisible)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoOpenvpnResetVisible != progressBarProtoOpenvpnResetVisible) {
|
|
||||||
m_progressBarProtoOpenvpnResetVisible = progressBarProtoOpenvpnResetVisible;
|
|
||||||
emit progressBarProtoOpenvpnResetVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getRadioButtonProtoOpenvpnUdpEnabled() const
|
|
||||||
{
|
|
||||||
return m_radioButtonProtoOpenvpnUdpEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void OpenVpnLogic::setRadioButtonProtoOpenvpnUdpEnabled(bool radioButtonProtoOpenvpnUdpEnabled)
|
|
||||||
{
|
|
||||||
if (m_radioButtonProtoOpenvpnUdpEnabled != radioButtonProtoOpenvpnUdpEnabled) {
|
|
||||||
m_radioButtonProtoOpenvpnUdpEnabled = radioButtonProtoOpenvpnUdpEnabled;
|
|
||||||
emit radioButtonProtoOpenvpnUdpEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getRadioButtonProtoOpenvpnTcpEnabled() const
|
|
||||||
{
|
|
||||||
return m_radioButtonProtoOpenvpnTcpEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setRadioButtonProtoOpenvpnTcpEnabled(bool radioButtonProtoOpenvpnTcpEnabled)
|
|
||||||
{
|
|
||||||
if (m_radioButtonProtoOpenvpnTcpEnabled != radioButtonProtoOpenvpnTcpEnabled) {
|
|
||||||
m_radioButtonProtoOpenvpnTcpEnabled = radioButtonProtoOpenvpnTcpEnabled;
|
|
||||||
emit radioButtonProtoOpenvpnTcpEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getRadioButtonProtoOpenvpnTcpChecked() const
|
|
||||||
{
|
|
||||||
return m_radioButtonProtoOpenvpnTcpChecked;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setRadioButtonProtoOpenvpnTcpChecked(bool radioButtonProtoOpenvpnTcpChecked)
|
|
||||||
{
|
|
||||||
if (m_radioButtonProtoOpenvpnTcpChecked != radioButtonProtoOpenvpnTcpChecked) {
|
|
||||||
m_radioButtonProtoOpenvpnTcpChecked = radioButtonProtoOpenvpnTcpChecked;
|
|
||||||
emit radioButtonProtoOpenvpnTcpCheckedChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getLineEditProtoOpenvpnPortEnabled() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoOpenvpnPortEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setLineEditProtoOpenvpnPortEnabled(bool lineEditProtoOpenvpnPortEnabled)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoOpenvpnPortEnabled != lineEditProtoOpenvpnPortEnabled) {
|
|
||||||
m_lineEditProtoOpenvpnPortEnabled = lineEditProtoOpenvpnPortEnabled;
|
|
||||||
emit lineEditProtoOpenvpnPortEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getComboBoxProtoOpenvpnCipherEnabled() const
|
|
||||||
{
|
|
||||||
return m_comboBoxProtoOpenvpnCipherEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setComboBoxProtoOpenvpnCipherEnabled(bool comboBoxProtoOpenvpnCipherEnabled)
|
|
||||||
{
|
|
||||||
if (m_comboBoxProtoOpenvpnCipherEnabled != comboBoxProtoOpenvpnCipherEnabled) {
|
|
||||||
m_comboBoxProtoOpenvpnCipherEnabled = comboBoxProtoOpenvpnCipherEnabled;
|
|
||||||
emit comboBoxProtoOpenvpnCipherEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getComboBoxProtoOpenvpnHashEnabled() const
|
|
||||||
{
|
|
||||||
return m_comboBoxProtoOpenvpnHashEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setComboBoxProtoOpenvpnHashEnabled(bool comboBoxProtoOpenvpnHashEnabled)
|
|
||||||
{
|
|
||||||
if (m_comboBoxProtoOpenvpnHashEnabled != comboBoxProtoOpenvpnHashEnabled) {
|
|
||||||
m_comboBoxProtoOpenvpnHashEnabled = comboBoxProtoOpenvpnHashEnabled;
|
|
||||||
emit comboBoxProtoOpenvpnHashEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
bool OpenVpnLogic::getPageProtoOpenvpnEnabled() const
|
|
||||||
{
|
|
||||||
return m_pageProtoOpenvpnEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setPageProtoOpenvpnEnabled(bool pageProtoOpenvpnEnabled)
|
|
||||||
{
|
|
||||||
if (m_pageProtoOpenvpnEnabled != pageProtoOpenvpnEnabled) {
|
|
||||||
m_pageProtoOpenvpnEnabled = pageProtoOpenvpnEnabled;
|
|
||||||
emit pageProtoOpenvpnEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool OpenVpnLogic::getLabelProtoOpenvpnInfoVisible() const
|
|
||||||
{
|
|
||||||
return m_labelProtoOpenvpnInfoVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setLabelProtoOpenvpnInfoVisible(bool labelProtoOpenvpnInfoVisible)
|
|
||||||
{
|
|
||||||
if (m_labelProtoOpenvpnInfoVisible != labelProtoOpenvpnInfoVisible) {
|
|
||||||
m_labelProtoOpenvpnInfoVisible = labelProtoOpenvpnInfoVisible;
|
|
||||||
emit labelProtoOpenvpnInfoVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString OpenVpnLogic::getLabelProtoOpenvpnInfoText() const
|
|
||||||
{
|
|
||||||
return m_labelProtoOpenvpnInfoText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setLabelProtoOpenvpnInfoText(const QString &labelProtoOpenvpnInfoText)
|
|
||||||
{
|
|
||||||
if (m_labelProtoOpenvpnInfoText != labelProtoOpenvpnInfoText) {
|
|
||||||
m_labelProtoOpenvpnInfoText = labelProtoOpenvpnInfoText;
|
|
||||||
emit labelProtoOpenvpnInfoTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int OpenVpnLogic::getProgressBarProtoOpenvpnResetValue() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoOpenvpnResetValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setProgressBarProtoOpenvpnResetValue(int progressBarProtoOpenvpnResetValue)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoOpenvpnResetValue != progressBarProtoOpenvpnResetValue) {
|
|
||||||
m_progressBarProtoOpenvpnResetValue = progressBarProtoOpenvpnResetValue;
|
|
||||||
emit progressBarProtoOpenvpnResetValueChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int OpenVpnLogic::getProgressBarProtoOpenvpnResetMaximium() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoOpenvpnResetMaximium;
|
|
||||||
}
|
|
||||||
|
|
||||||
void OpenVpnLogic::setProgressBarProtoOpenvpnResetMaximium(int progressBarProtoOpenvpnResetMaximium)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoOpenvpnResetMaximium != progressBarProtoOpenvpnResetMaximium) {
|
|
||||||
m_progressBarProtoOpenvpnResetMaximium = progressBarProtoOpenvpnResetMaximium;
|
|
||||||
emit progressBarProtoOpenvpnResetMaximiumChanged();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenVpnLogic::onCheckBoxProtoOpenvpnAutoEncryptionClicked()
|
void OpenVpnLogic::onCheckBoxProtoOpenvpnAutoEncryptionClicked()
|
||||||
{
|
{
|
||||||
setComboBoxProtoOpenvpnCipherEnabled(!getCheckBoxProtoOpenvpnAutoEncryptionChecked());
|
set_comboBoxProtoOpenvpnCipherEnabled(!checkBoxProtoOpenvpnAutoEncryptionChecked());
|
||||||
setComboBoxProtoOpenvpnHashEnabled(!getCheckBoxProtoOpenvpnAutoEncryptionChecked());
|
set_comboBoxProtoOpenvpnHashEnabled(!checkBoxProtoOpenvpnAutoEncryptionChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
void OpenVpnLogic::onPushButtonProtoOpenvpnSaveClicked()
|
void OpenVpnLogic::onPushButtonProtoOpenvpnSaveClicked()
|
||||||
|
|
@ -383,31 +96,31 @@ 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 {
|
||||||
setPageProtoOpenvpnEnabled(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 {
|
||||||
setPushButtonProtoOpenvpnSaveVisible(visible);
|
set_pushButtonOpenvpnSaveVisible(visible);
|
||||||
};
|
};
|
||||||
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 {
|
||||||
setLabelProtoOpenvpnInfoVisible(visible);
|
set_labelProtoOpenvpnInfoVisible(visible);
|
||||||
};
|
};
|
||||||
label_proto_openvpn_info.setTextFunc = [this] (const QString& text) ->void {
|
label_proto_openvpn_info.setTextFunc = [this] (const QString& text) ->void {
|
||||||
setLabelProtoOpenvpnInfoText(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 {
|
||||||
setProgressBarProtoOpenvpnResetVisible(visible);
|
set_progressBarProtoOpenvpnResetVisible(visible);
|
||||||
};
|
};
|
||||||
progressBar_proto_openvpn_reset.setValueFunc = [this] (int value) ->void {
|
progressBar_proto_openvpn_reset.setValueFunc = [this] (int value) ->void {
|
||||||
setProgressBarProtoOpenvpnResetValue(value);
|
set_progressBarProtoOpenvpnResetValue(value);
|
||||||
};
|
};
|
||||||
progressBar_proto_openvpn_reset.getValueFunc = [this] (void) -> int {
|
progressBar_proto_openvpn_reset.getValueFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtoOpenvpnResetValue();
|
return progressBarProtoOpenvpnResetValue();
|
||||||
};
|
};
|
||||||
progressBar_proto_openvpn_reset.getMaximiumFunc = [this] (void) -> int {
|
progressBar_proto_openvpn_reset.getMaximiumFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtoOpenvpnResetMaximium();
|
return progressBarProtoOpenvpnResetMaximium();
|
||||||
};
|
};
|
||||||
|
|
||||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
||||||
|
|
@ -425,13 +138,13 @@ void OpenVpnLogic::onPushButtonProtoOpenvpnSaveClicked()
|
||||||
|
|
||||||
QJsonObject OpenVpnLogic::getOpenVpnConfigFromPage(QJsonObject oldConfig)
|
QJsonObject OpenVpnLogic::getOpenVpnConfigFromPage(QJsonObject oldConfig)
|
||||||
{
|
{
|
||||||
oldConfig.insert(config_key::subnet_address, getLineEditProtoOpenvpnSubnetText());
|
oldConfig.insert(config_key::subnet_address, lineEditProtoOpenvpnSubnetText());
|
||||||
oldConfig.insert(config_key::transport_proto, getRadioButtonProtoOpenvpnUdpChecked() ? protocols::UDP : protocols::TCP);
|
oldConfig.insert(config_key::transport_proto, radioButtonProtoOpenvpnUdpChecked() ? protocols::UDP : protocols::TCP);
|
||||||
oldConfig.insert(config_key::ncp_disable, ! getCheckBoxProtoOpenvpnAutoEncryptionChecked());
|
oldConfig.insert(config_key::ncp_disable, ! checkBoxProtoOpenvpnAutoEncryptionChecked());
|
||||||
oldConfig.insert(config_key::cipher, getComboBoxProtoOpenvpnCipherText());
|
oldConfig.insert(config_key::cipher, comboBoxProtoOpenvpnCipherText());
|
||||||
oldConfig.insert(config_key::hash, getComboBoxProtoOpenvpnHashText());
|
oldConfig.insert(config_key::hash, comboBoxProtoOpenvpnHashText());
|
||||||
oldConfig.insert(config_key::block_outside_dns, getCheckBoxProtoOpenvpnBlockDnsChecked());
|
oldConfig.insert(config_key::block_outside_dns, checkBoxProtoOpenvpnBlockDnsChecked());
|
||||||
oldConfig.insert(config_key::port, getLineEditProtoOpenvpnPortText());
|
oldConfig.insert(config_key::port, lineEditProtoOpenvpnPortText());
|
||||||
oldConfig.insert(config_key::tls_auth, getCheckBoxProtoOpenvpnTlsAuthChecked());
|
oldConfig.insert(config_key::tls_auth, checkBoxProtoOpenvpnTlsAuthChecked());
|
||||||
return oldConfig;
|
return oldConfig;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,32 +9,32 @@ class OpenVpnLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
|
AUTO_PROPERTY(QString, lineEditProtoOpenvpnSubnetText)
|
||||||
|
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnUdpChecked)
|
||||||
|
AUTO_PROPERTY(bool, checkBoxProtoOpenvpnAutoEncryptionChecked)
|
||||||
|
AUTO_PROPERTY(QString, comboBoxProtoOpenvpnCipherText)
|
||||||
|
AUTO_PROPERTY(QString, comboBoxProtoOpenvpnHashText)
|
||||||
|
AUTO_PROPERTY(bool, checkBoxProtoOpenvpnBlockDnsChecked)
|
||||||
|
AUTO_PROPERTY(QString, lineEditProtoOpenvpnPortText)
|
||||||
|
AUTO_PROPERTY(bool, checkBoxProtoOpenvpnTlsAuthChecked)
|
||||||
|
|
||||||
|
AUTO_PROPERTY(bool, widgetProtoOpenvpnEnabled)
|
||||||
|
AUTO_PROPERTY(bool, pushButtonOpenvpnSaveVisible)
|
||||||
|
AUTO_PROPERTY(bool, progressBarProtoOpenvpnResetVisible)
|
||||||
|
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnUdpEnabled)
|
||||||
|
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnTcpEnabled)
|
||||||
|
AUTO_PROPERTY(bool, radioButtonProtoOpenvpnTcpChecked)
|
||||||
|
AUTO_PROPERTY(bool, lineEditProtoOpenvpnPortEnabled)
|
||||||
|
|
||||||
|
AUTO_PROPERTY(bool, comboBoxProtoOpenvpnCipherEnabled)
|
||||||
|
AUTO_PROPERTY(bool, comboBoxProtoOpenvpnHashEnabled)
|
||||||
|
AUTO_PROPERTY(bool, pageProtoOpenvpnEnabled)
|
||||||
|
AUTO_PROPERTY(bool, labelProtoOpenvpnInfoVisible)
|
||||||
|
AUTO_PROPERTY(QString, labelProtoOpenvpnInfoText)
|
||||||
|
AUTO_PROPERTY(int, progressBarProtoOpenvpnResetValue)
|
||||||
|
AUTO_PROPERTY(int, progressBarProtoOpenvpnResetMaximium)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Q_PROPERTY(QString lineEditProtoOpenvpnSubnetText READ getLineEditProtoOpenvpnSubnetText WRITE setLineEditProtoOpenvpnSubnetText NOTIFY lineEditProtoOpenvpnSubnetTextChanged)
|
|
||||||
Q_PROPERTY(bool radioButtonProtoOpenvpnUdpChecked READ getRadioButtonProtoOpenvpnUdpChecked WRITE setRadioButtonProtoOpenvpnUdpChecked NOTIFY radioButtonProtoOpenvpnUdpCheckedChanged)
|
|
||||||
Q_PROPERTY(bool checkBoxProtoOpenvpnAutoEncryptionChecked READ getCheckBoxProtoOpenvpnAutoEncryptionChecked WRITE setCheckBoxProtoOpenvpnAutoEncryptionChecked NOTIFY checkBoxProtoOpenvpnAutoEncryptionCheckedChanged)
|
|
||||||
Q_PROPERTY(QString comboBoxProtoOpenvpnCipherText READ getComboBoxProtoOpenvpnCipherText WRITE setComboBoxProtoOpenvpnCipherText NOTIFY comboBoxProtoOpenvpnCipherTextChanged)
|
|
||||||
Q_PROPERTY(QString comboBoxProtoOpenvpnHashText READ getComboBoxProtoOpenvpnHashText WRITE setComboBoxProtoOpenvpnHashText NOTIFY comboBoxProtoOpenvpnHashTextChanged)
|
|
||||||
Q_PROPERTY(bool checkBoxProtoOpenvpnBlockDnsChecked READ getCheckBoxProtoOpenvpnBlockDnsChecked WRITE setCheckBoxProtoOpenvpnBlockDnsChecked NOTIFY checkBoxProtoOpenvpnBlockDnsCheckedChanged)
|
|
||||||
Q_PROPERTY(QString lineEditProtoOpenvpnPortText READ getLineEditProtoOpenvpnPortText WRITE setLineEditProtoOpenvpnPortText NOTIFY lineEditProtoOpenvpnPortTextChanged)
|
|
||||||
Q_PROPERTY(bool checkBoxProtoOpenvpnTlsAuthChecked READ getCheckBoxProtoOpenvpnTlsAuthChecked WRITE setCheckBoxProtoOpenvpnTlsAuthChecked NOTIFY checkBoxProtoOpenvpnTlsAuthCheckedChanged)
|
|
||||||
|
|
||||||
Q_PROPERTY(bool widgetProtoOpenvpnEnabled READ getWidgetProtoOpenvpnEnabled WRITE setWidgetProtoOpenvpnEnabled NOTIFY widgetProtoOpenvpnEnabledChanged)
|
|
||||||
Q_PROPERTY(bool pushButtonProtoOpenvpnSaveVisible READ getPushButtonProtoOpenvpnSaveVisible WRITE setPushButtonProtoOpenvpnSaveVisible NOTIFY pushButtonProtoOpenvpnSaveVisibleChanged)
|
|
||||||
Q_PROPERTY(bool progressBarProtoOpenvpnResetVisible READ getProgressBarProtoOpenvpnResetVisible WRITE setProgressBarProtoOpenvpnResetVisible NOTIFY progressBarProtoOpenvpnResetVisibleChanged)
|
|
||||||
Q_PROPERTY(bool radioButtonProtoOpenvpnUdpEnabled READ getRadioButtonProtoOpenvpnUdpEnabled WRITE setRadioButtonProtoOpenvpnUdpEnabled NOTIFY radioButtonProtoOpenvpnUdpEnabledChanged)
|
|
||||||
Q_PROPERTY(bool radioButtonProtoOpenvpnTcpEnabled READ getRadioButtonProtoOpenvpnTcpEnabled WRITE setRadioButtonProtoOpenvpnTcpEnabled NOTIFY radioButtonProtoOpenvpnTcpEnabledChanged)
|
|
||||||
Q_PROPERTY(bool radioButtonProtoOpenvpnTcpChecked READ getRadioButtonProtoOpenvpnTcpChecked WRITE setRadioButtonProtoOpenvpnTcpChecked NOTIFY radioButtonProtoOpenvpnTcpCheckedChanged)
|
|
||||||
Q_PROPERTY(bool lineEditProtoOpenvpnPortEnabled READ getLineEditProtoOpenvpnPortEnabled WRITE setLineEditProtoOpenvpnPortEnabled NOTIFY lineEditProtoOpenvpnPortEnabledChanged)
|
|
||||||
|
|
||||||
Q_PROPERTY(bool comboBoxProtoOpenvpnCipherEnabled READ getComboBoxProtoOpenvpnCipherEnabled WRITE setComboBoxProtoOpenvpnCipherEnabled NOTIFY comboBoxProtoOpenvpnCipherEnabledChanged)
|
|
||||||
Q_PROPERTY(bool comboBoxProtoOpenvpnHashEnabled READ getComboBoxProtoOpenvpnHashEnabled WRITE setComboBoxProtoOpenvpnHashEnabled NOTIFY comboBoxProtoOpenvpnHashEnabledChanged)
|
|
||||||
Q_PROPERTY(bool pageProtoOpenvpnEnabled READ getPageProtoOpenvpnEnabled WRITE setPageProtoOpenvpnEnabled NOTIFY pageProtoOpenvpnEnabledChanged)
|
|
||||||
Q_PROPERTY(bool labelProtoOpenvpnInfoVisible READ getLabelProtoOpenvpnInfoVisible WRITE setLabelProtoOpenvpnInfoVisible NOTIFY labelProtoOpenvpnInfoVisibleChanged)
|
|
||||||
Q_PROPERTY(QString labelProtoOpenvpnInfoText READ getLabelProtoOpenvpnInfoText WRITE setLabelProtoOpenvpnInfoText NOTIFY labelProtoOpenvpnInfoTextChanged)
|
|
||||||
Q_PROPERTY(int progressBarProtoOpenvpnResetValue READ getProgressBarProtoOpenvpnResetValue WRITE setProgressBarProtoOpenvpnResetValue NOTIFY progressBarProtoOpenvpnResetValueChanged)
|
|
||||||
Q_PROPERTY(int progressBarProtoOpenvpnResetMaximium READ getProgressBarProtoOpenvpnResetMaximium WRITE setProgressBarProtoOpenvpnResetMaximium NOTIFY progressBarProtoOpenvpnResetMaximiumChanged)
|
|
||||||
|
|
||||||
Q_INVOKABLE void onCheckBoxProtoOpenvpnAutoEncryptionClicked();
|
Q_INVOKABLE void onCheckBoxProtoOpenvpnAutoEncryptionClicked();
|
||||||
Q_INVOKABLE void onPushButtonProtoOpenvpnSaveClicked();
|
Q_INVOKABLE void onPushButtonProtoOpenvpnSaveClicked();
|
||||||
|
|
||||||
|
|
@ -45,110 +45,9 @@ public:
|
||||||
void updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerContainer container, bool haveAuthData);
|
void updateOpenVpnPage(const QJsonObject &openvpnConfig, DockerContainer container, bool haveAuthData);
|
||||||
QJsonObject getOpenVpnConfigFromPage(QJsonObject oldConfig);
|
QJsonObject getOpenVpnConfigFromPage(QJsonObject oldConfig);
|
||||||
|
|
||||||
QString getLineEditProtoOpenvpnSubnetText() const;
|
|
||||||
void setLineEditProtoOpenvpnSubnetText(const QString &lineEditProtoOpenvpnSubnetText);
|
|
||||||
bool getRadioButtonProtoOpenvpnUdpChecked() const;
|
|
||||||
void setRadioButtonProtoOpenvpnUdpChecked(bool radioButtonProtoOpenvpnUdpChecked);
|
|
||||||
bool getCheckBoxProtoOpenvpnAutoEncryptionChecked() const;
|
|
||||||
void setCheckBoxProtoOpenvpnAutoEncryptionChecked(bool checkBoxProtoOpenvpnAutoEncryptionChecked);
|
|
||||||
QString getComboBoxProtoOpenvpnCipherText() const;
|
|
||||||
void setComboBoxProtoOpenvpnCipherText(const QString &comboBoxProtoOpenvpnCipherText);
|
|
||||||
QString getComboBoxProtoOpenvpnHashText() const;
|
|
||||||
void setComboBoxProtoOpenvpnHashText(const QString &comboBoxProtoOpenvpnHashText);
|
|
||||||
bool getCheckBoxProtoOpenvpnBlockDnsChecked() const;
|
|
||||||
void setCheckBoxProtoOpenvpnBlockDnsChecked(bool checkBoxProtoOpenvpnBlockDnsChecked);
|
|
||||||
QString getLineEditProtoOpenvpnPortText() const;
|
|
||||||
void setLineEditProtoOpenvpnPortText(const QString &lineEditProtoOpenvpnPortText);
|
|
||||||
bool getCheckBoxProtoOpenvpnTlsAuthChecked() const;
|
|
||||||
void setCheckBoxProtoOpenvpnTlsAuthChecked(bool checkBoxProtoOpenvpnTlsAuthChecked);
|
|
||||||
|
|
||||||
|
|
||||||
bool getWidgetProtoOpenvpnEnabled() const;
|
|
||||||
void setWidgetProtoOpenvpnEnabled(bool widgetProtoOpenvpnEnabled);
|
|
||||||
bool getPushButtonProtoOpenvpnSaveVisible() const;
|
|
||||||
void setPushButtonProtoOpenvpnSaveVisible(bool pushButtonProtoOpenvpnSaveVisible);
|
|
||||||
bool getProgressBarProtoOpenvpnResetVisible() const;
|
|
||||||
void setProgressBarProtoOpenvpnResetVisible(bool progressBarProtoOpenvpnResetVisible);
|
|
||||||
bool getRadioButtonProtoOpenvpnUdpEnabled() const;
|
|
||||||
void setRadioButtonProtoOpenvpnUdpEnabled(bool radioButtonProtoOpenvpnUdpEnabled);
|
|
||||||
bool getRadioButtonProtoOpenvpnTcpEnabled() const;
|
|
||||||
void setRadioButtonProtoOpenvpnTcpEnabled(bool radioButtonProtoOpenvpnTcpEnabled);
|
|
||||||
bool getRadioButtonProtoOpenvpnTcpChecked() const;
|
|
||||||
void setRadioButtonProtoOpenvpnTcpChecked(bool radioButtonProtoOpenvpnTcpChecked);
|
|
||||||
bool getLineEditProtoOpenvpnPortEnabled() const;
|
|
||||||
void setLineEditProtoOpenvpnPortEnabled(bool lineEditProtoOpenvpnPortEnabled);
|
|
||||||
|
|
||||||
bool getComboBoxProtoOpenvpnCipherEnabled() const;
|
|
||||||
void setComboBoxProtoOpenvpnCipherEnabled(bool comboBoxProtoOpenvpnCipherEnabled);
|
|
||||||
bool getComboBoxProtoOpenvpnHashEnabled() const;
|
|
||||||
void setComboBoxProtoOpenvpnHashEnabled(bool comboBoxProtoOpenvpnHashEnabled);
|
|
||||||
bool getPageProtoOpenvpnEnabled() const;
|
|
||||||
void setPageProtoOpenvpnEnabled(bool pageProtoOpenvpnEnabled);
|
|
||||||
bool getLabelProtoOpenvpnInfoVisible() const;
|
|
||||||
void setLabelProtoOpenvpnInfoVisible(bool labelProtoOpenvpnInfoVisible);
|
|
||||||
QString getLabelProtoOpenvpnInfoText() const;
|
|
||||||
void setLabelProtoOpenvpnInfoText(const QString &labelProtoOpenvpnInfoText);
|
|
||||||
int getProgressBarProtoOpenvpnResetValue() const;
|
|
||||||
void setProgressBarProtoOpenvpnResetValue(int progressBarProtoOpenvpnResetValue);
|
|
||||||
int getProgressBarProtoOpenvpnResetMaximium() const;
|
|
||||||
void setProgressBarProtoOpenvpnResetMaximium(int progressBarProtoOpenvpnResetMaximium);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void lineEditProtoOpenvpnSubnetTextChanged();
|
|
||||||
void radioButtonProtoOpenvpnUdpCheckedChanged();
|
|
||||||
void checkBoxProtoOpenvpnAutoEncryptionCheckedChanged();
|
|
||||||
void comboBoxProtoOpenvpnCipherTextChanged();
|
|
||||||
void comboBoxProtoOpenvpnHashTextChanged();
|
|
||||||
void checkBoxProtoOpenvpnBlockDnsCheckedChanged();
|
|
||||||
void lineEditProtoOpenvpnPortTextChanged();
|
|
||||||
void checkBoxProtoOpenvpnTlsAuthCheckedChanged();
|
|
||||||
void widgetProtoOpenvpnEnabledChanged();
|
|
||||||
void pushButtonProtoOpenvpnSaveVisibleChanged();
|
|
||||||
void progressBarProtoOpenvpnResetVisibleChanged();
|
|
||||||
void radioButtonProtoOpenvpnUdpEnabledChanged();
|
|
||||||
void radioButtonProtoOpenvpnTcpEnabledChanged();
|
|
||||||
void radioButtonProtoOpenvpnTcpCheckedChanged();
|
|
||||||
void lineEditProtoOpenvpnPortEnabledChanged();
|
|
||||||
void comboBoxProtoOpenvpnCipherEnabledChanged();
|
|
||||||
void comboBoxProtoOpenvpnHashEnabledChanged();
|
|
||||||
void pageProtoOpenvpnEnabledChanged();
|
|
||||||
void labelProtoOpenvpnInfoVisibleChanged();
|
|
||||||
void labelProtoOpenvpnInfoTextChanged();
|
|
||||||
void progressBarProtoOpenvpnResetValueChanged();
|
|
||||||
void progressBarProtoOpenvpnResetMaximiumChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Settings m_settings;
|
Settings m_settings;
|
||||||
UiLogic *m_uiLogic;
|
UiLogic *m_uiLogic;
|
||||||
|
|
||||||
QString m_lineEditProtoOpenvpnSubnetText;
|
|
||||||
bool m_radioButtonProtoOpenvpnUdpChecked;
|
|
||||||
bool m_checkBoxProtoOpenvpnAutoEncryptionChecked;
|
|
||||||
QString m_comboBoxProtoOpenvpnCipherText;
|
|
||||||
QString m_comboBoxProtoOpenvpnHashText;
|
|
||||||
bool m_checkBoxProtoOpenvpnBlockDnsChecked;
|
|
||||||
QString m_lineEditProtoOpenvpnPortText;
|
|
||||||
bool m_checkBoxProtoOpenvpnTlsAuthChecked;
|
|
||||||
bool m_widgetProtoOpenvpnEnabled;
|
|
||||||
bool m_pushButtonProtoOpenvpnSaveVisible;
|
|
||||||
bool m_progressBarProtoOpenvpnResetVisible;
|
|
||||||
bool m_radioButtonProtoOpenvpnUdpEnabled;
|
|
||||||
bool m_radioButtonProtoOpenvpnTcpEnabled;
|
|
||||||
bool m_radioButtonProtoOpenvpnTcpChecked;
|
|
||||||
bool m_lineEditProtoOpenvpnPortEnabled;
|
|
||||||
bool m_comboBoxProtoOpenvpnCipherEnabled;
|
|
||||||
bool m_comboBoxProtoOpenvpnHashEnabled;
|
|
||||||
bool m_pageProtoOpenvpnEnabled;
|
|
||||||
bool m_labelProtoOpenvpnInfoVisible;
|
|
||||||
QString m_labelProtoOpenvpnInfoText;
|
|
||||||
int m_progressBarProtoOpenvpnResetValue;
|
|
||||||
int m_progressBarProtoOpenvpnResetMaximium;
|
|
||||||
};
|
};
|
||||||
#endif // OPENVPN_LOGIC_H
|
#endif // OPENVPN_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@ ShadowSocksLogic::ShadowSocksLogic(UiLogic *logic, QObject *parent):
|
||||||
m_widgetProtoSsEnabled{false},
|
m_widgetProtoSsEnabled{false},
|
||||||
m_comboBoxProtoShadowsocksCipherText{"chacha20-poly1305"},
|
m_comboBoxProtoShadowsocksCipherText{"chacha20-poly1305"},
|
||||||
m_lineEditProtoShadowsocksPortText{},
|
m_lineEditProtoShadowsocksPortText{},
|
||||||
m_pushButtonProtoShadowsocksSaveVisible{false},
|
m_pushButtonShadowsocksSaveVisible{false},
|
||||||
m_progressBarProtoShadowsocksResetVisible{false},
|
m_progressBarProtoShadowsocksResetVisible{false},
|
||||||
m_lineEditProtoShadowsocksPortEnabled{false},
|
m_lineEditProtoShadowsocksPortEnabled{false},
|
||||||
m_pageProtoShadowsocksEnabled{true},
|
m_pageProtoShadowsocksEnabled{true},
|
||||||
|
|
@ -25,170 +25,27 @@ ShadowSocksLogic::ShadowSocksLogic(UiLogic *logic, QObject *parent):
|
||||||
|
|
||||||
void ShadowSocksLogic::updateShadowSocksPage(const QJsonObject &ssConfig, DockerContainer container, bool haveAuthData)
|
void ShadowSocksLogic::updateShadowSocksPage(const QJsonObject &ssConfig, DockerContainer container, bool haveAuthData)
|
||||||
{
|
{
|
||||||
setWidgetProtoSsEnabled(haveAuthData);
|
set_widgetProtoSsEnabled(haveAuthData);
|
||||||
setPushButtonProtoShadowsocksSaveVisible(haveAuthData);
|
set_pushButtonShadowsocksSaveVisible(haveAuthData);
|
||||||
setProgressBarProtoShadowsocksResetVisible(haveAuthData);
|
set_progressBarProtoShadowsocksResetVisible(haveAuthData);
|
||||||
|
|
||||||
setComboBoxProtoShadowsocksCipherText(ssConfig.value(config_key::cipher).
|
set_comboBoxProtoShadowsocksCipherText(ssConfig.value(config_key::cipher).
|
||||||
toString(protocols::shadowsocks::defaultCipher));
|
toString(protocols::shadowsocks::defaultCipher));
|
||||||
|
|
||||||
setLineEditProtoShadowsocksPortText(ssConfig.value(config_key::port).
|
set_lineEditProtoShadowsocksPortText(ssConfig.value(config_key::port).
|
||||||
toString(protocols::shadowsocks::defaultPort));
|
toString(protocols::shadowsocks::defaultPort));
|
||||||
|
|
||||||
setLineEditProtoShadowsocksPortEnabled(container == DockerContainer::OpenVpnOverShadowSocks);
|
set_lineEditProtoShadowsocksPortEnabled(container == DockerContainer::OpenVpnOverShadowSocks);
|
||||||
}
|
}
|
||||||
|
|
||||||
QJsonObject ShadowSocksLogic::getShadowSocksConfigFromPage(QJsonObject oldConfig)
|
QJsonObject ShadowSocksLogic::getShadowSocksConfigFromPage(QJsonObject oldConfig)
|
||||||
{
|
{
|
||||||
oldConfig.insert(config_key::cipher, getComboBoxProtoShadowsocksCipherText());
|
oldConfig.insert(config_key::cipher, comboBoxProtoShadowsocksCipherText());
|
||||||
oldConfig.insert(config_key::port, getLineEditProtoShadowsocksPortText());
|
oldConfig.insert(config_key::port, lineEditProtoShadowsocksPortText());
|
||||||
|
|
||||||
return oldConfig;
|
return oldConfig;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ShadowSocksLogic::getComboBoxProtoShadowsocksCipherText() const
|
|
||||||
{
|
|
||||||
return m_comboBoxProtoShadowsocksCipherText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setComboBoxProtoShadowsocksCipherText(const QString &comboBoxProtoShadowsocksCipherText)
|
|
||||||
{
|
|
||||||
if (m_comboBoxProtoShadowsocksCipherText != comboBoxProtoShadowsocksCipherText) {
|
|
||||||
m_comboBoxProtoShadowsocksCipherText = comboBoxProtoShadowsocksCipherText;
|
|
||||||
emit comboBoxProtoShadowsocksCipherTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShadowSocksLogic::getLineEditProtoShadowsocksPortText() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoShadowsocksPortText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setLineEditProtoShadowsocksPortText(const QString &lineEditProtoShadowsocksPortText)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoShadowsocksPortText != lineEditProtoShadowsocksPortText) {
|
|
||||||
m_lineEditProtoShadowsocksPortText = lineEditProtoShadowsocksPortText;
|
|
||||||
emit lineEditProtoShadowsocksPortTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShadowSocksLogic::getPushButtonProtoShadowsocksSaveVisible() const
|
|
||||||
{
|
|
||||||
return m_pushButtonProtoShadowsocksSaveVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setPushButtonProtoShadowsocksSaveVisible(bool pushButtonProtoShadowsocksSaveVisible)
|
|
||||||
{
|
|
||||||
if (m_pushButtonProtoShadowsocksSaveVisible != pushButtonProtoShadowsocksSaveVisible) {
|
|
||||||
m_pushButtonProtoShadowsocksSaveVisible = pushButtonProtoShadowsocksSaveVisible;
|
|
||||||
emit pushButtonProtoShadowsocksSaveVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShadowSocksLogic::getProgressBarProtoShadowsocksResetVisible() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoShadowsocksResetVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setProgressBarProtoShadowsocksResetVisible(bool progressBarProtoShadowsocksResetVisible)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoShadowsocksResetVisible != progressBarProtoShadowsocksResetVisible) {
|
|
||||||
m_progressBarProtoShadowsocksResetVisible = progressBarProtoShadowsocksResetVisible;
|
|
||||||
emit progressBarProtoShadowsocksResetVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShadowSocksLogic::getLineEditProtoShadowsocksPortEnabled() const
|
|
||||||
{
|
|
||||||
return m_lineEditProtoShadowsocksPortEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setLineEditProtoShadowsocksPortEnabled(bool lineEditProtoShadowsocksPortEnabled)
|
|
||||||
{
|
|
||||||
if (m_lineEditProtoShadowsocksPortEnabled != lineEditProtoShadowsocksPortEnabled) {
|
|
||||||
m_lineEditProtoShadowsocksPortEnabled = lineEditProtoShadowsocksPortEnabled;
|
|
||||||
emit lineEditProtoShadowsocksPortEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShadowSocksLogic::getPageProtoShadowsocksEnabled() const
|
|
||||||
{
|
|
||||||
return m_pageProtoShadowsocksEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setPageProtoShadowsocksEnabled(bool pageProtoShadowsocksEnabled)
|
|
||||||
{
|
|
||||||
if (m_pageProtoShadowsocksEnabled != pageProtoShadowsocksEnabled) {
|
|
||||||
m_pageProtoShadowsocksEnabled = pageProtoShadowsocksEnabled;
|
|
||||||
emit pageProtoShadowsocksEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShadowSocksLogic::getLabelProtoShadowsocksInfoVisible() const
|
|
||||||
{
|
|
||||||
return m_labelProtoShadowsocksInfoVisible;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setLabelProtoShadowsocksInfoVisible(bool labelProtoShadowsocksInfoVisible)
|
|
||||||
{
|
|
||||||
if (m_labelProtoShadowsocksInfoVisible != labelProtoShadowsocksInfoVisible) {
|
|
||||||
m_labelProtoShadowsocksInfoVisible = labelProtoShadowsocksInfoVisible;
|
|
||||||
emit labelProtoShadowsocksInfoVisibleChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
QString ShadowSocksLogic::getLabelProtoShadowsocksInfoText() const
|
|
||||||
{
|
|
||||||
return m_labelProtoShadowsocksInfoText;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setLabelProtoShadowsocksInfoText(const QString &labelProtoShadowsocksInfoText)
|
|
||||||
{
|
|
||||||
if (m_labelProtoShadowsocksInfoText != labelProtoShadowsocksInfoText) {
|
|
||||||
m_labelProtoShadowsocksInfoText = labelProtoShadowsocksInfoText;
|
|
||||||
emit labelProtoShadowsocksInfoTextChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int ShadowSocksLogic::getProgressBarProtoShadowsocksResetValue() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoShadowsocksResetValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setProgressBarProtoShadowsocksResetValue(int progressBarProtoShadowsocksResetValue)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoShadowsocksResetValue != progressBarProtoShadowsocksResetValue) {
|
|
||||||
m_progressBarProtoShadowsocksResetValue = progressBarProtoShadowsocksResetValue;
|
|
||||||
emit progressBarProtoShadowsocksResetValueChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int ShadowSocksLogic::getProgressBarProtoShadowsocksResetMaximium() const
|
|
||||||
{
|
|
||||||
return m_progressBarProtoShadowsocksResetMaximium;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setProgressBarProtoShadowsocksResetMaximium(int progressBarProtoShadowsocksResetMaximium)
|
|
||||||
{
|
|
||||||
if (m_progressBarProtoShadowsocksResetMaximium != progressBarProtoShadowsocksResetMaximium) {
|
|
||||||
m_progressBarProtoShadowsocksResetMaximium = progressBarProtoShadowsocksResetMaximium;
|
|
||||||
emit progressBarProtoShadowsocksResetMaximiumChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool ShadowSocksLogic::getWidgetProtoSsEnabled() const
|
|
||||||
{
|
|
||||||
return m_widgetProtoSsEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
void ShadowSocksLogic::setWidgetProtoSsEnabled(bool widgetProtoSsEnabled)
|
|
||||||
{
|
|
||||||
if (m_widgetProtoSsEnabled != widgetProtoSsEnabled) {
|
|
||||||
m_widgetProtoSsEnabled = widgetProtoSsEnabled;
|
|
||||||
emit widgetProtoSsEnabledChanged();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
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);
|
||||||
|
|
@ -199,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 {
|
||||||
setPageProtoShadowsocksEnabled(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 {
|
||||||
setPushButtonProtoShadowsocksSaveVisible(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 {
|
||||||
setLabelProtoShadowsocksInfoVisible(visible);
|
set_labelProtoShadowsocksInfoVisible(visible);
|
||||||
};
|
};
|
||||||
label_proto_shadowsocks_info.setTextFunc = [this] (const QString& text) ->void {
|
label_proto_shadowsocks_info.setTextFunc = [this] (const QString& text) ->void {
|
||||||
setLabelProtoShadowsocksInfoText(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 {
|
||||||
setProgressBarProtoShadowsocksResetVisible(visible);
|
set_progressBarProtoShadowsocksResetVisible(visible);
|
||||||
};
|
};
|
||||||
progressBar_proto_shadowsocks_reset.setValueFunc = [this] (int value) ->void {
|
progressBar_proto_shadowsocks_reset.setValueFunc = [this] (int value) ->void {
|
||||||
setProgressBarProtoShadowsocksResetValue(value);
|
set_progressBarProtoShadowsocksResetValue(value);
|
||||||
};
|
};
|
||||||
progressBar_proto_shadowsocks_reset.getValueFunc = [this] (void) -> int {
|
progressBar_proto_shadowsocks_reset.getValueFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtoShadowsocksResetValue();
|
return progressBarProtoShadowsocksResetValue();
|
||||||
};
|
};
|
||||||
progressBar_proto_shadowsocks_reset.getMaximiumFunc = [this] (void) -> int {
|
progressBar_proto_shadowsocks_reset.getMaximiumFunc = [this] (void) -> int {
|
||||||
return getProgressBarProtoShadowsocksResetMaximium();
|
return progressBarProtoShadowsocksResetMaximium();
|
||||||
};
|
};
|
||||||
|
|
||||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, newContainerConfig](){
|
||||||
|
|
|
||||||
|
|
@ -9,19 +9,19 @@ class ShadowSocksLogic : public PageLogicBase
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
AUTO_PROPERTY(bool, widgetProtoSsEnabled)
|
||||||
Q_PROPERTY(bool widgetProtoSsEnabled READ getWidgetProtoSsEnabled WRITE setWidgetProtoSsEnabled NOTIFY widgetProtoSsEnabledChanged)
|
AUTO_PROPERTY(QString, comboBoxProtoShadowsocksCipherText)
|
||||||
Q_PROPERTY(QString comboBoxProtoShadowsocksCipherText READ getComboBoxProtoShadowsocksCipherText WRITE setComboBoxProtoShadowsocksCipherText NOTIFY comboBoxProtoShadowsocksCipherTextChanged)
|
AUTO_PROPERTY(QString, lineEditProtoShadowsocksPortText)
|
||||||
Q_PROPERTY(QString lineEditProtoShadowsocksPortText READ getLineEditProtoShadowsocksPortText WRITE setLineEditProtoShadowsocksPortText NOTIFY lineEditProtoShadowsocksPortTextChanged)
|
AUTO_PROPERTY(bool, pushButtonShadowsocksSaveVisible)
|
||||||
Q_PROPERTY(bool pushButtonProtoShadowsocksSaveVisible READ getPushButtonProtoShadowsocksSaveVisible WRITE setPushButtonProtoShadowsocksSaveVisible NOTIFY pushButtonProtoShadowsocksSaveVisibleChanged)
|
AUTO_PROPERTY(bool, progressBarProtoShadowsocksResetVisible)
|
||||||
Q_PROPERTY(bool progressBarProtoShadowsocksResetVisible READ getProgressBarProtoShadowsocksResetVisible WRITE setProgressBarProtoShadowsocksResetVisible NOTIFY progressBarProtoShadowsocksResetVisibleChanged)
|
AUTO_PROPERTY(bool, lineEditProtoShadowsocksPortEnabled)
|
||||||
Q_PROPERTY(bool lineEditProtoShadowsocksPortEnabled READ getLineEditProtoShadowsocksPortEnabled WRITE setLineEditProtoShadowsocksPortEnabled NOTIFY lineEditProtoShadowsocksPortEnabledChanged)
|
AUTO_PROPERTY(bool, pageProtoShadowsocksEnabled)
|
||||||
Q_PROPERTY(bool pageProtoShadowsocksEnabled READ getPageProtoShadowsocksEnabled WRITE setPageProtoShadowsocksEnabled NOTIFY pageProtoShadowsocksEnabledChanged)
|
AUTO_PROPERTY(bool, labelProtoShadowsocksInfoVisible)
|
||||||
Q_PROPERTY(bool labelProtoShadowsocksInfoVisible READ getLabelProtoShadowsocksInfoVisible WRITE setLabelProtoShadowsocksInfoVisible NOTIFY labelProtoShadowsocksInfoVisibleChanged)
|
AUTO_PROPERTY(QString, labelProtoShadowsocksInfoText)
|
||||||
Q_PROPERTY(QString labelProtoShadowsocksInfoText READ getLabelProtoShadowsocksInfoText WRITE setLabelProtoShadowsocksInfoText NOTIFY labelProtoShadowsocksInfoTextChanged)
|
AUTO_PROPERTY(int, progressBarProtoShadowsocksResetValue)
|
||||||
Q_PROPERTY(int progressBarProtoShadowsocksResetValue READ getProgressBarProtoShadowsocksResetValue WRITE setProgressBarProtoShadowsocksResetValue NOTIFY progressBarProtoShadowsocksResetValueChanged)
|
AUTO_PROPERTY(int, progressBarProtoShadowsocksResetMaximium)
|
||||||
Q_PROPERTY(int progressBarProtoShadowsocksResetMaximium READ getProgressBarProtoShadowsocksResetMaximium WRITE setProgressBarProtoShadowsocksResetMaximium NOTIFY progressBarProtoShadowsocksResetMaximiumChanged)
|
|
||||||
|
|
||||||
|
public:
|
||||||
Q_INVOKABLE void onPushButtonProtoShadowsocksSaveClicked();
|
Q_INVOKABLE void onPushButtonProtoShadowsocksSaveClicked();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
@ -31,66 +31,9 @@ public:
|
||||||
void updateShadowSocksPage(const QJsonObject &ssConfig, DockerContainer container, bool haveAuthData);
|
void updateShadowSocksPage(const QJsonObject &ssConfig, DockerContainer container, bool haveAuthData);
|
||||||
QJsonObject getShadowSocksConfigFromPage(QJsonObject oldConfig);
|
QJsonObject getShadowSocksConfigFromPage(QJsonObject oldConfig);
|
||||||
|
|
||||||
bool getWidgetProtoSsEnabled() const;
|
|
||||||
void setWidgetProtoSsEnabled(bool widgetProtoSsEnabled);
|
|
||||||
QString getComboBoxProtoShadowsocksCipherText() const;
|
|
||||||
void setComboBoxProtoShadowsocksCipherText(const QString &comboBoxProtoShadowsocksCipherText);
|
|
||||||
QString getLineEditProtoShadowsocksPortText() const;
|
|
||||||
void setLineEditProtoShadowsocksPortText(const QString &lineEditProtoShadowsocksPortText);
|
|
||||||
|
|
||||||
bool getPushButtonProtoShadowsocksSaveVisible() const;
|
|
||||||
void setPushButtonProtoShadowsocksSaveVisible(bool pushButtonProtoShadowsocksSaveVisible);
|
|
||||||
bool getProgressBarProtoShadowsocksResetVisible() const;
|
|
||||||
void setProgressBarProtoShadowsocksResetVisible(bool progressBarProtoShadowsocksResetVisible);
|
|
||||||
bool getLineEditProtoShadowsocksPortEnabled() const;
|
|
||||||
void setLineEditProtoShadowsocksPortEnabled(bool lineEditProtoShadowsocksPortEnabled);
|
|
||||||
|
|
||||||
bool getPageProtoShadowsocksEnabled() const;
|
|
||||||
void setPageProtoShadowsocksEnabled(bool pageProtoShadowsocksEnabled);
|
|
||||||
bool getLabelProtoShadowsocksInfoVisible() const;
|
|
||||||
void setLabelProtoShadowsocksInfoVisible(bool labelProtoShadowsocksInfoVisible);
|
|
||||||
QString getLabelProtoShadowsocksInfoText() const;
|
|
||||||
void setLabelProtoShadowsocksInfoText(const QString &labelProtoShadowsocksInfoText);
|
|
||||||
int getProgressBarProtoShadowsocksResetValue() const;
|
|
||||||
void setProgressBarProtoShadowsocksResetValue(int progressBarProtoShadowsocksResetValue);
|
|
||||||
int getProgressBarProtoShadowsocksResetMaximium() const;
|
|
||||||
void setProgressBarProtoShadowsocksResetMaximium(int progressBarProtoShadowsocksResetMaximium);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
void widgetProtoSsEnabledChanged();
|
|
||||||
void comboBoxProtoShadowsocksCipherTextChanged();
|
|
||||||
void lineEditProtoShadowsocksPortTextChanged();
|
|
||||||
void pushButtonProtoShadowsocksSaveVisibleChanged();
|
|
||||||
void progressBarProtoShadowsocksResetVisibleChanged();
|
|
||||||
void lineEditProtoShadowsocksPortEnabledChanged();
|
|
||||||
void pageProtoShadowsocksEnabledChanged();
|
|
||||||
void labelProtoShadowsocksInfoVisibleChanged();
|
|
||||||
void labelProtoShadowsocksInfoTextChanged();
|
|
||||||
void progressBarProtoShadowsocksResetValueChanged();
|
|
||||||
void progressBarProtoShadowsocksResetMaximiumChanged();
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
|
|
||||||
private slots:
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Settings m_settings;
|
Settings m_settings;
|
||||||
UiLogic *m_uiLogic;
|
UiLogic *m_uiLogic;
|
||||||
|
|
||||||
bool m_widgetProtoSsEnabled;
|
|
||||||
QString m_comboBoxProtoShadowsocksCipherText;
|
|
||||||
QString m_lineEditProtoShadowsocksPortText;
|
|
||||||
bool m_pushButtonProtoShadowsocksSaveVisible;
|
|
||||||
bool m_progressBarProtoShadowsocksResetVisible;
|
|
||||||
bool m_lineEditProtoShadowsocksPortEnabled;
|
|
||||||
bool m_pageProtoShadowsocksEnabled;
|
|
||||||
bool m_labelProtoShadowsocksInfoVisible;
|
|
||||||
QString m_labelProtoShadowsocksInfoText;
|
|
||||||
int m_progressBarProtoShadowsocksResetValue;
|
|
||||||
int m_progressBarProtoShadowsocksResetMaximium;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
#endif // SHADOWSOCKS_LOGIC_H
|
#endif // SHADOWSOCKS_LOGIC_H
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import "../Config"
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
enabled: ServerContainersLogic.pageServerContainersEnabled
|
enabled: ServerContainersLogic.pageEnabled
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
id: back
|
id: back
|
||||||
x: 10
|
x: 10
|
||||||
|
|
@ -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.pushButtonProtoCloakOpenvpnContDefaultChecked
|
checked: ServerContainersLogic.pushButtonCloakOpenvpnContDefaultChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoCloakOpenvpnContDefaultChecked = checked
|
ServerContainersLogic.pushButtonCloakOpenvpnContDefaultChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContDefaultClicked(checked)
|
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContDefaultClicked(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: ServerContainersLogic.pushButtonProtoCloakOpenvpnContDefaultVisible
|
visible: ServerContainersLogic.pushButtonCloakOpenvpnContDefaultVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -123,7 +123,7 @@ Item {
|
||||||
icon.source: "qrc:/images/share.png"
|
icon.source: "qrc:/images/share.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
visible: ServerContainersLogic.pushButtonProtoCloakOpenvpnContShareVisible
|
visible: ServerContainersLogic.pushButtonCloakOpenvpnContShareVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContShareClicked(false)
|
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContShareClicked(false)
|
||||||
}
|
}
|
||||||
|
|
@ -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.pushButtonProtoCloakOpenvpnContInstallChecked
|
checked: ServerContainersLogic.pushButtonCloakOpenvpnContInstallChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoCloakOpenvpnContInstallChecked = checked
|
ServerContainersLogic.pushButtonCloakOpenvpnContInstallChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContInstallClicked(checked)
|
ServerContainersLogic.onPushButtonProtoCloakOpenvpnContInstallClicked(checked)
|
||||||
}
|
}
|
||||||
enabled: ServerContainersLogic.pushButtonProtoCloakOpenvpnContInstallEnabled
|
enabled: ServerContainersLogic.pushButtonCloakOpenvpnContInstallEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -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.pushButtonProtoSsOpenvpnContDefaultChecked
|
checked: ServerContainersLogic.pushButtonSsOpenvpnContDefaultChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoSsOpenvpnContDefaultChecked = checked
|
ServerContainersLogic.pushButtonSsOpenvpnContDefaultChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContDefaultClicked(checked)
|
ServerContainersLogic.onPushButtonProtoSsOpenvpnContDefaultClicked(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: ServerContainersLogic.pushButtonProtoSsOpenvpnContDefaultVisible
|
visible: ServerContainersLogic.pushButtonSsOpenvpnContDefaultVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -235,7 +235,7 @@ Item {
|
||||||
icon.source: "qrc:/images/share.png"
|
icon.source: "qrc:/images/share.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
visible: ServerContainersLogic.pushButtonProtoSsOpenvpnContShareVisible
|
visible: ServerContainersLogic.pushButtonSsOpenvpnContShareVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContShareClicked(false)
|
ServerContainersLogic.onPushButtonProtoSsOpenvpnContShareClicked(false)
|
||||||
}
|
}
|
||||||
|
|
@ -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.pushButtonProtoSsOpenvpnContInstallChecked
|
checked: ServerContainersLogic.pushButtonSsOpenvpnContInstallChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoSsOpenvpnContInstallChecked = checked
|
ServerContainersLogic.pushButtonSsOpenvpnContInstallChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoSsOpenvpnContInstallClicked(checked)
|
ServerContainersLogic.onPushButtonProtoSsOpenvpnContInstallClicked(checked)
|
||||||
}
|
}
|
||||||
enabled: ServerContainersLogic.pushButtonProtoSsOpenvpnContInstallEnabled
|
enabled: ServerContainersLogic.pushButtonSsOpenvpnContInstallEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -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.pushButtonProtoOpenvpnContDefaultChecked
|
checked: ServerContainersLogic.pushButtonOpenvpnContDefaultChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoOpenvpnContDefaultChecked = checked
|
ServerContainersLogic.pushButtonOpenvpnContDefaultChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoOpenvpnContDefaultClicked(checked)
|
ServerContainersLogic.onPushButtonProtoOpenvpnContDefaultClicked(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: ServerContainersLogic.pushButtonProtoOpenvpnContDefaultVisible
|
visible: ServerContainersLogic.pushButtonOpenvpnContDefaultVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -336,7 +336,7 @@ Item {
|
||||||
icon.source: "qrc:/images/share.png"
|
icon.source: "qrc:/images/share.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
visible: ServerContainersLogic.pushButtonProtoOpenvpnContShareVisible
|
visible: ServerContainersLogic.pushButtonOpenvpnContShareVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoOpenvpnContShareClicked(false)
|
ServerContainersLogic.onPushButtonProtoOpenvpnContShareClicked(false)
|
||||||
}
|
}
|
||||||
|
|
@ -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.pushButtonProtoOpenvpnContInstallChecked
|
checked: ServerContainersLogic.pushButtonOpenvpnContInstallChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoOpenvpnContInstallChecked = checked
|
ServerContainersLogic.pushButtonOpenvpnContInstallChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoOpenvpnContInstallClicked(checked)
|
ServerContainersLogic.onPushButtonProtoOpenvpnContInstallClicked(checked)
|
||||||
}
|
}
|
||||||
enabled: ServerContainersLogic.pushButtonProtoOpenvpnContInstallEnabled
|
enabled: ServerContainersLogic.pushButtonOpenvpnContInstallEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
@ -408,15 +408,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.pushButtonProtoWireguardContDefaultChecked
|
checked: ServerContainersLogic.pushButtonWireguardContDefaultChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoWireguardContDefaultChecked = checked
|
ServerContainersLogic.pushButtonWireguardContDefaultChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoWireguardContDefaultClicked(checked)
|
ServerContainersLogic.onPushButtonProtoWireguardContDefaultClicked(checked)
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: ServerContainersLogic.pushButtonProtoWireguardContDefaultVisible
|
visible: ServerContainersLogic.pushButtonWireguardContDefaultVisible
|
||||||
}
|
}
|
||||||
|
|
||||||
ImageButtonType {
|
ImageButtonType {
|
||||||
|
|
@ -426,7 +426,7 @@ Item {
|
||||||
icon.source: "qrc:/images/share.png"
|
icon.source: "qrc:/images/share.png"
|
||||||
width: 24
|
width: 24
|
||||||
height: 24
|
height: 24
|
||||||
visible: ServerContainersLogic.pushButtonProtoWireguardContShareVisible
|
visible: ServerContainersLogic.pushButtonWireguardContShareVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoWireguardContShareClicked(false)
|
ServerContainersLogic.onPushButtonProtoWireguardContShareClicked(false)
|
||||||
}
|
}
|
||||||
|
|
@ -439,14 +439,14 @@ Item {
|
||||||
: "qrc:/images/connect_button_disconnected.png"
|
: "qrc:/images/connect_button_disconnected.png"
|
||||||
width: 36
|
width: 36
|
||||||
height: 24
|
height: 24
|
||||||
checked: ServerContainersLogic.pushButtonProtoWireguardContInstallChecked
|
checked: ServerContainersLogic.pushButtonWireguardContInstallChecked
|
||||||
onCheckedChanged: {
|
onCheckedChanged: {
|
||||||
ServerContainersLogic.pushButtonProtoWireguardContInstallChecked = checked
|
ServerContainersLogic.pushButtonWireguardContInstallChecked = checked
|
||||||
}
|
}
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ServerContainersLogic.onPushButtonProtoWireguardContInstallClicked(checked)
|
ServerContainersLogic.onPushButtonProtoWireguardContInstallClicked(checked)
|
||||||
}
|
}
|
||||||
enabled: ServerContainersLogic.pushButtonProtoWireguardContInstallEnabled
|
enabled: ServerContainersLogic.pushButtonWireguardContInstallEnabled
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
||||||
|
|
@ -148,7 +148,7 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Save and restart VPN")
|
text: qsTr("Save and restart VPN")
|
||||||
visible: CloakLogic.pushButtonProtoCloakSaveVisible
|
visible: CloakLogic.pushButtonCloakSaveVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
CloakLogic.onPushButtonProtoCloakSaveClicked()
|
CloakLogic.onPushButtonProtoCloakSaveClicked()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -268,7 +268,7 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Save and restart VPN")
|
text: qsTr("Save and restart VPN")
|
||||||
visible: OpenVpnLogic.pushButtonProtoOpenvpnSaveVisible
|
visible: OpenVpnLogic.pushButtonOpenvpnSaveVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
OpenVpnLogic.onPushButtonProtoOpenvpnSaveClicked()
|
OpenVpnLogic.onPushButtonProtoOpenvpnSaveClicked()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,7 +128,7 @@ Item {
|
||||||
width: 321
|
width: 321
|
||||||
height: 40
|
height: 40
|
||||||
text: qsTr("Save and restart VPN")
|
text: qsTr("Save and restart VPN")
|
||||||
visible: ShadowSocksLogic.pushButtonProtoShadowsocksSaveVisible
|
visible: ShadowSocksLogic.pushButtonShadowsocksSaveVisible
|
||||||
onClicked: {
|
onClicked: {
|
||||||
ShadowSocksLogic.onPushButtonProtoShadowsocksSaveClicked()
|
ShadowSocksLogic.onPushButtonProtoShadowsocksSaveClicked()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,7 @@ Window {
|
||||||
UiLogic.progressBarValue = 0;
|
UiLogic.progressBarValue = 0;
|
||||||
}
|
}
|
||||||
if (page === PageEnum.GeneralSettings) {
|
if (page === PageEnum.GeneralSettings) {
|
||||||
GeneralSettingsLogic.updateGeneralSettingPage();
|
GeneralSettingsLogic.updatePage();
|
||||||
}
|
}
|
||||||
if (page === PageEnum.ServersList) {
|
if (page === PageEnum.ServersList) {
|
||||||
ServerListLogic.updateServersListPage();
|
ServerListLogic.updateServersListPage();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue