added a button to scan the server for already installed containers

- refactoring of old code, redundant sections of code removed
This commit is contained in:
vladimir.kuznetsov 2023-02-25 17:59:22 +03:00
parent 480b2181f0
commit 2580475f67
12 changed files with 136 additions and 98 deletions

View file

@ -32,7 +32,6 @@ enum ErrorCode
ServerContainerMissingError, ServerContainerMissingError,
ServerDockerFailedError, ServerDockerFailedError,
ServerCancelInstallation, ServerCancelInstallation,
ServerContainerAlreadyInstalledError,
// Ssh connection errors // Ssh connection errors
SshSocketError, SshTimeoutError, SshProtocolError, SshSocketError, SshTimeoutError, SshProtocolError,

View file

@ -16,7 +16,6 @@ QString errorString(ErrorCode code){
case(ServerContainerMissingError): return QObject::tr("Server error: Docker container missing"); case(ServerContainerMissingError): return QObject::tr("Server error: Docker container missing");
case(ServerDockerFailedError): return QObject::tr("Server error: Docker failed"); case(ServerDockerFailedError): return QObject::tr("Server error: Docker failed");
case(ServerCancelInstallation): return QObject::tr("Installation canceled by user"); case(ServerCancelInstallation): return QObject::tr("Installation canceled by user");
case(ServerContainerAlreadyInstalledError): return QObject::tr("Container already installed");
// Ssh connection errors // Ssh connection errors
case(SshSocketError): return QObject::tr("Ssh connection error"); case(SshSocketError): return QObject::tr("Ssh connection error");

View file

@ -879,7 +879,7 @@ ErrorCode ServerController::getAlreadyInstalledContainers(const ServerCredential
if (containerInfo.isEmpty()) { if (containerInfo.isEmpty()) {
continue; continue;
} }
const static QRegularExpression containerAndPortRegExp("(amnezia-[a-z]*).*?>([0-9]*)/(udp|tcp).*"); const static QRegularExpression containerAndPortRegExp("(amnezia[-a-z]*).*?>([0-9]*)/(udp|tcp).*");
QRegularExpressionMatch containerAndPortMatch = containerAndPortRegExp.match(containerInfo); QRegularExpressionMatch containerAndPortMatch = containerAndPortRegExp.match(containerInfo);
if (containerAndPortMatch.hasMatch()) { if (containerAndPortMatch.hasMatch()) {
QString name = containerAndPortMatch.captured(1); QString name = containerAndPortMatch.captured(1);
@ -890,8 +890,8 @@ ErrorCode ServerController::getAlreadyInstalledContainers(const ServerCredential
QJsonObject config { QJsonObject config {
{ config_key::container, name }, { config_key::container, name },
{ ProtocolProps::protoToString(mainProto), QJsonObject { { ProtocolProps::protoToString(mainProto), QJsonObject {
{ config_key::port, port }, { config_key::port, port },
{ config_key::transport_proto, transportProto }} { config_key::transport_proto, transportProto }}
} }
}; };
installedContainers.insert(container, config); installedContainers.insert(container, config);

View file

@ -35,7 +35,7 @@ void AdvancedServerSettingsLogic::onUpdatePage()
set_labelCurrentVpnProtocolText(tr("Service: ") + selectedContainerName); set_labelCurrentVpnProtocolText(tr("Service: ") + selectedContainerName);
} }
void AdvancedServerSettingsLogic::onPushButtonClearServer() void AdvancedServerSettingsLogic::onPushButtonClearServerClicked()
{ {
set_pageEnabled(false); set_pageEnabled(false);
set_pushButtonClearText(tr("Uninstalling Amnezia software...")); set_pushButtonClearText(tr("Uninstalling Amnezia software..."));
@ -47,7 +47,7 @@ void AdvancedServerSettingsLogic::onPushButtonClearServer()
ErrorCode e = m_serverController->removeAllContainers(m_settings->serverCredentials(uiLogic()->m_selectedServerIndex)); ErrorCode e = m_serverController->removeAllContainers(m_settings->serverCredentials(uiLogic()->m_selectedServerIndex));
m_serverController->disconnectFromHost(m_settings->serverCredentials(uiLogic()->m_selectedServerIndex)); m_serverController->disconnectFromHost(m_settings->serverCredentials(uiLogic()->m_selectedServerIndex));
if (e) { if (e) {
emit uiLogic()->showWarningMessage(tr("Error occurred while configuring server.") + "\n" + emit uiLogic()->showWarningMessage(tr("Error occurred while cleaning the server.") + "\n" +
tr("Error message: ") + errorString(e) + "\n" + tr("Error message: ") + errorString(e) + "\n" +
tr("See logs for details.")); tr("See logs for details."));
} else { } else {
@ -61,3 +61,28 @@ void AdvancedServerSettingsLogic::onPushButtonClearServer()
set_pageEnabled(true); set_pageEnabled(true);
set_pushButtonClearText(tr("Clear server from Amnezia software")); set_pushButtonClearText(tr("Clear server from Amnezia software"));
} }
void AdvancedServerSettingsLogic::onPushButtonScanServerClicked()
{
set_labelWaitInfoVisible(false);
set_pageEnabled(false);
bool isServerCreated;
auto containersCount = m_settings->containers(uiLogic()->m_selectedServerIndex).size();
ErrorCode errorCode = uiLogic()->addAlreadyInstalledContainersGui(false, isServerCreated);
if (errorCode != ErrorCode::NoError) {
emit uiLogic()->showWarningMessage(tr("Error occurred while scanning the server.") + "\n" +
tr("Error message: ") + errorString(errorCode) + "\n" +
tr("See logs for details."));
}
auto newContainersCount = m_settings->containers(uiLogic()->m_selectedServerIndex).size();
if (containersCount != newContainersCount) {
emit uiLogic()->showWarningMessage(tr("All containers installed on the server are added to the GUI"));
} else {
emit uiLogic()->showWarningMessage(tr("No installed containers found on the server"));
}
onUpdatePage();
set_pageEnabled(true);
}

View file

@ -24,7 +24,8 @@ public:
Q_INVOKABLE void onUpdatePage() override; Q_INVOKABLE void onUpdatePage() override;
Q_INVOKABLE void onPushButtonClearServer(); Q_INVOKABLE void onPushButtonClearServerClicked();
Q_INVOKABLE void onPushButtonScanServerClicked();
}; };
#endif // ADVANCEDSERVERSETTINGSLOGIC_H #endif // ADVANCEDSERVERSETTINGSLOGIC_H

View file

@ -17,7 +17,6 @@ void NewServerProtocolsLogic::onUpdatePage()
void NewServerProtocolsLogic::onPushButtonConfigureClicked(DockerContainer c, int port, TransportProto tp) void NewServerProtocolsLogic::onPushButtonConfigureClicked(DockerContainer c, int port, TransportProto tp)
{ {
QMap<DockerContainer, QJsonObject> containers;
Proto mainProto = ContainerProps::defaultProtocol(c); Proto mainProto = ContainerProps::defaultProtocol(c);
QJsonObject config { QJsonObject config {
@ -28,8 +27,8 @@ void NewServerProtocolsLogic::onPushButtonConfigureClicked(DockerContainer c, in
} }
}; };
containers.insert(c, config); QPair<DockerContainer, QJsonObject> container(c, config);
uiLogic()->installServer(containers); uiLogic()->installServer(container);
} }

View file

@ -88,11 +88,11 @@ void ServerContainersLogic::onPushButtonContinueClicked(DockerContainer c, int p
emit uiLogic()->goToPage(Page::ServerConfiguringProgress); emit uiLogic()->goToPage(Page::ServerConfiguringProgress);
qApp->processEvents(); qApp->processEvents();
ServerCredentials credentials = m_settings->serverCredentials(uiLogic()->m_selectedServerIndex); bool isServerCreated = false;
ErrorCode errorCode = uiLogic()->addAlreadyInstalledContainersGui(false, credentials); ErrorCode errorCode = uiLogic()->addAlreadyInstalledContainersGui(false, isServerCreated);
if (errorCode == ErrorCode::NoError) { if (errorCode == ErrorCode::NoError) {
if (!uiLogic()->isContainerAlreadyAddedToGui(c, credentials)) { if (!uiLogic()->isContainerAlreadyAddedToGui(c)) {
auto installAction = [this, c, &config]() { auto installAction = [this, c, &config]() {
return m_serverController->setupContainer(m_settings->serverCredentials(uiLogic()->m_selectedServerIndex), c, config); return m_serverController->setupContainer(m_settings->serverCredentials(uiLogic()->m_selectedServerIndex), c, config);
}; };

View file

@ -18,7 +18,7 @@ void WizardLogic::onUpdatePage()
set_radioButtonMediumChecked(true); set_radioButtonMediumChecked(true);
} }
QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage() const QPair<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage() const
{ {
QJsonObject cloakConfig { QJsonObject cloakConfig {
{ config_key::container, ContainerProps::containerToString(DockerContainer::Cloak) }, { config_key::container, ContainerProps::containerToString(DockerContainer::Cloak) },
@ -33,27 +33,29 @@ QMap<DockerContainer, QJsonObject> WizardLogic::getInstallConfigsFromWizardPage(
{ config_key::container, ContainerProps::containerToString(DockerContainer::OpenVpn) } { config_key::container, ContainerProps::containerToString(DockerContainer::OpenVpn) }
}; };
QMap<DockerContainer, QJsonObject> containers; QPair<DockerContainer, QJsonObject> container;
DockerContainer dockerContainer;
if (radioButtonHighChecked()) { if (radioButtonHighChecked()) {
containers.insert(DockerContainer::Cloak, cloakConfig); container = {DockerContainer::Cloak, cloakConfig};
} }
if (radioButtonMediumChecked()) { if (radioButtonMediumChecked()) {
containers.insert(DockerContainer::ShadowSocks, ssConfig); container = {DockerContainer::ShadowSocks, ssConfig};
} }
if (radioButtonLowChecked()) { if (radioButtonLowChecked()) {
containers.insert(DockerContainer::OpenVpn, openVpnConfig); container = {DockerContainer::OpenVpn, openVpnConfig};
} }
return containers; return container;
} }
void WizardLogic::onPushButtonVpnModeFinishClicked() void WizardLogic::onPushButtonVpnModeFinishClicked()
{ {
auto containers = getInstallConfigsFromWizardPage(); auto container = getInstallConfigsFromWizardPage();
uiLogic()->installServer(containers); uiLogic()->installServer(container);
if (checkBoxVpnModeChecked()) { if (checkBoxVpnModeChecked()) {
m_settings->setRouteMode(Settings::VpnOnlyForwardSites); m_settings->setRouteMode(Settings::VpnOnlyForwardSites);
} else { } else {
@ -63,6 +65,6 @@ void WizardLogic::onPushButtonVpnModeFinishClicked()
void WizardLogic::onPushButtonLowFinishClicked() void WizardLogic::onPushButtonLowFinishClicked()
{ {
auto containers = getInstallConfigsFromWizardPage(); auto container = getInstallConfigsFromWizardPage();
uiLogic()->installServer(containers); uiLogic()->installServer(container);
} }

View file

@ -25,7 +25,7 @@ public:
explicit WizardLogic(UiLogic *uiLogic, QObject *parent = nullptr); explicit WizardLogic(UiLogic *uiLogic, QObject *parent = nullptr);
~WizardLogic() = default; ~WizardLogic() = default;
QMap<DockerContainer, QJsonObject> getInstallConfigsFromWizardPage() const; QPair<DockerContainer, QJsonObject> getInstallConfigsFromWizardPage() const;
}; };
#endif // WIZARD_LOGIC_H #endif // WIZARD_LOGIC_H

View file

@ -16,12 +16,21 @@ PageBase {
BackButton { BackButton {
id: back id: back
} }
Caption { Caption {
id: caption id: caption
text: qsTr("Advanced server settings") text: qsTr("Advanced server settings")
anchors.horizontalCenter: parent.horizontalCenter anchors.horizontalCenter: parent.horizontalCenter
} }
BusyIndicator {
z: 99
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: parent.verticalCenter
visible: !AdvancedServerSettingsLogic.pageEnabled
running: !AdvancedServerSettingsLogic.pageEnabled
}
FlickableType { FlickableType {
id: fl id: fl
anchors.top: caption.bottom anchors.top: caption.bottom
@ -54,6 +63,7 @@ PageBase {
LabelType { LabelType {
Layout.fillWidth: true Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
text: AdvancedServerSettingsLogic.labelWaitInfoText text: AdvancedServerSettingsLogic.labelWaitInfoText
visible: AdvancedServerSettingsLogic.labelWaitInfoVisible visible: AdvancedServerSettingsLogic.labelWaitInfoVisible
} }
@ -64,7 +74,7 @@ PageBase {
text: "Scan the server for installed containers" text: "Scan the server for installed containers"
visible: AdvancedServerSettingsLogic.pushButtonClearVisible visible: AdvancedServerSettingsLogic.pushButtonClearVisible
onClicked: { onClicked: {
UiLogic.getInstalledContainers(false) AdvancedServerSettingsLogic.onPushButtonScanServerClicked()
} }
} }
@ -82,8 +92,8 @@ PageBase {
id: popupClearServer id: popupClearServer
questionText: "Attention! All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. Continue?" questionText: "Attention! All containers will be deleted on the server. This means that configuration files, keys and certificates will be deleted. Continue?"
yesFunc: function() { yesFunc: function() {
AdvancedServerSettingsLogic.onPushButtonClearServer()
close() close()
AdvancedServerSettingsLogic.onPushButtonClearServerClicked()
} }
noFunc: function() { noFunc: function() {
close() close()

View file

@ -267,10 +267,8 @@ void UiLogic::onGotoCurrentProtocolsPage()
emit goToPage(Page::ServerContainers); emit goToPage(Page::ServerContainers);
} }
void UiLogic::installServer(QMap<DockerContainer, QJsonObject> &containers) void UiLogic::installServer(QPair<DockerContainer, QJsonObject> &container)
{ {
if (containers.isEmpty()) return;
emit goToPage(Page::ServerConfiguringProgress); emit goToPage(Page::ServerConfiguringProgress);
QEventLoop loop; QEventLoop loop;
QTimer::singleShot(500, &loop, SLOT(quit())); QTimer::singleShot(500, &loop, SLOT(quit()));
@ -325,57 +323,48 @@ void UiLogic::installServer(QMap<DockerContainer, QJsonObject> &containers)
pageLogic<ServerConfiguringProgressLogic>()->set_pushButtonCancelVisible(visible); pageLogic<ServerConfiguringProgressLogic>()->set_pushButtonCancelVisible(visible);
}; };
ErrorCode errorCode = addAlreadyInstalledContainersGui(true, m_installCredentials); bool isServerCreated = false;
ErrorCode errorCode = addAlreadyInstalledContainersGui(true, isServerCreated);
if (errorCode == ErrorCode::NoError) { if (errorCode == ErrorCode::NoError) {
int count = 0; if (!isContainerAlreadyAddedToGui(container.first)) {
bool isSomethingInstalled = false; progressBarFunc.setTextFunc(QString("Installing %1").arg(ContainerProps::containerToString(container.first)));
for (QMap<DockerContainer, QJsonObject>::iterator i = containers.begin(); i != containers.end(); i++, count++) {
if (isContainerAlreadyAddedToGui(i.key(), m_installCredentials)) {
continue;
}
isSomethingInstalled = true;
progressBarFunc.setTextFunc(QString("Installing %1 %2 %3").arg(count + 1).arg(tr("of")).arg(containers.size()));
auto installAction = [&] () { auto installAction = [&] () {
return m_serverController->setupContainer(m_installCredentials, i.key(), i.value()); return m_serverController->setupContainer(m_installCredentials, container.first, container.second);
}; };
errorCode = pageLogic<ServerConfiguringProgressLogic>()->doInstallAction(installAction, pageFunc, progressBarFunc, errorCode = pageLogic<ServerConfiguringProgressLogic>()->doInstallAction(installAction, pageFunc, progressBarFunc,
noButton, waitInfoFunc, noButton, waitInfoFunc,
busyInfoFunc, cancelButtonFunc); busyInfoFunc, cancelButtonFunc);
m_serverController->disconnectFromHost(m_installCredentials); m_serverController->disconnectFromHost(m_installCredentials);
}
if (errorCode == ErrorCode::NoError) { if (errorCode == ErrorCode::NoError) {
if (!isSomethingInstalled) { if (!isServerCreated) {
QJsonObject server;
server.insert(config_key::hostName, m_installCredentials.hostName);
server.insert(config_key::userName, m_installCredentials.userName);
server.insert(config_key::password, m_installCredentials.password);
server.insert(config_key::port, m_installCredentials.port);
server.insert(config_key::description, m_settings->nextAvailableServerName());
server.insert(config_key::containers, QJsonArray{container.second});
server.insert(config_key::defaultContainer, ContainerProps::containerToString(container.first));
m_settings->addServer(server);
m_settings->setDefaultServer(m_settings->serversCount() - 1);
} else {
m_settings->setContainerConfig(m_settings->serversCount() - 1, container.first, container.second);
m_settings->setDefaultContainer(m_settings->serversCount() - 1, container.first);
}
onUpdateAllPages(); onUpdateAllPages();
emit showWarningMessage("Attention! The container you are trying to install is already installed on the server. "
"All installed containers have been added to the application ");
emit setStartPage(Page::Vpn); emit setStartPage(Page::Vpn);
qApp->processEvents();
return; return;
} }
} else {
QJsonObject server;
server.insert(config_key::hostName, m_installCredentials.hostName);
server.insert(config_key::userName, m_installCredentials.userName);
server.insert(config_key::password, m_installCredentials.password);
server.insert(config_key::port, m_installCredentials.port);
server.insert(config_key::description, m_settings->nextAvailableServerName());
QJsonArray containerConfigs;
for (const QJsonObject &cfg : containers) {
containerConfigs.append(cfg);
}
server.insert(config_key::containers, containerConfigs);
server.insert(config_key::defaultContainer, ContainerProps::containerToString(containers.firstKey()));
m_settings->addServer(server);
m_settings->setDefaultServer(m_settings->serversCount() - 1);
onUpdateAllPages(); onUpdateAllPages();
emit showWarningMessage("Attention! The container you are trying to install is already installed on the server. "
"All installed containers have been added to the application ");
emit setStartPage(Page::Vpn); emit setStartPage(Page::Vpn);
qApp->processEvents();
return; return;
} }
} }
@ -521,8 +510,16 @@ void UiLogic::registerPagesLogic()
registerPageLogic<AdvancedServerSettingsLogic>(); registerPageLogic<AdvancedServerSettingsLogic>();
} }
ErrorCode UiLogic::addAlreadyInstalledContainersGui(bool createNewServer, const ServerCredentials& credentials) ErrorCode UiLogic::addAlreadyInstalledContainersGui(bool createNewServer, bool &isServerCreated)
{ {
isServerCreated = false;
ServerCredentials credentials;
if (createNewServer) {
credentials = m_installCredentials;
} else {
credentials = m_settings->serverCredentials(m_selectedServerIndex);
}
QMap<DockerContainer, QJsonObject> installedContainers; QMap<DockerContainer, QJsonObject> installedContainers;
ErrorCode errorCode = m_serverController->getAlreadyInstalledContainers(credentials, installedContainers); ErrorCode errorCode = m_serverController->getAlreadyInstalledContainers(credentials, installedContainers);
m_serverController->disconnectFromHost(credentials); m_serverController->disconnectFromHost(credentials);
@ -530,44 +527,47 @@ ErrorCode UiLogic::addAlreadyInstalledContainersGui(bool createNewServer, const
return errorCode; return errorCode;
} }
QJsonObject server; if (!installedContainers.empty()) {
QJsonArray containerConfigs; QJsonObject server;
if (createNewServer) { QJsonArray containerConfigs;
server.insert(config_key::hostName, credentials.hostName); if (createNewServer) {
server.insert(config_key::userName, credentials.userName); server.insert(config_key::hostName, credentials.hostName);
server.insert(config_key::password, credentials.password); server.insert(config_key::userName, credentials.userName);
server.insert(config_key::port, credentials.port); server.insert(config_key::password, credentials.password);
server.insert(config_key::description, m_settings->nextAvailableServerName()); server.insert(config_key::port, credentials.port);
} server.insert(config_key::description, m_settings->nextAvailableServerName());
}
for (auto container = installedContainers.begin(); container != installedContainers.end(); container++) { for (auto container = installedContainers.begin(); container != installedContainers.end(); container++) {
if (isContainerAlreadyAddedToGui(container.key(), credentials)) { if (isContainerAlreadyAddedToGui(container.key())) {
continue; continue;
}
if (createNewServer) {
containerConfigs.append(container.value());
server.insert(config_key::containers, containerConfigs);
} else {
m_settings->setContainerConfig(m_selectedServerIndex, container.key(), container.value());
m_settings->setDefaultContainer(m_selectedServerIndex, installedContainers.firstKey());
}
} }
if (createNewServer) { if (createNewServer) {
containerConfigs.append(container.value()); server.insert(config_key::defaultContainer, ContainerProps::containerToString(installedContainers.firstKey()));
server.insert(config_key::containers, containerConfigs); m_settings->addServer(server);
} else { m_settings->setDefaultServer(m_settings->serversCount() - 1);
m_settings->setContainerConfig(m_selectedServerIndex, container.key(), container.value()); isServerCreated = true;
m_settings->setDefaultContainer(m_selectedServerIndex, installedContainers.firstKey());
} }
} }
if (createNewServer) {
server.insert(config_key::defaultContainer, ContainerProps::containerToString(installedContainers.firstKey()));
m_settings->addServer(server);
m_settings->setDefaultServer(m_settings->serversCount() - 1);
}
return ErrorCode::NoError; return ErrorCode::NoError;
} }
bool UiLogic::isContainerAlreadyAddedToGui(DockerContainer container, const ServerCredentials &selectedServerCredentials) bool UiLogic::isContainerAlreadyAddedToGui(DockerContainer container)
{ {
for (int i = 0; i < m_settings->serversCount(); i++) { for (int i = 0; i < m_settings->serversCount(); i++) {
const ServerCredentials credentials = m_settings->serverCredentials(i); const ServerCredentials credentials = m_settings->serverCredentials(i);
if (selectedServerCredentials.hostName == credentials.hostName && selectedServerCredentials.port == credentials.port) { if (m_installCredentials.hostName == credentials.hostName && m_installCredentials.port == credentials.port) {
const QJsonObject containerConfig = m_settings->containerConfig(i, container); const QJsonObject containerConfig = m_settings->containerConfig(i, container);
if (!containerConfig.isEmpty()) { if (!containerConfig.isEmpty()) {
return true; return true;

View file

@ -53,6 +53,7 @@ class OtherProtocolsLogic;
class VpnConnection; class VpnConnection;
class CreateServerTest;
class UiLogic : public QObject class UiLogic : public QObject
{ {
@ -97,6 +98,8 @@ public:
friend class OtherProtocolsLogic; friend class OtherProtocolsLogic;
friend class CreateServerTest;
Q_INVOKABLE virtual void onUpdatePage() {} // UiLogic is set as logic class for some qml pages Q_INVOKABLE virtual void onUpdatePage() {} // UiLogic is set as logic class for some qml pages
Q_INVOKABLE void onUpdateAllPages(); Q_INVOKABLE void onUpdateAllPages();
@ -114,7 +117,7 @@ public:
Q_INVOKABLE void saveBinaryFile(const QString& desc, QString ext, const QString& data); Q_INVOKABLE void saveBinaryFile(const QString& desc, QString ext, const QString& data);
Q_INVOKABLE void copyToClipboard(const QString& text); Q_INVOKABLE void copyToClipboard(const QString& text);
Q_INVOKABLE amnezia::ErrorCode addAlreadyInstalledContainersGui(bool createNewServer, const ServerCredentials& credentials); Q_INVOKABLE amnezia::ErrorCode addAlreadyInstalledContainersGui(bool createNewServer, bool &isServerCreated);
void shareTempFile(const QString &suggestedName, QString ext, const QString& data); void shareTempFile(const QString &suggestedName, QString ext, const QString& data);
@ -135,11 +138,11 @@ signals:
private slots: private slots:
// containers - INOUT arg // containers - INOUT arg
void installServer(QMap<DockerContainer, QJsonObject> &containers); void installServer(QPair<amnezia::DockerContainer, QJsonObject> &container);
private: private:
PageEnumNS::Page currentPage(); PageEnumNS::Page currentPage();
bool isContainerAlreadyAddedToGui(DockerContainer container, const ServerCredentials &selectedServerCredentials); bool isContainerAlreadyAddedToGui(DockerContainer container);
public: public:
Q_INVOKABLE PageProtocolLogicBase *protocolLogic(Proto p); Q_INVOKABLE PageProtocolLogicBase *protocolLogic(Proto p);