App refactoring finished
This commit is contained in:
parent
510a564797
commit
3ce1ec708d
46 changed files with 362 additions and 247 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#include "NetworkSettingsLogic.h"
|
||||
|
||||
#include "defines.h"
|
||||
#include "settings.h"
|
||||
#include "utils.h"
|
||||
|
||||
NetworkSettingsLogic::NetworkSettingsLogic(UiLogic *logic, QObject *parent):
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define NEW_SERVER_PROTOCOLS_LOGIC_H
|
||||
|
||||
#include "PageLogicBase.h"
|
||||
#include "containers/containers_defs.h"
|
||||
|
||||
class UiLogic;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,8 @@
|
|||
#include "PageLogicBase.h"
|
||||
#include "ui/uilogic.h"
|
||||
|
||||
#include "ui/uilogic.h"
|
||||
#include "settings.h"
|
||||
#include "configurators/vpn_configurator.h"
|
||||
|
||||
PageLogicBase::PageLogicBase(UiLogic *logic, QObject *parent):
|
||||
QObject(parent),
|
||||
|
|
@ -8,6 +10,8 @@ PageLogicBase::PageLogicBase(UiLogic *logic, QObject *parent):
|
|||
m_uiLogic(logic)
|
||||
{
|
||||
m_settings = logic->m_settings;
|
||||
m_configurator = logic->m_configurator;
|
||||
m_serverController = logic->m_serverController;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,15 @@
|
|||
#ifndef PAGE_LOGIC_BASE_H
|
||||
#define PAGE_LOGIC_BASE_H
|
||||
|
||||
#include "settings.h"
|
||||
#include "../pages.h"
|
||||
#include "../property_helper.h"
|
||||
|
||||
using namespace amnezia;
|
||||
using namespace PageEnumNS;
|
||||
|
||||
class UiLogic;
|
||||
class Settings;
|
||||
class VpnConfigurator;
|
||||
class ServerController;
|
||||
|
||||
class PageLogicBase : public QObject
|
||||
{
|
||||
|
|
@ -22,10 +23,12 @@ public:
|
|||
Q_INVOKABLE virtual void onUpdatePage() {}
|
||||
|
||||
protected:
|
||||
UiLogic *uiLogic() const { return m_uiLogic; }
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
|
||||
UiLogic *m_uiLogic;
|
||||
UiLogic *uiLogic() const { return m_uiLogic; }
|
||||
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
std::shared_ptr<VpnConfigurator> m_configurator;
|
||||
std::shared_ptr<ServerController> m_serverController;
|
||||
|
||||
signals:
|
||||
void updatePage();
|
||||
|
|
|
|||
|
|
@ -3,6 +3,9 @@
|
|||
|
||||
#include <functional>
|
||||
#include "PageLogicBase.h"
|
||||
#include "core/defs.h"
|
||||
|
||||
using namespace amnezia;
|
||||
|
||||
class UiLogic;
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ void ServerContainersLogic::onPushButtonShareClicked(DockerContainer c)
|
|||
void ServerContainersLogic::onPushButtonRemoveClicked(DockerContainer container)
|
||||
{
|
||||
//buttonSetEnabledFunc(false);
|
||||
ErrorCode e = ServerController::removeContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), container);
|
||||
ErrorCode e = m_serverController->removeContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), container);
|
||||
m_settings->removeContainerConfig(uiLogic()->selectedServerIndex, container);
|
||||
//buttonSetEnabledFunc(true);
|
||||
|
||||
|
|
@ -81,13 +81,13 @@ void ServerContainersLogic::onPushButtonRemoveClicked(DockerContainer container)
|
|||
|
||||
void ServerContainersLogic::onPushButtonContinueClicked(DockerContainer c, int port, TransportProto tp)
|
||||
{
|
||||
QJsonObject config = ServerController::createContainerInitialConfig(c, port, tp);
|
||||
QJsonObject config = m_serverController->createContainerInitialConfig(c, port, tp);
|
||||
|
||||
emit uiLogic()->goToPage(Page::ServerConfiguringProgress);
|
||||
qApp->processEvents();
|
||||
|
||||
ErrorCode e = uiLogic()->serverConfiguringProgressLogic()->doInstallAction([this, c, &config](){
|
||||
return ServerController::setupContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), c, config);
|
||||
return m_serverController->setupContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), c, config);
|
||||
});
|
||||
|
||||
if (!e) {
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define SERVER_CONTAINERS_LOGIC_H
|
||||
|
||||
#include "PageLogicBase.h"
|
||||
#include "containers/containers_defs.h"
|
||||
|
||||
class UiLogic;
|
||||
|
||||
|
|
|
|||
|
|
@ -52,10 +52,10 @@ void ServerSettingsLogic::onPushButtonClearServer()
|
|||
uiLogic()->vpnLogic()->onDisconnect();
|
||||
}
|
||||
|
||||
ErrorCode e = ServerController::removeAllContainers(m_settings->serverCredentials(uiLogic()->selectedServerIndex));
|
||||
ServerController::disconnectFromHost(m_settings->serverCredentials(uiLogic()->selectedServerIndex));
|
||||
ErrorCode e = m_serverController->removeAllContainers(m_settings->serverCredentials(uiLogic()->selectedServerIndex));
|
||||
m_serverController->disconnectFromHost(m_settings->serverCredentials(uiLogic()->selectedServerIndex));
|
||||
if (e) {
|
||||
uiLogic()->setDialogConnectErrorText(
|
||||
uiLogic()->set_dialogConnectErrorText(
|
||||
tr("Error occurred while configuring server.") + "\n" +
|
||||
errorString(e) + "\n" +
|
||||
tr("See logs for details."));
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@
|
|||
#include "defines.h"
|
||||
#include "core/defs.h"
|
||||
#include "core/errorstrings.h"
|
||||
#include "core/servercontroller.h"
|
||||
#include <functional>
|
||||
|
||||
#include "../uilogic.h"
|
||||
|
|
@ -85,7 +86,7 @@ void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
|||
for (Proto p: ContainerProps::protocolsForContainer(container)) {
|
||||
QJsonObject protoConfig = m_settings->protocolConfig(serverIndex, container, p);
|
||||
|
||||
QString cfg = VpnConfigurator::genVpnProtocolConfig(credentials, container, containerConfig, p, &e);
|
||||
QString cfg = m_configurator->genVpnProtocolConfig(credentials, container, containerConfig, p, &e);
|
||||
if (e) {
|
||||
cfg = "Error generating config";
|
||||
break;
|
||||
|
|
@ -103,7 +104,7 @@ void ShareConnectionLogic::onPushButtonShareAmneziaGenerateClicked()
|
|||
serverConfig.insert(config_key::containers, QJsonArray {containerConfig});
|
||||
serverConfig.insert(config_key::defaultContainer, ContainerProps::containerToString(container));
|
||||
|
||||
auto dns = VpnConfigurator::getDnsForConfig(serverIndex);
|
||||
auto dns = m_configurator->getDnsForConfig(serverIndex);
|
||||
serverConfig.insert(config_key::dns1, dns.first);
|
||||
serverConfig.insert(config_key::dns2, dns.second);
|
||||
|
||||
|
|
@ -134,8 +135,8 @@ void ShareConnectionLogic::onPushButtonShareOpenVpnGenerateClicked()
|
|||
const QJsonObject &containerConfig = m_settings->containerConfig(serverIndex, container);
|
||||
|
||||
ErrorCode e = ErrorCode::NoError;
|
||||
QString cfg = OpenVpnConfigurator::genOpenVpnConfig(credentials, container, containerConfig, &e);
|
||||
cfg = VpnConfigurator::processConfigWithExportSettings(serverIndex, container, Proto::OpenVpn, cfg);
|
||||
QString cfg = m_configurator->openVpnConfigurator->genOpenVpnConfig(credentials, container, containerConfig, &e);
|
||||
cfg = m_configurator->processConfigWithExportSettings(serverIndex, container, Proto::OpenVpn, cfg);
|
||||
|
||||
set_textEditShareOpenVpnCodeText(QJsonDocument::fromJson(cfg.toUtf8()).object()[config_key::config].toString());
|
||||
}
|
||||
|
|
@ -153,7 +154,7 @@ void ShareConnectionLogic::onPushButtonShareShadowSocksGenerateClicked()
|
|||
const QJsonObject &containerConfig = m_settings->containerConfig(serverIndex, container);
|
||||
|
||||
ErrorCode e = ErrorCode::NoError;
|
||||
cfg = ShadowSocksConfigurator::genShadowSocksConfig(credentials, container, containerConfig, &e);
|
||||
cfg = m_configurator->shadowSocksConfigurator->genShadowSocksConfig(credentials, container, containerConfig, &e);
|
||||
}
|
||||
|
||||
QJsonObject ssConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
||||
|
|
@ -195,7 +196,7 @@ void ShareConnectionLogic::onPushButtonShareCloakGenerateClicked()
|
|||
const QJsonObject &containerConfig = m_settings->containerConfig(serverIndex, container);
|
||||
|
||||
ErrorCode e = ErrorCode::NoError;
|
||||
cfg = CloakConfigurator::genCloakConfig(credentials, container, containerConfig, &e);
|
||||
cfg = m_configurator->cloakConfigurator->genCloakConfig(credentials, container, containerConfig, &e);
|
||||
}
|
||||
|
||||
QJsonObject cloakConfig = QJsonDocument::fromJson(cfg.toUtf8()).object();
|
||||
|
|
@ -214,14 +215,14 @@ void ShareConnectionLogic::onPushButtonShareWireGuardGenerateClicked()
|
|||
const QJsonObject &containerConfig = m_settings->containerConfig(serverIndex, container);
|
||||
|
||||
ErrorCode e = ErrorCode::NoError;
|
||||
QString cfg = WireguardConfigurator::genWireguardConfig(credentials, container, containerConfig, &e);
|
||||
QString cfg = m_configurator->wireguardConfigurator->genWireguardConfig(credentials, container, containerConfig, &e);
|
||||
if (e) {
|
||||
QMessageBox::warning(nullptr, APPLICATION_NAME,
|
||||
tr("Error occurred while configuring server.") + "\n" +
|
||||
errorString(e));
|
||||
return;
|
||||
}
|
||||
cfg = VpnConfigurator::processConfigWithExportSettings(serverIndex, container, Proto::WireGuard, cfg);
|
||||
cfg = m_configurator->processConfigWithExportSettings(serverIndex, container, Proto::WireGuard, cfg);
|
||||
cfg = QJsonDocument::fromJson(cfg.toUtf8()).object()[config_key::config].toString();
|
||||
|
||||
set_textEditShareWireGuardCodeText(cfg);
|
||||
|
|
@ -239,18 +240,18 @@ void ShareConnectionLogic::onPushButtonShareIkev2GenerateClicked()
|
|||
|
||||
//const QJsonObject &containerConfig = m_settings->containerConfig(serverIndex, container);
|
||||
|
||||
Ikev2Configurator::ConnectionData connData = Ikev2Configurator::prepareIkev2Config(credentials, container);
|
||||
Ikev2Configurator::ConnectionData connData = m_configurator->ikev2Configurator->prepareIkev2Config(credentials, container);
|
||||
|
||||
QString cfg = Ikev2Configurator::genIkev2Config(connData);
|
||||
cfg = VpnConfigurator::processConfigWithExportSettings(serverIndex, container, Proto::Ikev2, cfg);
|
||||
QString cfg = m_configurator->ikev2Configurator->genIkev2Config(connData);
|
||||
cfg = m_configurator->processConfigWithExportSettings(serverIndex, container, Proto::Ikev2, cfg);
|
||||
cfg = QJsonDocument::fromJson(cfg.toUtf8()).object()[config_key::cert].toString();
|
||||
|
||||
set_textEditShareIkev2CertText(cfg);
|
||||
|
||||
QString mobileCfg = Ikev2Configurator::genMobileConfig(connData);
|
||||
QString mobileCfg = m_configurator->ikev2Configurator->genMobileConfig(connData);
|
||||
set_textEditShareIkev2MobileConfigText(mobileCfg);
|
||||
|
||||
QString strongSwanCfg = Ikev2Configurator::genStrongSwanConfig(connData);
|
||||
QString strongSwanCfg = m_configurator->ikev2Configurator->genStrongSwanConfig(connData);
|
||||
set_textEditShareIkev2StrongSwanConfigText(strongSwanCfg);
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define SHARE_CONNECTION_LOGIC_H
|
||||
|
||||
#include "PageLogicBase.h"
|
||||
#include "containers/containers_defs.h"
|
||||
|
||||
class UiLogic;
|
||||
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define SITES_LOGIC_H
|
||||
|
||||
#include "PageLogicBase.h"
|
||||
#include "settings.h"
|
||||
|
||||
class UiLogic;
|
||||
class SitesModel;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#include "StartPageLogic.h"
|
||||
#include "core/errorstrings.h"
|
||||
#include "configurators/ssh_configurator.h"
|
||||
#include "configurators/vpn_configurator.h"
|
||||
#include "../uilogic.h"
|
||||
#include "utils.h"
|
||||
|
||||
|
|
@ -83,7 +84,7 @@ void StartPageLogic::onPushButtonConnect()
|
|||
}
|
||||
|
||||
if (key.contains("OPENSSH") && key.contains("BEGIN") && key.contains("PRIVATE KEY")) {
|
||||
key = SshConfigurator::convertOpenSShKey(key);
|
||||
key = m_configurator->sshConfigurator->convertOpenSShKey(key);
|
||||
}
|
||||
|
||||
serverCredentials.password = key;
|
||||
|
|
@ -97,7 +98,7 @@ void StartPageLogic::onPushButtonConnect()
|
|||
|
||||
ErrorCode e = ErrorCode::NoError;
|
||||
#ifdef Q_DEBUG
|
||||
//QString output = ServerController::checkSshConnection(serverCredentials, &e);
|
||||
//QString output = m_serverController->checkSshConnection(serverCredentials, &e);
|
||||
#else
|
||||
QString output;
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ void VpnLogic::onUpdatePage()
|
|||
QString selectedContainerName = ContainerProps::containerHumanNames().value(selectedContainer);
|
||||
set_labelCurrentService(selectedContainerName);
|
||||
|
||||
auto dns = VpnConfigurator::getDnsForConfig(m_settings->defaultServerIndex());
|
||||
auto dns = m_configurator->getDnsForConfig(m_settings->defaultServerIndex());
|
||||
set_amneziaDnsEnabled(dns.first == protocols::dns::amneziaDnsIp);
|
||||
if (dns.first == protocols::dns::amneziaDnsIp) {
|
||||
set_labelCurrentDns("On your server");
|
||||
|
|
@ -233,14 +233,6 @@ void VpnLogic::onConnectWorker(int serverIndex, const ServerCredentials &credent
|
|||
qApp->processEvents();
|
||||
|
||||
emit connectToVpn(serverIndex, credentials, container, containerConfig);
|
||||
|
||||
// if (errorCode) {
|
||||
// //ui->pushButton_connect->setChecked(false);
|
||||
// uiLogic()->setDialogConnectErrorText(errorString(errorCode));
|
||||
// emit uiLogic()->showConnectErrorDialog();
|
||||
// return;
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
void VpnLogic::onDisconnect()
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
#define WIZARD_LOGIC_H
|
||||
|
||||
#include "PageLogicBase.h"
|
||||
#include "containers/containers_defs.h"
|
||||
|
||||
class UiLogic;
|
||||
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ void CloakLogic::onPushButtonSaveClicked()
|
|||
};
|
||||
|
||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, &newContainerConfig](){
|
||||
return ServerController::updateContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer, containerConfig, newContainerConfig);
|
||||
return m_serverController->updateContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer, containerConfig, newContainerConfig);
|
||||
},
|
||||
page_func, progressBar_reset,
|
||||
pushButton_save_func, label_info_func);
|
||||
|
|
|
|||
|
|
@ -118,7 +118,7 @@ void OpenVpnLogic::onPushButtonProtoOpenVpnSaveClicked()
|
|||
};
|
||||
|
||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, &newContainerConfig](){
|
||||
return ServerController::updateContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer, containerConfig, newContainerConfig);
|
||||
return m_serverController->updateContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer, containerConfig, newContainerConfig);
|
||||
},
|
||||
page_proto_openvpn, progressBar_proto_openvpn_reset,
|
||||
pushButton_proto_openvpn_save, label_proto_openvpn_info);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,6 @@
|
|||
#include <QStandardPaths>
|
||||
|
||||
#include "OtherProtocolsLogic.h"
|
||||
#include "core/servercontroller.h"
|
||||
#include <functional>
|
||||
#include "../../uilogic.h"
|
||||
#include "utils.h"
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ void ShadowSocksLogic::onPushButtonSaveClicked()
|
|||
};
|
||||
|
||||
ErrorCode e = uiLogic()->doInstallAction([this, containerConfig, &newContainerConfig](){
|
||||
return ServerController::updateContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer, containerConfig, newContainerConfig);
|
||||
return m_serverController->updateContainer(m_settings->serverCredentials(uiLogic()->selectedServerIndex), uiLogic()->selectedDockerContainer, containerConfig, newContainerConfig);
|
||||
},
|
||||
page_proto_shadowsocks, progressBar_reset,
|
||||
pushButton_proto_shadowsocks_save, label_proto_shadowsocks_info);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
} \
|
||||
Q_SIGNAL void NAME ## Changed(TYPE value);\
|
||||
private: \
|
||||
TYPE m_ ## NAME;
|
||||
TYPE m_ ## NAME{};
|
||||
|
||||
#define READONLY_PROPERTY(TYPE, NAME) \
|
||||
Q_PROPERTY(TYPE NAME READ NAME CONSTANT ) \
|
||||
|
|
@ -22,6 +22,6 @@
|
|||
TYPE NAME() const { return m_ ## NAME ; } \
|
||||
private: \
|
||||
void NAME(TYPE value) {m_ ## NAME = value; } \
|
||||
TYPE m_ ## NAME;
|
||||
TYPE m_ ## NAME{};
|
||||
|
||||
#endif // PROPERTY_HELPER_H
|
||||
|
|
|
|||
|
|
@ -74,14 +74,17 @@
|
|||
using namespace amnezia;
|
||||
using namespace PageEnumNS;
|
||||
|
||||
UiLogic::UiLogic(std::shared_ptr<Settings> settings, QObject *parent) :
|
||||
UiLogic::UiLogic(std::shared_ptr<Settings> settings, std::shared_ptr<VpnConfigurator> configurator,
|
||||
std::shared_ptr<ServerController> serverController,
|
||||
QObject *parent) :
|
||||
QObject(parent),
|
||||
m_settings(settings),
|
||||
m_dialogConnectErrorText{}
|
||||
m_configurator(configurator),
|
||||
m_serverController(serverController)
|
||||
{
|
||||
m_containersModel = new ContainersModel(settings, this);
|
||||
m_protocolsModel = new ProtocolsModel(settings, this);
|
||||
m_vpnConnection = new VpnConnection(settings);
|
||||
m_vpnConnection = new VpnConnection(settings, configurator, serverController);
|
||||
m_vpnConnection->moveToThread(&m_vpnConnectionThread);
|
||||
m_vpnConnectionThread.start();
|
||||
|
||||
|
|
@ -173,19 +176,6 @@ void UiLogic::initalizeUiLogic()
|
|||
qInfo().noquote() << QString("%1 (%2)").arg(QSysInfo::prettyProductName()).arg(QSysInfo::currentCpuArchitecture());
|
||||
}
|
||||
|
||||
QString UiLogic::getDialogConnectErrorText() const
|
||||
{
|
||||
return m_dialogConnectErrorText;
|
||||
}
|
||||
|
||||
void UiLogic::setDialogConnectErrorText(const QString &dialogConnectErrorText)
|
||||
{
|
||||
if (m_dialogConnectErrorText != dialogConnectErrorText) {
|
||||
m_dialogConnectErrorText = dialogConnectErrorText;
|
||||
emit dialogConnectErrorTextChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void UiLogic::showOnStartup()
|
||||
{
|
||||
if (! m_settings->isStartMinimized()) {
|
||||
|
|
@ -259,7 +249,7 @@ void UiLogic::keyPressEvent(Qt::Key key)
|
|||
onGotoCurrentProtocolsPage();
|
||||
break;
|
||||
case Qt::Key_T:
|
||||
SshConfigurator::openSshTerminal(m_settings->serverCredentials(m_settings->defaultServerIndex()));
|
||||
m_configurator->sshConfigurator->openSshTerminal(m_settings->serverCredentials(m_settings->defaultServerIndex()));
|
||||
break;
|
||||
case Qt::Key_Escape:
|
||||
case Qt::Key_Back:
|
||||
|
|
@ -443,9 +433,9 @@ bool UiLogic::installContainers(ServerCredentials credentials,
|
|||
progress.setTextVisibleFunc(true);
|
||||
progress.setTextFunc(QString("Installing %1 %2 %3").arg(cnt+1).arg(tr("of")).arg(containers.size()));
|
||||
|
||||
ErrorCode e = ServerController::setupContainer(credentials, i.key(), i.value());
|
||||
ErrorCode e = m_serverController->setupContainer(credentials, i.key(), i.value());
|
||||
qDebug() << "Setup server finished with code" << e;
|
||||
ServerController::disconnectFromHost(credentials);
|
||||
m_serverController->disconnectFromHost(credentials);
|
||||
|
||||
if (e) {
|
||||
if (page.setEnabledFunc) {
|
||||
|
|
|
|||
|
|
@ -16,7 +16,10 @@
|
|||
#include "models/protocols_model.h"
|
||||
|
||||
#include "notificationhandler.h"
|
||||
#include "settings.h"
|
||||
|
||||
class Settings;
|
||||
class VpnConfigurator;
|
||||
class ServerController;
|
||||
|
||||
class AppSettingsLogic;
|
||||
class GeneralSettingsLogic;
|
||||
|
|
@ -50,15 +53,14 @@ class UiLogic : public QObject
|
|||
AUTO_PROPERTY(bool, pageEnabled)
|
||||
AUTO_PROPERTY(int, pagesStackDepth)
|
||||
AUTO_PROPERTY(int, currentPageValue)
|
||||
AUTO_PROPERTY(QString, dialogConnectErrorText)
|
||||
|
||||
READONLY_PROPERTY(QObject *, containersModel)
|
||||
READONLY_PROPERTY(QObject *, protocolsModel)
|
||||
|
||||
// TODO: review
|
||||
Q_PROPERTY(QString dialogConnectErrorText READ getDialogConnectErrorText WRITE setDialogConnectErrorText NOTIFY dialogConnectErrorTextChanged)
|
||||
|
||||
public:
|
||||
explicit UiLogic(std::shared_ptr<Settings> settings, QObject *parent = nullptr);
|
||||
explicit UiLogic(std::shared_ptr<Settings> settings, std::shared_ptr<VpnConfigurator> configurator,
|
||||
std::shared_ptr<ServerController> serverController, QObject *parent = nullptr);
|
||||
~UiLogic();
|
||||
void showOnStartup();
|
||||
|
||||
|
|
@ -108,9 +110,6 @@ public:
|
|||
|
||||
void shareTempFile(const QString &suggestedName, QString ext, const QString& data);
|
||||
|
||||
QString getDialogConnectErrorText() const;
|
||||
void setDialogConnectErrorText(const QString &dialogConnectErrorText);
|
||||
|
||||
signals:
|
||||
void dialogConnectErrorTextChanged();
|
||||
|
||||
|
|
@ -127,9 +126,6 @@ signals:
|
|||
void raise();
|
||||
void toggleLogPanel();
|
||||
|
||||
private:
|
||||
QString m_dialogConnectErrorText;
|
||||
|
||||
private slots:
|
||||
// containers - INOUT arg
|
||||
void installServer(QMap<DockerContainer, QJsonObject> &containers);
|
||||
|
|
@ -214,7 +210,10 @@ private:
|
|||
|
||||
VpnConnection* m_vpnConnection;
|
||||
QThread m_vpnConnectionThread;
|
||||
|
||||
std::shared_ptr<Settings> m_settings;
|
||||
std::shared_ptr<VpnConfigurator> m_configurator;
|
||||
std::shared_ptr<ServerController> m_serverController;
|
||||
|
||||
NotificationHandler* m_notificationHandler;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue