From c26443b6f82c6568e764e419748ad0236335f24c Mon Sep 17 00:00:00 2001 From: Quentin Rouland Date: Fri, 22 Mar 2019 17:40:44 +0100 Subject: [PATCH] Prettify info page --- .gitignore | 2 + README.md | 4 +- main.cpp | 1 - manifest.json.in | 2 +- po/utpass.qrouland.pot | 30 ++++++++++-- qml/models/Manifest.qml | 26 ++++++++++ .../{Passtore.qml => PasswordStore.qml} | 0 qml/models/qmldir | 2 +- qml/pages/Info.qml | 48 ++++++++++++++----- 9 files changed, 92 insertions(+), 23 deletions(-) rename qml/models/{Passtore.qml => PasswordStore.qml} (100%) diff --git a/.gitignore b/.gitignore index 4d0d9d4..306aaec 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,8 @@ build .clickable .idea *.project +*.workspace +.codelite # Third parties ouput dir third/local diff --git a/README.md b/README.md index 6098622..03fbce7 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # UTPass -A password management app for Ubuntu Touch aiming to be compatible with [ZX2C4’s pass command line application](https://www.passwordstore.org/) the standard unix password manager. +A Ubuntu Touch password management app aiming to be compatible with [ZX2C4’s pass command line application](https://www.passwordstore.org/) the standard unix password manager. # Building @@ -21,7 +21,7 @@ For more options/details see the [clickable documentation](http://clickable.bhdo # Contributing Any contributions are welcome using the github issue & pull request system. -Please try to respect the code style format by running ```clickable style``` before committing. +Please respect the code style format by running ```clickable style``` before committing. # Features diff --git a/main.cpp b/main.cpp index 46b912b..c231f89 100644 --- a/main.cpp +++ b/main.cpp @@ -7,7 +7,6 @@ int main(int argc, char *argv[]) { - new QGuiApplication(argc, argv); QGuiApplication::setApplicationName("utpass.qrouland"); diff --git a/manifest.json.in b/manifest.json.in index 6861a7b..0532fdf 100644 --- a/manifest.json.in +++ b/manifest.json.in @@ -1,6 +1,6 @@ { "name": "utpass.qrouland", - "description": "A password management app for Ubuntu Touch aiming to be compatible with", + "description": "A Ubuntu Touch password management app aiming to be compatible with pass", "architecture": "@CLICK_ARCH@", "title": "UTPass", "hooks": { diff --git a/po/utpass.qrouland.pot b/po/utpass.qrouland.pot index 6576440..c4ffb32 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: 2019-03-22 15:10+0000\n" +"POT-Creation-Date: 2019-03-22 16:39+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -29,19 +29,39 @@ msgstr "" msgid "No password found in the current folder" msgstr "" -#: ../qml/pages/Info.qml:9 ../qml/pages/headers/MainHeader.qml:56 +#: ../qml/pages/Info.qml:10 ../qml/pages/headers/MainHeader.qml:56 msgid "Info" msgstr "" -#: ../qml/pages/Info.qml:43 ../qml/pages/headers/MainHeader.qml:8 -#: ../qml/pages/headers/StackHeader.qml:8 UTPass.desktop.in.h:1 -msgid "UTPass" +#: ../qml/pages/Info.qml:31 +msgid "%1" +msgstr "" + +#: ../qml/pages/Info.qml:47 +msgid "Maintainer
%1
" msgstr "" #: ../qml/pages/Info.qml:53 +msgid "Version
%1

%2@%3" +msgstr "" + +#: ../qml/pages/Info.qml:64 msgid "Suggest improvement(s) or report a bug(s)" msgstr "" +#: ../qml/pages/Info.qml:68 +msgid "Access to the source code" +msgstr "" + +#: ../qml/pages/Info.qml:75 +msgid "Released under the terms of the GNU GPL v3" +msgstr "" + +#: ../qml/pages/headers/MainHeader.qml:8 ../qml/pages/headers/StackHeader.qml:8 +#: UTPass.desktop.in.h:1 +msgid "UTPass" +msgstr "" + #: ../qml/pages/headers/MainHeader.qml:23 #: ../qml/pages/headers/MainHeader.qml:38 msgid "Search" diff --git a/qml/models/Manifest.qml b/qml/models/Manifest.qml index a16cb51..bdfb882 100644 --- a/qml/models/Manifest.qml +++ b/qml/models/Manifest.qml @@ -2,4 +2,30 @@ pragma Singleton import QtQuick 2.4 Item { + id: manifest + property string name : "" + property string description : "" + property string architecture : "" + property string title : "" + property string version : "" + property string maintainer : "" + property string framework : "" + + Component.onCompleted: { + var xhr = new XMLHttpRequest; + xhr.open("GET", "../../manifest.json"); + xhr.onreadystatechange = function() { + if (xhr.readyState == XMLHttpRequest.DONE) { + var mJson = JSON.parse(xhr.responseText); + manifest.name = mJson.name + manifest.description = mJson.description + manifest.architecture = mJson.architecture + manifest.title = mJson.title + manifest.version = mJson.version + manifest.maintainer = mJson.maintainer + manifest.framework = mJson.framework + } + }; + xhr.send(); + } } diff --git a/qml/models/Passtore.qml b/qml/models/PasswordStore.qml similarity index 100% rename from qml/models/Passtore.qml rename to qml/models/PasswordStore.qml diff --git a/qml/models/qmldir b/qml/models/qmldir index 959f056..8cdf98d 100644 --- a/qml/models/qmldir +++ b/qml/models/qmldir @@ -1,2 +1,2 @@ -singleton Passtore 1.0 Passtore.qml +singleton PasswordStore 1.0 PasswordStore.qml singleton Manifest 1.0 Manifest.qml \ No newline at end of file diff --git a/qml/pages/Info.qml b/qml/pages/Info.qml index ac5e2ca..47b9b85 100644 --- a/qml/pages/Info.qml +++ b/qml/pages/Info.qml @@ -2,6 +2,7 @@ import QtQuick 2.4 import Ubuntu.Components 1.3 import "headers" import "../components" +import "../models" Page { header: StackHeader { @@ -16,11 +17,18 @@ Page { color: "#FFF" Flow { - spacing: 2 + spacing: units.gu(3) anchors.fill: parent - Rectangle { + Rectangle { + width: parent.width + height: units.gu(1) + } + Text { + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter width: parent.width height: units.gu(4) + text: i18n.tr('%1').arg(Manifest.title) } Rectangle { width: parent.width @@ -32,26 +40,40 @@ Page { anchors.horizontalCenter: parent.horizontalCenter } } - Rectangle { + Text { + horizontalAlignment: Text.AlignHCenter width: parent.width - height: units.gu(4) + height: units.gu(6) + text: i18n.tr('Maintainer
%1
').arg(Manifest.maintainer) } Text { horizontalAlignment: Text.AlignHCenter width: parent.width height: units.gu(6) - text: i18n.tr('UTPass') + text: i18n.tr('Version
%1

%2@%3').arg(Manifest.version).arg(Manifest.framework).arg(Manifest.architecture) } - Text { - horizontalAlignment: Text.AlignHCenter - width: parent.width - height: units.gu(6) - text: "Version" //i18n.tr("Version %1").arg(Manifest.get("version")) - } - Link { + + } + Flow { + spacing: 2 + anchors.bottom: parent.bottom + anchors.right: parent.right + anchors.left: parent.left + Link { url: "https://github.com/QRouland/UTPass/issues" text: i18n.tr('Suggest improvement(s) or report a bug(s)') } - } + Link { + url: "https://github.com/QRouland/UTPass" + text: i18n.tr('Access to the source code') + } + Text { + width: parent.width + height: units.gu(3) + horizontalAlignment: Text.AlignHCenter + verticalAlignment: Text.AlignVCenter + text: i18n.tr('Released under the terms of the GNU GPL v3') + } + } } }