Merge lp:~nik90/podbird/header-actions into lp:podbird

Proposed by Nekhelesh Ramananthan
Status: Merged
Approved by: Michael Sheldon
Approved revision: 8
Merged at revision: 9
Proposed branch: lp:~nik90/podbird/header-actions
Merge into: lp:podbird
Diff against target: 232 lines (+70/-76)
2 files modified
app/ui/PodcastsTab.qml (+55/-61)
po/com.mikeasoft.podbird.pot (+15/-15)
To merge this branch: bzr merge lp:~nik90/podbird/header-actions
Reviewer Review Type Date Requested Status
Michael Sheldon Approve
Review via email: mp+247516@code.launchpad.net

Commit message

Replaces toolbar items with head actions.

Description of the change

Replaces toolbar items with head actions as recommended by the SDK devs.

To post a comment you must log in.
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Great, thanks :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'app/ui/PodcastsTab.qml'
2--- app/ui/PodcastsTab.qml 2015-01-10 10:10:43 +0000
3+++ app/ui/PodcastsTab.qml 2015-01-24 17:28:18 +0000
4@@ -31,53 +31,47 @@
5 property bool addPodcast: false;
6
7 page: Page {
8- tools: ToolbarItems {
9- ToolbarButton {
10- action: Action {
11- text: i18n.tr("Add Podcast")
12- iconName: "add"
13- visible: view.model === podcastModel && !addPodcast
14- onTriggered: {
15- addPodcast = true;
16- }
17- }
18- }
19-
20- ToolbarButton {
21- action: Action {
22- text: i18n.tr("Up")
23- iconName: "up"
24- visible: view.model === episodeModel
25- onTriggered: {
26+ head.actions: [
27+ Action {
28+ text: i18n.tr("Add Podcast")
29+ iconName: "add"
30+ visible: view.model === podcastModel && !addPodcast
31+ onTriggered: {
32+ addPodcast = true;
33+ }
34+ },
35+
36+ Action {
37+ text: i18n.tr("Up")
38+ iconName: "up"
39+ visible: view.model === episodeModel
40+ onTriggered: {
41+ page.title = i18n.tr("Podcasts");
42+ view.model = podcastModel;
43+ refreshModel();
44+ }
45+ },
46+
47+ Action {
48+ text: i18n.tr("Unsubscribe")
49+ iconName: "delete"
50+ visible: view.model === episodeModel
51+ onTriggered: {
52+ var db = Podcasts.init();
53+ db.transaction(function (tx) {
54+ var rs = tx.executeSql("SELECT downloadedfile FROM Episode WHERE downloadedfile NOT NULL AND podcast=?", [episodeModel.pid]);
55+ for(var i = 0; i < rs.rows.length; i++) {
56+ fileManager.deleteFile(rs.rows.item(i).downloadedfile);
57+ }
58+ tx.executeSql("DELETE FROM Episode WHERE podcast=?", [episodeModel.pid]);
59+ tx.executeSql("DELETE FROM Podcast WHERE rowid=?", [episodeModel.pid]);
60 page.title = i18n.tr("Podcasts");
61 view.model = podcastModel;
62 refreshModel();
63- }
64- }
65- }
66-
67- ToolbarButton {
68- action: Action {
69- text: i18n.tr("Unsubscribe")
70- iconName: "delete"
71- visible: view.model === episodeModel
72- onTriggered: {
73- var db = Podcasts.init();
74- db.transaction(function (tx) {
75- var rs = tx.executeSql("SELECT downloadedfile FROM Episode WHERE downloadedfile NOT NULL AND podcast=?", [episodeModel.pid]);
76- for(var i = 0; i < rs.rows.length; i++) {
77- fileManager.deleteFile(rs.rows.item(i).downloadedfile);
78- }
79- tx.executeSql("DELETE FROM Episode WHERE podcast=?", [episodeModel.pid]);
80- tx.executeSql("DELETE FROM Podcast WHERE rowid=?", [episodeModel.pid]);
81- page.title = i18n.tr("Podcasts");
82- view.model = podcastModel;
83- refreshModel();
84- });
85- }
86- }
87- }
88- }
89+ });
90+ }
91+ }
92+ ]
93
94 onVisibleChanged: {
95 if(visible) {
96@@ -117,16 +111,16 @@
97 }
98
99 Component {
100- id: subscribeFailedDialog
101- Dialog {
102- id: dialogInternal
103- title: i18n.tr("Unable to subscribe")
104- text: i18n.tr("Please check the URL and try again")
105- Button {
106- text: i18n.tr("Close")
107- onClicked: PopupUtils.close(dialogInternal)
108- }
109- }
110+ id: subscribeFailedDialog
111+ Dialog {
112+ id: dialogInternal
113+ title: i18n.tr("Unable to subscribe")
114+ text: i18n.tr("Please check the URL and try again")
115+ Button {
116+ text: i18n.tr("Close")
117+ onClicked: PopupUtils.close(dialogInternal)
118+ }
119+ }
120 }
121
122 Label {
123@@ -578,13 +572,13 @@
124 var ers = tx2.executeSql("SELECT rowid FROM Episode WHERE guid=?", [track.guid]);
125 if (ers.rows.length === 0) {
126 tx2.executeSql("INSERT INTO Episode(podcast, name, description, audiourl, guid, listened, duration, published) VALUES(?, ?, ? , ?, ?, ?, ?, ?)", [pid,
127- track.name,
128- track.description,
129- track.audiourl,
130- track.guid,
131- false,
132- track.duration,
133- track.published]);
134+ track.name,
135+ track.description,
136+ track.audiourl,
137+ track.guid,
138+ false,
139+ track.duration,
140+ track.published]);
141 }
142 });
143 }
144
145=== modified file 'po/com.mikeasoft.podbird.pot'
146--- po/com.mikeasoft.podbird.pot 2015-01-10 10:10:43 +0000
147+++ po/com.mikeasoft.podbird.pot 2015-01-24 17:28:18 +0000
148@@ -8,7 +8,7 @@
149 msgstr ""
150 "Project-Id-Version: \n"
151 "Report-Msgid-Bugs-To: \n"
152-"POT-Creation-Date: 2015-01-10 10:09+0000\n"
153+"POT-Creation-Date: 2015-01-24 18:24+0100\n"
154 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
155 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
156 "Language-Team: LANGUAGE <LL@li.org>\n"
157@@ -17,54 +17,54 @@
158 "Content-Type: text/plain; charset=CHARSET\n"
159 "Content-Transfer-Encoding: 8bit\n"
160
161-#: ../app/ui/PodcastsTab.qml:29 ../app/ui/PodcastsTab.qml:52
162-#: ../app/ui/PodcastsTab.qml:73
163+#: ../app/ui/PodcastsTab.qml:29 ../app/ui/PodcastsTab.qml:49
164+#: ../app/ui/PodcastsTab.qml:68
165 msgid "Podcasts"
166 msgstr ""
167
168-#: ../app/ui/PodcastsTab.qml:37
169+#: ../app/ui/PodcastsTab.qml:36
170 msgid "Add Podcast"
171 msgstr ""
172
173-#: ../app/ui/PodcastsTab.qml:48
174+#: ../app/ui/PodcastsTab.qml:45
175 msgid "Up"
176 msgstr ""
177
178-#: ../app/ui/PodcastsTab.qml:61
179+#: ../app/ui/PodcastsTab.qml:56
180 msgid "Unsubscribe"
181 msgstr ""
182
183-#: ../app/ui/PodcastsTab.qml:123
184+#: ../app/ui/PodcastsTab.qml:117
185 msgid "Unable to subscribe"
186 msgstr ""
187
188-#: ../app/ui/PodcastsTab.qml:124
189+#: ../app/ui/PodcastsTab.qml:118
190 msgid "Please check the URL and try again"
191 msgstr ""
192
193-#: ../app/ui/PodcastsTab.qml:126
194+#: ../app/ui/PodcastsTab.qml:120
195 msgid "Close"
196 msgstr ""
197
198-#: ../app/ui/PodcastsTab.qml:136
199+#: ../app/ui/PodcastsTab.qml:130
200 msgid "No Podcast Subscriptions"
201 msgstr ""
202
203-#: ../app/ui/PodcastsTab.qml:136
204+#: ../app/ui/PodcastsTab.qml:130
205 msgid ""
206 "You haven't subscribed to any podcasts yet, visit the 'Search' page to add "
207 "some."
208 msgstr ""
209
210-#: ../app/ui/PodcastsTab.qml:393
211+#: ../app/ui/PodcastsTab.qml:387
212 msgid "Feed URL..."
213 msgstr ""
214
215-#: ../app/ui/PodcastsTab.qml:407
216+#: ../app/ui/PodcastsTab.qml:401
217 msgid "Cancel"
218 msgstr ""
219
220-#: ../app/ui/PodcastsTab.qml:417
221+#: ../app/ui/PodcastsTab.qml:411
222 msgid "Add"
223 msgstr ""
224
225@@ -80,6 +80,6 @@
226 msgid "Subscribe"
227 msgstr ""
228
229-#: /home/mike/src/build-podbird-Ubuntu_Device2_GCC_armhf_ubuntu_sdk_14_10_utopic-Default/po/Podbird.desktop.in.h:1
230+#: /home/krnekhelesh/Documents/Ubuntu-Projects/MP-Reviews/builddir/build-podbird-header-actions-rtm_stable_GCC_i386_ubuntu_sdk_14_10_utopic-Default/po/Podbird.desktop.in.h:1
231 msgid "Podbird"
232 msgstr ""

Subscribers

People subscribed via source and target branches