From 1b57b5b0c6411e24d79a6e02496c521a6cc4195b Mon Sep 17 00:00:00 2001 From: Dan Ballard Date: Mon, 19 Oct 2020 15:46:40 -0700 Subject: [PATCH] redesign of profile add / edit pane --- ...account_circle-24px_lines_thin-blocked.svg | 22 + .../account_circle-24px_negative_space.svg | 17 + i18n/translation_de.ts | 108 ++-- i18n/translation_en.qm | Bin 8325 -> 8499 bytes i18n/translation_en.ts | 115 +++-- i18n/translation_fr.ts | 108 ++-- i18n/translation_pt.ts | 108 ++-- qml/opaque | 2 +- qml/panes/GroupSettingsPane.qml | 100 ++-- qml/panes/OverlayPane.qml | 8 +- qml/panes/PeerSettingsPane.qml | 1 + qml/panes/ProfileAddEditPane.qml | 469 ++++++++++++------ qml/panes/ProfileManagerPane.qml | 5 +- qml/panes/ServerInfoPane.qml | 52 +- qml/panes/SettingsPane.qml | 1 + qml/widgets/ProfileRow.qml | 2 +- 16 files changed, 682 insertions(+), 436 deletions(-) create mode 100644 assets/core/account_circle-24px_lines_thin-blocked.svg create mode 100644 assets/core/account_circle-24px_negative_space.svg diff --git a/assets/core/account_circle-24px_lines_thin-blocked.svg b/assets/core/account_circle-24px_lines_thin-blocked.svg new file mode 100644 index 00000000..5c3b9b7a --- /dev/null +++ b/assets/core/account_circle-24px_lines_thin-blocked.svg @@ -0,0 +1,22 @@ + + + + + + + + + + + + + diff --git a/assets/core/account_circle-24px_negative_space.svg b/assets/core/account_circle-24px_negative_space.svg new file mode 100644 index 00000000..c9c4f83c --- /dev/null +++ b/assets/core/account_circle-24px_negative_space.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index 68ad72ff..40bee578 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -292,55 +292,55 @@ PeerSettingsPane - + address-label Adresse - + copy-btn Kopieren - + copied-to-clipboard-notification notification: copied to clipboard in die Zwischenablage kopiert - + display-name-label Angezeigter Name - + save-btn speichern - - + + save-peer-history Save Peer History - + save-peer-history-description - + dont-save-peer-history - + delete-btn löschen - + block-btn @@ -348,114 +348,120 @@ ProfileAddEditPane - - + + default-profile-name default suggested profile name - + profile-onion-label - Onion + Send this address to peers you want to connect with - + copy-btn Kopieren - + copied-to-clipboard-notification notification: copied to clipboard in die Zwischenablage kopiert - - profile-name - Display name - - - - + radio-use-password Password - + radio-no-password Unencrypted (No password) - + no-password-warning Not using a password on this account means that all data stored locally will not be encrypted - + + new-profile + New Profile || Edit Profile + + + + + edit-profile + + + + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn - Create Profile || Save Profile + Create || Save - + save-profile-btn - + password-error-match Passwords do not match - + password-change-error Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile - + + delete-confirm-label Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile - + delete-confirm-text DELETE @@ -520,66 +526,66 @@ Benutzeroberflächen-Zoom (betriftt hauptsächlich Text- und Knopgrößen) - + setting-language Language - + locale-en - + locale-fr - + locale-pt - + locale-de - + setting-interface-zoom Interface Zoom - + large-text-label Groß - + setting-theme Theme - + theme-light - + theme-dark - + version %1 Version %1 - + builddate %2 Built on: %2 @@ -590,7 +596,7 @@ defaultmäßige Textgröße (Skalierungsfaktor: - + small-text-label Klein diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index a0a111b16aa4c6340d78c53f387bff5a608fcb9b..5a0195a72bc93856d46f05034b5cbc20b8673c8f 100644 GIT binary patch delta 642 zcmXv~TT4_?7+w3EJeN5$jx!uDGfpZIL5&ht{s6^!neqZbNtcJvGZ&L_P-6&`$g(hB zlJn3*Ao(C&um~nAi2`*3i<*cDilT==Dsl=0r2?bYD6u(wXRYtsYprjOG^U#_n`ai` zNzMSuXQ3>v1Nt{n`)C>vheYc$3-In1XO9&Dm2F}=_y+Lo6t{D=fV?agzh;55zv7ji z1AHaYJ}>*_52TLf!$9D>WWS?M>2W#OJq1)5@_A)Hb>`)ptAl_sE9aFyV0^67J<&cv z;&;*O)C&$=9Dm%}v^AzaZMX_ljH>zTLx6ul6G|b@pym&lv}xBmJQ+@}X)*H-W8Bro z3@_t1Yqvfv@m|;tiR#9AyrM9i|+DVtY{|O&9<7&AQ;zq@;=m>em z?;4x@!i_WbkknTE&^;YFKuOMAWbeuU74I0jIIcJ!ea5uzR*OQSy&eom_^ zK2VqJ>y5;FEW6$esAXt{g_ONg;d2@ZEA_vbUNL8+Xaon@O;ERnx-shY^X~+47ac63 r0v@1O4U)tb*#dK#%qi9sXA>KVHfK7?CwMG$Zm_A1ys`9p`Ka~}$G@lC delta 482 zcmdn&)ap1vMDYNFV8K=f2DWF6Y$yIOFmS$N)Y-j;fq^lMu`z~~fkA5JL|bvgNXGM= zml+r&vY1SSt}rl&3o=ExgflS6xHC<@0aPq1%&eWYlz~AumAQq@n}I=EW@4+RxU{q> z1B1v3)_DQ*7#O&JvR*7d12pg9#Jzr2GKbiYn$89q^qBq4@>-y%EQgeg2m^!IDvk)j zBR~WEIWk1n0r^}U-P}SzSGjPkdiVsWe#vBCMtMgWPSb@zXE6TYY!YZpacwotvp`7{0t1NRy>QQ_AxLp zr$T6++dNx8NH8!6ALTjt2k1?SU%c%8Ux4Oi^YRz(V_*k^hSOzvXx;#1~dljZ{qv7$_1NG{p@h{;%J^D5DqOv(}rE)1Cr#S8@u uISh#ml?)0Dc|basA(aE@Kn6A-=9%0etijF2;186^WXNa8+q_DmlLG*Gjeej2 diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index d5c4beda..75a00117 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -172,7 +172,7 @@ Right-click to reset. copied-to-clipboard-notification notification: copied to clipboard - Copied to Clipboard + Copied to Clipboard @@ -197,12 +197,12 @@ Right-click to reset. server-synced - Synced + Synced server-not-synced - Out of Sync + Out of Sync @@ -372,50 +372,50 @@ Right-click to reset. PeerSettingsPane - + address-label Address - + copy-btn Copy - + copied-to-clipboard-notification notification: copied to clipboard Copied to Clipboard - + display-name-label Display Name - + save-btn Save - + block-btn Block Peer - - + + save-peer-history Save Peer History Save Peer History - + save-peer-history-description Determines whether or not to delete any history associated with the peer. - + dont-save-peer-history Delete Peer History @@ -424,7 +424,7 @@ Right-click to reset. Unblock Peer - + delete-btn Delete @@ -440,114 +440,125 @@ Right-click to reset. Edit Profile - profile-name Display name - Display name + Display name - - + + default-profile-name default suggested profile name Alice - - profile-onion-label - Onion - Onion + + new-profile + New Profile || Edit Profile + New Profile - + + edit-profile + Edit Profille + + + + profile-onion-label + Send this address to peers you want to connect with + Send this address to peers you want to connect with + + + copy-btn Copy - + copied-to-clipboard-notification notification: copied to clipboard Copied to Clipboard - + radio-use-password Password Password - + radio-no-password Unencrypted (No password) Unencrypted (No password) - + no-password-warning Not using a password on this account means that all data stored locally will not be encrypted Not using a password on this account means that all data stored locally will not be encrypted - + current-password-label Current Password Current Password - + password1-label Password Password - + password2-label Reenter password Reenter password - + create-profile-btn - Create Profile || Save Profile + Create || Save Create Profile - + save-profile-btn Save Profile - + password-error-match Passwords do not match Passwords do not match - + password-change-error Error changing password: Supplied password rejected Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile Delete Profile - + + delete-confirm-label Type DELETE to confirm Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile Really Delete Profile - + delete-confirm-text DELETE DELETE @@ -621,66 +632,66 @@ Right-click to reset. Block Unknown Peers - + setting-language Language Language - + locale-en English - + locale-fr Frances - + locale-pt Portuguesa - + locale-de Deutsche - + setting-interface-zoom Interface Zoom Zoom level - + large-text-label Large - + setting-theme Theme Theme - + theme-light Light - + theme-dark Dark - + version %1 Version %1 Version %1 - + builddate %2 Built on: %2 Built on: %2 @@ -691,7 +702,7 @@ Right-click to reset. Default size text (scale factor: - + small-text-label Small diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts index abda02d8..bab389d5 100644 --- a/i18n/translation_fr.ts +++ b/i18n/translation_fr.ts @@ -292,55 +292,55 @@ PeerSettingsPane - + address-label Adresse - + copy-btn Copier - + copied-to-clipboard-notification notification: copied to clipboard Copié dans le presse-papier - + display-name-label Pseudo - + save-btn Sauvegarder - - + + save-peer-history Save Peer History - + save-peer-history-description - + dont-save-peer-history - + delete-btn Effacer - + block-btn @@ -348,114 +348,120 @@ ProfileAddEditPane - - + + default-profile-name default suggested profile name - + profile-onion-label - Onion + Send this address to peers you want to connect with - + copy-btn Copier - + copied-to-clipboard-notification notification: copied to clipboard Copié dans le presse-papier - - profile-name - Display name - - - - + radio-use-password Password - + radio-no-password Unencrypted (No password) - + no-password-warning Not using a password on this account means that all data stored locally will not be encrypted - + + new-profile + New Profile || Edit Profile + + + + + edit-profile + + + + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn - Create Profile || Save Profile + Create || Save - + save-profile-btn - + password-error-match Passwords do not match - + password-change-error Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile - + + delete-confirm-label Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile - + delete-confirm-text DELETE @@ -520,66 +526,66 @@ Interface zoom (essentiellement la taille du texte et des composants de l'interface) - + setting-language Language - + locale-en - + locale-fr - + locale-pt - + locale-de - + setting-interface-zoom Interface Zoom - + large-text-label Large - + setting-theme Theme - + theme-light - + theme-dark - + version %1 Version %1 - + builddate %2 Built on: %2 @@ -590,7 +596,7 @@ Taille par défaut du texte (échelle: - + small-text-label Petit diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts index 349a5948..237bff16 100644 --- a/i18n/translation_pt.ts +++ b/i18n/translation_pt.ts @@ -292,55 +292,55 @@ PeerSettingsPane - + address-label Endereço - + copy-btn Copiar - + copied-to-clipboard-notification notification: copied to clipboard Copiado - + display-name-label Nome de Exibição - + save-btn Salvar - - + + save-peer-history Save Peer History - + save-peer-history-description - + dont-save-peer-history - + delete-btn Deletar - + block-btn @@ -348,114 +348,120 @@ ProfileAddEditPane - - + + default-profile-name default suggested profile name - + profile-onion-label - Onion + Send this address to peers you want to connect with - + copy-btn Copiar - + copied-to-clipboard-notification notification: copied to clipboard Copiado - - profile-name - Display name - - - - + radio-use-password Password - + radio-no-password Unencrypted (No password) - + no-password-warning Not using a password on this account means that all data stored locally will not be encrypted - + + new-profile + New Profile || Edit Profile + + + + + edit-profile + + + + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn - Create Profile || Save Profile + Create || Save - + save-profile-btn - + password-error-match Passwords do not match - + password-change-error Error changing password: Supplied password rejected - + delete-profile-btn Delete Profile - + + delete-confirm-label Type DELETE to confirm - + delete-profile-confirm-btn Really Delete Profile - + delete-confirm-text DELETE @@ -520,66 +526,66 @@ Zoom da interface (afeta principalmente tamanho de texto e botões) - + setting-language Language - + locale-en - + locale-fr - + locale-pt - + locale-de - + setting-interface-zoom Interface Zoom - + large-text-label Grande - + setting-theme Theme - + theme-light - + theme-dark - + version %1 Version %1 - + builddate %2 Built on: %2 @@ -590,7 +596,7 @@ Texto tamanho padrão (fator de escala: - + small-text-label Pequeno diff --git a/qml/opaque b/qml/opaque index 12b7e514..c33a868d 160000 --- a/qml/opaque +++ b/qml/opaque @@ -1 +1 @@ -Subproject commit 12b7e51497868515401edc68be5514c020472da9 +Subproject commit c33a868d0c39929c3cc75ad272f7c9c27da50b2e diff --git a/qml/panes/GroupSettingsPane.qml b/qml/panes/GroupSettingsPane.qml index f3dbb722..e7d45789 100644 --- a/qml/panes/GroupSettingsPane.qml +++ b/qml/panes/GroupSettingsPane.qml @@ -78,59 +78,59 @@ Opaque.SettingsList { // groupSettingsPane Opaque.Setting { property color backgroundColor: parent.color - inline: true - label: qsTr("server-info") - field: Column { - width: parent.width - spacing:10 - RowLayout { - width: parent.width - Layout.fillWidth: true - Opaque.ScalingLabel { - text: gsp.connected ? qsTr("server-connectivity-connected") : qsTr("server-connectivity-disconnected") - Layout.alignment: Qt.AlignLeft - } - Opaque.Icon { - backgroundColor: Theme.backgroundPaneColor - id: serverStatusIcon - height: 18 - width: 18 - Layout.alignment: Qt.AlignRight - iconColor: gsp.connected ? Theme.statusbarOnlineFontColor : Theme.statusbarDisconnectedTorFontColor - source: gcd.assetPath + (gsp.connected ? "core/signal_cellular_4_bar-24px.svg" : "core/signal_cellular_connected_no_internet_4_bar-24px.svg") - } - } - RowLayout { - width: parent.width - Layout.fillWidth: true + inline: true + label: qsTr("server-info") + field: Column { + width: parent.width + spacing:10 + RowLayout { + width: parent.width + Layout.fillWidth: true + Opaque.ScalingLabel { + text: gsp.connected ? qsTr("server-connectivity-connected") : qsTr("server-connectivity-disconnected") + Layout.alignment: Qt.AlignLeft + } + Opaque.Icon { + backgroundColor: Theme.backgroundPaneColor + id: serverStatusIcon + height: 18 + width: 18 + Layout.alignment: Qt.AlignRight + iconColor: gsp.connected ? Theme.statusbarOnlineFontColor : Theme.statusbarDisconnectedTorFontColor + source: gcd.assetPath + (gsp.connected ? "core/signal_cellular_4_bar-24px.svg" : "core/signal_cellular_connected_no_internet_4_bar-24px.svg") + } + } + RowLayout { + width: parent.width + Layout.fillWidth: true - Opaque.ScalingLabel { - text: gsp.synced ? qsTr("server-synced") : qsTr("server-not-synced") - Layout.alignment: Qt.AlignLeft - } - Opaque.Icon { - id: serverSyncedStatusIcon - backgroundColor: Theme.backgroundPaneColor - height: 18 - width: 18 - Layout.alignment: Qt.AlignRight - iconColor : gsp.synced ? Theme.statusbarOnlineFontColor : Theme.statusbarConnectingFontColor - source: gcd.assetPath + (gsp.synced ? "core/syncing-01.svg" : "core/syncing-03.svg") - } - } + Opaque.ScalingLabel { + text: gsp.synced ? qsTr("server-synced") : qsTr("server-not-synced") + Layout.alignment: Qt.AlignLeft + } + Opaque.Icon { + id: serverSyncedStatusIcon + backgroundColor: Theme.backgroundPaneColor + height: 18 + width: 18 + Layout.alignment: Qt.AlignRight + iconColor : gsp.synced ? Theme.statusbarOnlineFontColor : Theme.statusbarConnectingFontColor + source: gcd.assetPath + (gsp.synced ? "core/syncing-01.svg" : "core/syncing-03.svg") + } + } - Opaque.Button { - icon: "regular/hdd" - text: qsTr("view-server-info") - anchors.right: parent.right + Opaque.Button { + icon: "regular/hdd" + text: qsTr("view-server-info") + anchors.right: parent.right - onClicked: { - gcd.requestServerSettings(gcd.selectedConversation) - theStack.pane = theStack.serverInfoPane - } - } + onClicked: { + gcd.requestServerSettings(gcd.selectedConversation) + theStack.pane = theStack.serverInfoPane + } + } - } + } } @@ -152,7 +152,7 @@ Opaque.SettingsList { // groupSettingsPane } } - } + } Connections { target: gcd diff --git a/qml/panes/OverlayPane.qml b/qml/panes/OverlayPane.qml index 911b0db1..24b8a204 100644 --- a/qml/panes/OverlayPane.qml +++ b/qml/panes/OverlayPane.qml @@ -33,10 +33,10 @@ ColumnLayout { //: Accept group invite button text: qsTr("accept-group-btn") icon: "regular/heart" - onClicked: { - gcd.acceptGroup(gcd.selectedConversation) - gcd.requestGroupSettings(gcd.selectedConversation) - } + onClicked: { + gcd.acceptGroup(gcd.selectedConversation) + gcd.requestGroupSettings(gcd.selectedConversation) + } } Opaque.Button { diff --git a/qml/panes/PeerSettingsPane.qml b/qml/panes/PeerSettingsPane.qml index 5d8bbd64..8822822a 100644 --- a/qml/panes/PeerSettingsPane.qml +++ b/qml/panes/PeerSettingsPane.qml @@ -15,6 +15,7 @@ import "../const" Opaque.SettingsList { // settingsPane id: root anchors.fill: parent + anchors.topMargin: 20 property string authorization property string saveHistory diff --git a/qml/panes/ProfileAddEditPane.qml b/qml/panes/ProfileAddEditPane.qml index 7b9535cc..4f94076c 100644 --- a/qml/panes/ProfileAddEditPane.qml +++ b/qml/panes/ProfileAddEditPane.qml @@ -8,11 +8,19 @@ import QtQuick.Window 2.11 import "../opaque" as Opaque import "../opaque/theme" +import "../opaque/fonts" // import "../styles" -Opaque.SettingsList { // Add Profile Pane - id: profileAddEditPane - anchors.fill: parent +Opaque.Flickable { + id: flickRoot + Layout.fillHeight: true + Layout.fillWidth: true + + contentWidth: rc.width + contentHeight: rc.height + + readonly property string mode_add: "add" + readonly property string mode_edit: "edit" property string mode // edit or add property string onion @@ -21,32 +29,49 @@ Opaque.SettingsList { // Add Profile Pane property bool changingPassword function reset() { - mode = "add" + flickRoot.contentY = 0 + mode = mode_add + reset_errors() txtProfileName.text = qsTr("default-profile-name") changingPassword = false txtPassword1.text = "" txtPassword2.text = "" deleting = false - deleteConfirmLabel.color = "black" - passwordErrorLabel.visible = false - txtCurrentPassword.text = "" + deleteConfirmLabel.color = Theme.mainTextColor + txtCurrentPassword.text = "" + nameLabel.text = "" + + portrait.performTransform = true + portrait.source = "core/account_circle-24px_negative_space.svg" tag = "" confirmDeleteTxt.text = "" radioUsePassword.checked = true - passwordChangeErrorLabel.visible = false } - function load(userOnion, name, userTag) { + function reset_errors() { + txtPassword1.error = false + txtPassword2.error = false + txtCurrentPassword.error = false + passwordErrorLabel.visible = false + passwordChangeErrorLabel.visible = false + confirmDeleteTxt.error = false + } + + function load(userOnion, name, userTag, image) { reset() - mode = "edit" + mode = mode_edit tag = userTag onion = userOnion txtPassword1.text = "" txtPassword2.text = "" onionLabel.text = onion txtProfileName.text = name + nameLabel.text = name + portrait.performTransform = false + portrait.source = image + if (tag == "v1-defaultPassword" || tag == "v1-default-password") { radioNoPassword.checked = true @@ -56,174 +81,323 @@ Opaque.SettingsList { // Add Profile Pane } - settings: Column { - anchors.horizontalCenter: parent.horizontalCenter - width: 700 + Opaque.ResponsiveContainer { + id: rc + width: flickRoot.width + + Rectangle { + id: leftCol + color: Theme.backgroundPaneColor + //height: + implicitHeight: leftContents.height + height: implicitHeight + Layout.fillWidth: true + Layout.alignment: Qt.AlignTop - Opaque.Setting { - inline: false - visible: mode == "edit" + Column { + id: leftContents + anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment : Qt.AlignHCenter + Qt.AlignTop + width: 400 * gcd.themeScale + spacing: 10 * gcd.themeScale - //: Onion - label: qsTr("profile-onion-label") + ":" + Opaque.ScalingLabel { + anchors.horizontalCenter: parent.horizontalCenter + size: Theme.primaryTextSize - field: Opaque.ButtonTextField { - id: onionLabel - readOnly: true - button_text: qsTr("copy-btn") - dropShadowColor: Theme.dropShadowPaneColor - onClicked: { - //: notification: copied to clipboard - gcd.popup(qsTr("copied-to-clipboard-notification")) - onionLabel.selectAll() - onionLabel.copy() - }} - } - - - - Opaque.Setting { - inline: false - visible: mode == "edit" - - //: Display name - label: qsTr("profile-name") + ":" - - field: Opaque.UnderlineTextField { - id: txtProfileName - //Layout.fillWidth: true - - //: default suggested profile name - text: qsTr("default-profile-name") - width: parent.width + //: New Profile || Edit Profile + text: mode == mode_add ? qsTr("new-profile") : qsTr("edit-profile") + bold: true } - } + // spacing + Rectangle { + height: 30 * gcd.themeScale + width: 100 + color: Theme.backgroundPaneColor + } - Opaque.Setting { - inline: false - visible: mode == "add" || tag == "v1-defaultPassword" + Opaque.Portrait { + id: portrait - field: - ColumnLayout{ - RowLayout { - //id: radioButtons + size: 250 - Opaque.RadioButton { - id: radioUsePassword - checked: true - //: Password - text: qsTr("radio-use-password") + Layout.preferredHeight: size + anchors.horizontalCenter: parent.horizontalCenter - onClicked: { - changingPassword = true - } - } + portraitBorderColor: Theme.portraitOnlineBorderColor + portraitColor: Theme.portraitOnlineBackgroundColor + badgeColor: Theme.portraitProfileBadgeColor - Opaque.RadioButton { - id: radioNoPassword - //: Unencrypted (No password) - text: qsTr("radio-no-password") - onClicked: { - changingPassword = true - } - } + performTransform: true + overlayColor: Theme.portraitProfileBadgeTextColor + + badgeContent: Image {// Profle Type + id: profiletype + source: radioUsePassword.checked ? gcd.assetPath + "/fontawesome/solid/lock.svg" : gcd.assetPath + "/fontawesome/solid/lock-open.svg" + height: 40 * gcd.themeScale + width: height } + } + + Opaque.ScalingLabel { + id: nameLabel + visible: mode == mode_edit + + anchors.horizontalCenter: parent.horizontalCenter + size: Theme.primaryTextSize + bold: true + } + + // spacing + Rectangle { + visible: mode == mode_edit + height: 10 * gcd.themeScale + width: 100 + color: Theme.backgroundPaneColor + } + + Opaque.ScalingLabel { + visible: mode == mode_edit + anchors.horizontalCenter: parent.horizontalCenter + size: Theme.secondaryTextSize + + //: Send this address to peers you want to connect with + text: qsTr("profile-oniblon-label") + } + + Opaque.ButtonTextField { + id: onionLabel + anchors.horizontalCenter: parent.horizontalCenter + visible: mode == mode_edit + readOnly: true + + width: leftCol.width - (40*gcd.themeScale) + + button_text: qsTr("copy-btn") + dropShadowColor: Theme.dropShadowPaneColor + onClicked: { + //: notification: copied to clipboard + gcd.popup(qsTr("copied-to-clipboard-notification")) + onionLabel.selectAll() + onionLabel.copy() + } + } + + // spacing + Rectangle { + visible: radioNoPassword.checked + height: 30 * gcd.themeScale + width: 100 + color: Theme.backgroundPaneColor + } + + Rectangle { + width: parent.width + height: noPasswordLabel.visible ? noPasswordLabel.height : 0 + color: leftCol.color + anchors.horizontalCenter: parent.horizontalCenter Opaque.ScalingLabel { id: noPasswordLabel + width: parent.width + size: Theme.secondaryTextSize + anchors.horizontalCenter: parent.horizontalCenter + //: Not using a password on this account means that all data stored locally will not be encrypted text: qsTr("no-password-warning") visible: radioNoPassword.checked } } - } - Opaque.Setting{ - inline: false - visible: radioUsePassword.checked && mode == "edit" && tag != "v1-defaultPassword" - - - //: Current Password - label: qsTr("current-password-label") + ":" - - field: Opaque.TextField { - id: txtCurrentPassword - Layout.fillWidth: true - echoMode: TextInput.Password + // spacing + Rectangle { + height: 30 * gcd.themeScale + width: 100 + color: Theme.backgroundPaneColor } } - Opaque.Setting { - visible: radioUsePassword.checked - //: Password - label: qsTr("password1-label") + ":" + } - field: Opaque.TextField { - id: txtPassword1 - Layout.fillWidth: true - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } + + + Rectangle { + id: rightCol + color: Theme.backgroundPaneColor + anchors.topMargin: 80 * gcd.themeScale + height: rightContents.height + implicitHeight: height + Layout.fillWidth: true + Layout.alignment: Qt.AlignTop + + + + + Column { + id: rightContents + + anchors.horizontalCenter: parent.horizontalCenter + Layout.alignment : Qt.AlignHCenter + Qt.AlignTop + width: 400 * gcd.themeScale + spacing: 40 * gcd.themeScale + + Opaque.UnderlineTextField { + id: txtProfileName + visible: mode == mode_edit + //Layout.fillWidth: true + backgroundColor: Theme.backgroundPaneColor + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: default suggested profile name + text: qsTr("default-profile-name") + + } + + RowLayout { + visible: (mode == mode_add) || (tag == "v1-defaultPassword") + + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //id: radioButtons + + Opaque.RadioButton { + id: radioUsePassword + checked: true + //: Password + text: qsTr("radio-use-password") + + onClicked: { + changingPassword = true + } + } + + Opaque.RadioButton { + id: radioNoPassword + //: Unencrypted (No password) + text: qsTr("radio-no-password") + onClicked: { + changingPassword = true + } + } + } + + + Opaque.UnderlineTextField { + id: txtCurrentPassword + visible: radioUsePassword.checked && (mode == mode_edit) && tag != "v1-defaultPassword" + + backgroundColor: Theme.backgroundPaneColor + + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: Current Password + placeholderText: qsTr("current-password-label") + ":" echoMode: TextInput.Password + + } + + + Opaque.UnderlineTextField { + id: txtPassword1 visible: radioUsePassword.checked + backgroundColor: Theme.backgroundPaneColor + + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + echoMode: TextInput.Password + + //: Password + placeholderText: qsTr("password1-label") + onTextEdited: { changingPassword = true } } - } - Opaque.Setting { - visible: radioUsePassword.checked - - //: Reenter password - label: qsTr("password2-label") + ":" - - field: Opaque.TextField { + Opaque.UnderlineTextField { id: txtPassword2 - Layout.fillWidth: true - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - echoMode: TextInput.Password visible: radioUsePassword.checked + + backgroundColor: Theme.backgroundPaneColor + + width: parent.width - (40*gcd.themeScale) + anchors.horizontalCenter: parent.horizontalCenter + + //: Reenter password + placeholderText: qsTr("password2-label") + + echoMode: TextInput.Password } - } + Opaque.ScalingLabel { + id: passwordErrorLabel + anchors.horizontalCenter: parent.horizontalCenter + size: Theme.secondaryTextSize + + //: Passwords do not match + text: qsTr("password-error-match") + visible: false + color: Theme.textfieldErrorColor + } + + Opaque.ScalingLabel { + id: passwordChangeErrorLabel + anchors.horizontalCenter: parent.horizontalCenter + size: Theme.secondaryTextSize + + //: Error changing password: Supplied password rejected + text: qsTr("password-change-error") + visible: false + color: Theme.textfieldErrorColor + } - Column { - width:parent.width * 0.95 - anchors.horizontalCenter: parent.horizontalCenter - spacing: 10 * gcd.themeScale Opaque.Button { // ADD or SAVE button - anchors.right: parent.right height: Theme.primaryTextSize * 1.5 + anchors.horizontalCenter: parent.horizontalCenter - //: Create Profile || Save Profile - text: mode == "add" ? qsTr("create-profile-btn") : qsTr("save-profile-btn") + + //: Create || Save + text: mode == mode_add ? qsTr("create-profile-btn") : qsTr("save-profile-btn") onClicked: { - if (mode == "add") { + reset_errors() + if (mode == mode_add) { if (txtPassword1.text != txtPassword2.text) { passwordErrorLabel.visible = true + txtPassword1.error = true + txtPassword2.error = true } else { gcd.createProfile(txtProfileName.text, radioNoPassword.checked, txtPassword1.text) gcd.reloadProfileList() parentStack.pane = parentStack.managementPane } } else { + console.log("Save clicked") gcd.updateNick(onion, txtProfileName.text) if (changingPassword) { + console.log("changingPassword") if (txtPassword1.text != txtPassword2.text) { passwordErrorLabel.visible = true + txtPassword1.error = true + txtPassword2.error = true } else { + console.log("gcd.changePassword") gcd.changePassword(onion, txtCurrentPassword.text, txtPassword1.text, radioNoPassword.checked) } } else { @@ -235,38 +409,17 @@ Opaque.SettingsList { // Add Profile Pane } } - Opaque.ScalingLabel { - id: passwordErrorLabel - //: Passwords do not match - text: qsTr("password-error-match") - visible: false - color: "red" - } - - Opaque.ScalingLabel { - id: passwordChangeErrorLabel - //: Error changing password: Supplied password rejected - text: qsTr("password-change-error") - visible: false - color: "red" - } - - - - // ***** Delete button and confirm flow ***** - - - Opaque.Button { anchors.right: parent.right + anchors.rightMargin: 20 * gcd.themeScale //: Delete Profile text: qsTr("delete-profile-btn") - icon: "regular/trash-alt" - visible: mode == "edit" + //icon: "regular/trash-alt" + visible: mode == mode_edit height: Theme.primaryTextSize * 1.5 @@ -277,47 +430,65 @@ Opaque.SettingsList { // Add Profile Pane Opaque.ScalingLabel { id: deleteConfirmLabel + size: Theme.secondaryTextSize + + anchors.right: parent.right + anchors.rightMargin: 20 * gcd.themeScale + //: Type DELETE to confirm text: qsTr("delete-confirm-label")+ ":" visible: deleting } - Opaque.TextField { + Opaque.UnderlineTextField { id: confirmDeleteTxt - Layout.fillWidth: true - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } visible: deleting + backgroundColor: Theme.backgroundPaneColor + + width: 300 * gcd.themeScale + anchors.right: parent.right + anchors.rightMargin: 20 * gcd.themeScale + + placeholderText: qsTr("delete-confirm-label") } Opaque.Button { id: confirmDeleteBtn - icon: "regular/trash-alt" + + height: Theme.primaryTextSize * 1.5 + anchors.right: parent.right + anchors.rightMargin: 20 * gcd.themeScale //: Really Delete Profile text: qsTr("delete-profile-confirm-btn") - color: "red" visible: deleting onClicked: { //: DELETE if (confirmDeleteTxt.text == qsTr("delete-confirm-text")) { - deleteConfirmLabel.color = "black" + deleteConfirmLabel.color = Theme.mainTextColor gcd.deleteProfile(onion) gcd.reloadProfileList() parentStack.pane = parentStack.managementPane } else { - deleteConfirmLabel.color = "red" + confirmDeleteTxt.error = true + deleteConfirmLabel.color = Theme.textfieldErrorColor } } } + + // spacing + Rectangle { + height: 30 * gcd.themeScale + width: 100 + color: Theme.backgroundPaneColor + } } + } - }//end of column - - - Connections { // UPDATE UNREAD MESSAGES COUNTER + Connections { target: gcd onChangePasswordResponse: function(error) { @@ -326,7 +497,9 @@ Opaque.SettingsList { // Add Profile Pane parentStack.pane = parentStack.managementPane } else { passwordChangeErrorLabel.visible = true + txtCurrentPassword.error = true } } } } +} diff --git a/qml/panes/ProfileManagerPane.qml b/qml/panes/ProfileManagerPane.qml index beceedde..903a8313 100644 --- a/qml/panes/ProfileManagerPane.qml +++ b/qml/panes/ProfileManagerPane.qml @@ -28,7 +28,6 @@ ColumnLayout { wrapMode: TextEdit.Wrap size: Theme.primaryTextSize - font.family: Fonts.applicationFontRegular.name font.styleName: "Bold" @@ -112,6 +111,8 @@ ColumnLayout { size: Theme.primaryTextSize font.family: Fonts.applicationFontRegular.name font.styleName: "Bold" + anchors.left: parent.left + anchors.leftMargin: 25 * gcd.themeScale //: Your Profiles text: qsTr("your-profiles") @@ -136,6 +137,8 @@ ColumnLayout { size: Theme.primaryTextSize font.family: Fonts.applicationFontRegular.name font.styleName: "Bold" + anchors.left: parent.left + anchors.leftMargin: 25 * gcd.themeScale //: Your Profiles text: qsTr("your-servers") diff --git a/qml/panes/ServerInfoPane.qml b/qml/panes/ServerInfoPane.qml index 31762287..b7dd4d84 100644 --- a/qml/panes/ServerInfoPane.qml +++ b/qml/panes/ServerInfoPane.qml @@ -41,37 +41,37 @@ Opaque.SettingsList { // groupSettingsPane } } } - } + } - Connections { - target: gcd + Connections { + target: gcd - onUpdateContactStatus: function(_handle, _status, _loading) { - if (txtServer.text == _handle) { - if (_status >= Const.state_connected) { - gsp.connected = true - serverStatusIcon - if (_status != Const.state_synced) { - gsp.synced = false - } else { - gsp.synced = true - } - } else { - gsp.connected = false + onUpdateContactStatus: function(_handle, _status, _loading) { + if (txtServer.text == _handle) { + if (_status >= Const.state_connected) { + gsp.connected = true + serverStatusIcon + if (_status != Const.state_synced) { gsp.synced = false + } else { + gsp.synced = true } + } else { + gsp.connected = false + gsp.synced = false } } + } - onSupplyServerSettings: function(server, key_names, keys) { - gsp.serverName = server; - toolbar.setTitle(qsTr("server-settings")); - console.log("Servers: " + key_names); - for (let i=0; i