Merge lp:~ajalkane/ubuntu-filemanager-app/fileOperationProgress into lp:ubuntu-filemanager-app

Proposed by Arto Jalkanen
Status: Merged
Approved by: Arto Jalkanen
Approved revision: 20
Merged at revision: 20
Proposed branch: lp:~ajalkane/ubuntu-filemanager-app/fileOperationProgress
Merge into: lp:ubuntu-filemanager-app
Diff against target: 88 lines (+60/-2)
3 files modified
FileOperationProgressDialog.qml (+46/-0)
FolderListPage.qml (+4/-2)
FolderListView.qml (+10/-0)
To merge this branch: bzr merge lp:~ajalkane/ubuntu-filemanager-app/fileOperationProgress
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Arto Jalkanen Approve
Review via email: mp+159200@code.launchpad.net

Commit message

File operation progress dialog. Errors put into main text body as Ubuntu components seem not able to handle long texts in title.

Description of the change

File operation progress dialog. Errors put into main text body as Ubuntu components seem not able to handle long texts in title.

To post a comment you must log in.
Revision history for this message
Arto Jalkanen (ajalkane) wrote :

It's good. I approve.

review: Approve
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file 'FileOperationProgressDialog.qml'
2--- FileOperationProgressDialog.qml 1970-01-01 00:00:00 +0000
3+++ FileOperationProgressDialog.qml 2013-04-16 17:00:36 +0000
4@@ -0,0 +1,46 @@
5+import QtQuick 2.0
6+import Ubuntu.Components 0.1
7+import Ubuntu.Components.Popups 0.1
8+import org.nemomobile.folderlistmodel 1.0
9+
10+Dialog {
11+ id: root
12+ property FolderListModel folderListModel
13+ property string descriptionPrepend: i18n.tr("Operation in progress")
14+
15+ title: "File operation"
16+ text: descriptionPrepend
17+
18+ ProgressBar {
19+ id: progress
20+ minimumValue: 0.0
21+ maximumValue: 100.0
22+ value: 0.0
23+ }
24+
25+ Button {
26+ text: i18n.tr("Cancel")
27+ onClicked: {
28+ console.log("Cancelling file progress action")
29+ folderListModel.cancelAction()
30+ PopupUtils.close(root)
31+ }
32+ }
33+
34+ Connections {
35+ target: folderListModel
36+ onProgress: {
37+ console.log("On progress ", curItem, totalItems, percent)
38+ progress.value = percent
39+ // TODO: is this a bug in backend? The first received signal is curItem=0, totalItems=0. Work around:
40+ if (!(curItem == 0 && totalItems == 0)) {
41+ if (curItem == totalItems) {
42+ console.log("All files processed, closing progress dialog")
43+ PopupUtils.close(root)
44+ } else {
45+ root.text = descriptionPrepend + " " + curItem + "/" + totalItems
46+ }
47+ }
48+ }
49+ }
50+}
51
52=== modified file 'FolderListPage.qml'
53--- FolderListPage.qml 2013-04-15 19:50:55 +0000
54+++ FolderListPage.qml 2013-04-16 17:00:36 +0000
55@@ -89,8 +89,10 @@
56 console.log("FolderListModel Error Title/Description", errorTitle, errorMessage)
57 PopupUtils.open(Qt.resolvedUrl("NotifyDialog.qml"), root,
58 {
59- title: i18n.tr(errorTitle),
60- text: i18n.tr(errorMessage)
61+ // Unfortunately title can not handle too long texts. TODO: bug report
62+ // title: i18n.tr(errorTitle),
63+ title: i18n.tr("File operation error"),
64+ text: errorTitle + ": " + errorMessage
65 })
66 }
67 }
68
69=== modified file 'FolderListView.qml'
70--- FolderListView.qml 2013-04-01 20:03:15 +0000
71+++ FolderListView.qml 2013-04-16 17:00:36 +0000
72@@ -21,6 +21,16 @@
73 onAccepted: {
74 console.log("Delete accepted for filePath, fileName", filePath, fileName)
75
76+ PopupUtils.open(Qt.resolvedUrl("FileOperationProgressDialog.qml"),
77+ root,
78+ {
79+ title: i18n.tr("Deleting files"),
80+ // descriptionPrepend: i18n.tr("Operation in progress"),
81+ folderListModel: folderListModel
82+ }
83+ )
84+
85+ console.log("Doing delete")
86 folderListModel.rm(filePath)
87 }
88 }

Subscribers

People subscribed via source and target branches