AUTO_PROPERTY added
This commit is contained in:
parent
539bf2ee24
commit
63ffa4a212
19 changed files with 216 additions and 778 deletions
|
|
@ -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; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue