From 795405c47d3c4fceffbe82aa6ce0be1e8970d12e Mon Sep 17 00:00:00 2001 From: "vladimir.kuznetsov" Date: Tue, 27 Jun 2023 19:07:42 +0900 Subject: [PATCH] added display of amnesia dns container activity on the main page --- client/resources.qrc | 1 + .../ui/controllers/connectionController.cpp | 2 + client/ui/controllers/settingsController.cpp | 26 +--- client/ui/controllers/settingsController.h | 6 +- client/ui/models/containers_model.cpp | 11 ++ client/ui/models/containers_model.h | 3 + client/ui/models/servers_model.cpp | 23 ++- client/ui/models/servers_model.h | 6 +- client/ui/qml/Components/ConnectButton.qml | 2 + .../qml/Components/ShareConnectionDrawer.qml | 1 - .../ui/qml/Components/ShowDetailsDrawer.qml | 10 ++ .../qml/Components/TransportProtoSelector.qml | 14 +- client/ui/qml/Controls2/DropDownType.qml | 3 - .../qml/Controls2/HorizontalRadioButton.qml | 6 + client/ui/qml/Pages2/PageHome.qml | 42 ++++-- .../Pages2/PageSettingsServerProtocols.qml | 3 +- .../qml/Pages2/PageSettingsServerServices.qml | 3 +- .../qml/Pages2/PageSetupWizardCredentials.qml | 6 +- .../PageSetupWizardProtocolSettings.qml | 139 ++++++++++++++++-- client/ui/qml/Pages2/PageShare.qml | 12 +- client/ui/qml/Pages2/PageStart.qml | 4 +- 21 files changed, 238 insertions(+), 85 deletions(-) create mode 100644 client/ui/qml/Components/ShowDetailsDrawer.qml diff --git a/client/resources.qrc b/client/resources.qrc index 9aba0a6b..b306c154 100644 --- a/client/resources.qrc +++ b/client/resources.qrc @@ -270,5 +270,6 @@ images/controls/telegram.svg ui/qml/Controls2/TextTypes/SmallTextType.qml ui/qml/Filters/ContainersModelFilters.qml + ui/qml/Components/ShowDetailsDrawer.qml diff --git a/client/ui/controllers/connectionController.cpp b/client/ui/controllers/connectionController.cpp index aace2857..7d1b6bed 100644 --- a/client/ui/controllers/connectionController.cpp +++ b/client/ui/controllers/connectionController.cpp @@ -83,11 +83,13 @@ void ConnectionController::onConnectionStateChanged(Vpn::ConnectionState state) } case Vpn::ConnectionState::Error: { m_isConnectionInProgress = false; + m_connectionStateText = tr("Connect"); emit connectionErrorOccurred(getLastConnectionError()); break; } case Vpn::ConnectionState::Unknown: { m_isConnectionInProgress = false; + m_connectionStateText = tr("Connect"); emit connectionErrorOccurred(getLastConnectionError()); break; } diff --git a/client/ui/controllers/settingsController.cpp b/client/ui/controllers/settingsController.cpp index b86b1cff..fcfcc7af 100644 --- a/client/ui/controllers/settingsController.cpp +++ b/client/ui/controllers/settingsController.cpp @@ -8,15 +8,10 @@ SettingsController::SettingsController(const QSharedPointer &serversModel, const QSharedPointer &containersModel, - const std::shared_ptr &settings, - QObject *parent) - : QObject(parent) - , m_serversModel(serversModel) - , m_containersModel(containersModel) - , m_settings(settings) + const std::shared_ptr &settings, QObject *parent) + : QObject(parent), m_serversModel(serversModel), m_containersModel(containersModel), m_settings(settings) { - m_appVersion = QString("%1: %2 (%3)") - .arg(tr("Software version"), QString(APP_MAJOR_VERSION), __DATE__); + m_appVersion = QString("%1: %2 (%3)").arg(tr("Software version"), QString(APP_MAJOR_VERSION), __DATE__); } void SettingsController::setAmneziaDns(bool enable) @@ -79,21 +74,16 @@ void SettingsController::clearLogs() void SettingsController::backupAppConfig() { - Utils::saveFile(".backup", - tr("Backup application config"), - "AmneziaVPN", - m_settings->backupAppConfig()); + Utils::saveFile(".backup", tr("Backup application config"), "AmneziaVPN", m_settings->backupAppConfig()); } void SettingsController::restoreAppConfig() { - QString fileName = Utils::getFileName(Q_NULLPTR, - tr("Open backup"), - QStandardPaths::writableLocation( - QStandardPaths::DocumentsLocation), - "*.backup"); + QString fileName = + Utils::getFileName(Q_NULLPTR, tr("Open backup"), + QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation), "*.backup"); - //todo error processing + // todo error processing if (fileName.isEmpty()) return; diff --git a/client/ui/controllers/settingsController.h b/client/ui/controllers/settingsController.h index 77de424c..f961a37d 100644 --- a/client/ui/controllers/settingsController.h +++ b/client/ui/controllers/settingsController.h @@ -12,12 +12,10 @@ class SettingsController : public QObject public: explicit SettingsController(const QSharedPointer &serversModel, const QSharedPointer &containersModel, - const std::shared_ptr &settings, - QObject *parent = nullptr); + const std::shared_ptr &settings, QObject *parent = nullptr); Q_PROPERTY(QString primaryDns READ getPrimaryDns WRITE setPrimaryDns NOTIFY primaryDnsChanged) - Q_PROPERTY( - QString secondaryDns READ getSecondaryDns WRITE setSecondaryDns NOTIFY secondaryDnsChanged) + Q_PROPERTY(QString secondaryDns READ getSecondaryDns WRITE setSecondaryDns NOTIFY secondaryDnsChanged) public slots: void setAmneziaDns(bool enable); diff --git a/client/ui/models/containers_model.cpp b/client/ui/models/containers_model.cpp index 7a6946f5..ecacc184 100644 --- a/client/ui/models/containers_model.cpp +++ b/client/ui/models/containers_model.cpp @@ -132,6 +132,17 @@ void ContainersModel::clearCachedProfiles() } } +bool ContainersModel::isAmneziaDnsContainerInstalled() +{ + return m_containers.contains(DockerContainer::Dns); +} + +bool ContainersModel::isAmneziaDnsContainerInstalled(const int serverIndex) +{ + QMap containers = m_settings->containers(serverIndex); + return containers.contains(DockerContainer::Dns); +} + QHash ContainersModel::roleNames() const { QHash roles; diff --git a/client/ui/models/containers_model.h b/client/ui/models/containers_model.h index ebf47497..7331ef22 100644 --- a/client/ui/models/containers_model.h +++ b/client/ui/models/containers_model.h @@ -51,6 +51,9 @@ public slots: void removeAllContainers(); void clearCachedProfiles(); + bool isAmneziaDnsContainerInstalled(); + bool isAmneziaDnsContainerInstalled(const int serverIndex); + protected: QHash roleNames() const override; diff --git a/client/ui/models/servers_model.cpp b/client/ui/models/servers_model.cpp index 9df243fe..b427f15b 100644 --- a/client/ui/models/servers_model.cpp +++ b/client/ui/models/servers_model.cpp @@ -59,10 +59,14 @@ QVariant ServersModel::data(const QModelIndex &index, int role) const case CredentialsLoginRole: return m_settings->serverCredentials(index.row()).userName; case IsDefaultRole: return index.row() == m_defaultServerIndex; case IsCurrentlyProcessedRole: return index.row() == m_currenlyProcessedServerIndex; - case HasWriteAccess: { + case HasWriteAccessRole: { auto credentials = m_settings->serverCredentials(index.row()); return (!credentials.userName.isEmpty() && !credentials.secretData.isEmpty()); } + case ContainsAmneziaDnsRole: { + QString primaryDns = server.value(config_key::dns1).toString(); + return primaryDns == protocols::dns::amneziaDnsIp; + } } return QVariant(); @@ -109,7 +113,12 @@ bool ServersModel::isDefaultServerCurrentlyProcessed() bool ServersModel::isCurrentlyProcessedServerHasWriteAccess() { - return qvariant_cast(data(m_currenlyProcessedServerIndex, HasWriteAccess)); + return qvariant_cast(data(m_currenlyProcessedServerIndex, HasWriteAccessRole)); +} + +bool ServersModel::isDefaultServerHasWriteAccess() +{ + return qvariant_cast(data(m_currenlyProcessedServerIndex, HasWriteAccessRole)); } void ServersModel::addServer(const QJsonObject &server) @@ -138,6 +147,13 @@ void ServersModel::removeServer() endResetModel(); } +bool ServersModel::isDefaultServerConfigContainsAmneziaDns() +{ + const QJsonObject server = m_servers.at(m_defaultServerIndex).toObject(); + QString primaryDns = server.value(config_key::dns1).toString(); + return primaryDns == protocols::dns::amneziaDnsIp; +} + QHash ServersModel::roleNames() const { QHash roles; @@ -147,6 +163,7 @@ QHash ServersModel::roleNames() const roles[CredentialsLoginRole] = "credentialsLogin"; roles[IsDefaultRole] = "isDefault"; roles[IsCurrentlyProcessedRole] = "isCurrentlyProcessed"; - roles[HasWriteAccess] = "hasWriteAccess"; + roles[HasWriteAccessRole] = "hasWriteAccess"; + roles[ContainsAmneziaDnsRole] = "containsAmneziaDns"; return roles; } diff --git a/client/ui/models/servers_model.h b/client/ui/models/servers_model.h index 6cb9859e..0ec78e7e 100644 --- a/client/ui/models/servers_model.h +++ b/client/ui/models/servers_model.h @@ -16,7 +16,8 @@ public: CredentialsLoginRole, IsDefaultRole, IsCurrentlyProcessedRole, - HasWriteAccess + HasWriteAccessRole, + ContainsAmneziaDnsRole }; ServersModel(std::shared_ptr settings, QObject *parent = nullptr); @@ -37,6 +38,7 @@ public slots: bool isDefaultServerCurrentlyProcessed(); bool isCurrentlyProcessedServerHasWriteAccess(); + bool isDefaultServerHasWriteAccess(); const int getServersCount(); @@ -46,6 +48,8 @@ public slots: void addServer(const QJsonObject &server); void removeServer(); + bool isDefaultServerConfigContainsAmneziaDns(); + protected: QHash roleNames() const override; diff --git a/client/ui/qml/Components/ConnectButton.qml b/client/ui/qml/Components/ConnectButton.qml index 626c4ffb..1f27973a 100644 --- a/client/ui/qml/Components/ConnectButton.qml +++ b/client/ui/qml/Components/ConnectButton.qml @@ -17,6 +17,8 @@ Button { text: ConnectionController.connectionStateText + enabled: !ConnectionController.isConnectionInProgress + background: Item { clip: true diff --git a/client/ui/qml/Components/ShareConnectionDrawer.qml b/client/ui/qml/Components/ShareConnectionDrawer.qml index e03738c8..720e3206 100644 --- a/client/ui/qml/Components/ShareConnectionDrawer.qml +++ b/client/ui/qml/Components/ShareConnectionDrawer.qml @@ -76,7 +76,6 @@ DrawerType { } } - BasicButtonType { Layout.fillWidth: true Layout.topMargin: 8 diff --git a/client/ui/qml/Components/ShowDetailsDrawer.qml b/client/ui/qml/Components/ShowDetailsDrawer.qml new file mode 100644 index 00000000..2f6d2656 --- /dev/null +++ b/client/ui/qml/Components/ShowDetailsDrawer.qml @@ -0,0 +1,10 @@ +import QtQuick +import QtQuick.Controls +import QtQuick.Layouts + +import "../Controls2" +import "../Controls2/TextTypes" + +Item { + +} diff --git a/client/ui/qml/Components/TransportProtoSelector.qml b/client/ui/qml/Components/TransportProtoSelector.qml index 6f5aa44b..dd315deb 100644 --- a/client/ui/qml/Components/TransportProtoSelector.qml +++ b/client/ui/qml/Components/TransportProtoSelector.qml @@ -8,11 +8,9 @@ import "../Controls2/TextTypes" Rectangle { id: root - property var rootWidth: root.width + property real rootWidth: root.width property int currentIndex - property alias mouseArea: transportProtoButtonMouseArea - implicitWidth: transportProtoButtonGroup.implicitWidth implicitHeight: transportProtoButtonGroup.implicitHeight @@ -30,8 +28,6 @@ Rectangle { implicitWidth: (rootWidth - 32) / 2 text: "UDP" - hoverEnabled: !transportProtoButtonMouseArea.enabled - onClicked: { root.currentIndex = 0 } @@ -43,17 +39,9 @@ Rectangle { implicitWidth: (rootWidth - 32) / 2 text: "TCP" - hoverEnabled: !transportProtoButtonMouseArea.enabled - onClicked: { root.currentIndex = 1 } } } - - MouseArea { - id: transportProtoButtonMouseArea - - anchors.fill: parent - } } diff --git a/client/ui/qml/Controls2/DropDownType.qml b/client/ui/qml/Controls2/DropDownType.qml index 38cd0afa..9b9c718a 100644 --- a/client/ui/qml/Controls2/DropDownType.qml +++ b/client/ui/qml/Controls2/DropDownType.qml @@ -19,7 +19,6 @@ Item { property string rootButtonImage: "qrc:/images/controls/chevron-down.svg" property string rootButtonImageColor: "#D7D8DB" property string rootButtonBackgroundColor: "#1C1D21" - property int rootButtonMaximumWidth: 0 property string rootButtonHoveredBorderColor: "#494B50" property string rootButtonDefaultBorderColor: "transparent" @@ -88,8 +87,6 @@ Item { horizontalAlignment: Text.AlignLeft verticalAlignment: Text.AlignVCenter - Layout.maximumWidth: rootButtonMaximumWidth ? rootButtonMaximumWidth : implicitWidth - color: root.textColor text: root.text diff --git a/client/ui/qml/Controls2/HorizontalRadioButton.qml b/client/ui/qml/Controls2/HorizontalRadioButton.qml index 86218b3f..4a2a13dd 100644 --- a/client/ui/qml/Controls2/HorizontalRadioButton.qml +++ b/client/ui/qml/Controls2/HorizontalRadioButton.qml @@ -88,4 +88,10 @@ RadioButton { horizontalAlignment: Qt.AlignHCenter } } + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + enabled: false + } } diff --git a/client/ui/qml/Pages2/PageHome.qml b/client/ui/qml/Pages2/PageHome.qml index 9f121273..b97acad1 100644 --- a/client/ui/qml/Pages2/PageHome.qml +++ b/client/ui/qml/Pages2/PageHome.qml @@ -95,13 +95,20 @@ PageType { Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter text: { - var string = "" - if (SettingsController.isAmneziaDnsEnabled()) { - string += "Amnezia DNS | " + var description = "" + if (ServersModel.isDefaultServerHasWriteAccess()) { + if (SettingsController.isAmneziaDnsEnabled() + && ContainersModel.isAmneziaDnsContainerInstalled(ServersModel.getDefaultServerIndex())) { + description += "Amnezia DNS | " + } + } else { + if (ServersModel.isDefaultServerConfigContainsAmneziaDns) { + description += "Amnezia DNS | " + } } - string += root.currentContainerName + " | " + root.currentServerHostName - return string + description += root.currentContainerName + " | " + root.currentServerHostName + return description } } } @@ -153,7 +160,6 @@ PageType { rootButtonBorderWidth: 0 rootButtonImageColor: "#0E0E11" - rootButtonMaximumWidth: 150 //todo make it dynamic rootButtonBackgroundColor: "#D7D8DB" text: root.currentContainerName @@ -194,14 +200,6 @@ PageType { currentIndex: ContainersModel.getDefaultContainer() } } - - BasicButtonType { - id: dnsButton - - implicitHeight: 40 - - text: "Amnezia DNS" - } } Header2Type { @@ -277,7 +275,21 @@ PageType { Layout.fillWidth: true text: name - descriptionText: hostName + descriptionText: { + var description = "" + if (hasWriteAccess) { + if (SettingsController.isAmneziaDnsEnabled() + && ContainersModel.isAmneziaDnsContainerInstalled(index)) { + description += "AmneziaDNS | " + } + } else { + if (containsAmneziaDns) { + description += "AmneziaDNS | " + } + } + + return description += hostName + } checked: index === serversMenuContent.currentIndex diff --git a/client/ui/qml/Pages2/PageSettingsServerProtocols.qml b/client/ui/qml/Pages2/PageSettingsServerProtocols.qml index 1d806d07..2b67afca 100644 --- a/client/ui/qml/Pages2/PageSettingsServerProtocols.qml +++ b/client/ui/qml/Pages2/PageSettingsServerProtocols.qml @@ -21,11 +21,12 @@ PageType { property var installedProtocolsCount SettingsContainersListView { + id: settingsContainersListView Connections { target: ServersModel function onCurrentlyProcessedServerIndexChanged() { - updateContainersModelFilters() + settingsContainersListView.updateContainersModelFilters() } } diff --git a/client/ui/qml/Pages2/PageSettingsServerServices.qml b/client/ui/qml/Pages2/PageSettingsServerServices.qml index 1e3d8722..282e7e9e 100644 --- a/client/ui/qml/Pages2/PageSettingsServerServices.qml +++ b/client/ui/qml/Pages2/PageSettingsServerServices.qml @@ -21,11 +21,12 @@ PageType { property var installedServicesCount SettingsContainersListView { + id: settingsContainersListView Connections { target: ServersModel function onCurrentlyProcessedServerIndexChanged() { - updateContainersModelFilters() + settingsContainersListView.updateContainersModelFilters() } } diff --git a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml index fc8bf9ae..5a2f7d88 100644 --- a/client/ui/qml/Pages2/PageSetupWizardCredentials.qml +++ b/client/ui/qml/Pages2/PageSetupWizardCredentials.qml @@ -121,18 +121,18 @@ PageType { var hasEmptyField = false if (hostname.textFieldText === "") { - hostname.errorText = qsTr("ip address cannot be empty") + hostname.errorText = qsTr("Ip address cannot be empty") hasEmptyField = true } else if (!hostname.textField.acceptableInput) { hostname.errorText = qsTr("Enter the address in the format 255.255.255.255:88") } if (username.textFieldText === "") { - username.errorText = qsTr("login cannot be empty") + username.errorText = qsTr("Login cannot be empty") hasEmptyField = true } if (secretData.textFieldText === "") { - secretData.errorText = qsTr("password/private key cannot be empty") + secretData.errorText = qsTr("Password/private key cannot be empty") hasEmptyField = true } return !hasEmptyField diff --git a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml index c0483df4..5ca75f6f 100644 --- a/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml +++ b/client/ui/qml/Pages2/PageSetupWizardProtocolSettings.qml @@ -29,7 +29,6 @@ PageType { } FlickableType { - id: fl anchors.fill: parent contentHeight: content.height @@ -41,18 +40,17 @@ PageType { anchors.right: parent.right ListView { - // todo change id naming - id: containers + id: processedContainerListView width: parent.width - height: containers.contentItem.height + height: contentItem.height currentIndex: -1 clip: true interactive: false model: proxyContainersModel delegate: Item { - implicitWidth: containers.width - implicitHeight: delegateContent.implicitHeight + implicitWidth: processedContainerListView.width + implicitHeight: (delegateContent.implicitHeight > root.height) ? delegateContent.implicitHeight : root.height ColumnLayout { id: delegateContent @@ -72,8 +70,122 @@ PageType { Layout.fillWidth: true - headerText: "Установка " + name - descriptionText: "Эти настройки можно будет изменить позже" + headerText: qsTr("Installing ") + name + descriptionText: qsTr("protocol description") + } + + BasicButtonType { + id: showDetailsButton + + Layout.topMargin: 16 + Layout.leftMargin: -8 + + implicitHeight: 32 + + defaultColor: "transparent" + hoveredColor: Qt.rgba(1, 1, 1, 0.08) + pressedColor: Qt.rgba(1, 1, 1, 0.12) + disabledColor: "#878B91" + textColor: "#FBB26A" + + text: qsTr("More detailed") + + onClicked: { + showDetailsDrawer.open() + } + } + + DrawerType { + id: showDetailsDrawer + + width: parent.width + height: parent.height * 0.9 + + BackButtonType { + id: showDetailsBackButton + + anchors.top: parent.top + anchors.left: parent.left + anchors.right: parent.right + anchors.rightMargin: 16 + anchors.leftMargin: 16 + anchors.topMargin: 16 + + backButtonFunction: function() { + showDetailsDrawer.close() + } + } + + FlickableType { + anchors.top: showDetailsBackButton.bottom + anchors.left: parent.left + anchors.right: parent.right + anchors.bottom: parent.bottom + contentHeight: { + var emptySpaceHeight = parent.height - showDetailsBackButton.implicitHeight - showDetailsBackButton.anchors.topMargin + + return (showDetailsDrawerContent.implicitHeight > emptySpaceHeight) ? + showDetailsDrawerContent.implicitHeight : emptySpaceHeight + } + + ColumnLayout { + id: showDetailsDrawerContent + + anchors.fill: parent + anchors.rightMargin: 16 + anchors.leftMargin: 16 + + Header2Type { + id: showDetailsDrawerHeader + Layout.fillWidth: true + Layout.topMargin: 16 + + headerText: name + } + + TextField { + Layout.fillWidth: true + Layout.topMargin: 16 + Layout.bottomMargin: 16 + + padding: 0 + leftPadding: 0 + height: 24 + + color: "#D7D8DB" + + font.pixelSize: 16 + font.weight: Font.Medium + font.family: "PT Root UI VF" + + text: qsTr("detailed protocol description") + + wrapMode: Text.WordWrap + + readOnly: true + background: Rectangle { + anchors.fill: parent + color: "transparent" + } + } + + Rectangle { + Layout.fillHeight: true + color: "transparent" + } + + BasicButtonType { + Layout.fillWidth: true + Layout.bottomMargin: 32 + + text: qsTr("Close") + + onClicked: function() { + showDetailsDrawer.close() + } + } + } + } } ParagraphTextType { @@ -96,15 +208,12 @@ PageType { Layout.fillWidth: true Layout.topMargin: 16 + headerText: "Port" } Rectangle { - // todo make it dynamic - implicitHeight: root.height - port.implicitHeight - - transportProtoSelector.implicitHeight - transportProtoHeader.implicitHeight - - header.implicitHeight - backButton.implicitHeight - installButton.implicitHeight - 116 - + Layout.fillHeight: true color: "transparent" } @@ -134,7 +243,9 @@ PageType { transportProtoSelector.currentIndex = ProtocolProps.defaultTransportProto(defaultContainerProto) port.enabled = ProtocolProps.defaultPortChangeable(defaultContainerProto) - transportProtoSelector.mouseArea.enabled = !ProtocolProps.defaultTransportProtoChangeable(defaultContainerProto) + var protocolSelectorVisible = ProtocolProps.defaultTransportProtoChangeable(defaultContainerProto) + transportProtoSelector.visible = protocolSelectorVisible + transportProtoHeader.visible = protocolSelectorVisible } } } diff --git a/client/ui/qml/Pages2/PageShare.qml b/client/ui/qml/Pages2/PageShare.qml index 30430073..1e3d02e8 100644 --- a/client/ui/qml/Pages2/PageShare.qml +++ b/client/ui/qml/Pages2/PageShare.qml @@ -260,12 +260,12 @@ PageType { } function fillConnectionTypeModel() { - connectionTypesModel = [amneziaConnectionFormat] + root.connectionTypesModel = [amneziaConnectionFormat] if (currentIndex === ContainerProps.containerFromString("OpenVpn")) { - connectionTypesModel.push(openVpnConnectionFormat) + root.connectionTypesModel.push(openVpnConnectionFormat) } else if (currentIndex === ContainerProps.containerFromString("wireGuardConnectionType")) { - connectionTypesModel.push(amneziaConnectionFormat) + root.connectionTypesModel.push(amneziaConnectionFormat) } } } @@ -287,7 +287,7 @@ PageType { drawerHeight: 0.4375 visible: accessTypeSelector.currentIndex === 0 - enabled: connectionTypesModel.length > 1 + enabled: root.connectionTypesModel.length > 1 descriptionText: qsTr("Connection format") headerText: qsTr("Connection format") @@ -298,7 +298,7 @@ PageType { imageSource: "qrc:/images/controls/chevron-right.svg" - model: connectionTypesModel + model: root.connectionTypesModel currentIndex: 0 clickedFunction: function() { @@ -326,7 +326,7 @@ PageType { onClicked: { if (accessTypeSelector.currentIndex === 0) { - connectionTypesModel[connectionTypeSelector.currentIndex].func() + root.connectionTypesModel[accessTypeSelector.currentIndex].func() } else { ExportController.generateConfig(true) } diff --git a/client/ui/qml/Pages2/PageStart.qml b/client/ui/qml/Pages2/PageStart.qml index e2b83056..76450b16 100644 --- a/client/ui/qml/Pages2/PageStart.qml +++ b/client/ui/qml/Pages2/PageStart.qml @@ -77,8 +77,8 @@ PageType { isSelected: tabBar.currentIndex === 0 image: "qrc:/images/controls/home.svg" onClicked: { - ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex tabBarStackView.goToTabBarPage(PageEnum.PageHome) + ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex } } TabImageButtonType { @@ -94,7 +94,7 @@ PageType { } visible: ServersModel.isCurrentlyProcessedServerHasWriteAccess() - width: visible ? undefined : 0 + width: ServersModel.isCurrentlyProcessedServerHasWriteAccess() ? undefined : 0 isSelected: tabBar.currentIndex === 1 image: "qrc:/images/controls/share-2.svg"