Merge lp:~vthompson/music-app/new-playlist-header into lp:music-app/trusty

Proposed by Victor Thompson
Status: Merged
Approved by: Victor Thompson
Approved revision: 512
Merged at revision: 512
Proposed branch: lp:~vthompson/music-app/new-playlist-header
Merge into: lp:music-app/trusty
Diff against target: 124 lines (+34/-24)
5 files modified
MusicPlaylists.qml (+14/-0)
MusicaddtoPlaylist.qml (+14/-17)
common/MusicPage.qml (+0/-1)
tests/autopilot/music_app/emulators.py (+4/-3)
tests/autopilot/music_app/tests/test_music.py (+2/-3)
To merge this branch: bzr merge lp:~vthompson/music-app/new-playlist-header
Reviewer Review Type Date Requested Status
Andrew Hayzen Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+225308@code.launchpad.net

Commit message

* New playlist from header

Description of the change

This change places an action in the header to create a new playlist and removes the old button. It also introduces this action the the Playlists tab.

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)
512. By Victor Thompson

Fix test

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 :

Sweet! Looks good to me :)

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'MusicPlaylists.qml'
2--- MusicPlaylists.qml 2014-06-24 19:35:57 +0000
3+++ MusicPlaylists.qml 2014-07-02 23:10:52 +0000
4@@ -44,6 +44,20 @@
5 property string oldPlaylistID: ""
6 property string inPlaylist: ""
7
8+ tools: ToolbarItems {
9+ ToolbarButton {
10+ action: Action {
11+ objectName: "newplaylistButton"
12+ text: i18n.tr("New playlist")
13+ iconSource: "images/add.svg"
14+ onTriggered: {
15+ customdebug("New playlist.")
16+ PopupUtils.open(newPlaylistDialog, mainView)
17+ }
18+ }
19+ }
20+ }
21+
22 // Edit name of playlist dialog
23 Component {
24 id: editPlaylistDialog
25
26=== modified file 'MusicaddtoPlaylist.qml'
27--- MusicaddtoPlaylist.qml 2014-06-24 19:35:57 +0000
28+++ MusicaddtoPlaylist.qml 2014-07-02 23:10:52 +0000
29@@ -40,6 +40,20 @@
30 title: i18n.tr("Select playlist")
31 visible: false
32
33+ tools: ToolbarItems {
34+ ToolbarButton {
35+ action: Action {
36+ objectName: "newplaylistButton"
37+ text: i18n.tr("New playlist")
38+ iconSource: "images/add.svg"
39+ onTriggered: {
40+ customdebug("New playlist.")
41+ PopupUtils.open(newPlaylistDialog, mainView)
42+ }
43+ }
44+ }
45+ }
46+
47 Component.onCompleted: {
48 // check the four latest track in each playlist
49 // get the cover art of them
50@@ -118,21 +132,4 @@
51 }
52 }
53 }
54-
55- Button {
56- id: newPlaylistItem
57- anchors {
58- bottom: parent.bottom
59- bottomMargin: wideAspect ? musicToolbar.fullHeight : musicToolbar.mouseAreaOffset + musicToolbar.minimizedHeight
60- }
61- objectName: "newplaylistButton"
62- text: i18n.tr("New playlist")
63- iconSource: "images/add.svg"
64- iconPosition: "left"
65- width: parent.width
66- onClicked: {
67- customdebug("New playlist.")
68- PopupUtils.open(newPlaylistDialog, mainView)
69- }
70- }
71 }
72
73=== modified file 'common/MusicPage.qml'
74--- common/MusicPage.qml 2014-06-25 19:43:32 +0000
75+++ common/MusicPage.qml 2014-07-02 23:10:52 +0000
76@@ -23,7 +23,6 @@
77 // generic page for music, could be useful for bottomedge implementation
78 Page {
79 id: thisPage
80- tools: null
81
82 onVisibleChanged: {
83 if (visible) {
84
85=== modified file 'tests/autopilot/music_app/emulators.py'
86--- tests/autopilot/music_app/emulators.py 2014-06-26 17:48:54 +0000
87+++ tests/autopilot/music_app/emulators.py 2014-07-02 23:10:52 +0000
88@@ -78,6 +78,10 @@
89 queueTrackLabel = self.get_songs_page_queuetrack_label()
90 self.pointing_device.click_object(queueTrackLabel)
91
92+ def tap_new_playlist_action(self):
93+ header = self.get_header()
94+ header.click_action_button('newplaylistButton')
95+
96 def get_player(self):
97 return self.select_single("*", objectName="player")
98
99@@ -248,9 +252,6 @@
100 if item.visible:
101 return item
102
103- def get_newplaylistButton(self):
104- return self.select_many_retry("Button", objectName="newplaylistButton")
105-
106 def get_newPlaylistDialog_createButton(self):
107 return self.wait_select_single(
108 "Button", objectName="newPlaylistDialog_createButton")
109
110=== modified file 'tests/autopilot/music_app/tests/test_music.py'
111--- tests/autopilot/music_app/tests/test_music.py 2014-06-26 17:48:54 +0000
112+++ tests/autopilot/music_app/tests/test_music.py 2014-07-02 23:10:52 +0000
113@@ -457,9 +457,8 @@
114 # get initial list view playlist count
115 playlist_count = self.main_view.get_addtoplaylistview()[0].count
116
117- # click on New playlist button
118- newplaylistButton = self.main_view.get_newplaylistButton()[0]
119- self.pointing_device.click_object(newplaylistButton)
120+ # click on New playlist button in header
121+ self.main_view.tap_new_playlist_action()
122
123 # input playlist name
124 playlistNameFld = self.main_view.get_newPlaylistDialog_name_textfield()

Subscribers

People subscribed via source and target branches

to status/vote changes: