summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomasz Sterna <tomek@xiaoka.com>2015-04-17 15:59:39 +0200
committerTomasz Sterna <tomek@xiaoka.com>2015-04-17 15:59:39 +0200
commit8bb7a35eedd431f707ca6fb9134c35bace8e4b24 (patch)
treeb9ee5787397604c198b5630197e995219203518d
parent453e9ea4ea8d56ad84c2329cb95f1dfed279be95 (diff)
Disclaimer page
-rw-r--r--app/app.pro1
-rw-r--r--app/pebble.cpp38
-rw-r--r--app/qml/pages/AboutPage.qml2
-rw-r--r--app/qml/pages/Disclaimer.qml78
-rw-r--r--app/qml/pages/WatchInfo.qml2
-rw-r--r--app/translations/pebble-es.ts41
-rw-r--r--app/translations/pebble-pl.ts65
-rw-r--r--app/translations/pebble.ts33
8 files changed, 227 insertions, 33 deletions
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 <thomas.perl@jollamobile.com>
- 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 <QtQuick>
+#include <QQmlPropertyMap>
#include <sailfishapp.h>
#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<QGuiApplication> app(SailfishApp::application(argc, argv));
@@ -56,10 +28,14 @@ int main(int argc, char *argv[])
QScopedPointer<PebbledInterface> pebbled(new PebbledInterface);
QScopedPointer<PebbleAppIconProvider> appicons(new PebbleAppIconProvider(pebbled.data()));
QScopedPointer<PebbleFirmware> firmware(new PebbleFirmware);
+ QScopedPointer<QQmlPropertyMap> 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
@@ -104,6 +104,47 @@
</message>
</context>
<context>
+ <name>Disclaimer</name>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="21"/>
+ <source>Feature unavailable</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="31"/>
+ <source>This feature is available for supporters only.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="44"/>
+ <source>Supporter?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="51"/>
+ <source>Send me my code!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="61"/>
+ <source>Activation code</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Version</source>
+ <translation type="obsolete">Versión</translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="34"/>
+ <source>PayPal Donate</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Bugs?</source>
+ <translation type="obsolete">¿Errores?</translation>
+ </message>
+</context>
+<context>
<name>InstallAppDialog</name>
<message>
<source>Install app</source>
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
@@ -104,6 +104,71 @@
</message>
</context>
<context>
+ <name>Disclaimer</name>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="21"/>
+ <source>Feature unavailable</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="31"/>
+ <source>This feature is available for supporters only.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="44"/>
+ <source>Supporter?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="51"/>
+ <source>Send me my code!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="61"/>
+ <source>Activation code</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <source>Version</source>
+ <translation type="obsolete">Wersja</translation>
+ </message>
+ <message>
+ <source>All Rights Reserved.</source>
+ <translation type="obsolete">Wszelkie prawa zastrzeżone.</translation>
+ </message>
+ <message>
+ <source>Support</source>
+ <translation type="obsolete">Wsparcie</translation>
+ </message>
+ <message>
+ <source>Your donations help justify development time.</source>
+ <translation type="obsolete">Dotacje pomagają uzasadnić czas poświęcony na rozwój aplikacji.</translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="34"/>
+ <source>PayPal Donate</source>
+ <translation type="unfinished">Dotacja PayPal</translation>
+ </message>
+ <message>
+ <source>Bugs?</source>
+ <translation type="obsolete">Błędy?</translation>
+ </message>
+ <message>
+ <source>Open Bug Tracker</source>
+ <translation type="obsolete">Otwórz Bug Tracker</translation>
+ </message>
+ <message>
+ <source>Forum Thread</source>
+ <translation type="obsolete">Wątek na forum</translation>
+ </message>
+ <message>
+ <source>Send issue e-mail to developer</source>
+ <translation type="obsolete">Wyślij zgłoszenie e-mail do developera</translation>
+ </message>
+</context>
+<context>
<name>InstallAppDialog</name>
<message>
<location filename="../qml/pages/InstallAppDialog.qml" line="17"/>
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
@@ -104,6 +104,39 @@
</message>
</context>
<context>
+ <name>Disclaimer</name>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="21"/>
+ <source>Feature unavailable</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="31"/>
+ <source>This feature is available for supporters only.</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="44"/>
+ <source>Supporter?</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="51"/>
+ <source>Send me my code!</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="61"/>
+ <source>Activation code</source>
+ <translation type="unfinished"></translation>
+ </message>
+ <message>
+ <location filename="../qml/pages/Disclaimer.qml" line="34"/>
+ <source>PayPal Donate</source>
+ <translation type="unfinished"></translation>
+ </message>
+</context>
+<context>
<name>InstallAppDialog</name>
<message>
<location filename="../qml/pages/InstallAppDialog.qml" line="17"/>