Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Merged
Approved by: Roman Shchekin
Approved revision: 191
Merged at revision: 191
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12
Merge into: lp:ubuntu-docviewer-app
Diff against target: 4327 lines (+668/-2637)
55 files modified
po/com.ubuntu.docviewer.pot (+79/-87)
src/app/graphics/select-none.svg (+0/-153)
src/app/graphics/select.svg (+0/-158)
src/app/graphics/settings_alt.svg (+0/-138)
src/app/qml/common/ContentHubProxy.qml (+1/-1)
src/app/qml/common/DetailsPage.qml (+15/-11)
src/app/qml/common/FileNotFoundDialog.qml (+2/-2)
src/app/qml/common/NightModeShader.qml (+1/-1)
src/app/qml/common/PickImportedDialog.qml (+13/-7)
src/app/qml/common/RejectedImportDialog.qml (+3/-3)
src/app/qml/common/SubtitledListItem.qml (+41/-0)
src/app/qml/common/UnknownTypeDialog.qml (+28/-16)
src/app/qml/common/utils.js (+28/-0)
src/app/qml/documentPage/DeleteFileDialog.qml (+48/-35)
src/app/qml/documentPage/DocumentDelegateActions.qml (+6/-3)
src/app/qml/documentPage/DocumentEmptyState.qml (+1/-1)
src/app/qml/documentPage/DocumentGridDelegate.qml (+0/-113)
src/app/qml/documentPage/DocumentGridView.qml (+0/-94)
src/app/qml/documentPage/DocumentListDelegate.qml (+89/-118)
src/app/qml/documentPage/DocumentListView.qml (+63/-154)
src/app/qml/documentPage/DocumentPage.qml (+22/-12)
src/app/qml/documentPage/DocumentPageDefaultHeader.qml (+6/-8)
src/app/qml/documentPage/DocumentPagePickModeHeader.qml (+5/-5)
src/app/qml/documentPage/DocumentPageSearchHeader.qml (+2/-2)
src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml (+39/-59)
src/app/qml/documentPage/SearchEmptyState.qml (+1/-1)
src/app/qml/documentPage/SectionHeader.qml (+29/-0)
src/app/qml/documentPage/SharePage.qml (+2/-2)
src/app/qml/documentPage/SortSettingsDialog.qml (+3/-2)
src/app/qml/documentPage/TileBase.qml (+0/-369)
src/app/qml/loView/KeybHelper.js (+1/-1)
src/app/qml/loView/LOViewDefaultHeader.qml (+2/-2)
src/app/qml/loView/LOViewGotoDialog.qml (+25/-14)
src/app/qml/loView/LOViewPage.qml (+9/-9)
src/app/qml/loView/LOViewZoomHeader.qml (+2/-2)
src/app/qml/loView/PanelButton.qml (+2/-2)
src/app/qml/loView/PartsView.qml (+10/-8)
src/app/qml/loView/SlideControllerPanel.qml (+2/-2)
src/app/qml/loView/ZoomSelector.qml (+2/-2)
src/app/qml/pdfView/PdfContentsPage.qml (+43/-36)
src/app/qml/pdfView/PdfView.qml (+2/-2)
src/app/qml/pdfView/PdfViewDefaultHeader.qml (+2/-2)
src/app/qml/pdfView/PdfViewDelegate.qml (+2/-2)
src/app/qml/pdfView/PdfViewGotoDialog.qml (+25/-14)
src/app/qml/textView/TextView.qml (+3/-3)
src/app/qml/textView/TextViewDefaultHeader.qml (+2/-2)
src/app/qml/ubuntu-docviewer-app.qml (+3/-3)
src/app/qml/upstreamComponents/EmptyState.qml (+2/-2)
src/app/qml/upstreamComponents/HeaderButton.qml (+0/-65)
src/app/qml/upstreamComponents/ListItemWithActions.qml (+0/-453)
src/app/qml/upstreamComponents/ListItemWithActionsCheckBox.qml (+0/-25)
src/app/qml/upstreamComponents/MultipleSelectionGridView.qml (+0/-199)
src/app/qml/upstreamComponents/MultipleSelectionListView.qml (+0/-199)
src/app/qml/upstreamComponents/MultipleSelectionVisualModel.qml (+0/-31)
src/app/qml/upstreamComponents/PageWithBottomEdge.qml (+2/-2)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12
Reviewer Review Type Date Requested Status
Ubuntu Phone Apps Jenkins Bot continuous-integration Approve
Roman Shchekin Needs Fixing
Review via email: mp+274051@code.launchpad.net

Commit message

* Switch to Ubuntu.Components 1.2
* Minor UI changes
* Temporarily removed GridView from documents browser page
* Fixed wrong default date format (now it is middle-endian format, default for US English)
* Limit ListViews width to units.gu(80) on wide screens

Description of the change

* Switch to Ubuntu.Components 1.2
* Minor UI changes
* Temporarily removed GridView from documents browser page
* Fixed wrong default date format (now it is middle-endian format, default for US English)
* Limit ListViews width to units.gu(80) on wide screens

To post a comment you must log in.
Revision history for this message
Stefano Verzegnassi (verzegnassi-stefano) wrote :

The diff is a bit huge because of the removal of deprecated components. I suggest to check the changes of a single revision at a time, since this MP is pretty linear.

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 :

See inline comments. I will continue my review in IDE.

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

Q: "Theme.palette.selected.backgroundText" such things are deprecated, aren't them?

A: Yes, they are. The question is how and when.
As far as I know, they're surely deprecated in UITK 1.3. In UITK 1.2 there has been some change about theming, but no complete guide/statement/changelog has been provided.
If I look at UITK source code, the 'Theme' singleton is still used in many 1.2 components, so I can suppose that it's just OK.

Anyway we will update to UITK 1.3 soon (probably even after the first release of our 'reboot' branch), since yesterday the 'Ubuntu 15.04.1' target has finally landed with OTA-7.

IMHO, at the moment, it is not a big thing to deal with.

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
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
190. By Stefano Verzegnassi

Merged 'reboot' branch

191. By Stefano Verzegnassi

Updated translation template

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=== modified file 'po/com.ubuntu.docviewer.pot'
2--- po/com.ubuntu.docviewer.pot 2015-10-19 22:31:33 +0000
3+++ po/com.ubuntu.docviewer.pot 2015-10-20 18:22:30 +0000
4@@ -8,7 +8,7 @@
5 msgstr ""
6 "Project-Id-Version: \n"
7 "Report-Msgid-Bugs-To: \n"
8-"POT-Creation-Date: 2015-10-20 00:24+0200\n"
9+"POT-Creation-Date: 2015-10-20 20:21+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@@ -41,30 +41,30 @@
14 "The path must exist prior to running ubuntu-docviewer-app"
15 msgstr ""
16
17-#: ../src/app/qml/common/DetailsPage.qml:27
18+#: ../src/app/qml/common/DetailsPage.qml:25
19 #: ../src/app/qml/loView/LOViewDefaultHeader.qml:106
20 #: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:97
21 #: ../src/app/qml/textView/TextViewDefaultHeader.qml:83
22 msgid "Details"
23 msgstr ""
24
25-#: ../src/app/qml/common/DetailsPage.qml:33
26+#: ../src/app/qml/common/DetailsPage.qml:36
27 msgid "Location"
28 msgstr ""
29
30-#: ../src/app/qml/common/DetailsPage.qml:37
31+#: ../src/app/qml/common/DetailsPage.qml:41
32 msgid "Size"
33 msgstr ""
34
35-#: ../src/app/qml/common/DetailsPage.qml:42
36+#: ../src/app/qml/common/DetailsPage.qml:46
37 msgid "Created"
38 msgstr ""
39
40-#: ../src/app/qml/common/DetailsPage.qml:47
41+#: ../src/app/qml/common/DetailsPage.qml:51
42 msgid "Last modified"
43 msgstr ""
44
45-#: ../src/app/qml/common/DetailsPage.qml:54
46+#: ../src/app/qml/common/DetailsPage.qml:58
47 msgid "MIME type"
48 msgstr ""
49
50@@ -77,9 +77,9 @@
51 msgstr ""
52
53 #: ../src/app/qml/common/FileNotFoundDialog.qml:28
54-#: ../src/app/qml/common/PickImportedDialog.qml:47
55+#: ../src/app/qml/common/PickImportedDialog.qml:53
56 #: ../src/app/qml/common/RejectedImportDialog.qml:38
57-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:32
58+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:33
59 #: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
60 #: ../src/app/qml/loView/LOViewDefaultHeader.qml:70
61 #: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61
62@@ -87,11 +87,11 @@
63 msgid "Close"
64 msgstr ""
65
66+#: ../src/app/qml/common/PickImportedDialog.qml:28
67+msgid "Multiple documents imported"
68+msgstr ""
69+
70 #: ../src/app/qml/common/PickImportedDialog.qml:29
71-msgid "Multiple documents imported"
72-msgstr ""
73-
74-#: ../src/app/qml/common/PickImportedDialog.qml:30
75 msgid "Choose which one to open:"
76 msgstr ""
77
78@@ -107,24 +107,29 @@
79 msgstr[0] ""
80 msgstr[1] ""
81
82-#: ../src/app/qml/common/UnknownTypeDialog.qml:26
83+#: ../src/app/qml/common/UnknownTypeDialog.qml:27
84 msgid "Unknown file type"
85 msgstr ""
86
87-#: ../src/app/qml/common/UnknownTypeDialog.qml:27
88+#: ../src/app/qml/common/UnknownTypeDialog.qml:28
89 msgid ""
90-"Sorry but we can't find a way to display this file. Do you want to open it "
91-"as a plain text?"
92-msgstr ""
93-
94-#: ../src/app/qml/common/UnknownTypeDialog.qml:29
95+"Sorry but we can't find a way to display this file.\n"
96+"\n"
97+"Do you want to open it as a plain text?"
98+msgstr ""
99+
100+#: ../src/app/qml/common/UnknownTypeDialog.qml:38
101+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
102+#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
103+#: ../src/app/qml/loView/LOViewGotoDialog.qml:53
104+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
105+msgid "Cancel"
106+msgstr ""
107+
108+#: ../src/app/qml/common/UnknownTypeDialog.qml:44
109 msgid "Yes"
110 msgstr ""
111
112-#: ../src/app/qml/common/UnknownTypeDialog.qml:38
113-msgid "No"
114-msgstr ""
115-
116 #. TRANSLATORS: %1 is the size of a file, expressed in GB
117 #: ../src/app/qml/common/utils.js:22
118 #, qt-format
119@@ -149,38 +154,31 @@
120 msgid "%1 byte"
121 msgstr ""
122
123-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:36
124+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
125 msgid "Delete file"
126 msgstr ""
127
128-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:37
129+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
130 #, qt-format
131 msgid "Delete %1 file"
132 msgid_plural "Delete %1 files"
133 msgstr[0] ""
134 msgstr[1] ""
135
136-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:38
137-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
138+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
139+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
140 msgid "Are you sure you want to permanently delete this file?"
141 msgid_plural "Are you sure you want to permanently delete these files?"
142 msgstr[0] ""
143 msgstr[1] ""
144
145-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:44
146-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
147-#: ../src/app/qml/loView/LOViewGotoDialog.qml:54
148-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:52
149-msgid "Cancel"
150-msgstr ""
151-
152-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:49
153-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
154-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:82
155+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
156+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:27
157+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:55
158 msgid "Delete"
159 msgstr ""
160
161-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:43
162+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:46
163 msgid "Share"
164 msgstr ""
165
166@@ -196,56 +194,32 @@
167
168 #. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
169 #. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
170-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:32
171-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:37
172+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:95
173 #, qt-format
174 msgid "Today, %1"
175 msgstr ""
176
177 #. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
178 #. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
179-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:37
180-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:42
181+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
182 #, qt-format
183 msgid "Yesterday, %1"
184 msgstr ""
185
186 #. TRANSLATORS: this is a datetime formatting string,
187 #. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
188-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:42
189-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:58
190+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:107
191+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:126
192+msgid "yyyy/MM/dd hh:mm"
193+msgstr ""
194+
195+#. TRANSLATORS: this is a datetime formatting string,
196+#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
197+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:120
198 msgid "dddd, hh:mm"
199 msgstr ""
200
201-#. TRANSLATORS: this is a datetime formatting string,
202-#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
203-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:46
204-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:47
205-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:63
206-msgid "dd-MM-yyyy hh:mm"
207-msgstr ""
208-
209-#: ../src/app/qml/documentPage/DocumentListView.qml:167
210-msgid "Today"
211-msgstr ""
212-
213-#: ../src/app/qml/documentPage/DocumentListView.qml:170
214-msgid "Yesterday"
215-msgstr ""
216-
217-#: ../src/app/qml/documentPage/DocumentListView.qml:173
218-msgid "Earlier this week"
219-msgstr ""
220-
221-#: ../src/app/qml/documentPage/DocumentListView.qml:176
222-msgid "Earlier this month"
223-msgstr ""
224-
225-#: ../src/app/qml/documentPage/DocumentListView.qml:178
226-msgid "Even earlier..."
227-msgstr ""
228-
229-#: ../src/app/qml/documentPage/DocumentPage.qml:24
230+#: ../src/app/qml/documentPage/DocumentPage.qml:23
231 msgid "Documents"
232 msgstr ""
233
234@@ -253,16 +227,14 @@
235 msgid "Search..."
236 msgstr ""
237
238-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:37
239+#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
240 msgid "Sorting settings..."
241 msgstr ""
242
243-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:46
244 #: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
245 msgid "Switch to single column list"
246 msgstr ""
247
248-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:46
249 #: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
250 msgid "Switch to grid"
251 msgstr ""
252@@ -283,11 +255,11 @@
253 msgid "search in documents..."
254 msgstr ""
255
256-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:52
257+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:42
258 msgid "Select None"
259 msgstr ""
260
261-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:54
262+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:42
263 msgid "Select All"
264 msgstr ""
265
266@@ -300,6 +272,26 @@
267 "Please ensure that your query is not misspelled and/or try a different query."
268 msgstr ""
269
270+#: ../src/app/qml/documentPage/SectionHeader.qml:13
271+msgid "Today"
272+msgstr ""
273+
274+#: ../src/app/qml/documentPage/SectionHeader.qml:16
275+msgid "Yesterday"
276+msgstr ""
277+
278+#: ../src/app/qml/documentPage/SectionHeader.qml:19
279+msgid "Earlier this week"
280+msgstr ""
281+
282+#: ../src/app/qml/documentPage/SectionHeader.qml:22
283+msgid "Earlier this month"
284+msgstr ""
285+
286+#: ../src/app/qml/documentPage/SectionHeader.qml:24
287+msgid "Even earlier..."
288+msgstr ""
289+
290 #: ../src/app/qml/documentPage/SharePage.qml:23
291 msgid "Share to"
292 msgstr ""
293@@ -373,16 +365,16 @@
294 msgid "Enable night mode"
295 msgstr ""
296
297-#: ../src/app/qml/loView/LOViewGotoDialog.qml:27
298+#: ../src/app/qml/loView/LOViewGotoDialog.qml:28
299 msgid "Go to position"
300 msgstr ""
301
302-#: ../src/app/qml/loView/LOViewGotoDialog.qml:28
303+#: ../src/app/qml/loView/LOViewGotoDialog.qml:29
304 msgid "Choose a position between 1% and 100%"
305 msgstr ""
306
307-#: ../src/app/qml/loView/LOViewGotoDialog.qml:46
308-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:44
309+#: ../src/app/qml/loView/LOViewGotoDialog.qml:60
310+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
311 msgid "GO!"
312 msgstr ""
313
314@@ -443,11 +435,11 @@
315 msgid "Go to page..."
316 msgstr ""
317
318-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:25
319+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
320 msgid "Go to page"
321 msgstr ""
322
323-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
324+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
325 #, qt-format
326 msgid "Choose a page between 1 and %1"
327 msgstr ""
328@@ -466,10 +458,10 @@
329 msgid "copy %1"
330 msgstr ""
331
332-#: /tmp/build-reboot-app-init-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
333+#: /tmp/build-reboot-uitk12-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
334 msgid "Document Viewer"
335 msgstr ""
336
337-#: /tmp/build-reboot-app-init-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
338+#: /tmp/build-reboot-uitk12-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
339 msgid "documents;viewer;pdf;reader;"
340 msgstr ""
341
342=== removed file 'src/app/graphics/select-none.svg'
343--- src/app/graphics/select-none.svg 2015-02-13 15:30:01 +0000
344+++ src/app/graphics/select-none.svg 1970-01-01 00:00:00 +0000
345@@ -1,153 +0,0 @@
346-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
347-<!-- Created with Inkscape (http://www.inkscape.org/) -->
348-
349-<svg
350- xmlns:dc="http://purl.org/dc/elements/1.1/"
351- xmlns:cc="http://creativecommons.org/ns#"
352- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
353- xmlns:svg="http://www.w3.org/2000/svg"
354- xmlns="http://www.w3.org/2000/svg"
355- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
356- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
357- width="90"
358- height="90"
359- id="svg4874"
360- version="1.1"
361- inkscape:version="0.48+devel r"
362- viewBox="0 0 90 90.000001"
363- sodipodi:docname="select-none.svg">
364- <defs
365- id="defs4876" />
366- <sodipodi:namedview
367- id="base"
368- pagecolor="#ffffff"
369- bordercolor="#666666"
370- borderopacity="1.0"
371- inkscape:pageopacity="0.0"
372- inkscape:pageshadow="2"
373- inkscape:zoom="12.434498"
374- inkscape:cx="10.237647"
375- inkscape:cy="53.078139"
376- inkscape:document-units="px"
377- inkscape:current-layer="g1311"
378- showgrid="true"
379- showborder="true"
380- fit-margin-top="0"
381- fit-margin-left="0"
382- fit-margin-right="0"
383- fit-margin-bottom="0"
384- inkscape:snap-bbox="true"
385- inkscape:bbox-paths="true"
386- inkscape:bbox-nodes="true"
387- inkscape:snap-bbox-edge-midpoints="true"
388- inkscape:snap-bbox-midpoints="true"
389- inkscape:object-paths="true"
390- inkscape:snap-intersection-paths="true"
391- inkscape:object-nodes="true"
392- inkscape:snap-smooth-nodes="true"
393- inkscape:snap-midpoints="true"
394- inkscape:snap-object-midpoints="true"
395- inkscape:snap-center="true"
396- showguides="true"
397- inkscape:guide-bbox="true">
398- <inkscape:grid
399- type="xygrid"
400- id="grid5451"
401- empspacing="6" />
402- <sodipodi:guide
403- orientation="1,0"
404- position="6,77"
405- id="guide4063" />
406- <sodipodi:guide
407- orientation="1,0"
408- position="3,78"
409- id="guide4065" />
410- <sodipodi:guide
411- orientation="0,1"
412- position="55,84"
413- id="guide4067" />
414- <sodipodi:guide
415- orientation="0,1"
416- position="53,87"
417- id="guide4069" />
418- <sodipodi:guide
419- orientation="0,1"
420- position="20,3"
421- id="guide4071" />
422- <sodipodi:guide
423- orientation="0,1"
424- position="20,6"
425- id="guide4073" />
426- <sodipodi:guide
427- orientation="1,0"
428- position="87,7"
429- id="guide4075" />
430- <sodipodi:guide
431- orientation="1,0"
432- position="84,7"
433- id="guide4077" />
434- <sodipodi:guide
435- orientation="0,1"
436- position="58,81"
437- id="guide4074" />
438- <sodipodi:guide
439- orientation="1,0"
440- position="9,74"
441- id="guide4076" />
442- <sodipodi:guide
443- orientation="0,1"
444- position="21,9"
445- id="guide4078" />
446- <sodipodi:guide
447- orientation="1,0"
448- position="81,4"
449- id="guide4080" />
450- </sodipodi:namedview>
451- <metadata
452- id="metadata4879">
453- <rdf:RDF>
454- <cc:Work
455- rdf:about="">
456- <dc:format>image/svg+xml</dc:format>
457- <dc:type
458- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
459- <dc:title></dc:title>
460- </cc:Work>
461- </rdf:RDF>
462- </metadata>
463- <g
464- inkscape:label="Layer 1"
465- inkscape:groupmode="layer"
466- id="layer1"
467- transform="translate(67.857146,-84.50504)">
468- <g
469- transform="matrix(0,-1,-1,0,373.50506,516.50504)"
470- id="g4845"
471- style="display:inline">
472- <g
473- transform="matrix(0,-1,-1,0,567.36222,615.36221)"
474- id="g1311"
475- inkscape:export-filename="envelope02.png"
476- inkscape:export-xdpi="90"
477- inkscape:export-ydpi="90">
478- <g
479- id="g1313"
480- transform="matrix(1.875,0,0,1.875,-366,-1657.8169)">
481- <rect
482- transform="translate(0,804.3622)"
483- y="152"
484- x="288"
485- height="48"
486- width="48"
487- id="rect1315"
488- style="opacity:0.21171169;fill:none;stroke:none" />
489- </g>
490- <path
491- style="font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#808080;fill-opacity:1;stroke:none;display:inline;font-family:Ubuntu;-inkscape-font-specification:Ubuntu"
492- d="M 21 6 C 11 6 6 5.9998033 6 17.626953 L 6 72.373047 C 6 84.000207 11 84 21 84 L 69 84 C 79 84 84 84.000207 84 72.373047 L 84 17.626953 C 84 5.9998033 79 6 69 6 L 21 6 z M 22.867188 12 L 67.132812 12 C 75.065512 12 78 11.999356 78 20.191406 L 78 69.808594 C 78 78.000644 75.065512 78 67.132812 78 L 22.867188 78 C 14.934488 78 12 78.000644 12 69.808594 L 12 20.191406 C 12 11.999356 14.934488 12 22.867188 12 z "
493- transform="translate(174,135.36222)"
494- id="path4098" />
495- </g>
496- </g>
497- </g>
498-</svg>
499
500=== removed file 'src/app/graphics/select.svg'
501--- src/app/graphics/select.svg 2015-02-13 15:30:01 +0000
502+++ src/app/graphics/select.svg 1970-01-01 00:00:00 +0000
503@@ -1,158 +0,0 @@
504-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
505-<!-- Created with Inkscape (http://www.inkscape.org/) -->
506-
507-<svg
508- xmlns:dc="http://purl.org/dc/elements/1.1/"
509- xmlns:cc="http://creativecommons.org/ns#"
510- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
511- xmlns:svg="http://www.w3.org/2000/svg"
512- xmlns="http://www.w3.org/2000/svg"
513- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
514- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
515- width="90"
516- height="90"
517- id="svg4874"
518- version="1.1"
519- inkscape:version="0.48+devel r12833"
520- viewBox="0 0 90 90.000001"
521- sodipodi:docname="select.svg">
522- <defs
523- id="defs4876" />
524- <sodipodi:namedview
525- id="base"
526- pagecolor="#ffffff"
527- bordercolor="#666666"
528- borderopacity="1.0"
529- inkscape:pageopacity="0.0"
530- inkscape:pageshadow="2"
531- inkscape:zoom="12.434498"
532- inkscape:cx="30.343002"
533- inkscape:cy="53.600878"
534- inkscape:document-units="px"
535- inkscape:current-layer="g1311"
536- showgrid="true"
537- showborder="true"
538- fit-margin-top="0"
539- fit-margin-left="0"
540- fit-margin-right="0"
541- fit-margin-bottom="0"
542- inkscape:snap-bbox="true"
543- inkscape:bbox-paths="true"
544- inkscape:bbox-nodes="true"
545- inkscape:snap-bbox-edge-midpoints="true"
546- inkscape:snap-bbox-midpoints="true"
547- inkscape:object-paths="true"
548- inkscape:snap-intersection-paths="true"
549- inkscape:object-nodes="true"
550- inkscape:snap-smooth-nodes="true"
551- inkscape:snap-midpoints="true"
552- inkscape:snap-object-midpoints="true"
553- inkscape:snap-center="true"
554- showguides="true"
555- inkscape:guide-bbox="true">
556- <inkscape:grid
557- type="xygrid"
558- id="grid5451"
559- empspacing="6" />
560- <sodipodi:guide
561- orientation="1,0"
562- position="6,77"
563- id="guide4063" />
564- <sodipodi:guide
565- orientation="1,0"
566- position="3,78"
567- id="guide4065" />
568- <sodipodi:guide
569- orientation="0,1"
570- position="55,84"
571- id="guide4067" />
572- <sodipodi:guide
573- orientation="0,1"
574- position="53,87"
575- id="guide4069" />
576- <sodipodi:guide
577- orientation="0,1"
578- position="20,3"
579- id="guide4071" />
580- <sodipodi:guide
581- orientation="0,1"
582- position="20,6"
583- id="guide4073" />
584- <sodipodi:guide
585- orientation="1,0"
586- position="87,7"
587- id="guide4075" />
588- <sodipodi:guide
589- orientation="1,0"
590- position="84,7"
591- id="guide4077" />
592- <sodipodi:guide
593- orientation="0,1"
594- position="58,81"
595- id="guide4074" />
596- <sodipodi:guide
597- orientation="1,0"
598- position="9,74"
599- id="guide4076" />
600- <sodipodi:guide
601- orientation="0,1"
602- position="21,9"
603- id="guide4078" />
604- <sodipodi:guide
605- orientation="1,0"
606- position="81,4"
607- id="guide4080" />
608- </sodipodi:namedview>
609- <metadata
610- id="metadata4879">
611- <rdf:RDF>
612- <cc:Work
613- rdf:about="">
614- <dc:format>image/svg+xml</dc:format>
615- <dc:type
616- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
617- <dc:title></dc:title>
618- </cc:Work>
619- </rdf:RDF>
620- </metadata>
621- <g
622- inkscape:label="Layer 1"
623- inkscape:groupmode="layer"
624- id="layer1"
625- transform="translate(67.857146,-84.50504)">
626- <g
627- transform="matrix(0,-1,-1,0,373.50506,516.50504)"
628- id="g4845"
629- style="display:inline">
630- <g
631- transform="matrix(0,-1,-1,0,567.36222,615.36221)"
632- id="g1311"
633- inkscape:export-filename="envelope02.png"
634- inkscape:export-xdpi="90"
635- inkscape:export-ydpi="90">
636- <g
637- id="g1313"
638- transform="matrix(1.875,0,0,1.875,-366,-1657.8169)">
639- <rect
640- transform="translate(0,804.3622)"
641- y="152"
642- x="288"
643- height="48"
644- width="48"
645- id="rect1315"
646- style="opacity:0.21171169;fill:none;stroke:none" />
647- </g>
648- <path
649- style="font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#808080;fill-opacity:1;stroke:none;display:inline;font-family:Ubuntu;-inkscape-font-specification:Ubuntu"
650- d="M 21 6 C 11 6 6 5.9998033 6 17.626953 L 6 72.373047 C 6 84.000207 11 84 21 84 L 69 84 C 79 84 84 84.000207 84 72.373047 L 84 17.626953 C 84 5.9998033 79 6 69 6 L 21 6 z M 22.867188 12 L 67.132812 12 C 75.065512 12 78 11.999356 78 20.191406 L 78 69.808594 C 78 78.000644 75.065512 78 67.132812 78 L 22.867188 78 C 14.934488 78 12 78.000644 12 69.808594 L 12 20.191406 C 12 11.999356 14.934488 12 22.867188 12 z "
651- transform="translate(174,135.36222)"
652- id="path4098" />
653- <path
654- style="font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;writing-mode:lr-tb;text-anchor:middle;fill:#808080;fill-opacity:1;stroke:none;font-family:Ubuntu;-inkscape-font-specification:Ubuntu"
655- d="m 242.00422,161.6591 -0.375,0.32812 -26.94727,23.60352 -15.79687,-13.55079 -4.77539,5.4004 20.57617,21.64843 31.30078,-32.9375 -3.98242,-4.49218 z"
656- id="path4041-9"
657- inkscape:connector-curvature="0" />
658- </g>
659- </g>
660- </g>
661-</svg>
662
663=== removed file 'src/app/graphics/settings_alt.svg'
664--- src/app/graphics/settings_alt.svg 2015-06-10 17:17:47 +0000
665+++ src/app/graphics/settings_alt.svg 1970-01-01 00:00:00 +0000
666@@ -1,138 +0,0 @@
667-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
668-<!-- Created with Inkscape (http://www.inkscape.org/) -->
669-
670-<svg
671- xmlns:dc="http://purl.org/dc/elements/1.1/"
672- xmlns:cc="http://creativecommons.org/ns#"
673- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
674- xmlns:svg="http://www.w3.org/2000/svg"
675- xmlns="http://www.w3.org/2000/svg"
676- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
677- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
678- width="90"
679- height="90"
680- id="svg3133"
681- version="1.1"
682- inkscape:version="0.48.3.1 r9886"
683- sodipodi:docname="settings@30.svg">
684- <defs
685- id="defs3135" />
686- <sodipodi:namedview
687- id="base"
688- pagecolor="#ffffff"
689- bordercolor="#666666"
690- borderopacity="1.0"
691- inkscape:pageopacity="0.0"
692- inkscape:pageshadow="2"
693- inkscape:zoom="6.3664628"
694- inkscape:cx="93.340685"
695- inkscape:cy="27.377839"
696- inkscape:document-units="px"
697- inkscape:current-layer="g4674"
698- showgrid="true"
699- inkscape:window-width="1920"
700- inkscape:window-height="1029"
701- inkscape:window-x="0"
702- inkscape:window-y="24"
703- inkscape:window-maximized="1"
704- fit-margin-top="0"
705- fit-margin-left="0"
706- fit-margin-right="0"
707- fit-margin-bottom="0"
708- showguides="true"
709- inkscape:guide-bbox="true">
710- <inkscape:grid
711- type="xygrid"
712- id="grid2992"
713- empspacing="6"
714- visible="true"
715- enabled="true"
716- snapvisiblegridlinesonly="true"
717- originx="4.2039363e-07px"
718- originy="0px" />
719- <sodipodi:guide
720- orientation="1,0"
721- position="45,11"
722- id="guide3763" />
723- <sodipodi:guide
724- orientation="0,1"
725- position="48,45"
726- id="guide3765" />
727- </sodipodi:namedview>
728- <metadata
729- id="metadata3138">
730- <rdf:RDF>
731- <cc:Work
732- rdf:about="">
733- <dc:format>image/svg+xml</dc:format>
734- <dc:type
735- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
736- <dc:title />
737- </cc:Work>
738- </rdf:RDF>
739- </metadata>
740- <g
741- inkscape:label="Layer 1"
742- inkscape:groupmode="layer"
743- id="layer1"
744- transform="translate(4.2039363e-7,-962.3622)">
745- <g
746- id="g4978"
747- transform="matrix(0.99934414,0,0,1,-106.92982,549.00002)">
748- <g
749- id="g4674"
750- transform="matrix(1.0006563,0,0,1,-155.17195,-2.6171874e-6)">
751- <rect
752- y="431.36218"
753- x="262"
754- height="72"
755- width="72"
756- id="rect4869"
757- style="opacity:0.01000001;color:#000000;fill:none;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
758- <path
759- style="color:#000000;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
760- d="m 320.5,419.36218 c 6.5,0 7.49965,0 7.49979,7 l 2.1e-4,10 c 1.5e-4,7 -1,7 -7.5,7 -6.5,0 -7.50015,0 -7.5,-7 l 2.1e-4,-9.99997 c 1.4e-4,-7.00003 0.99979,-7.00003 7.49979,-7.00003 z"
761- id="rect4871"
762- inkscape:connector-curvature="0"
763- sodipodi:nodetypes="zsszssz" />
764- <path
765- style="color:#000000;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
766- d="m 262,428.36218 0,6 45,0 0,-6 z m 72,0 0,6 18,0 0,-6 z"
767- id="rect4882"
768- inkscape:connector-curvature="0"
769- sodipodi:nodetypes="cccccccccc" />
770- <path
771- id="path4887"
772- d="m 262,455.36218 0,6 18,0 0,-6 z m 45,0 0,6 45,0 0,-6 z"
773- style="color:#000000;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
774- inkscape:connector-curvature="0"
775- sodipodi:nodetypes="cccccccccc" />
776- <path
777- sodipodi:nodetypes="cccccccccc"
778- inkscape:connector-curvature="0"
779- style="color:#000000;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
780- d="m 262,482.36218 0,6 45,0 0,-6 z m 72,0 0,6 18,0 0,-6 z"
781- id="path4889" />
782- <rect
783- y="413.36218"
784- x="262"
785- height="90"
786- width="90"
787- id="rect2993"
788- style="color:#000000;fill:none;stroke:none;stroke-width:11.80000019;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
789- <path
790- sodipodi:nodetypes="zsszssz"
791- inkscape:connector-curvature="0"
792- id="path3775"
793- d="m 293.5,446.36218 c 6.5,0 7.49965,0 7.49979,7 l 2.1e-4,10 c 1.5e-4,7 -1,7 -7.5,7 -6.5,0 -7.50015,0 -7.5,-7 l 2.1e-4,-9.99997 c 1.4e-4,-7.00003 0.99979,-7.00003 7.49979,-7.00003 z"
794- style="color:#000000;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
795- <path
796- style="color:#000000;fill:#808080;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:3;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
797- d="m 320.5,473.36218 c 6.5,0 7.49965,0 7.49979,7 l 2.1e-4,10 c 1.5e-4,7 -1,7 -7.5,7 -6.5,0 -7.50015,0 -7.5,-7 l 2.1e-4,-9.99997 c 1.4e-4,-7.00003 0.99979,-7.00003 7.49979,-7.00003 z"
798- id="path3777"
799- inkscape:connector-curvature="0"
800- sodipodi:nodetypes="zsszssz" />
801- </g>
802- </g>
803- </g>
804-</svg>
805
806=== modified file 'src/app/qml/common/ContentHubProxy.qml'
807--- src/app/qml/common/ContentHubProxy.qml 2015-09-21 11:15:29 +0000
808+++ src/app/qml/common/ContentHubProxy.qml 2015-10-20 18:22:30 +0000
809@@ -14,7 +14,7 @@
810 * along with this program. If not, see <http://www.gnu.org/licenses/>.
811 */
812
813-import QtQuick 2.3
814+import QtQuick 2.4
815 import Ubuntu.Content 1.1
816 import DocumentViewer 1.0
817
818
819=== modified file 'src/app/qml/common/DetailsPage.qml'
820--- src/app/qml/common/DetailsPage.qml 2015-04-15 14:21:48 +0000
821+++ src/app/qml/common/DetailsPage.qml 2015-10-20 18:22:30 +0000
822@@ -14,42 +14,46 @@
823 * along with this program. If not, see <http://www.gnu.org/licenses/>.
824 */
825
826-import QtQuick 2.3
827-import Ubuntu.Components 1.1
828-import Ubuntu.Components.ListItems 1.0 as ListItem
829+import QtQuick 2.4
830+import Ubuntu.Components 1.2
831
832 import "utils.js" as Utils
833
834 Page {
835 id: detailsPage
836 objectName: "detailsPage"
837-
838 title: i18n.tr("Details")
839
840 Column {
841- width: parent.width
842+ width: Math.min(units.gu(80), parent.width)
843+ anchors {
844+ top: parent.top
845+ bottom: parent.bottom
846+ horizontalCenter: parent.horizontalCenter
847+ }
848
849- ListItem.Subtitled {
850+ SubtitledListItem {
851 text: i18n.tr("Location")
852 subText: file.path
853 }
854- ListItem.Subtitled {
855+
856+ SubtitledListItem {
857 text: i18n.tr("Size")
858 subText: Utils.printSize(i18n, file.info.size)
859 }
860
861- ListItem.Subtitled {
862+ SubtitledListItem {
863 text: i18n.tr("Created")
864 subText: file.info.creationTime.toLocaleString(Qt.locale())
865 }
866
867- ListItem.Subtitled {
868+ SubtitledListItem {
869 text: i18n.tr("Last modified")
870 subText: file.info.lastModified.toLocaleString(Qt.locale())
871 }
872
873- ListItem.Subtitled {
874- id: mimetypeItem
875+ SubtitledListItem {
876+ // Used by Autopilot tests
877 objectName: "mimetypeItem"
878 text: i18n.tr("MIME type")
879 subText: file.mimetype.name
880
881=== modified file 'src/app/qml/common/FileNotFoundDialog.qml'
882--- src/app/qml/common/FileNotFoundDialog.qml 2015-04-07 21:40:16 +0000
883+++ src/app/qml/common/FileNotFoundDialog.qml 2015-10-20 18:22:30 +0000
884@@ -14,8 +14,8 @@
885 * along with this program. If not, see <http://www.gnu.org/licenses/>.
886 */
887
888-import QtQuick 2.3
889-import Ubuntu.Components 1.1
890+import QtQuick 2.4
891+import Ubuntu.Components 1.2
892 import Ubuntu.Components.Popups 1.0
893
894 // We may want to refactor this dialog for a more generic usage, when we'll need it.
895
896=== modified file 'src/app/qml/common/NightModeShader.qml'
897--- src/app/qml/common/NightModeShader.qml 2015-03-26 14:09:38 +0000
898+++ src/app/qml/common/NightModeShader.qml 2015-10-20 18:22:30 +0000
899@@ -14,7 +14,7 @@
900 * along with this program. If not, see <http://www.gnu.org/licenses/>.
901 */
902
903-import QtQuick 2.3
904+import QtQuick 2.4
905
906 ShaderEffect {
907 fragmentShader: "
908
909=== modified file 'src/app/qml/common/PickImportedDialog.qml'
910--- src/app/qml/common/PickImportedDialog.qml 2015-09-11 14:48:57 +0000
911+++ src/app/qml/common/PickImportedDialog.qml 2015-10-20 18:22:30 +0000
912@@ -14,10 +14,9 @@
913 * along with this program. If not, see <http://www.gnu.org/licenses/>.
914 */
915
916-import QtQuick 2.3
917-import Ubuntu.Components 1.1
918+import QtQuick 2.4
919+import Ubuntu.Components 1.2
920 import Ubuntu.Components.Popups 1.0
921-import Ubuntu.Components.ListItems 1.0 as ListItem
922
923 import "utils.js" as Utils
924
925@@ -29,17 +28,24 @@
926 title: i18n.tr("Multiple documents imported")
927 text: i18n.tr("Choose which one to open:")
928
929- // We don't use a Flickable, since it already lives in the Dialog itself.
930+ // We don't use a Flickable, since the Dialog has already one.
931 Repeater {
932 id: repeater
933- ListItem.Standard {
934- text: Utils.getNameOfFile(model.path)
935- __foregroundColor: Theme.palette.selected.backgroundText
936
937+ ListItem {
938 onClicked: {
939 PopupUtils.close(multipleImportDialog);
940 mainView.openDocument(model.path);
941 }
942+
943+ Label {
944+ text: Utils.getNameOfFile(model.path)
945+ anchors {
946+ left: parent.left; right: parent.right
947+ margins: units.gu(2)
948+ verticalCenter: parent.verticalCenter
949+ }
950+ }
951 }
952 }
953
954
955=== modified file 'src/app/qml/common/RejectedImportDialog.qml'
956--- src/app/qml/common/RejectedImportDialog.qml 2015-09-11 14:48:57 +0000
957+++ src/app/qml/common/RejectedImportDialog.qml 2015-10-20 18:22:30 +0000
958@@ -14,8 +14,8 @@
959 * along with this program. If not, see <http://www.gnu.org/licenses/>.
960 */
961
962-import QtQuick 2.3
963-import Ubuntu.Components 1.1
964+import QtQuick 2.4
965+import Ubuntu.Components 1.2
966 import Ubuntu.Components.Popups 1.0
967
968 Dialog {
969@@ -23,7 +23,7 @@
970
971 property alias model: repeater.model
972
973- signal closed
974+ signal closed()
975
976 title: i18n.tr("File not supported", "Files not supported", repeater.count)
977 text: i18n.tr("Following document has not been imported:",
978
979=== added file 'src/app/qml/common/SubtitledListItem.qml'
980--- src/app/qml/common/SubtitledListItem.qml 1970-01-01 00:00:00 +0000
981+++ src/app/qml/common/SubtitledListItem.qml 2015-10-20 18:22:30 +0000
982@@ -0,0 +1,41 @@
983+/*
984+ * Copyright (C) 2015 Canonical, Ltd.
985+ *
986+ * This program is free software; you can redistribute it and/or modify
987+ * it under the terms of the GNU General Public License as published by
988+ * the Free Software Foundation; version 3.
989+ *
990+ * This program is distributed in the hope that it will be useful,
991+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
992+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
993+ * GNU General Public License for more details.
994+ *
995+ * You should have received a copy of the GNU General Public License
996+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
997+ */
998+
999+import QtQuick 2.4
1000+import Ubuntu.Components 1.2
1001+
1002+ListItem {
1003+ id: listItemSubtitled
1004+ property alias text: mainLabel.text
1005+ property alias subText: subLabel.text
1006+
1007+ Column {
1008+ anchors {
1009+ left: parent.left; right: parent.right
1010+ margins: units.gu(2)
1011+ verticalCenter: parent.verticalCenter
1012+ }
1013+
1014+ Label {
1015+ id: mainLabel
1016+ color: UbuntuColors.midAubergine
1017+ }
1018+ Label {
1019+ id: subLabel
1020+ fontSize: "small"
1021+ }
1022+ }
1023+}
1024
1025=== modified file 'src/app/qml/common/UnknownTypeDialog.qml'
1026--- src/app/qml/common/UnknownTypeDialog.qml 2015-02-13 15:30:01 +0000
1027+++ src/app/qml/common/UnknownTypeDialog.qml 2015-10-20 18:22:30 +0000
1028@@ -14,9 +14,10 @@
1029 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1030 */
1031
1032-import QtQuick 2.3
1033-import Ubuntu.Components 1.1
1034+import QtQuick 2.4
1035+import Ubuntu.Components 1.2
1036 import Ubuntu.Components.Popups 1.0
1037+import QtQuick.Layouts 1.1
1038
1039 import "loadComponent.js" as LoadComponent
1040
1041@@ -24,20 +25,31 @@
1042 id: unknownDialog
1043 objectName: "unknownDialog"
1044 title: i18n.tr("Unknown file type")
1045- text: i18n.tr("Sorry but we can't find a way to display this file. Do you want to open it as a plain text?")
1046- Button {
1047- text: i18n.tr("Yes")
1048- color: UbuntuColors.green
1049-
1050- onClicked: {
1051- LoadComponent.load("text/plain");
1052- PopupUtils.close(unknownDialog)
1053- }
1054- }
1055- Button {
1056- text: i18n.tr("No")
1057- color: UbuntuColors.red
1058- onClicked: PopupUtils.close(unknownDialog)
1059+ text: i18n.tr("Sorry but we can't find a way to display this file.\n\nDo you want to open it as a plain text?")
1060+
1061+ RowLayout {
1062+ anchors {
1063+ left: parent.left
1064+ right: parent.right
1065+ margins: units.gu(-1)
1066+ }
1067+
1068+ Button {
1069+ text: i18n.tr("Cancel")
1070+ onClicked: PopupUtils.close(unknownDialog)
1071+ Layout.fillWidth: true
1072+ }
1073+
1074+ Button {
1075+ text: i18n.tr("Yes")
1076+ color: UbuntuColors.green
1077+ Layout.fillWidth: true
1078+
1079+ onClicked: {
1080+ LoadComponent.load("text/plain");
1081+ PopupUtils.close(unknownDialog)
1082+ }
1083+ }
1084 }
1085 }
1086
1087
1088=== modified file 'src/app/qml/common/utils.js'
1089--- src/app/qml/common/utils.js 2015-03-04 17:48:47 +0000
1090+++ src/app/qml/common/utils.js 2015-10-20 18:22:30 +0000
1091@@ -36,3 +36,31 @@
1092 function getNameOfFile(path) {
1093 return path.toString().substring(path.lastIndexOf('/') + 1);
1094 }
1095+
1096+function getIconNameFromMimetype(mimetype) {
1097+ if (mimetype.substring(0, 5) === "text/")
1098+ return "text-x-generic-symbolic"
1099+
1100+ if (mimetype.substring(0, 5) === "image")
1101+ return "image-x-generic-symbolic"
1102+
1103+ if (mimetype === "application/pdf")
1104+ return "application-pdf-symbolic"
1105+
1106+ if (mimetype === "application/vnd.oasis.opendocument.text"
1107+ || mimetype === "application/msword"
1108+ || mimetype === "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
1109+ return "x-office-document-symbolic"
1110+
1111+ if (mimetype === "application/vnd.oasis.opendocument.spreadsheet"
1112+ || mimetype === "application/vnd.ms-excel"
1113+ || mimetype === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
1114+ return "x-office-spreadsheet-symbolic"
1115+
1116+ if (mimetype === "application/vnd.oasis.opendocument.presentation"
1117+ || mimetype === "application/vnd.ms-powerpoint"
1118+ || mimetype === "application/vnd.openxmlformats-officedocument.presentationml.presentation")
1119+ return "x-office-presentation-symbolic"
1120+
1121+ return "package-x-generic-symbolic"
1122+}
1123
1124=== modified file 'src/app/qml/documentPage/DeleteFileDialog.qml'
1125--- src/app/qml/documentPage/DeleteFileDialog.qml 2015-07-01 16:05:59 +0000
1126+++ src/app/qml/documentPage/DeleteFileDialog.qml 2015-10-20 18:22:30 +0000
1127@@ -15,56 +15,69 @@
1128 along with this program. If not, see http://www.gnu.org/licenses/.
1129 */
1130
1131-import QtQuick 2.0
1132-import Ubuntu.Components 1.1
1133+import QtQuick 2.4
1134+import Ubuntu.Components 1.2
1135 import Ubuntu.Components.Popups 1.0
1136+import QtQuick.Layouts 1.1
1137
1138 Dialog {
1139 id: deleteFileDialog
1140
1141 property string path
1142- property int __deleteCount: documentPage.view.item.selectedItems.count
1143+ property var selectedIndices: viewLoader.item.ViewItems.selectedIndices;
1144+ property int deleteCount: selectedIndices.length
1145
1146- // WORKAROUND: This property is used only when user wants to remove a single
1147- // file from a delegate action, and the value of the property is read during
1148- // the Component.onDestruction event.
1149+ // WORKAROUND: This property is only used when the dialog is opened from a
1150+ // ListView delegate action for removing a single file.
1151+ // In this case, we remove the file as soon as the dialog is destroyed
1152+ // (it means that docModel.rm() is called externally).
1153 // We do this because we need to avoid that the entry in the model is removed
1154 // before this dialog is closed.
1155 // See src/app/qml/documentPage/DocumentDelegateActions.qml
1156 property bool confirmed: false
1157
1158- title: path ? i18n.tr("Delete file") :
1159- i18n.tr("Delete %1 file", "Delete %1 files", __deleteCount).arg(__deleteCount)
1160- text: path ? i18n.tr("Are you sure you want to permanently delete this file?") :
1161- i18n.tr("Are you sure you want to permanently delete this file?",
1162- "Are you sure you want to permanently delete these files?",
1163- __deleteCount)
1164-
1165- Button {
1166- text: i18n.tr("Cancel")
1167- onClicked: PopupUtils.close(deleteFileDialog)
1168- }
1169-
1170- Button {
1171- text: i18n.tr("Delete")
1172- color: UbuntuColors.red
1173-
1174- onClicked: {
1175- if (deleteFileDialog.path) {
1176- deleteFileDialog.confirmed = true;
1177- } else {
1178- // This is called from selection mode
1179- var items = documentPage.view.item.selectedItems;
1180-
1181- for (var i=0; i < items.count; i++) {
1182- console.log("Removing:", items.get(i).model.path);
1183- docModel.rm(items.get(i).model.path);
1184+ title: path ? i18n.tr("Delete file")
1185+ : i18n.tr("Delete %1 file", "Delete %1 files", deleteCount).arg(deleteCount)
1186+ text: path ? i18n.tr("Are you sure you want to permanently delete this file?")
1187+ : i18n.tr("Are you sure you want to permanently delete this file?",
1188+ "Are you sure you want to permanently delete these files?",
1189+ deleteCount)
1190+
1191+
1192+ RowLayout {
1193+ anchors {
1194+ left: parent.left
1195+ right: parent.right
1196+ margins: units.gu(-1)
1197+ }
1198+
1199+ Button {
1200+ text: i18n.tr("Cancel")
1201+ onClicked: PopupUtils.close(deleteFileDialog)
1202+ Layout.fillWidth: true
1203+ }
1204+
1205+ Button {
1206+ text: i18n.tr("Delete")
1207+ color: UbuntuColors.red
1208+ Layout.fillWidth: true
1209+
1210+ onClicked: {
1211+ if (deleteFileDialog.path) {
1212+ // WORKAROUND: See above.
1213+ deleteFileDialog.confirmed = true;
1214+ } else {
1215+ // This is called from selection mode
1216+ for (var i=0; i < selectedIndices.length; i++) {
1217+ console.log("Removing:", folderModel.get(selectedIndices[i]).path);
1218+ docModel.rm(folderModel.get(selectedIndices[i]).path);
1219+ }
1220+
1221+ viewLoader.item.cancelSelection();
1222 }
1223
1224- viewLoader.item.endSelection();
1225+ PopupUtils.close(deleteFileDialog)
1226 }
1227-
1228- PopupUtils.close(deleteFileDialog)
1229 }
1230 }
1231 }
1232
1233=== modified file 'src/app/qml/documentPage/DocumentDelegateActions.qml'
1234--- src/app/qml/documentPage/DocumentDelegateActions.qml 2015-09-09 17:18:12 +0000
1235+++ src/app/qml/documentPage/DocumentDelegateActions.qml 2015-10-20 18:22:30 +0000
1236@@ -14,10 +14,12 @@
1237 along with this program. If not, see http://www.gnu.org/licenses/.
1238 */
1239
1240-import QtQuick 2.0
1241-import Ubuntu.Components 1.1
1242+import QtQuick 2.4
1243+import Ubuntu.Components 1.2
1244 import Ubuntu.Components.Popups 1.0
1245
1246+// TODO: Probably requires some change in order to work with latest ListItem 1.2
1247+
1248 QtObject {
1249 property list<Action> leadingActions: [
1250 Action {
1251@@ -27,12 +29,13 @@
1252 var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"),
1253 documentPage, { path: model.path })
1254
1255+ // See DeleteFileDialog.qml
1256 dialog.Component.destruction.connect(function() {
1257 if (dialog.confirmed) {
1258 console.log("Removing:", model.path);
1259 docModel.rm(model.path);
1260 }
1261- });
1262+ })
1263 }
1264 }
1265 ]
1266
1267=== modified file 'src/app/qml/documentPage/DocumentEmptyState.qml'
1268--- src/app/qml/documentPage/DocumentEmptyState.qml 2015-09-09 17:05:58 +0000
1269+++ src/app/qml/documentPage/DocumentEmptyState.qml 2015-10-20 18:22:30 +0000
1270@@ -14,7 +14,7 @@
1271 along with this program. If not, see http://www.gnu.org/licenses/.
1272 */
1273
1274-import QtQuick 2.0
1275+import QtQuick 2.4
1276 import "../upstreamComponents"
1277
1278 Item {
1279
1280=== removed file 'src/app/qml/documentPage/DocumentGridDelegate.qml'
1281--- src/app/qml/documentPage/DocumentGridDelegate.qml 2015-09-09 14:05:46 +0000
1282+++ src/app/qml/documentPage/DocumentGridDelegate.qml 1970-01-01 00:00:00 +0000
1283@@ -1,113 +0,0 @@
1284-/*
1285- Copyright (C) 2015 Stefano Verzegnassi
1286-
1287- This program is free software: you can redistribute it and/or modify
1288- it under the terms of the GNU General Public License 3 as published by
1289- the Free Software Foundation.
1290-
1291- This program is distributed in the hope that it will be useful,
1292- but WITHOUT ANY WARRANTY; without even the implied warranty of
1293- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1294- GNU General Public License for more details.
1295-
1296- You should have received a copy of the GNU General Public License
1297- along with this program. If not, see http://www.gnu.org/licenses/.
1298-*/
1299-
1300-import QtQuick 2.0
1301-import Ubuntu.Components 1.1
1302-
1303-import "../common/utils.js" as Utils
1304-
1305-TileBase {
1306- id: root
1307-
1308- function formattedDateTime() {
1309- var date = new Date(model.date)
1310- var diff = model.dateDiff
1311-
1312- if (diff < 1)
1313- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1314- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1315- return i18n.tr("Today, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
1316-
1317- if (diff < 2)
1318- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1319- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1320- return i18n.tr("Yesterday, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
1321-
1322- if (diff < 7)
1323- // TRANSLATORS: this is a datetime formatting string,
1324- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1325- return Qt.formatDateTime(date, i18n.tr("dddd, hh:mm"))
1326-
1327- // TRANSLATORS: this is a datetime formatting string,
1328- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1329- return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm"))
1330- }
1331-
1332- title: model.name
1333- text: formattedDateTime()
1334- subText: Utils.printSize(i18n, model.size)
1335-
1336- leadingActions: documentDelegateActions.leadingActions
1337- trailingActions: documentDelegateActions.trailingActions
1338-
1339- Icon {
1340- id: extStorageIcon
1341-
1342- width: units.gu(4)
1343- height: units.gu(4)
1344- anchors {
1345- left: parent.left
1346- top: parent.top
1347- margins: units.gu(0.5)
1348- }
1349-
1350- visible: model.isFromExternalStorage
1351- name: "sdcard-symbolic"
1352- }
1353-
1354- // Document mimetype icon
1355- Icon {
1356- anchors.centerIn: parent
1357- width: units.gu(8); height: width
1358-
1359- // At the moment the suru icon theme doesn't have much icons.
1360- // Just some note for the future:
1361- // TODO: Add icons for Office/ODF documents
1362- // TODO: Whenever there will be icons for source code files, add them.
1363- name: {
1364- if (model.mimetype.substring(0, 5) === "text/")
1365- return "text-x-generic-symbolic"
1366-
1367- if (model.mimetype.substring(0, 5) === "image")
1368- return "image-x-generic-symbolic"
1369-
1370- if (model.mimetype === "application/pdf")
1371- return "application-pdf-symbolic"
1372-
1373- return "package-x-generic-symbolic"
1374- }
1375- }
1376-
1377- // Cover
1378- /* Image {
1379- anchors.fill: parent
1380-
1381- source: {
1382- if (model.cover !== "" && typeof model.cover !== "undefined")
1383- return model.cover
1384-
1385- if (model.mimetype.toString().indexOf("image") !== -1)
1386- return model.path
1387-
1388- return ""
1389- }
1390-
1391- sourceSize.width: width
1392- fillMode: Image.PreserveAspectCrop
1393- }*/
1394-
1395- DocumentDelegateActions { id: documentDelegateActions }
1396-}
1397
1398=== removed file 'src/app/qml/documentPage/DocumentGridView.qml'
1399--- src/app/qml/documentPage/DocumentGridView.qml 2015-09-19 17:51:46 +0000
1400+++ src/app/qml/documentPage/DocumentGridView.qml 1970-01-01 00:00:00 +0000
1401@@ -1,94 +0,0 @@
1402-/*
1403- Copyright (C) 2015 Stefano Verzegnassi
1404-
1405- This program is free software: you can redistribute it and/or modify
1406- it under the terms of the GNU General Public License 3 as published by
1407- the Free Software Foundation.
1408-
1409- This program is distributed in the hope that it will be useful,
1410- but WITHOUT ANY WARRANTY; without even the implied warranty of
1411- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
1412- GNU General Public License for more details.
1413-
1414- You should have received a copy of the GNU General Public License
1415- along with this program. If not, see http://www.gnu.org/licenses/.
1416-*/
1417-
1418-import QtQuick 2.0
1419-import Ubuntu.Components 1.1
1420-
1421-import "../upstreamComponents"
1422-
1423-MultipleSelectionGridView {
1424- id: documentGridView
1425-
1426- // We use mainView.width to calculate the size and the spacing of elements.
1427- // That's because this GridView always fills (and always will) the whole size of MainView.
1428- // By this way, we can avoid binding loops, keeping the code pretty simple.
1429- anchors {
1430- fill: parent
1431- margins: units.gu(0.5)
1432- leftMargin: (mainView.width % cellWidth) * 0.5
1433- rightMargin: (mainView.width % cellWidth) * 0.5
1434- }
1435- clip: true
1436-
1437- cellHeight: cellWidth
1438- cellWidth: (mainView.width > units.gu(50)) ? units.gu(24)
1439- : (mainView.width - units.gu(2)) * 0.5
1440-
1441- // We allow multiple selection both in selection and pick mode.
1442- multipleSelection: {
1443- // No active transfer, then we're in selection mode.
1444- if (!contentHubProxy.activeTransfer)
1445- return true
1446-
1447- // We have an active transfer, get the value from the content hub proxy
1448- return contentHubProxy.multipleSelectionType
1449- }
1450-
1451- listDelegate: DocumentGridDelegate {
1452- id: delegate
1453- width: cellWidth
1454- height: cellHeight
1455-
1456- selectionMode: documentGridView.isInSelectionMode
1457- selected: documentGridView.isSelected(delegate)
1458-
1459- onClicked: {
1460- if(documentGridView.isInSelectionMode) {
1461- if(!documentGridView.selectItem(delegate)) {
1462- documentGridView.deselectItem(delegate)
1463- }
1464- return
1465- }
1466- else {
1467- mainView.openDocument(model.path)
1468- }
1469- }
1470-
1471- onPressAndHold: {
1472- if (!documentGridView.isInSelectionMode) {
1473- documentGridView.startSelection()
1474- documentGridView.selectItem(delegate)
1475- }
1476- }
1477- }
1478-
1479- listModel: folderModel
1480-
1481- Scrollbar {
1482- flickableItem: documentGridView
1483- parent: documentGridView.parent
1484- }
1485-
1486- Connections {
1487- target: sortSettings
1488-
1489- onSortModeChanged: {
1490- documentGridView.positionViewAtBeginning()
1491- }
1492- }
1493-
1494- Component.onCompleted: { if (mainView.pickMode) documentGridView.startSelection(); }
1495-}
1496
1497=== modified file 'src/app/qml/documentPage/DocumentListDelegate.qml'
1498--- src/app/qml/documentPage/DocumentListDelegate.qml 2015-09-09 14:05:46 +0000
1499+++ src/app/qml/documentPage/DocumentListDelegate.qml 2015-10-20 18:22:30 +0000
1500@@ -14,147 +14,118 @@
1501 along with this program. If not, see http://www.gnu.org/licenses/.
1502 */
1503
1504-import QtQuick 2.0
1505-import Ubuntu.Components 1.1
1506+import QtQuick 2.4
1507+import Ubuntu.Components 1.2
1508 import QtQuick.Layouts 1.1
1509-import QtGraphicalEffects 1.0
1510+import DocumentViewer 1.0
1511
1512 import "../common/utils.js" as Utils
1513-import "../upstreamComponents"
1514-
1515-ListItemWithActions {
1516- property QtObject documentDelegateActions: DocumentDelegateActions { }
1517-
1518- function formattedDateTime() {
1519- var date = new Date(model.date)
1520- var diff = model.dateDiff
1521-
1522- if (sortSettings.sortMode !== 0) { // The sort rule is not "by date"
1523- switch(diff) {
1524- case 0: // DocumentsModel.Today
1525- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1526- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1527- return i18n.tr("Today, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
1528-
1529- case 1: // DocumentsModel.Yesterday
1530- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1531- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1532- return i18n.tr("Yesterday, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
1533-
1534- default: // DocumentsModel.LastWeek || DocumentsModel.LastMonth || DocumentsModel.Earlier
1535- // TRANSLATORS: this is a datetime formatting string,
1536- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1537- return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm"))
1538- }
1539- } else {
1540- switch(diff) {
1541- case 0: // DocumentsModel.Today, or
1542- case 1: // DocumentsModel.Yesterday
1543- return Qt.formatDateTime(date, Qt.locale().timeFormat(Locale.ShortFormat))
1544-
1545- case 2: // DocumentsModel.LastWeek
1546- // TRANSLATORS: this is a datetime formatting string,
1547- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1548- return Qt.formatDateTime(date, i18n.tr("dddd, hh:mm"))
1549-
1550- default: // DocumentsModel.LastMonth || DocumentsModel.Earlier
1551- // TRANSLATORS: this is a datetime formatting string,
1552- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1553- return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm"))
1554- }
1555- }
1556- }
1557-
1558- anchors { left: parent.left; right: parent.right }
1559- height: units.gu(8)
1560-
1561- locked: documentPage.state == "pickMode"
1562-
1563- leftSideAction: documentDelegateActions.leadingActions[0]
1564- rightSideActions: documentDelegateActions.trailingActions
1565-
1566- contents: RowLayout {
1567- anchors.fill: parent
1568+
1569+// TODO: Ask for a review of this component to the design team
1570+
1571+ListItem {
1572+ id: listDelegate
1573+ height: units.gu(9)
1574+ leadingActions: ListItemActions { actions: documentDelegateActions.leadingActions }
1575+ trailingActions: ListItemActions { actions: documentDelegateActions.trailingActions }
1576+
1577+ RowLayout {
1578 spacing: units.gu(2)
1579+ anchors {
1580+ fill: parent; margins: units.gu(1)
1581+ leftMargin: units.gu(2)
1582+ rightMargin: units.gu(2)
1583+ }
1584
1585 Icon {
1586+ name: Utils.getIconNameFromMimetype(model.mimetype)
1587 Layout.preferredWidth: height
1588 Layout.preferredHeight: units.gu(5)
1589-
1590- // At the moment the suru icon theme doesn't have much icons.
1591- name: {
1592- if (model.mimetype.substring(0, 5) === "text/")
1593- return "text-x-generic-symbolic"
1594-
1595- if (model.mimetype.substring(0, 5) === "image")
1596- return "image-x-generic-symbolic"
1597-
1598- if (model.mimetype === "application/pdf")
1599- return "application-pdf-symbolic"
1600-
1601- if (model.mimetype === "application/vnd.oasis.opendocument.text"
1602- || model.mimetype === "application/msword"
1603- || model.mimetype === "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
1604- return "x-office-document-symbolic"
1605-
1606- if (model.mimetype === "application/vnd.oasis.opendocument.spreadsheet"
1607- || model.mimetype === "application/vnd.ms-excel"
1608- || model.mimetype === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
1609- return "x-office-spreadsheet-symbolic"
1610-
1611- if (model.mimetype === "application/vnd.oasis.opendocument.presentation"
1612- || model.mimetype === "application/vnd.ms-powerpoint"
1613- || model.mimetype === "application/vnd.openxmlformats-officedocument.presentationml.presentation")
1614- return "x-office-presentation-symbolic"
1615-
1616- return "package-x-generic-symbolic"
1617- }
1618-
1619- Rectangle {
1620- anchors {
1621- right: parent.right
1622- bottom: parent.bottom
1623- }
1624-
1625- width: units.gu(2.5)
1626- height: units.gu(2.5)
1627-
1628- visible: model.isFromExternalStorage
1629- color: mainView.backgroundColor
1630-
1631- Icon {
1632- anchors.fill: parent
1633- name: "sdcard-symbolic"
1634- }
1635- }
1636 }
1637
1638 Column {
1639 Layout.fillWidth: true
1640
1641- Label {
1642- text: model.name
1643- wrapMode: Text.Wrap
1644- width: parent.width
1645-
1646- color: UbuntuColors.midAubergine
1647- }
1648-
1649 RowLayout {
1650 width: parent.width
1651-
1652 Label {
1653- text: formattedDateTime()
1654- fontSize: "small"
1655-
1656+ text: model.name
1657+ //wrapMode: Text.Wrap
1658+ elide: Text.ElideRight
1659+ color: UbuntuColors.midAubergine
1660 Layout.fillWidth: true
1661 }
1662-
1663 Label {
1664 text: Utils.printSize(i18n, model.size)
1665 fontSize: "small"
1666 }
1667 }
1668+
1669+ RowLayout {
1670+ width: parent.width
1671+ Label {
1672+ text: internal.formattedDateTime()
1673+ fontSize: "small"
1674+
1675+ Layout.fillWidth: true
1676+ }
1677+ Icon {
1678+ width: units.gu(2); height: width
1679+ name: "sdcard-symbolic"
1680+ visible: model.isFromExternalStorage
1681+ }
1682+ }
1683+ }
1684+ }
1685+
1686+ DocumentDelegateActions { id: documentDelegateActions }
1687+
1688+ QtObject {
1689+ id: internal
1690+
1691+ function formattedDateTime() {
1692+ var date = new Date(model.date)
1693+ var diff = model.dateDiff
1694+
1695+ if (sortSettings.sortMode !== 0) { // Sort is not "by date"
1696+ switch(diff) {
1697+ case DocumentsModel.Today:
1698+ // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1699+ // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1700+ return i18n.tr("Today, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
1701+
1702+ case DocumentsModel.Yesterday:
1703+ // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
1704+ // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
1705+ return i18n.tr("Yesterday, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
1706+
1707+ case DocumentsModel.LastWeek:
1708+ case DocumentsModel.LastMonth:
1709+ case DocumentsModel.Earlier:
1710+ // TRANSLATORS: this is a datetime formatting string,
1711+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1712+ return Qt.formatDateTime(date, i18n.tr("yyyy/MM/dd hh:mm"))
1713+ }
1714+ }
1715+
1716+ else { //
1717+ switch(diff) { // Sort "by date"
1718+ case DocumentsModel.Today:
1719+ case DocumentsModel.Yesterday:
1720+ return Qt.formatDateTime(date, Qt.locale().timeFormat(Locale.ShortFormat))
1721+
1722+ case DocumentsModel.LastWeek:
1723+ // TRANSLATORS: this is a datetime formatting string,
1724+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1725+ return Qt.formatDateTime(date, i18n.tr("dddd, hh:mm"))
1726+
1727+ case DocumentsModel.LastMonth:
1728+ case DocumentsModel.Earlier:
1729+ // TRANSLATORS: this is a datetime formatting string,
1730+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
1731+ return Qt.formatDateTime(date, i18n.tr("yyyy/MM/dd hh:mm"))
1732+ }
1733+ }
1734 }
1735 }
1736 }
1737
1738=== modified file 'src/app/qml/documentPage/DocumentListView.qml'
1739--- src/app/qml/documentPage/DocumentListView.qml 2015-09-19 17:51:46 +0000
1740+++ src/app/qml/documentPage/DocumentListView.qml 2015-10-20 18:22:30 +0000
1741@@ -14,42 +14,17 @@
1742 along with this program. If not, see http://www.gnu.org/licenses/.
1743 */
1744
1745-import QtQuick 2.0
1746-import Ubuntu.Components 1.1
1747-import Ubuntu.Components.ListItems 1.0 as ListItem
1748-import DocumentViewer 1.0
1749+import QtQuick 2.4
1750+import Ubuntu.Components 1.2
1751
1752 import "../upstreamComponents"
1753
1754-MultipleSelectionListView {
1755+ListView {
1756 id: documentListView
1757-
1758 anchors { fill: parent; margins: units.gu(0.5) }
1759 clip: true
1760
1761- property var _currentSwipedItem: null
1762-
1763- function _updateSwipeState(item)
1764- {
1765- if (item.swipping) {
1766- return
1767- }
1768-
1769- if (item.swipeState !== "Normal") {
1770- if (documentListView._currentSwipedItem !== item) {
1771- if (documentListView._currentSwipedItem) {
1772- documentListView._currentSwipedItem.resetSwipe()
1773- }
1774- documentListView._currentSwipedItem = item
1775- }
1776- } else if (item.swipeState !== "Normal"
1777- && documentListView._currentSwipedItem === item) {
1778- documentListView._currentSwipedItem = null
1779- }
1780- }
1781-
1782- // We allow multiple selection both in selection and pick mode.
1783- multipleSelection: {
1784+ function isMultipleSelection() {
1785 // No active transfer, then we're in selection mode.
1786 if (!contentHubProxy.activeTransfer)
1787 return true
1788@@ -58,127 +33,64 @@
1789 return contentHubProxy.multipleSelectionType
1790 }
1791
1792- listDelegate: DocumentListDelegate {
1793- id: delegate
1794-
1795- property var removalAnimation
1796-
1797- function remove() {
1798- removalAnimation.start()
1799- }
1800-
1801- selectionMode: documentListView.isInSelectionMode
1802- selected: documentListView.isSelected(delegate)
1803-
1804- onSwippingChanged: {
1805- _updateSwipeState(delegate)
1806- }
1807-
1808- onSwipeStateChanged: {
1809- _updateSwipeState(delegate)
1810- }
1811-
1812- ListView.onRemove: ScriptAction {
1813- script: {
1814- if (_currentSwipedItem
1815- === delegate) {
1816- _currentSwipedItem = null
1817- }
1818- }
1819- }
1820-
1821- removalAnimation: SequentialAnimation {
1822- alwaysRunToEnd: true
1823-
1824- PropertyAction {
1825- target: delegate
1826- property: "ListView.delayRemove"
1827- value: true
1828- }
1829-
1830- UbuntuNumberAnimation {
1831- target: delegate
1832- property: "height"
1833- to: 0
1834- }
1835-
1836- PropertyAction {
1837- target: delegate
1838- property: "ListView.delayRemove"
1839- value: false
1840- }
1841-
1842- ScriptAction {
1843- script: {
1844- var filePath = d.folderModel.get(index, "filePath")
1845- Storage.rm(filePath)
1846- }
1847- }
1848- }
1849-
1850- onItemClicked: {
1851- if(documentListView.isInSelectionMode) {
1852- if(!documentListView.selectItem(delegate)) {
1853- documentListView.deselectItem(delegate)
1854- }
1855- return
1856- }
1857-
1858- else {
1859- mainView.openDocument(model.path)
1860- }
1861- }
1862-
1863- onItemPressAndHold: {
1864- if (!documentListView.isInSelectionMode) {
1865- documentListView.startSelection()
1866- documentListView.selectItem(delegate)
1867- }
1868- }
1869- }
1870-
1871- listModel: folderModel
1872-
1873- section.property: {
1874- switch (sortSettings.sortMode) {
1875- case 0: // sort by date
1876- return "dateDiff"
1877- case 1: // sort by name
1878- return "name"
1879- default: // sort by size -> do not show section header
1880- return ""
1881- }
1882- }
1883-
1884- section.criteria: {
1885- if (sortSettings.sortMode === 1) // sort by name
1886- return ViewSection.FirstCharacter
1887-
1888- return ViewSection.FullString
1889- }
1890-
1891- section.delegate: ListItem.Header {
1892- text: {
1893+ function clearSelection() {
1894+ ViewItems.selectedIndices = []
1895+ }
1896+
1897+ function selectAll() {
1898+ clearSelection()
1899+
1900+ for (var i=0; i < model.count; i++) {
1901+ ViewItems.selectedIndices.push(i)
1902+ }
1903+ }
1904+
1905+ function cancelSelection() {
1906+ clearSelection()
1907+ ViewItems.selectMode = false
1908+ }
1909+
1910+ function startSelection() {
1911+ ViewItems.selectMode = true
1912+ }
1913+
1914+ model: folderModel
1915+ delegate: DocumentListDelegate {
1916+ onClicked: {
1917+ if (selectMode) {
1918+ if (!isMultipleSelection())
1919+ clearSelection()
1920+
1921+ selected = !selected
1922+ return;
1923+ }
1924+
1925+ mainView.openDocument(model.path)
1926+ }
1927+
1928+ onPressAndHold: {
1929+ ListView.view.ViewItems.selectMode = !ListView.view.ViewItems.selectMode
1930+ selected = true
1931+ }
1932+ }
1933+
1934+ section {
1935+ delegate: SectionHeader { }
1936+ property: {
1937+ switch (sortSettings.sortMode) {
1938+ case 0: // sort by date
1939+ return "dateDiff"
1940+ case 1: // sort by name
1941+ return "name"
1942+ default: // sort by size -> do not show section header
1943+ return ""
1944+ }
1945+ }
1946+ criteria: {
1947 if (sortSettings.sortMode === 1) // sort by name
1948- return section.toUpperCase()
1949-
1950- if (sortSettings.sortMode === 0) { // sort by date
1951- if (section == DocumentsModel.Today)
1952- return i18n.tr("Today")
1953-
1954- if (section == DocumentsModel.Yesterday)
1955- return i18n.tr("Yesterday")
1956-
1957- if (section == DocumentsModel.LastWeek)
1958- return i18n.tr("Earlier this week")
1959-
1960- if (section == DocumentsModel.LastMonth)
1961- return i18n.tr("Earlier this month")
1962-
1963- return i18n.tr("Even earlier...")
1964- }
1965-
1966- return ""
1967+ return ViewSection.FirstCharacter
1968+
1969+ return ViewSection.FullString
1970 }
1971 }
1972
1973@@ -189,11 +101,8 @@
1974
1975 Connections {
1976 target: sortSettings
1977-
1978- onSortModeChanged: {
1979- documentListView.positionViewAtBeginning()
1980- }
1981+ onSortModeChanged: documentListView.positionViewAtBeginning()
1982 }
1983
1984- Component.onCompleted: { if (mainView.pickMode) documentListView.startSelection(); }
1985+ Component.onCompleted: if (mainView.pickMode) documentListView.startSelection()
1986 }
1987
1988=== modified file 'src/app/qml/documentPage/DocumentPage.qml'
1989--- src/app/qml/documentPage/DocumentPage.qml 2015-09-11 14:48:57 +0000
1990+++ src/app/qml/documentPage/DocumentPage.qml 2015-10-20 18:22:30 +0000
1991@@ -14,13 +14,12 @@
1992 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1993 */
1994
1995-import QtQuick 2.0
1996-import Ubuntu.Components 1.1
1997+import QtQuick 2.4
1998+import Ubuntu.Components 1.2
1999 import Qt.labs.settings 1.0
2000
2001 Page {
2002 id: documentPage
2003-
2004 title: i18n.tr("Documents")
2005 flickable: null
2006
2007@@ -41,12 +40,23 @@
2008
2009 Loader {
2010 id: viewLoader
2011- anchors.fill: parent
2012-
2013- source: (folderModel.count === 0) ? documentPage.state == "search" ? Qt.resolvedUrl("./SearchEmptyState.qml")
2014- : Qt.resolvedUrl("./DocumentEmptyState.qml")
2015- : useGridView ? Qt.resolvedUrl("./DocumentGridView.qml")
2016- : Qt.resolvedUrl("./DocumentListView.qml")
2017+
2018+ width: Math.min(units.gu(80), parent.width)
2019+ anchors {
2020+ top: parent.top
2021+ bottom: parent.bottom
2022+ horizontalCenter: parent.horizontalCenter
2023+ }
2024+
2025+ source: {
2026+ if (folderModel.count === 0) {
2027+ return documentPage.state == "search"
2028+ ? Qt.resolvedUrl("SearchEmptyState.qml")
2029+ : Qt.resolvedUrl("BrowserEmptyState.qml")
2030+ }
2031+
2032+ return Qt.resolvedUrl("DocumentListView.qml")
2033+ }
2034 }
2035
2036 // *** HEADER ***
2037@@ -54,7 +64,7 @@
2038 DocumentPageDefaultHeader {
2039 name: "default"
2040 targetPage: documentPage
2041- when: !mainView.pickMode && !viewLoader.item.isInSelectionMode && !documentPage.searchMode
2042+ when: !mainView.pickMode && !viewLoader.item.ViewItems.selectMode && !documentPage.searchMode
2043 },
2044
2045 DocumentPagePickModeHeader {
2046@@ -66,13 +76,13 @@
2047 DocumentPageSelectionModeHeader {
2048 name: "selection"
2049 targetPage: documentPage
2050- when: !mainView.pickMode && viewLoader.item.isInSelectionMode
2051+ when: !mainView.pickMode && viewLoader.item.ViewItems.selectMode
2052 },
2053
2054 DocumentPageSearchHeader {
2055 name: "search"
2056 targetPage: documentPage
2057- when: !mainView.pickMode && !viewLoader.item.isInSelectionMode && documentPage.searchMode
2058+ when: !mainView.pickMode && !viewLoader.item.ViewItems.selectMode && documentPage.searchMode
2059 }
2060 ]
2061
2062
2063=== modified file 'src/app/qml/documentPage/DocumentPageDefaultHeader.qml'
2064--- src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-06-12 14:47:40 +0000
2065+++ src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-10-20 18:22:30 +0000
2066@@ -14,8 +14,8 @@
2067 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2068 */
2069
2070-import QtQuick 2.3
2071-import Ubuntu.Components 1.1
2072+import QtQuick 2.4
2073+import Ubuntu.Components 1.2
2074 import Ubuntu.Components.Popups 1.0
2075
2076 PageHeadState {
2077@@ -29,25 +29,23 @@
2078 text: i18n.tr("Search...")
2079 iconName: "search"
2080 onTriggered: targetPage.searchMode = true
2081-
2082 visible: folderModel.count !== 0
2083 },
2084
2085 Action {
2086 text: i18n.tr("Sorting settings...")
2087- iconSource: Qt.resolvedUrl("../../graphics/settings_alt.svg")
2088+ iconName: "settings"
2089 onTriggered: PopupUtils.open(Qt.resolvedUrl("SortSettingsDialog.qml"))
2090-
2091 visible: folderModel.count !== 0
2092- },
2093+ }
2094
2095+ /*
2096 Action {
2097- id: switchView
2098 text: targetPage.useGridView ? i18n.tr("Switch to single column list") : i18n.tr("Switch to grid")
2099 iconName: targetPage.useGridView ? "view-list-symbolic" : "view-grid-symbolic"
2100 onTriggered: targetPage.useGridView = !targetPage.useGridView
2101-
2102 visible: folderModel.count !== 0
2103 }
2104+ */
2105 ]
2106 }
2107
2108=== modified file 'src/app/qml/documentPage/DocumentPagePickModeHeader.qml'
2109--- src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-09-11 14:48:57 +0000
2110+++ src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-10-20 18:22:30 +0000
2111@@ -14,8 +14,8 @@
2112 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2113 */
2114
2115-import QtQuick 2.3
2116-import Ubuntu.Components 1.1
2117+import QtQuick 2.4
2118+import Ubuntu.Components 1.2
2119 import Ubuntu.Content 1.1
2120
2121 PageHeadState {
2122@@ -55,10 +55,10 @@
2123 return;
2124
2125 var urlList = []
2126- var items = documentPage.view.item.selectedItems;
2127+ var indices = documentPage.view.item.selectedIndices;
2128
2129- for (var i=0; i < items.count; i++) {
2130- urlList.push("file://" + items.get(i).model.path);
2131+ for (var i=0; i < indices.length; i++) {
2132+ urlList.push("file://" + folderModel.get(i).path);
2133 }
2134
2135 contentHubProxy.activeTransfer.items = urlList
2136
2137=== modified file 'src/app/qml/documentPage/DocumentPageSearchHeader.qml'
2138--- src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-06-12 14:04:40 +0000
2139+++ src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-10-20 18:22:30 +0000
2140@@ -14,8 +14,8 @@
2141 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2142 */
2143
2144-import QtQuick 2.3
2145-import Ubuntu.Components 1.1
2146+import QtQuick 2.4
2147+import Ubuntu.Components 1.2
2148
2149 PageHeadState {
2150 id: rootItem
2151
2152=== modified file 'src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml'
2153--- src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-03-04 17:44:36 +0000
2154+++ src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-10-20 18:22:30 +0000
2155@@ -14,8 +14,8 @@
2156 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2157 */
2158
2159-import QtQuick 2.3
2160-import Ubuntu.Components 1.1
2161+import QtQuick 2.4
2162+import Ubuntu.Components 1.2
2163 import Ubuntu.Components.Popups 1.0
2164
2165 import "../upstreamComponents"
2166@@ -24,9 +24,10 @@
2167 id: rootItem
2168
2169 property Page targetPage
2170-
2171 head: targetPage.head
2172
2173+ property bool selectedAll: viewLoader.item.ViewItems.selectedIndices.length == viewLoader.item.count
2174+
2175 backAction: Action {
2176 iconName: "close"
2177 text: i18n.tr("Close")
2178@@ -35,61 +36,40 @@
2179 }
2180 }
2181
2182- contents: Loader {
2183- id: selectionStateLoader
2184- active: documentPage.state === "selection"
2185- sourceComponent: Item {
2186- HeaderButton {
2187- id: selectButton
2188-
2189- anchors {
2190- right: deleteButton.left
2191- rightMargin: units.gu(1)
2192- }
2193-
2194- text: {
2195- if(viewLoader.item.selectedItems.count === viewLoader.item.count) {
2196- return i18n.tr("Select None")
2197- } else {
2198- return i18n.tr("Select All")
2199- }
2200- }
2201-
2202- iconSource: {
2203- if(viewLoader.item.selectedItems.count === viewLoader.item.count) {
2204- return Qt.resolvedUrl("../../graphics/select-none.svg")
2205- } else {
2206- return Qt.resolvedUrl("../../graphics/select.svg")
2207- }
2208- }
2209-
2210- onTriggered: {
2211- if(viewLoader.item.selectedItems.count === viewLoader.item.count) {
2212- viewLoader.item.clearSelection()
2213- } else {
2214- viewLoader.item.selectAll()
2215- }
2216- }
2217- }
2218-
2219- HeaderButton {
2220- id: deleteButton
2221-
2222- anchors.right: parent.right
2223- anchors.rightMargin: units.gu(2)
2224-
2225- iconName: "delete"
2226- text: i18n.tr("Delete")
2227- enabled: viewLoader.item.selectedItems.count !== 0
2228-
2229- onTriggered: {
2230- PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"), documentPage)
2231- }
2232- }
2233- }
2234-
2235- height: parent ? parent.height : undefined
2236- anchors.right: parent ? parent.right: undefined
2237+ actions: [
2238+ Action {
2239+ iconName: selectedAll ? "select-none" : "select"
2240+ text: selectedAll ? i18n.tr("Select None") : i18n.tr("Select All")
2241+
2242+ onTriggered: {
2243+ if (selectedAll) {
2244+ viewLoader.item.clearSelection()
2245+ } else {
2246+ viewLoader.item.selectAll()
2247+ }
2248+ }
2249+ },
2250+
2251+ Action {
2252+ iconName: "delete"
2253+ text: i18n.tr("Delete")
2254+ enabled: viewLoader.item.ViewItems.selectedIndices.length !== 0
2255+
2256+ onTriggered: PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"), documentPage)
2257+ }
2258+ ]
2259+
2260+ // WORKAROUND: "preset" property of PageHeadConfiguration is still not
2261+ // exposed in PageHeadState.
2262+ contents: Item {
2263+ Connections {
2264+ target: targetPage
2265+ onStateChanged: {
2266+ if (targetPage.state === "selection")
2267+ head.preset = "select"
2268+ else
2269+ head.preset = ""
2270+ }
2271+ }
2272 }
2273-
2274 }
2275
2276=== modified file 'src/app/qml/documentPage/SearchEmptyState.qml'
2277--- src/app/qml/documentPage/SearchEmptyState.qml 2015-06-10 17:22:28 +0000
2278+++ src/app/qml/documentPage/SearchEmptyState.qml 2015-10-20 18:22:30 +0000
2279@@ -14,7 +14,7 @@
2280 along with this program. If not, see http://www.gnu.org/licenses/.
2281 */
2282
2283-import QtQuick 2.0
2284+import QtQuick 2.4
2285 import "../upstreamComponents"
2286
2287 Item {
2288
2289=== added file 'src/app/qml/documentPage/SectionHeader.qml'
2290--- src/app/qml/documentPage/SectionHeader.qml 1970-01-01 00:00:00 +0000
2291+++ src/app/qml/documentPage/SectionHeader.qml 2015-10-20 18:22:30 +0000
2292@@ -0,0 +1,29 @@
2293+import QtQuick 2.4
2294+import Ubuntu.Components 1.2
2295+import Ubuntu.Components.ListItems 1.0 as ListItem
2296+import DocumentViewer 1.0
2297+
2298+ListItem.Header {
2299+ text: {
2300+ if (sortSettings.sortMode === 1) // sort by name
2301+ return section.toUpperCase()
2302+
2303+ if (sortSettings.sortMode === 0) { // sort by date
2304+ if (section == DocumentsModel.Today)
2305+ return i18n.tr("Today")
2306+
2307+ if (section == DocumentsModel.Yesterday)
2308+ return i18n.tr("Yesterday")
2309+
2310+ if (section == DocumentsModel.LastWeek)
2311+ return i18n.tr("Earlier this week")
2312+
2313+ if (section == DocumentsModel.LastMonth)
2314+ return i18n.tr("Earlier this month")
2315+
2316+ return i18n.tr("Even earlier...")
2317+ }
2318+
2319+ return ""
2320+ }
2321+}
2322
2323=== modified file 'src/app/qml/documentPage/SharePage.qml'
2324--- src/app/qml/documentPage/SharePage.qml 2015-09-09 17:18:12 +0000
2325+++ src/app/qml/documentPage/SharePage.qml 2015-10-20 18:22:30 +0000
2326@@ -14,8 +14,8 @@
2327 along with this program. If not, see http://www.gnu.org/licenses/.
2328 */
2329
2330-import QtQuick 2.3
2331-import Ubuntu.Components 1.1
2332+import QtQuick 2.4
2333+import Ubuntu.Components 1.2
2334 import Ubuntu.Content 1.1
2335
2336 Page {
2337
2338=== modified file 'src/app/qml/documentPage/SortSettingsDialog.qml'
2339--- src/app/qml/documentPage/SortSettingsDialog.qml 2015-07-14 15:43:11 +0000
2340+++ src/app/qml/documentPage/SortSettingsDialog.qml 2015-10-20 18:22:30 +0000
2341@@ -15,8 +15,8 @@
2342 along with this program. If not, see http://www.gnu.org/licenses/.
2343 */
2344
2345-import QtQuick 2.0
2346-import Ubuntu.Components 1.1
2347+import QtQuick 2.4
2348+import Ubuntu.Components 1.2
2349 import Ubuntu.Components.Popups 1.0
2350 import QtQuick.Layouts 1.1
2351
2352@@ -51,6 +51,7 @@
2353
2354 Button {
2355 text: i18n.tr("Close")
2356+ color: UbuntuColors.green
2357 onClicked: PopupUtils.close(sortSettingsDialog)
2358 }
2359 }
2360
2361=== removed file 'src/app/qml/documentPage/TileBase.qml'
2362--- src/app/qml/documentPage/TileBase.qml 2015-07-14 13:20:35 +0000
2363+++ src/app/qml/documentPage/TileBase.qml 1970-01-01 00:00:00 +0000
2364@@ -1,369 +0,0 @@
2365-/*
2366- Copyright (C) 2014, 2015 Canonical Ltd.
2367-
2368- This program is free software: you can redistribute it and/or modify
2369- it under the terms of the GNU General Public License 3 as published by
2370- the Free Software Foundation.
2371-
2372- This program is distributed in the hope that it will be useful,
2373- but WITHOUT ANY WARRANTY; without even the implied warranty of
2374- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2375- GNU General Public License for more details.
2376-
2377- You should have received a copy of the GNU General Public License
2378- along with this program. If not, see http://www.gnu.org/licenses/.
2379-*/
2380-
2381-import QtQuick 2.0
2382-import Ubuntu.Components 1.1
2383-import Ubuntu.Components.Popups 1.0
2384-import Ubuntu.Components.ListItems 1.0 as ListItem
2385-
2386-AbstractButton {
2387- id: root
2388-
2389- property bool selected: false
2390- property bool selectionMode: false
2391-
2392- default property alias content: tileContent.data
2393-
2394- property alias title: titleLabel.text
2395- property alias text: textLabel.text
2396- property alias subText: subTextLabel.text
2397-
2398- // We don't really have swipe gesture here, but we anyway use the same
2399- // properties' name used for UITK1.2 ListItem just for consistency.
2400- property list<Action> trailingActions // Right to Left gesture in ListItem
2401- property list<Action> leadingActions // Left to Right gesture in ListItem
2402-
2403- Rectangle {
2404- id: rect
2405-
2406- anchors { fill: parent; margins: units.gu(0.5) }
2407-
2408- color: Qt.lighter(UbuntuColors.lightGrey)
2409- clip: true
2410-
2411- Item {
2412- id: tileContent
2413-
2414- height: parent.height - captionsLayout.height * 0.3 - units.gu(2)
2415- anchors {
2416- left: parent.left
2417- right: parent.right
2418- verticalCenter: parent.verticalCenter
2419- verticalCenterOffset: - captionsLayout.height * 0.3
2420- }
2421- }
2422-
2423- Loader {
2424- id: overflowButton
2425-
2426- anchors {
2427- right: parent.right
2428- top: parent.top
2429- }
2430-
2431- z: 10
2432-
2433- sourceComponent: actionsOverflowButton
2434-
2435- onStatusChanged: {
2436- if (status === Loader.Ready) {
2437- item.iconName = "contextual-menu"
2438- item.color = UbuntuColors.darkGrey
2439- item.width = overflowButton.width
2440- item.height = overflowButton.height
2441-
2442- item.triggered.connect(function() {
2443- var overflowPanel = PopupUtils.open(actionsOverflowPopoverComponent, item)
2444- item.overflowPanelVisible = overflowPanel.visible;
2445-
2446- overflowPanel.visibleChanged.connect(function() {
2447- item.overflowPanelVisible = overflowPanel.visible
2448- });
2449- });
2450- }
2451- }
2452-
2453- width: units.gu(5)
2454- height: units.gu(5)
2455- visible: rect.state !== "select" && (trailingActions.length > 0 || leadingActions.length > 0)
2456-
2457- Behavior on opacity {
2458- NumberAnimation {
2459- duration: UbuntuAnimation.SnapDuration
2460- }
2461- }
2462- }
2463-
2464- Loader {
2465- id: selectionIcon
2466-
2467- anchors {
2468- right: parent.right
2469- top: parent.top
2470- }
2471-
2472- z: 10
2473-
2474- width: (status === Loader.Ready) ? item.implicitWidth : 0
2475- visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
2476- Behavior on opacity {
2477- NumberAnimation {
2478- duration: UbuntuAnimation.SnapDuration
2479- }
2480- }
2481- }
2482-
2483- // Tile captions
2484- Rectangle {
2485- id: captionsRect
2486-
2487- anchors {
2488- left: parent.left
2489- right: parent.right
2490- bottom: parent.bottom
2491- }
2492-
2493- height: captionsLayout.height + units.gu(1)
2494-
2495- color: UbuntuColors.darkGrey
2496- opacity: 0.75
2497- layer.enabled: true
2498-
2499- Column {
2500- id: captionsLayout
2501- anchors {
2502- left: parent.left;
2503- right: parent.right
2504- verticalCenter: parent.verticalCenter
2505- margins: units.gu(0.5)
2506- }
2507-
2508- Label {
2509- id: titleLabel
2510- color: "white"
2511-
2512- elide: Text.ElideRight
2513- font.weight: Font.DemiBold
2514- fontSize: "small"
2515-
2516- anchors { left: parent.left; right: parent.right }
2517- }
2518-
2519- Label {
2520- id: textLabel
2521- color: "white"
2522- fontSize: "small"
2523-
2524- anchors { left: parent.left; right: parent.right }
2525- }
2526-
2527- Label {
2528- id: subTextLabel
2529- color: "white"
2530- fontSize: "small"
2531-
2532- anchors { left: parent.left; right: parent.right }
2533- }
2534- }
2535- }
2536-
2537- states: [
2538- State {
2539- name: "select"
2540- when: selectionMode || selected
2541- PropertyChanges {
2542- target: selectionIcon
2543- sourceComponent: selectionCheckBox
2544- anchors.margins: units.gu(1)
2545- }
2546- }
2547- ]
2548- }
2549-
2550- // *** COMPONENTS
2551- Component {
2552- id: selectionCheckBox
2553-
2554- CheckBox {
2555- checked: root.selected
2556- width: implicitWidth
2557- // disable item mouse area to avoid conflicts with parent mouse area
2558- __mouseArea.enabled: false
2559- }
2560- }
2561-
2562- Component {
2563- id: actionsOverflowButton
2564-
2565- AbstractButton {
2566- id: button
2567-
2568- property alias color: icon.color
2569- property bool overflowPanelVisible: false
2570-
2571- width: visible ? units.gu(5) : 0
2572- height: parent ? parent.height : undefined
2573- Rectangle {
2574- visible: button.pressed || button.overflowPanelVisible
2575- anchors.fill: parent
2576- color: Theme.palette.selected.background
2577- }
2578-
2579- Icon {
2580- id: icon
2581- anchors.centerIn: parent
2582-
2583- // prevent trying to render the icon with an invalid source
2584- // when the button is invisible by setting width and height to 0
2585- width: visible ? units.gu(2.5) : 0
2586- height: visible ? units.gu(2.5) : 0
2587- source: button.iconSource
2588- color: Qt.rgba(0, 0, 0, 0)
2589- opacity: button.enabled ? 1.0 : 0.3
2590- }
2591-
2592- Component {
2593- id: labelComponent
2594- Label {
2595- id: label
2596- objectName: button.objectName + "_label"
2597- color: button.color
2598- opacity: button.enabled ? 1.0 : 0.3
2599- text: button.text
2600- fontSize: "xx-small"
2601- }
2602- }
2603- Loader {
2604- anchors {
2605- top: icon.bottom
2606- topMargin: units.gu(0.5)
2607- horizontalCenter: parent.horizontalCenter
2608- }
2609- sourceComponent: button.state === "IconAndLabel" ? labelComponent : null
2610- }
2611- }
2612- }
2613-
2614- Component {
2615- id: actionsOverflowPopoverComponent
2616-
2617- Popover {
2618- id: actionsOverflowPopover
2619- property bool square: true
2620- callerMargin: -units.gu(1) + units.dp(4)
2621- contentWidth: units.gu(20)
2622- contentHeight: popoverActionsLayout.height
2623-
2624- Connections {
2625- target: root
2626- onLeadingActionsChanged: {
2627- actionsOverflowPopover.hide();
2628- }
2629- onTrailingActionsChanged: {
2630- actionsOverflowPopover.hide();
2631- }
2632- }
2633-
2634- Column {
2635- id: popoverActionsLayout
2636- anchors {
2637- left: parent.left
2638- top: parent.top
2639- right: parent.right
2640- }
2641- Repeater {
2642- id: overflowTrailingRepeater
2643- model: root.trailingActions
2644-
2645- delegate: overflowPanelDelegate
2646- onItemAdded: {
2647- item.action = model[index]
2648- item.clicked.connect(function() {
2649- actionsOverflowPopover.hide()
2650- })
2651-
2652- item.showDivider = (overflowLeadingRepeater.count === 0) ? (index !== overflowTrailingRepeater.count - 1) : true
2653- }
2654- }
2655-
2656- Repeater {
2657- id: overflowLeadingRepeater
2658- model: root.leadingActions
2659-
2660- delegate: overflowPanelDelegate
2661- onItemAdded: {
2662- item.action = model[index]
2663- item.clicked.connect(function() {
2664- actionsOverflowPopover.hide()
2665- })
2666-
2667- item.showDivider = (index !== overflowLeadingRepeater.count - 1)
2668- }
2669- }
2670- }
2671- }
2672- }
2673-
2674- Component {
2675- id: overflowPanelDelegate
2676-
2677- AbstractButton {
2678- id: rootItem
2679- implicitHeight: units.gu(6) + bottomDividerLine.height
2680- width: parent ? parent.width : units.gu(31)
2681-
2682- property bool showDivider: true
2683- property color foregroundColor: Theme.palette.selected.backgroundText
2684-
2685- Rectangle {
2686- visible: parent.pressed
2687- anchors {
2688- left: parent.left
2689- right: parent.right
2690- top: parent.top
2691- }
2692- height: parent.height - bottomDividerLine.height
2693- color: Theme.palette.selected.background
2694- }
2695-
2696- Icon {
2697- id: actionIcon
2698- source: action.iconSource
2699- color: rootItem.foregroundColor
2700- anchors {
2701- verticalCenter: parent.verticalCenter
2702- verticalCenterOffset: units.dp(-1)
2703- left: parent.left
2704- leftMargin: units.gu(2)
2705- }
2706- width: units.gu(2)
2707- height: units.gu(2)
2708- opacity: action.enabled ? 1.0 : 0.5
2709- }
2710-
2711- Label {
2712- anchors {
2713- verticalCenter: parent.verticalCenter
2714- verticalCenterOffset: units.dp(-1)
2715- left: actionIcon.right
2716- leftMargin: units.gu(2)
2717- right: parent.right
2718- }
2719- fontSize: "small"
2720- elide: Text.ElideRight
2721- text: action.text
2722- color: rootItem.foregroundColor
2723- opacity: action.enabled ? 1.0 : 0.5
2724- }
2725-
2726- ListItem.ThinDivider {
2727- id: bottomDividerLine
2728- anchors.bottom: parent.bottom
2729- visible: rootItem.showDivider
2730- }
2731- }
2732- }
2733-}
2734
2735=== modified file 'src/app/qml/loView/KeybHelper.js'
2736--- src/app/qml/loView/KeybHelper.js 2015-09-23 16:48:39 +0000
2737+++ src/app/qml/loView/KeybHelper.js 2015-10-20 18:22:30 +0000
2738@@ -18,7 +18,7 @@
2739 var pixelDiff = 5;
2740
2741 var view = loPageContentLoader.item.loView
2742- var isPresentation = view.document.documentType === LO.Document.PresentationDocument
2743+ var isPresentation = view.document.documentType === LibreOffice.Document.PresentationDocument
2744
2745 if (event.key == Qt.Key_PageUp) {
2746 if (isPresentation)
2747
2748=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
2749--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-10-11 12:49:58 +0000
2750+++ src/app/qml/loView/LOViewDefaultHeader.qml 2015-10-20 18:22:30 +0000
2751@@ -14,8 +14,8 @@
2752 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2753 */
2754
2755-import QtQuick 2.3
2756-import Ubuntu.Components 1.1
2757+import QtQuick 2.4
2758+import Ubuntu.Components 1.2
2759 import Ubuntu.Components.Popups 1.0
2760 import DocumentViewer.LibreOffice 1.0 as LibreOffice
2761
2762
2763=== modified file 'src/app/qml/loView/LOViewGotoDialog.qml'
2764--- src/app/qml/loView/LOViewGotoDialog.qml 2015-10-10 12:13:40 +0000
2765+++ src/app/qml/loView/LOViewGotoDialog.qml 2015-10-20 18:22:30 +0000
2766@@ -14,9 +14,10 @@
2767 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2768 */
2769
2770-import QtQuick 2.3
2771-import Ubuntu.Components 1.1
2772+import QtQuick 2.4
2773+import Ubuntu.Components 1.2
2774 import Ubuntu.Components.Popups 1.0
2775+import QtQuick.Layouts 1.1
2776
2777 // TODO: Use page breaks detection, when LibreOfficeKit will support it.
2778
2779@@ -41,18 +42,28 @@
2780 Component.onCompleted: forceActiveFocus()
2781 }
2782
2783- Button {
2784- objectName:"GOButton"
2785- text: i18n.tr("GO!")
2786- color: UbuntuColors.green
2787-
2788- enabled: goToPageTextField.acceptableInput
2789- onClicked: goToPage()
2790- }
2791-
2792- Button {
2793- text: i18n.tr("Cancel")
2794- onClicked: PopupUtils.close(goToPageDialog)
2795+ RowLayout {
2796+ anchors {
2797+ left: parent.left
2798+ right: parent.right
2799+ margins: units.gu(-1)
2800+ }
2801+
2802+ Button {
2803+ text: i18n.tr("Cancel")
2804+ onClicked: PopupUtils.close(goToPageDialog)
2805+ Layout.fillWidth: true
2806+ }
2807+
2808+ Button {
2809+ objectName:"GOButton"
2810+ text: i18n.tr("GO!")
2811+ color: UbuntuColors.green
2812+ Layout.fillWidth: true
2813+
2814+ enabled: goToPageTextField.acceptableInput
2815+ onClicked: goToPage()
2816+ }
2817 }
2818
2819 function goToPage() {
2820
2821=== modified file 'src/app/qml/loView/LOViewPage.qml'
2822--- src/app/qml/loView/LOViewPage.qml 2015-10-11 11:27:29 +0000
2823+++ src/app/qml/loView/LOViewPage.qml 2015-10-20 18:22:30 +0000
2824@@ -14,10 +14,10 @@
2825 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2826 */
2827
2828-import QtQuick 2.3
2829-import Ubuntu.Components 1.1
2830+import QtQuick 2.4
2831+import Ubuntu.Components 1.2
2832 import Ubuntu.Layouts 1.0
2833-import DocumentViewer.LibreOffice 1.0 as LO
2834+import DocumentViewer.LibreOffice 1.0 as LibreOffice
2835
2836 import "../upstreamComponents"
2837
2838@@ -37,7 +37,7 @@
2839 return false
2840
2841 // else
2842- return loPageContentLoader.item.loDocument.documentType == LO.Document.PresentationDocument && !wideWindow
2843+ return loPageContentLoader.item.loDocument.documentType == LibreOffice.Document.PresentationDocument && !wideWindow
2844 }
2845
2846 Loader {
2847@@ -50,7 +50,7 @@
2848 onLoaded: {
2849 if (loaded) {
2850 // FIXME: At the moment don't hide header if the document is a presentation
2851- var isPresentation = (item.loDocument.documentType === LO.Document.PresentationDocument)
2852+ var isPresentation = (item.loDocument.documentType === LibreOffice.Document.PresentationDocument)
2853 loPage.flickable = isPresentation ? null : item.loView
2854
2855 loPage.bottomEdgePageComponent = item.bottomEdgePartsPage
2856@@ -100,7 +100,7 @@
2857 }
2858
2859 model: loView.partsModel
2860- visible: loDocument.documentType == LO.Document.PresentationDocument
2861+ visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
2862 width: visible ? units.gu(40) : 0
2863 }
2864
2865@@ -125,7 +125,7 @@
2866
2867 Item {
2868 id: bottomBarLayoutItem
2869- visible: loDocument.documentType == LO.Document.PresentationDocument
2870+ visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
2871 height: visible ? units.gu(5) : 0
2872 anchors {
2873 left: parent.left
2874@@ -139,7 +139,7 @@
2875 }
2876 ]
2877
2878- LO.Viewer {
2879+ LibreOffice.Viewer {
2880 id: loView
2881 objectName: "loView"
2882 Layouts.item: "loView"
2883@@ -173,7 +173,7 @@
2884 SlideControllerPanel {
2885 id: bottomBar
2886 Layouts.item: "bottomBar"
2887- visible: loDocument.documentType == LO.Document.PresentationDocument
2888+ visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
2889 height: visible ? units.gu(5) : 0
2890 anchors {
2891 left: parent.left
2892
2893=== modified file 'src/app/qml/loView/LOViewZoomHeader.qml'
2894--- src/app/qml/loView/LOViewZoomHeader.qml 2015-09-22 19:02:46 +0000
2895+++ src/app/qml/loView/LOViewZoomHeader.qml 2015-10-20 18:22:30 +0000
2896@@ -14,8 +14,8 @@
2897 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2898 */
2899
2900-import QtQuick 2.3
2901-import Ubuntu.Components 1.1
2902+import QtQuick 2.4
2903+import Ubuntu.Components 1.2
2904 import QtQuick.Layouts 1.1
2905 import Ubuntu.Components.Popups 1.0
2906
2907
2908=== modified file 'src/app/qml/loView/PanelButton.qml'
2909--- src/app/qml/loView/PanelButton.qml 2015-09-14 18:59:09 +0000
2910+++ src/app/qml/loView/PanelButton.qml 2015-10-20 18:22:30 +0000
2911@@ -14,8 +14,8 @@
2912 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2913 */
2914
2915-import QtQuick 2.3
2916-import Ubuntu.Components 1.1
2917+import QtQuick 2.4
2918+import Ubuntu.Components 1.2
2919
2920 AbstractButton {
2921 width: units.gu(4); height: parent.height
2922
2923=== modified file 'src/app/qml/loView/PartsView.qml'
2924--- src/app/qml/loView/PartsView.qml 2015-10-11 11:27:29 +0000
2925+++ src/app/qml/loView/PartsView.qml 2015-10-20 18:22:30 +0000
2926@@ -14,13 +14,11 @@
2927 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2928 */
2929
2930-import QtQuick 2.3
2931-import Ubuntu.Components 1.1
2932+import QtQuick 2.4
2933+import Ubuntu.Components 1.2
2934 import QtQuick.Layouts 1.1
2935 import DocumentViewer.LibreOffice 1.0 as LibreOffice
2936
2937-import "../upstreamComponents"
2938-
2939 ListView {
2940 id: view
2941 objectName: "view"
2942@@ -31,7 +29,7 @@
2943 currentIndex: view.model ? loView.document.currentPart : -1
2944 highlightMoveDuration: UbuntuAnimation.SnapDuration
2945
2946- delegate: ListItemWithActions {
2947+ delegate: ListItem {
2948 id: delegate
2949
2950 width: parent.width
2951@@ -56,7 +54,11 @@
2952 }
2953
2954 RowLayout {
2955- anchors.fill: parent
2956+ anchors {
2957+ fill: parent
2958+ leftMargin: units.gu(1)
2959+ rightMargin: units.gu(1)
2960+ }
2961 spacing: units.gu(1)
2962
2963 Image {
2964@@ -74,13 +76,13 @@
2965 wrapMode: Text.WordWrap
2966 text: model.name
2967 color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
2968- : Theme.palette.selected.backgroundText
2969+ : Theme.palette.selected.backgroundText
2970 }
2971
2972 Label {
2973 text: model.index + 1
2974 color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
2975- : Theme.palette.selected.backgroundText
2976+ : Theme.palette.selected.backgroundText
2977 }
2978 }
2979 }
2980
2981=== modified file 'src/app/qml/loView/SlideControllerPanel.qml'
2982--- src/app/qml/loView/SlideControllerPanel.qml 2015-09-26 13:46:07 +0000
2983+++ src/app/qml/loView/SlideControllerPanel.qml 2015-10-20 18:22:30 +0000
2984@@ -14,8 +14,8 @@
2985 * along with this program. If not, see <http://www.gnu.org/licenses/>.
2986 */
2987
2988-import QtQuick 2.3
2989-import Ubuntu.Components 1.1
2990+import QtQuick 2.4
2991+import Ubuntu.Components 1.2
2992 import QtQuick.Layouts 1.1
2993 import Ubuntu.Components.ListItems 1.0 as ListItems
2994
2995
2996=== modified file 'src/app/qml/loView/ZoomSelector.qml'
2997--- src/app/qml/loView/ZoomSelector.qml 2015-09-22 19:02:46 +0000
2998+++ src/app/qml/loView/ZoomSelector.qml 2015-10-20 18:22:30 +0000
2999@@ -14,8 +14,8 @@
3000 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3001 */
3002
3003-import QtQuick 2.3
3004-import Ubuntu.Components 1.1
3005+import QtQuick 2.4
3006+import Ubuntu.Components 1.2
3007 import Ubuntu.Components.Popups 1.0
3008 import DocumentViewer.LibreOffice 1.0 as LibreOffice
3009
3010
3011=== modified file 'src/app/qml/pdfView/PdfContentsPage.qml'
3012--- src/app/qml/pdfView/PdfContentsPage.qml 2015-05-02 14:45:06 +0000
3013+++ src/app/qml/pdfView/PdfContentsPage.qml 2015-10-20 18:22:30 +0000
3014@@ -15,8 +15,8 @@
3015 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3016 */
3017
3018-import QtQuick 2.0
3019-import Ubuntu.Components 1.1
3020+import QtQuick 2.4
3021+import Ubuntu.Components 1.2
3022 import QtQuick.Layouts 1.1
3023
3024 import "../upstreamComponents"
3025@@ -69,31 +69,34 @@
3026
3027 model: poppler.tocModel
3028
3029- delegate: ListItemWithActions {
3030+ delegate: ListItem {
3031 id: delegate
3032 objectName: "delegate" + index
3033
3034- width: parent.width
3035- height: (model.level === 0) ? units.gu(7) : units.gu(6)
3036-
3037- // Don't use 'selected' property here, since it shows a CheckBox
3038- color: (view.currentIndex == model.index) ? Qt.lighter(UbuntuColors.lightGrey)
3039- : Theme.palette.normal.background
3040-
3041- AbstractButton {
3042- objectName: "abstractbutton"
3043+ anchors {
3044+ left: parent.left; right: parent.right
3045+ leftMargin: units.gu(2) + (model.level * units.gu(2))
3046+ rightMargin: units.gu(2)
3047+ }
3048+
3049+ onClicked: {
3050+ pdfView.positionAtIndex(model.pageIndex);
3051+ pageStack.pop();
3052+ }
3053+
3054+ // Highlighted property of ListItem is read-only. In order to
3055+ // provide an highlight for the current page, we need to duplicate
3056+ // the overlay.
3057+ Rectangle {
3058 anchors.fill: parent
3059-
3060- onClicked: {
3061- pdfView.positionAtIndex(model.pageIndex);
3062- pageStack.pop();
3063- }
3064+ color: Qt.rgba(0, 0, 0, 0.05)
3065+ visible: view.currentIndex == model.index
3066 }
3067
3068 RowLayout {
3069 anchors {
3070 fill: parent
3071- leftMargin: units.gu(1) + (units.gu(2) * model.level)
3072+ leftMargin: units.gu(1)
3073 rightMargin: units.gu(1)
3074 }
3075
3076@@ -107,31 +110,35 @@
3077 elide: Text.ElideRight
3078
3079 font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
3080- color: (model.level === 0) ? UbuntuColors.midAubergine
3081- : Theme.palette.selected.backgroundText
3082+ color: (model.level == 0) ? UbuntuColors.midAubergine
3083+ : Theme.palette.selected.backgroundText
3084+ }
3085+
3086+ /*
3087+ TODO: Needs UX team's review.
3088+ UX specifications for ListItem suggest to use a "tick" icon
3089+ as indicator for a selected state.
3090+ This currently looks a bit redundant, since we already
3091+ use a grey overlay (see above).
3092+ */
3093+ Icon {
3094+ Layout.preferredHeight: units.gu(2)
3095+ Layout.preferredWidth: units.gu(2)
3096+ name: "tick"
3097+ color: UbuntuColors.green
3098+ visible: view.currentIndex == model.index
3099 }
3100
3101 Label {
3102 objectName: "pageindex"
3103 text: model.pageIndex + 1
3104 font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
3105- color: (model.level === 0) ? UbuntuColors.midAubergine
3106- : Theme.palette.selected.backgroundText
3107- }
3108- }
3109-
3110- Rectangle {
3111- anchors {
3112- left: parent.left
3113- right: parent.right
3114- bottom: parent.bottom
3115- }
3116-
3117- height: units.gu(0.1)
3118- visible: model.level == 0
3119- color: (view.currentIndex === model.index) ? "transparent"
3120- : UbuntuColors.midAubergine
3121+ color: (model.level == 0) ? UbuntuColors.midAubergine
3122+ : Theme.palette.selected.backgroundText
3123+ }
3124 }
3125 }
3126 }
3127+
3128+ Scrollbar { flickableItem: view }
3129 }
3130
3131=== modified file 'src/app/qml/pdfView/PdfView.qml'
3132--- src/app/qml/pdfView/PdfView.qml 2015-10-12 19:03:24 +0000
3133+++ src/app/qml/pdfView/PdfView.qml 2015-10-20 18:22:30 +0000
3134@@ -14,8 +14,8 @@
3135 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3136 */
3137
3138-import QtQuick 2.3
3139-import Ubuntu.Components 1.1
3140+import QtQuick 2.4
3141+import Ubuntu.Components 1.2
3142 import DocumentViewer.PDF 1.0 as PDF
3143
3144 import "../common/utils.js" as Utils
3145
3146=== modified file 'src/app/qml/pdfView/PdfViewDefaultHeader.qml'
3147--- src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-03-26 13:58:31 +0000
3148+++ src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-10-20 18:22:30 +0000
3149@@ -14,8 +14,8 @@
3150 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3151 */
3152
3153-import QtQuick 2.3
3154-import Ubuntu.Components 1.1
3155+import QtQuick 2.4
3156+import Ubuntu.Components 1.2
3157 import QtQuick.Layouts 1.1
3158 import Ubuntu.Components.Popups 1.0
3159
3160
3161=== modified file 'src/app/qml/pdfView/PdfViewDelegate.qml'
3162--- src/app/qml/pdfView/PdfViewDelegate.qml 2015-02-13 15:30:01 +0000
3163+++ src/app/qml/pdfView/PdfViewDelegate.qml 2015-10-20 18:22:30 +0000
3164@@ -13,8 +13,8 @@
3165 * You should have received a copy of the GNU General Public License
3166 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3167 */
3168-import QtQuick 2.3
3169-import Ubuntu.Components 1.1
3170+import QtQuick 2.4
3171+import Ubuntu.Components 1.2
3172
3173 Rectangle {
3174 id: pdfPage
3175
3176=== modified file 'src/app/qml/pdfView/PdfViewGotoDialog.qml'
3177--- src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-03-03 15:41:11 +0000
3178+++ src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-10-20 18:22:30 +0000
3179@@ -14,9 +14,10 @@
3180 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3181 */
3182
3183-import QtQuick 2.3
3184-import Ubuntu.Components 1.1
3185+import QtQuick 2.4
3186+import Ubuntu.Components 1.2
3187 import Ubuntu.Components.Popups 1.0
3188+import QtQuick.Layouts 1.1
3189
3190 Dialog {
3191 id: goToPageDialog
3192@@ -39,18 +40,28 @@
3193 Component.onCompleted: forceActiveFocus()
3194 }
3195
3196- Button {
3197- objectName:"GOButton"
3198- text: i18n.tr("GO!")
3199- color: UbuntuColors.green
3200-
3201- enabled: goToPageTextField.acceptableInput
3202- onClicked: goToPage()
3203- }
3204-
3205- Button {
3206- text: i18n.tr("Cancel")
3207- onClicked: PopupUtils.close(goToPageDialog)
3208+ RowLayout {
3209+ anchors {
3210+ left: parent.left
3211+ right: parent.right
3212+ margins: units.gu(-1)
3213+ }
3214+
3215+ Button {
3216+ text: i18n.tr("Cancel")
3217+ onClicked: PopupUtils.close(goToPageDialog)
3218+ Layout.fillWidth: true
3219+ }
3220+
3221+ Button {
3222+ objectName:"GOButton"
3223+ text: i18n.tr("GO!")
3224+ color: UbuntuColors.green
3225+ Layout.fillWidth: true
3226+
3227+ enabled: goToPageTextField.acceptableInput
3228+ onClicked: goToPage()
3229+ }
3230 }
3231
3232 function goToPage() {
3233
3234=== modified file 'src/app/qml/textView/TextView.qml'
3235--- src/app/qml/textView/TextView.qml 2015-03-26 13:58:31 +0000
3236+++ src/app/qml/textView/TextView.qml 2015-10-20 18:22:30 +0000
3237@@ -14,9 +14,9 @@
3238 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3239 */
3240
3241-import QtQuick 2.3
3242-import Ubuntu.Components 1.1
3243-import Ubuntu.Components.Themes.Ambiance 0.1
3244+import QtQuick 2.4
3245+import Ubuntu.Components 1.2
3246+import Ubuntu.Components.Themes.Ambiance 1.2
3247
3248 import "../common/utils.js" as Utils
3249
3250
3251=== modified file 'src/app/qml/textView/TextViewDefaultHeader.qml'
3252--- src/app/qml/textView/TextViewDefaultHeader.qml 2015-04-15 14:21:48 +0000
3253+++ src/app/qml/textView/TextViewDefaultHeader.qml 2015-10-20 18:22:30 +0000
3254@@ -14,8 +14,8 @@
3255 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3256 */
3257
3258-import QtQuick 2.3
3259-import Ubuntu.Components 1.1
3260+import QtQuick 2.4
3261+import Ubuntu.Components 1.2
3262 import QtQuick.Layouts 1.1
3263 import Ubuntu.Components.Popups 1.0
3264
3265
3266=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
3267--- src/app/qml/ubuntu-docviewer-app.qml 2015-10-17 15:47:22 +0000
3268+++ src/app/qml/ubuntu-docviewer-app.qml 2015-10-20 18:22:30 +0000
3269@@ -14,8 +14,8 @@
3270 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3271 */
3272
3273-import QtQuick 2.3
3274-import Ubuntu.Components 1.1
3275+import QtQuick 2.4
3276+import Ubuntu.Components 1.2
3277 import Ubuntu.Components.Popups 1.0
3278 import DocumentViewer 1.0
3279 import QtQuick.Window 2.0
3280@@ -34,7 +34,6 @@
3281 Screen.orientation == Qt.InvertedLandscapeOrientation
3282
3283 applicationName: "com.ubuntu.docviewer"
3284- useDeprecatedToolbar: false
3285 automaticOrientation: true
3286
3287 width: units.gu(150)
3288@@ -143,6 +142,7 @@
3289 customDir: commandLineProxy.documentsDir
3290 }
3291
3292+ // TODO: Expose an enum from DocumentViewer module.
3293 sort.property: {
3294 switch (sortSettings.sortMode) {
3295 case 0:
3296
3297=== modified file 'src/app/qml/upstreamComponents/EmptyState.qml'
3298--- src/app/qml/upstreamComponents/EmptyState.qml 2015-02-26 20:16:32 +0000
3299+++ src/app/qml/upstreamComponents/EmptyState.qml 2015-10-20 18:22:30 +0000
3300@@ -16,8 +16,8 @@
3301 * along with this program. If not, see <http://www.gnu.org/licenses/>.
3302 */
3303
3304-import QtQuick 2.3
3305-import Ubuntu.Components 1.1
3306+import QtQuick 2.4
3307+import Ubuntu.Components 1.2
3308
3309 /*
3310 Component which displays an empty state (approved by design). It offers an
3311
3312=== removed file 'src/app/qml/upstreamComponents/HeaderButton.qml'
3313--- src/app/qml/upstreamComponents/HeaderButton.qml 2015-02-13 15:30:01 +0000
3314+++ src/app/qml/upstreamComponents/HeaderButton.qml 1970-01-01 00:00:00 +0000
3315@@ -1,65 +0,0 @@
3316-/*
3317- * Copyright (C) 2014 Canonical Ltd
3318- *
3319- * This file is part of Ubuntu Clock App
3320- *
3321- * Ubuntu Clock App is free software: you can redistribute it and/or modify
3322- * it under the terms of the GNU General Public License version 3 as
3323- * published by the Free Software Foundation.
3324- *
3325- * Ubuntu Clock App is distributed in the hope that it will be useful,
3326- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3327- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3328- * GNU General Public License for more details.
3329- *
3330- * You should have received a copy of the GNU General Public License
3331- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3332- */
3333-
3334-import QtQuick 2.3
3335-import Ubuntu.Components 1.1
3336-
3337-AbstractButton {
3338- id: headerButton
3339-
3340- property alias iconSource: _icon.source
3341- property alias iconName: _icon.name
3342- property alias text: _label.text
3343-
3344- width: units.gu(6)
3345- height: parent ? parent.height : undefined
3346-
3347- Rectangle {
3348- anchors.fill: parent
3349- visible: headerButton.pressed
3350- color: Theme.palette.selected.background
3351- }
3352-
3353- Column {
3354- id: buttonHolder
3355-
3356- width: _label.width
3357- height: childrenRect.height
3358-
3359- spacing: units.gu(0.2)
3360- anchors.centerIn: parent
3361- anchors.verticalCenterOffset: units.gu(0.3)
3362-
3363- Icon {
3364- id: _icon
3365- color: UbuntuColors.darkGrey
3366- width: units.gu(2.5)
3367- height: width
3368- opacity: headerButton.enabled ? 1.0 : 0.3
3369- anchors.horizontalCenter: parent.horizontalCenter
3370- }
3371-
3372- Label {
3373- id: _label
3374- color: UbuntuColors.darkGrey
3375- fontSize: "xx-small"
3376- opacity: headerButton.enabled ? 1.0 : 0.3
3377- anchors.horizontalCenter: _icon.horizontalCenter
3378- }
3379- }
3380-}
3381
3382=== removed file 'src/app/qml/upstreamComponents/ListItemWithActions.qml'
3383--- src/app/qml/upstreamComponents/ListItemWithActions.qml 2015-02-13 15:30:01 +0000
3384+++ src/app/qml/upstreamComponents/ListItemWithActions.qml 1970-01-01 00:00:00 +0000
3385@@ -1,453 +0,0 @@
3386-/*
3387- * Copyright (C) 2012-2014 Canonical, Ltd.
3388- *
3389- * This program is free software; you can redistribute it and/or modify
3390- * it under the terms of the GNU General Public License as published by
3391- * the Free Software Foundation; version 3.
3392- *
3393- * This program is distributed in the hope that it will be useful,
3394- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3395- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3396- * GNU General Public License for more details.
3397- *
3398- * You should have received a copy of the GNU General Public License
3399- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3400- */
3401-
3402-import QtQuick 2.3
3403-import Ubuntu.Components 1.1
3404-
3405-Item {
3406- id: root
3407-
3408- property Action leftSideAction: null
3409- property list<Action> rightSideActions
3410- property double defaultHeight: units.gu(8)
3411- property bool locked: false
3412- property Action activeAction: null
3413- property var activeItem: null
3414- property bool triggerActionOnMouseRelease: false
3415- property color color: Theme.palette.normal.background
3416- property color selectedColor: "#E6E6E6"
3417- property bool selected: false
3418- property bool selectionMode: false
3419- property alias internalAnchors: mainContents.anchors
3420- default property alias contents: mainContents.children
3421-
3422- readonly property double actionWidth: units.gu(4)
3423- readonly property double leftActionWidth: units.gu(10)
3424- readonly property double actionThreshold: actionWidth * 0.4
3425- readonly property double threshold: 0.4
3426- readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
3427- readonly property alias swipping: mainItemMoving.running
3428- readonly property bool _showActions: mouseArea.pressed || swipeState != "Normal" || swipping
3429-
3430- /* internal */
3431- property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
3432-
3433- signal itemClicked(var mouse)
3434- signal itemPressAndHold(var mouse)
3435-
3436- function returnToBoundsRTL(direction)
3437- {
3438- var actionFullWidth = actionWidth + units.gu(2)
3439-
3440- // go back to normal state if swipping reverse
3441- if (direction === "LTR") {
3442- updatePosition(0)
3443- return
3444- } else if (!triggerActionOnMouseRelease) {
3445- updatePosition(-rightActionsView.width + units.gu(2))
3446- return
3447- }
3448-
3449- var xOffset = Math.abs(main.x)
3450- var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
3451- var newX = 0
3452- if (index === _visibleRightSideActions.length) {
3453- newX = -(rightActionsView.width - units.gu(2))
3454- } else if (index >= 1) {
3455- newX = -(actionFullWidth * index)
3456- }
3457- updatePosition(newX)
3458- }
3459-
3460- function returnToBoundsLTR(direction)
3461- {
3462- var finalX = leftActionWidth
3463- if ((direction === "RTL") || (main.x <= (finalX * root.threshold)))
3464- finalX = 0
3465- updatePosition(finalX)
3466- }
3467-
3468- function returnToBounds(direction)
3469- {
3470- if (main.x < 0) {
3471- returnToBoundsRTL(direction)
3472- } else if (main.x > 0) {
3473- returnToBoundsLTR(direction)
3474- } else {
3475- updatePosition(0)
3476- }
3477- }
3478-
3479- function contains(item, point, marginX)
3480- {
3481- var itemStartX = item.x - marginX
3482- var itemEndX = item.x + item.width + marginX
3483- return (point.x >= itemStartX) && (point.x <= itemEndX) &&
3484- (point.y >= item.y) && (point.y <= (item.y + item.height));
3485- }
3486-
3487- function getActionAt(point)
3488- {
3489- if (contains(leftActionView, point, 0)) {
3490- return leftSideAction
3491- } else if (contains(rightActionsView, point, 0)) {
3492- var newPoint = root.mapToItem(rightActionsView, point.x, point.y)
3493- for (var i = 0; i < rightActionsRepeater.count; i++) {
3494- var child = rightActionsRepeater.itemAt(i)
3495- if (contains(child, newPoint, units.gu(1))) {
3496- return i
3497- }
3498- }
3499- }
3500- return -1
3501- }
3502-
3503- function updateActiveAction()
3504- {
3505- if (triggerActionOnMouseRelease &&
3506- (main.x <= -(root.actionWidth + units.gu(2))) &&
3507- (main.x > -(rightActionsView.width - units.gu(2)))) {
3508- var actionFullWidth = actionWidth + units.gu(2)
3509- var xOffset = Math.abs(main.x)
3510- var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
3511- index = index - 1
3512- if (index > -1) {
3513- root.activeItem = rightActionsRepeater.itemAt(index)
3514- root.activeAction = root._visibleRightSideActions[index]
3515- }
3516- } else {
3517- root.activeAction = null
3518- }
3519- }
3520-
3521- function resetSwipe()
3522- {
3523- updatePosition(0)
3524- }
3525-
3526- function filterVisibleActions(actions)
3527- {
3528- var visibleActions = []
3529- for(var i = 0; i < actions.length; i++) {
3530- var action = actions[i]
3531- if (action.visible) {
3532- visibleActions.push(action)
3533- }
3534- }
3535- return visibleActions
3536- }
3537-
3538- function updatePosition(pos)
3539- {
3540- if (!root.triggerActionOnMouseRelease && (pos !== 0)) {
3541- mouseArea.state = pos > 0 ? "RightToLeft" : "LeftToRight"
3542- } else {
3543- mouseArea.state = ""
3544- }
3545- main.x = pos
3546- }
3547-
3548- states: [
3549- State {
3550- name: "select"
3551- when: selectionMode || selected
3552- PropertyChanges {
3553- target: selectionIcon
3554- source: Qt.resolvedUrl("ListItemWithActionsCheckBox.qml")
3555- anchors.leftMargin: units.gu(2)
3556- }
3557- PropertyChanges {
3558- target: root
3559- locked: true
3560- }
3561- PropertyChanges {
3562- target: main
3563- x: 0
3564- }
3565- }
3566- ]
3567-
3568- height: defaultHeight
3569- clip: height !== defaultHeight
3570-
3571- Rectangle {
3572- id: leftActionView
3573-
3574- anchors {
3575- top: parent.top
3576- bottom: parent.bottom
3577- right: main.left
3578- }
3579- width: root.leftActionWidth + actionThreshold
3580- visible: leftSideAction
3581- color: UbuntuColors.red
3582-
3583- Icon {
3584- anchors {
3585- centerIn: parent
3586- horizontalCenterOffset: actionThreshold / 2
3587- }
3588- name: leftSideAction && _showActions ? leftSideAction.iconName : ""
3589- color: Theme.palette.selected.field
3590- height: units.gu(3)
3591- width: units.gu(3)
3592- }
3593- }
3594-
3595- Rectangle {
3596- id: rightActionsView
3597-
3598- anchors {
3599- top: main.top
3600- left: main.right
3601- bottom: main.bottom
3602- }
3603- visible: _visibleRightSideActions.length > 0
3604- width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0
3605- color: "white"
3606- Row {
3607- anchors{
3608- top: parent.top
3609- left: parent.left
3610- leftMargin: units.gu(2)
3611- right: parent.right
3612- rightMargin: units.gu(2)
3613- bottom: parent.bottom
3614- }
3615- spacing: units.gu(2)
3616- Repeater {
3617- id: rightActionsRepeater
3618-
3619- model: _showActions ? _visibleRightSideActions : []
3620- Item {
3621- property alias image: img
3622-
3623- height: rightActionsView.height
3624- width: root.actionWidth
3625-
3626- Icon {
3627- id: img
3628-
3629- anchors.centerIn: parent
3630- width: units.gu(3)
3631- height: units.gu(3)
3632- name: modelData.iconName
3633- color: root.activeAction === modelData ? UbuntuColors.lightAubergine : UbuntuColors.lightGrey
3634- }
3635- }
3636- }
3637- }
3638- }
3639-
3640-
3641- Rectangle {
3642- id: main
3643- objectName: "mainItem"
3644-
3645- anchors {
3646- top: parent.top
3647- bottom: parent.bottom
3648- }
3649-
3650- width: parent.width
3651- color: root.selected ? root.selectedColor : root.color
3652-
3653- Loader {
3654- id: selectionIcon
3655-
3656- anchors {
3657- left: main.left
3658- verticalCenter: main.verticalCenter
3659- }
3660- width: (status === Loader.Ready) ? item.implicitWidth : 0
3661- visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
3662- Behavior on width {
3663- NumberAnimation {
3664- duration: UbuntuAnimation.SnapDuration
3665- }
3666- }
3667- }
3668-
3669-
3670- Item {
3671- id: mainContents
3672-
3673- anchors {
3674- left: selectionIcon.right
3675- leftMargin: units.gu(2)
3676- top: parent.top
3677- topMargin: units.gu(1)
3678- right: parent.right
3679- rightMargin: units.gu(2)
3680- bottom: parent.bottom
3681- bottomMargin: units.gu(1)
3682- }
3683- }
3684-
3685- Behavior on x {
3686- UbuntuNumberAnimation {
3687- id: mainItemMoving
3688-
3689- easing.type: Easing.OutElastic
3690- duration: UbuntuAnimation.SlowDuration
3691- }
3692- }
3693- Behavior on color {
3694- ColorAnimation {}
3695- }
3696- }
3697-
3698- SequentialAnimation {
3699- id: triggerAction
3700-
3701- property var currentItem: root.activeItem ? root.activeItem.image : null
3702-
3703- running: false
3704- ParallelAnimation {
3705- UbuntuNumberAnimation {
3706- target: triggerAction.currentItem
3707- property: "opacity"
3708- from: 1.0
3709- to: 0.0
3710- duration: UbuntuAnimation.SlowDuration
3711- easing {type: Easing.InOutBack; }
3712- }
3713- UbuntuNumberAnimation {
3714- target: triggerAction.currentItem
3715- properties: "width, height"
3716- from: units.gu(3)
3717- to: root.actionWidth
3718- duration: UbuntuAnimation.SlowDuration
3719- easing {type: Easing.InOutBack; }
3720- }
3721- }
3722- PropertyAction {
3723- target: triggerAction.currentItem
3724- properties: "width, height"
3725- value: units.gu(3)
3726- }
3727- PropertyAction {
3728- target: triggerAction.currentItem
3729- properties: "opacity"
3730- value: 1.0
3731- }
3732- ScriptAction {
3733- script: {
3734- root.activeAction.triggered(root)
3735- mouseArea.state = ""
3736- }
3737- }
3738- PauseAnimation {
3739- duration: 500
3740- }
3741- UbuntuNumberAnimation {
3742- target: main
3743- property: "x"
3744- to: 0
3745-
3746- }
3747- }
3748-
3749- MouseArea {
3750- id: mouseArea
3751-
3752- property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0))
3753- property bool manual: false
3754- property string direction: "None"
3755- property real lastX: -1
3756-
3757- anchors.fill: parent
3758- drag {
3759- target: locked ? null : main
3760- axis: Drag.XAxis
3761- minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
3762- maximumX: leftActionView.visible ? leftActionView.width : 0
3763- threshold: root.actionThreshold
3764- }
3765-
3766- states: [
3767- State {
3768- name: "LeftToRight"
3769- PropertyChanges {
3770- target: mouseArea
3771- drag.maximumX: 0
3772- }
3773- },
3774- State {
3775- name: "RightToLeft"
3776- PropertyChanges {
3777- target: mouseArea
3778- drag.minimumX: 0
3779- }
3780- }
3781- ]
3782-
3783- onMouseXChanged: {
3784- var offset = (lastX - mouseX)
3785- if (Math.abs(offset) <= root.actionThreshold) {
3786- return
3787- }
3788- lastX = mouseX
3789- direction = offset > 0 ? "RTL" : "LTR";
3790- }
3791-
3792- onPressed: {
3793- lastX = mouse.x
3794- }
3795-
3796- onReleased: {
3797- if (root.triggerActionOnMouseRelease && root.activeAction) {
3798- triggerAction.start()
3799- } else {
3800- root.returnToBounds(direction)
3801- root.activeAction = null
3802- }
3803- lastX = -1
3804- direction = "None"
3805- }
3806- onClicked: {
3807- if (main.x === 0) {
3808- root.itemClicked(mouse)
3809- } else if (main.x > 0) {
3810- var action = getActionAt(Qt.point(mouse.x, mouse.y))
3811- if (action && action !== -1) {
3812- action.triggered(root)
3813- }
3814- } else {
3815- var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
3816- if (actionIndex !== -1) {
3817- root.activeItem = rightActionsRepeater.itemAt(actionIndex)
3818- root.activeAction = root._visibleRightSideActions[actionIndex]
3819- triggerAction.start()
3820- return
3821- }
3822- }
3823- root.resetSwipe()
3824- }
3825-
3826- onPositionChanged: {
3827- if (mouseArea.pressed) {
3828- updateActiveAction()
3829- }
3830- }
3831- onPressAndHold: {
3832- if (main.x === 0) {
3833- root.itemPressAndHold(mouse)
3834- }
3835- }
3836- z: -1
3837- }
3838-}
3839
3840=== removed file 'src/app/qml/upstreamComponents/ListItemWithActionsCheckBox.qml'
3841--- src/app/qml/upstreamComponents/ListItemWithActionsCheckBox.qml 2015-02-13 15:30:01 +0000
3842+++ src/app/qml/upstreamComponents/ListItemWithActionsCheckBox.qml 1970-01-01 00:00:00 +0000
3843@@ -1,25 +0,0 @@
3844-/*
3845- * Copyright (C) 2012-2014 Canonical, Ltd.
3846- *
3847- * This program is free software; you can redistribute it and/or modify
3848- * it under the terms of the GNU General Public License as published by
3849- * the Free Software Foundation; version 3.
3850- *
3851- * This program is distributed in the hope that it will be useful,
3852- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3853- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3854- * GNU General Public License for more details.
3855- *
3856- * You should have received a copy of the GNU General Public License
3857- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3858- */
3859-
3860-import QtQuick 2.3
3861-import Ubuntu.Components 1.1
3862-
3863-CheckBox {
3864- checked: root.selected
3865- width: implicitWidth
3866- // disable item mouse area to avoid conflicts with parent mouse area
3867- __mouseArea.enabled: false
3868-}
3869
3870=== removed file 'src/app/qml/upstreamComponents/MultipleSelectionGridView.qml'
3871--- src/app/qml/upstreamComponents/MultipleSelectionGridView.qml 2015-02-13 15:30:01 +0000
3872+++ src/app/qml/upstreamComponents/MultipleSelectionGridView.qml 1970-01-01 00:00:00 +0000
3873@@ -1,199 +0,0 @@
3874-/*
3875- * Copyright (C) 2013 Canonical, Ltd.
3876- *
3877- * This program is free software; you can redistribute it and/or modify
3878- * it under the terms of the GNU General Public License as published by
3879- * the Free Software Foundation; version 3.
3880- *
3881- * This program is distributed in the hope that it will be useful,
3882- * but WITHOUT ANY WARRANTY; without even the implied warranty of
3883- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
3884- * GNU General Public License for more details.
3885- *
3886- * You should have received a copy of the GNU General Public License
3887- * along with this program. If not, see <http://www.gnu.org/licenses/>.
3888- */
3889-
3890-import QtQuick 2.3
3891-import Ubuntu.Components 1.1
3892-import Ubuntu.Components.Popups 1.0 as Popups
3893-
3894-/*!
3895- \qmltype ContactSimpleListView
3896- \inqmlmodule Ubuntu.Contacts 0.1
3897- \ingroup ubuntu
3898- \brief The MultipleSelectionListView provides a ListView with support to multiple selection
3899-
3900- The MultipleSelectionListViewprovides a ListView with support to multiple selection which can be used by any
3901- application.
3902-
3903- Example:
3904- \qml
3905- import Ubuntu.Contacts 0.1
3906-
3907- MultipleSelectionListView {
3908- id: view
3909- anchors.fill: paret
3910- model: 100
3911- delegate: Rectangle {
3912- width: parent.width
3913- height: 100
3914- color: view.selectedItems.indexOf(index) == -1 ? "white" : "blue"
3915-
3916- MouseArea {
3917- anchors.fill: parent
3918- onClicked: {
3919- if (view.isInSelectionModel) {
3920- view.selectItem(index)
3921- }
3922- }
3923- onPressAndHold: view.startSelection()
3924- }
3925- }
3926- onSelectionDone: console.debug("Selected items:" + view.selectedItems)
3927- }
3928- \endqml
3929-*/
3930-
3931-GridView {
3932- id: listView
3933-
3934- /*!
3935- \qmlproperty model selectedItems
3936-
3937- This property holds the list of selected items
3938- */
3939- readonly property alias selectedItems: visualModel.selectedItems
3940- /*!
3941- \qmlproperty bool multipleSelection
3942-
3943- This property holds if the selection will accept multiple items or single items
3944- */
3945- property bool multipleSelection: true
3946-
3947- /*!
3948- \qmlproperty model listModel
3949-
3950- This property holds the model providing data for the list.
3951- */
3952- property alias listModel: visualModel.model
3953- /*!
3954- \qmlproperty Component listDelegate
3955-
3956- The delegate provides a template defining each item instantiated by the view.
3957- */
3958- property alias listDelegate: visualModel.delegate
3959-
3960- /*!
3961- \qmlproperty bool isInSelectionMode
3962-
3963- This property holds a list with the index of selected items
3964- */
3965- readonly property bool isInSelectionMode: state === "selection"
3966- /*!
3967- This handler is called when the selection mode is finished without be canceled
3968- */
3969- signal selectionDone(var items)
3970- /*!
3971- This handler is called when the selection mode is canceled
3972- */
3973- signal selectionCanceled()
3974-
3975- /*!
3976- Start the selection mode on the list view.
3977- */
3978- function startSelection()
3979- {
3980- state = "selection"
3981- }
3982- /*!
3983- Check if the item is selected
3984- Returns true if the item was marked as selected or false if the item is unselected
3985- */
3986- function isSelected(item)
3987- {
3988- if (item && item.VisualDataModel) {
3989- return (item.VisualDataModel.inSelected === true)
3990- } else {
3991- return false
3992- }
3993- }
3994- /*!
3995- Mark the item as selected
3996- Returns true if the item was marked as selected or false if the item is already selected
3997- */
3998- function selectItem(item)
3999- {
4000- if (item.VisualDataModel.inSelected) {
4001- return false
4002- } else {
4003- if (!multipleSelection) {
4004- clearSelection()
4005- }
4006- item.VisualDataModel.inSelected = true
4007- return true
4008- }
4009- }
4010- /*!
4011- Remove the index from the selected list
4012- */
4013- function deselectItem(item)
4014- {
4015- var result = false
4016- if (item.VisualDataModel.inSelected) {
4017- item.VisualDataModel.inSelected = false
4018- result = true
4019- }
4020- return result
4021- }
4022- /*!
4023- Finish the selection mode with sucess
4024- */
4025- function endSelection()
4026- {
4027- selectionDone(listView.selectedItems)
4028- clearSelection()
4029- state = ""
4030- }
4031- /*!
4032- Cancel the selection
4033- */
4034- function cancelSelection()
4035- {
4036- selectionCanceled()
4037- clearSelection()
4038- state = ""
4039- }
4040- /*!
4041- Remove any selected item from the selection list
4042- */
4043- function clearSelection()
4044- {
4045- if (selectedItems.count > 0) {
4046- selectedItems.remove(0, selectedItems.count)
4047- }
4048- }
4049- /*!
4050- Select all items in the list
4051- */
4052- function selectAll()
4053- {
4054- if (multipleSelection) {
4055- visualModel.items.addGroups(0, visualModel.items.count, ["selected"] )
4056- }
4057- }
4058-
4059- model: visualModel
4060-
4061- MultipleSelectionVisualModel {
4062- id: visualModel
4063- }
4064-
4065- Component.onCompleted: {
4066- // FIXME: workaround for qtubuntu not returning values depending on the grid unit definition
4067- // for Flickable.maximumFlickVelocity and Flickable.flickDeceleration
4068- var scaleFactor = units.gridUnit / 8;
4069- maximumFlickVelocity = maximumFlickVelocity * scaleFactor;
4070- flickDeceleration = flickDeceleration * scaleFactor;
4071- }
4072-}
4073
4074=== removed file 'src/app/qml/upstreamComponents/MultipleSelectionListView.qml'
4075--- src/app/qml/upstreamComponents/MultipleSelectionListView.qml 2015-02-13 15:30:01 +0000
4076+++ src/app/qml/upstreamComponents/MultipleSelectionListView.qml 1970-01-01 00:00:00 +0000
4077@@ -1,199 +0,0 @@
4078-/*
4079- * Copyright (C) 2013 Canonical, Ltd.
4080- *
4081- * This program is free software; you can redistribute it and/or modify
4082- * it under the terms of the GNU General Public License as published by
4083- * the Free Software Foundation; version 3.
4084- *
4085- * This program is distributed in the hope that it will be useful,
4086- * but WITHOUT ANY WARRANTY; without even the implied warranty of
4087- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4088- * GNU General Public License for more details.
4089- *
4090- * You should have received a copy of the GNU General Public License
4091- * along with this program. If not, see <http://www.gnu.org/licenses/>.
4092- */
4093-
4094-import QtQuick 2.3
4095-import Ubuntu.Components 1.1
4096-import Ubuntu.Components.Popups 1.0 as Popups
4097-
4098-/*!
4099- \qmltype ContactSimpleListView
4100- \inqmlmodule Ubuntu.Contacts 0.1
4101- \ingroup ubuntu
4102- \brief The MultipleSelectionListView provides a ListView with support to multiple selection
4103-
4104- The MultipleSelectionListViewprovides a ListView with support to multiple selection which can be used by any
4105- application.
4106-
4107- Example:
4108- \qml
4109- import Ubuntu.Contacts 0.1
4110-
4111- MultipleSelectionListView {
4112- id: view
4113- anchors.fill: paret
4114- model: 100
4115- delegate: Rectangle {
4116- width: parent.width
4117- height: 100
4118- color: view.selectedItems.indexOf(index) == -1 ? "white" : "blue"
4119-
4120- MouseArea {
4121- anchors.fill: parent
4122- onClicked: {
4123- if (view.isInSelectionModel) {
4124- view.selectItem(index)
4125- }
4126- }
4127- onPressAndHold: view.startSelection()
4128- }
4129- }
4130- onSelectionDone: console.debug("Selected items:" + view.selectedItems)
4131- }
4132- \endqml
4133-*/
4134-
4135-ListView {
4136- id: listView
4137-
4138- /*!
4139- \qmlproperty model selectedItems
4140-
4141- This property holds the list of selected items
4142- */
4143- readonly property alias selectedItems: visualModel.selectedItems
4144- /*!
4145- \qmlproperty bool multipleSelection
4146-
4147- This property holds if the selection will accept multiple items or single items
4148- */
4149- property bool multipleSelection: true
4150-
4151- /*!
4152- \qmlproperty model listModel
4153-
4154- This property holds the model providing data for the list.
4155- */
4156- property alias listModel: visualModel.model
4157- /*!
4158- \qmlproperty Component listDelegate
4159-
4160- The delegate provides a template defining each item instantiated by the view.
4161- */
4162- property alias listDelegate: visualModel.delegate
4163-
4164- /*!
4165- \qmlproperty bool isInSelectionMode
4166-
4167- This property holds a list with the index of selected items
4168- */
4169- readonly property bool isInSelectionMode: state === "selection"
4170- /*!
4171- This handler is called when the selection mode is finished without be canceled
4172- */
4173- signal selectionDone(var items)
4174- /*!
4175- This handler is called when the selection mode is canceled
4176- */
4177- signal selectionCanceled()
4178-
4179- /*!
4180- Start the selection mode on the list view.
4181- */
4182- function startSelection()
4183- {
4184- state = "selection"
4185- }
4186- /*!
4187- Check if the item is selected
4188- Returns true if the item was marked as selected or false if the item is unselected
4189- */
4190- function isSelected(item)
4191- {
4192- if (item && item.VisualDataModel) {
4193- return (item.VisualDataModel.inSelected === true)
4194- } else {
4195- return false
4196- }
4197- }
4198- /*!
4199- Mark the item as selected
4200- Returns true if the item was marked as selected or false if the item is already selected
4201- */
4202- function selectItem(item)
4203- {
4204- if (item.VisualDataModel.inSelected) {
4205- return false
4206- } else {
4207- if (!multipleSelection) {
4208- clearSelection()
4209- }
4210- item.VisualDataModel.inSelected = true
4211- return true
4212- }
4213- }
4214- /*!
4215- Remove the index from the selected list
4216- */
4217- function deselectItem(item)
4218- {
4219- var result = false
4220- if (item.VisualDataModel.inSelected) {
4221- item.VisualDataModel.inSelected = false
4222- result = true
4223- }
4224- return result
4225- }
4226- /*!
4227- Finish the selection mode with sucess
4228- */
4229- function endSelection()
4230- {
4231- selectionDone(listView.selectedItems)
4232- clearSelection()
4233- state = ""
4234- }
4235- /*!
4236- Cancel the selection
4237- */
4238- function cancelSelection()
4239- {
4240- selectionCanceled()
4241- clearSelection()
4242- state = ""
4243- }
4244- /*!
4245- Remove any selected item from the selection list
4246- */
4247- function clearSelection()
4248- {
4249- if (selectedItems.count > 0) {
4250- selectedItems.remove(0, selectedItems.count)
4251- }
4252- }
4253- /*!
4254- Select all items in the list
4255- */
4256- function selectAll()
4257- {
4258- if (multipleSelection) {
4259- visualModel.items.addGroups(0, visualModel.items.count, ["selected"] )
4260- }
4261- }
4262-
4263- model: visualModel
4264-
4265- MultipleSelectionVisualModel {
4266- id: visualModel
4267- }
4268-
4269- Component.onCompleted: {
4270- // FIXME: workaround for qtubuntu not returning values depending on the grid unit definition
4271- // for Flickable.maximumFlickVelocity and Flickable.flickDeceleration
4272- var scaleFactor = units.gridUnit / 8;
4273- maximumFlickVelocity = maximumFlickVelocity * scaleFactor;
4274- flickDeceleration = flickDeceleration * scaleFactor;
4275- }
4276-}
4277
4278=== removed file 'src/app/qml/upstreamComponents/MultipleSelectionVisualModel.qml'
4279--- src/app/qml/upstreamComponents/MultipleSelectionVisualModel.qml 2015-02-13 15:30:01 +0000
4280+++ src/app/qml/upstreamComponents/MultipleSelectionVisualModel.qml 1970-01-01 00:00:00 +0000
4281@@ -1,31 +0,0 @@
4282-/*
4283- * Copyright (C) 2012-2013 Canonical, Ltd.
4284- *
4285- * This program is free software; you can redistribute it and/or modify
4286- * it under the terms of the GNU General Public License as published by
4287- * the Free Software Foundation; version 3.
4288- *
4289- * This program is distributed in the hope that it will be useful,
4290- * but WITHOUT ANY WARRANTY; without even the implied warranty of
4291- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
4292- * GNU General Public License for more details.
4293- *
4294- * You should have received a copy of the GNU General Public License
4295- * along with this program. If not, see <http://www.gnu.org/licenses/>.
4296- */
4297-
4298-import QtQuick 2.3
4299-
4300-VisualDataModel {
4301- id: contactVisualModel
4302-
4303- property alias selectedItems: selectedGroup
4304-
4305- groups: [
4306- VisualDataGroup {
4307- id: selectedGroup
4308-
4309- name: "selected"
4310- }
4311- ]
4312-}
4313
4314=== modified file 'src/app/qml/upstreamComponents/PageWithBottomEdge.qml'
4315--- src/app/qml/upstreamComponents/PageWithBottomEdge.qml 2015-02-13 15:30:01 +0000
4316+++ src/app/qml/upstreamComponents/PageWithBottomEdge.qml 2015-10-20 18:22:30 +0000
4317@@ -62,8 +62,8 @@
4318
4319 */
4320
4321-import QtQuick 2.2
4322-import Ubuntu.Components 1.1
4323+import QtQuick 2.4
4324+import Ubuntu.Components 1.2
4325
4326 Page {
4327 id: page

Subscribers

People subscribed via source and target branches