Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-documentpage-add-share-option into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Roman Shchekin
Approved revision: 173
Merged at revision: 175
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-documentpage-add-share-option
Merge into: lp:ubuntu-docviewer-app
Diff against target: 245 lines (+92/-34)
4 files modified
po/com.ubuntu.docviewer.pot (+26/-29)
src/app/qml/documentPage/DocumentDelegateActions.qml (+9/-1)
src/app/qml/documentPage/DocumentEmptyState.qml (+1/-4)
src/app/qml/documentPage/SharePage.qml (+56/-0)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-documentpage-add-share-option
Reviewer Review Type Date Requested Status
Roman Shchekin Approve
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Review via email: mp+270851@code.launchpad.net

Commit message

Added share option in documentsPage

Description of the change

Added share option in documentsPage

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
Roman Shchekin (mrqtros) wrote :

Looks ok!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'po/com.ubuntu.docviewer.pot'
2--- po/com.ubuntu.docviewer.pot 2015-08-04 16:01:37 +0000
3+++ po/com.ubuntu.docviewer.pot 2015-09-11 15:50:50 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: \n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2015-07-12 21:23+0200\n"
9+"POT-Creation-Date: 2015-09-09 19:15+0200\n"
10 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12 "Language-Team: LANGUAGE <LL@li.org>\n"
13@@ -33,7 +33,7 @@
14 msgstr ""
15
16 #: ../src/app/docviewer-application.cpp:171
17-#: /home/stefano/Progetti/docviewer/Libreoffice/build-lo-tiled-rendering-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
18+#: /tmp/build-reboot-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_15_04_vivid-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
19 msgid "Document Viewer"
20 msgstr ""
21
22@@ -149,89 +149,82 @@
23 msgid "%1 byte"
24 msgstr ""
25
26-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:28
27+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:36
28 msgid "Delete file"
29 msgstr ""
30
31-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:29
32+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:37
33 #, qt-format
34 msgid "Delete %1 file"
35 msgid_plural "Delete %1 files"
36 msgstr[0] ""
37 msgstr[1] ""
38
39-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:30
40-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:31
41+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:38
42+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
43 msgid "Are you sure you want to permanently delete this file?"
44 msgid_plural "Are you sure you want to permanently delete these files?"
45 msgstr[0] ""
46 msgstr[1] ""
47
48-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:36
49+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:44
50 #: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:27
51 #: ../src/app/qml/loView/LOViewGotoDialog.qml:52
52 #: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:52
53 msgid "Cancel"
54 msgstr ""
55
56-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
57+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:49
58+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
59 #: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:82
60 msgid "Delete"
61 msgstr ""
62
63+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:43
64+msgid "Share"
65+msgstr ""
66+
67 #: ../src/app/qml/documentPage/DocumentEmptyState.qml:24
68 msgid "No document found"
69 msgstr ""
70
71-#: ../src/app/qml/documentPage/DocumentEmptyState.qml:28
72+#: ../src/app/qml/documentPage/DocumentEmptyState.qml:25
73 msgid ""
74 "Connect your device to any computer and simply drag files to the Documents "
75-"folder."
76+"folder or insert removable media with documents."
77 msgstr ""
78
79 #. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
80 #. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
81-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:35
82+#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:32
83+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:37
84 #, qt-format
85 msgid "Today, %1"
86 msgstr ""
87
88 #. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
89 #. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
90-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:40
91+#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:37
92+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:42
93 #, qt-format
94 msgid "Yesterday, %1"
95 msgstr ""
96
97 #. TRANSLATORS: this is a datetime formatting string,
98 #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
99-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:45
100+#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:42
101 #: ../src/app/qml/documentPage/DocumentListDelegate.qml:58
102 msgid "dddd, hh:mm"
103 msgstr ""
104
105 #. TRANSLATORS: this is a datetime formatting string,
106 #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
107-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:49
108+#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:46
109 #: ../src/app/qml/documentPage/DocumentListDelegate.qml:47
110 #: ../src/app/qml/documentPage/DocumentListDelegate.qml:63
111 msgid "dd-MM-yyyy hh:mm"
112 msgstr ""
113
114-#. TRANSLATORS: this is a datetime formatting string, and the
115-#. singlequote is an escape character.
116-#. See http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
117-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:36
118-msgid "'Today', hh:mm"
119-msgstr ""
120-
121-#. TRANSLATORS: this is a datetime formatting string, and the
122-#. singlequote is an escape character.
123-#. See http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
124-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:42
125-msgid "'Yesterday', hh:mm"
126-msgstr ""
127-
128 #: ../src/app/qml/documentPage/DocumentListView.qml:157
129 msgid "Today"
130 msgstr ""
131@@ -306,6 +299,10 @@
132 "Please ensure that your query is not misspelled and/or try a different query."
133 msgstr ""
134
135+#: ../src/app/qml/documentPage/SharePage.qml:23
136+msgid "Share to"
137+msgstr ""
138+
139 #: ../src/app/qml/documentPage/SortSettingsDialog.qml:26
140 msgid "Sorting settings"
141 msgstr ""
142@@ -414,6 +411,6 @@
143 msgid "Open"
144 msgstr ""
145
146-#: /home/stefano/Progetti/docviewer/Libreoffice/build-lo-tiled-rendering-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
147+#: /tmp/build-reboot-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_15_04_vivid-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
148 msgid "documents;viewer;pdf;reader;"
149 msgstr ""
150
151=== modified file 'src/app/qml/documentPage/DocumentDelegateActions.qml'
152--- src/app/qml/documentPage/DocumentDelegateActions.qml 2015-07-01 16:05:59 +0000
153+++ src/app/qml/documentPage/DocumentDelegateActions.qml 2015-09-11 15:50:50 +0000
154@@ -37,5 +37,13 @@
155 }
156 ]
157
158- property list<Action> trailingActions
159+ property list<Action> trailingActions: [
160+ Action {
161+ iconName: "share"
162+ text: i18n.tr("Share")
163+ onTriggered: {
164+ pageStack.push(Qt.resolvedUrl("./SharePage.qml"), { fileUrl: model.path })
165+ }
166+ }
167+ ]
168 }
169
170=== modified file 'src/app/qml/documentPage/DocumentEmptyState.qml'
171--- src/app/qml/documentPage/DocumentEmptyState.qml 2015-02-26 20:16:32 +0000
172+++ src/app/qml/documentPage/DocumentEmptyState.qml 2015-09-11 15:50:50 +0000
173@@ -22,10 +22,7 @@
174
175 EmptyState {
176 title: i18n.tr("No document found")
177-
178- // TODO: Add "or insert removable media with documents." to subTitle when
179- // the support for SD card will be implemented.
180- subTitle: i18n.tr("Connect your device to any computer and simply drag files to the Documents folder.")
181+ subTitle: i18n.tr("Connect your device to any computer and simply drag files to the Documents folder or insert removable media with documents.")
182 iconName: "edit-copy"
183
184 anchors.centerIn: parent
185
186=== added file 'src/app/qml/documentPage/SharePage.qml'
187--- src/app/qml/documentPage/SharePage.qml 1970-01-01 00:00:00 +0000
188+++ src/app/qml/documentPage/SharePage.qml 2015-09-11 15:50:50 +0000
189@@ -0,0 +1,56 @@
190+/*
191+ Copyright (C) 2015 Stefano Verzegnassi
192+
193+ This program is free software: you can redistribute it and/or modify
194+ it under the terms of the GNU General Public License 3 as published by
195+ the Free Software Foundation.
196+
197+ This program is distributed in the hope that it will be useful,
198+ but WITHOUT ANY WARRANTY; without even the implied warranty of
199+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
200+ GNU General Public License for more details.
201+
202+ You should have received a copy of the GNU General Public License
203+ along with this program. If not, see http://www.gnu.org/licenses/.
204+*/
205+
206+import QtQuick 2.3
207+import Ubuntu.Components 1.1
208+import Ubuntu.Content 1.1
209+
210+Page {
211+ id: sharePage
212+ title: i18n.tr("Share to")
213+
214+ property url fileUrl
215+ property var activeTransfer
216+
217+ ContentPeerPicker {
218+ id: picker
219+
220+ contentType: ContentType.Documents
221+ handler: ContentHandler.Share
222+ showTitle: false
223+
224+ onPeerSelected: {
225+ activeTransfer = peer.request();
226+ activeTransfer.items = [ resultComponent.createObject(sharePage, { "url": fileUrl }) ];
227+ activeTransfer.state = ContentTransfer.Charged;
228+ pageStack.pop();
229+ }
230+
231+ onCancelPressed: {
232+ pageStack.pop();
233+ }
234+ }
235+
236+ ContentTransferHint {
237+ anchors.fill: parent
238+ activeTransfer: sharePage.activeTransfer
239+ }
240+
241+ Component {
242+ id: resultComponent
243+ ContentItem {}
244+ }
245+}

Subscribers

People subscribed via source and target branches