2021-09-03 20:17:13 +03:00
|
|
|
#include "GeneralSettingsLogic.h"
|
2021-09-06 13:41:45 +03:00
|
|
|
#include "ShareConnectionLogic.h"
|
2021-09-06 12:39:46 +03:00
|
|
|
|
2021-09-03 20:17:13 +03:00
|
|
|
#include "../uilogic.h"
|
2021-11-06 13:47:52 +03:00
|
|
|
#include "../models/protocols_model.h"
|
2021-09-03 20:17:13 +03:00
|
|
|
|
2021-09-07 21:01:56 +03:00
|
|
|
GeneralSettingsLogic::GeneralSettingsLogic(UiLogic *logic, QObject *parent):
|
|
|
|
|
PageLogicBase(logic, parent)
|
2021-09-03 20:17:13 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-22 14:49:08 +03:00
|
|
|
void GeneralSettingsLogic::onUpdatePage()
|
2021-09-03 20:17:13 +03:00
|
|
|
{
|
2021-11-08 15:18:52 +03:00
|
|
|
uiLogic()->selectedServerIndex = m_settings.defaultServerIndex();
|
|
|
|
|
uiLogic()->selectedDockerContainer = m_settings.defaultContainer(m_settings.defaultServerIndex());
|
|
|
|
|
|
2021-09-07 22:11:43 +03:00
|
|
|
set_pushButtonGeneralSettingsShareConnectionEnable(m_settings.haveAuthData(m_settings.defaultServerIndex()));
|
2021-09-03 20:17:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GeneralSettingsLogic::onPushButtonGeneralSettingsServerSettingsClicked()
|
|
|
|
|
{
|
2021-09-07 21:01:56 +03:00
|
|
|
uiLogic()->selectedServerIndex = m_settings.defaultServerIndex();
|
2021-11-08 15:18:52 +03:00
|
|
|
uiLogic()->selectedDockerContainer = m_settings.defaultContainer(m_settings.defaultServerIndex());
|
|
|
|
|
|
|
|
|
|
emit uiLogic()->goToPage(Page::ServerSettings);
|
2021-09-03 20:17:13 +03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void GeneralSettingsLogic::onPushButtonGeneralSettingsShareConnectionClicked()
|
|
|
|
|
{
|
2021-09-07 21:01:56 +03:00
|
|
|
uiLogic()->selectedServerIndex = m_settings.defaultServerIndex();
|
|
|
|
|
uiLogic()->selectedDockerContainer = m_settings.defaultContainer(uiLogic()->selectedServerIndex);
|
2021-11-08 15:18:52 +03:00
|
|
|
|
2021-11-06 13:47:52 +03:00
|
|
|
qobject_cast<ProtocolsModel *>(uiLogic()->protocolsModel())->setSelectedServerIndex(uiLogic()->selectedServerIndex);
|
|
|
|
|
qobject_cast<ProtocolsModel *>(uiLogic()->protocolsModel())->setSelectedDockerContainer(uiLogic()->selectedDockerContainer);
|
2021-09-03 20:17:13 +03:00
|
|
|
|
2021-11-15 18:17:28 +03:00
|
|
|
uiLogic()->shareConnectionLogic()->updateSharingPage(uiLogic()->selectedServerIndex, uiLogic()->selectedDockerContainer);
|
2021-11-08 15:18:52 +03:00
|
|
|
emit uiLogic()->goToPage(Page::ShareConnection);
|
2021-09-03 20:17:13 +03:00
|
|
|
}
|