Merge lp:~rpadovani/ubuntu-clock-app/17Feb2014 into lp:ubuntu-clock-app/saucy

Proposed by Riccardo Padovani
Status: Rejected
Rejected by: Riccardo Padovani
Proposed branch: lp:~rpadovani/ubuntu-clock-app/17Feb2014
Merge into: lp:ubuntu-clock-app/saucy
Diff against target: 59 lines (+30/-1)
2 files modified
CMakeLists.txt (+1/-1)
ubuntu-clock-app.qml (+29/-0)
To merge this branch: bzr merge lp:~rpadovani/ubuntu-clock-app/17Feb2014
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Needs Fixing
Ubuntu Clock Developers Pending
Review via email: mp+206693@code.launchpad.net

Commit message

Added support for arguments

Description of the change

Added support for arguments.
Now if "alarm" is passed the "Alarm" tab is opened

To post a comment you must log in.
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)

Unmerged revisions

345. By Riccardo Padovani

Added arguments support

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2014-02-12 23:36:09 +0000
3+++ CMakeLists.txt 2014-02-17 11:42:51 +0000
4@@ -23,7 +23,7 @@
5 set(CMAKE_INSTALL_PREFIX /)
6 set(CMAKE_INSTALL_BINDIR /)
7 set(DATA_DIR /)
8- set(EXEC "qmlscene ${MAIN_QML}")
9+ set(EXEC "qmlscene %u ${MAIN_QML}")
10 set(DESKTOP_DIR ${DATA_DIR})
11 set(URLS_DIR ${DATA_DIR})
12 else(CLICK_MODE)
13
14=== modified file 'ubuntu-clock-app.qml'
15--- ubuntu-clock-app.qml 2014-02-11 13:54:38 +0000
16+++ ubuntu-clock-app.qml 2014-02-17 11:42:51 +0000
17@@ -73,6 +73,10 @@
18 root.width = minimumWidth
19 root.height = minimumHeight
20 }
21+
22+ // If alarm has been invoked on startup
23+ if (parseArgument(args.defaultArgument.at(0)) === "alarm")
24+ rootTabs.selectedTabIndex = 1;
25 }
26
27 actions: [
28@@ -87,6 +91,31 @@
29 }
30 ]
31
32+ // Argument during startup
33+ Arguments {
34+ id: args;
35+
36+ // IMPORTANT
37+ // Due to bug #1231558 you have to pass arguments BEFORE app:
38+ // qmlscene alarm:/// ubuntu-clock-app.qml
39+
40+ defaultArgument.valueNames: ["URL"];
41+ defaultArgument.help: i18n.tr("Clock app accepts only one argument: alarm:/// to switch to Alarm Page");
42+ }
43+
44+ // Function to parse arguments that are invoked on start
45+ function parseArgument(url) {
46+ var alarmPattern = new RegExp ("alarm");
47+ console.log('url ' + url)
48+ console.log('alarmPattern ' + alarmPattern)
49+ if (alarmPattern.test(url))
50+ {
51+ console.log('test true')
52+ return "alarm";
53+ }
54+ console.log('test false')
55+ }
56+
57 // Timer that runs our app
58 Timer {
59 id: updateTimer

Subscribers

People subscribed via source and target branches