NewServerConfiguringLogic
NewServerProtocolsLogic
This commit is contained in:
parent
7c28fe2795
commit
4c0ff29488
12 changed files with 587 additions and 543 deletions
|
|
@ -5,7 +5,120 @@ using namespace PageEnumNS;
|
|||
|
||||
NewServerConfiguringLogic::NewServerConfiguringLogic(UiLogic *uiLogic, QObject *parent):
|
||||
QObject(parent),
|
||||
m_uiLogic(uiLogic)
|
||||
m_uiLogic(uiLogic),
|
||||
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...")}
|
||||
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ class NewServerConfiguringLogic : public QObject
|
|||
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)
|
||||
|
|
@ -23,9 +24,33 @@ 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:
|
||||
|
||||
|
|
@ -38,7 +63,14 @@ private:
|
|||
Settings m_settings;
|
||||
UiLogic *m_uiLogic;
|
||||
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -5,7 +5,281 @@ using namespace PageEnumNS;
|
|||
|
||||
NewServerProtocolsLogic::NewServerProtocolsLogic(UiLogic *uiLogic, QObject *parent):
|
||||
QObject(parent),
|
||||
m_uiLogic(uiLogic)
|
||||
m_uiLogic(uiLogic),
|
||||
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}
|
||||
{
|
||||
setFrameNewServerSettingsParentWireguardVisible(false);
|
||||
|
||||
}
|
||||
|
||||
bool NewServerProtocolsLogic::getFrameNewServerSettingsParentWireguardVisible() const
|
||||
{
|
||||
return m_frameNewServerSettingsParentWireguardVisible;
|
||||
}
|
||||
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
QMap<DockerContainer, QJsonObject> NewServerProtocolsLogic::getInstallConfigsFromProtocolsPage() const
|
||||
{
|
||||
QJsonObject cloakConfig {
|
||||
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverCloak) },
|
||||
{ config_key::cloak, QJsonObject {
|
||||
{ config_key::port, getLineEditNewServerCloakPortText() },
|
||||
{ config_key::site, getLineEditNewServerCloakSiteText() }}
|
||||
}
|
||||
};
|
||||
QJsonObject ssConfig {
|
||||
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpnOverShadowSocks) },
|
||||
{ config_key::shadowsocks, QJsonObject {
|
||||
{ config_key::port, getLineEditNewServerSsPortText() },
|
||||
{ config_key::cipher, getComboBoxNewServerSsCipherText() }}
|
||||
}
|
||||
};
|
||||
QJsonObject openVpnConfig {
|
||||
{ config_key::container, amnezia::containerToString(DockerContainer::OpenVpn) },
|
||||
{ config_key::openvpn, QJsonObject {
|
||||
{ config_key::port, getlineEditNewServerOpenvpnPortText() },
|
||||
{ config_key::transport_proto, getComboBoxNewServerOpenvpnProtoText() }}
|
||||
}
|
||||
};
|
||||
|
||||
QMap<DockerContainer, QJsonObject> containers;
|
||||
|
||||
if (getCheckBoxNewServerCloakChecked()) {
|
||||
containers.insert(DockerContainer::OpenVpnOverCloak, cloakConfig);
|
||||
}
|
||||
|
||||
if (getCheckBoxNewServerSsChecked()) {
|
||||
containers.insert(DockerContainer::OpenVpnOverShadowSocks, ssConfig);
|
||||
}
|
||||
|
||||
if (getCheckBoxNewServerOpenvpnChecked()) {
|
||||
containers.insert(DockerContainer::OpenVpn, openVpnConfig);
|
||||
}
|
||||
|
||||
return containers;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,8 +11,9 @@ class NewServerProtocolsLogic : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
Q_INVOKABLE void updateNewServerProtocolsPage();
|
||||
|
||||
Q_PROPERTY(bool frameNewServerSettingsParentWireguardVisible READ getFrameNewServerSettingsParentWireguardVisible WRITE setFrameNewServerSettingsParentWireguardVisible NOTIFY frameNewServerSettingsParentWireguardVisibleChanged)
|
||||
Q_PROPERTY(double progressBarNewServerConfiguringValue READ getProgressBarNewServerConfiguringValue WRITE setProgressBarNewServerConfiguringValue NOTIFY progressBarNewServerConfiguringValueChanged)
|
||||
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)
|
||||
|
|
@ -25,14 +26,69 @@ public:
|
|||
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:
|
||||
explicit NewServerProtocolsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
|
||||
~NewServerProtocolsLogic() = default;
|
||||
|
||||
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 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:
|
||||
|
||||
|
|
@ -45,7 +101,23 @@ private:
|
|||
Settings m_settings;
|
||||
UiLogic *m_uiLogic;
|
||||
|
||||
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
|
||||
|
|
|
|||
|
|
@ -19,8 +19,6 @@ StartPageLogic::StartPageLogic(UiLogic *uiLogic, QObject *parent):
|
|||
m_lineEditNewServerLoginText{},
|
||||
m_labelNewServerWaitInfoVisible{true},
|
||||
m_labelNewServerWaitInfoText{},
|
||||
m_progressBarNewServerConnectionMinimum{0},
|
||||
m_progressBarNewServerConnectionMaximum{100},
|
||||
m_pushButtonBackFromStartVisible{true},
|
||||
m_pushButtonNewServerConnectVisible{true}
|
||||
{
|
||||
|
|
@ -38,8 +36,6 @@ void StartPageLogic::updateStartPage()
|
|||
|
||||
setLabelNewServerWaitInfoVisible(false);
|
||||
setLabelNewServerWaitInfoText("");
|
||||
setProgressBarNewServerConnectionMinimum(0);
|
||||
setProgressBarNewServerConnectionMaximum(300);
|
||||
setPushButtonNewServerConnectVisible(true);
|
||||
}
|
||||
|
||||
|
|
@ -147,32 +143,6 @@ void StartPageLogic::setLabelNewServerWaitInfoText(const QString &labelNewServer
|
|||
}
|
||||
}
|
||||
|
||||
double StartPageLogic::getProgressBarNewServerConnectionMinimum() const
|
||||
{
|
||||
return m_progressBarNewServerConnectionMinimum;
|
||||
}
|
||||
|
||||
void StartPageLogic::setProgressBarNewServerConnectionMinimum(double progressBarNewServerConnectionMinimum)
|
||||
{
|
||||
if (m_progressBarNewServerConnectionMinimum != progressBarNewServerConnectionMinimum) {
|
||||
m_progressBarNewServerConnectionMinimum = progressBarNewServerConnectionMinimum;
|
||||
emit progressBarNewServerConnectionMinimumChanged();
|
||||
}
|
||||
}
|
||||
|
||||
double StartPageLogic::getProgressBarNewServerConnectionMaximum() const
|
||||
{
|
||||
return m_progressBarNewServerConnectionMaximum;
|
||||
}
|
||||
|
||||
void StartPageLogic::setProgressBarNewServerConnectionMaximum(double progressBarNewServerConnectionMaximum)
|
||||
{
|
||||
if (m_progressBarNewServerConnectionMaximum != progressBarNewServerConnectionMaximum) {
|
||||
m_progressBarNewServerConnectionMaximum = progressBarNewServerConnectionMaximum;
|
||||
emit progressBarNewServerConnectionMaximumChanged();
|
||||
}
|
||||
}
|
||||
|
||||
bool StartPageLogic::getPushButtonNewServerConnectVisible() const
|
||||
{
|
||||
return m_pushButtonNewServerConnectVisible;
|
||||
|
|
|
|||
|
|
@ -23,8 +23,6 @@ public:
|
|||
Q_PROPERTY(QString lineEditNewServerLoginText READ getLineEditNewServerLoginText WRITE setLineEditNewServerLoginText NOTIFY lineEditNewServerLoginTextChanged)
|
||||
Q_PROPERTY(bool labelNewServerWaitInfoVisible READ getLabelNewServerWaitInfoVisible WRITE setLabelNewServerWaitInfoVisible NOTIFY labelNewServerWaitInfoVisibleChanged)
|
||||
Q_PROPERTY(QString labelNewServerWaitInfoText READ getLabelNewServerWaitInfoText WRITE setLabelNewServerWaitInfoText NOTIFY labelNewServerWaitInfoTextChanged)
|
||||
Q_PROPERTY(double progressBarNewServerConnectionMinimum READ getProgressBarNewServerConnectionMinimum WRITE setProgressBarNewServerConnectionMinimum NOTIFY progressBarNewServerConnectionMinimumChanged)
|
||||
Q_PROPERTY(double progressBarNewServerConnectionMaximum READ getProgressBarNewServerConnectionMaximum WRITE setProgressBarNewServerConnectionMaximum NOTIFY progressBarNewServerConnectionMaximumChanged)
|
||||
Q_PROPERTY(bool pushButtonBackFromStartVisible READ getPushButtonBackFromStartVisible WRITE setPushButtonBackFromStartVisible NOTIFY pushButtonBackFromStartVisibleChanged)
|
||||
Q_PROPERTY(bool pushButtonNewServerConnectVisible READ getPushButtonNewServerConnectVisible WRITE setPushButtonNewServerConnectVisible NOTIFY pushButtonNewServerConnectVisibleChanged)
|
||||
|
||||
|
|
@ -58,10 +56,6 @@ public:
|
|||
void setLabelNewServerWaitInfoVisible(bool labelNewServerWaitInfoVisible);
|
||||
QString getLabelNewServerWaitInfoText() const;
|
||||
void setLabelNewServerWaitInfoText(const QString &labelNewServerWaitInfoText);
|
||||
double getProgressBarNewServerConnectionMinimum() const;
|
||||
void setProgressBarNewServerConnectionMinimum(double progressBarNewServerConnectionMinimum);
|
||||
double getProgressBarNewServerConnectionMaximum() const;
|
||||
void setProgressBarNewServerConnectionMaximum(double progressBarNewServerConnectionMaximum);
|
||||
|
||||
QString getPushButtonNewServerConnectText() const;
|
||||
void setPushButtonNewServerConnectText(const QString &pushButtonNewServerConnectText);
|
||||
|
|
@ -75,8 +69,6 @@ signals:
|
|||
void lineEditNewServerLoginTextChanged();
|
||||
void labelNewServerWaitInfoVisibleChanged();
|
||||
void labelNewServerWaitInfoTextChanged();
|
||||
void progressBarNewServerConnectionMinimumChanged();
|
||||
void progressBarNewServerConnectionMaximumChanged();
|
||||
void pushButtonBackFromStartVisibleChanged();
|
||||
void pushButtonNewServerConnectVisibleChanged();
|
||||
void pushButtonNewServerConnectEnabledChanged();
|
||||
|
|
@ -103,8 +95,6 @@ private:
|
|||
QString m_lineEditNewServerLoginText;
|
||||
bool m_labelNewServerWaitInfoVisible;
|
||||
QString m_labelNewServerWaitInfoText;
|
||||
double m_progressBarNewServerConnectionMinimum;
|
||||
double m_progressBarNewServerConnectionMaximum;
|
||||
bool m_pushButtonBackFromStartVisible;
|
||||
bool m_pushButtonNewServerConnectVisible;
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue