From 8bb7a35eedd431f707ca6fb9134c35bace8e4b24 Mon Sep 17 00:00:00 2001 From: Tomasz Sterna Date: Fri, 17 Apr 2015 15:59:39 +0200 Subject: Disclaimer page --- app/app.pro | 1 + app/pebble.cpp | 38 ++++----------------- app/qml/pages/AboutPage.qml | 2 +- app/qml/pages/Disclaimer.qml | 78 +++++++++++++++++++++++++++++++++++++++++++ app/qml/pages/WatchInfo.qml | 2 +- app/translations/pebble-es.ts | 41 +++++++++++++++++++++++ app/translations/pebble-pl.ts | 65 ++++++++++++++++++++++++++++++++++++ app/translations/pebble.ts | 33 ++++++++++++++++++ 8 files changed, 227 insertions(+), 33 deletions(-) create mode 100644 app/qml/pages/Disclaimer.qml diff --git a/app/app.pro b/app/app.pro index 18be5a5..2872cf7 100644 --- a/app/app.pro +++ b/app/app.pro @@ -32,6 +32,7 @@ OTHER_FILES += \ qml/pages/WebItemSelDialog.qml \ qml/pages/AppStorePage.qml \ qml/pages/WatchInfo.qml \ + qml/pages/Disclaimer.qml \ qml/pebble.qml \ translations/*.ts \ pebble.desktop \ diff --git a/app/pebble.cpp b/app/pebble.cpp index 04ff6a8..804a85e 100644 --- a/app/pebble.cpp +++ b/app/pebble.cpp @@ -1,35 +1,5 @@ -/* - Copyright (C) 2014 Jouni Roivas - Copyright (C) 2013 Jolla Ltd. - Contact: Thomas Perl - All rights reserved. - - You may use this file under the terms of BSD license as follows: - - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - * Neither the name of the authors nor the - names of its contributors may be used to endorse or promote products - derived from this software without specific prior written permission. - - THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND - ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED - WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE LIABLE FOR - ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES - (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND - ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -*/ - #include +#include #include #include "pebbledinterface.h" @@ -37,6 +7,8 @@ #include "pebblefirmware.h" #include "pebblestoreview.h" +const char DONATE_URL[] = "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MAGN86VCARBSA"; + int main(int argc, char *argv[]) { QScopedPointer app(SailfishApp::application(argc, argv)); @@ -56,10 +28,14 @@ int main(int argc, char *argv[]) QScopedPointer pebbled(new PebbledInterface); QScopedPointer appicons(new PebbleAppIconProvider(pebbled.data())); QScopedPointer firmware(new PebbleFirmware); + QScopedPointer donate(new QQmlPropertyMap); + + donate->insert("url", QString(DONATE_URL)); view->rootContext()->setContextProperty("APP_VERSION", APP_VERSION); view->rootContext()->setContextProperty("pebbled", pebbled.data()); view->rootContext()->setContextProperty("pebbleFirmware", firmware.data()); + view->rootContext()->setContextProperty("donate", donate.data()); view->engine()->addImageProvider("pebble-app-icon", appicons.data()); view->setSource(SailfishApp::pathTo("qml/pebble.qml")); view->show(); diff --git a/app/qml/pages/AboutPage.qml b/app/qml/pages/AboutPage.qml index c121608..86a05c5 100644 --- a/app/qml/pages/AboutPage.qml +++ b/app/qml/pages/AboutPage.qml @@ -80,7 +80,7 @@ Page { right: parent.right margins: Theme.paddingLarge * 2 } - onClicked: Qt.openUrlExternally("https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=MAGN86VCARBSA") + onClicked: Qt.openUrlExternally(donate.url) } Label { diff --git a/app/qml/pages/Disclaimer.qml b/app/qml/pages/Disclaimer.qml new file mode 100644 index 0000000..baf5cd0 --- /dev/null +++ b/app/qml/pages/Disclaimer.qml @@ -0,0 +1,78 @@ +import QtQuick 2.0 +import QtQml 2.1 +import Sailfish.Silica 1.0 + +Page { + id: page + + SilicaFlickable { + id: flickable + anchors.fill: parent + contentHeight: column.height + + VerticalScrollDecorator { flickable: flickable } + + Column { + id: column + width: page.width + spacing: Theme.paddingMedium + + PageHeader { + title: qsTr("Feature unavailable") + } + Label { + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingLarge + } + font.pixelSize: Theme.fontSizeSmall + wrapMode: Text.Wrap + text: qsTr("This feature is available for supporters only.") + } + Button { + text: qsTr("PayPal Donate") + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingLarge * 2 + } + onClicked: Qt.openUrlExternally(donate.url) + } + + Label { + text: qsTr("Supporter?") + font.family: Theme.fontFamilyHeading + color: Theme.highlightColor + anchors.right: parent.right + anchors.rightMargin: Theme.paddingMedium + } + Button { + text: qsTr("Send me my code!") + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingLarge * 2 + } + onClicked: Qt.openUrlExternally("mailto:support@xiaoka.com?subject=pebbled code request - "+ + donate.id + "&body=My paypal id is: ") + } + Label { + text: qsTr("Activation code") + font.family: Theme.fontFamilyHeading + color: Theme.highlightColor + anchors.left: parent.left + anchors.leftMargin: Theme.paddingMedium + } + TextField { + id: code + anchors { + left: parent.left + right: parent.right + margins: Theme.paddingMedium + } + focus: true + } + } + } +} diff --git a/app/qml/pages/WatchInfo.qml b/app/qml/pages/WatchInfo.qml index 69a916c..af4a740 100644 --- a/app/qml/pages/WatchInfo.qml +++ b/app/qml/pages/WatchInfo.qml @@ -96,7 +96,7 @@ Page { right: parent.right margins: Theme.paddingLarge * 2 } - onClicked: pageStack.push(Qt.resolvedUrl("FirmwareUpgrade.qml")) + onClicked: pageStack.push(Qt.resolvedUrl(donate.active ? "FirmwareUpgrade.qml" : "Disclaimer.qml")) } } } diff --git a/app/translations/pebble-es.ts b/app/translations/pebble-es.ts index f4255bd..6bdb778 100644 --- a/app/translations/pebble-es.ts +++ b/app/translations/pebble-es.ts @@ -103,6 +103,47 @@ desconectado + + Disclaimer + + + Feature unavailable + + + + + This feature is available for supporters only. + + + + + Supporter? + + + + + Send me my code! + + + + + Activation code + + + + Version + Versión + + + + PayPal Donate + + + + Bugs? + ¿Errores? + + InstallAppDialog diff --git a/app/translations/pebble-pl.ts b/app/translations/pebble-pl.ts index 040df3d..ebe4f1a 100644 --- a/app/translations/pebble-pl.ts +++ b/app/translations/pebble-pl.ts @@ -103,6 +103,71 @@ rozłączony + + Disclaimer + + + Feature unavailable + + + + + This feature is available for supporters only. + + + + + Supporter? + + + + + Send me my code! + + + + + Activation code + + + + Version + Wersja + + + All Rights Reserved. + Wszelkie prawa zastrzeżone. + + + Support + Wsparcie + + + Your donations help justify development time. + Dotacje pomagają uzasadnić czas poświęcony na rozwój aplikacji. + + + + PayPal Donate + Dotacja PayPal + + + Bugs? + Błędy? + + + Open Bug Tracker + Otwórz Bug Tracker + + + Forum Thread + Wątek na forum + + + Send issue e-mail to developer + Wyślij zgłoszenie e-mail do developera + + InstallAppDialog diff --git a/app/translations/pebble.ts b/app/translations/pebble.ts index 9da7dd2..24f2352 100644 --- a/app/translations/pebble.ts +++ b/app/translations/pebble.ts @@ -103,6 +103,39 @@ + + Disclaimer + + + Feature unavailable + + + + + This feature is available for supporters only. + + + + + Supporter? + + + + + Send me my code! + + + + + Activation code + + + + + PayPal Donate + + + InstallAppDialog -- cgit v1.2.3