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
=== modified file 'app/ui/PodcastsTab.qml'
--- app/ui/PodcastsTab.qml 2015-01-10 10:10:43 +0000
+++ app/ui/PodcastsTab.qml 2015-01-24 17:28:18 +0000
@@ -31,53 +31,47 @@
31 property bool addPodcast: false;31 property bool addPodcast: false;
3232
33 page: Page {33 page: Page {
34 tools: ToolbarItems {34 head.actions: [
35 ToolbarButton {35 Action {
36 action: Action {36 text: i18n.tr("Add Podcast")
37 text: i18n.tr("Add Podcast")37 iconName: "add"
38 iconName: "add"38 visible: view.model === podcastModel && !addPodcast
39 visible: view.model === podcastModel && !addPodcast39 onTriggered: {
40 onTriggered: {40 addPodcast = true;
41 addPodcast = true;41 }
42 }42 },
43 }43
44 }44 Action {
4545 text: i18n.tr("Up")
46 ToolbarButton {46 iconName: "up"
47 action: Action {47 visible: view.model === episodeModel
48 text: i18n.tr("Up")48 onTriggered: {
49 iconName: "up"49 page.title = i18n.tr("Podcasts");
50 visible: view.model === episodeModel50 view.model = podcastModel;
51 onTriggered: {51 refreshModel();
52 }
53 },
54
55 Action {
56 text: i18n.tr("Unsubscribe")
57 iconName: "delete"
58 visible: view.model === episodeModel
59 onTriggered: {
60 var db = Podcasts.init();
61 db.transaction(function (tx) {
62 var rs = tx.executeSql("SELECT downloadedfile FROM Episode WHERE downloadedfile NOT NULL AND podcast=?", [episodeModel.pid]);
63 for(var i = 0; i < rs.rows.length; i++) {
64 fileManager.deleteFile(rs.rows.item(i).downloadedfile);
65 }
66 tx.executeSql("DELETE FROM Episode WHERE podcast=?", [episodeModel.pid]);
67 tx.executeSql("DELETE FROM Podcast WHERE rowid=?", [episodeModel.pid]);
52 page.title = i18n.tr("Podcasts");68 page.title = i18n.tr("Podcasts");
53 view.model = podcastModel;69 view.model = podcastModel;
54 refreshModel();70 refreshModel();
55 }71 });
56 }72 }
57 }73 }
5874 ]
59 ToolbarButton {
60 action: Action {
61 text: i18n.tr("Unsubscribe")
62 iconName: "delete"
63 visible: view.model === episodeModel
64 onTriggered: {
65 var db = Podcasts.init();
66 db.transaction(function (tx) {
67 var rs = tx.executeSql("SELECT downloadedfile FROM Episode WHERE downloadedfile NOT NULL AND podcast=?", [episodeModel.pid]);
68 for(var i = 0; i < rs.rows.length; i++) {
69 fileManager.deleteFile(rs.rows.item(i).downloadedfile);
70 }
71 tx.executeSql("DELETE FROM Episode WHERE podcast=?", [episodeModel.pid]);
72 tx.executeSql("DELETE FROM Podcast WHERE rowid=?", [episodeModel.pid]);
73 page.title = i18n.tr("Podcasts");
74 view.model = podcastModel;
75 refreshModel();
76 });
77 }
78 }
79 }
80 }
8175
82 onVisibleChanged: {76 onVisibleChanged: {
83 if(visible) {77 if(visible) {
@@ -117,16 +111,16 @@
117 }111 }
118112
119 Component {113 Component {
120 id: subscribeFailedDialog114 id: subscribeFailedDialog
121 Dialog {115 Dialog {
122 id: dialogInternal116 id: dialogInternal
123 title: i18n.tr("Unable to subscribe")117 title: i18n.tr("Unable to subscribe")
124 text: i18n.tr("Please check the URL and try again")118 text: i18n.tr("Please check the URL and try again")
125 Button {119 Button {
126 text: i18n.tr("Close")120 text: i18n.tr("Close")
127 onClicked: PopupUtils.close(dialogInternal)121 onClicked: PopupUtils.close(dialogInternal)
128 }122 }
129 }123 }
130 }124 }
131125
132 Label {126 Label {
@@ -578,13 +572,13 @@
578 var ers = tx2.executeSql("SELECT rowid FROM Episode WHERE guid=?", [track.guid]);572 var ers = tx2.executeSql("SELECT rowid FROM Episode WHERE guid=?", [track.guid]);
579 if (ers.rows.length === 0) {573 if (ers.rows.length === 0) {
580 tx2.executeSql("INSERT INTO Episode(podcast, name, description, audiourl, guid, listened, duration, published) VALUES(?, ?, ? , ?, ?, ?, ?, ?)", [pid,574 tx2.executeSql("INSERT INTO Episode(podcast, name, description, audiourl, guid, listened, duration, published) VALUES(?, ?, ? , ?, ?, ?, ?, ?)", [pid,
581 track.name,575 track.name,
582 track.description,576 track.description,
583 track.audiourl,577 track.audiourl,
584 track.guid,578 track.guid,
585 false,579 false,
586 track.duration,580 track.duration,
587 track.published]);581 track.published]);
588 }582 }
589 });583 });
590 }584 }
591585
=== modified file 'po/com.mikeasoft.podbird.pot'
--- po/com.mikeasoft.podbird.pot 2015-01-10 10:10:43 +0000
+++ po/com.mikeasoft.podbird.pot 2015-01-24 17:28:18 +0000
@@ -8,7 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11"POT-Creation-Date: 2015-01-10 10:09+0000\n"11"POT-Creation-Date: 2015-01-24 18:24+0100\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -17,54 +17,54 @@
17"Content-Type: text/plain; charset=CHARSET\n"17"Content-Type: text/plain; charset=CHARSET\n"
18"Content-Transfer-Encoding: 8bit\n"18"Content-Transfer-Encoding: 8bit\n"
1919
20#: ../app/ui/PodcastsTab.qml:29 ../app/ui/PodcastsTab.qml:5220#: ../app/ui/PodcastsTab.qml:29 ../app/ui/PodcastsTab.qml:49
21#: ../app/ui/PodcastsTab.qml:7321#: ../app/ui/PodcastsTab.qml:68
22msgid "Podcasts"22msgid "Podcasts"
23msgstr ""23msgstr ""
2424
25#: ../app/ui/PodcastsTab.qml:3725#: ../app/ui/PodcastsTab.qml:36
26msgid "Add Podcast"26msgid "Add Podcast"
27msgstr ""27msgstr ""
2828
29#: ../app/ui/PodcastsTab.qml:4829#: ../app/ui/PodcastsTab.qml:45
30msgid "Up"30msgid "Up"
31msgstr ""31msgstr ""
3232
33#: ../app/ui/PodcastsTab.qml:6133#: ../app/ui/PodcastsTab.qml:56
34msgid "Unsubscribe"34msgid "Unsubscribe"
35msgstr ""35msgstr ""
3636
37#: ../app/ui/PodcastsTab.qml:12337#: ../app/ui/PodcastsTab.qml:117
38msgid "Unable to subscribe"38msgid "Unable to subscribe"
39msgstr ""39msgstr ""
4040
41#: ../app/ui/PodcastsTab.qml:12441#: ../app/ui/PodcastsTab.qml:118
42msgid "Please check the URL and try again"42msgid "Please check the URL and try again"
43msgstr ""43msgstr ""
4444
45#: ../app/ui/PodcastsTab.qml:12645#: ../app/ui/PodcastsTab.qml:120
46msgid "Close"46msgid "Close"
47msgstr ""47msgstr ""
4848
49#: ../app/ui/PodcastsTab.qml:13649#: ../app/ui/PodcastsTab.qml:130
50msgid "No Podcast Subscriptions"50msgid "No Podcast Subscriptions"
51msgstr ""51msgstr ""
5252
53#: ../app/ui/PodcastsTab.qml:13653#: ../app/ui/PodcastsTab.qml:130
54msgid ""54msgid ""
55"You haven't subscribed to any podcasts yet, visit the 'Search' page to add "55"You haven't subscribed to any podcasts yet, visit the 'Search' page to add "
56"some."56"some."
57msgstr ""57msgstr ""
5858
59#: ../app/ui/PodcastsTab.qml:39359#: ../app/ui/PodcastsTab.qml:387
60msgid "Feed URL..."60msgid "Feed URL..."
61msgstr ""61msgstr ""
6262
63#: ../app/ui/PodcastsTab.qml:40763#: ../app/ui/PodcastsTab.qml:401
64msgid "Cancel"64msgid "Cancel"
65msgstr ""65msgstr ""
6666
67#: ../app/ui/PodcastsTab.qml:41767#: ../app/ui/PodcastsTab.qml:411
68msgid "Add"68msgid "Add"
69msgstr ""69msgstr ""
7070
@@ -80,6 +80,6 @@
80msgid "Subscribe"80msgid "Subscribe"
81msgstr ""81msgstr ""
8282
83#: /home/mike/src/build-podbird-Ubuntu_Device2_GCC_armhf_ubuntu_sdk_14_10_utopic-Default/po/Podbird.desktop.in.h:183#: /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
84msgid "Podbird"84msgid "Podbird"
85msgstr ""85msgstr ""

Subscribers

People subscribed via source and target branches