Merge lp:~vthompson/music-app/remix-retain-pagestack into lp:music-app/remix

Proposed by Victor Thompson
Status: Merged
Approved by: Andrew Hayzen
Approved revision: 731
Merged at revision: 729
Proposed branch: lp:~vthompson/music-app/remix-retain-pagestack
Merge into: lp:music-app/remix
Diff against target: 74 lines (+6/-21)
3 files modified
MusicNowPlaying.qml (+1/-12)
tests/autopilot/music_app/__init__.py (+0/-4)
tests/autopilot/music_app/tests/test_music.py (+5/-5)
To merge this branch: bzr merge lp:~vthompson/music-app/remix-retain-pagestack
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+241153@code.launchpad.net

Commit message

* Do not pop existing pages from page stack when returning from Now Playing/Queue

Description of the change

This small change will bring the user back to the last viewed page when returning from the Queue/Now Playing page. For instance, if the user is on the Album view (SongsPage) before entering the Now Playing page, they will return there when tapping the back button in the header.

To post a comment you must log in.
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Looks good so far, 1 inline comment.

review: Needs Fixing
729. By Victor Thompson

Remove custom backAction

730. By Victor Thompson

Remove go_back AP helper.

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
731. By Victor Thompson

Update failing test

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: Approve (continuous-integration)
Revision history for this message
Andrew Hayzen (ahayzen) wrote :

LGTM, thanks for fixing the AP tests :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'MusicNowPlaying.qml'
--- MusicNowPlaying.qml 2014-10-28 02:05:16 +0000
+++ MusicNowPlaying.qml 2014-11-07 23:08:40 +0000
@@ -75,17 +75,6 @@
75 id: defaultState75 id: defaultState
7676
77 name: "default"77 name: "default"
78 backAction: Action {
79 iconName: "back";
80 objectName: "backButton"
81 onTriggered: {
82 mainPageStack.pop();
83
84 while (mainPageStack.depth > 1) { // jump back to the tab layer if via SongsPage
85 mainPageStack.pop();
86 }
87 }
88 }
89 actions: [78 actions: [
90 Action {79 Action {
91 objectName: "toggleView"80 objectName: "toggleView"
@@ -123,7 +112,7 @@
123 text: i18n.tr("Clear queue")112 text: i18n.tr("Clear queue")
124 visible: isListView113 visible: isListView
125 onTriggered: {114 onTriggered: {
126 head.backAction.trigger()115 pageStack.pop()
127 trackQueue.clear()116 trackQueue.clear()
128 }117 }
129 }118 }
130119
=== modified file 'tests/autopilot/music_app/__init__.py'
--- tests/autopilot/music_app/__init__.py 2014-10-26 21:39:08 +0000
+++ tests/autopilot/music_app/__init__.py 2014-11-07 23:08:40 +0000
@@ -270,10 +270,6 @@
270 def click_toggle_view(self):270 def click_toggle_view(self):
271 self.main_view.get_header().click_action_button("toggleView")271 self.main_view.get_header().click_action_button("toggleView")
272272
273 def go_back(self):
274 """Use custom back button to go back"""
275 self.main_view.get_header().click_custom_back_button()
276
277 @ensure_now_playing_list273 @ensure_now_playing_list
278 def get_track(self, i):274 def get_track(self, i):
279 return (self.wait_select_single(ListItemWithActions,275 return (self.wait_select_single(ListItemWithActions,
280276
=== modified file 'tests/autopilot/music_app/tests/test_music.py'
--- tests/autopilot/music_app/tests/test_music.py 2014-10-31 14:10:26 +0000
+++ tests/autopilot/music_app/tests/test_music.py 2014-11-07 23:08:40 +0000
@@ -104,7 +104,7 @@
104 Equals(self.tracks[0]["title"]))104 Equals(self.tracks[0]["title"]))
105105
106 # click on close button to close the page and now playing page106 # click on close button to close the page and now playing page
107 now_playing_page.go_back()107 self.app.main_view.go_back()
108108
109 # click the play button (toolbar) to start playing109 # click the play button (toolbar) to start playing
110 toolbar.click_play_button()110 toolbar.click_play_button()
@@ -358,11 +358,11 @@
358 self.assertThat(current_track.get_label_text("titleLabel"),358 self.assertThat(current_track.get_label_text("titleLabel"),
359 Equals(tracks[0]["title"]))359 Equals(tracks[0]["title"]))
360360
361 # click on close button to close nowplaying and songs page361 # click on close button to close nowplaying page
362 now_playing_page.go_back()362 self.app.main_view.go_back()
363363
364 # check that the albums page is now visible364 # check that the songs page is now visible
365 self.assertThat(albums_page.visible, Eventually(Equals(True)))365 self.assertThat(songs_page.visible, Eventually(Equals(True)))
366366
367 def test_add_songs_to_queue_from_songs_tab_and_play(self):367 def test_add_songs_to_queue_from_songs_tab_and_play(self):
368 """tests navigating to the Songs tab and adding the library to the368 """tests navigating to the Songs tab and adding the library to the

Subscribers

People subscribed via source and target branches