Merge lp:~danielholm/music-app/settings-sheet into lp:music-app/trusty

Proposed by Daniel Holm
Status: Merged
Approved by: Daniel Holm
Approved revision: 108
Merged at revision: 105
Proposed branch: lp:~danielholm/music-app/settings-sheet
Merge into: lp:music-app/trusty
Diff against target: 827 lines (+335/-309)
9 files modified
LoginLastFM.qml (+40/-88)
MusicAlbums.qml (+4/-0)
MusicArtists.qml (+4/-0)
MusicPlaylists.qml (+5/-1)
MusicSettings.qml (+170/-120)
MusicStart.qml (+100/-93)
MusicTracks.qml (+5/-1)
Style.qml (+4/-0)
music-app.qml (+3/-6)
To merge this branch: bzr merge lp:~danielholm/music-app/settings-sheet
Reviewer Review Type Date Requested Status
Victor Thompson Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+185665@code.launchpad.net

Commit message

New settings and now use Sheets instead.

Description of the change

Based on UX spec, move settings to a Sheet and add some new stuff. Most of the new stuff is disabled for the moment, since they won't fit inside the sheet.

Shuffle should be moved to the new toolbar, and I'm awainting answer on a bug report regarding the Sheet's size, which can not fill parent right now.
https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1224428

Andrew, can you help me with the setting regarding the "Snap to current song"? I've saved it in the settings DB and need to use it.

Also we need to change the color of the sheet later, but since there should be a new Sheet that we should use in the future, I thought we could wait untill then.

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: Approve (continuous-integration)
Revision history for this message
Victor Thompson (vthompson) wrote :

I think there are currently some readability issues (white text on grey background). Could you also make the sheet full sized like the spec?

Revision history for this message
Daniel Holm (danielholm) wrote :

I was going to look up how to change the color, since I dont know how. Regarding the full size, see the bug report above. Resize is not yet possible.

Revision history for this message
Victor Thompson (vthompson) wrote :

Daniel,

You should be able to do the following to get full sized Sheets. Please cancel the bug.

victor@bigdaddy:~/Development/settings-sheet$ bzr diff
=== modified file 'MusicSettings.qml'
--- MusicSettings.qml 2013-09-15 09:33:20 +0000
+++ MusicSettings.qml 2013-09-15 15:54:13 +0000
@@ -27,6 +27,8 @@
 ComposerSheet {
     id: musicSettings
     title: i18n.tr("Settings")
+ contentsHeight: parent.height
+ contentsWidth: parent.width

     onCancelClicked: PopupUtils.close(musicSettings)
     onConfirmClicked: {

Revision history for this message
Victor Thompson (vthompson) wrote :

I think the implementation of "snap to song" can wait for another branch--it might be tricky. BUT, if it's possible I would like you to change the colors such that they are readable.

106. By Daniel Holm

Changed text color in settings.

107. By Daniel Holm

Merge with trunk.

Revision history for this message
Victor Thompson (vthompson) wrote :

Actually, Daniel I think the font issue is an SDK bug. Filemanager filed a bug that was fixed for Popovers that used white text because of the darker Suru colors. It might be best to file a bug similar to the Popover bug: Bug #1205094.

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
Daniel Holm (danielholm) wrote :

The text color is now changed to coolGrey. The bug I was talking about is that Sheets cant fill the window.

Revision history for this message
Victor Thompson (vthompson) wrote :

Did you see my other comment? The Sheet not filling the parent is not a bug, use contentsHeight and contentsWidth. The Sheet not using the proper text color IS an SDK bug. We *should* be diligent and file said bug.

Revision history for this message
Daniel Holm (danielholm) wrote :

What?! ahah, it works! Thanks, mate. That really drove me crazy. So that bug is wrong..

Sure, that bug should probalby be filed.

108. By Daniel Holm

Sheet now fills parent.

Revision history for this message
Daniel Holm (danielholm) wrote :

Now fills window. I'll report that bug. But I don't think we should wait until a fix is released.

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
Victor Thompson (vthompson) wrote :

Ok, feel free to top approve when you think this is ready. You might want to 1) work around the font colors for the remaining items on the sheet and 2) document the SDK bug you file in the code that works around the bug.

review: Approve
Revision history for this message
Daniel Holm (danielholm) wrote :

Lovely, thanks.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'LoginLastFM.qml'
--- LoginLastFM.qml 2013-07-28 22:18:52 +0000
+++ LoginLastFM.qml 2013-09-15 20:50:07 +0000
@@ -29,15 +29,22 @@
29import "scrobble.js" as Scrobble29import "scrobble.js" as Scrobble
3030
31// LastFM login dialog31// LastFM login dialog
32Dialog {32DefaultSheet {
33 id: lastfmroot33 id: lastfmroot
34 anchors.fill: parent34 anchors.fill: parent
3535
36 onDoneClicked: PopupUtils.close(lastfmroot)
37
36 // Dialog data38 // Dialog data
37 title: i18n.tr("LastFM")39 title: i18n.tr("LastFM")
38 text: i18n.tr("Login to be able to scrobble.")40
3941 Column {
40 Row {42 spacing: units.gu(2)
43
44 Label {
45 text: i18n.tr("Login to be able to scrobble.")
46 }
47
41 // Username field48 // Username field
42 TextField {49 TextField {
43 id: usernameField50 id: usernameField
@@ -45,11 +52,9 @@
45 hasClearButton: true52 hasClearButton: true
46 placeholderText: i18n.tr("Username")53 placeholderText: i18n.tr("Username")
47 text: lastfmusername54 text: lastfmusername
48 width: units.gu(30)55 width: units.gu(48)
49 }56 }
50 }
5157
52 Row {
53 // add password field58 // add password field
54 TextField {59 TextField {
55 id: passField60 id: passField
@@ -58,81 +63,32 @@
58 placeholderText: i18n.tr("Password")63 placeholderText: i18n.tr("Password")
59 text: lastfmpassword64 text: lastfmpassword
60 echoMode: TextInput.Password65 echoMode: TextInput.Password
61 width: units.gu(30)66 width: units.gu(48)
62 }67 }
63 }
6468
65 Row {
66 // indicate progress of login69 // indicate progress of login
67 ActivityIndicator {70 ActivityIndicator {
68 id: activity71 id: activity
72 visible: false
69 }73 }
7074
71 // item to present login result75 // item to present login result
72 ListItem.Standard {76 ListItem.Standard {
73 id: loginstatetext77 id: loginstatetext
74 }78 visible: false
7579 }
76 // Model to send the data80
77 XmlListModel {81 // Login button
78 id: lastfmlogin
79 query: "/"
80
81 function rpcRequest(request,handler) {
82 console.debug("Debug: Starting to send user credentials")
83 var http = new XMLHttpRequest()
84
85 http.open("POST",Scrobble.scrobble_url,true)
86 http.setRequestHeader("User-Agent", "Music-App/"+appVersion)
87 http.setRequestHeader("Content-type", "text/xml")
88 http.setRequestHeader("Content-length", request.length)
89 http.setRequestHeader("Connection", "close")
90 http.onreadystatechange = function() {
91 if(http.readyState == 4 && http.status == 200) {
92 console.debug("Debug: XmlRpc::rpcRequest.onreadystatechange()")
93 handler(http.responseText)
94 }
95 }
96 http.send(request)
97 }
98
99 function callHandler(response) {
100 xml = response
101 }
102
103 function call(cmd,params) {
104 console.debug("Debug: XmlRpc.call(",cmd,params,")")
105 var request = ""
106 request += "<?xml version='1.0'?>"
107 request += "<methodCall>"
108 request += "<methodName>" + cmd + "</methodName>"
109 request += "<params>"
110 for (var i=0; i<params.length; i++) {
111 request += "<param><value>"
112 if (typeof(params[i])=="string") {
113 request += "<string>" + params[i] + "</string>"
114 }
115 if (typeof(params[i])=="number") {
116 request += "<int>" + params[i] + "</int>"
117 }
118 request += "</value></param>"
119 }
120 request += "</params>"
121 request += "</methodCall>"
122 rpcRequest(request,callHandler)
123 }
124 }
125 }
126
127 // Login button
128 Row {
129 Button {82 Button {
130 id: loginButton83 id: loginButton
131 width: units.gu(30)84 width: units.gu(48)
132 text: "Login"85 text: i18n.tr("Login")
133 color: "#c94212"86 enabled: false
87
134 onClicked: {88 onClicked: {
89 activity.visible = true
135 activity.running = !activity.running // change the activity indicator state90 activity.running = !activity.running // change the activity indicator state
91 loginstatetext.visible = true
136 loginstatetext.text = i18n.tr("Trying to login...")92 loginstatetext.text = i18n.tr("Trying to login...")
137 Settings.initialize()93 Settings.initialize()
138 console.debug("Debug: Login to LastFM clicked.")94 console.debug("Debug: Login to LastFM clicked.")
@@ -140,12 +96,23 @@
140 Settings.setSetting("lastfmusername", usernameField.text) // save lastfm username96 Settings.setSetting("lastfmusername", usernameField.text) // save lastfm username
141 Settings.setSetting("lastfmpassword", passField.text) // save lastfm password (should be passed by ha hash function)97 Settings.setSetting("lastfmpassword", passField.text) // save lastfm password (should be passed by ha hash function)
142 lastfmusername = Settings.getSetting("lastfmusername") // get username again98 lastfmusername = Settings.getSetting("lastfmusername") // get username again
143 lastfmpassword = Settings.getSetting("lastfmpassword") // get password again99 lastfmpassword = Settings.getSetting("lastfmpassword") // get password again, for use during the rest of the session
144 if (usernameField.text.length > 0 && passField.text.length > 0) { // make sure something is acually inputed100 if (usernameField.text.length > 0 && passField.text.length > 0) { // make sure something is acually inputed
145 console.debug("Debug: Sending credentials to authentication function")101 console.debug("Debug: Sending credentials to authentication function");
146 var signature = Scrobble.authenticate(usernameField.text, passField.text); // pass the data to authenticate102 var answer = Scrobble.authenticate(usernameField.text, passField.text) // pass credentials to login function
147 //lastfmlogin.model103
148 //lastfmlogin.construct()104 // Print result to user
105 if (answer == "ok") {
106 loginstatetext.text = i18n.tr("Login Successful")
107 activity.running = !activity.running // change the activity indicator state
108 //loginButton.text = "Log out" // later
109 Settings.setSetting("lastfmsessionkey",Scrobble.session_key)
110 }
111 else {
112 loginstatetext.text = i18n.tr("Login Failed")
113 activity.running = !activity.running // change the activity indicator state
114 }
115
149 }116 }
150 else {117 else {
151 loginstatetext.text = i18n.tr("You forgot to set your username and/or password")118 loginstatetext.text = i18n.tr("You forgot to set your username and/or password")
@@ -153,19 +120,4 @@
153 }120 }
154 }121 }
155 }122 }
156
157 // cancel Button
158 Row {
159 Button {
160 id: cancelButton
161 width: units.gu(30)
162 text: i18n.tr("Close")
163 onClicked: {
164 PopupUtils.close(lastfmroot)
165 }
166 }
167 }
168}123}
169
170
171
172124
=== modified file 'MusicAlbums.qml'
--- MusicAlbums.qml 2013-09-01 17:50:24 +0000
+++ MusicAlbums.qml 2013-09-15 20:50:07 +0000
@@ -31,6 +31,10 @@
31 id: pageStack31 id: pageStack
32 anchors.fill: parent32 anchors.fill: parent
3333
34 MusicSettings {
35 id: musicSettings
36 }
37
34 Page {38 Page {
35 id: mainpage39 id: mainpage
36 title: i18n.tr("Albums")40 title: i18n.tr("Albums")
3741
=== modified file 'MusicArtists.qml'
--- MusicArtists.qml 2013-09-01 17:50:24 +0000
+++ MusicArtists.qml 2013-09-15 20:50:07 +0000
@@ -31,6 +31,10 @@
31 id: pageStack31 id: pageStack
32 anchors.fill: parent32 anchors.fill: parent
3333
34 MusicSettings {
35 id: musicSettings
36 }
37
34 Page {38 Page {
35 id: mainpage39 id: mainpage
36 title: i18n.tr("Artists")40 title: i18n.tr("Artists")
3741
=== modified file 'MusicPlaylists.qml'
--- MusicPlaylists.qml 2013-09-02 21:39:46 +0000
+++ MusicPlaylists.qml 2013-09-15 20:50:07 +0000
@@ -165,6 +165,10 @@
165 playlist.forEach(addtoPlaylistModel) // send each item on playlist array to the model to show it165 playlist.forEach(addtoPlaylistModel) // send each item on playlist array to the model to show it
166 }166 }
167167
168 MusicSettings {
169 id: musicSettings
170 }
171
168 // page for the playlists172 // page for the playlists
169 Page {173 Page {
170 id: listspage174 id: listspage
@@ -247,7 +251,7 @@
247 text: i18n.tr("Settings")251 text: i18n.tr("Settings")
248252
249 onTriggered: {253 onTriggered: {
250 console.debug('Debug: Show settings')254 console.debug('Debug: Show settings from Playlists')
251 PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,255 PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,
252 {256 {
253 title: i18n.tr("Settings")257 title: i18n.tr("Settings")
254258
=== modified file 'MusicSettings.qml'
--- MusicSettings.qml 2013-07-28 22:18:52 +0000
+++ MusicSettings.qml 2013-09-15 20:50:07 +0000
@@ -1,6 +1,7 @@
1/*1/*
2 * Copyright (C) 2013 Victor Thompson <victor.thompson@gmail.com>2 * Copyright (C) 2013 Andrew Hayzen <ahayzen@gmail.com>
3 * Daniel Holm <d.holmen@gmail.com>3 * Daniel Holm <d.holmen@gmail.com>
4 * Victor Thompson <victor.thompson@gmail.com>
4 *5 *
5 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by7 * it under the terms of the GNU General Public License as published by
@@ -22,133 +23,182 @@
22import QtQuick.LocalStorage 2.023import QtQuick.LocalStorage 2.0
23import "settings.js" as Settings24import "settings.js" as Settings
24import "scrobble.js" as Scrobble25import "scrobble.js" as Scrobble
25import "playlists.js" as Playlists26
26import "meta-database.js" as Library27ComposerSheet {
2728 id: musicSettings
28Dialog {29 title: i18n.tr("Settings")
29 id: root30 contentsHeight: parent.height;
3031
31// Row {32 onCancelClicked: PopupUtils.close(musicSettings)
32// spacing: units.gu(2)33 onConfirmClicked: {
33// Button {34 PopupUtils.close(musicSettings)
34// id: selectdirectory35 console.debug("Debug: Save settings")
35// text: i18n.tr("Select Music folder")36 Settings.initialize()
36// width: units.gu(30)37
37// color: "#c94212"38 // Equaliser
38// onClicked: {39 // ACTIVATE IN 1.+ Settings.setSetting("eqialiser",equaliser.index)
39// folderScannerModel.nameFilters = [""]40
40// console.debug('Debug: Show settings')41 // snap track
41// pageStack.push(Qt.resolvedUrl("LibraryLoader.qml"))42 Settings.setSetting("snaptrack",snapSwitch.checked)
42// PopupUtils.close(root)43
43// }44 // ACCOUNTS
44// }45 // Last.fm
45// }46
4647 // MUSIC STREAMING
47 // Shuffle or not48 // Ubuntu one
48 Row {49 /* READY THIS LATER IN 1.+
49 spacing: units.gu(2)50 if (ubuntuaccount === activated) {
50 Label {51 Settings.setSetting("wifiswitch",wifiSwitch.checked)
51 text: i18n.tr("Shuffle")52 }*/
52 width: units.gu(20)53
53 color: "white"54
54 }55 // MOVE TO TOOLBAR
55 Switch {56 Settings.setSetting("shuffle", shuffleSwitch.checked) // save shuffle state
56 id: shuffleSwitch57
57 checked: Settings.getSetting("shuffle") === "1"58 // -- random = shuffleSwitch.checked // set shuffle state variable
58 }59 //console.debug("Debug: Shuffle: "+ shuffleSwitch.checked)
59 }60
6061 // MOVE TO scrobble Settings.setSetting("scrobble", scrobbleSwitch.checked) // save shuffle state
61 // lastfm62 //scrobble = scrobbleSwitch.checked // set scrobble state variable
62 Row {63 //console.debug("Debug: Scrobble: "+ scrobbleSwitch.checked)
63 spacing: units.gu(2)64 }
64 Label {65
65 text: i18n.tr("Scrobble to Last.FM")66 Column {
66 width: units.gu(20)67 spacing: units.gu(2)
67 color: "white"68
68 }69 // Activate in 1.+
69 Switch {70 ListItem.ItemSelector {
70 id: scrobbleSwitch71 id: equaliser
71 checked: Settings.getSetting("scrobble") === "1"72 enabled: false
72 }73 text: i18n.tr("Equaliser")
73 }74 model: [i18n.tr("Accoustic"),
7475 i18n.tr("Classical"),
75 Row {76 i18n.tr("Electronic"),
76 spacing: units.gu(2)77 i18n.tr("Flat"),
77 Button {78 i18n.tr("Hip Hop"),
78 id: lastfmLogin79 i18n.tr("Jazz"),
79 text: i18n.tr("Login to last.fm")80 i18n.tr("Metal"),
80 width: units.gu(30)81 i18n.tr("Pop"),
81 color: "#c94212"82 i18n.tr("Rock"),
82 enabled: Settings.getSetting("scrobble") === "1" // only if scrobble is activated.83 i18n.tr("Custom")]
84 onDelegateClicked: {
85 customdebug("Value changed to "+index)
86 //equaliserChange(index)
87 }
88 }
89
90 // Snap to current track
91 Row {
92 spacing: units.gu(2)
93 Label {
94 text: i18n.tr("Snap to current song \nwhen opening toolbar")
95 color: styleMusic.musicSettings.labelColor
96 width: units.gu(35)
97 }
98 Switch {
99 id: snapSwitch
100 checked: Settings.getSetting("snaptrack") === "1"
101 }
102 }
103
104 // Shuffle or not
105 // MOVE THIS TO NEW TOOLBAR
106 Row {
107 spacing: units.gu(2)
108 Label {
109 text: i18n.tr("Shuffle")
110 color: styleMusic.musicSettings.labelColor
111 width: units.gu(35)
112 }
113 Switch {
114 id: shuffleSwitch
115 checked: Settings.getSetting("shuffle") === "1"
116 }
117 }
118
119 // Accounts
120 Label {
121 text: i18n.tr("Accounts")
122 color: styleMusic.musicSettings.labelColor
123 }
124
125 // lastfm
126 ListItem.Subtitled {
127 id: lasftfmProg
128 text: i18n.tr("Last.fm")
129 subText: i18n.tr("Login to scrobble and \nimport playlists")
130 progression: true
131 enabled: false
83 onClicked: {132 onClicked: {
84 PopupUtils.open(Qt.resolvedUrl("LoginLastFM.qml"), mainView,133 PopupUtils.open(Qt.resolvedUrl("LoginLastFM.qml"), mainView,
85 {134 {
86 title: i18n.tr("Last.fm")135 title: i18n.tr("Last.fm")
87 } )136 } )
88 }137 PopupUtils.close(musicSettings)
89 }138 }
90 }139 }
91140
92 // import playlists from lastfm141 // Music Streaming
93 Row {142 // Activate in 1.+
94 spacing: units.gu(2)143 Label {
144 text: i18n.tr("Music Streaming")
145 color: styleMusic.musicSettings.labelColor
146 }
147
148 Column {
149 ListItem.Subtitled {
150 id: musicStreamProg
151 text: i18n.tr("Ubuntu One")
152 subText: i18n.tr("Sign in to stream your cloud music")
153 enabled: false
154 progression: true
155 onClicked: {
156 customdebug("I'm Ron Burgendy...?")
157 }
158 }
159
160 Row {
161 spacing: units.gu(20)
162 Label {
163 text: i18n.tr("Stream only on Wi-Fi")
164 color: styleMusic.musicSettings.labelColor
165 enabled: false // check if account is connected
166 }
167 Switch {
168 id: wifiSwitch
169 checked: Settings.getSetting("wifiswitch") === "1"
170 enabled: false // check if account is connected
171 }
172 }
173 }
174
175 /* MOVE THIS STUFF
176 // import playlists from lastfm
177 Row {
178 spacing: units.gu(2)
179 Button {
180 id: lastfmPlaylists
181 text: i18n.tr("Import playlists from last.fm")
182 width: units.gu(30)
183 color: "#c94212"
184 enabled: Settings.getSetting("scrobble") === "1" // only if scrobble is activated.
185 onClicked: {
186 console.debug("Debug: import playlists from last.fm")
187 Scrobble.getPlaylists(Settings.getSetting("lastfmusername"))
188 }
189 }
190 } */
191
192 // developer button - KILLS YOUR CAT!
95 Button {193 Button {
96 id: lastfmPlaylists194 text: i18n.tr("Clean everything!")
97 text: i18n.tr("Import playlists from last.fm")195 color: "red"
98 width: units.gu(30)196 visible: false
99 color: "#c94212"
100 enabled: Settings.getSetting("scrobble") === "1" // only if scrobble is activated.
101 onClicked: {197 onClicked: {
102 console.debug("Debug: import playlists from last.fm")198 Settings.reset()
103 Scrobble.getPlaylists(Settings.getSetting("lastfmusername"))199 Library.reset()
200 Playlists.reset()
104 }201 }
105 }202 }
106 }203 }
107
108 // headphones
109 Row {
110 spacing: units.gu(2)
111 Label {
112 text: i18n.tr("Pause when when headphones are un-plugged.")
113 width: units.gu(20)
114 wrapMode: "WordWrap"
115 color: "white"
116 }
117 Switch {
118 checked: true
119 enabled: false
120 }
121 }
122
123 // developer button
124 /*Button {
125 text: i18n.tr("Clean everything!")
126 color: "red"
127 onClicked: {
128 Settings.reset()
129 Library.reset()
130 Playlists.reset()
131 }
132 }*/
133
134 Button {
135 text: i18n.tr("Close")
136 onClicked: {
137 PopupUtils.close(root)
138 console.debug("Debug: Close settings")
139 // push infront the tracks again
140 // set new music dir
141 Settings.initialize()
142 //Settings.setSetting("currentfolder", musicDirField.text) // save music dir
143 Settings.setSetting("shuffle", shuffleSwitch.checked) // save shuffle state
144 Settings.setSetting("scrobble", scrobbleSwitch.checked) // save shuffle state
145 random = shuffleSwitch.checked // set shuffle state variable
146 scrobble = scrobbleSwitch.checked // set scrobble state variable
147 // set function to set and load tracks in new map directly, whithout need of restart
148 // disable fpr now (testing) console.debug("Debug: Set new music dir to: "+musicDirField.text)
149 console.debug("Debug: Shuffle: "+ shuffleSwitch.checked)
150 console.debug("Debug: Scrobble: "+ scrobbleSwitch.checked)
151 }
152 }
153
154}204}
155205
=== modified file 'MusicStart.qml'
--- MusicStart.qml 2013-08-30 17:21:05 +0000
+++ MusicStart.qml 2013-09-15 20:50:07 +0000
@@ -28,97 +28,104 @@
28import "meta-database.js" as Library28import "meta-database.js" as Library
29import "playlists.js" as Playlists29import "playlists.js" as Playlists
3030
3131PageStack {
32Page {32 id: pageStack
33 id: mainpage33
3434 MusicSettings {
35 tools: ToolbarItems {35 id: musicSettings
36 // Settings dialog36 }
37 ToolbarButton {37
38 objectName: "settingsaction"38 Page {
39 iconSource: Qt.resolvedUrl("images/settings.png")39 id: mainpage
40 text: i18n.tr("Settings")40
4141 tools: ToolbarItems {
42 onTriggered: {42 // Settings dialog
43 console.debug('Debug: Show settings')43 ToolbarButton {
44 PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,44 objectName: "settingsaction"
45 {45 iconSource: Qt.resolvedUrl("images/settings.png")
46 title: i18n.tr("Settings")46 text: i18n.tr("Settings")
47 } )47
48 }48 onTriggered: {
49 }49 console.debug('Debug: Show settings from start page')
50 }50 PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,
5151 {
52 title: i18n.tr("Music")52 title: i18n.tr("Settings")
5353 } )
54 ListItem.Standard {54 }
55 id: recentlyPlayed55 }
56 text: "Recently Played"56 }
57 }57
5858 title: i18n.tr("Music")
59 ListView {59
60 id: recentlist60 ListItem.Standard {
61 width: parent.width61 id: recentlyPlayed
62 anchors.top: recentlyPlayed.bottom62 text: "Recently Played"
63 //anchors.bottom: genres.top63 }
64 spacing: units.gu(2)64
65 height: units.gu(13)65 ListView {
66 // TODO: Update when view counts are collected66 id: recentlist
67 model: albumModel.model67 width: parent.width
68 delegate: recentDelegate68 anchors.top: recentlyPlayed.bottom
69 orientation: ListView.Horizontal69 //anchors.bottom: genres.top
7070 spacing: units.gu(2)
71 Component {71 height: units.gu(13)
72 id: recentDelegate72 // TODO: Update when view counts are collected
73 Item {73 model: albumModel.model
74 id: recentItem74 delegate: recentDelegate
75 height: units.gu(13)75 orientation: ListView.Horizontal
76 width: units.gu(13)76
77 UbuntuShape {77 Component {
78 id: recentShape78 id: recentDelegate
79 height: recentItem.width79 Item {
80 width: recentItem.width80 id: recentItem
81 image: Image {81 height: units.gu(13)
82 id: icon82 width: units.gu(13)
83 fillMode: Image.Stretch83 UbuntuShape {
84 property string artist: model.artist84 id: recentShape
85 property string album: model.album85 height: recentItem.width
86 property string title: model.title86 width: recentItem.width
87 property string cover: model.cover87 image: Image {
88 property string length: model.length88 id: icon
89 property string file: model.file89 fillMode: Image.Stretch
90 property string year: model.year90 property string artist: model.artist
91 source: cover === "" ? Qt.resolvedUrl("images/cover_default.png") : "image://cover-art-full/"+file91 property string album: model.album
92 }92 property string title: model.title
93 }93 property string cover: model.cover
94 MouseArea {94 property string length: model.length
95 anchors.fill: parent95 property string file: model.file
96 onClicked: {96 property string year: model.year
97 recentAlbumTracksModel.filterAlbumTracks(album)97 source: cover === "" ? Qt.resolvedUrl("images/cover_default.png") : "image://cover-art-full/"+file
98 trackQueue.model.clear()98 }
99 addQueueFromModel(recentAlbumTracksModel)99 }
100 currentModel = recentAlbumTracksModel100 MouseArea {
101 currentQuery = recentAlbumTracksModel.query101 anchors.fill: parent
102 currentParam = recentAlbumTracksModel.param102 onClicked: {
103 var file = trackQueue.model.get(0).file103 recentAlbumTracksModel.filterAlbumTracks(album)
104 currentIndex = trackQueue.indexOf(file)104 trackQueue.model.clear()
105 queueChanged = true105 addQueueFromModel(recentAlbumTracksModel)
106 player.stop()106 currentModel = recentAlbumTracksModel
107 player.source = Qt.resolvedUrl(file)107 currentQuery = recentAlbumTracksModel.query
108 player.play()108 currentParam = recentAlbumTracksModel.param
109 nowPlaying.visible = true109 var file = trackQueue.model.get(0).file
110 }110 currentIndex = trackQueue.indexOf(file)
111 }111 queueChanged = true
112 }112 player.stop()
113 }113 player.source = Qt.resolvedUrl(file)
114 }114 player.play()
115115 nowPlaying.visible = true
116 ListItem.Standard {116 }
117 id: genres117 }
118 anchors.top: recentlist.bottom118 }
119 text: "Genres"119 }
120 }120 }
121121
122 // TODO: add music genres. frequency of play? most tracks?122 ListItem.Standard {
123123 id: genres
124 anchors.top: recentlist.bottom
125 text: "Genres"
126 }
127
128 // TODO: add music genres. frequency of play? most tracks?
129
130 }
124}131}
125132
=== modified file 'MusicTracks.qml'
--- MusicTracks.qml 2013-09-11 12:22:52 +0000
+++ MusicTracks.qml 2013-09-15 20:50:07 +0000
@@ -32,6 +32,10 @@
32 id: pageStack32 id: pageStack
33 anchors.fill: parent33 anchors.fill: parent
3434
35 MusicSettings {
36 id: musicSettings
37 }
38
35 Page {39 Page {
36 id: mainpage40 id: mainpage
3741
@@ -43,7 +47,7 @@
43 text: i18n.tr("Settings")47 text: i18n.tr("Settings")
4448
45 onTriggered: {49 onTriggered: {
46 console.debug('Debug: Show settings')50 console.debug('Debug: Show settings from tracks')
47 PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,51 PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,
48 {52 {
49 title: i18n.tr("Settings")53 title: i18n.tr("Settings")
5054
=== modified file 'Style.qml'
--- Style.qml 2013-09-02 22:53:45 +0000
+++ Style.qml 2013-09-15 20:50:07 +0000
@@ -73,4 +73,8 @@
73 property color progressForegroundColor: UbuntuColors.orange;73 property color progressForegroundColor: UbuntuColors.orange;
74 property color progressHandleColor: common.white;74 property color progressHandleColor: common.white;
75 }75 }
76
77 property QtObject musicSettings: QtObject {
78 property color labelColor: UbuntuColors.coolGrey;
79 }
76}80}
7781
=== modified file 'music-app.qml'
--- music-app.qml 2013-09-11 23:35:44 +0000
+++ music-app.qml 2013-09-15 20:50:07 +0000
@@ -1,6 +1,7 @@
1/*1/*
2 * Copyright (C) 2013 Victor Thompson <victor.thompson@gmail.com>2 * Copyright (C) 2013 Andrew Hayzen <ahayzen@gmail.com>
3 * Daniel Holm <d.holmen@gmail.com>3 * Daniel Holm <d.holmen@gmail.com>
4 * Victor Thompson <victor.thompson@gmail.com>
4 *5 *
5 * This program is free software; you can redistribute it and/or modify6 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by7 * it under the terms of the GNU General Public License as published by
@@ -74,10 +75,7 @@
74 keywords: i18n.tr("Music Settings")75 keywords: i18n.tr("Music Settings")
75 onTriggered: {76 onTriggered: {
76 customdebug('Show settings')77 customdebug('Show settings')
77 PopupUtils.open(Qt.resolvedUrl("MusicSettings.qml"), mainView,78 musicSettings.visible = true
78 {
79 title: i18n.tr("Settings")
80 } )
81 }79 }
82 }80 }
83 Action {81 Action {
@@ -1026,7 +1024,6 @@
1026 MusicaddtoPlaylist {1024 MusicaddtoPlaylist {
1027 id: addtoPlaylist1025 id: addtoPlaylist
1028 }1026 }
1029
1030 // Converts an duration in ms to a formated string ("minutes:seconds")1027 // Converts an duration in ms to a formated string ("minutes:seconds")
1031 function __durationToString(duration) {1028 function __durationToString(duration) {
1032 var minutes = Math.floor((duration/1000) / 60);1029 var minutes = Math.floor((duration/1000) / 60);

Subscribers

People subscribed via source and target branches

to status/vote changes: