Skip to content

Commit

Permalink
Merge pull request #362 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 committed Oct 9, 2023
2 parents 61396ec + 4a2706a commit 45dc302
Show file tree
Hide file tree
Showing 24 changed files with 251 additions and 164 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.25.0 FATAL_ERROR)

set(PROJECT AmneziaVPN)

project(${PROJECT} VERSION 4.0.7.1
project(${PROJECT} VERSION 4.0.8.1
DESCRIPTION "AmneziaVPN"
HOMEPAGE_URL "https://amnezia.org/"
)
Expand Down
5 changes: 5 additions & 0 deletions client/images/controls/x-circle.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions client/resources.qrc
Original file line number Diff line number Diff line change
Expand Up @@ -215,5 +215,6 @@
<file>ui/qml/Controls2/ListViewWithLabelsType.qml</file>
<file>ui/qml/Pages2/PageServiceDnsSettings.qml</file>
<file>ui/qml/Controls2/TopCloseButtonType.qml</file>
<file>images/controls/x-circle.svg</file>
</qresource>
</RCC>
145 changes: 85 additions & 60 deletions client/translations/amneziavpn_ru.ts

Large diffs are not rendered by default.

143 changes: 90 additions & 53 deletions client/translations/amneziavpn_zh_CN.ts

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions client/ui/controllers/installController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ void InstallController::installContainer(DockerContainer container, QJsonObject
"All installed containers have been added to the application");
}

m_containersModel->setData(m_containersModel->index(0, 0), container, ContainersModel::Roles::IsDefaultRole);
emit installContainerFinished(finishMessage, ContainerProps::containerService(container) == ServiceType::Other);
return;
}
Expand Down
5 changes: 5 additions & 0 deletions client/ui/controllers/pageController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,3 +157,8 @@ void PageController::setTriggeredBtConnectButton(bool trigger)
{
m_isTriggeredByConnectButton = trigger;
}

void PageController::closeApplication()
{
qApp->quit();
}
3 changes: 2 additions & 1 deletion client/ui/controllers/pageController.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,11 @@ public slots:
void drawerOpen();
void drawerClose();


bool isTriggeredByConnectButton();
void setTriggeredBtConnectButton(bool trigger);

void closeApplication();

signals:
void goToPage(PageLoader::PageEnum page, bool slide = true);
void goToStartPage();
Expand Down
2 changes: 0 additions & 2 deletions client/ui/qml/Components/HomeContainersListView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -76,15 +76,13 @@ ListView {
(ConnectionController.isConnected || ConnectionController.isConnectionInProgress)) {
PageController.showNotificationMessage(qsTr("Reconnect via VPN Procotol: ") + name)
PageController.goToPageHome()
menu.visible = false
ConnectionController.openConnection()
}
} else {
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index))
InstallController.setShouldCreateServer(false)
PageController.goToPage(PageEnum.PageSetupWizardProtocolSettings)
containersDropDown.menuVisible = false
menu.visible = false
}
}

Expand Down
1 change: 1 addition & 0 deletions client/ui/qml/Components/ShareConnectionDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,7 @@ DrawerType {

Image {
anchors.fill: parent
anchors.margins: 2
smooth: false

source: ExportController.qrCodesCount ? ExportController.qrCodes[0] : ""
Expand Down
7 changes: 4 additions & 3 deletions client/ui/qml/Controls2/LabelWithButtonType.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Item {

property string rightImageSource
property string leftImageSource
property bool isLeftImageHoverEnabled: true //todo separete this qml file to 3

property string textColor: "#d7d8db"
property string descriptionColor: "#878B91"
Expand All @@ -42,9 +43,9 @@ Item {

visible: leftImageSource ? true : false

Layout.preferredHeight: rightImageSource ? leftImage.implicitHeight : 56
Layout.preferredWidth: rightImageSource ? leftImage.implicitWidth : 56
Layout.rightMargin: rightImageSource ? 16 : 0
Layout.preferredHeight: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitHeight : 56
Layout.preferredWidth: rightImageSource || !isLeftImageHoverEnabled ? leftImage.implicitWidth : 56
Layout.rightMargin: rightImageSource || !isLeftImageHoverEnabled ? 16 : 0

radius: 12
color: "transparent"
Expand Down
13 changes: 1 addition & 12 deletions client/ui/qml/Pages2/PageHome.qml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ PageType {
id: dragArea

anchors.fill: buttonBackground
cursorShape: Qt.PointingHandCursor
cursorShape: buttonContent.state === "collapsed" ? Qt.PointingHandCursor : Qt.ArrowCursor
hoverEnabled: true

drag.target: buttonContent
Expand Down Expand Up @@ -385,18 +385,7 @@ PageType {
Layout.rightMargin: 16
visible: buttonContent.expandedVisibility

actionButtonImage: "qrc:/images/controls/plus.svg"

headerText: qsTr("Servers")

actionButtonFunction: function() {
buttonContent.state = "collapsed"
connectionTypeSelection.visible = true
}
}

ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
}
}

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

onClicked: {
questionDrawer.headerText = qsTr("Remove OpenVpn from server?")
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")

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

clickedFunction: function() {
questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName())
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")

Expand Down
14 changes: 14 additions & 0 deletions client/ui/qml/Pages2/PageSettings.qml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ PageType {
}

DividerType {}

LabelWithButtonType {
Layout.fillWidth: true

text: qsTr("Close application")
leftImageSource: "qrc:/images/controls/x-circle.svg"
isLeftImageHoverEnabled: false

clickedFunction: function() {
PageController.closeApplication()
}
}

DividerType {}
}
}
}
4 changes: 2 additions & 2 deletions client/ui/qml/Pages2/PageSettingsAbout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ PageType {
height: 20
font.pixelSize: 14

text: qsTr("This is a free and open source application. If you like it, support the developers with a donation.
And if you don't like the app, all the more support it - the donation will be used to improve the app.")
text: qsTr("This is a free and open source application. If you like it, support the developers with a donation. ") +
qsTr("And if you dont like the application, all the more reason to support it - the donation will be used for the improving the application.")
color: "#CCCAC8"
}

Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Pages2/PageSettingsBackup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ PageType {
Layout.fillWidth: true
Layout.topMargin: -12

text: qsTr("It will help you instantly restore connection settings at the next installation")
text: qsTr("You can save your settings to a backup file to restore them the next time you install the application.")
color: "#878B91"
}

Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Pages2/PageSettingsConnection.qml
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ PageType {
Layout.fillWidth: true

text: qsTr("Split site tunneling")
descriptionText: qsTr("Allows you to connect to some sites through a secure connection, and to others bypassing it")
descriptionText: qsTr("Allows you to choose which sites you want to use the VPN for.")
rightImageSource: "qrc:/images/controls/chevron-right.svg"

clickedFunction: function() {
Expand Down
2 changes: 1 addition & 1 deletion client/ui/qml/Pages2/PageSettingsServerProtocol.qml
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ PageType {

clickedFunction: function() {
questionDrawer.headerText = qsTr("Remove %1 from server?").arg(ContainersModel.getCurrentlyProcessedContainerName())
questionDrawer.descriptionText = qsTr("All users with whom you shared a connection will no longer be able to connect to it")
questionDrawer.descriptionText = qsTr("All users who you shared a connection with will no longer be able to connect to it.")
questionDrawer.yesButtonText = qsTr("Continue")
questionDrawer.noButtonText = qsTr("Cancel")

Expand Down
10 changes: 0 additions & 10 deletions client/ui/qml/Pages2/PageSettingsServersList.qml
Original file line number Diff line number Diff line change
Expand Up @@ -34,20 +34,10 @@ PageType {
Layout.leftMargin: 16
Layout.rightMargin: 16

actionButtonImage: "qrc:/images/controls/plus.svg"

headerText: qsTr("Servers")

actionButtonFunction: function() {
connectionTypeSelection.visible = true
}
}
}

ConnectionTypeSelectionDrawer {
id: connectionTypeSelection
}

FlickableType {
anchors.top: header.bottom
anchors.topMargin: 16
Expand Down
6 changes: 1 addition & 5 deletions client/ui/qml/Pages2/PageSetupWizardInstalling.qml
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ PageType {

function onInstallServerFinished(finishedMessage) {
PageController.goToStartPage()
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
PageController.restorePageHomeState()
} else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) {
PageController.goToPage(PageEnum.PageSettingsServersList, false)
} else {
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) {
PageController.replaceStartPage()
}

Expand Down
6 changes: 1 addition & 5 deletions client/ui/qml/Pages2/PageSetupWizardViewConfig.qml
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,7 @@ PageType {

function onImportFinished() {
PageController.goToStartPage()
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageHome)) {
PageController.restorePageHomeState()
} else if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSettings)) {
PageController.goToPage(PageEnum.PageSettingsServersList, false)
} else {
if (stackView.currentItem.objectName === PageController.getPagePath(PageEnum.PageSetupWizardStart)) {
PageController.replaceStartPage()
}
}
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 @@ -187,7 +187,7 @@ PageType {

drawerHeight: 0.4375

descriptionText: qsTr("Servers")
descriptionText: qsTr("Server")
headerText: qsTr("Server")

listView: ListViewWithRadioButtonType {
Expand Down
35 changes: 31 additions & 4 deletions client/ui/qml/Pages2/PageStart.qml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import "./"
import "../Controls2"
import "../Controls2/TextTypes"
import "../Config"
import "../Components"

PageType {
id: root
Expand All @@ -17,14 +18,14 @@ PageType {
target: PageController

function onGoToPageHome() {
tabBar.currentIndex = 0
tabBar.setCurrentIndex(0)
tabBarStackView.goToTabBarPage(PageEnum.PageHome)

PageController.updateDrawerRootPage(PageEnum.PageHome)
}

function onGoToPageSettings() {
tabBar.currentIndex = 2
tabBar.setCurrentIndex(2)
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)

PageController.updateDrawerRootPage(PageEnum.PageSettings)
Expand Down Expand Up @@ -70,6 +71,7 @@ PageType {
}

function onGoToStartPage() {
connectionTypeSelection.close()
while (tabBarStackView.depth > 1) {
tabBarStackView.pop()
}
Expand Down Expand Up @@ -120,6 +122,8 @@ PageType {
height: root.height - tabBar.implicitHeight

function goToTabBarPage(page) {
connectionTypeSelection.close()

var pagePath = PageController.getPagePath(page)
tabBarStackView.clear(StackView.Immediate)
tabBarStackView.replace(pagePath, { "objectName" : pagePath }, StackView.Immediate)
Expand All @@ -137,14 +141,16 @@ PageType {
TabBar {
id: tabBar

property int previousIndex: 0

anchors.right: parent.right
anchors.left: parent.left
anchors.bottom: parent.bottom

topPadding: 8
bottomPadding: 8
leftPadding: shareTabButton.visible ? 96 : 128
rightPadding: shareTabButton.visible ? 96 : 128
leftPadding: 96
rightPadding: 96

background: Shape {
width: parent.width
Expand All @@ -171,8 +177,10 @@ PageType {
onClicked: {
tabBarStackView.goToTabBarPage(PageEnum.PageHome)
ServersModel.currentlyProcessedIndex = ServersModel.defaultIndex
tabBar.previousIndex = 0
}
}

TabImageButtonType {
id: shareTabButton

Expand All @@ -193,13 +201,24 @@ PageType {
image: "qrc:/images/controls/share-2.svg"
onClicked: {
tabBarStackView.goToTabBarPage(PageEnum.PageShare)
tabBar.previousIndex = 1
}
}

TabImageButtonType {
isSelected: tabBar.currentIndex === 2
image: "qrc:/images/controls/settings-2.svg"
onClicked: {
tabBarStackView.goToTabBarPage(PageEnum.PageSettings)
tabBar.previousIndex = 2
}
}

TabImageButtonType {
isSelected: tabBar.currentIndex === 3
image: "qrc:/images/controls/plus.svg"
onClicked: {
connectionTypeSelection.open()
}
}
}
Expand All @@ -215,4 +234,12 @@ PageType {
x: tabBarStackView.width - topCloseButton.width
z: 1
}

ConnectionTypeSelectionDrawer {
id: connectionTypeSelection

onAboutToHide: {
tabBar.setCurrentIndex(tabBar.previousIndex)
}
}
}

0 comments on commit 45dc302

Please sign in to comment.