Skip to content

Commit

Permalink
Merge pull request #360 from amnezia-vpn/bugfix/minor-ui-fixes-4-version
Browse files Browse the repository at this point in the history
Bugfix/minor UI fixes 4 version
  • Loading branch information
Nethius authored Oct 8, 2023
2 parents 5c121ea + 396b7aa commit 1b38cd6
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 39 deletions.
4 changes: 2 additions & 2 deletions client/ui/controllers/settingsController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ SettingsController::SettingsController(const QSharedPointer<ServersModel> &serve
m_languageModel(languageModel),
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_VERSION), __DATE__);

#ifdef Q_OS_ANDROID
if (!m_settings->isScreenshotsEnabled()) {
Expand Down Expand Up @@ -193,4 +193,4 @@ void SettingsController::toggleScreenshotsEnabled(bool enable)
}
});
#endif
}
}
92 changes: 56 additions & 36 deletions client/ui/qml/Pages2/PageHome.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,55 @@ PageType {
property string defaultServerHostName: ServersModel.defaultServerHostName
property string defaultContainerName: ContainersModel.defaultContainerName

Connections {
target: PageController

function onRestorePageHomeState(isContainerInstalled) {
buttonContent.state = "expanded"
if (isContainerInstalled) {
containersDropDown.menuVisible = true
}
}
function onForceCloseDrawer() {
buttonContent.state = "collapsed"
}
}

Connections {
target: ServersModel

function onDefaultServerIndexChanged() {
updateDescriptions()
}
}

Connections {
target: ContainersModel

function onDefaultContainerChanged() {
updateDescriptions()
}
}

function updateDescriptions() {
var description = ""
if (ServersModel.isDefaultServerHasWriteAccess()) {
if (SettingsController.isAmneziaDnsEnabled()
&& ContainersModel.isAmneziaDnsContainerInstalled(ServersModel.getDefaultServerIndex())) {
description += "Amnezia DNS | "
}
} else {
if (ServersModel.isDefaultServerConfigContainsAmneziaDns()) {
description += "Amnezia DNS | "
}
}

collapsedServerMenuDescription.text = description + root.defaultContainerName + " | " + root.defaultServerHostName
expandedServersMenuDescription.text = description + root.defaultServerHostName
}

Component.onCompleted: updateDescriptions()

MouseArea {
anchors.fill: parent
enabled: buttonContent.state === "expanded"
Expand All @@ -43,20 +92,6 @@ PageType {
}
}

Connections {
target: PageController

function onRestorePageHomeState(isContainerInstalled) {
buttonContent.state = "expanded"
if (isContainerInstalled) {
containersDropDown.menuVisible = true
}
}
function onForceCloseDrawer() {
buttonContent.state = "collapsed"
}
}

MouseArea {
id: dragArea

Expand Down Expand Up @@ -255,26 +290,10 @@ PageType {
}

LabelTextType {
id: collapsedServerMenuDescription
Layout.bottomMargin: 44
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
visible: buttonContent.collapsedVisibility

text: {
var description = ""
if (ServersModel.isDefaultServerHasWriteAccess()) {
if (SettingsController.isAmneziaDnsEnabled()
&& ContainersModel.isAmneziaDnsContainerInstalled(ServersModel.getDefaultServerIndex())) {
description += "Amnezia DNS | "
}
} else {
if (ServersModel.isDefaultServerConfigContainsAmneziaDns()) {
description += "Amnezia DNS | "
}
}

description += root.defaultContainerName + " | " + root.defaultServerHostName
return description
}
}

ColumnLayout {
Expand All @@ -297,10 +316,11 @@ PageType {
}

LabelTextType {
id: expandedServersMenuDescription
Layout.bottomMargin: 24
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter

text: root.defaultServerHostName
Layout.fillWidth: true
horizontalAlignment: Qt.AlignHCenter
verticalAlignment: Qt.AlignVCenter
}

RowLayout {
Expand Down Expand Up @@ -450,11 +470,11 @@ PageType {
if (hasWriteAccess) {
if (SettingsController.isAmneziaDnsEnabled()
&& ContainersModel.isAmneziaDnsContainerInstalled(index)) {
description += "AmneziaDNS | "
description += "Amnezia DNS | "
}
} else {
if (containsAmneziaDns) {
description += "AmneziaDNS | "
description += "Amnezia DNS | "
}
}

Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Pages2/PageShare.qml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ PageType {
Layout.bottomMargin: 24

text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") :
qsTr("Full access to server")
qsTr("Access to server management. The user with whom you share full access to the connection will be able to add and remove your protocols and services to the servers, as well as change settings.")
color: "#878B91"
}

Expand Down

0 comments on commit 1b38cd6

Please sign in to comment.