diff --git a/i18n/translation_de.qm b/i18n/translation_de.qm index d3f984f6..4e70a999 100644 Binary files a/i18n/translation_de.qm and b/i18n/translation_de.qm differ diff --git a/i18n/translation_de.ts b/i18n/translation_de.ts index d978b4a6..a5ba8fca 100644 --- a/i18n/translation_de.ts +++ b/i18n/translation_de.ts @@ -184,7 +184,7 @@ peer-blocked-message - Peer is blockced + Peer is blocked @@ -313,103 +313,114 @@ ProfileAddEditPane - - + + default-profile-name default suggested profile name - + profile-onion-label Onion - + + 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 - + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn Create Profile || Save Profile - + 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 @@ -418,7 +429,7 @@ ProfileList - + add-new-profile-btn @@ -426,24 +437,24 @@ ProfileManagerPane - + enter-profile-password Please enter password: - + password - + error-0-profiles-loaded-for-password 0 profiles loaded with that password - + unlock Unlock diff --git a/i18n/translation_en.qm b/i18n/translation_en.qm index e1871aa5..abbf18b7 100644 Binary files a/i18n/translation_en.qm and b/i18n/translation_en.qm differ diff --git a/i18n/translation_en.ts b/i18n/translation_en.ts index a62f2a31..4f3deba3 100644 --- a/i18n/translation_en.ts +++ b/i18n/translation_en.ts @@ -264,7 +264,7 @@ Right-click to reset. peer-blocked-message - Peer is blockced + Peer is blocked Peer is blocked @@ -405,103 +405,114 @@ Right-click to reset. Edit Profile - + profile-name Display name Display name - - + + default-profile-name default suggested profile name Alice - + profile-onion-label Onion Onion - + + 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 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 @@ -510,7 +521,7 @@ Right-click to reset. ProfileList - + add-new-profile-btn Add new profile @@ -518,24 +529,24 @@ Right-click to reset. ProfileManagerPane - + enter-profile-password Please enter password: Please enter password - + password Password - + error-0-profiles-loaded-for-password 0 profiles loaded with that password 0 profiles loaded with that password - + unlock Unlock Unlock diff --git a/i18n/translation_fr.qm b/i18n/translation_fr.qm index d20f24f0..18e4d8b3 100644 Binary files a/i18n/translation_fr.qm and b/i18n/translation_fr.qm differ diff --git a/i18n/translation_fr.ts b/i18n/translation_fr.ts index 10aa6cd7..d2d3e951 100644 --- a/i18n/translation_fr.ts +++ b/i18n/translation_fr.ts @@ -184,7 +184,7 @@ peer-blocked-message - Peer is blockced + Peer is blocked @@ -313,103 +313,114 @@ ProfileAddEditPane - - + + default-profile-name default suggested profile name - + profile-onion-label Onion - + + 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 - + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn Create Profile || Save Profile - + 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 @@ -418,7 +429,7 @@ ProfileList - + add-new-profile-btn @@ -426,24 +437,24 @@ ProfileManagerPane - + enter-profile-password Please enter password: - + password - + error-0-profiles-loaded-for-password 0 profiles loaded with that password - + unlock Unlock diff --git a/i18n/translation_pt.qm b/i18n/translation_pt.qm index 3480551a..a64ae3c5 100644 Binary files a/i18n/translation_pt.qm and b/i18n/translation_pt.qm differ diff --git a/i18n/translation_pt.ts b/i18n/translation_pt.ts index 36119bb0..627dd4fd 100644 --- a/i18n/translation_pt.ts +++ b/i18n/translation_pt.ts @@ -184,7 +184,7 @@ peer-blocked-message - Peer is blockced + Peer is blocked @@ -313,103 +313,114 @@ ProfileAddEditPane - - + + default-profile-name default suggested profile name - + profile-onion-label Onion - + + 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 - + current-password-label Current Password - + password1-label Password - + password2-label Reenter password - + create-profile-btn Create Profile || Save Profile - + 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 @@ -418,7 +429,7 @@ ProfileList - + add-new-profile-btn @@ -426,24 +437,24 @@ ProfileManagerPane - + enter-profile-password Please enter password: - + password - + error-0-profiles-loaded-for-password 0 profiles loaded with that password - + unlock Unlock diff --git a/qml/main.qml b/qml/main.qml index 319c4602..2073204a 100644 --- a/qml/main.qml +++ b/qml/main.qml @@ -155,7 +155,7 @@ ApplicationWindow { Rectangle { // Profile Add / Edit pane Layout.fillHeight: true Layout.fillWidth: true - color: Theme.backgroundMainColor + color: Theme.backgroundPaneColor ProfileAddEditPane{ diff --git a/qml/panes/ProfileAddEditPane.qml b/qml/panes/ProfileAddEditPane.qml index 3f1154e8..7b9535cc 100644 --- a/qml/panes/ProfileAddEditPane.qml +++ b/qml/panes/ProfileAddEditPane.qml @@ -7,9 +7,10 @@ import QtQuick.Window 2.11 import "../opaque" as Opaque +import "../opaque/theme" // import "../styles" -ColumnLayout { // Add Profile Pane +Opaque.SettingsList { // Add Profile Pane id: profileAddEditPane anchors.fill: parent @@ -55,241 +56,277 @@ ColumnLayout { // Add Profile Pane } - Flickable { - anchors.top: parent.top - anchors.left: parent.left - anchors.right: parent.right - anchors.bottom: parent.bottom - boundsBehavior: Flickable.StopAtBounds - clip:true - contentWidth: tehcol.width - contentHeight: tehcol.height + settings: Column { + anchors.horizontalCenter: parent.horizontalCenter + width: 700 - Column { - id: tehcol - leftPadding: 10 - spacing: 5 - width: profileAddEditPane.width - Opaque.ScalingLabel { - //: Onion - text: qsTr("profile-onion-label") + ":" - visible: mode == "edit" - } - Opaque.ScalingLabel { + Opaque.Setting { + inline: false + visible: mode == "edit" + + //: Onion + label: qsTr("profile-onion-label") + ":" + + field: Opaque.ButtonTextField { id: onionLabel - visible: mode == "edit" - } - - Opaque.ScalingLabel { - //: Display name - text: qsTr("profile-name") + ":" - } - - Opaque.TextField { - id: txtProfileName - Layout.fillWidth: true - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - //: default suggested profile name - text: qsTr("default-profile-name") - - - } - - RowLayout { - //id: radioButtons - - Opaque.RadioButton { - id: radioUsePassword - checked: true - //: Password - text: qsTr("radio-use-password") - visible: mode == "add" || tag == "v1-defaultPassword" - onClicked: { - changingPassword = true - } - } - - Opaque.RadioButton { - id: radioNoPassword - //: Unencrypted (No password) - text: qsTr("radio-no-password") - visible: mode == "add" || tag == "v1-defaultPassword" - onClicked: { - changingPassword = true - } - } - } - - Opaque.ScalingLabel { - id: noPasswordLabel - //: 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.ScalingLabel { - id: currentPasswordLabel - //: Current Password - text: qsTr("current-password-label") + ":" - visible: radioUsePassword.checked && mode == "edit" && tag != "v1-defaultPassword" - } - - Opaque.TextField { - id: txtCurrentPassword - Layout.fillWidth: true - echoMode: TextInput.Password - visible: radioUsePassword.checked && mode == "edit" && tag != "v1-defaultPassword" - } - - Opaque.ScalingLabel { - id: passwordLabel - //: Password - text: qsTr("password1-label") + ":" - visible: radioUsePassword.checked - } - - Opaque.TextField { - id: txtPassword1 - Layout.fillWidth: true - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - echoMode: TextInput.Password - visible: radioUsePassword.checked - - onTextEdited: { - changingPassword = true - } - } - - - Opaque.ScalingLabel { - id: passwordReLabel - //: Reenter password - text: qsTr("password2-label") + ":" - visible: radioUsePassword.checked - } - - Opaque.TextField { - id: txtPassword2 - Layout.fillWidth: true - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - echoMode: TextInput.Password - visible: radioUsePassword.checked - } - - Opaque.Button { // ADD or SAVE button - //: Create Profile || Save Profile - text: mode == "add" ? qsTr("create-profile-btn") : qsTr("save-profile-btn") - + readOnly: true + button_text: qsTr("copy-btn") + dropShadowColor: Theme.dropShadowPaneColor onClicked: { - if (mode == "add") { - if (txtPassword1.text != txtPassword2.text) { - passwordErrorLabel.visible = true - } else { - gcd.createProfile(txtProfileName.text, radioNoPassword.checked, txtPassword1.text) - gcd.reloadProfileList() - parentStack.pane = parentStack.managementPane - } - } else { - gcd.updateNick(onion, txtProfileName.text) + //: notification: copied to clipboard + gcd.popup(qsTr("copied-to-clipboard-notification")) + onionLabel.selectAll() + onionLabel.copy() + }} + } - if (changingPassword) { + + + 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 + } + } + + + Opaque.Setting { + inline: false + visible: mode == "add" || tag == "v1-defaultPassword" + + field: + ColumnLayout{ + RowLayout { + //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.ScalingLabel { + id: noPasswordLabel + //: 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 + + } + + } + + + 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 } + echoMode: TextInput.Password + visible: radioUsePassword.checked + + onTextEdited: { + changingPassword = true + } + } + + } + + Opaque.Setting { + visible: radioUsePassword.checked + + //: Reenter password + label: qsTr("password2-label") + ":" + + field: Opaque.TextField { + id: txtPassword2 + Layout.fillWidth: true + //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } + echoMode: TextInput.Password + visible: radioUsePassword.checked + } + + } + + + 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 + + //: Create Profile || Save Profile + text: mode == "add" ? qsTr("create-profile-btn") : qsTr("save-profile-btn") + + onClicked: { + if (mode == "add") { if (txtPassword1.text != txtPassword2.text) { passwordErrorLabel.visible = true } else { - gcd.changePassword(onion, txtCurrentPassword.text, txtPassword1.text, radioNoPassword.checked) + gcd.createProfile(txtProfileName.text, radioNoPassword.checked, txtPassword1.text) + gcd.reloadProfileList() + parentStack.pane = parentStack.managementPane } } else { + gcd.updateNick(onion, txtProfileName.text) + + if (changingPassword) { + if (txtPassword1.text != txtPassword2.text) { + passwordErrorLabel.visible = true + } else { + gcd.changePassword(onion, txtCurrentPassword.text, txtPassword1.text, radioNoPassword.checked) + } + } else { + gcd.reloadProfileList() + parentStack.pane = parentStack.managementPane + } + } + + } + } + + 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 + + //: Delete Profile + text: qsTr("delete-profile-btn") + icon: "regular/trash-alt" + visible: mode == "edit" + height: Theme.primaryTextSize * 1.5 + + + onClicked: { + deleting = true + } + } + + Opaque.ScalingLabel { + id: deleteConfirmLabel + //: Type DELETE to confirm + text: qsTr("delete-confirm-label")+ ":" + visible: deleting + } + + Opaque.TextField { + id: confirmDeleteTxt + Layout.fillWidth: true + //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } + visible: deleting + } + + Opaque.Button { + id: confirmDeleteBtn + icon: "regular/trash-alt" + + //: 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" + gcd.deleteProfile(onion) gcd.reloadProfileList() parentStack.pane = parentStack.managementPane + } else { + deleteConfirmLabel.color = "red" } + } - - } - } - - 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 { - //: Delete Profile - text: qsTr("delete-profile-btn") - icon: "regular/trash-alt" - visible: mode == "edit" - - - onClicked: { - deleting = true - } - } - - Opaque.ScalingLabel { - id: deleteConfirmLabel - //: Type DELETE to confirm - text: qsTr("delete-confirm-label")+ ":" - visible: deleting - } - - Opaque.TextField { - id: confirmDeleteTxt - Layout.fillWidth: true - //style: CwtchTextFieldStyle{ width: tehcol.width * 0.8 } - visible: deleting - } - - Opaque.Button { - id: confirmDeleteBtn - icon: "regular/trash-alt" - - //: 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" - gcd.deleteProfile(onion) - gcd.reloadProfileList() - parentStack.pane = parentStack.managementPane - } else { - deleteConfirmLabel.color = "red" - } - } } - }//end of column with padding - }//end of flickable + }//end of column - Connections { // UPDATE UNREAD MESSAGES COUNTER - target: gcd - onChangePasswordResponse: function(error) { - if (!error) { - gcd.reloadProfileList() - parentStack.pane = parentStack.managementPane - } else { - passwordChangeErrorLabel.visible = true + Connections { // UPDATE UNREAD MESSAGES COUNTER + target: gcd + + onChangePasswordResponse: function(error) { + if (!error) { + gcd.reloadProfileList() + parentStack.pane = parentStack.managementPane + } else { + passwordChangeErrorLabel.visible = true + } } } } -} diff --git a/qml/panes/ProfileManagerPane.qml b/qml/panes/ProfileManagerPane.qml index 9447004a..0c0375cb 100644 --- a/qml/panes/ProfileManagerPane.qml +++ b/qml/panes/ProfileManagerPane.qml @@ -14,6 +14,7 @@ import "../opaque" as Opaque import "../opaque/controls" import "../opaque/styles" import "../opaque/theme" +import "../opaque/fonts" ColumnLayout { @@ -25,19 +26,53 @@ ColumnLayout { Opaque.ScalingLabel { anchors.horizontalCenter: parent.horizontalCenter wrapMode: TextEdit.Wrap + size: Theme.primaryTextSize + + + font.family: Fonts.applicationFontRegular.name + font.styleName: "Bold" + //: Please enter password: text: qsTr("enter-profile-password")+":" } - Opaque.UnderlineTextField { - id: txtPassword - anchors.horizontalCenter: parent.horizontalCenter - Layout.fillWidth: true - Layout.rightMargin: 40 - Layout.leftMargin: 40 - placeholderText: qsTr("password") - echoMode: TextInput.Password - onAccepted: button.clicked() + RowLayout { + width: 700 * gcd.themeScale + Layout.alignment: Qt.AlignHCenter + + Opaque.UnderlineTextField { + id: txtPassword + //anchors.horizontalCenter: parent.horizontalCenter + //Layout.fillWidth: true + Layout.maximumWidth: 450 * gcd.themeScale + Layout.minimumWidth: 450 * gcd.themeScale + + Layout.rightMargin: 40 + Layout.leftMargin: 40 + placeholderText: qsTr("password") + echoMode: TextInput.Password + onAccepted: button.clicked() + } + + Opaque.Button { + id: "button" + //anchors.horizontalCenter: parent.horizontalCenter + + width: 100 * gcd.themeScale + + icon: "solid/unlock-alt" + //: Unlock + text: qsTr("unlock") + + height: Theme.primaryTextSize * gcd.themeScale + + + onClicked: { + gcd.unlockProfiles(txtPassword.text) + txtPassword.text = "" + error.visible = false + } + } } Opaque.ScalingLabel { @@ -49,20 +84,7 @@ ColumnLayout { visible: false } - Opaque.Button { - id: "button" - anchors.horizontalCenter: parent.horizontalCenter - icon: "solid/unlock-alt" - //: Unlock - text: qsTr("unlock") - - onClicked: { - gcd.unlockProfiles(txtPassword.text) - txtPassword.text = "" - error.visible = false - } - } Connections { // ADD/REMOVE CONTACT ENTRIES target: gcd diff --git a/qml/widgets/ProfileList.qml b/qml/widgets/ProfileList.qml index 624a53e9..5d50ea44 100644 --- a/qml/widgets/ProfileList.qml +++ b/qml/widgets/ProfileList.qml @@ -97,7 +97,7 @@ ColumnLayout { } Opaque.PortraitRow { - Layout.fillWidth: true + Layout.fillWidth: true handle: "" displayName: qsTr("add-new-profile-btn") nameColor: Theme.mainTextColor diff --git a/qml/widgets/ProfileRow.qml b/qml/widgets/ProfileRow.qml index 03fd71db..669d71a0 100644 --- a/qml/widgets/ProfileRow.qml +++ b/qml/widgets/ProfileRow.qml @@ -12,6 +12,7 @@ import "../opaque/styles" import "../opaque/theme" Opaque.PortraitRow { + id: root badgeColor: Theme.portraitProfileBadgeColor portraitBorderColor: Theme.portraitOnlineBorderColor @@ -26,9 +27,12 @@ Opaque.PortraitRow { width: height } - Opaque.Button {// Edit BUTTON + Opaque.Icon {// Edit BUTTON id: btnEdit - icon: "solid/user-edit" + source: gcd.assetPath + "core/edit-24px.svg" + + backgroundColor: root.color + iconColor: Theme.altTextColor anchors.right: parent.right @@ -36,14 +40,20 @@ Opaque.PortraitRow { anchors.verticalCenter: parent.verticalCenter anchors.leftMargin: 1 * gcd.themeScale anchors.rightMargin: 20 * gcd.themeScale - height: parent.height * 0.75 - + height: parent.height * 0.5 + width: parent.height * 0.5 + size: parent.height * 0.5 onClicked: { profileAddEditPane.load(handle, displayName, tag) parentStack.pane = parentStack.addEditProfilePane } + + onHover: function (hover) { + root.isHover = hover + } + } onClicked: function openClick(handle) {