Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/fix-1544149 into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Alan Pope 🍺🐧🐱 πŸ¦„
Approved revision: 299
Merged at revision: 300
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/fix-1544149
Merge into: lp:ubuntu-docviewer-app
Diff against target: 138 lines (+34/-21)
3 files modified
src/app/qml/common/ContentHubProxy.qml (+10/-9)
src/app/qml/documentPage/DocumentListView.qml (+1/-1)
src/app/qml/documentPage/DocumentPagePickModeHeader.qml (+23/-11)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/fix-1544149
Reviewer Review Type Date Requested Status
Alan Pope 🍺🐧🐱 πŸ¦„ (community) Approve
Jenkins Bot continuous-integration Approve
Review via email: mp+285641@code.launchpad.net

Commit message

Fixed ContentTransferHint being visible during an export

Description of the change

Fixed ContentTransferHint being visible during an export

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Tested this on OTA-9. It brings up the document selector, and I can select a document to transfer. However when I then press the tick in the header, nothing happens. I get a vibrate so it did notice I pressed the tick, but it never transfers the file. The document selector still works, I can select and unselect documents, but I can never transfer them.

review: Needs Fixing
298. By Stefano Verzegnassi

Fixed DocumentPagePickModeHeader:
* Use UCListItem 1.2+ APIs
* Use content-hub properly

299. By Stefano Verzegnassi

Restore the browse mode when the content transfer is completed or aborted

Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

Fixed!

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Alan Pope 🍺🐧🐱 πŸ¦„ (popey) wrote :

Yup! Fixed! Thank you!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'src/app/qml/common/ContentHubProxy.qml'
--- src/app/qml/common/ContentHubProxy.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/ContentHubProxy.qml 2016-02-12 13:03:03 +0000
@@ -23,11 +23,12 @@
23Item {23Item {
24 id: contentHubProxy24 id: contentHubProxy
2525
26 property var activeTransfer26 property var activeImportTransfer
27 property var activeExportTransfer
2728
28 // This property is used in ../documentPage/Document(Grid|List)View.qml29 // This property is used in ../documentPage/Document(Grid|List)View.qml
29 // so that we avoid to import Ubuntu.Content module outside this proxy.30 // so that we avoid to import Ubuntu.Content module outside this proxy.
30 property bool multipleSelectionType: !activeTransfer || activeTransfer.selectionType == ContentTransfer.Multiple31 property bool multipleSelectionType: !activeExportTransfer || activeExportTransfer.selectionType == ContentTransfer.Multiple
3132
32 property alias rejectedDocuments: rejectedDocsModel33 property alias rejectedDocuments: rejectedDocsModel
33 property alias importedDocuments: importedDocsModel34 property alias importedDocuments: importedDocsModel
@@ -36,22 +37,22 @@
36 ListModel { id: importedDocsModel }37 ListModel { id: importedDocsModel }
3738
38 ContentTransferHint {39 ContentTransferHint {
39 activeTransfer: contentHubProxy.activeTransfer40 activeTransfer: contentHubProxy.activeImportTransfer
40 }41 }
4142
42 Connections {43 Connections {
43 target: ContentHub44 target: ContentHub
4445
45 onImportRequested: {46 onImportRequested: {
46 activeTransfer = transfer47 activeImportTransfer = transfer
4748
48 if (activeTransfer.state === ContentTransfer.Charged) {49 if (activeImportTransfer.state === ContentTransfer.Charged) {
49 mainView.switchToBrowseMode()50 mainView.switchToBrowseMode()
5051
51 internal.clearModels()52 internal.clearModels()
5253
53 for (var i=0; i<activeTransfer.items.length; i++) {54 for (var i=0; i<activeImportTransfer.items.length; i++) {
54 var sourcePath = internal.getPathFromUrl(activeTransfer.items[i].url)55 var sourcePath = internal.getPathFromUrl(activeImportTransfer.items[i].url)
5556
56 if (DocumentViewer.isFileSupported(sourcePath)) {57 if (DocumentViewer.isFileSupported(sourcePath)) {
57 var documentsLocation = DocumentViewer.getXdgDocumentsLocation()58 var documentsLocation = DocumentViewer.getXdgDocumentsLocation()
@@ -84,7 +85,7 @@
84 }85 }
8586
86 onExportRequested: {87 onExportRequested: {
87 activeTransfer = transfer88 activeExportTransfer = transfer
88 mainView.switchToPickMode()89 mainView.switchToPickMode()
89 }90 }
90 }91 }
@@ -125,7 +126,7 @@
125 }126 }
126127
127 function finalizeImport() {128 function finalizeImport() {
128 activeTransfer.finalize()129 activeImportTransfer.finalize()
129 }130 }
130131
131 function handleNotifications() {132 function handleNotifications() {
132133
=== modified file 'src/app/qml/documentPage/DocumentListView.qml'
--- src/app/qml/documentPage/DocumentListView.qml 2015-11-01 16:50:23 +0000
+++ src/app/qml/documentPage/DocumentListView.qml 2016-02-12 13:03:03 +0000
@@ -24,7 +24,7 @@
2424
25 function isMultipleSelection() {25 function isMultipleSelection() {
26 // No active transfer, then we're in selection mode.26 // No active transfer, then we're in selection mode.
27 if (!contentHubProxy.activeTransfer)27 if (!contentHubProxy.activeExportTransfer)
28 return true28 return true
2929
30 // We have an active transfer, get the value from the content hub proxy30 // We have an active transfer, get the value from the content hub proxy
3131
=== modified file 'src/app/qml/documentPage/DocumentPagePickModeHeader.qml'
--- src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-10-23 14:10:47 +0000
+++ src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2016-02-12 13:03:03 +0000
@@ -29,10 +29,13 @@
29 objectName: "cancelButton"29 objectName: "cancelButton"
30 iconName: "close"30 iconName: "close"
31 onTriggered: {31 onTriggered: {
32 if (!contentHubProxy.activeTransfer)32 if (!contentHubProxy.activeExportTransfer)
33 return;33 return
3434
35 contentHubProxy.activeTransfer.state = ContentTransfer.Aborted;35 contentHubProxy.activeExportTransfer.items = []
36 contentHubProxy.activeExportTransfer.state = ContentTransfer.Aborted
37
38 mainView.switchToBrowseMode()
36 }39 }
37 }40 }
3841
@@ -48,23 +51,32 @@
48 Action {51 Action {
49 text: i18n.tr("Pick")52 text: i18n.tr("Pick")
50 objectName: "pickButton"53 objectName: "pickButton"
51 enabled: viewLoader.item.selectedItems.count > 054 enabled: viewLoader.item.ViewItems.selectedIndices.length > 0
52 iconName: "ok"55 iconName: "ok"
53 onTriggered: {56 onTriggered: {
54 if (!enabled || !contentHubProxy.activeTransfer)57 if (!enabled || !contentHubProxy.activeExportTransfer)
55 return;58 return;
5659
57 var urlList = []60 var contentList = []
58 var indices = documentPage.view.item.selectedIndices;61 var indices = viewLoader.item.ViewItems.selectedIndices
62
63 console.log("[content-hub] Following files will be exported:")
5964
60 for (var i=0; i < indices.length; i++) {65 for (var i=0; i < indices.length; i++) {
61 urlList.push("file://" + folderModel.get(i).path);66 var filePath = "file://" + folderModel.get(i).path
67 console.log(filePath)
68
69 contentList.push(contentItem.createObject(rootItem, { "url": filePath }))
62 }70 }
6371
64 contentHubProxy.activeTransfer.items = urlList72 contentHubProxy.activeExportTransfer.items = contentList
65 contentHubProxy.activeTransfer.state = ContentTransfer.Charged73 contentHubProxy.activeExportTransfer.state = ContentTransfer.Charged
74
75 mainView.switchToBrowseMode()
66 }76 }
67 }77 }
68 ]78 ]
79
80 property Component contentItem: Component { ContentItem {} }
69}81}
7082

Subscribers

People subscribed via source and target branches