NewServerConfiguringLogic

NewServerProtocolsLogic
This commit is contained in:
pokamest 2021-09-07 11:48:25 +03:00
parent deda2e158e
commit 7c28fe2795
13 changed files with 132 additions and 94 deletions

View file

@ -37,7 +37,8 @@ HEADERS += \
ui/pages_logic/AppSettingsLogic.h \
ui/pages_logic/GeneralSettingsLogic.h \
ui/pages_logic/NetworkSettingsLogic.h \
ui/pages_logic/NewServerLogic.h \
ui/pages_logic/NewServerConfiguringLogic.h \
ui/pages_logic/NewServerProtocolsLogic.h \
ui/pages_logic/ProtocolSettingsLogic.h \
ui/pages_logic/ServerListLogic.h \
ui/pages_logic/ServerSettingsLogic.h \
@ -82,7 +83,8 @@ SOURCES += \
ui/pages_logic/AppSettingsLogic.cpp \
ui/pages_logic/GeneralSettingsLogic.cpp \
ui/pages_logic/NetworkSettingsLogic.cpp \
ui/pages_logic/NewServerLogic.cpp \
ui/pages_logic/NewServerConfiguringLogic.cpp \
ui/pages_logic/NewServerProtocolsLogic.cpp \
ui/pages_logic/ProtocolSettingsLogic.cpp \
ui/pages_logic/ServerListLogic.cpp \
ui/pages_logic/ServerSettingsLogic.cpp \

View file

@ -16,7 +16,7 @@
#include "ui/pages_logic/AppSettingsLogic.h"
#include "ui/pages_logic/GeneralSettingsLogic.h"
#include "ui/pages_logic/NetworkSettingsLogic.h"
#include "ui/pages_logic/NewServerLogic.h"
#include "ui/pages_logic/NewServerProtocolsLogic.h"
#include "ui/pages_logic/ProtocolSettingsLogic.h"
#include "ui/pages_logic/ServerListLogic.h"
#include "ui/pages_logic/ServerSettingsLogic.h"
@ -117,20 +117,6 @@ int main(int argc, char *argv[])
UiLogic *uiLogic = new UiLogic;
// AppSettingsLogic *appSettingsLogic = new AppSettingsLogic(uiLogic);
// GeneralSettingsLogic *generalSettingsLogic = new GeneralSettingsLogic(uiLogic);
// NetworkSettingsLogic *networkSettingsLogic = new NetworkSettingsLogic(uiLogic);
// NewServerLogic *newServerLogic = new NewServerLogic(uiLogic);
// ProtocolSettingsLogic *protocolSettingsLogic = new ProtocolSettingsLogic(uiLogic);
// ServerListLogic *serverListLogic = new ServerListLogic(uiLogic);
// ServerSettingsLogic *serverSettingsLogic = new ServerSettingsLogic(uiLogic);
// ServerVpnProtocolsLogic *serverVpnProtocolsLogic = new ServerVpnProtocolsLogic(uiLogic);
// ShareConnectionLogic *shareConnectionLogic = new ShareConnectionLogic(uiLogic);
// SitesLogic *sitesLogic = new SitesLogic(uiLogic);
// StartPageLogic *startPageLogic = new StartPageLogic(uiLogic);
// VpnLogic *vpnLogic = new VpnLogic(uiLogic);
// WizardLogic *wizardLogic = new WizardLogic(uiLogic);
QQmlApplicationEngine engine;
PageEnumNS::declareQML();
const QUrl url(QStringLiteral("qrc:/ui/qml/main.qml"));
@ -145,7 +131,7 @@ int main(int argc, char *argv[])
engine.rootContext()->setContextProperty("AppSettingsLogic", uiLogic->appSettingsLogic());
engine.rootContext()->setContextProperty("GeneralSettingsLogic", uiLogic->generalSettingsLogic());
engine.rootContext()->setContextProperty("NetworkSettingsLogic", uiLogic->networkSettingsLogic());
engine.rootContext()->setContextProperty("NewServerLogic", uiLogic->newServerLogic());
engine.rootContext()->setContextProperty("NewServerProtocolsLogic", uiLogic->newServerProtocolsLogic());
engine.rootContext()->setContextProperty("ProtocolSettingsLogic", uiLogic->protocolSettingsLogic());
engine.rootContext()->setContextProperty("ServerListLogic", uiLogic->serverListLogic());
engine.rootContext()->setContextProperty("ServerSettingsLogic", uiLogic->serverSettingsLogic());

View file

@ -71,7 +71,7 @@
<file>ui/qml/Pages/PageNetworkSetting.qml</file>
<file>ui/qml/Pages/PageNewServer.qml</file>
<file>ui/qml/Pages/PageNewServerConfiguring.qml</file>
<file>ui/qml/Pages/PageNewServerProtocol.qml</file>
<file>ui/qml/Pages/PageNewServerProtocols.qml</file>
<file>ui/qml/Pages/PageServerList.qml</file>
<file>ui/qml/Pages/PageServerProtocols.qml</file>
<file>ui/qml/Pages/PageServerSetting.qml</file>

View file

@ -0,0 +1,11 @@
#include "NewServerConfiguringLogic.h"
using namespace amnezia;
using namespace PageEnumNS;
NewServerConfiguringLogic::NewServerConfiguringLogic(UiLogic *uiLogic, QObject *parent):
QObject(parent),
m_uiLogic(uiLogic)
{
}

View file

@ -0,0 +1,44 @@
#ifndef NEW_SERVER_CONFIGURING_LOGIC_H
#define NEW_SERVER_CONFIGURING_LOGIC_H
#include "../pages.h"
#include "settings.h"
class UiLogic;
class NewServerConfiguringLogic : public QObject
{
Q_OBJECT
public:
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)
public:
explicit NewServerConfiguringLogic(UiLogic *uiLogic, QObject *parent = nullptr);
~NewServerConfiguringLogic() = default;
signals:
private:
private slots:
private:
Settings m_settings;
UiLogic *m_uiLogic;
};
#endif // NEW_SERVER_CONFIGURING_LOGIC_H

View file

@ -1,11 +0,0 @@
#include "NewServerLogic.h"
using namespace amnezia;
using namespace PageEnumNS;
NewServerLogic::NewServerLogic(UiLogic *uiLogic, QObject *parent):
QObject(parent),
m_uiLogic(uiLogic)
{
}

View file

@ -1,35 +0,0 @@
#ifndef NEW_SERVER_LOGIC_H
#define NEW_SERVER_LOGIC_H
#include "../pages.h"
#include "settings.h"
class UiLogic;
class NewServerLogic : public QObject
{
Q_OBJECT
public:
explicit NewServerLogic(UiLogic *uiLogic, QObject *parent = nullptr);
~NewServerLogic() = default;
signals:
private:
private slots:
private:
Settings m_settings;
UiLogic *m_uiLogic;
};
#endif // NEW_SERVER_LOGIC_H

View file

@ -0,0 +1,11 @@
#include "NewServerProtocolsLogic.h"
using namespace amnezia;
using namespace PageEnumNS;
NewServerProtocolsLogic::NewServerProtocolsLogic(UiLogic *uiLogic, QObject *parent):
QObject(parent),
m_uiLogic(uiLogic)
{
}

View file

@ -0,0 +1,51 @@
#ifndef NEW_SERVER_PROTOCOLS_LOGIC_H
#define NEW_SERVER_PROTOCOLS_LOGIC_H
#include "../pages.h"
#include "settings.h"
class UiLogic;
class NewServerProtocolsLogic : public QObject
{
Q_OBJECT
public:
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)
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)
public:
explicit NewServerProtocolsLogic(UiLogic *uiLogic, QObject *parent = nullptr);
~NewServerProtocolsLogic() = default;
signals:
private:
private slots:
private:
Settings m_settings;
UiLogic *m_uiLogic;
};
#endif // NEW_SERVER_PROTOCOLS_LOGIC_H

View file

@ -79,7 +79,7 @@ Window {
if (item instanceof PageNewServer) {
return PageEnum.NewServer
}
if (item instanceof PageNewServerProtocol) {
if (item instanceof PageNewServerProtocols) {
return PageEnum.NewServerProtocols
}
if (item instanceof PageSetupWizard) {
@ -288,7 +288,7 @@ Window {
}
Component {
id: page_new_server_protocols
PageNewServerProtocol {}
PageNewServerProtocols {}
}
Component {
id: page_vpn

View file

@ -47,7 +47,7 @@
#include "pages_logic/AppSettingsLogic.h"
#include "pages_logic/GeneralSettingsLogic.h"
#include "pages_logic/NetworkSettingsLogic.h"
#include "pages_logic/NewServerLogic.h"
#include "pages_logic/NewServerProtocolsLogic.h"
#include "pages_logic/ProtocolSettingsLogic.h"
#include "pages_logic/ServerListLogic.h"
#include "pages_logic/ServerSettingsLogic.h"
@ -153,7 +153,7 @@ UiLogic::UiLogic(QObject *parent) :
m_appSettingsLogic = new AppSettingsLogic(this);
m_generalSettingsLogic = new GeneralSettingsLogic(this);
m_networkSettingsLogic = new NetworkSettingsLogic(this);
m_newServerLogic = new NewServerLogic(this);
m_newServerProtocolsLogic = new NewServerProtocolsLogic(this);
m_protocolSettingsLogic = new ProtocolSettingsLogic(this);
m_serverListLogic = new ServerListLogic(this);
m_serverSettingsLogic = new ServerSettingsLogic(this);

View file

@ -13,7 +13,7 @@
class AppSettingsLogic;
class GeneralSettingsLogic;
class NetworkSettingsLogic;
class NewServerLogic;
class NewServerProtocolsLogic;
class ProtocolSettingsLogic;
class ServerListLogic;
class ServerSettingsLogic;
@ -36,26 +36,12 @@ class UiLogic : public QObject
Q_OBJECT
Q_PROPERTY(bool frameWireguardSettingsVisible READ getFrameWireguardSettingsVisible WRITE setFrameWireguardSettingsVisible NOTIFY frameWireguardSettingsVisibleChanged)
Q_PROPERTY(bool frameWireguardVisible READ getFrameWireguardVisible WRITE setFrameWireguardVisible NOTIFY frameWireguardVisibleChanged)
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)
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(int currentPageValue READ getCurrentPageValue WRITE setCurrentPageValue NOTIFY currentPageValueChanged)
Q_PROPERTY(QString trayIconUrl READ getTrayIconUrl WRITE setTrayIconUrl NOTIFY trayIconUrlChanged)
Q_PROPERTY(bool trayActionDisconnectEnabled READ getTrayActionDisconnectEnabled WRITE setTrayActionDisconnectEnabled NOTIFY trayActionDisconnectEnabledChanged)
Q_PROPERTY(bool trayActionConnectEnabled READ getTrayActionConnectEnabled WRITE setTrayActionConnectEnabled NOTIFY trayActionConnectEnabledChanged)
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(bool pushButtonConnectChecked READ getPushButtonConnectChecked WRITE setPushButtonConnectChecked NOTIFY pushButtonConnectCheckedChanged)
Q_PROPERTY(bool pushButtonProtoOpenvpnContInstallChecked READ getPushButtonProtoOpenvpnContInstallChecked WRITE setPushButtonProtoOpenvpnContInstallChecked NOTIFY pushButtonProtoOpenvpnContInstallCheckedChanged)
@ -89,13 +75,6 @@ class UiLogic : public QObject
Q_PROPERTY(bool widgetVpnModeEnabled READ getWidgetVpnModeEnabled WRITE setWidgetVpnModeEnabled NOTIFY widgetVpnModeEnabledChanged)
Q_PROPERTY(QString labelErrorText READ getLabelErrorText WRITE setLabelErrorText NOTIFY labelErrorTextChanged)
Q_PROPERTY(QString dialogConnectErrorText READ getDialogConnectErrorText WRITE setDialogConnectErrorText NOTIFY dialogConnectErrorTextChanged)
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)
Q_PROPERTY(bool pageServerProtocolsEnabled READ getPageServerProtocolsEnabled WRITE setPageServerProtocolsEnabled NOTIFY pageServerProtocolsEnabledChanged)
Q_PROPERTY(int progressBarProtocolsContainerReinstallValue READ getProgressBarProtocolsContainerReinstallValue WRITE setProgressBarProtocolsContainerReinstallValue NOTIFY progressBarProtocolsContainerReinstallValueChanged)
Q_PROPERTY(int progressBarProtocolsContainerReinstallMaximium READ getProgressBarProtocolsContainerReinstallMaximium WRITE setProgressBarProtocolsContainerReinstallMaximium NOTIFY progressBarProtocolsContainerReinstallMaximiumChanged)
@ -115,7 +94,7 @@ public:
friend class AppSettingsLogic;
friend class GeneralSettingsLogic;
friend class NetworkSettingsLogic;
friend class NewServerLogic;
friend class NewServerProtocolsLogic;
friend class ProtocolSettingsLogic;
friend class ServerListLogic;
friend class ServerSettingsLogic;
@ -559,7 +538,7 @@ public:
AppSettingsLogic *appSettingsLogic() { return m_appSettingsLogic; }
GeneralSettingsLogic *generalSettingsLogic() { return m_generalSettingsLogic; }
NetworkSettingsLogic *networkSettingsLogic() { return m_networkSettingsLogic; }
NewServerLogic *newServerLogic() { return m_newServerLogic; }
NewServerProtocolsLogic *newServerProtocolsLogic() { return m_newServerProtocolsLogic; }
ProtocolSettingsLogic *protocolSettingsLogic() { return m_protocolSettingsLogic; }
ServerListLogic *serverListLogic() { return m_serverListLogic; }
ServerSettingsLogic *serverSettingsLogic() { return m_serverSettingsLogic; }
@ -578,7 +557,7 @@ private:
AppSettingsLogic *m_appSettingsLogic;
GeneralSettingsLogic *m_generalSettingsLogic;
NetworkSettingsLogic *m_networkSettingsLogic;
NewServerLogic *m_newServerLogic;
NewServerProtocolsLogic *m_newServerProtocolsLogic;
ProtocolSettingsLogic *m_protocolSettingsLogic;
ServerListLogic *m_serverListLogic;
ServerSettingsLogic *m_serverSettingsLogic;