commit 61be1c7d2bf6521fc0ba0fc77bf397c5d490b86f
parent c85aa1be3d4ce78afe44e3fa8761336828bfaa06
Author: Daniel Vrátil <dvratil@kde.org>
Date: Mon, 4 Feb 2019 01:06:36 +0100
Add 'About' page
Diffstat:
7 files changed, 119 insertions(+), 2 deletions(-)
diff --git a/harbour-passilic.pro b/harbour-passilic.pro
@@ -39,12 +39,14 @@ DISTFILES += \
qml/cover/CoverPage.qml \
qml/pages/PasswordListPage.qml \
qml/pages/PassphraseRequester.qml \
+ qml/components/GlobalPullDownMenu.qml \
rpm/harbour-passilic.changes.in \
rpm/harbour-passilic.changes.run.in \
rpm/harbour-passilic.spec \
rpm/harbour-passilic.yaml \
translations/*.ts \
- harbour-passilic.desktop
+ harbour-passilic.desktop \
+ qml/pages/AboutPage.qml
SAILFISHAPP_ICONS = 86x86 108x108 128x128 172x172
diff --git a/qml/components/GlobalPullDownMenu.qml b/qml/components/GlobalPullDownMenu.qml
@@ -0,0 +1,27 @@
+/*
+ * Copyright (C) 2019 Daniel Vrátil <dvratil@kde.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.2
+import QtQml.Models 2.2
+import Sailfish.Silica 1.0
+
+PullDownMenu {
+ MenuItem {
+ text: qsTr("About")
+ onClicked: app.pageStack.push(Qt.resolvedUrl("../pages/AboutPage.qml"))
+ }
+}
diff --git a/qml/images/icon.png b/qml/images/icon.png
Binary files differ.
diff --git a/qml/pages/AboutPage.qml b/qml/pages/AboutPage.qml
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2019 Daniel Vrátil <dvratil@kde.org>
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <https://www.gnu.org/licenses/>.
+ */
+
+import QtQuick 2.2
+import QtQml.Models 2.2
+import Sailfish.Silica 1.0
+
+Page {
+
+ Column {
+ anchors {
+ fill: parent
+ leftMargin: Theme.horizontalPageMargin
+ rightMargin: Theme.horizontalPageMargin
+ }
+
+ spacing: Theme.paddingMedium
+
+
+ PageHeader {
+ title: qsTr("About")
+ }
+
+ Row {
+ spacing: Theme.paddingLarge
+
+ Image {
+ anchors {
+ verticalCenter: parent.verticalCenter
+ }
+
+ id: icon
+ source: "../images/icon.png"
+ }
+
+ Column {
+ spacing: Theme.paddingMedium
+
+ Label {
+ text: qsTr("Passilic")
+ font.pixelSize: Theme.fontSizeExtraLarge
+ }
+
+ Label {
+ text: qsTr("Version %1").arg(Qt.application.version)
+ font.pixelSize: Theme.fontSizeSmall
+ }
+
+ Label {
+ text: qsTr("Author: Daniel Vrátil")
+ font.pixelSize: Theme.fontSizeSmall
+ }
+ }
+ }
+
+ Label {
+ text: qsTr("Homepage: <a href=\"%1\">Github</a>").arg("https://github.com/danvratil/harbour-passilic")
+ font.pixelSize: Theme.fontSizeSmall
+ }
+
+ Label {
+ text: qsTr("License: GPLv3")
+ font.pixelSize: Theme.fontSizeSmall
+ }
+ }
+}
diff --git a/qml/pages/PasswordListPage.qml b/qml/pages/PasswordListPage.qml
@@ -19,6 +19,7 @@ import QtQuick 2.2
import QtQml.Models 2.2
import Sailfish.Silica 1.0
import harbour.passilic 1.0
+import "../components"
Page {
id: passwordListPage
@@ -43,6 +44,8 @@ Page {
title: passwordListPage.currentPath === "" ? qsTr("Passilic") : passwordListPage.currentPath
}
+ GlobalPullDownMenu {}
+
model: DelegateModel {
id: delegateModel
diff --git a/rpm/harbour-passilic.spec b/rpm/harbour-passilic.spec
@@ -39,7 +39,7 @@ after 45 seconds.
%build
%qtc_qmake5
-%qtc_make %{?_smp_mflags}
+%qtc_make %{?_smp_mflags} DEFINES+=-DPASSILIC_VERSION=\\\"%{version}\\\"
%install
rm -rf %{buildroot}
diff --git a/src/main.cpp b/src/main.cpp
@@ -35,6 +35,11 @@ void addImageProvider(QQmlEngine *engine, const QString &id)
int main(int argc, char *argv[])
{
QScopedPointer<QGuiApplication> app(SailfishApp::application(argc, argv));
+ app->setApplicationDisplayName(QObject::tr("Passilic"));
+ app->setApplicationName(QStringLiteral("passilic"));
+ app->setApplicationVersion(PASSILIC_VERSION);
+ app->setOrganizationName(QObject::tr("Daniel Vrátil"));
+
QScopedPointer<QQuickView> view(SailfishApp::createView());
qmlRegisterType<PasswordsModel>("harbour.passilic", 1, 0, "PasswordsModel");