AUTO_PROPERTY added
This commit is contained in:
parent
539bf2ee24
commit
63ffa4a212
19 changed files with 216 additions and 778 deletions
|
@ -51,6 +51,7 @@ HEADERS += \
|
|||
ui/pages_logic/protocols/CloakLogic.h \
|
||||
ui/pages_logic/protocols/OpenVpnLogic.h \
|
||||
ui/pages_logic/protocols/ShadowSocksLogic.h \
|
||||
ui/property_helper.h \
|
||||
ui/serversmodel.h \
|
||||
ui/uilogic.h \
|
||||
ui/qautostart.h \
|
||||
|
|
|
@ -9,97 +9,45 @@ using namespace PageEnumNS;
|
|||
|
||||
AppSettingsLogic::AppSettingsLogic(UiLogic *logic, QObject *parent):
|
||||
PageLogicBase(logic, parent),
|
||||
m_checkBoxAppSettingsAutostartChecked{false},
|
||||
m_checkBoxAppSettingsAutoconnectChecked{false},
|
||||
m_checkBoxAppSettingsStartMinimizedChecked{false}
|
||||
m_checkBoxAutostartChecked{false},
|
||||
m_checkBoxAutoConnectChecked{false},
|
||||
m_checkBoxStartMinimizedChecked{false}
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void AppSettingsLogic::updateAppSettingsPage()
|
||||
void AppSettingsLogic::updatePage()
|
||||
{
|
||||
setCheckBoxAppSettingsAutostartChecked(Autostart::isAutostart());
|
||||
setCheckBoxAppSettingsAutoconnectChecked(m_settings.isAutoConnect());
|
||||
setCheckBoxAppSettingsStartMinimizedChecked(m_settings.isStartMinimized());
|
||||
set_checkBoxAutostartChecked(Autostart::isAutostart());
|
||||
set_checkBoxAutoConnectChecked(m_settings.isAutoConnect());
|
||||
set_checkBoxStartMinimizedChecked(m_settings.isStartMinimized());
|
||||
|
||||
QString ver = QString("%1: %2 (%3)")
|
||||
.arg(tr("Software version"))
|
||||
.arg(QString(APP_MAJOR_VERSION))
|
||||
.arg(__DATE__);
|
||||
setLabelAppSettingsVersionText(ver);
|
||||
set_labelVersionText(ver);
|
||||
}
|
||||
|
||||
bool AppSettingsLogic::getCheckBoxAppSettingsAutostartChecked() const
|
||||
{
|
||||
return m_checkBoxAppSettingsAutostartChecked;
|
||||
}
|
||||
|
||||
void AppSettingsLogic::setCheckBoxAppSettingsAutostartChecked(bool checkBoxAppSettingsAutostartChecked)
|
||||
{
|
||||
if (m_checkBoxAppSettingsAutostartChecked != checkBoxAppSettingsAutostartChecked) {
|
||||
m_checkBoxAppSettingsAutostartChecked = checkBoxAppSettingsAutostartChecked;
|
||||
emit checkBoxAppSettingsAutostartCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool AppSettingsLogic::getCheckBoxAppSettingsAutoconnectChecked() const
|
||||
{
|
||||
return m_checkBoxAppSettingsAutoconnectChecked;
|
||||
}
|
||||
|
||||
void AppSettingsLogic::setCheckBoxAppSettingsAutoconnectChecked(bool checkBoxAppSettingsAutoconnectChecked)
|
||||
{
|
||||
if (m_checkBoxAppSettingsAutoconnectChecked != checkBoxAppSettingsAutoconnectChecked) {
|
||||
m_checkBoxAppSettingsAutoconnectChecked = checkBoxAppSettingsAutoconnectChecked;
|
||||
emit checkBoxAppSettingsAutoconnectCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool AppSettingsLogic::getCheckBoxAppSettingsStartMinimizedChecked() const
|
||||
{
|
||||
return m_checkBoxAppSettingsStartMinimizedChecked;
|
||||
}
|
||||
|
||||
void AppSettingsLogic::setCheckBoxAppSettingsStartMinimizedChecked(bool checkBoxAppSettingsStartMinimizedChecked)
|
||||
{
|
||||
if (m_checkBoxAppSettingsStartMinimizedChecked != checkBoxAppSettingsStartMinimizedChecked) {
|
||||
m_checkBoxAppSettingsStartMinimizedChecked = checkBoxAppSettingsStartMinimizedChecked;
|
||||
emit checkBoxAppSettingsStartMinimizedCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void AppSettingsLogic::onCheckBoxAppSettingsAutostartToggled(bool checked)
|
||||
void AppSettingsLogic::onCheckBoxAutostartToggled(bool checked)
|
||||
{
|
||||
if (!checked) {
|
||||
setCheckBoxAppSettingsAutoconnectChecked(false);
|
||||
set_checkBoxAutoConnectChecked(false);
|
||||
}
|
||||
Autostart::setAutostart(checked);
|
||||
}
|
||||
|
||||
void AppSettingsLogic::onCheckBoxAppSettingsAutoconnectToggled(bool checked)
|
||||
void AppSettingsLogic::onCheckBoxAutoconnectToggled(bool checked)
|
||||
{
|
||||
m_settings.setAutoConnect(checked);
|
||||
}
|
||||
|
||||
void AppSettingsLogic::onCheckBoxAppSettingsStartMinimizedToggled(bool checked)
|
||||
void AppSettingsLogic::onCheckBoxStartMinimizedToggled(bool checked)
|
||||
{
|
||||
m_settings.setStartMinimized(checked);
|
||||
}
|
||||
|
||||
void AppSettingsLogic::setLabelAppSettingsVersionText(const QString &labelAppSettingsVersionText)
|
||||
{
|
||||
if (m_labelAppSettingsVersionText != labelAppSettingsVersionText) {
|
||||
m_labelAppSettingsVersionText = labelAppSettingsVersionText;
|
||||
emit labelAppSettingsVersionTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString AppSettingsLogic::getLabelAppSettingsVersionText() const
|
||||
{
|
||||
return m_labelAppSettingsVersionText;
|
||||
}
|
||||
|
||||
void AppSettingsLogic::onPushButtonAppSettingsOpenLogsChecked()
|
||||
void AppSettingsLogic::onPushButtonOpenLogsClicked()
|
||||
{
|
||||
Debug::openLogsFolder();
|
||||
}
|
||||
|
|
|
@ -8,57 +8,26 @@ class UiLogic;
|
|||
class AppSettingsLogic : public PageLogicBase
|
||||
{
|
||||
Q_OBJECT
|
||||
AUTO_PROPERTY(bool, checkBoxAutostartChecked)
|
||||
AUTO_PROPERTY(bool, checkBoxAutoConnectChecked)
|
||||
AUTO_PROPERTY(bool, checkBoxStartMinimizedChecked)
|
||||
AUTO_PROPERTY(QString, labelVersionText)
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void updateAppSettingsPage();
|
||||
Q_INVOKABLE void updatePage() override;
|
||||
|
||||
Q_PROPERTY(bool checkBoxAppSettingsAutostartChecked READ getCheckBoxAppSettingsAutostartChecked WRITE setCheckBoxAppSettingsAutostartChecked NOTIFY checkBoxAppSettingsAutostartCheckedChanged)
|
||||
Q_PROPERTY(bool checkBoxAppSettingsAutoconnectChecked READ getCheckBoxAppSettingsAutoconnectChecked WRITE setCheckBoxAppSettingsAutoconnectChecked NOTIFY checkBoxAppSettingsAutoconnectCheckedChanged)
|
||||
Q_PROPERTY(bool checkBoxAppSettingsStartMinimizedChecked READ getCheckBoxAppSettingsStartMinimizedChecked WRITE setCheckBoxAppSettingsStartMinimizedChecked NOTIFY checkBoxAppSettingsStartMinimizedCheckedChanged)
|
||||
|
||||
Q_PROPERTY(QString labelAppSettingsVersionText READ getLabelAppSettingsVersionText WRITE setLabelAppSettingsVersionText NOTIFY labelAppSettingsVersionTextChanged)
|
||||
|
||||
Q_INVOKABLE void onCheckBoxAppSettingsAutostartToggled(bool checked);
|
||||
Q_INVOKABLE void onCheckBoxAppSettingsAutoconnectToggled(bool checked);
|
||||
Q_INVOKABLE void onCheckBoxAppSettingsStartMinimizedToggled(bool checked);
|
||||
|
||||
Q_INVOKABLE void onPushButtonAppSettingsOpenLogsChecked();
|
||||
Q_INVOKABLE void onCheckBoxAutostartToggled(bool checked);
|
||||
Q_INVOKABLE void onCheckBoxAutoconnectToggled(bool checked);
|
||||
Q_INVOKABLE void onCheckBoxStartMinimizedToggled(bool checked);
|
||||
Q_INVOKABLE void onPushButtonOpenLogsClicked();
|
||||
|
||||
public:
|
||||
explicit AppSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~AppSettingsLogic() = default;
|
||||
|
||||
|
||||
bool getCheckBoxAppSettingsAutostartChecked() const;
|
||||
void setCheckBoxAppSettingsAutostartChecked(bool checkBoxAppSettingsAutostartChecked);
|
||||
bool getCheckBoxAppSettingsAutoconnectChecked() const;
|
||||
void setCheckBoxAppSettingsAutoconnectChecked(bool checkBoxAppSettingsAutoconnectChecked);
|
||||
bool getCheckBoxAppSettingsStartMinimizedChecked() const;
|
||||
void setCheckBoxAppSettingsStartMinimizedChecked(bool checkBoxAppSettingsStartMinimizedChecked);
|
||||
|
||||
QString getLabelAppSettingsVersionText() const;
|
||||
void setLabelAppSettingsVersionText(const QString &labelAppSettingsVersionText);
|
||||
|
||||
signals:
|
||||
void checkBoxAppSettingsAutostartCheckedChanged();
|
||||
void checkBoxAppSettingsAutoconnectCheckedChanged();
|
||||
void checkBoxAppSettingsStartMinimizedCheckedChanged();
|
||||
|
||||
void labelAppSettingsVersionTextChanged();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
|
||||
private:
|
||||
bool m_checkBoxAppSettingsAutostartChecked;
|
||||
bool m_checkBoxAppSettingsAutoconnectChecked;
|
||||
bool m_checkBoxAppSettingsStartMinimizedChecked;
|
||||
|
||||
QString m_labelAppSettingsVersionText;
|
||||
|
||||
};
|
||||
#endif // APP_SETTINGS_LOGIC_H
|
||||
|
|
|
@ -11,20 +11,7 @@ GeneralSettingsLogic::GeneralSettingsLogic(UiLogic *logic, QObject *parent):
|
|||
|
||||
void GeneralSettingsLogic::updateGeneralSettingPage()
|
||||
{
|
||||
setPushButtonGeneralSettingsShareConnectionEnable(m_settings.haveAuthData(m_settings.defaultServerIndex()));
|
||||
}
|
||||
|
||||
bool GeneralSettingsLogic::getPushButtonGeneralSettingsShareConnectionEnable() const
|
||||
{
|
||||
return m_pushButtonGeneralSettingsShareConnectionEnable;
|
||||
}
|
||||
|
||||
void GeneralSettingsLogic::setPushButtonGeneralSettingsShareConnectionEnable(bool pushButtonGeneralSettingsShareConnectionEnable)
|
||||
{
|
||||
if (m_pushButtonGeneralSettingsShareConnectionEnable != pushButtonGeneralSettingsShareConnectionEnable) {
|
||||
m_pushButtonGeneralSettingsShareConnectionEnable = pushButtonGeneralSettingsShareConnectionEnable;
|
||||
emit pushButtonGeneralSettingsShareConnectionEnableChanged();
|
||||
}
|
||||
set_pushButtonGeneralSettingsShareConnectionEnable(m_settings.haveAuthData(m_settings.defaultServerIndex()));
|
||||
}
|
||||
|
||||
void GeneralSettingsLogic::onPushButtonGeneralSettingsServerSettingsClicked()
|
||||
|
|
|
@ -9,11 +9,10 @@ class GeneralSettingsLogic : public PageLogicBase
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
AUTO_PROPERTY(bool, pushButtonGeneralSettingsShareConnectionEnable)
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void updateGeneralSettingPage();
|
||||
|
||||
Q_PROPERTY(bool pushButtonGeneralSettingsShareConnectionEnable READ getPushButtonGeneralSettingsShareConnectionEnable WRITE setPushButtonGeneralSettingsShareConnectionEnable NOTIFY pushButtonGeneralSettingsShareConnectionEnableChanged)
|
||||
|
||||
Q_INVOKABLE void onPushButtonGeneralSettingsServerSettingsClicked();
|
||||
Q_INVOKABLE void onPushButtonGeneralSettingsShareConnectionClicked();
|
||||
|
||||
|
@ -21,23 +20,5 @@ public:
|
|||
explicit GeneralSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~GeneralSettingsLogic() = default;
|
||||
|
||||
|
||||
|
||||
bool getPushButtonGeneralSettingsShareConnectionEnable() const;
|
||||
void setPushButtonGeneralSettingsShareConnectionEnable(bool pushButtonGeneralSettingsShareConnectionEnable);
|
||||
|
||||
signals:
|
||||
void pushButtonGeneralSettingsShareConnectionEnableChanged();
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
private:
|
||||
bool m_pushButtonGeneralSettingsShareConnectionEnable;
|
||||
|
||||
};
|
||||
#endif // GENERAL_SETTINGS_LOGIC_H
|
||||
|
|
|
@ -10,39 +10,13 @@ NetworkSettingsLogic::NetworkSettingsLogic(UiLogic *logic, QObject *parent):
|
|||
|
||||
}
|
||||
|
||||
void NetworkSettingsLogic::updateNetworkSettingsPage()
|
||||
void NetworkSettingsLogic::updatePage()
|
||||
{
|
||||
setLineEditNetworkSettingsDns1Text(m_settings.primaryDns());
|
||||
setLineEditNetworkSettingsDns2Text(m_settings.secondaryDns());
|
||||
set_lineEditDns1Text(m_settings.primaryDns());
|
||||
set_lineEditDns2Text(m_settings.secondaryDns());
|
||||
}
|
||||
|
||||
QString NetworkSettingsLogic::getLineEditNetworkSettingsDns1Text() const
|
||||
{
|
||||
return m_lineEditNetworkSettingsDns1Text;
|
||||
}
|
||||
|
||||
void NetworkSettingsLogic::setLineEditNetworkSettingsDns1Text(const QString &lineEditNetworkSettingsDns1Text)
|
||||
{
|
||||
if (m_lineEditNetworkSettingsDns1Text != lineEditNetworkSettingsDns1Text) {
|
||||
m_lineEditNetworkSettingsDns1Text = lineEditNetworkSettingsDns1Text;
|
||||
emit lineEditNetworkSettingsDns1TextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NetworkSettingsLogic::getLineEditNetworkSettingsDns2Text() const
|
||||
{
|
||||
return m_lineEditNetworkSettingsDns2Text;
|
||||
}
|
||||
|
||||
void NetworkSettingsLogic::setLineEditNetworkSettingsDns2Text(const QString &lineEditNetworkSettingsDns2Text)
|
||||
{
|
||||
if (m_lineEditNetworkSettingsDns2Text != lineEditNetworkSettingsDns2Text) {
|
||||
m_lineEditNetworkSettingsDns2Text = lineEditNetworkSettingsDns2Text;
|
||||
emit lineEditNetworkSettingsDns2TextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void NetworkSettingsLogic::onLineEditNetworkSettingsDns1EditFinished(const QString &text)
|
||||
void NetworkSettingsLogic::onLineEditDns1EditFinished(const QString &text)
|
||||
{
|
||||
QRegExp reg{getIpAddressValidatorRegex()};
|
||||
if (reg.exactMatch(text)) {
|
||||
|
@ -50,7 +24,7 @@ void NetworkSettingsLogic::onLineEditNetworkSettingsDns1EditFinished(const QStri
|
|||
}
|
||||
}
|
||||
|
||||
void NetworkSettingsLogic::onLineEditNetworkSettingsDns2EditFinished(const QString &text)
|
||||
void NetworkSettingsLogic::onLineEditDns2EditFinished(const QString &text)
|
||||
{
|
||||
QRegExp reg{getIpAddressValidatorRegex()};
|
||||
if (reg.exactMatch(text)) {
|
||||
|
@ -58,16 +32,16 @@ void NetworkSettingsLogic::onLineEditNetworkSettingsDns2EditFinished(const QStri
|
|||
}
|
||||
}
|
||||
|
||||
void NetworkSettingsLogic::onPushButtonNetworkSettingsResetdns1Clicked()
|
||||
void NetworkSettingsLogic::onPushButtonResetDns1Clicked()
|
||||
{
|
||||
m_settings.setPrimaryDns(m_settings.cloudFlareNs1);
|
||||
updateNetworkSettingsPage();
|
||||
updatePage();
|
||||
}
|
||||
|
||||
void NetworkSettingsLogic::onPushButtonNetworkSettingsResetdns2Clicked()
|
||||
void NetworkSettingsLogic::onPushButtonResetDns2Clicked()
|
||||
{
|
||||
m_settings.setSecondaryDns(m_settings.cloudFlareNs2);
|
||||
updateNetworkSettingsPage();
|
||||
updatePage();
|
||||
}
|
||||
|
||||
QString NetworkSettingsLogic::getIpAddressValidatorRegex() const
|
||||
|
|
|
@ -9,48 +9,22 @@ class NetworkSettingsLogic : public PageLogicBase
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
AUTO_PROPERTY(QString, lineEditDns1Text)
|
||||
AUTO_PROPERTY(QString, lineEditDns2Text)
|
||||
READONLY_PROPERTY(QString, ipAddressValidatorRegex)
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void updateNetworkSettingsPage();
|
||||
Q_INVOKABLE void updatePage() override;
|
||||
|
||||
Q_PROPERTY(QString lineEditNetworkSettingsDns1Text READ getLineEditNetworkSettingsDns1Text WRITE setLineEditNetworkSettingsDns1Text NOTIFY lineEditNetworkSettingsDns1TextChanged)
|
||||
Q_PROPERTY(QString lineEditNetworkSettingsDns2Text READ getLineEditNetworkSettingsDns2Text WRITE setLineEditNetworkSettingsDns2Text NOTIFY lineEditNetworkSettingsDns2TextChanged)
|
||||
|
||||
Q_PROPERTY(QString ipAddressValidatorRegex READ getIpAddressValidatorRegex CONSTANT)
|
||||
|
||||
Q_INVOKABLE void onLineEditNetworkSettingsDns1EditFinished(const QString& text);
|
||||
Q_INVOKABLE void onLineEditNetworkSettingsDns2EditFinished(const QString& text);
|
||||
Q_INVOKABLE void onPushButtonNetworkSettingsResetdns1Clicked();
|
||||
Q_INVOKABLE void onPushButtonNetworkSettingsResetdns2Clicked();
|
||||
Q_INVOKABLE void onLineEditDns1EditFinished(const QString& text);
|
||||
Q_INVOKABLE void onLineEditDns2EditFinished(const QString& text);
|
||||
Q_INVOKABLE void onPushButtonResetDns1Clicked();
|
||||
Q_INVOKABLE void onPushButtonResetDns2Clicked();
|
||||
|
||||
public:
|
||||
explicit NetworkSettingsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~NetworkSettingsLogic() = default;
|
||||
|
||||
|
||||
|
||||
QString getLineEditNetworkSettingsDns1Text() const;
|
||||
void setLineEditNetworkSettingsDns1Text(const QString &lineEditNetworkSettingsDns1Text);
|
||||
QString getLineEditNetworkSettingsDns2Text() const;
|
||||
void setLineEditNetworkSettingsDns2Text(const QString &lineEditNetworkSettingsDns2Text);
|
||||
|
||||
QString getIpAddressValidatorRegex() const;
|
||||
|
||||
signals:
|
||||
void lineEditNetworkSettingsDns1TextChanged();
|
||||
void lineEditNetworkSettingsDns2TextChanged();
|
||||
|
||||
|
||||
|
||||
private:
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
private:
|
||||
QString m_lineEditNetworkSettingsDns1Text;
|
||||
QString m_lineEditNetworkSettingsDns2Text;
|
||||
|
||||
QString m_ipAddressValidatorRegex;
|
||||
};
|
||||
#endif // NETWORK_SETTINGS_LOGIC_H
|
||||
|
|
|
@ -2,119 +2,15 @@
|
|||
|
||||
NewServerConfiguringLogic::NewServerConfiguringLogic(UiLogic *logic, QObject *parent):
|
||||
PageLogicBase(logic, parent),
|
||||
m_progressBarNewServerConfiguringValue{0},
|
||||
m_pageNewServerConfiguringEnabled{true},
|
||||
m_labelNewServerConfiguringWaitInfoVisible{true},
|
||||
m_labelNewServerConfiguringWaitInfoText{tr("Please wait, configuring process may take up to 5 minutes")},
|
||||
m_progressBarNewServerConfiguringVisible{true},
|
||||
m_progressBarNewServerConfiguringMaximium{100},
|
||||
m_progressBarNewServerConfiguringTextVisible{true},
|
||||
m_progressBarNewServerConfiguringText{tr("Configuring...")}
|
||||
|
||||
m_progressBarValue{0},
|
||||
m_pageEnabled{true},
|
||||
m_labelWaitInfoVisible{true},
|
||||
m_labelWaitInfoText{tr("Please wait, configuring process may take up to 5 minutes")},
|
||||
m_progressBarVisible{true},
|
||||
m_progressBarMaximium{100},
|
||||
m_progressBarTextVisible{true},
|
||||
m_progressBarText{tr("Configuring...")}
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
double NewServerConfiguringLogic::getProgressBarNewServerConfiguringValue() const
|
||||
{
|
||||
return m_progressBarNewServerConfiguringValue;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setProgressBarNewServerConfiguringValue(double progressBarNewServerConfiguringValue)
|
||||
{
|
||||
if (m_progressBarNewServerConfiguringValue != progressBarNewServerConfiguringValue) {
|
||||
m_progressBarNewServerConfiguringValue = progressBarNewServerConfiguringValue;
|
||||
emit progressBarNewServerConfiguringValueChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerConfiguringLogic::getPageNewServerConfiguringEnabled() const
|
||||
{
|
||||
return m_pageNewServerConfiguringEnabled;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setPageNewServerConfiguringEnabled(bool pageNewServerConfiguringEnabled)
|
||||
{
|
||||
if (m_pageNewServerConfiguringEnabled != pageNewServerConfiguringEnabled) {
|
||||
m_pageNewServerConfiguringEnabled = pageNewServerConfiguringEnabled;
|
||||
emit pageNewServerConfiguringEnabledChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerConfiguringLogic::getLabelNewServerConfiguringWaitInfoVisible() const
|
||||
{
|
||||
return m_labelNewServerConfiguringWaitInfoVisible;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setLabelNewServerConfiguringWaitInfoVisible(bool labelNewServerConfiguringWaitInfoVisible)
|
||||
{
|
||||
if (m_labelNewServerConfiguringWaitInfoVisible != labelNewServerConfiguringWaitInfoVisible) {
|
||||
m_labelNewServerConfiguringWaitInfoVisible = labelNewServerConfiguringWaitInfoVisible;
|
||||
emit labelNewServerConfiguringWaitInfoVisibleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NewServerConfiguringLogic::getLabelNewServerConfiguringWaitInfoText() const
|
||||
{
|
||||
return m_labelNewServerConfiguringWaitInfoText;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setLabelNewServerConfiguringWaitInfoText(const QString &labelNewServerConfiguringWaitInfoText)
|
||||
{
|
||||
if (m_labelNewServerConfiguringWaitInfoText != labelNewServerConfiguringWaitInfoText) {
|
||||
m_labelNewServerConfiguringWaitInfoText = labelNewServerConfiguringWaitInfoText;
|
||||
emit labelNewServerConfiguringWaitInfoTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerConfiguringLogic::getProgressBarNewServerConfiguringVisible() const
|
||||
{
|
||||
return m_progressBarNewServerConfiguringVisible;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setProgressBarNewServerConfiguringVisible(bool progressBarNewServerConfiguringVisible)
|
||||
{
|
||||
if (m_progressBarNewServerConfiguringVisible != progressBarNewServerConfiguringVisible) {
|
||||
m_progressBarNewServerConfiguringVisible = progressBarNewServerConfiguringVisible;
|
||||
emit progressBarNewServerConfiguringVisibleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
int NewServerConfiguringLogic::getProgressBarNewServerConfiguringMaximium() const
|
||||
{
|
||||
return m_progressBarNewServerConfiguringMaximium;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setProgressBarNewServerConfiguringMaximium(int progressBarNewServerConfiguringMaximium)
|
||||
{
|
||||
if (m_progressBarNewServerConfiguringMaximium != progressBarNewServerConfiguringMaximium) {
|
||||
m_progressBarNewServerConfiguringMaximium = progressBarNewServerConfiguringMaximium;
|
||||
emit progressBarNewServerConfiguringMaximiumChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerConfiguringLogic::getProgressBarNewServerConfiguringTextVisible() const
|
||||
{
|
||||
return m_progressBarNewServerConfiguringTextVisible;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setProgressBarNewServerConfiguringTextVisible(bool progressBarNewServerConfiguringTextVisible)
|
||||
{
|
||||
if (m_progressBarNewServerConfiguringTextVisible != progressBarNewServerConfiguringTextVisible) {
|
||||
m_progressBarNewServerConfiguringTextVisible = progressBarNewServerConfiguringTextVisible;
|
||||
emit progressBarNewServerConfiguringTextVisibleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NewServerConfiguringLogic::getProgressBarNewServerConfiguringText() const
|
||||
{
|
||||
return m_progressBarNewServerConfiguringText;
|
||||
}
|
||||
|
||||
void NewServerConfiguringLogic::setProgressBarNewServerConfiguringText(const QString &progressBarNewServerConfiguringText)
|
||||
{
|
||||
if (m_progressBarNewServerConfiguringText != progressBarNewServerConfiguringText) {
|
||||
m_progressBarNewServerConfiguringText = progressBarNewServerConfiguringText;
|
||||
emit progressBarNewServerConfiguringTextChanged();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,63 +9,18 @@ class NewServerConfiguringLogic : public PageLogicBase
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_PROPERTY(double progressBarNewServerConfiguringValue READ getProgressBarNewServerConfiguringValue WRITE setProgressBarNewServerConfiguringValue NOTIFY progressBarNewServerConfiguringValueChanged)
|
||||
Q_PROPERTY(bool pageNewServerConfiguringEnabled READ getPageNewServerConfiguringEnabled WRITE setPageNewServerConfiguringEnabled NOTIFY pageNewServerConfiguringEnabledChanged)
|
||||
Q_PROPERTY(bool labelNewServerConfiguringWaitInfoVisible READ getLabelNewServerConfiguringWaitInfoVisible WRITE setLabelNewServerConfiguringWaitInfoVisible NOTIFY labelNewServerConfiguringWaitInfoVisibleChanged)
|
||||
Q_PROPERTY(QString labelNewServerConfiguringWaitInfoText READ getLabelNewServerConfiguringWaitInfoText WRITE setLabelNewServerConfiguringWaitInfoText NOTIFY labelNewServerConfiguringWaitInfoTextChanged)
|
||||
Q_PROPERTY(bool progressBarNewServerConfiguringVisible READ getProgressBarNewServerConfiguringVisible WRITE setProgressBarNewServerConfiguringVisible NOTIFY progressBarNewServerConfiguringVisibleChanged)
|
||||
Q_PROPERTY(int progressBarNewServerConfiguringMaximium READ getProgressBarNewServerConfiguringMaximium WRITE setProgressBarNewServerConfiguringMaximium NOTIFY progressBarNewServerConfiguringMaximiumChanged)
|
||||
Q_PROPERTY(bool progressBarNewServerConfiguringTextVisible READ getProgressBarNewServerConfiguringTextVisible WRITE setProgressBarNewServerConfiguringTextVisible NOTIFY progressBarNewServerConfiguringTextVisibleChanged)
|
||||
Q_PROPERTY(QString progressBarNewServerConfiguringText READ getProgressBarNewServerConfiguringText WRITE setProgressBarNewServerConfiguringText NOTIFY progressBarNewServerConfiguringTextChanged)
|
||||
AUTO_PROPERTY(double, progressBarValue)
|
||||
AUTO_PROPERTY(bool, pageEnabled)
|
||||
AUTO_PROPERTY(bool, labelWaitInfoVisible)
|
||||
AUTO_PROPERTY(QString, labelWaitInfoText)
|
||||
AUTO_PROPERTY(bool, progressBarVisible)
|
||||
AUTO_PROPERTY(int, progressBarMaximium)
|
||||
AUTO_PROPERTY(bool, progressBarTextVisible)
|
||||
AUTO_PROPERTY(QString, progressBarText)
|
||||
|
||||
public:
|
||||
explicit NewServerConfiguringLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~NewServerConfiguringLogic() = default;
|
||||
|
||||
double getProgressBarNewServerConfiguringValue() const;
|
||||
void setProgressBarNewServerConfiguringValue(double progressBarNewServerConfiguringValue);
|
||||
|
||||
bool getPageNewServerConfiguringEnabled() const;
|
||||
void setPageNewServerConfiguringEnabled(bool pageNewServerConfiguringEnabled);
|
||||
bool getLabelNewServerConfiguringWaitInfoVisible() const;
|
||||
void setLabelNewServerConfiguringWaitInfoVisible(bool labelNewServerConfiguringWaitInfoVisible);
|
||||
QString getLabelNewServerConfiguringWaitInfoText() const;
|
||||
void setLabelNewServerConfiguringWaitInfoText(const QString &labelNewServerConfiguringWaitInfoText);
|
||||
bool getProgressBarNewServerConfiguringVisible() const;
|
||||
void setProgressBarNewServerConfiguringVisible(bool progressBarNewServerConfiguringVisible);
|
||||
int getProgressBarNewServerConfiguringMaximium() const;
|
||||
void setProgressBarNewServerConfiguringMaximium(int progressBarNewServerConfiguringMaximium);
|
||||
bool getProgressBarNewServerConfiguringTextVisible() const;
|
||||
void setProgressBarNewServerConfiguringTextVisible(bool progressBarNewServerConfiguringTextVisible);
|
||||
QString getProgressBarNewServerConfiguringText() const;
|
||||
void setProgressBarNewServerConfiguringText(const QString &progressBarNewServerConfiguringText);
|
||||
|
||||
signals:
|
||||
void progressBarNewServerConfiguringValueChanged();
|
||||
void pageNewServerConfiguringEnabledChanged();
|
||||
void labelNewServerConfiguringWaitInfoVisibleChanged();
|
||||
void labelNewServerConfiguringWaitInfoTextChanged();
|
||||
void progressBarNewServerConfiguringVisibleChanged();
|
||||
void progressBarNewServerConfiguringMaximiumChanged();
|
||||
void progressBarNewServerConfiguringTextVisibleChanged();
|
||||
void progressBarNewServerConfiguringTextChanged();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
private:
|
||||
double m_progressBarNewServerConfiguringValue;
|
||||
bool m_pageNewServerConfiguringEnabled;
|
||||
bool m_labelNewServerConfiguringWaitInfoVisible;
|
||||
QString m_labelNewServerConfiguringWaitInfoText;
|
||||
bool m_progressBarNewServerConfiguringVisible;
|
||||
int m_progressBarNewServerConfiguringMaximium;
|
||||
bool m_progressBarNewServerConfiguringTextVisible;
|
||||
QString m_progressBarNewServerConfiguringText;
|
||||
|
||||
};
|
||||
#endif // NEW_SERVER_CONFIGURING_LOGIC_H
|
||||
|
|
|
@ -3,243 +3,45 @@
|
|||
|
||||
NewServerProtocolsLogic::NewServerProtocolsLogic(UiLogic *logic, QObject *parent):
|
||||
PageLogicBase(logic, parent),
|
||||
m_pushButtonNewServerSettingsCloakChecked{false},
|
||||
m_pushButtonNewServerSettingsSsChecked{false},
|
||||
m_pushButtonNewServerSettingsOpenvpnChecked{false},
|
||||
m_lineEditNewServerCloakPortText{},
|
||||
m_lineEditNewServerCloakSiteText{},
|
||||
m_lineEditNewServerSsPortText{},
|
||||
m_comboBoxNewServerSsCipherText{"chacha20-ietf-poly1305"},
|
||||
m_lineEditNewServerOpenvpnPortText{},
|
||||
m_comboBoxNewServerOpenvpnProtoText{"udp"},
|
||||
m_frameNewServerSettingsParentWireguardVisible{false},
|
||||
m_checkBoxNewServerCloakChecked{true},
|
||||
m_checkBoxNewServerSsChecked{false},
|
||||
m_checkBoxNewServerOpenvpnChecked{false},
|
||||
m_progressBarNewServerConnectionMinimum{0},
|
||||
m_progressBarNewServerConnectionMaximum{100}
|
||||
m_pushButtonSettingsCloakChecked{false},
|
||||
m_pushButtonSettingsSsChecked{false},
|
||||
m_pushButtonSettingsOpenvpnChecked{false},
|
||||
m_lineEditCloakPortText{},
|
||||
m_lineEditCloakSiteText{},
|
||||
m_lineEditSsPortText{},
|
||||
m_comboBoxSsCipherText{"chacha20-ietf-poly1305"},
|
||||
m_lineEditOpenvpnPortText{},
|
||||
m_comboBoxOpenvpnProtoText{"udp"},
|
||||
m_frameSettingsParentWireguardVisible{false},
|
||||
m_checkBoxCloakChecked{true},
|
||||
m_checkBoxSsChecked{false},
|
||||
m_checkBoxOpenvpnChecked{false},
|
||||
m_progressBarConnectionMinimum{0},
|
||||
m_progressBarConnectionMaximum{100}
|
||||
{
|
||||
setFrameNewServerSettingsParentWireguardVisible(false);
|
||||
set_frameSettingsParentWireguardVisible(false);
|
||||
|
||||
connect(this, &NewServerProtocolsLogic::pushButtonNewServerConnectConfigureClicked, this, [this](){
|
||||
connect(this, &NewServerProtocolsLogic::pushButtonConnectConfigureClicked, this, [this](){
|
||||
uiLogic()->installServer(getInstallConfigsFromProtocolsPage());
|
||||
});
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getFrameNewServerSettingsParentWireguardVisible() const
|
||||
|
||||
void NewServerProtocolsLogic::updatePage()
|
||||
{
|
||||
return m_frameNewServerSettingsParentWireguardVisible;
|
||||
}
|
||||
set_progressBarConnectionMinimum(0);
|
||||
set_progressBarConnectionMaximum(300);
|
||||
|
||||
void NewServerProtocolsLogic::setFrameNewServerSettingsParentWireguardVisible(bool frameNewServerSettingsParentWireguardVisible)
|
||||
{
|
||||
if (m_frameNewServerSettingsParentWireguardVisible != frameNewServerSettingsParentWireguardVisible) {
|
||||
m_frameNewServerSettingsParentWireguardVisible = frameNewServerSettingsParentWireguardVisible;
|
||||
emit frameNewServerSettingsParentWireguardVisibleChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void NewServerProtocolsLogic::updateNewServerProtocolsPage()
|
||||
{
|
||||
setProgressBarNewServerConnectionMinimum(0);
|
||||
setProgressBarNewServerConnectionMaximum(300);
|
||||
|
||||
setPushButtonNewServerSettingsCloakChecked(true);
|
||||
setPushButtonNewServerSettingsCloakChecked(false);
|
||||
setPushButtonNewServerSettingsSsChecked(true);
|
||||
setPushButtonNewServerSettingsSsChecked(false);
|
||||
setLineEditNewServerCloakPortText(amnezia::protocols::cloak::defaultPort);
|
||||
setLineEditNewServerCloakSiteText(amnezia::protocols::cloak::defaultRedirSite);
|
||||
setLineEditNewServerSsPortText(amnezia::protocols::shadowsocks::defaultPort);
|
||||
setComboBoxNewServerSsCipherText(amnezia::protocols::shadowsocks::defaultCipher);
|
||||
setLineEditNewServerOpenvpnPortText(amnezia::protocols::openvpn::defaultPort);
|
||||
setComboBoxNewServerOpenvpnProtoText(amnezia::protocols::openvpn::defaultTransportProto);
|
||||
}
|
||||
|
||||
|
||||
|
||||
QString NewServerProtocolsLogic::getComboBoxNewServerOpenvpnProtoText() const
|
||||
{
|
||||
return m_comboBoxNewServerOpenvpnProtoText;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setComboBoxNewServerOpenvpnProtoText(const QString &comboBoxNewServerOpenvpnProtoText)
|
||||
{
|
||||
if (m_comboBoxNewServerOpenvpnProtoText != comboBoxNewServerOpenvpnProtoText) {
|
||||
m_comboBoxNewServerOpenvpnProtoText = comboBoxNewServerOpenvpnProtoText;
|
||||
emit comboBoxNewServerOpenvpnProtoTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NewServerProtocolsLogic::getLineEditNewServerCloakSiteText() const
|
||||
{
|
||||
return m_lineEditNewServerCloakSiteText;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setLineEditNewServerCloakSiteText(const QString &lineEditNewServerCloakSiteText)
|
||||
{
|
||||
if (m_lineEditNewServerCloakSiteText != lineEditNewServerCloakSiteText) {
|
||||
m_lineEditNewServerCloakSiteText = lineEditNewServerCloakSiteText;
|
||||
emit lineEditNewServerCloakSiteTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NewServerProtocolsLogic::getLineEditNewServerSsPortText() const
|
||||
{
|
||||
return m_lineEditNewServerSsPortText;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setLineEditNewServerSsPortText(const QString &lineEditNewServerSsPortText)
|
||||
{
|
||||
if (m_lineEditNewServerSsPortText != lineEditNewServerSsPortText) {
|
||||
m_lineEditNewServerSsPortText = lineEditNewServerSsPortText;
|
||||
emit lineEditNewServerSsPortTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NewServerProtocolsLogic::getComboBoxNewServerSsCipherText() const
|
||||
{
|
||||
return m_comboBoxNewServerSsCipherText;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setComboBoxNewServerSsCipherText(const QString &comboBoxNewServerSsCipherText)
|
||||
{
|
||||
if (m_comboBoxNewServerSsCipherText != comboBoxNewServerSsCipherText) {
|
||||
m_comboBoxNewServerSsCipherText = comboBoxNewServerSsCipherText;
|
||||
emit comboBoxNewServerSsCipherTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NewServerProtocolsLogic::getlineEditNewServerOpenvpnPortText() const
|
||||
{
|
||||
return m_lineEditNewServerOpenvpnPortText;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setLineEditNewServerOpenvpnPortText(const QString &lineEditNewServerOpenvpnPortText)
|
||||
{
|
||||
if (m_lineEditNewServerOpenvpnPortText != lineEditNewServerOpenvpnPortText) {
|
||||
m_lineEditNewServerOpenvpnPortText = lineEditNewServerOpenvpnPortText;
|
||||
emit lineEditNewServerOpenvpnPortTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getPushButtonNewServerSettingsSsChecked() const
|
||||
{
|
||||
return m_pushButtonNewServerSettingsSsChecked;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setPushButtonNewServerSettingsSsChecked(bool pushButtonNewServerSettingsSsChecked)
|
||||
{
|
||||
if (m_pushButtonNewServerSettingsSsChecked != pushButtonNewServerSettingsSsChecked) {
|
||||
m_pushButtonNewServerSettingsSsChecked = pushButtonNewServerSettingsSsChecked;
|
||||
emit pushButtonNewServerSettingsSsCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getPushButtonNewServerSettingsOpenvpnChecked() const
|
||||
{
|
||||
return m_pushButtonNewServerSettingsOpenvpnChecked;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setPushButtonNewServerSettingsOpenvpnChecked(bool pushButtonNewServerSettingsOpenvpnChecked)
|
||||
{
|
||||
if (m_pushButtonNewServerSettingsOpenvpnChecked != pushButtonNewServerSettingsOpenvpnChecked) {
|
||||
m_pushButtonNewServerSettingsOpenvpnChecked = pushButtonNewServerSettingsOpenvpnChecked;
|
||||
emit pushButtonNewServerSettingsOpenvpnCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
QString NewServerProtocolsLogic::getLineEditNewServerCloakPortText() const
|
||||
{
|
||||
return m_lineEditNewServerCloakPortText;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setLineEditNewServerCloakPortText(const QString &lineEditNewServerCloakPortText)
|
||||
{
|
||||
if (m_lineEditNewServerCloakPortText != lineEditNewServerCloakPortText) {
|
||||
m_lineEditNewServerCloakPortText = lineEditNewServerCloakPortText;
|
||||
emit lineEditNewServerCloakPortTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getPushButtonNewServerSettingsCloakChecked() const
|
||||
{
|
||||
return m_pushButtonNewServerSettingsCloakChecked;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setPushButtonNewServerSettingsCloakChecked(bool pushButtonNewServerSettingsCloakChecked)
|
||||
{
|
||||
if (m_pushButtonNewServerSettingsCloakChecked != pushButtonNewServerSettingsCloakChecked) {
|
||||
m_pushButtonNewServerSettingsCloakChecked = pushButtonNewServerSettingsCloakChecked;
|
||||
emit pushButtonNewServerSettingsCloakCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getCheckBoxNewServerCloakChecked() const
|
||||
{
|
||||
return m_checkBoxNewServerCloakChecked;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setCheckBoxNewServerCloakChecked(bool checkBoxNewServerCloakChecked)
|
||||
{
|
||||
if (m_checkBoxNewServerCloakChecked != checkBoxNewServerCloakChecked) {
|
||||
m_checkBoxNewServerCloakChecked = checkBoxNewServerCloakChecked;
|
||||
emit checkBoxNewServerCloakCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getCheckBoxNewServerSsChecked() const
|
||||
{
|
||||
return m_checkBoxNewServerSsChecked;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setCheckBoxNewServerSsChecked(bool checkBoxNewServerSsChecked)
|
||||
{
|
||||
if (m_checkBoxNewServerSsChecked != checkBoxNewServerSsChecked) {
|
||||
m_checkBoxNewServerSsChecked = checkBoxNewServerSsChecked;
|
||||
emit checkBoxNewServerSsCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getCheckBoxNewServerOpenvpnChecked() const
|
||||
{
|
||||
return m_checkBoxNewServerOpenvpnChecked;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setCheckBoxNewServerOpenvpnChecked(bool checkBoxNewServerOpenvpnChecked)
|
||||
{
|
||||
if (m_checkBoxNewServerOpenvpnChecked != checkBoxNewServerOpenvpnChecked) {
|
||||
m_checkBoxNewServerOpenvpnChecked = checkBoxNewServerOpenvpnChecked;
|
||||
emit checkBoxNewServerOpenvpnCheckedChanged();
|
||||
}
|
||||
}
|
||||
|
||||
double NewServerProtocolsLogic::getProgressBarNewServerConnectionMinimum() const
|
||||
{
|
||||
return m_progressBarNewServerConnectionMinimum;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setProgressBarNewServerConnectionMinimum(double progressBarNewServerConnectionMinimum)
|
||||
{
|
||||
if (m_progressBarNewServerConnectionMinimum != progressBarNewServerConnectionMinimum) {
|
||||
m_progressBarNewServerConnectionMinimum = progressBarNewServerConnectionMinimum;
|
||||
emit progressBarNewServerConnectionMinimumChanged();
|
||||
}
|
||||
}
|
||||
|
||||
double NewServerProtocolsLogic::getProgressBarNewServerConnectionMaximum() const
|
||||
{
|
||||
return m_progressBarNewServerConnectionMaximum;
|
||||
}
|
||||
|
||||
void NewServerProtocolsLogic::setProgressBarNewServerConnectionMaximum(double progressBarNewServerConnectionMaximum)
|
||||
{
|
||||
if (m_progressBarNewServerConnectionMaximum != progressBarNewServerConnectionMaximum) {
|
||||
m_progressBarNewServerConnectionMaximum = progressBarNewServerConnectionMaximum;
|
||||
emit progressBarNewServerConnectionMaximumChanged();
|
||||
}
|
||||
set_pushButtonSettingsCloakChecked(true);
|
||||
set_pushButtonSettingsCloakChecked(false);
|
||||
set_pushButtonSettingsSsChecked(true);
|
||||
set_pushButtonSettingsSsChecked(false);
|
||||
set_lineEditCloakPortText(amnezia::protocols::cloak::defaultPort);
|
||||
set_lineEditCloakSiteText(amnezia::protocols::cloak::defaultRedirSite);
|
||||
set_lineEditSsPortText(amnezia::protocols::shadowsocks::defaultPort);
|
||||
set_comboBoxSsCipherText(amnezia::protocols::shadowsocks::defaultCipher);
|
||||
set_lineEditOpenvpnPortText(amnezia::protocols::openvpn::defaultPort);
|
||||
set_comboBoxOpenvpnProtoText(amnezia::protocols::openvpn::defaultTransportProto);
|
||||
}
|
||||
|
||||
QMap<DockerContainer, QJsonObject> NewServerProtocolsLogic::getInstallConfigsFromProtocolsPage() const
|
||||
|
@ -247,36 +49,36 @@ QMap<DockerContainer, QJsonObject> NewServerProtocolsLogic::getInstallConfigsFro
|
|||
QJsonObject cloakConfig {
|
||||
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverCloak) },
|
||||
{ config_key::cloak, QJsonObject {
|
||||
{ config_key::port, getLineEditNewServerCloakPortText() },
|
||||
{ config_key::site, getLineEditNewServerCloakSiteText() }}
|
||||
{ config_key::port, lineEditCloakPortText() },
|
||||
{ config_key::site, lineEditCloakSiteText() }}
|
||||
}
|
||||
};
|
||||
QJsonObject ssConfig {
|
||||
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverShadowSocks) },
|
||||
{ config_key::shadowsocks, QJsonObject {
|
||||
{ config_key::port, getLineEditNewServerSsPortText() },
|
||||
{ config_key::cipher, getComboBoxNewServerSsCipherText() }}
|
||||
{ config_key::port, lineEditSsPortText() },
|
||||
{ config_key::cipher, comboBoxSsCipherText() }}
|
||||
}
|
||||
};
|
||||
QJsonObject openVpnConfig {
|
||||
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpn) },
|
||||
{ config_key::openvpn, QJsonObject {
|
||||
{ config_key::port, getlineEditNewServerOpenvpnPortText() },
|
||||
{ config_key::transport_proto, getComboBoxNewServerOpenvpnProtoText() }}
|
||||
{ config_key::port, lineEditOpenvpnPortText() },
|
||||
{ config_key::transport_proto, comboBoxOpenvpnProtoText() }}
|
||||
}
|
||||
};
|
||||
|
||||
QMap<DockerContainer, QJsonObject> containers;
|
||||
|
||||
if (getCheckBoxNewServerCloakChecked()) {
|
||||
if (checkBoxCloakChecked()) {
|
||||
containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
|
||||
}
|
||||
|
||||
if (getCheckBoxNewServerSsChecked()) {
|
||||
if (checkBoxSsChecked()) {
|
||||
containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
|
||||
}
|
||||
|
||||
if (getCheckBoxNewServerOpenvpnChecked()) {
|
||||
if (checkBoxOpenvpnChecked()) {
|
||||
containers.insert(DockerContainer::OpenVpn, openVpnConfig);
|
||||
}
|
||||
|
||||
|
|
|
@ -9,24 +9,24 @@ class NewServerProtocolsLogic : public PageLogicBase
|
|||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void updateNewServerProtocolsPage();
|
||||
AUTO_PROPERTY(bool, frameSettingsParentWireguardVisible)
|
||||
AUTO_PROPERTY(bool, pushButtonSettingsCloakChecked)
|
||||
AUTO_PROPERTY(bool, pushButtonSettingsSsChecked)
|
||||
AUTO_PROPERTY(bool, pushButtonSettingsOpenvpnChecked)
|
||||
AUTO_PROPERTY(QString, lineEditCloakPortText)
|
||||
AUTO_PROPERTY(QString, lineEditCloakSiteText)
|
||||
AUTO_PROPERTY(QString, lineEditSsPortText)
|
||||
AUTO_PROPERTY(QString, comboBoxSsCipherText)
|
||||
AUTO_PROPERTY(QString, lineEditOpenvpnPortText)
|
||||
AUTO_PROPERTY(QString, comboBoxOpenvpnProtoText)
|
||||
AUTO_PROPERTY(bool, checkBoxCloakChecked)
|
||||
AUTO_PROPERTY(bool, checkBoxSsChecked)
|
||||
AUTO_PROPERTY(bool, checkBoxOpenvpnChecked)
|
||||
AUTO_PROPERTY(double, progressBarConnectionMinimum)
|
||||
AUTO_PROPERTY(double, progressBarConnectionMaximum)
|
||||
|
||||
Q_PROPERTY(bool frameNewServerSettingsParentWireguardVisible READ getFrameNewServerSettingsParentWireguardVisible WRITE setFrameNewServerSettingsParentWireguardVisible NOTIFY frameNewServerSettingsParentWireguardVisibleChanged)
|
||||
Q_PROPERTY(bool pushButtonNewServerSettingsCloakChecked READ getPushButtonNewServerSettingsCloakChecked WRITE setPushButtonNewServerSettingsCloakChecked NOTIFY pushButtonNewServerSettingsCloakCheckedChanged)
|
||||
Q_PROPERTY(bool pushButtonNewServerSettingsSsChecked READ getPushButtonNewServerSettingsSsChecked WRITE setPushButtonNewServerSettingsSsChecked NOTIFY pushButtonNewServerSettingsSsCheckedChanged)
|
||||
Q_PROPERTY(bool pushButtonNewServerSettingsOpenvpnChecked READ getPushButtonNewServerSettingsOpenvpnChecked WRITE setPushButtonNewServerSettingsOpenvpnChecked NOTIFY pushButtonNewServerSettingsOpenvpnCheckedChanged)
|
||||
Q_PROPERTY(QString lineEditNewServerCloakPortText READ getLineEditNewServerCloakPortText WRITE setLineEditNewServerCloakPortText NOTIFY lineEditNewServerCloakPortTextChanged)
|
||||
Q_PROPERTY(QString lineEditNewServerCloakSiteText READ getLineEditNewServerCloakSiteText WRITE setLineEditNewServerCloakSiteText NOTIFY lineEditNewServerCloakSiteTextChanged)
|
||||
Q_PROPERTY(QString lineEditNewServerSsPortText READ getLineEditNewServerSsPortText WRITE setLineEditNewServerSsPortText NOTIFY lineEditNewServerSsPortTextChanged)
|
||||
Q_PROPERTY(QString comboBoxNewServerSsCipherText READ getComboBoxNewServerSsCipherText WRITE setComboBoxNewServerSsCipherText NOTIFY comboBoxNewServerSsCipherTextChanged)
|
||||
Q_PROPERTY(QString lineEditNewServerOpenvpnPortText READ getlineEditNewServerOpenvpnPortText WRITE setLineEditNewServerOpenvpnPortText NOTIFY lineEditNewServerOpenvpnPortTextChanged)
|
||||
Q_PROPERTY(QString comboBoxNewServerOpenvpnProtoText READ getComboBoxNewServerOpenvpnProtoText WRITE setComboBoxNewServerOpenvpnProtoText NOTIFY comboBoxNewServerOpenvpnProtoTextChanged)
|
||||
Q_PROPERTY(bool checkBoxNewServerCloakChecked READ getCheckBoxNewServerCloakChecked WRITE setCheckBoxNewServerCloakChecked NOTIFY checkBoxNewServerCloakCheckedChanged)
|
||||
Q_PROPERTY(bool checkBoxNewServerSsChecked READ getCheckBoxNewServerSsChecked WRITE setCheckBoxNewServerSsChecked NOTIFY checkBoxNewServerSsCheckedChanged)
|
||||
Q_PROPERTY(bool checkBoxNewServerOpenvpnChecked READ getCheckBoxNewServerOpenvpnChecked WRITE setCheckBoxNewServerOpenvpnChecked NOTIFY checkBoxNewServerOpenvpnCheckedChanged)
|
||||
Q_PROPERTY(double progressBarNewServerConnectionMinimum READ getProgressBarNewServerConnectionMinimum WRITE setProgressBarNewServerConnectionMinimum NOTIFY progressBarNewServerConnectionMinimumChanged)
|
||||
Q_PROPERTY(double progressBarNewServerConnectionMaximum READ getProgressBarNewServerConnectionMaximum WRITE setProgressBarNewServerConnectionMaximum NOTIFY progressBarNewServerConnectionMaximumChanged)
|
||||
public:
|
||||
Q_INVOKABLE void updatePage() override;
|
||||
|
||||
public:
|
||||
explicit NewServerProtocolsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
|
@ -34,85 +34,8 @@ public:
|
|||
|
||||
QMap<DockerContainer, QJsonObject> getInstallConfigsFromProtocolsPage() const;
|
||||
|
||||
bool getFrameNewServerSettingsParentWireguardVisible() const;
|
||||
void setFrameNewServerSettingsParentWireguardVisible(bool frameNewServerSettingsParentWireguardVisible);
|
||||
|
||||
bool getPushButtonNewServerSettingsCloakChecked() const;
|
||||
void setPushButtonNewServerSettingsCloakChecked(bool pushButtonNewServerSettingsCloakChecked);
|
||||
bool getPushButtonNewServerSettingsSsChecked() const;
|
||||
void setPushButtonNewServerSettingsSsChecked(bool pushButtonNewServerSettingsSsChecked);
|
||||
bool getPushButtonNewServerSettingsOpenvpnChecked() const;
|
||||
void setPushButtonNewServerSettingsOpenvpnChecked(bool pushButtonNewServerSettingsOpenvpnChecked);
|
||||
QString getLineEditNewServerCloakPortText() const;
|
||||
void setLineEditNewServerCloakPortText(const QString &lineEditNewServerCloakPortText);
|
||||
QString getLineEditNewServerCloakSiteText() const;
|
||||
void setLineEditNewServerCloakSiteText(const QString &lineEditNewServerCloakSiteText);
|
||||
QString getLineEditNewServerSsPortText() const;
|
||||
void setLineEditNewServerSsPortText(const QString &lineEditNewServerSsPortText);
|
||||
QString getComboBoxNewServerSsCipherText() const;
|
||||
void setComboBoxNewServerSsCipherText(const QString &comboBoxNewServerSsCipherText);
|
||||
QString getlineEditNewServerOpenvpnPortText() const;
|
||||
void setLineEditNewServerOpenvpnPortText(const QString &lineEditNewServerOpenvpnPortText);
|
||||
QString getComboBoxNewServerOpenvpnProtoText() const;
|
||||
void setComboBoxNewServerOpenvpnProtoText(const QString &comboBoxNewServerOpenvpnProtoText);
|
||||
|
||||
bool getCheckBoxNewServerCloakChecked() const;
|
||||
void setCheckBoxNewServerCloakChecked(bool checkBoxNewServerCloakChecked);
|
||||
bool getCheckBoxNewServerSsChecked() const;
|
||||
void setCheckBoxNewServerSsChecked(bool checkBoxNewServerSsChecked);
|
||||
bool getCheckBoxNewServerOpenvpnChecked() const;
|
||||
void setCheckBoxNewServerOpenvpnChecked(bool checkBoxNewServerOpenvpnChecked);
|
||||
|
||||
double getProgressBarNewServerConnectionMinimum() const;
|
||||
void setProgressBarNewServerConnectionMinimum(double progressBarNewServerConnectionMinimum);
|
||||
double getProgressBarNewServerConnectionMaximum() const;
|
||||
void setProgressBarNewServerConnectionMaximum(double progressBarNewServerConnectionMaximum);
|
||||
|
||||
signals:
|
||||
void frameNewServerSettingsParentWireguardVisibleChanged();
|
||||
void pushButtonNewServerConnectConfigureClicked();
|
||||
void pushButtonConnectConfigureClicked();
|
||||
|
||||
void pushButtonNewServerSettingsCloakCheckedChanged();
|
||||
void pushButtonNewServerSettingsSsCheckedChanged();
|
||||
void pushButtonNewServerSettingsOpenvpnCheckedChanged();
|
||||
void lineEditNewServerCloakPortTextChanged();
|
||||
void lineEditNewServerCloakSiteTextChanged();
|
||||
void lineEditNewServerSsPortTextChanged();
|
||||
void comboBoxNewServerSsCipherTextChanged();
|
||||
void lineEditNewServerOpenvpnPortTextChanged();
|
||||
void comboBoxNewServerOpenvpnProtoTextChanged();
|
||||
|
||||
void checkBoxNewServerCloakCheckedChanged();
|
||||
void checkBoxNewServerSsCheckedChanged();
|
||||
void checkBoxNewServerOpenvpnCheckedChanged();
|
||||
|
||||
void progressBarNewServerConnectionMinimumChanged();
|
||||
void progressBarNewServerConnectionMaximumChanged();
|
||||
|
||||
private:
|
||||
|
||||
|
||||
private slots:
|
||||
|
||||
|
||||
private:
|
||||
bool m_frameNewServerSettingsParentWireguardVisible;
|
||||
|
||||
bool m_pushButtonNewServerSettingsCloakChecked;
|
||||
bool m_pushButtonNewServerSettingsSsChecked;
|
||||
bool m_pushButtonNewServerSettingsOpenvpnChecked;
|
||||
QString m_lineEditNewServerCloakPortText;
|
||||
QString m_lineEditNewServerCloakSiteText;
|
||||
QString m_lineEditNewServerSsPortText;
|
||||
QString m_comboBoxNewServerSsCipherText;
|
||||
QString m_lineEditNewServerOpenvpnPortText;
|
||||
QString m_comboBoxNewServerOpenvpnProtoText;
|
||||
|
||||
bool m_checkBoxNewServerCloakChecked;
|
||||
bool m_checkBoxNewServerSsChecked;
|
||||
bool m_checkBoxNewServerOpenvpnChecked;
|
||||
|
||||
double m_progressBarNewServerConnectionMinimum;
|
||||
double m_progressBarNewServerConnectionMaximum;
|
||||
};
|
||||
#endif // NEW_SERVER_PROTOCOLS_LOGIC_H
|
||||
|
|
|
@ -1,8 +1,9 @@
|
|||
#ifndef PAGE_LOGIC_BASE_H
|
||||
#define PAGE_LOGIC_BASE_H
|
||||
|
||||
#include "../pages.h"
|
||||
#include "settings.h"
|
||||
#include "../pages.h"
|
||||
#include "../property_helper.h"
|
||||
|
||||
using namespace amnezia;
|
||||
using namespace PageEnumNS;
|
||||
|
@ -17,7 +18,7 @@ public:
|
|||
explicit PageLogicBase(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~PageLogicBase() = default;
|
||||
|
||||
Q_INVOKABLE void updatePage() {}
|
||||
Q_INVOKABLE virtual void updatePage() {}
|
||||
|
||||
protected:
|
||||
UiLogic *uiLogic() const { return m_uiLogic; }
|
||||
|
|
27
client/ui/property_helper.h
Normal file
27
client/ui/property_helper.h
Normal file
|
@ -0,0 +1,27 @@
|
|||
#ifndef PROPERTY_HELPER_H
|
||||
#define PROPERTY_HELPER_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#define AUTO_PROPERTY(TYPE, NAME) \
|
||||
Q_PROPERTY(TYPE NAME READ NAME WRITE set_ ## NAME NOTIFY NAME ## Changed ) \
|
||||
public: \
|
||||
TYPE NAME() const { return m_ ## NAME ; } \
|
||||
void set_ ## NAME(TYPE value) { \
|
||||
if (m_ ## NAME == value) return; \
|
||||
m_ ## NAME = value; \
|
||||
emit NAME ## Changed(value); \
|
||||
} \
|
||||
Q_SIGNAL void NAME ## Changed(TYPE value);\
|
||||
private: \
|
||||
TYPE m_ ## NAME;
|
||||
|
||||
#define READONLY_PROPERTY(TYPE, NAME) \
|
||||
Q_PROPERTY(TYPE NAME READ NAME CONSTANT ) \
|
||||
public: \
|
||||
TYPE NAME() const { return m_ ## NAME ; } \
|
||||
private: \
|
||||
void NAME(TYPE value) {m_ ## NAME = value; } \
|
||||
TYPE m_ ## NAME;
|
||||
|
||||
#endif // PROPERTY_HELPER_H
|
|
@ -36,10 +36,10 @@ PageBase {
|
|||
width: 211
|
||||
height: 31
|
||||
text: qsTr("Auto connect")
|
||||
checked: AppSettingsLogic.checkBoxAppSettingsAutoconnectChecked
|
||||
checked: AppSettingsLogic.checkBoxAutoConnectChecked
|
||||
onCheckedChanged: {
|
||||
AppSettingsLogic.checkBoxAppSettingsAutoconnectChecked = checked
|
||||
AppSettingsLogic.onCheckBoxAppSettingsAutoconnectToggled(checked)
|
||||
AppSettingsLogic.checkBoxAutoConnectChecked = checked
|
||||
AppSettingsLogic.onCheckBoxAutoconnectToggled(checked)
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
|
@ -48,10 +48,10 @@ PageBase {
|
|||
width: 211
|
||||
height: 31
|
||||
text: qsTr("Auto start")
|
||||
checked: AppSettingsLogic.checkBoxAppSettingsAutostartChecked
|
||||
checked: AppSettingsLogic.checkBoxAutostartChecked
|
||||
onCheckedChanged: {
|
||||
AppSettingsLogic.checkBoxAppSettingsAutostartChecked = checked
|
||||
AppSettingsLogic.onCheckBoxAppSettingsAutostartToggled(checked)
|
||||
AppSettingsLogic.checkBoxAutostartChecked = checked
|
||||
AppSettingsLogic.onCheckBoxAutostartToggled(checked)
|
||||
}
|
||||
}
|
||||
CheckBoxType {
|
||||
|
@ -60,10 +60,10 @@ PageBase {
|
|||
width: 211
|
||||
height: 31
|
||||
text: qsTr("Start minimized")
|
||||
checked: AppSettingsLogic.checkBoxAppSettingsStartMinimizedChecked
|
||||
checked: AppSettingsLogic.checkBoxStartMinimizedChecked
|
||||
onCheckedChanged: {
|
||||
AppSettingsLogic.checkBoxAppSettingsStartMinimizedChecked = checked
|
||||
AppSettingsLogic.onCheckBoxAppSettingsStartMinimizedToggled(checked)
|
||||
AppSettingsLogic.checkBoxStartMinimizedChecked = checked
|
||||
AppSettingsLogic.onCheckBoxStartMinimizedToggled(checked)
|
||||
}
|
||||
}
|
||||
Image {
|
||||
|
@ -78,7 +78,7 @@ PageBase {
|
|||
y: 240
|
||||
width: 281
|
||||
height: 21
|
||||
text: AppSettingsLogic.labelAppSettingsVersionText
|
||||
text: AppSettingsLogic.labelVersionText
|
||||
}
|
||||
BlueButtonType {
|
||||
x: 30
|
||||
|
@ -97,7 +97,7 @@ PageBase {
|
|||
height: 41
|
||||
text: qsTr("Open logs folder")
|
||||
onClicked: {
|
||||
AppSettingsLogic.onPushButtonAppSettingsOpenLogsChecked()
|
||||
AppSettingsLogic.onPushButtonOpenLogsClicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -57,10 +57,10 @@ Item {
|
|||
y: 120
|
||||
width: 271
|
||||
height: 40
|
||||
text: NetworkSettingsLogic.lineEditNetworkSettingsDns1Text
|
||||
text: NetworkSettingsLogic.lineEditDns1Text
|
||||
onEditingFinished: {
|
||||
NetworkSettingsLogic.lineEditNetworkSettingsDns1Text = text
|
||||
NetworkSettingsLogic.onLineEditNetworkSettingsDns1EditFinished(text)
|
||||
NetworkSettingsLogic.lineEditDns1Text = text
|
||||
NetworkSettingsLogic.onLineEditDns1EditFinished(text)
|
||||
}
|
||||
validator: RegExpValidator {
|
||||
regExp: NetworkSettingsLogic.ipAddressValidatorRegex
|
||||
|
@ -72,10 +72,10 @@ Item {
|
|||
y: 200
|
||||
width: 271
|
||||
height: 40
|
||||
text: NetworkSettingsLogic.lineEditNetworkSettingsDns2Text
|
||||
text: NetworkSettingsLogic.lineEditDns2Text
|
||||
onEditingFinished: {
|
||||
NetworkSettingsLogic.lineEditNetworkSettingsDns2Text = text
|
||||
NetworkSettingsLogic.onLineEditNetworkSettingsDns2EditFinished(text)
|
||||
NetworkSettingsLogic.lineEditDns2Text = text
|
||||
NetworkSettingsLogic.onLineEditDns2EditFinished(text)
|
||||
}
|
||||
validator: RegExpValidator {
|
||||
regExp: NetworkSettingsLogic.ipAddressValidatorRegex
|
||||
|
@ -89,7 +89,7 @@ Item {
|
|||
height: 24
|
||||
icon.source: "qrc:/images/reload.png"
|
||||
onClicked: {
|
||||
NetworkSettingsLogic.onPushButtonNetworkSettingsResetdns1Clicked()
|
||||
NetworkSettingsLogic.onPushButtonResetDns1Clicked()
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
|
@ -100,7 +100,7 @@ Item {
|
|||
height: 24
|
||||
icon.source: "qrc:/images/reload.png"
|
||||
onClicked: {
|
||||
NetworkSettingsLogic.onPushButtonNetworkSettingsResetdns2Clicked()
|
||||
NetworkSettingsLogic.onPushButtonResetDns2Clicked()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@ import "../Config"
|
|||
|
||||
Item {
|
||||
id: root
|
||||
enabled: NewServerConfiguringLogic.pageNewServerConfiguringEnabled
|
||||
enabled: NewServerConfiguringLogic.pageEnabled
|
||||
Text {
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
|
@ -32,8 +32,8 @@ Item {
|
|||
y: 560
|
||||
width: 301
|
||||
height: 41
|
||||
text: NewServerConfiguringLogic.labelNewServerConfiguringWaitInfoText
|
||||
visible: NewServerConfiguringLogic.labelNewServerConfiguringWaitInfoVisible
|
||||
text: NewServerConfiguringLogic.labelWaitInfoText
|
||||
visible: NewServerConfiguringLogic.labelWaitInfoVisible
|
||||
}
|
||||
ProgressBar {
|
||||
id: pr
|
||||
|
@ -42,9 +42,9 @@ Item {
|
|||
width: 301
|
||||
height: 40
|
||||
from: 0
|
||||
to: NewServerConfiguringLogic.progressBarNewServerConfiguringMaximium
|
||||
value: NewServerConfiguringLogic.progressBarNewServerConfiguringValue
|
||||
visible: NewServerConfiguringLogic.progressBarNewServerConfiguringVisible
|
||||
to: NewServerConfiguringLogic.progressBarMaximium
|
||||
value: NewServerConfiguringLogic.progressBarValue
|
||||
visible: NewServerConfiguringLogic.progressBarVisible
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
implicitHeight: parent.height
|
||||
|
@ -65,13 +65,13 @@ Item {
|
|||
|
||||
LabelType {
|
||||
anchors.fill: parent
|
||||
text: NewServerConfiguringLogic.progressBarNewServerConfiguringText
|
||||
text: NewServerConfiguringLogic.progressBarText
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
font.family: "Lato"
|
||||
font.styleName: "normal"
|
||||
font.pixelSize: 16
|
||||
color: "#D4D4D4"
|
||||
visible: NewServerConfiguringLogic.progressBarNewServerConfiguringTextVisible
|
||||
visible: NewServerConfiguringLogic.progressBarTextVisible
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -36,8 +36,8 @@ Item {
|
|||
y: 570
|
||||
width: 301
|
||||
height: 40
|
||||
from: NewServerProtocolsLogic.progressBarNewServerConnectionMinimum
|
||||
to: NewServerProtocolsLogic.progressBarNewServerConnectionMaximum
|
||||
from: NewServerProtocolsLogic.progressBarConnectionMinimum
|
||||
to: NewServerProtocolsLogic.progressBarConnectionMaximum
|
||||
value: 0
|
||||
background: Rectangle {
|
||||
implicitWidth: parent.width
|
||||
|
@ -74,7 +74,7 @@ Item {
|
|||
height: 40
|
||||
text: qsTr("Setup server")
|
||||
onClicked: {
|
||||
NewServerProtocolsLogic.pushButtonNewServerConnectConfigureClicked()
|
||||
NewServerProtocolsLogic.pushButtonConnectConfigureClicked()
|
||||
}
|
||||
}
|
||||
ScrollView {
|
||||
|
@ -120,9 +120,9 @@ Item {
|
|||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: NewServerProtocolsLogic.lineEditNewServerCloakPortText
|
||||
text: NewServerProtocolsLogic.lineEditCloakPortText
|
||||
onEditingFinished: {
|
||||
NewServerProtocolsLogic.lineEditNewServerCloakPortText = text
|
||||
NewServerProtocolsLogic.lineEditCloakPortText = text
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
|
@ -133,9 +133,9 @@ Item {
|
|||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: NewServerProtocolsLogic.lineEditNewServerCloakSiteText
|
||||
text: NewServerProtocolsLogic.lineEditCloakSiteText
|
||||
onEditingFinished: {
|
||||
NewServerProtocolsLogic.lineEditNewServerCloakSiteText = text
|
||||
NewServerProtocolsLogic.lineEditCloakSiteText = text
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -151,9 +151,9 @@ Item {
|
|||
text: qsTr("OpenVPN and ShadowSocks\n with masking using Cloak plugin")
|
||||
height: parent.height
|
||||
width: 308
|
||||
checked: NewServerProtocolsLogic.checkBoxNewServerCloakChecked
|
||||
checked: NewServerProtocolsLogic.checkBoxCloakChecked
|
||||
onCheckedChanged: {
|
||||
NewServerProtocolsLogic.checkBoxNewServerCloakChecked = checked
|
||||
NewServerProtocolsLogic.checkBoxCloakChecked = checked
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
|
@ -162,9 +162,9 @@ Item {
|
|||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
checkable: true
|
||||
checked: NewServerProtocolsLogic.pushButtonNewServerSettingsCloakChecked
|
||||
checked: NewServerProtocolsLogic.pushButtonSettingsCloakChecked
|
||||
onCheckedChanged: {
|
||||
NewServerProtocolsLogic.pushButtonNewServerSettingsCloakChecked = checked
|
||||
NewServerProtocolsLogic.pushButtonSettingsCloakChecked = checked
|
||||
if (checked) {
|
||||
frame_new_server_setting_cloak.visible = true
|
||||
} else {
|
||||
|
@ -209,9 +209,9 @@ Item {
|
|||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: NewServerProtocolsLogic.lineEditNewServerSsPortText
|
||||
text: NewServerProtocolsLogic.lineEditSsPortText
|
||||
onEditingFinished: {
|
||||
NewServerProtocolsLogic.lineEditNewServerSsPortText = text
|
||||
NewServerProtocolsLogic.lineEditSsPortText = text
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
|
@ -231,14 +231,14 @@ Item {
|
|||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (NewServerProtocolsLogic.comboBoxNewServerSsCipherText === model[i]) {
|
||||
if (NewServerProtocolsLogic.comboBoxSsCipherText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
NewServerProtocolsLogic.comboBoxNewServerSsCipherText = currentText
|
||||
NewServerProtocolsLogic.comboBoxSsCipherText = currentText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -254,9 +254,9 @@ Item {
|
|||
text: qsTr("ShadowSocks")
|
||||
height: parent.height
|
||||
width: 308
|
||||
checked: NewServerProtocolsLogic.checkBoxNewServerSsChecked
|
||||
checked: NewServerProtocolsLogic.checkBoxSsChecked
|
||||
onCheckedChanged: {
|
||||
NewServerProtocolsLogic.checkBoxNewServerSsChecked = checked
|
||||
NewServerProtocolsLogic.checkBoxSsChecked = checked
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
|
@ -264,10 +264,10 @@ Item {
|
|||
height: 35
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
checked: NewServerProtocolsLogic.pushButtonNewServerSettingsSsChecked
|
||||
checked: NewServerProtocolsLogic.pushButtonSettingsSsChecked
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
NewServerProtocolsLogic.pushButtonNewServerSettingsSsChecked = checked
|
||||
NewServerProtocolsLogic.pushButtonSettingsSsChecked = checked
|
||||
if (checked) {
|
||||
frame_new_server_settings_ss.visible = true
|
||||
} else {
|
||||
|
@ -312,9 +312,9 @@ Item {
|
|||
TextFieldType {
|
||||
width: parent.width - 130 - parent.spacing - parent.leftPadding * 2
|
||||
height: (parent.height - parent.spacing - parent.topPadding * 2) / 2
|
||||
text: NewServerProtocolsLogic.lineEditNewServerOpenvpnPortText
|
||||
text: NewServerProtocolsLogic.lineEditOpenvpnPortText
|
||||
onEditingFinished: {
|
||||
NewServerProtocolsLogic.lineEditNewServerOpenvpnPortText = text
|
||||
NewServerProtocolsLogic.lineEditOpenvpnPortText = text
|
||||
}
|
||||
}
|
||||
LabelType {
|
||||
|
@ -331,14 +331,14 @@ Item {
|
|||
]
|
||||
currentIndex: {
|
||||
for (let i = 0; i < model.length; ++i) {
|
||||
if (NewServerProtocolsLogic.comboBoxNewServerOpenvpnProtoText === model[i]) {
|
||||
if (NewServerProtocolsLogic.comboBoxOpenvpnProtoText === model[i]) {
|
||||
return i
|
||||
}
|
||||
}
|
||||
return -1
|
||||
}
|
||||
onCurrentTextChanged: {
|
||||
NewServerProtocolsLogic.comboBoxNewServerOpenvpnProtoText = currentText
|
||||
NewServerProtocolsLogic.comboBoxOpenvpnProtoText = currentText
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -354,9 +354,9 @@ Item {
|
|||
text: qsTr("OpenVPN")
|
||||
height: parent.height
|
||||
width: 308
|
||||
checked: NewServerProtocolsLogic.checkBoxNewServerOpenvpnChecked
|
||||
checked: NewServerProtocolsLogic.checkBoxOpenvpnChecked
|
||||
onCheckedChanged: {
|
||||
NewServerProtocolsLogic.checkBoxNewServerOpenvpnChecked = checked
|
||||
NewServerProtocolsLogic.checkBoxOpenvpnChecked = checked
|
||||
}
|
||||
}
|
||||
ImageButtonType {
|
||||
|
@ -364,10 +364,10 @@ Item {
|
|||
height: 35
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon.source: "qrc:/images/settings.png"
|
||||
checked: NewServerProtocolsLogic.pushButtonNewServerSettingsOpenvpnChecked
|
||||
checked: NewServerProtocolsLogic.pushButtonSettingsOpenvpnChecked
|
||||
checkable: true
|
||||
onCheckedChanged: {
|
||||
NewServerProtocolsLogic.pushButtonNewServerSettingsOpenvpnChecked = checked
|
||||
NewServerProtocolsLogic.pushButtonSettingsOpenvpnChecked = checked
|
||||
if (checked) {
|
||||
frame_new_server_settings_openvpn.visible = true
|
||||
} else {
|
||||
|
@ -379,7 +379,7 @@ Item {
|
|||
}
|
||||
Rectangle {
|
||||
id: frame_new_server_settings_parent_wireguard
|
||||
visible: NewServerProtocolsLogic.frameNewServerSettingsParentWireguardVisible
|
||||
visible: NewServerProtocolsLogic.frameSettingsParentWireguardVisible
|
||||
x: 5
|
||||
y: 5
|
||||
width: 368
|
||||
|
|
|
@ -154,7 +154,7 @@ Window {
|
|||
UiLogic.updateWizardHighPage();
|
||||
}
|
||||
if (page === PageEnum.ServerConfiguring) {
|
||||
UiLogic.progressBarNewServerConfiguringValue = 0;
|
||||
UiLogic.progressBarValue = 0;
|
||||
}
|
||||
if (page === PageEnum.GeneralSettings) {
|
||||
GeneralSettingsLogic.updateGeneralSettingPage();
|
||||
|
@ -167,16 +167,16 @@ Window {
|
|||
StartPageLogic.updateStartPage();
|
||||
}
|
||||
if (page === PageEnum.NewServerProtocols) {
|
||||
NewServerProtocolsLogic.updateNewServerProtocolsPage()
|
||||
NewServerProtocolsLogic.updatePage()
|
||||
}
|
||||
if (page === PageEnum.ServerContainers) {
|
||||
ServerContainersLogic.updateServerContainersPage()
|
||||
}
|
||||
if (page === PageEnum.AppSettings) {
|
||||
AppSettingsLogic.updateAppSettingsPage()
|
||||
AppSettingsLogic.updatePage()
|
||||
}
|
||||
if (page === PageEnum.NetworkSettings) {
|
||||
NetworkSettingsLogic.updateNetworkSettingsPage()
|
||||
NetworkSettingsLogic.updatePage()
|
||||
}
|
||||
if (page === PageEnum.Sites) {
|
||||
SitesLogic.updateSitesPage()
|
||||
|
|
|
@ -381,34 +381,34 @@ void UiLogic::installServer(const QMap<DockerContainer, QJsonObject> &containers
|
|||
|
||||
PageFunc page_new_server_configuring;
|
||||
page_new_server_configuring.setEnabledFunc = [this] (bool enabled) -> void {
|
||||
newServerConfiguringLogic()->setPageNewServerConfiguringEnabled(enabled);
|
||||
newServerConfiguringLogic()->set_pageEnabled(enabled);
|
||||
};
|
||||
ButtonFunc no_button;
|
||||
LabelFunc label_new_server_configuring_wait_info;
|
||||
label_new_server_configuring_wait_info.setTextFunc = [this] (const QString& text) -> void {
|
||||
newServerConfiguringLogic()->setLabelNewServerConfiguringWaitInfoText(text);
|
||||
newServerConfiguringLogic()->set_labelWaitInfoText(text);
|
||||
};
|
||||
label_new_server_configuring_wait_info.setVisibleFunc = [this] (bool visible) ->void {
|
||||
newServerConfiguringLogic()->setLabelNewServerConfiguringWaitInfoVisible(visible);
|
||||
newServerConfiguringLogic()->set_labelWaitInfoVisible(visible);
|
||||
};
|
||||
ProgressFunc progressBar_new_server_configuring;
|
||||
progressBar_new_server_configuring.setVisibleFunc = [this] (bool visible) ->void {
|
||||
newServerConfiguringLogic()->setProgressBarNewServerConfiguringVisible(visible);
|
||||
newServerConfiguringLogic()->set_progressBarVisible(visible);
|
||||
};
|
||||
progressBar_new_server_configuring.setValueFunc = [this] (int value) ->void {
|
||||
newServerConfiguringLogic()->setProgressBarNewServerConfiguringValue(value);
|
||||
newServerConfiguringLogic()->set_progressBarValue(value);
|
||||
};
|
||||
progressBar_new_server_configuring.getValueFunc = [this] (void) -> int {
|
||||
return newServerConfiguringLogic()->getProgressBarNewServerConfiguringValue();
|
||||
return newServerConfiguringLogic()->progressBarValue();
|
||||
};
|
||||
progressBar_new_server_configuring.getMaximiumFunc = [this] (void) -> int {
|
||||
return newServerConfiguringLogic()->getProgressBarNewServerConfiguringMaximium();
|
||||
return newServerConfiguringLogic()->progressBarMaximium();
|
||||
};
|
||||
progressBar_new_server_configuring.setTextVisibleFunc = [this] (bool visible) ->void {
|
||||
newServerConfiguringLogic()->setProgressBarNewServerConfiguringTextVisible(visible);
|
||||
newServerConfiguringLogic()->set_progressBarTextVisible(visible);
|
||||
};
|
||||
progressBar_new_server_configuring.setTextFunc = [this] (const QString& text) ->void {
|
||||
newServerConfiguringLogic()->setProgressBarNewServerConfiguringText(text);
|
||||
newServerConfiguringLogic()->set_progressBarText(text);
|
||||
};
|
||||
bool ok = installContainers(installCredentials, containers,
|
||||
page_new_server_configuring,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue