From 00116aea8c61d0541328eef5a947f2e8fcb63b35 Mon Sep 17 00:00:00 2001 From: Quentin Rouland Date: Tue, 14 Jan 2025 13:57:29 +0100 Subject: [PATCH] Fix am issue with page stack titles when navigationg the password list --- plugins/Pass/pass.cpp | 2 +- plugins/Pass/pass.h | 2 +- po/utpass.qrouland.pot | 34 +++++++++++++++++----------------- qml/components/FileDir.qml | 15 +-------------- qml/pages/Password.qml | 10 +++++----- qml/pages/PasswordList.qml | 17 +++++++++++++++-- 6 files changed, 40 insertions(+), 40 deletions(-) diff --git a/plugins/Pass/pass.cpp b/plugins/Pass/pass.cpp index d515a85..6472b72 100644 --- a/plugins/Pass/pass.cpp +++ b/plugins/Pass/pass.cpp @@ -39,7 +39,7 @@ void Pass::show(QUrl url) emit decryptCanceled(); } else { qInfo() << "Decrypt OK"; - emit decrypted(decrypt_ret.second); + emit decrypted(url.fileName(), decrypt_ret.second); } } diff --git a/plugins/Pass/pass.h b/plugins/Pass/pass.h index 3ff9fed..b11f450 100644 --- a/plugins/Pass/pass.h +++ b/plugins/Pass/pass.h @@ -15,7 +15,7 @@ private: QString m_password_store; signals: - void decrypted(QString text); + void decrypted(QString name, QString text); void decryptCanceled(); void decryptFailed(); diff --git a/po/utpass.qrouland.pot b/po/utpass.qrouland.pot index 5940020..b77b775 100644 --- a/po/utpass.qrouland.pot +++ b/po/utpass.qrouland.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: utpass.qrouland\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-01-14 12:17+0100\n" +"POT-Creation-Date: 2025-01-14 13:57+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -17,7 +17,7 @@ msgstr "" "Content-Type: text/plain; charset=CHARSET\n" "Content-Transfer-Encoding: 8bit\n" -#: ../qml/components/FileDir.qml:72 +#: ../qml/components/FileDir.qml:59 msgid "Decryption failed !" msgstr "" @@ -67,34 +67,34 @@ msgstr "" msgid "Maintainer" msgstr "" -#: ../qml/pages/Info.qml:108 +#: ../qml/pages/Info.qml:109 msgid "Suggest improvement(s) or report a bug(s)" msgstr "" -#: ../qml/pages/Info.qml:113 +#: ../qml/pages/Info.qml:114 msgid "Access to the source code" msgstr "" -#: ../qml/pages/Info.qml:121 +#: ../qml/pages/Info.qml:122 msgid "Released under the terms of the GNU GPL v3" msgstr "" -#: ../qml/pages/Info.qml:130 ../qml/pages/headers/MainHeader.qml:33 +#: ../qml/pages/Info.qml:131 ../qml/pages/headers/MainHeader.qml:33 msgid "Info" msgstr "" -#: ../qml/pages/PasswordList.qml:26 +#: ../qml/pages/PasswordList.qml:22 msgid "" "No password found
You can import a password store by cloning or importing " "a zip in the settings" msgstr "" -#: ../qml/pages/PasswordList.qml:65 +#: ../qml/pages/PasswordList.qml:61 msgid "Back" msgstr "" -#: ../qml/pages/headers/MainHeader.qml:9 ../qml/pages/headers/StackHeader.qml:9 -#: UTPass.desktop.in.h:1 +#: ../qml/pages/PasswordList.qml:68 ../qml/pages/headers/MainHeader.qml:9 +#: ../qml/pages/headers/StackHeader.qml:9 UTPass.desktop.in.h:1 msgid "UTPass" msgstr "" @@ -126,7 +126,7 @@ msgstr "" #: ../qml/pages/settings/ImportGitClone.qml:91 #: ../qml/pages/settings/ImportZip.qml:62 -#: ../qml/pages/settings/InfoKeys.qml:117 +#: ../qml/pages/settings/InfoKeys.qml:122 msgid "Yes" msgstr "" @@ -172,27 +172,27 @@ msgstr "" msgid "Key ID :" msgstr "" -#: ../qml/pages/settings/InfoKeys.qml:72 +#: ../qml/pages/settings/InfoKeys.qml:73 msgid "Users IDs : " msgstr "" -#: ../qml/pages/settings/InfoKeys.qml:96 +#: ../qml/pages/settings/InfoKeys.qml:99 msgid "Delete this key" msgstr "" -#: ../qml/pages/settings/InfoKeys.qml:116 +#: ../qml/pages/settings/InfoKeys.qml:121 msgid "You're are about to delete
%1
Continue ?" msgstr "" -#: ../qml/pages/settings/InfoKeys.qml:134 +#: ../qml/pages/settings/InfoKeys.qml:139 msgid "Key removal failed !" msgstr "" -#: ../qml/pages/settings/InfoKeys.qml:143 +#: ../qml/pages/settings/InfoKeys.qml:148 msgid "Key successfully deleted !" msgstr "" -#: ../qml/pages/settings/InfoKeys.qml:154 +#: ../qml/pages/settings/InfoKeys.qml:159 msgid "Info Keys" msgstr "" diff --git a/qml/components/FileDir.qml b/qml/components/FileDir.qml index 7810952..fb50b71 100644 --- a/qml/components/FileDir.qml +++ b/qml/components/FileDir.qml @@ -8,10 +8,6 @@ import QtQuick 2.4 Component { Rectangle { - id: fileDir - - property string activePasswordName - anchors.right: parent.right anchors.left: parent.left height: units.gu(5) @@ -40,17 +36,8 @@ Component { if (fileIsDir) { folderModel.folder = folderModel.folder + "/" + fileName; backAction.visible = true; + passwordListHeader.title = fileName; } else { - fileDir.activePasswordName = fileBaseName; - Pass.onDecrypted.connect(function(text) { - pageStack.push(Qt.resolvedUrl("../pages/Password.qml"), { - "plainText": text, - "title": fileDir.activePasswordName - }); - }); - Pass.onDecryptFailed.connect(function() { - PopupUtils.open(passwordPageDecryptError); - }); Pass.show(folderModel.folder + "/" + fileName); } } diff --git a/qml/pages/Password.qml b/qml/pages/Password.qml index 78eaa37..f4d4b15 100644 --- a/qml/pages/Password.qml +++ b/qml/pages/Password.qml @@ -49,11 +49,11 @@ Page { iconName: "back" text: "Back" onTriggered: { - passwordPage.plainText = ""; - for (var object in objects) { - object.text = ""; - object.destroy(); - } + // passwordPage.plainText = ""; + // for (var object in objects) { + // object.text = ""; + // object.destroy(); + // } pageStack.pop(); } } diff --git a/qml/pages/PasswordList.qml b/qml/pages/PasswordList.qml index 8dd8a96..a2ee897 100644 --- a/qml/pages/PasswordList.qml +++ b/qml/pages/PasswordList.qml @@ -13,6 +13,15 @@ Page { anchors.fill: parent Component.onCompleted: { passwordStorePath = "file:" + Pass.password_store; + Pass.onDecrypted.connect(function(filename, text) { + pageStack.push(Qt.resolvedUrl("../pages/Password.qml"), { + "plainText": text, + "title": filename + }); + }); + Pass.onDecryptFailed.connect(function() { + PopupUtils.open(passwordPageDecryptError); + }); } Rectangle { @@ -66,9 +75,13 @@ Page { visible: false onTriggered: { folderModel.folder = folderModel.parentFolder; - if (folderModel.rootFolder === folderModel.folder) + console.debug(folderModel.folder); + if (folderModel.rootFolder === folderModel.folder) { backAction.visible = false; - + passwordListHeader.title = i18n.tr("UTPass"); + } else { + passwordListHeader.title = folderModel.folder; + } } } ]