Merge lp:~ibelieve/ubuntu-filemanager-app/fixed-progress-dialog into lp:ubuntu-filemanager-app

Proposed by Michael Spencer
Status: Merged
Approved by: Nicholas Skaggs
Approved revision: 67
Merged at revision: 63
Proposed branch: lp:~ibelieve/ubuntu-filemanager-app/fixed-progress-dialog
Merge into: lp:ubuntu-filemanager-app
Diff against target: 473 lines (+113/-114)
6 files modified
FileOperationProgressDialog.qml (+24/-6)
FolderListPage.qml (+55/-95)
FolderListView.qml (+1/-9)
Makefile (+8/-0)
PlacesSidebar.qml (+1/-1)
ubuntu-filemanager-app.qml (+24/-3)
To merge this branch: bzr merge lp:~ibelieve/ubuntu-filemanager-app/fixed-progress-dialog
Reviewer Review Type Date Requested Status
Nicholas Skaggs (community) Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+186103@code.launchpad.net

Commit message

Fixed the progress dialog, blurry icons, header covering content, and made the the toolbar hidden by default

Description of the change

This makes the following changes:

 * Fixes the header from covering content
 * Hides the progress dialog unless it is needed
 * Fixes the blurry icons on the phone
 * Hides the toolbar in phone mode and shows it in wide mode

To post a comment you must log in.
66. By Michael Spencer

Added missing files

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

Removed unused targets from the Makefile

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
Nicholas Skaggs (nskaggs) :
review: Approve
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

I wasn't able to run this properly on my device due to unrelated autopilot issues. As such, the approval is only based upon review and proper running in the VM.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'FileOperationProgressDialog.qml'
2--- FileOperationProgressDialog.qml 2013-06-26 23:00:41 +0000
3+++ FileOperationProgressDialog.qml 2013-09-17 17:06:39 +0000
4@@ -22,12 +22,17 @@
5
6 Dialog {
7 id: root
8- property FolderListModel folderListModel
9+ property FolderListModel model
10+ property Page page
11 property string descriptionPrepend: i18n.tr("Operation in progress")
12
13 title: "File operation"
14 text: descriptionPrepend
15
16+ function startOperation(name) {
17+ root.title = name
18+ }
19+
20 ProgressBar {
21 id: progress
22 minimumValue: 0.0
23@@ -39,21 +44,34 @@
24 text: i18n.tr("Cancel")
25 onClicked: {
26 console.log("Cancelling file progress action")
27- folderListModel.cancelAction()
28+ model.cancelAction()
29 PopupUtils.close(root)
30 }
31 }
32
33 Connections {
34- target: folderListModel
35+ target: model
36 onProgress: {
37+ // curItem == 0 && percent == 0 means the Action has just been created, check getProgressCounter() before
38+ if (curItem == 0 && percent == 0) {
39+ console.log("Creating dialog:", model.getProgressCounter())
40+ if (model.getProgressCounter() > 20) {
41+ // show/activate/make visible the dialog here
42+ print("Showing dialog...")
43+ PopupUtils.open(root, page)
44+ root.show()
45+ }
46+ }
47+
48 console.log("On progress ", curItem, totalItems, percent)
49+
50 progress.value = percent
51- if (curItem == totalItems) {
52+ if (percent == 100 && curItem == totalItems) {
53 console.log("All files processed, closing progress dialog")
54- PopupUtils.close(root)
55+ //PopupUtils.close(root)
56+ root.hide()
57 } else {
58- root.text = descriptionPrepend + " " + curItem + "/" + totalItems
59+ root.text = descriptionPrepend + " (" + curItem + "/" + totalItems + ")"
60 }
61 }
62 }
63
64=== modified file 'FolderListPage.qml'
65--- FolderListPage.qml 2013-09-07 09:08:11 +0000
66+++ FolderListPage.qml 2013-09-17 17:06:39 +0000
67@@ -22,16 +22,16 @@
68 import org.nemomobile.folderlistmodel 1.0
69
70 Page {
71- id: root
72+ id: folderListPage
73
74 title: folderName(folder)
75
76- property variant fileView: root
77+ property variant fileView: folderListPage
78
79 property bool showHiddenFiles: false
80
81 onShowHiddenFilesChanged: {
82- pageModel.showHiddenFiles = root.showHiddenFiles
83+ pageModel.showHiddenFiles = folderListPage.showHiddenFiles
84 }
85
86 property string sortingMethod: "Name"
87@@ -69,7 +69,7 @@
88 property string path: folder.replace("~", pageModel.homePath())
89
90 function goHome() {
91- goTo(root.homeFolder)
92+ goTo(folderListPage.homeFolder)
93 }
94
95 function goTo(location) {
96@@ -80,7 +80,7 @@
97 location = location.substring(0, location.length - 1)
98 }
99
100- root.folder = location.replace(pageModel.homePath(), "~")
101+ folderListPage.folder = location.replace(pageModel.homePath(), "~")
102 refresh()
103 }
104
105@@ -130,7 +130,7 @@
106 function folderName(folder) {
107 folder = folder.replace(pageModel.homePath(), "~")
108
109- if (folder === root.homeFolder) {
110+ if (folder === folderListPage.homeFolder) {
111 return i18n.tr("Home")
112 } else if (folder === "/") {
113 return i18n.tr("File System")
114@@ -172,7 +172,7 @@
115 FolderListModel {
116 id: pageModel
117
118- path: root.path
119+ path: folderListPage.path
120
121 enableExternalFSWatcher: true
122
123@@ -191,7 +191,7 @@
124
125 FolderListModel {
126 id: repeaterModel
127- path: root.folder
128+ path: folderListPage.folder
129
130 onPathChanged: {
131 console.log("Path: " + repeaterModel.path)
132@@ -212,7 +212,7 @@
133 onTriggered: {
134 print(text)
135
136- PopupUtils.open(createFolderDialog, root)
137+ PopupUtils.open(createFolderDialog, folderListPage)
138 }
139 }
140
141@@ -234,15 +234,7 @@
142 : i18n.tr("Paste %1 Files").arg(pageModel.clipboardUrlsCounter)
143 onTriggered: {
144 console.log("Pasting to current folder items of count " + pageModel.clipboardUrlsCounter)
145- PopupUtils.open(Qt.resolvedUrl("FileOperationProgressDialog.qml"),
146- root,
147- {
148- title: i18n.tr("Paste files"),
149- folderListModel: pageModel
150- }
151- )
152-
153-
154+ fileOperationDialog.startOperation(i18n.tr("Paste files"))
155 pageModel.paste()
156 }
157
158@@ -270,7 +262,7 @@
159 onTriggered: {
160 print(text)
161 PopupUtils.open(Qt.resolvedUrl("FileDetailsPopover.qml"),
162- root,
163+ folderListPage,
164 { "model": pageModel
165 }
166 )
167@@ -336,13 +328,15 @@
168
169 tools: ToolbarItems {
170 id: toolbar
171- locked: true
172- opened: true
173+ locked: wideAspect
174+ opened: wideAspect
175+
176+ onLockedChanged: opened = Qt.binding(function() { return wideAspect })
177
178 back: ToolbarButton {
179 objectName: "up"
180 text: "Up"
181- iconSource: "icons/up.png"
182+ iconSource: getIcon("up")
183 visible: folder != "/"
184 onTriggered: {
185 goTo(pageModel.parentPath)
186@@ -353,7 +347,7 @@
187 id: actionsButton
188 objectName: "actions"
189 text: i18n.tr("Actions")
190- iconSource: "icons/edit.png"
191+ iconSource: getIcon("edit")
192
193 onTriggered: {
194 print(text)
195@@ -363,7 +357,7 @@
196
197 ToolbarButton {
198 text: i18n.tr("View")
199- iconSource: "icons/settings.png"
200+ iconSource: getIcon("settings")
201 id: optionsButton
202
203 onTriggered: {
204@@ -378,7 +372,7 @@
205 visible: wideAspect
206 objectName: "goTo"
207 text: i18n.tr("Go To")
208- iconSource: "icons/location.png"
209+ iconSource: getIcon("location")
210 onTriggered: {
211 print(text)
212
213@@ -391,7 +385,7 @@
214 visible: !wideAspect
215 objectName: "places"
216 text: i18n.tr("Places")
217- iconSource: "icons/location.png"
218+ iconSource: getIcon("location")
219 onTriggered: {
220 print(text)
221
222@@ -402,19 +396,41 @@
223
224 flickable: !wideAspect ? folderListView : null
225
226+ onFlickableChanged: {
227+ if (wideAspect) {
228+ folderListView.topMargin = 0
229+ } else {
230+ folderListView.topMargin = units.gu(9.5)
231+ }
232+ }
233+
234 PlacesSidebar {
235 id: sidebar
236 objectName: "placesSidebar"
237
238- anchors {
239- top: parent.top
240- bottom: parent.bottom
241- bottomMargin: units.gu(-2)
242- }
243+// anchors {
244+// top: parent.top
245+// bottom: parent.bottom
246+// bottomMargin: units.gu(-2)
247+// }
248
249 expanded: wideAspect
250 }
251
252+ FolderListView {
253+ id: folderListView
254+
255+ clip: true
256+
257+ folderListModel: pageModel
258+ anchors {
259+ top: parent.top
260+ bottom: parent.bottom
261+ left: sidebar.right
262+ right: parent.right
263+ }
264+ }
265+
266 Item {
267 id: contents
268
269@@ -423,22 +439,6 @@
270 bottom: parent.bottom
271 left: sidebar.right
272 right: parent.right
273-
274- // IMPROVE: this should work (?), but it doesn't. Height is undefined. Anyway in previous
275- // SDK version the parent size was properly initialized. Now the size of toolbar is not taken into
276- // account and apparently you can't even query toolbar's height.
277- // anchors.bottomMargin: toolbar.height
278- // Now in newer SDK (raring 19.07.2013) locked&opened toolbar is taken into
279- // account in some fashion, but the extra space left to the bottom without this
280- // bottomMargin definition seems to be exactly what is the height of Header's gray
281- // separator bar. This ugly workaround seems to give correct height for view at least on desktop.
282- // Bug report on this:
283- // https://bugs.launchpad.net/ubuntu-ui-toolkit/+bug/1202881
284- // This bug report also affects this, as if the toolbar is hidden by default
285- // then there is no problem:
286- // https://bugs.launchpad.net/ubuntu-filemanager-app/+bug/1198861
287- // Hard-code it for now. Not nice at all:
288- bottomMargin: units.gu(-2)
289 }
290
291 Column {
292@@ -454,61 +454,14 @@
293 height: units.gu(8)
294 }
295 }
296-
297- FolderListView {
298- id: folderListView
299-
300- clip: true
301-
302- folderListModel: pageModel
303- anchors.fill: parent
304- }
305 }
306
307- states: [
308- State {
309- name: "wide"
310- when: wideAspect
311- PropertyChanges {
312- target: tools
313- locked: true
314- opened: true
315- }
316-
317- PropertyChanges {
318- target: folderListView
319-
320- anchors.top: contents.top
321- //anchors.topMargin: units.gu(9.5)
322- topMargin: 0
323- }
324-
325- PropertyChanges {
326- target: contents
327- anchors.top: root.top
328- anchors.topMargin: 0
329- }
330- }
331-
332-// //FIXME: This should automatically be calculated - is there a way to remove it?
333-// State {
334-// name: ""
335-
336-// PropertyChanges {
337-// target: folderListView
338-
339-// topMargin: units.gu(9.5)
340-// }
341-// }
342-
343- ]
344-
345 // Errors from model
346 Connections {
347 target: pageModel
348 onError: {
349 console.log("FolderListModel Error Title/Description", errorTitle, errorMessage)
350- PopupUtils.open(Qt.resolvedUrl("NotifyDialog.qml"), root,
351+ PopupUtils.open(Qt.resolvedUrl("NotifyDialog.qml"), folderListPage,
352 {
353 // Unfortunately title can not handle too long texts. TODO: bug report
354 // title: i18n.tr(errorTitle),
355@@ -517,4 +470,11 @@
356 })
357 }
358 }
359+
360+ FileOperationProgressDialog {
361+ id: fileOperationDialog
362+
363+ page: folderListPage
364+ model: pageModel
365+ }
366 }
367
368=== modified file 'FolderListView.qml'
369--- FolderListView.qml 2013-08-06 22:07:40 +0000
370+++ FolderListView.qml 2013-09-17 17:06:39 +0000
371@@ -46,15 +46,7 @@
372 onAccepted: {
373 console.log("Delete accepted for filePath, fileName", filePath, fileName)
374
375- PopupUtils.open(Qt.resolvedUrl("FileOperationProgressDialog.qml"),
376- root,
377- {
378- title: i18n.tr("Deleting files"),
379- // descriptionPrepend: i18n.tr("Operation in progress"),
380- folderListModel: folderListModel
381- }
382- )
383-
384+ fileOperationDialog.startOperation("Deleting files")
385 console.log("Doing delete")
386 folderListModel.rm(filePath)
387 }
388
389=== added file 'Makefile'
390--- Makefile 1970-01-01 00:00:00 +0000
391+++ Makefile 2013-09-17 17:06:39 +0000
392@@ -0,0 +1,8 @@
393+all:
394+
395+run:
396+ /usr/bin/qmlscene $@ ubuntu-filemanager-app.qml
397+
398+icon:
399+ inkscape --export-png=icons/$(ICON).png --export-dpi=32 --export-background-opacity=0 --without-gui /usr/share/icons/ubuntu-mobile/actions/scalable/$(ICON).svg
400+
401
402=== modified file 'PlacesSidebar.qml'
403--- PlacesSidebar.qml 2013-08-30 16:12:41 +0000
404+++ PlacesSidebar.qml 2013-09-17 17:06:39 +0000
405@@ -23,7 +23,7 @@
406 Sidebar {
407 id: root
408
409- color: Qt.rgba(0.5,0.5,0.5,0.3)
410+ //color: Qt.rgba(0.5,0.5,0.5,0.3)
411 width: units.gu(30)
412
413 ListModel {
414
415=== modified file 'icons/edit.png'
416Binary files icons/edit.png 2013-07-03 13:31:12 +0000 and icons/edit.png 2013-09-17 17:06:39 +0000 differ
417=== modified file 'icons/location.png'
418Binary files icons/location.png 2013-07-03 13:31:12 +0000 and icons/location.png 2013-09-17 17:06:39 +0000 differ
419=== modified file 'icons/settings.png'
420Binary files icons/settings.png 2013-07-03 13:31:12 +0000 and icons/settings.png 2013-09-17 17:06:39 +0000 differ
421=== added file 'icons/up.png'
422Binary files icons/up.png 1970-01-01 00:00:00 +0000 and icons/up.png 2013-09-17 17:06:39 +0000 differ
423=== removed file 'icons/up.png'
424Binary files icons/up.png 2013-07-03 13:31:12 +0000 and icons/up.png 1970-01-01 00:00:00 +0000 differ
425=== modified file 'ubuntu-filemanager-app.qml'
426--- ubuntu-filemanager-app.qml 2013-08-30 16:05:42 +0000
427+++ ubuntu-filemanager-app.qml 2013-09-17 17:06:39 +0000
428@@ -40,9 +40,13 @@
429
430 property bool wideAspect: width >= units.gu(80)
431
432- headerColor: "#303030"
433- backgroundColor: "#505050"
434- footerColor: "#707070"
435+ headerColor: "#464646"
436+ backgroundColor: "#797979"
437+ footerColor: "#808080"
438+
439+// headerColor: "#303030"
440+// backgroundColor: "#505050"
441+// footerColor: "#707070"
442
443 property var pageStack: pageStack
444
445@@ -77,6 +81,19 @@
446 }
447 }
448
449+ property var showToolbar: wideAspect ? true : undefined
450+
451+ states: [
452+ State {
453+ when: showToolbar && toolbar.tools.opened && toolbar.tools.locked
454+
455+ PropertyChanges {
456+ target: pageStack
457+ anchors.bottomMargin: -root.toolbar.triggerSize
458+ }
459+ }
460+ ]
461+
462 /* Settings Storage */
463
464 U1db.Database {
465@@ -128,4 +145,8 @@
466 }
467
468 Component.onCompleted: reloadSettings()
469+
470+ function getIcon(name) {
471+ return Qt.resolvedUrl("icons/" + name + ".png")
472+ }
473 }

Subscribers

People subscribed via source and target branches