added a drawer to change the server name and moved the display of the exported config to a separate drawer

This commit is contained in:
vladimir.kuznetsov 2023-06-20 10:25:24 +09:00
parent 4224e8314b
commit 3a264e6baf
30 changed files with 276 additions and 159 deletions

View file

@ -1,3 +1,3 @@
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"> <svg width="24" height="24" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M11.944 3.26667e-05C8.77112 0.0148396 5.73324 1.28566 3.4949 3.53449C1.25656 5.78332 -3.4549e-05 8.82711 7.12435e-10 12C7.12441e-10 15.1826 1.26428 18.2349 3.51472 20.4853C5.76515 22.7358 8.8174 24 12 24C15.1826 24 18.2348 22.7358 20.4853 20.4853C22.7357 18.2349 24 15.1826 24 12C24 8.81743 22.7357 5.76519 20.4853 3.51475C18.2348 1.26431 15.1826 3.26667e-05 12 3.26667e-05C11.9813 -1.08889e-05 11.9627 -1.08889e-05 11.944 3.26667e-05ZM16.906 7.22403C17.006 7.22203 17.227 7.24703 17.371 7.36403C17.4667 7.44713 17.5277 7.56311 17.542 7.68903C17.558 7.78203 17.578 7.99503 17.562 8.16103C17.382 10.059 16.6 14.663 16.202 16.788C16.034 17.688 15.703 17.989 15.382 18.018C14.686 18.083 14.157 17.558 13.482 17.116C12.426 16.423 11.829 15.992 10.804 15.316C9.619 14.536 10.387 14.106 11.062 13.406C11.239 13.222 14.309 10.429 14.369 10.176C14.376 10.144 14.383 10.026 14.313 9.96403C14.243 9.90203 14.139 9.92303 14.064 9.94003C13.958 9.96403 12.271 11.08 9.003 13.285C8.523 13.615 8.09 13.775 7.701 13.765C7.273 13.757 6.449 13.524 5.836 13.325C5.084 13.08 4.487 12.951 4.539 12.536C4.566 12.32 4.864 12.099 5.432 11.873C8.93 10.349 11.262 9.34403 12.43 8.85903C15.762 7.47303 16.455 7.23203 16.906 7.22403Z" fill="#D7D8DB"/> <path fill-rule="evenodd" clip-rule="evenodd" d="M3.44009 10.8882C8.78796 8.6139 12.3627 7.1439 14.1358 6.42277C19.2263 4.37033 20.2844 4.00977 20.9708 4.00977C21.1138 4.00977 21.457 4.0375 21.6857 4.20392C21.8573 4.34259 21.9145 4.53674 21.9431 4.67542C21.9717 4.8141 22.0003 5.11919 21.9717 5.36882C21.6857 8.17012 20.5132 15.0208 19.8841 18.155C19.6267 19.4863 19.1119 19.9301 18.6257 19.9855C17.5676 20.0687 16.7383 19.2921 15.7087 18.6542C14.1072 17.628 13.408 17.1299 11.8351 16.1314C10.0334 14.9665 11.2059 14.3286 12.2355 13.3024C12.4929 13.025 16.9956 8.75257 17.0814 8.36427C17.0814 8.3088 17.11 8.14239 16.9956 8.05918C16.8812 7.97597 16.7383 8.00371 16.6239 8.03145C16.4523 8.05918 13.8784 9.72332 8.87375 12.9961C8.1302 13.4954 7.47244 13.7173 6.87188 13.7173C6.21412 13.7173 4.9558 13.3567 4.01206 13.0516C2.86813 12.691 1.95299 12.4969 2.03878 11.8867C2.12458 11.5539 2.58215 11.2211 3.44009 10.8882Z" stroke="#D7D8DB" stroke-width="2"/>
</svg> </svg>

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1 KiB

Before After
Before After

View file

@ -32,9 +32,8 @@ ConnectionController::ConnectionController(const QSharedPointer<ServersModel> &s
void ConnectionController::openConnection() void ConnectionController::openConnection()
{ {
int serverIndex = m_serversModel->getDefaultServerIndex(); int serverIndex = m_serversModel->getDefaultServerIndex();
QModelIndex serverModelIndex = m_serversModel->index(serverIndex); ServerCredentials credentials = qvariant_cast<ServerCredentials>(
ServerCredentials credentials = qvariant_cast<ServerCredentials>(m_serversModel->data(serverModelIndex, m_serversModel->data(serverIndex, ServersModel::ServersModelRoles::CredentialsRole));
ServersModel::ServersModelRoles::CredentialsRole));
DockerContainer container = m_containersModel->getDefaultContainer(); DockerContainer container = m_containersModel->getDefaultContainer();
QModelIndex containerModelIndex = m_containersModel->index(container); QModelIndex containerModelIndex = m_containersModel->index(container);

View file

@ -43,7 +43,8 @@ void ExportController::generateFullAccessConfig()
void ExportController::generateConnectionConfig() void ExportController::generateConnectionConfig()
{ {
int serverIndex = m_serversModel->getCurrentlyProcessedServerIndex(); int serverIndex = m_serversModel->getCurrentlyProcessedServerIndex();
ServerCredentials credentials = m_serversModel->getCurrentlyProcessedServerCredentials(); ServerCredentials credentials = qvariant_cast<ServerCredentials>(
m_serversModel->data(serverIndex, ServersModel::ServersModelRoles::CredentialsRole));
DockerContainer container = static_cast<DockerContainer>( DockerContainer container = static_cast<DockerContainer>(
m_containersModel->getCurrentlyProcessedContainerIndex()); m_containersModel->getCurrentlyProcessedContainerIndex());

View file

@ -61,7 +61,9 @@ void InstallController::installServer(DockerContainer container, QJsonObject& co
void InstallController::installContainer(DockerContainer container, QJsonObject& config) void InstallController::installContainer(DockerContainer container, QJsonObject& config)
{ {
//todo check if container already installed //todo check if container already installed
ServerCredentials serverCredentials = m_serversModel->getCurrentlyProcessedServerCredentials(); int serverIndex = m_serversModel->getCurrentlyProcessedServerIndex();
ServerCredentials serverCredentials = qvariant_cast<ServerCredentials>(
m_serversModel->data(serverIndex, ServersModel::ServersModelRoles::CredentialsRole));
ServerController serverController(m_settings); ServerController serverController(m_settings);
ErrorCode errorCode = serverController.setupContainer(serverCredentials, container, config); ErrorCode errorCode = serverController.setupContainer(serverCredentials, container, config);

View file

@ -19,12 +19,23 @@ bool ServersModel::setData(const QModelIndex &index, const QVariant &value, int
return false; return false;
} }
QJsonObject server = m_servers.at(index.row()).toObject();
switch (role) { switch (role) {
case IsDefaultRole: { case NameRole: {
m_settings->setDefaultServer(index.row()); server.insert(config_key::description, value.toString());
m_defaultServerIndex = m_settings->defaultServerIndex(); m_settings->editServer(index.row(), server);
} m_servers.replace(index.row(), server);
default: return true; break;
}
case IsDefaultRole: {
m_settings->setDefaultServer(index.row());
m_defaultServerIndex = m_settings->defaultServerIndex();
break;
}
default: {
return true;
}
} }
emit dataChanged(index, index); emit dataChanged(index, index);
@ -51,6 +62,8 @@ QVariant ServersModel::data(const QModelIndex &index, int role) const
return server.value(config_key::hostName).toString(); return server.value(config_key::hostName).toString();
case CredentialsRole: case CredentialsRole:
return QVariant::fromValue(m_settings->serverCredentials(index.row())); return QVariant::fromValue(m_settings->serverCredentials(index.row()));
case CredentialsLoginRole:
return m_settings->serverCredentials(index.row()).userName;
case IsDefaultRole: case IsDefaultRole:
return index.row() == m_defaultServerIndex; return index.row() == m_defaultServerIndex;
case IsCurrentlyProcessedRole: case IsCurrentlyProcessedRole:
@ -60,6 +73,12 @@ QVariant ServersModel::data(const QModelIndex &index, int role) const
return QVariant(); return QVariant();
} }
QVariant ServersModel::data(const int index, int role) const
{
QModelIndex modelIndex = this->index(index);
return data(modelIndex, role);
}
const int ServersModel::getDefaultServerIndex() const int ServersModel::getDefaultServerIndex()
{ {
return m_defaultServerIndex; return m_defaultServerIndex;
@ -85,11 +104,6 @@ bool ServersModel::isDefaultServerCurrentlyProcessed()
return m_defaultServerIndex == m_currenlyProcessedServerIndex; return m_defaultServerIndex == m_currenlyProcessedServerIndex;
} }
ServerCredentials ServersModel::getCurrentlyProcessedServerCredentials()
{
return qvariant_cast<ServerCredentials>(data(index(m_currenlyProcessedServerIndex), CredentialsRole));
}
void ServersModel::addServer(const QJsonObject &server) void ServersModel::addServer(const QJsonObject &server)
{ {
beginResetModel(); beginResetModel();
@ -121,6 +135,7 @@ QHash<int, QByteArray> ServersModel::roleNames() const {
roles[NameRole] = "name"; roles[NameRole] = "name";
roles[HostNameRole] = "hostName"; roles[HostNameRole] = "hostName";
roles[CredentialsRole] = "credentials"; roles[CredentialsRole] = "credentials";
roles[CredentialsLoginRole] = "credentialsLogin";
roles[IsDefaultRole] = "isDefault"; roles[IsDefaultRole] = "isDefault";
roles[IsCurrentlyProcessedRole] = "isCurrentlyProcessed"; roles[IsCurrentlyProcessedRole] = "isCurrentlyProcessed";
return roles; return roles;

View file

@ -19,6 +19,7 @@ public:
NameRole = Qt::UserRole + 1, NameRole = Qt::UserRole + 1,
HostNameRole, HostNameRole,
CredentialsRole, CredentialsRole,
CredentialsLoginRole,
IsDefaultRole, IsDefaultRole,
IsCurrentlyProcessedRole IsCurrentlyProcessedRole
}; };
@ -29,6 +30,7 @@ public:
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override; QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QVariant data(const int index, int role = Qt::DisplayRole) const;
public slots: public slots:
const int getDefaultServerIndex(); const int getDefaultServerIndex();
@ -38,7 +40,6 @@ public slots:
void setCurrentlyProcessedServerIndex(int index); void setCurrentlyProcessedServerIndex(int index);
int getCurrentlyProcessedServerIndex(); int getCurrentlyProcessedServerIndex();
ServerCredentials getCurrentlyProcessedServerCredentials();
void addServer(const QJsonObject &server); void addServer(const QJsonObject &server);
void removeServer(); void removeServer();

View file

@ -36,7 +36,7 @@ DrawerType {
Layout.topMargin: 16 Layout.topMargin: 16
text: "IP, логин и пароль от сервера" text: "IP, логин и пароль от сервера"
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSetupWizardCredentials) goToPage(PageEnum.PageSetupWizardCredentials)
@ -50,7 +50,7 @@ DrawerType {
Layout.fillWidth: true Layout.fillWidth: true
text: "QR-код, ключ или файл настроек" text: "QR-код, ключ или файл настроек"
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSetupWizardConfigSource) goToPage(PageEnum.PageSetupWizardConfigSource)

View file

@ -16,11 +16,12 @@ DrawerType {
id: root id: root
property alias headerText: header.headerText property alias headerText: header.headerText
property alias configContentHeaderText: configContentHeader.headerText
width: parent.width width: parent.width
height: parent.height * 0.9 height: parent.height * 0.9
Item{ Item {
anchors.fill: parent anchors.fill: parent
FlickableType { FlickableType {
@ -86,46 +87,77 @@ DrawerType {
disabledColor: "#878B91" disabledColor: "#878B91"
textColor: "#D7D8DB" textColor: "#D7D8DB"
text: showContent ? qsTr("Collapse content") : qsTr("Show content") text: qsTr("Show content")
onClicked: { onClicked: {
showContent = !showContent configContentDrawer.visible = true
} }
} }
Rectangle { DrawerType {
Layout.fillWidth: true id: configContentDrawer
Layout.preferredHeight: configContent.implicitHeight + configContent.anchors.topMargin + configContent.anchors.bottomMargin
radius: 10 width: parent.width
color: "#2C2D30" height: parent.height * 0.9
visible: showContent BackButtonType {
id: backButton
height: 24 anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.rightMargin: 16
anchors.leftMargin: 16
anchors.topMargin: 16
TextField { backButtonFunction: function() {
id: configContent configContentDrawer.visible = false
}
}
anchors.fill: parent FlickableType {
anchors.margins: 16 anchors.top: backButton.bottom
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
contentHeight: configContent.implicitHeight + configContent.anchors.topMargin + configContent.anchors.bottomMargin
height: 24 ColumnLayout {
id: configContent
color: "#D7D8DB"
font.pixelSize: 16
font.weight: Font.Medium
font.family: "PT Root UI VF"
text: ExportController.amneziaCode
wrapMode: Text.Wrap
enabled: false
background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: "transparent" anchors.rightMargin: 16
anchors.leftMargin: 16
Header2Type {
id: configContentHeader
Layout.fillWidth: true
Layout.topMargin: 16
}
TextField {
Layout.fillWidth: true
Layout.topMargin: 16
Layout.bottomMargin: 16
padding: 0
height: 24
color: "#D7D8DB"
font.pixelSize: 16
font.weight: Font.Medium
font.family: "PT Root UI VF"
text: ExportController.amneziaCode
wrapMode: Text.Wrap
readOnly: true
background: Rectangle {
color: "transparent"
}
}
} }
} }
} }
@ -143,17 +175,19 @@ DrawerType {
anchors.fill: parent anchors.fill: parent
smooth: false smooth: false
source: ExportController.qrCodesCount ? ExportController.qrCodes[0] : ""
Timer { Timer {
property int idx: 0 property int index: 0
interval: 1000 interval: 1000
running: ExportController.qrCodesCount > 0 running: ExportController.qrCodesCount > 0
repeat: true repeat: true
onTriggered: { onTriggered: {
idx++ index++
if (idx >= ExportController.qrCodesCount) { if (index >= ExportController.qrCodesCount) {
idx = 0 index = 0
} }
parent.source = ExportController.qrCodes[idx] parent.source = ExportController.qrCodes[index]
} }
} }

View file

@ -12,8 +12,8 @@ Item {
property var clickedFunction property var clickedFunction
property alias buttonImage: button.image property string rightImageSource
property string iconImage property string leftImageSource
property string textColor: "#d7d8db" property string textColor: "#d7d8db"
@ -26,17 +26,34 @@ Item {
anchors.leftMargin: 16 anchors.leftMargin: 16
anchors.rightMargin: 16 anchors.rightMargin: 16
Image { Rectangle {
id: icon id: leftImageBackground
source: iconImage
visible: iconImage ? true : false visible: leftImageSource ? true : false
Layout.rightMargin: visible ? 16 : 0
Layout.preferredHeight: rightImageSource ? leftImage.implicitHeight : 56
Layout.preferredWidth: rightImageSource ? leftImage.implicitWidth : 56
Layout.rightMargin: rightImageSource ? 16 : 0
radius: 12
color: "transparent"
Behavior on color {
PropertyAnimation { duration: 200 }
}
Image {
id: leftImage
anchors.centerIn: parent
source: leftImageSource
}
} }
ColumnLayout { ColumnLayout {
ListItemTitleType { ListItemTitleType {
text: root.text text: root.text
color: textColor color: root.textColor
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16 Layout.topMargin: 16
@ -63,25 +80,20 @@ Item {
} }
ImageButtonType { ImageButtonType {
id: button id: rightImage
hoverEnabled: false hoverEnabled: false
image: buttonImage image: rightImageSource
onClicked: { visible: rightImageSource ? true : false
if (clickedFunction && typeof clickedFunction === "function") {
clickedFunction()
}
}
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
Rectangle { Rectangle {
id: imageBackground id: rightImageBackground
anchors.fill: button anchors.fill: parent
radius: 12 radius: 12
color: "transparent" color: "transparent"
Behavior on color { Behavior on color {
PropertyAnimation { duration: 200 } PropertyAnimation { duration: 200 }
} }
@ -106,31 +118,39 @@ Item {
hoverEnabled: true hoverEnabled: true
onEntered: { onEntered: {
if (buttonImage) { if (rightImageSource) {
imageBackground.color = button.hoveredColor rightImageBackground.color = rightImage.hoveredColor
} else if (leftImageSource) {
leftImageBackground.color = rightImage.hoveredColor
} else { } else {
background.color = button.hoveredColor background.color = rightImage.hoveredColor
} }
} }
onExited: { onExited: {
if (buttonImage) { if (rightImageSource) {
imageBackground.color = button.defaultColor rightImageBackground.color = rightImage.defaultColor
} else if (leftImageSource) {
leftImageBackground.color = rightImage.defaultColor
} else { } else {
background.color = button.defaultColor background.color = rightImage.defaultColor
} }
} }
onPressedChanged: { onPressedChanged: {
if (buttonImage) { if (rightImageSource) {
imageBackground.color = pressed ? button.pressedColor : entered ? button.hoveredColor : button.defaultColor rightImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor
} else if (leftImageSource) {
leftImageBackground.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor
} else { } else {
background.color = pressed ? button.pressedColor : entered ? button.hoveredColor : button.defaultColor background.color = pressed ? rightImage.pressedColor : entered ? rightImage.hoveredColor : rightImage.defaultColor
} }
} }
onClicked: { onClicked: {
button.clicked() if (clickedFunction && typeof clickedFunction === "function") {
clickedFunction()
}
} }
} }
} }

View file

@ -31,7 +31,6 @@ ListView {
id: content id: content
anchors.fill: parent anchors.fill: parent
spacing: 16
RadioButton { RadioButton {
id: radioButton id: radioButton
@ -92,7 +91,7 @@ ListView {
DividerType { DividerType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.bottomMargin: 16 Layout.bottomMargin: 4
visible: dividerVisible visible: dividerVisible
} }

View file

@ -51,7 +51,6 @@ PageType {
Rectangle { Rectangle {
id: buttonBackground id: buttonBackground
anchors.fill: buttonContent anchors.fill: buttonContent
anchors.bottomMargin: -radius
radius: 16 radius: 16
color: root.defaultColor color: root.defaultColor
@ -59,11 +58,12 @@ PageType {
border.width: 1 border.width: 1
Rectangle { Rectangle {
width: parent.width width: parent.radius
height: 1 height: parent.radius
y: parent.height - height - parent.radius anchors.bottom: parent.bottom
anchors.right: parent.right
color: root.borderColor anchors.left: parent.left
color: parent.color
} }
} }

View file

@ -15,8 +15,8 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: root.top anchors.top: parent.top
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {
@ -40,8 +40,8 @@ PageType {
Layout.topMargin: 16 Layout.topMargin: 16
text: qsTr("Servers") text: qsTr("Servers")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/server.svg" leftImageSource: "qrc:/images/controls/server.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsServersList) goToPage(PageEnum.PageSettingsServersList)
@ -54,8 +54,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Connection") text: qsTr("Connection")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/radio.svg" leftImageSource: "qrc:/images/controls/radio.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsConnection) goToPage(PageEnum.PageSettingsConnection)
@ -68,8 +68,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Application") text: qsTr("Application")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/app.svg" leftImageSource: "qrc:/images/controls/app.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsApplication) goToPage(PageEnum.PageSettingsApplication)
@ -82,8 +82,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Backup") text: qsTr("Backup")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/save.svg" leftImageSource: "qrc:/images/controls/save.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsBackup) goToPage(PageEnum.PageSettingsBackup)
@ -96,8 +96,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("About AmneziaVPN") text: qsTr("About AmneziaVPN")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/amnezia.svg" leftImageSource: "qrc:/images/controls/amnezia.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsAbout) goToPage(PageEnum.PageSettingsAbout)

View file

@ -27,7 +27,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {
@ -102,8 +102,7 @@ And if you don't like the app, all the more support it - the donation will be us
text: qsTr("Show other methods on Github") text: qsTr("Show other methods on Github")
onClicked: { onClicked: Qt.openUrlExternally("https://github.com/amnezia-vpn/amnezia-client")
}
} }
ParagraphTextType { ParagraphTextType {
@ -121,11 +120,10 @@ And if you don't like the app, all the more support it - the donation will be us
text: qsTr("Telegram group") text: qsTr("Telegram group")
descriptionText: qsTr("To discuss features") descriptionText: qsTr("To discuss features")
buttonImage: "qrc:/images/controls/chevron-right.svg" leftImageSource: "qrc:/images/controls/telegram.svg"
iconImage: "qrc:/images/controls/telegram.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsAbout) Qt.openUrlExternally("https://t.me/amnezia_vpn_dev")
} }
} }
@ -136,11 +134,9 @@ And if you don't like the app, all the more support it - the donation will be us
text: qsTr("Mail") text: qsTr("Mail")
descriptionText: qsTr("For reviews and bug reports") descriptionText: qsTr("For reviews and bug reports")
buttonImage: "qrc:/images/controls/chevron-right.svg" leftImageSource: "qrc:/images/controls/mail.svg"
iconImage: "qrc:/images/controls/mail.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsAbout)
} }
} }
@ -150,11 +146,10 @@ And if you don't like the app, all the more support it - the donation will be us
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Github") text: qsTr("Github")
buttonImage: "qrc:/images/controls/chevron-right.svg" leftImageSource: "qrc:/images/controls/github.svg"
iconImage: "qrc:/images/controls/github.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsAbout) Qt.openUrlExternally("https://github.com/amnezia-vpn/amnezia-client")
} }
} }
@ -164,11 +159,9 @@ And if you don't like the app, all the more support it - the donation will be us
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Website") text: qsTr("Website")
buttonImage: "qrc:/images/controls/chevron-right.svg" leftImageSource: "qrc:/images/controls/amnezia.svg"
iconImage: "qrc:/images/controls/amnezia.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsAbout)
} }
} }

View file

@ -26,7 +26,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {
@ -35,22 +35,21 @@ PageType {
anchors.top: parent.top anchors.top: parent.top
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
anchors.leftMargin: 16
anchors.rightMargin: 16
spacing: 16
HeaderType { HeaderType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: 16
Layout.rightMargin: 16
headerText: qsTr("Application") headerText: qsTr("Application")
} }
LabelWithButtonType { LabelWithButtonType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16
text: qsTr("Language") text: qsTr("Language")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
} }
@ -62,7 +61,7 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
text: qsTr("Reset settings and remove all data from the application") text: qsTr("Reset settings and remove all data from the application")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
} }

View file

@ -26,7 +26,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {

View file

@ -25,7 +25,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {
@ -35,8 +35,6 @@ PageType {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
spacing: 16
HeaderType { HeaderType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: 16 Layout.leftMargin: 16
@ -47,6 +45,8 @@ PageType {
SwitcherType { SwitcherType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 16
Layout.bottomMargin: 16
Layout.leftMargin: 16 Layout.leftMargin: 16
Layout.rightMargin: 16 Layout.rightMargin: 16
@ -68,7 +68,7 @@ PageType {
text: qsTr("DNS servers") text: qsTr("DNS servers")
descriptionText: qsTr("If AmneziaDNS is not used or installed") descriptionText: qsTr("If AmneziaDNS is not used or installed")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSettingsDns) goToPage(PageEnum.PageSettingsDns)
@ -82,7 +82,7 @@ PageType {
text: qsTr("Split site tunneling") 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 connect to some sites through a secure connection, and to others bypassing it")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
} }
@ -95,7 +95,7 @@ PageType {
text: qsTr("Separate application tunneling") text: qsTr("Separate application tunneling")
descriptionText: qsTr("Allows you to use the VPN only for certain applications") descriptionText: qsTr("Allows you to use the VPN only for certain applications")
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
} }

View file

@ -26,7 +26,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {

View file

@ -16,8 +16,8 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: root.top anchors.top: parent.top
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {

View file

@ -54,10 +54,60 @@ PageType {
actionButtonImage: "qrc:/images/controls/edit-3.svg" actionButtonImage: "qrc:/images/controls/edit-3.svg"
headerText: name headerText: name
descriptionText: hostName descriptionText: credentialsLogin + " · " + hostName
actionButtonFunction: function() { actionButtonFunction: function() {
connectionTypeSelection.visible = true serverNameEditDrawer.visible = true
}
}
DrawerType {
id: serverNameEditDrawer
width: root.width
height: root.height * 0.35
onVisibleChanged: {
if (serverNameEditDrawer.visible) {
serverName.textField.forceActiveFocus()
}
}
ColumnLayout {
anchors.top: parent.top
anchors.left: parent.left
anchors.right: parent.right
anchors.topMargin: 16
anchors.leftMargin: 16
anchors.rightMargin: 16
TextFieldWithHeaderType {
id: serverName
Layout.fillWidth: true
headerText: qsTr("Server name")
textFieldText: name
}
BasicButtonType {
Layout.fillWidth: true
defaultColor: "transparent"
hoveredColor: Qt.rgba(1, 1, 1, 0.08)
pressedColor: Qt.rgba(1, 1, 1, 0.12)
disabledColor: "#878B91"
textColor: "#D7D8DB"
borderWidth: 1
text: qsTr("Save")
onClicked: {
if (serverName.textFieldText !== name) {
name = serverName.textFieldText
serverNameEditDrawer.visible = false
}
}
}
} }
} }
} }

View file

@ -86,7 +86,7 @@ PageType {
text: name text: name
descriptionText: hostName descriptionText: hostName
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
ServersModel.setCurrentlyProcessedServerIndex(index) ServersModel.setCurrentlyProcessedServerIndex(index)

View file

@ -15,8 +15,8 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: root.top anchors.top: parent.top
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {
@ -58,8 +58,8 @@ PageType {
Layout.topMargin: 16 Layout.topMargin: 16
text: "Файл с настройками подключения" text: "Файл с настройками подключения"
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/folder-open.svg" leftImageSource: "qrc:/images/controls/folder-open.svg"
clickedFunction: function() { clickedFunction: function() {
onClicked: fileDialog.open() onClicked: fileDialog.open()
@ -81,8 +81,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
text: "QR-код" text: "QR-код"
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/qr-code.svg" leftImageSource: "qrc:/images/controls/qr-code.svg"
clickedFunction: function() { clickedFunction: function() {
} }
@ -94,8 +94,8 @@ PageType {
Layout.fillWidth: true Layout.fillWidth: true
text: "Ключ в виде текста" text: "Ключ в виде текста"
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
iconImage: "qrc:/images/controls/text-cursor.svg" leftImageSource: "qrc:/images/controls/text-cursor.svg"
clickedFunction: function() { clickedFunction: function() {
goToPage(PageEnum.PageSetupWizardTextKey) goToPage(PageEnum.PageSetupWizardTextKey)

View file

@ -25,7 +25,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {

View file

@ -44,7 +44,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.implicitHeight + continueButton.anchors.bottomMargin contentHeight: content.implicitHeight + continueButton.anchors.bottomMargin
Column { Column {

View file

@ -32,8 +32,8 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: root.top anchors.top: parent.top
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
Column { Column {
@ -87,7 +87,7 @@ PageType {
text: name text: name
descriptionText: description descriptionText: description
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
clickedFunction: function() { clickedFunction: function() {
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index)) ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(index))

View file

@ -24,8 +24,8 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: root.top anchors.top: parent.top
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {

View file

@ -14,8 +14,8 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: root.top anchors.top: parent.top
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {

View file

@ -50,7 +50,7 @@ PageType {
FlickableType { FlickableType {
id: fl id: fl
anchors.top: backButton.bottom anchors.top: backButton.bottom
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.implicitHeight + connectButton.implicitHeight contentHeight: content.implicitHeight + connectButton.implicitHeight
ColumnLayout { ColumnLayout {

View file

@ -56,8 +56,8 @@ PageType {
} }
FlickableType { FlickableType {
anchors.top: root.top anchors.top: parent.top
anchors.bottom: root.bottom anchors.bottom: parent.bottom
contentHeight: content.height contentHeight: content.height
ColumnLayout { ColumnLayout {
@ -121,6 +121,7 @@ PageType {
ParagraphTextType { ParagraphTextType {
Layout.fillWidth: true Layout.fillWidth: true
Layout.topMargin: 24
text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") : text: accessTypeSelector.currentIndex === 0 ? qsTr("VPN access without the ability to manage the server") :
qsTr("Full access to server") qsTr("Full access to server")
@ -222,7 +223,6 @@ PageType {
roleName: "isInstalled" roleName: "isInstalled"
value: true value: true
} }
] ]
} }
@ -231,6 +231,7 @@ PageType {
clickedFunction: function () { clickedFunction: function () {
serverSelector.text += ", " + selectedText serverSelector.text += ", " + selectedText
shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(currentIndex)) ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(currentIndex))
protocolSelector.visible = false protocolSelector.visible = false
@ -242,6 +243,7 @@ PageType {
Component.onCompleted: { Component.onCompleted: {
serverSelector.text += ", " + selectedText serverSelector.text += ", " + selectedText
shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text shareConnectionDrawer.headerText = qsTr("Connection to ") + serverSelector.text
shareConnectionDrawer.configContentHeaderText = qsTr("File with connection settings to ") + serverSelector.text
ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(currentIndex)) ContainersModel.setCurrentlyProcessedContainerIndex(proxyContainersModel.mapToSource(currentIndex))
fillConnectionTypeModel() fillConnectionTypeModel()

View file

@ -59,11 +59,13 @@ PageType {
anchors.bottom: parent.bottom anchors.bottom: parent.bottom
topPadding: 8 topPadding: 8
bottomPadding: 34 bottomPadding: 8//34
leftPadding: 96 leftPadding: 96
rightPadding: 96 rightPadding: 96
background: Rectangle { background: Rectangle {
border.width: 1
border.color: "#2C2D30"
color: "#1C1D21" color: "#1C1D21"
} }

View file

@ -122,7 +122,7 @@ Item {
Layout.rightMargin: 16 Layout.rightMargin: 16
text: "IP, логин и пароль от сервера" text: "IP, логин и пароль от сервера"
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
} }
Rectangle { Rectangle {
@ -139,7 +139,7 @@ Item {
Layout.rightMargin: 16 Layout.rightMargin: 16
text: "QR-код, ключ или файл настроек" text: "QR-код, ключ или файл настроек"
buttonImage: "qrc:/images/controls/chevron-right.svg" rightImageSource: "qrc:/images/controls/chevron-right.svg"
} }
Rectangle { Rectangle {