ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #05339
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot.
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
Requested reviews:
Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)
For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12/+merge/274051
* 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
--
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot.
=== modified file 'po/com.ubuntu.docviewer.pot'
--- po/com.ubuntu.docviewer.pot 2015-10-18 21:27:16 +0000
+++ po/com.ubuntu.docviewer.pot 2015-10-19 11:44:23 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-10-19 00:19+0300\n"
+"POT-Creation-Date: 2015-10-19 13:42+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -19,34 +19,34 @@
"Plural-Forms: nplurals=INTEGER; plural=EXPRESSION;\n"
#: ../src/app/docviewer-application.cpp:162
-#: /home/qtros/dev/build-ubuntu-docviewer-app-more-oop-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
+#: /tmp/build-reboot-uitk12-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
msgid "Document Viewer"
msgstr ""
-#: ../src/app/qml/common/DetailsPage.qml:27
+#: ../src/app/qml/common/DetailsPage.qml:28
#: ../src/app/qml/loView/LOViewDefaultHeader.qml:106
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:97
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:83
msgid "Details"
msgstr ""
-#: ../src/app/qml/common/DetailsPage.qml:33
+#: ../src/app/qml/common/DetailsPage.qml:47
msgid "Location"
msgstr ""
-#: ../src/app/qml/common/DetailsPage.qml:37
+#: ../src/app/qml/common/DetailsPage.qml:66
msgid "Size"
msgstr ""
-#: ../src/app/qml/common/DetailsPage.qml:42
+#: ../src/app/qml/common/DetailsPage.qml:85
msgid "Created"
msgstr ""
-#: ../src/app/qml/common/DetailsPage.qml:47
+#: ../src/app/qml/common/DetailsPage.qml:104
msgid "Last modified"
msgstr ""
-#: ../src/app/qml/common/DetailsPage.qml:54
+#: ../src/app/qml/common/DetailsPage.qml:129
msgid "MIME type"
msgstr ""
@@ -59,9 +59,9 @@
msgstr ""
#: ../src/app/qml/common/FileNotFoundDialog.qml:28
-#: ../src/app/qml/common/PickImportedDialog.qml:47
+#: ../src/app/qml/common/PickImportedDialog.qml:53
#: ../src/app/qml/common/RejectedImportDialog.qml:38
-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:32
+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:33
#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
#: ../src/app/qml/loView/LOViewDefaultHeader.qml:70
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61
@@ -69,11 +69,11 @@
msgid "Close"
msgstr ""
+#: ../src/app/qml/common/PickImportedDialog.qml:28
+msgid "Multiple documents imported"
+msgstr ""
+
#: ../src/app/qml/common/PickImportedDialog.qml:29
-msgid "Multiple documents imported"
-msgstr ""
-
-#: ../src/app/qml/common/PickImportedDialog.qml:30
msgid "Choose which one to open:"
msgstr ""
@@ -89,24 +89,29 @@
msgstr[0] ""
msgstr[1] ""
-#: ../src/app/qml/common/UnknownTypeDialog.qml:26
+#: ../src/app/qml/common/UnknownTypeDialog.qml:27
msgid "Unknown file type"
msgstr ""
-#: ../src/app/qml/common/UnknownTypeDialog.qml:27
+#: ../src/app/qml/common/UnknownTypeDialog.qml:28
msgid ""
-"Sorry but we can't find a way to display this file. Do you want to open it "
-"as a plain text?"
-msgstr ""
-
-#: ../src/app/qml/common/UnknownTypeDialog.qml:29
+"Sorry but we can't find a way to display this file.\n"
+"\n"
+"Do you want to open it as a plain text?"
+msgstr ""
+
+#: ../src/app/qml/common/UnknownTypeDialog.qml:38
+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
+#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:53
+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
+msgid "Cancel"
+msgstr ""
+
+#: ../src/app/qml/common/UnknownTypeDialog.qml:44
msgid "Yes"
msgstr ""
-#: ../src/app/qml/common/UnknownTypeDialog.qml:38
-msgid "No"
-msgstr ""
-
#. TRANSLATORS: %1 is the size of a file, expressed in GB
#: ../src/app/qml/common/utils.js:22
#, qt-format
@@ -131,38 +136,31 @@
msgid "%1 byte"
msgstr ""
-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:36
+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
msgid "Delete file"
msgstr ""
-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:37
+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
#, qt-format
msgid "Delete %1 file"
msgid_plural "Delete %1 files"
msgstr[0] ""
msgstr[1] ""
-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:38
-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
msgid "Are you sure you want to permanently delete this file?"
msgid_plural "Are you sure you want to permanently delete these files?"
msgstr[0] ""
msgstr[1] ""
-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:44
-#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:54
-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:52
-msgid "Cancel"
-msgstr ""
-
-#: ../src/app/qml/documentPage/DeleteFileDialog.qml:49
-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:82
+#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:27
+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:55
msgid "Delete"
msgstr ""
-#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:43
+#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:46
msgid "Share"
msgstr ""
@@ -178,56 +176,32 @@
#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:32
-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:37
+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:95
#, qt-format
msgid "Today, %1"
msgstr ""
#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:37
-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:42
+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
#, qt-format
msgid "Yesterday, %1"
msgstr ""
#. TRANSLATORS: this is a datetime formatting string,
#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:42
-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:58
+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:107
+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:126
+msgid "yyyy/MM/dd hh:mm"
+msgstr ""
+
+#. TRANSLATORS: this is a datetime formatting string,
+#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+#: ../src/app/qml/documentPage/DocumentListDelegate.qml:120
msgid "dddd, hh:mm"
msgstr ""
-#. TRANSLATORS: this is a datetime formatting string,
-#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
-#: ../src/app/qml/documentPage/DocumentGridDelegate.qml:46
-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:47
-#: ../src/app/qml/documentPage/DocumentListDelegate.qml:63
-msgid "dd-MM-yyyy hh:mm"
-msgstr ""
-
-#: ../src/app/qml/documentPage/DocumentListView.qml:167
-msgid "Today"
-msgstr ""
-
-#: ../src/app/qml/documentPage/DocumentListView.qml:170
-msgid "Yesterday"
-msgstr ""
-
-#: ../src/app/qml/documentPage/DocumentListView.qml:173
-msgid "Earlier this week"
-msgstr ""
-
-#: ../src/app/qml/documentPage/DocumentListView.qml:176
-msgid "Earlier this month"
-msgstr ""
-
-#: ../src/app/qml/documentPage/DocumentListView.qml:178
-msgid "Even earlier..."
-msgstr ""
-
-#: ../src/app/qml/documentPage/DocumentPage.qml:24
+#: ../src/app/qml/documentPage/DocumentPage.qml:23
msgid "Documents"
msgstr ""
@@ -235,16 +209,14 @@
msgid "Search..."
msgstr ""
-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:37
+#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
msgid "Sorting settings..."
msgstr ""
-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:46
#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
msgid "Switch to single column list"
msgstr ""
-#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:46
#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
msgid "Switch to grid"
msgstr ""
@@ -265,11 +237,11 @@
msgid "search in documents..."
msgstr ""
-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:52
+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:42
msgid "Select None"
msgstr ""
-#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:54
+#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:42
msgid "Select All"
msgstr ""
@@ -282,6 +254,26 @@
"Please ensure that your query is not misspelled and/or try a different query."
msgstr ""
+#: ../src/app/qml/documentPage/SectionHeader.qml:13
+msgid "Today"
+msgstr ""
+
+#: ../src/app/qml/documentPage/SectionHeader.qml:16
+msgid "Yesterday"
+msgstr ""
+
+#: ../src/app/qml/documentPage/SectionHeader.qml:19
+msgid "Earlier this week"
+msgstr ""
+
+#: ../src/app/qml/documentPage/SectionHeader.qml:22
+msgid "Earlier this month"
+msgstr ""
+
+#: ../src/app/qml/documentPage/SectionHeader.qml:24
+msgid "Even earlier..."
+msgstr ""
+
#: ../src/app/qml/documentPage/SharePage.qml:23
msgid "Share to"
msgstr ""
@@ -355,16 +347,16 @@
msgid "Enable night mode"
msgstr ""
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:27
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:28
msgid "Go to position"
msgstr ""
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:28
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:29
msgid "Choose a position between 1% and 100%"
msgstr ""
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:46
-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:44
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:60
+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
msgid "GO!"
msgstr ""
@@ -425,11 +417,11 @@
msgid "Go to page..."
msgstr ""
-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:25
+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
msgid "Go to page"
msgstr ""
-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
#, qt-format
msgid "Choose a page between 1 and %1"
msgstr ""
@@ -448,6 +440,6 @@
msgid "copy %1"
msgstr ""
-#: /home/qtros/dev/build-ubuntu-docviewer-app-more-oop-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
+#: /tmp/build-reboot-uitk12-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
msgid "documents;viewer;pdf;reader;"
msgstr ""
=== removed file 'src/app/graphics/select-none.svg'
--- src/app/graphics/select-none.svg 2015-02-13 15:30:01 +0000
+++ src/app/graphics/select-none.svg 1970-01-01 00:00:00 +0000
@@ -1,153 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="90"
- height="90"
- id="svg4874"
- version="1.1"
- inkscape:version="0.48+devel r"
- viewBox="0 0 90 90.000001"
- sodipodi:docname="select-none.svg">
- <defs
- id="defs4876" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="12.434498"
- inkscape:cx="10.237647"
- inkscape:cy="53.078139"
- inkscape:document-units="px"
- inkscape:current-layer="g1311"
- showgrid="true"
- showborder="true"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:snap-bbox="true"
- inkscape:bbox-paths="true"
- inkscape:bbox-nodes="true"
- inkscape:snap-bbox-edge-midpoints="true"
- inkscape:snap-bbox-midpoints="true"
- inkscape:object-paths="true"
- inkscape:snap-intersection-paths="true"
- inkscape:object-nodes="true"
- inkscape:snap-smooth-nodes="true"
- inkscape:snap-midpoints="true"
- inkscape:snap-object-midpoints="true"
- inkscape:snap-center="true"
- showguides="true"
- inkscape:guide-bbox="true">
- <inkscape:grid
- type="xygrid"
- id="grid5451"
- empspacing="6" />
- <sodipodi:guide
- orientation="1,0"
- position="6,77"
- id="guide4063" />
- <sodipodi:guide
- orientation="1,0"
- position="3,78"
- id="guide4065" />
- <sodipodi:guide
- orientation="0,1"
- position="55,84"
- id="guide4067" />
- <sodipodi:guide
- orientation="0,1"
- position="53,87"
- id="guide4069" />
- <sodipodi:guide
- orientation="0,1"
- position="20,3"
- id="guide4071" />
- <sodipodi:guide
- orientation="0,1"
- position="20,6"
- id="guide4073" />
- <sodipodi:guide
- orientation="1,0"
- position="87,7"
- id="guide4075" />
- <sodipodi:guide
- orientation="1,0"
- position="84,7"
- id="guide4077" />
- <sodipodi:guide
- orientation="0,1"
- position="58,81"
- id="guide4074" />
- <sodipodi:guide
- orientation="1,0"
- position="9,74"
- id="guide4076" />
- <sodipodi:guide
- orientation="0,1"
- position="21,9"
- id="guide4078" />
- <sodipodi:guide
- orientation="1,0"
- position="81,4"
- id="guide4080" />
- </sodipodi:namedview>
- <metadata
- id="metadata4879">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(67.857146,-84.50504)">
- <g
- transform="matrix(0,-1,-1,0,373.50506,516.50504)"
- id="g4845"
- style="display:inline">
- <g
- transform="matrix(0,-1,-1,0,567.36222,615.36221)"
- id="g1311"
- inkscape:export-filename="envelope02.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <g
- id="g1313"
- transform="matrix(1.875,0,0,1.875,-366,-1657.8169)">
- <rect
- transform="translate(0,804.3622)"
- y="152"
- x="288"
- height="48"
- width="48"
- id="rect1315"
- style="opacity:0.21171169;fill:none;stroke:none" />
- </g>
- <path
- 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"
- 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 "
- transform="translate(174,135.36222)"
- id="path4098" />
- </g>
- </g>
- </g>
-</svg>
=== removed file 'src/app/graphics/select.svg'
--- src/app/graphics/select.svg 2015-02-13 15:30:01 +0000
+++ src/app/graphics/select.svg 1970-01-01 00:00:00 +0000
@@ -1,158 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="90"
- height="90"
- id="svg4874"
- version="1.1"
- inkscape:version="0.48+devel r12833"
- viewBox="0 0 90 90.000001"
- sodipodi:docname="select.svg">
- <defs
- id="defs4876" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="12.434498"
- inkscape:cx="30.343002"
- inkscape:cy="53.600878"
- inkscape:document-units="px"
- inkscape:current-layer="g1311"
- showgrid="true"
- showborder="true"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- inkscape:snap-bbox="true"
- inkscape:bbox-paths="true"
- inkscape:bbox-nodes="true"
- inkscape:snap-bbox-edge-midpoints="true"
- inkscape:snap-bbox-midpoints="true"
- inkscape:object-paths="true"
- inkscape:snap-intersection-paths="true"
- inkscape:object-nodes="true"
- inkscape:snap-smooth-nodes="true"
- inkscape:snap-midpoints="true"
- inkscape:snap-object-midpoints="true"
- inkscape:snap-center="true"
- showguides="true"
- inkscape:guide-bbox="true">
- <inkscape:grid
- type="xygrid"
- id="grid5451"
- empspacing="6" />
- <sodipodi:guide
- orientation="1,0"
- position="6,77"
- id="guide4063" />
- <sodipodi:guide
- orientation="1,0"
- position="3,78"
- id="guide4065" />
- <sodipodi:guide
- orientation="0,1"
- position="55,84"
- id="guide4067" />
- <sodipodi:guide
- orientation="0,1"
- position="53,87"
- id="guide4069" />
- <sodipodi:guide
- orientation="0,1"
- position="20,3"
- id="guide4071" />
- <sodipodi:guide
- orientation="0,1"
- position="20,6"
- id="guide4073" />
- <sodipodi:guide
- orientation="1,0"
- position="87,7"
- id="guide4075" />
- <sodipodi:guide
- orientation="1,0"
- position="84,7"
- id="guide4077" />
- <sodipodi:guide
- orientation="0,1"
- position="58,81"
- id="guide4074" />
- <sodipodi:guide
- orientation="1,0"
- position="9,74"
- id="guide4076" />
- <sodipodi:guide
- orientation="0,1"
- position="21,9"
- id="guide4078" />
- <sodipodi:guide
- orientation="1,0"
- position="81,4"
- id="guide4080" />
- </sodipodi:namedview>
- <metadata
- id="metadata4879">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(67.857146,-84.50504)">
- <g
- transform="matrix(0,-1,-1,0,373.50506,516.50504)"
- id="g4845"
- style="display:inline">
- <g
- transform="matrix(0,-1,-1,0,567.36222,615.36221)"
- id="g1311"
- inkscape:export-filename="envelope02.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
- <g
- id="g1313"
- transform="matrix(1.875,0,0,1.875,-366,-1657.8169)">
- <rect
- transform="translate(0,804.3622)"
- y="152"
- x="288"
- height="48"
- width="48"
- id="rect1315"
- style="opacity:0.21171169;fill:none;stroke:none" />
- </g>
- <path
- 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"
- 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 "
- transform="translate(174,135.36222)"
- id="path4098" />
- <path
- 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"
- 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"
- id="path4041-9"
- inkscape:connector-curvature="0" />
- </g>
- </g>
- </g>
-</svg>
=== removed file 'src/app/graphics/settings_alt.svg'
--- src/app/graphics/settings_alt.svg 2015-06-10 17:17:47 +0000
+++ src/app/graphics/settings_alt.svg 1970-01-01 00:00:00 +0000
@@ -1,138 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!-- Created with Inkscape (http://www.inkscape.org/) -->
-
-<svg
- xmlns:dc="http://purl.org/dc/elements/1.1/"
- xmlns:cc="http://creativecommons.org/ns#"
- xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
- xmlns:svg="http://www.w3.org/2000/svg"
- xmlns="http://www.w3.org/2000/svg"
- xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
- xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
- width="90"
- height="90"
- id="svg3133"
- version="1.1"
- inkscape:version="0.48.3.1 r9886"
- sodipodi:docname="settings@xxxxxx">
- <defs
- id="defs3135" />
- <sodipodi:namedview
- id="base"
- pagecolor="#ffffff"
- bordercolor="#666666"
- borderopacity="1.0"
- inkscape:pageopacity="0.0"
- inkscape:pageshadow="2"
- inkscape:zoom="6.3664628"
- inkscape:cx="93.340685"
- inkscape:cy="27.377839"
- inkscape:document-units="px"
- inkscape:current-layer="g4674"
- showgrid="true"
- inkscape:window-width="1920"
- inkscape:window-height="1029"
- inkscape:window-x="0"
- inkscape:window-y="24"
- inkscape:window-maximized="1"
- fit-margin-top="0"
- fit-margin-left="0"
- fit-margin-right="0"
- fit-margin-bottom="0"
- showguides="true"
- inkscape:guide-bbox="true">
- <inkscape:grid
- type="xygrid"
- id="grid2992"
- empspacing="6"
- visible="true"
- enabled="true"
- snapvisiblegridlinesonly="true"
- originx="4.2039363e-07px"
- originy="0px" />
- <sodipodi:guide
- orientation="1,0"
- position="45,11"
- id="guide3763" />
- <sodipodi:guide
- orientation="0,1"
- position="48,45"
- id="guide3765" />
- </sodipodi:namedview>
- <metadata
- id="metadata3138">
- <rdf:RDF>
- <cc:Work
- rdf:about="">
- <dc:format>image/svg+xml</dc:format>
- <dc:type
- rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
- </cc:Work>
- </rdf:RDF>
- </metadata>
- <g
- inkscape:label="Layer 1"
- inkscape:groupmode="layer"
- id="layer1"
- transform="translate(4.2039363e-7,-962.3622)">
- <g
- id="g4978"
- transform="matrix(0.99934414,0,0,1,-106.92982,549.00002)">
- <g
- id="g4674"
- transform="matrix(1.0006563,0,0,1,-155.17195,-2.6171874e-6)">
- <rect
- y="431.36218"
- x="262"
- height="72"
- width="72"
- id="rect4869"
- style="opacity:0.01000001;color:#000000;fill:none;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- 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"
- 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"
- id="rect4871"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="zsszssz" />
- <path
- 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"
- d="m 262,428.36218 0,6 45,0 0,-6 z m 72,0 0,6 18,0 0,-6 z"
- id="rect4882"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccccccc" />
- <path
- id="path4887"
- d="m 262,455.36218 0,6 18,0 0,-6 z m 45,0 0,6 45,0 0,-6 z"
- 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"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="cccccccccc" />
- <path
- sodipodi:nodetypes="cccccccccc"
- inkscape:connector-curvature="0"
- 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"
- d="m 262,482.36218 0,6 45,0 0,-6 z m 72,0 0,6 18,0 0,-6 z"
- id="path4889" />
- <rect
- y="413.36218"
- x="262"
- height="90"
- width="90"
- id="rect2993"
- style="color:#000000;fill:none;stroke:none;stroke-width:11.80000019;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
- <path
- sodipodi:nodetypes="zsszssz"
- inkscape:connector-curvature="0"
- id="path3775"
- 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"
- 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" />
- <path
- 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"
- 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"
- id="path3777"
- inkscape:connector-curvature="0"
- sodipodi:nodetypes="zsszssz" />
- </g>
- </g>
- </g>
-</svg>
=== modified file 'src/app/qml/common/ContentHubProxy.qml'
--- src/app/qml/common/ContentHubProxy.qml 2015-09-21 11:15:29 +0000
+++ src/app/qml/common/ContentHubProxy.qml 2015-10-19 11:44:23 +0000
@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
+import QtQuick 2.4
import Ubuntu.Content 1.1
import DocumentViewer 1.0
=== modified file 'src/app/qml/common/DetailsPage.qml'
--- src/app/qml/common/DetailsPage.qml 2015-04-15 14:21:48 +0000
+++ src/app/qml/common/DetailsPage.qml 2015-10-19 11:44:23 +0000
@@ -14,45 +14,127 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
-import Ubuntu.Components.ListItems 1.0 as ListItem
+import QtQuick 2.4
+import Ubuntu.Components 1.2
+import Ubuntu.Components.ListItems 1.0 as ListItems
import "utils.js" as Utils
+// FIXME: Autopilot tests
+
Page {
id: detailsPage
objectName: "detailsPage"
-
title: i18n.tr("Details")
Column {
- width: parent.width
-
- ListItem.Subtitled {
- text: i18n.tr("Location")
- subText: file.path
- }
- ListItem.Subtitled {
- text: i18n.tr("Size")
- subText: Utils.printSize(i18n, file.info.size)
- }
-
- ListItem.Subtitled {
- text: i18n.tr("Created")
- subText: file.info.creationTime.toLocaleString(Qt.locale())
- }
-
- ListItem.Subtitled {
- text: i18n.tr("Last modified")
- subText: file.info.lastModified.toLocaleString(Qt.locale())
- }
-
- ListItem.Subtitled {
- id: mimetypeItem
+ width: Math.min(units.gu(80), parent.width)
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ horizontalCenter: parent.horizontalCenter
+ }
+
+ ListItem {
+ Column {
+ anchors {
+ left: parent.left; right: parent.right
+ margins: units.gu(2)
+ verticalCenter: parent.verticalCenter
+ }
+
+ Label {
+ text: i18n.tr("Location")
+ color: UbuntuColors.midAubergine
+ }
+ Label {
+ text: file.path
+ fontSize: "small"
+ }
+ }
+ }
+
+ ListItem {
+ Column {
+ anchors {
+ left: parent.left; right: parent.right
+ margins: units.gu(2)
+ verticalCenter: parent.verticalCenter
+ }
+
+ Label {
+ text: i18n.tr("Size")
+ color: UbuntuColors.midAubergine
+ }
+ Label {
+ text: Utils.printSize(i18n, file.info.size)
+ fontSize: "small"
+ }
+ }
+ }
+
+ ListItem {
+ Column {
+ anchors {
+ left: parent.left; right: parent.right
+ margins: units.gu(2)
+ verticalCenter: parent.verticalCenter
+ }
+
+ Label {
+ text: i18n.tr("Created")
+ color: UbuntuColors.midAubergine
+ }
+ Label {
+ text: file.info.creationTime.toLocaleString(Qt.locale())
+ fontSize: "small"
+ }
+ }
+ }
+
+ ListItem {
+ Column {
+ anchors {
+ left: parent.left; right: parent.right
+ margins: units.gu(2)
+ verticalCenter: parent.verticalCenter
+ }
+
+ Label {
+ text: i18n.tr("Last modified")
+ color: UbuntuColors.midAubergine
+ }
+ Label {
+ text: file.info.lastModified.toLocaleString(Qt.locale())
+ fontSize: "small"
+ }
+ }
+ }
+
+ ListItem {
+ // Used by Autopilot tests
objectName: "mimetypeItem"
- text: i18n.tr("MIME type")
- subText: file.mimetype.name
+ property alias text: mimetypeText.text
+ property alias subText: mimetypeSubText.text
+
+ Column {
+ anchors {
+ left: parent.left; right: parent.right
+ margins: units.gu(2)
+ verticalCenter: parent.verticalCenter
+ }
+
+ Label {
+ id: mimetypeText
+ text: i18n.tr("MIME type")
+ color: UbuntuColors.midAubergine
+ }
+ Label {
+ id: mimetypeSubText
+ text: file.mimetype.name
+ fontSize: "small"
+ }
+ }
}
}
}
=== modified file 'src/app/qml/common/FileNotFoundDialog.qml'
--- src/app/qml/common/FileNotFoundDialog.qml 2015-04-07 21:40:16 +0000
+++ src/app/qml/common/FileNotFoundDialog.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
// We may want to refactor this dialog for a more generic usage, when we'll need it.
=== modified file 'src/app/qml/common/NightModeShader.qml'
--- src/app/qml/common/NightModeShader.qml 2015-03-26 14:09:38 +0000
+++ src/app/qml/common/NightModeShader.qml 2015-10-19 11:44:23 +0000
@@ -14,7 +14,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
+import QtQuick 2.4
ShaderEffect {
fragmentShader: "
=== modified file 'src/app/qml/common/PickImportedDialog.qml'
--- src/app/qml/common/PickImportedDialog.qml 2015-09-11 14:48:57 +0000
+++ src/app/qml/common/PickImportedDialog.qml 2015-10-19 11:44:23 +0000
@@ -14,10 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
-import Ubuntu.Components.ListItems 1.0 as ListItem
import "utils.js" as Utils
@@ -29,17 +28,24 @@
title: i18n.tr("Multiple documents imported")
text: i18n.tr("Choose which one to open:")
- // We don't use a Flickable, since it already lives in the Dialog itself.
+ // We don't use a Flickable, since the Dialog has already one.
Repeater {
id: repeater
- ListItem.Standard {
- text: Utils.getNameOfFile(model.path)
- __foregroundColor: Theme.palette.selected.backgroundText
+ ListItem {
onClicked: {
PopupUtils.close(multipleImportDialog);
mainView.openDocument(model.path);
}
+
+ Label {
+ text: Utils.getNameOfFile(model.path)
+ anchors {
+ left: parent.left; right: parent.right
+ margins: units.gu(2)
+ verticalCenter: parent.verticalCenter
+ }
+ }
}
}
=== modified file 'src/app/qml/common/RejectedImportDialog.qml'
--- src/app/qml/common/RejectedImportDialog.qml 2015-09-11 14:48:57 +0000
+++ src/app/qml/common/RejectedImportDialog.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
Dialog {
@@ -23,7 +23,7 @@
property alias model: repeater.model
- signal closed
+ signal closed()
title: i18n.tr("File not supported", "Files not supported", repeater.count)
text: i18n.tr("Following document has not been imported:",
=== modified file 'src/app/qml/common/UnknownTypeDialog.qml'
--- src/app/qml/common/UnknownTypeDialog.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/common/UnknownTypeDialog.qml 2015-10-19 11:44:23 +0000
@@ -14,9 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
+import QtQuick.Layouts 1.1
import "loadComponent.js" as LoadComponent
@@ -24,20 +25,31 @@
id: unknownDialog
objectName: "unknownDialog"
title: i18n.tr("Unknown file type")
- 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?")
- Button {
- text: i18n.tr("Yes")
- color: UbuntuColors.green
-
- onClicked: {
- LoadComponent.load("text/plain");
- PopupUtils.close(unknownDialog)
- }
- }
- Button {
- text: i18n.tr("No")
- color: UbuntuColors.red
- onClicked: PopupUtils.close(unknownDialog)
+ 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?")
+
+ RowLayout {
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: units.gu(-1)
+ }
+
+ Button {
+ text: i18n.tr("Cancel")
+ onClicked: PopupUtils.close(unknownDialog)
+ Layout.fillWidth: true
+ }
+
+ Button {
+ text: i18n.tr("Yes")
+ color: UbuntuColors.green
+ Layout.fillWidth: true
+
+ onClicked: {
+ LoadComponent.load("text/plain");
+ PopupUtils.close(unknownDialog)
+ }
+ }
}
}
=== modified file 'src/app/qml/common/utils.js'
--- src/app/qml/common/utils.js 2015-03-04 17:48:47 +0000
+++ src/app/qml/common/utils.js 2015-10-19 11:44:23 +0000
@@ -36,3 +36,31 @@
function getNameOfFile(path) {
return path.toString().substring(path.lastIndexOf('/') + 1);
}
+
+function getIconNameFromMimetype(mimetype) {
+ if (mimetype.substring(0, 5) === "text/")
+ return "text-x-generic-symbolic"
+
+ if (mimetype.substring(0, 5) === "image")
+ return "image-x-generic-symbolic"
+
+ if (mimetype === "application/pdf")
+ return "application-pdf-symbolic"
+
+ if (mimetype === "application/vnd.oasis.opendocument.text"
+ || mimetype === "application/msword"
+ || mimetype === "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
+ return "x-office-document-symbolic"
+
+ if (mimetype === "application/vnd.oasis.opendocument.spreadsheet"
+ || mimetype === "application/vnd.ms-excel"
+ || mimetype === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
+ return "x-office-spreadsheet-symbolic"
+
+ if (mimetype === "application/vnd.oasis.opendocument.presentation"
+ || mimetype === "application/vnd.ms-powerpoint"
+ || mimetype === "application/vnd.openxmlformats-officedocument.presentationml.presentation")
+ return "x-office-presentation-symbolic"
+
+ return "package-x-generic-symbolic"
+}
=== modified file 'src/app/qml/documentPage/DeleteFileDialog.qml'
--- src/app/qml/documentPage/DeleteFileDialog.qml 2015-07-01 16:05:59 +0000
+++ src/app/qml/documentPage/DeleteFileDialog.qml 2015-10-19 11:44:23 +0000
@@ -15,56 +15,69 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.0
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
+import QtQuick.Layouts 1.1
Dialog {
id: deleteFileDialog
property string path
- property int __deleteCount: documentPage.view.item.selectedItems.count
+ property var selectedIndices: viewLoader.item.ViewItems.selectedIndices;
+ property int deleteCount: selectedIndices.length
- // WORKAROUND: This property is used only when user wants to remove a single
- // file from a delegate action, and the value of the property is read during
- // the Component.onDestruction event.
+ // WORKAROUND: This property is only used when the dialog is opened from a
+ // ListView delegate action for removing a single file.
+ // In this case, we remove the file as soon as the dialog is destroyed
+ // (it means that docModel.rm() is called externally).
// We do this because we need to avoid that the entry in the model is removed
// before this dialog is closed.
// See src/app/qml/documentPage/DocumentDelegateActions.qml
property bool confirmed: false
- title: path ? i18n.tr("Delete file") :
- i18n.tr("Delete %1 file", "Delete %1 files", __deleteCount).arg(__deleteCount)
- text: path ? i18n.tr("Are you sure you want to permanently delete this file?") :
- i18n.tr("Are you sure you want to permanently delete this file?",
- "Are you sure you want to permanently delete these files?",
- __deleteCount)
-
- Button {
- text: i18n.tr("Cancel")
- onClicked: PopupUtils.close(deleteFileDialog)
- }
-
- Button {
- text: i18n.tr("Delete")
- color: UbuntuColors.red
-
- onClicked: {
- if (deleteFileDialog.path) {
- deleteFileDialog.confirmed = true;
- } else {
- // This is called from selection mode
- var items = documentPage.view.item.selectedItems;
-
- for (var i=0; i < items.count; i++) {
- console.log("Removing:", items.get(i).model.path);
- docModel.rm(items.get(i).model.path);
+ title: path ? i18n.tr("Delete file")
+ : i18n.tr("Delete %1 file", "Delete %1 files", deleteCount).arg(deleteCount)
+ text: path ? i18n.tr("Are you sure you want to permanently delete this file?")
+ : i18n.tr("Are you sure you want to permanently delete this file?",
+ "Are you sure you want to permanently delete these files?",
+ deleteCount)
+
+
+ RowLayout {
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: units.gu(-1)
+ }
+
+ Button {
+ text: i18n.tr("Cancel")
+ onClicked: PopupUtils.close(deleteFileDialog)
+ Layout.fillWidth: true
+ }
+
+ Button {
+ text: i18n.tr("Delete")
+ color: UbuntuColors.red
+ Layout.fillWidth: true
+
+ onClicked: {
+ if (deleteFileDialog.path) {
+ // WORKAROUND: See above.
+ deleteFileDialog.confirmed = true;
+ } else {
+ // This is called from selection mode
+ for (var i=0; i < selectedIndices.length; i++) {
+ console.log("Removing:", folderModel.get(selectedIndices[i]).path);
+ docModel.rm(folderModel.get(selectedIndices[i]).path);
+ }
+
+ viewLoader.item.cancelSelection();
}
- viewLoader.item.endSelection();
+ PopupUtils.close(deleteFileDialog)
}
-
- PopupUtils.close(deleteFileDialog)
}
}
}
=== modified file 'src/app/qml/documentPage/DocumentDelegateActions.qml'
--- src/app/qml/documentPage/DocumentDelegateActions.qml 2015-09-09 17:18:12 +0000
+++ src/app/qml/documentPage/DocumentDelegateActions.qml 2015-10-19 11:44:23 +0000
@@ -14,10 +14,12 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.0
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
+// TODO: Probably requires some change in order to work with latest ListItem 1.2
+
QtObject {
property list<Action> leadingActions: [
Action {
@@ -27,12 +29,13 @@
var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"),
documentPage, { path: model.path })
+ // See DeleteFileDialog.qml
dialog.Component.destruction.connect(function() {
if (dialog.confirmed) {
console.log("Removing:", model.path);
docModel.rm(model.path);
}
- });
+ })
}
}
]
=== modified file 'src/app/qml/documentPage/DocumentEmptyState.qml'
--- src/app/qml/documentPage/DocumentEmptyState.qml 2015-09-09 17:05:58 +0000
+++ src/app/qml/documentPage/DocumentEmptyState.qml 2015-10-19 11:44:23 +0000
@@ -14,7 +14,7 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.0
+import QtQuick 2.4
import "../upstreamComponents"
Item {
=== removed file 'src/app/qml/documentPage/DocumentGridDelegate.qml'
--- src/app/qml/documentPage/DocumentGridDelegate.qml 2015-09-09 14:05:46 +0000
+++ src/app/qml/documentPage/DocumentGridDelegate.qml 1970-01-01 00:00:00 +0000
@@ -1,113 +0,0 @@
-/*
- Copyright (C) 2015 Stefano Verzegnassi
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License 3 as published by
- the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see http://www.gnu.org/licenses/.
-*/
-
-import QtQuick 2.0
-import Ubuntu.Components 1.1
-
-import "../common/utils.js" as Utils
-
-TileBase {
- id: root
-
- function formattedDateTime() {
- var date = new Date(model.date)
- var diff = model.dateDiff
-
- if (diff < 1)
- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
- return i18n.tr("Today, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
-
- if (diff < 2)
- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
- return i18n.tr("Yesterday, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
-
- if (diff < 7)
- // TRANSLATORS: this is a datetime formatting string,
- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
- return Qt.formatDateTime(date, i18n.tr("dddd, hh:mm"))
-
- // TRANSLATORS: this is a datetime formatting string,
- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
- return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm"))
- }
-
- title: model.name
- text: formattedDateTime()
- subText: Utils.printSize(i18n, model.size)
-
- leadingActions: documentDelegateActions.leadingActions
- trailingActions: documentDelegateActions.trailingActions
-
- Icon {
- id: extStorageIcon
-
- width: units.gu(4)
- height: units.gu(4)
- anchors {
- left: parent.left
- top: parent.top
- margins: units.gu(0.5)
- }
-
- visible: model.isFromExternalStorage
- name: "sdcard-symbolic"
- }
-
- // Document mimetype icon
- Icon {
- anchors.centerIn: parent
- width: units.gu(8); height: width
-
- // At the moment the suru icon theme doesn't have much icons.
- // Just some note for the future:
- // TODO: Add icons for Office/ODF documents
- // TODO: Whenever there will be icons for source code files, add them.
- name: {
- if (model.mimetype.substring(0, 5) === "text/")
- return "text-x-generic-symbolic"
-
- if (model.mimetype.substring(0, 5) === "image")
- return "image-x-generic-symbolic"
-
- if (model.mimetype === "application/pdf")
- return "application-pdf-symbolic"
-
- return "package-x-generic-symbolic"
- }
- }
-
- // Cover
- /* Image {
- anchors.fill: parent
-
- source: {
- if (model.cover !== "" && typeof model.cover !== "undefined")
- return model.cover
-
- if (model.mimetype.toString().indexOf("image") !== -1)
- return model.path
-
- return ""
- }
-
- sourceSize.width: width
- fillMode: Image.PreserveAspectCrop
- }*/
-
- DocumentDelegateActions { id: documentDelegateActions }
-}
=== removed file 'src/app/qml/documentPage/DocumentGridView.qml'
--- src/app/qml/documentPage/DocumentGridView.qml 2015-09-19 17:51:46 +0000
+++ src/app/qml/documentPage/DocumentGridView.qml 1970-01-01 00:00:00 +0000
@@ -1,94 +0,0 @@
-/*
- Copyright (C) 2015 Stefano Verzegnassi
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License 3 as published by
- the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see http://www.gnu.org/licenses/.
-*/
-
-import QtQuick 2.0
-import Ubuntu.Components 1.1
-
-import "../upstreamComponents"
-
-MultipleSelectionGridView {
- id: documentGridView
-
- // We use mainView.width to calculate the size and the spacing of elements.
- // That's because this GridView always fills (and always will) the whole size of MainView.
- // By this way, we can avoid binding loops, keeping the code pretty simple.
- anchors {
- fill: parent
- margins: units.gu(0.5)
- leftMargin: (mainView.width % cellWidth) * 0.5
- rightMargin: (mainView.width % cellWidth) * 0.5
- }
- clip: true
-
- cellHeight: cellWidth
- cellWidth: (mainView.width > units.gu(50)) ? units.gu(24)
- : (mainView.width - units.gu(2)) * 0.5
-
- // We allow multiple selection both in selection and pick mode.
- multipleSelection: {
- // No active transfer, then we're in selection mode.
- if (!contentHubProxy.activeTransfer)
- return true
-
- // We have an active transfer, get the value from the content hub proxy
- return contentHubProxy.multipleSelectionType
- }
-
- listDelegate: DocumentGridDelegate {
- id: delegate
- width: cellWidth
- height: cellHeight
-
- selectionMode: documentGridView.isInSelectionMode
- selected: documentGridView.isSelected(delegate)
-
- onClicked: {
- if(documentGridView.isInSelectionMode) {
- if(!documentGridView.selectItem(delegate)) {
- documentGridView.deselectItem(delegate)
- }
- return
- }
- else {
- mainView.openDocument(model.path)
- }
- }
-
- onPressAndHold: {
- if (!documentGridView.isInSelectionMode) {
- documentGridView.startSelection()
- documentGridView.selectItem(delegate)
- }
- }
- }
-
- listModel: folderModel
-
- Scrollbar {
- flickableItem: documentGridView
- parent: documentGridView.parent
- }
-
- Connections {
- target: sortSettings
-
- onSortModeChanged: {
- documentGridView.positionViewAtBeginning()
- }
- }
-
- Component.onCompleted: { if (mainView.pickMode) documentGridView.startSelection(); }
-}
=== modified file 'src/app/qml/documentPage/DocumentListDelegate.qml'
--- src/app/qml/documentPage/DocumentListDelegate.qml 2015-09-09 14:05:46 +0000
+++ src/app/qml/documentPage/DocumentListDelegate.qml 2015-10-19 11:44:23 +0000
@@ -14,147 +14,118 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.0
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
-import QtGraphicalEffects 1.0
+import DocumentViewer 1.0
import "../common/utils.js" as Utils
-import "../upstreamComponents"
-
-ListItemWithActions {
- property QtObject documentDelegateActions: DocumentDelegateActions { }
-
- function formattedDateTime() {
- var date = new Date(model.date)
- var diff = model.dateDiff
-
- if (sortSettings.sortMode !== 0) { // The sort rule is not "by date"
- switch(diff) {
- case 0: // DocumentsModel.Today
- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
- return i18n.tr("Today, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
-
- case 1: // DocumentsModel.Yesterday
- // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
- // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
- return i18n.tr("Yesterday, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
-
- default: // DocumentsModel.LastWeek || DocumentsModel.LastMonth || DocumentsModel.Earlier
- // TRANSLATORS: this is a datetime formatting string,
- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
- return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm"))
- }
- } else {
- switch(diff) {
- case 0: // DocumentsModel.Today, or
- case 1: // DocumentsModel.Yesterday
- return Qt.formatDateTime(date, Qt.locale().timeFormat(Locale.ShortFormat))
-
- case 2: // DocumentsModel.LastWeek
- // TRANSLATORS: this is a datetime formatting string,
- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
- return Qt.formatDateTime(date, i18n.tr("dddd, hh:mm"))
-
- default: // DocumentsModel.LastMonth || DocumentsModel.Earlier
- // TRANSLATORS: this is a datetime formatting string,
- // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
- return Qt.formatDateTime(date, i18n.tr("dd-MM-yyyy hh:mm"))
- }
- }
- }
-
- anchors { left: parent.left; right: parent.right }
- height: units.gu(8)
-
- locked: documentPage.state == "pickMode"
-
- leftSideAction: documentDelegateActions.leadingActions[0]
- rightSideActions: documentDelegateActions.trailingActions
-
- contents: RowLayout {
- anchors.fill: parent
+
+// TODO: Ask for a review of this component to the design team
+
+ListItem {
+ id: listDelegate
+ height: units.gu(9)
+ leadingActions: ListItemActions { actions: documentDelegateActions.leadingActions }
+ trailingActions: ListItemActions { actions: documentDelegateActions.trailingActions }
+
+ RowLayout {
spacing: units.gu(2)
+ anchors {
+ fill: parent; margins: units.gu(1)
+ leftMargin: units.gu(2)
+ rightMargin: units.gu(2)
+ }
Icon {
+ name: Utils.getIconNameFromMimetype(model.mimetype)
Layout.preferredWidth: height
Layout.preferredHeight: units.gu(5)
-
- // At the moment the suru icon theme doesn't have much icons.
- name: {
- if (model.mimetype.substring(0, 5) === "text/")
- return "text-x-generic-symbolic"
-
- if (model.mimetype.substring(0, 5) === "image")
- return "image-x-generic-symbolic"
-
- if (model.mimetype === "application/pdf")
- return "application-pdf-symbolic"
-
- if (model.mimetype === "application/vnd.oasis.opendocument.text"
- || model.mimetype === "application/msword"
- || model.mimetype === "application/vnd.openxmlformats-officedocument.wordprocessingml.document")
- return "x-office-document-symbolic"
-
- if (model.mimetype === "application/vnd.oasis.opendocument.spreadsheet"
- || model.mimetype === "application/vnd.ms-excel"
- || model.mimetype === "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
- return "x-office-spreadsheet-symbolic"
-
- if (model.mimetype === "application/vnd.oasis.opendocument.presentation"
- || model.mimetype === "application/vnd.ms-powerpoint"
- || model.mimetype === "application/vnd.openxmlformats-officedocument.presentationml.presentation")
- return "x-office-presentation-symbolic"
-
- return "package-x-generic-symbolic"
- }
-
- Rectangle {
- anchors {
- right: parent.right
- bottom: parent.bottom
- }
-
- width: units.gu(2.5)
- height: units.gu(2.5)
-
- visible: model.isFromExternalStorage
- color: mainView.backgroundColor
-
- Icon {
- anchors.fill: parent
- name: "sdcard-symbolic"
- }
- }
}
Column {
Layout.fillWidth: true
- Label {
- text: model.name
- wrapMode: Text.Wrap
- width: parent.width
-
- color: UbuntuColors.midAubergine
- }
-
RowLayout {
width: parent.width
-
Label {
- text: formattedDateTime()
- fontSize: "small"
-
+ text: model.name
+ //wrapMode: Text.Wrap
+ elide: Text.ElideRight
+ color: UbuntuColors.midAubergine
Layout.fillWidth: true
}
-
Label {
text: Utils.printSize(i18n, model.size)
fontSize: "small"
}
}
+
+ RowLayout {
+ width: parent.width
+ Label {
+ text: internal.formattedDateTime()
+ fontSize: "small"
+
+ Layout.fillWidth: true
+ }
+ Icon {
+ width: units.gu(2); height: width
+ name: "sdcard-symbolic"
+ visible: model.isFromExternalStorage
+ }
+ }
+ }
+ }
+
+ DocumentDelegateActions { id: documentDelegateActions }
+
+ QtObject {
+ id: internal
+
+ function formattedDateTime() {
+ var date = new Date(model.date)
+ var diff = model.dateDiff
+
+ if (sortSettings.sortMode !== 0) { // Sort is not "by date"
+ switch(diff) {
+ case DocumentsModel.Today:
+ // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
+ // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
+ return i18n.tr("Today, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
+
+ case DocumentsModel.Yesterday:
+ // TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
+ // http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
+ return i18n.tr("Yesterday, %1").arg(Qt.formatTime(date, Qt.locale().timeFormat(Locale.ShortFormat)))
+
+ case DocumentsModel.LastWeek:
+ case DocumentsModel.LastMonth:
+ case DocumentsModel.Earlier:
+ // TRANSLATORS: this is a datetime formatting string,
+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+ return Qt.formatDateTime(date, i18n.tr("yyyy/MM/dd hh:mm"))
+ }
+ }
+
+ else { //
+ switch(diff) { // Sort "by date"
+ case DocumentsModel.Today:
+ case DocumentsModel.Yesterday:
+ return Qt.formatDateTime(date, Qt.locale().timeFormat(Locale.ShortFormat))
+
+ case DocumentsModel.LastWeek:
+ // TRANSLATORS: this is a datetime formatting string,
+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+ return Qt.formatDateTime(date, i18n.tr("dddd, hh:mm"))
+
+ case DocumentsModel.LastMonth:
+ case DocumentsModel.Earlier:
+ // TRANSLATORS: this is a datetime formatting string,
+ // see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
+ return Qt.formatDateTime(date, i18n.tr("yyyy/MM/dd hh:mm"))
+ }
+ }
}
}
}
=== modified file 'src/app/qml/documentPage/DocumentListView.qml'
--- src/app/qml/documentPage/DocumentListView.qml 2015-09-19 17:51:46 +0000
+++ src/app/qml/documentPage/DocumentListView.qml 2015-10-19 11:44:23 +0000
@@ -14,42 +14,17 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.0
-import Ubuntu.Components 1.1
-import Ubuntu.Components.ListItems 1.0 as ListItem
-import DocumentViewer 1.0
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import "../upstreamComponents"
-MultipleSelectionListView {
+ListView {
id: documentListView
-
anchors { fill: parent; margins: units.gu(0.5) }
clip: true
- property var _currentSwipedItem: null
-
- function _updateSwipeState(item)
- {
- if (item.swipping) {
- return
- }
-
- if (item.swipeState !== "Normal") {
- if (documentListView._currentSwipedItem !== item) {
- if (documentListView._currentSwipedItem) {
- documentListView._currentSwipedItem.resetSwipe()
- }
- documentListView._currentSwipedItem = item
- }
- } else if (item.swipeState !== "Normal"
- && documentListView._currentSwipedItem === item) {
- documentListView._currentSwipedItem = null
- }
- }
-
- // We allow multiple selection both in selection and pick mode.
- multipleSelection: {
+ function isMultipleSelection() {
// No active transfer, then we're in selection mode.
if (!contentHubProxy.activeTransfer)
return true
@@ -58,127 +33,64 @@
return contentHubProxy.multipleSelectionType
}
- listDelegate: DocumentListDelegate {
- id: delegate
-
- property var removalAnimation
-
- function remove() {
- removalAnimation.start()
- }
-
- selectionMode: documentListView.isInSelectionMode
- selected: documentListView.isSelected(delegate)
-
- onSwippingChanged: {
- _updateSwipeState(delegate)
- }
-
- onSwipeStateChanged: {
- _updateSwipeState(delegate)
- }
-
- ListView.onRemove: ScriptAction {
- script: {
- if (_currentSwipedItem
- === delegate) {
- _currentSwipedItem = null
- }
- }
- }
-
- removalAnimation: SequentialAnimation {
- alwaysRunToEnd: true
-
- PropertyAction {
- target: delegate
- property: "ListView.delayRemove"
- value: true
- }
-
- UbuntuNumberAnimation {
- target: delegate
- property: "height"
- to: 0
- }
-
- PropertyAction {
- target: delegate
- property: "ListView.delayRemove"
- value: false
- }
-
- ScriptAction {
- script: {
- var filePath = d.folderModel.get(index, "filePath")
- Storage.rm(filePath)
- }
- }
- }
-
- onItemClicked: {
- if(documentListView.isInSelectionMode) {
- if(!documentListView.selectItem(delegate)) {
- documentListView.deselectItem(delegate)
- }
- return
- }
-
- else {
- mainView.openDocument(model.path)
- }
- }
-
- onItemPressAndHold: {
- if (!documentListView.isInSelectionMode) {
- documentListView.startSelection()
- documentListView.selectItem(delegate)
- }
- }
- }
-
- listModel: folderModel
-
- section.property: {
- switch (sortSettings.sortMode) {
- case 0: // sort by date
- return "dateDiff"
- case 1: // sort by name
- return "name"
- default: // sort by size -> do not show section header
- return ""
- }
- }
-
- section.criteria: {
- if (sortSettings.sortMode === 1) // sort by name
- return ViewSection.FirstCharacter
-
- return ViewSection.FullString
- }
-
- section.delegate: ListItem.Header {
- text: {
+ function clearSelection() {
+ ViewItems.selectedIndices = []
+ }
+
+ function selectAll() {
+ clearSelection()
+
+ for (var i=0; i < model.count; i++) {
+ ViewItems.selectedIndices.push(i)
+ }
+ }
+
+ function cancelSelection() {
+ clearSelection()
+ ViewItems.selectMode = false
+ }
+
+ function startSelection() {
+ ViewItems.selectMode = true
+ }
+
+ model: folderModel
+ delegate: DocumentListDelegate {
+ onClicked: {
+ if (selectMode) {
+ if (!isMultipleSelection())
+ clearSelection()
+
+ selected = !selected
+ return;
+ }
+
+ mainView.openDocument(model.path)
+ }
+
+ onPressAndHold: {
+ ListView.view.ViewItems.selectMode = !ListView.view.ViewItems.selectMode
+ selected = true
+ }
+ }
+
+ section {
+ delegate: SectionHeader { }
+ property: {
+ switch (sortSettings.sortMode) {
+ case 0: // sort by date
+ return "dateDiff"
+ case 1: // sort by name
+ return "name"
+ default: // sort by size -> do not show section header
+ return ""
+ }
+ }
+ criteria: {
if (sortSettings.sortMode === 1) // sort by name
- return section.toUpperCase()
-
- if (sortSettings.sortMode === 0) { // sort by date
- if (section == DocumentsModel.Today)
- return i18n.tr("Today")
-
- if (section == DocumentsModel.Yesterday)
- return i18n.tr("Yesterday")
-
- if (section == DocumentsModel.LastWeek)
- return i18n.tr("Earlier this week")
-
- if (section == DocumentsModel.LastMonth)
- return i18n.tr("Earlier this month")
-
- return i18n.tr("Even earlier...")
- }
-
- return ""
+ return ViewSection.FirstCharacter
+
+ return ViewSection.FullString
}
}
@@ -189,11 +101,8 @@
Connections {
target: sortSettings
-
- onSortModeChanged: {
- documentListView.positionViewAtBeginning()
- }
+ onSortModeChanged: documentListView.positionViewAtBeginning()
}
- Component.onCompleted: { if (mainView.pickMode) documentListView.startSelection(); }
+ Component.onCompleted: if (mainView.pickMode) documentListView.startSelection()
}
=== modified file 'src/app/qml/documentPage/DocumentPage.qml'
--- src/app/qml/documentPage/DocumentPage.qml 2015-09-11 14:48:57 +0000
+++ src/app/qml/documentPage/DocumentPage.qml 2015-10-19 11:44:23 +0000
@@ -14,13 +14,12 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.0
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Qt.labs.settings 1.0
Page {
id: documentPage
-
title: i18n.tr("Documents")
flickable: null
@@ -41,12 +40,23 @@
Loader {
id: viewLoader
- anchors.fill: parent
-
- source: (folderModel.count === 0) ? documentPage.state == "search" ? Qt.resolvedUrl("./SearchEmptyState.qml")
- : Qt.resolvedUrl("./DocumentEmptyState.qml")
- : useGridView ? Qt.resolvedUrl("./DocumentGridView.qml")
- : Qt.resolvedUrl("./DocumentListView.qml")
+
+ width: Math.min(units.gu(80), parent.width)
+ anchors {
+ top: parent.top
+ bottom: parent.bottom
+ horizontalCenter: parent.horizontalCenter
+ }
+
+ source: {
+ if (folderModel.count === 0) {
+ return documentPage.state == "search"
+ ? Qt.resolvedUrl("SearchEmptyState.qml")
+ : Qt.resolvedUrl("BrowserEmptyState.qml")
+ }
+
+ return Qt.resolvedUrl("DocumentListView.qml")
+ }
}
// *** HEADER ***
@@ -54,7 +64,7 @@
DocumentPageDefaultHeader {
name: "default"
targetPage: documentPage
- when: !mainView.pickMode && !viewLoader.item.isInSelectionMode && !documentPage.searchMode
+ when: !mainView.pickMode && !viewLoader.item.ViewItems.selectMode && !documentPage.searchMode
},
DocumentPagePickModeHeader {
@@ -66,13 +76,13 @@
DocumentPageSelectionModeHeader {
name: "selection"
targetPage: documentPage
- when: !mainView.pickMode && viewLoader.item.isInSelectionMode
+ when: !mainView.pickMode && viewLoader.item.ViewItems.selectMode
},
DocumentPageSearchHeader {
name: "search"
targetPage: documentPage
- when: !mainView.pickMode && !viewLoader.item.isInSelectionMode && documentPage.searchMode
+ when: !mainView.pickMode && !viewLoader.item.ViewItems.selectMode && documentPage.searchMode
}
]
=== modified file 'src/app/qml/documentPage/DocumentPageDefaultHeader.qml'
--- src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-06-12 14:47:40 +0000
+++ src/app/qml/documentPage/DocumentPageDefaultHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
PageHeadState {
@@ -29,25 +29,23 @@
text: i18n.tr("Search...")
iconName: "search"
onTriggered: targetPage.searchMode = true
-
visible: folderModel.count !== 0
},
Action {
text: i18n.tr("Sorting settings...")
- iconSource: Qt.resolvedUrl("../../graphics/settings_alt.svg")
+ iconName: "settings"
onTriggered: PopupUtils.open(Qt.resolvedUrl("SortSettingsDialog.qml"))
-
visible: folderModel.count !== 0
- },
+ }
+ /*
Action {
- id: switchView
text: targetPage.useGridView ? i18n.tr("Switch to single column list") : i18n.tr("Switch to grid")
iconName: targetPage.useGridView ? "view-list-symbolic" : "view-grid-symbolic"
onTriggered: targetPage.useGridView = !targetPage.useGridView
-
visible: folderModel.count !== 0
}
+ */
]
}
=== modified file 'src/app/qml/documentPage/DocumentPagePickModeHeader.qml'
--- src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-09-11 14:48:57 +0000
+++ src/app/qml/documentPage/DocumentPagePickModeHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Content 1.1
PageHeadState {
@@ -55,10 +55,10 @@
return;
var urlList = []
- var items = documentPage.view.item.selectedItems;
+ var indices = documentPage.view.item.selectedIndices;
- for (var i=0; i < items.count; i++) {
- urlList.push("file://" + items.get(i).model.path);
+ for (var i=0; i < indices.length; i++) {
+ urlList.push("file://" + folderModel.get(i).path);
}
contentHubProxy.activeTransfer.items = urlList
=== modified file 'src/app/qml/documentPage/DocumentPageSearchHeader.qml'
--- src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-06-12 14:04:40 +0000
+++ src/app/qml/documentPage/DocumentPageSearchHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
PageHeadState {
id: rootItem
=== modified file 'src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml'
--- src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-03-04 17:44:36 +0000
+++ src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
import "../upstreamComponents"
@@ -24,9 +24,10 @@
id: rootItem
property Page targetPage
-
head: targetPage.head
+ property bool selectedAll: viewLoader.item.ViewItems.selectedIndices.length == viewLoader.item.count
+
backAction: Action {
iconName: "close"
text: i18n.tr("Close")
@@ -35,61 +36,40 @@
}
}
- contents: Loader {
- id: selectionStateLoader
- active: documentPage.state === "selection"
- sourceComponent: Item {
- HeaderButton {
- id: selectButton
-
- anchors {
- right: deleteButton.left
- rightMargin: units.gu(1)
- }
-
- text: {
- if(viewLoader.item.selectedItems.count === viewLoader.item.count) {
- return i18n.tr("Select None")
- } else {
- return i18n.tr("Select All")
- }
- }
-
- iconSource: {
- if(viewLoader.item.selectedItems.count === viewLoader.item.count) {
- return Qt.resolvedUrl("../../graphics/select-none.svg")
- } else {
- return Qt.resolvedUrl("../../graphics/select.svg")
- }
- }
-
- onTriggered: {
- if(viewLoader.item.selectedItems.count === viewLoader.item.count) {
- viewLoader.item.clearSelection()
- } else {
- viewLoader.item.selectAll()
- }
- }
- }
-
- HeaderButton {
- id: deleteButton
-
- anchors.right: parent.right
- anchors.rightMargin: units.gu(2)
-
- iconName: "delete"
- text: i18n.tr("Delete")
- enabled: viewLoader.item.selectedItems.count !== 0
-
- onTriggered: {
- PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"), documentPage)
- }
- }
- }
-
- height: parent ? parent.height : undefined
- anchors.right: parent ? parent.right: undefined
+ actions: [
+ Action {
+ iconName: selectedAll ? "select-none" : "select"
+ text: selectedAll ? i18n.tr("Select None") : i18n.tr("Select All")
+
+ onTriggered: {
+ if (selectedAll) {
+ viewLoader.item.clearSelection()
+ } else {
+ viewLoader.item.selectAll()
+ }
+ }
+ },
+
+ Action {
+ iconName: "delete"
+ text: i18n.tr("Delete")
+ enabled: viewLoader.item.ViewItems.selectedIndices.length !== 0
+
+ onTriggered: PopupUtils.open(Qt.resolvedUrl("DeleteFileDialog.qml"), documentPage)
+ }
+ ]
+
+ // WORKAROUND: "preset" property of PageHeadConfiguration is still not
+ // exposed in PageHeadState.
+ contents: Item {
+ Connections {
+ target: targetPage
+ onStateChanged: {
+ if (targetPage.state === "selection")
+ head.preset = "select"
+ else
+ head.preset = ""
+ }
+ }
}
-
}
=== modified file 'src/app/qml/documentPage/SearchEmptyState.qml'
--- src/app/qml/documentPage/SearchEmptyState.qml 2015-06-10 17:22:28 +0000
+++ src/app/qml/documentPage/SearchEmptyState.qml 2015-10-19 11:44:23 +0000
@@ -14,7 +14,7 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.0
+import QtQuick 2.4
import "../upstreamComponents"
Item {
=== added file 'src/app/qml/documentPage/SectionHeader.qml'
--- src/app/qml/documentPage/SectionHeader.qml 1970-01-01 00:00:00 +0000
+++ src/app/qml/documentPage/SectionHeader.qml 2015-10-19 11:44:23 +0000
@@ -0,0 +1,29 @@
+import QtQuick 2.4
+import Ubuntu.Components 1.2
+import Ubuntu.Components.ListItems 1.0 as ListItem
+import DocumentViewer 1.0
+
+ListItem.Header {
+ text: {
+ if (sortSettings.sortMode === 1) // sort by name
+ return section.toUpperCase()
+
+ if (sortSettings.sortMode === 0) { // sort by date
+ if (section == DocumentsModel.Today)
+ return i18n.tr("Today")
+
+ if (section == DocumentsModel.Yesterday)
+ return i18n.tr("Yesterday")
+
+ if (section == DocumentsModel.LastWeek)
+ return i18n.tr("Earlier this week")
+
+ if (section == DocumentsModel.LastMonth)
+ return i18n.tr("Earlier this month")
+
+ return i18n.tr("Even earlier...")
+ }
+
+ return ""
+ }
+}
=== modified file 'src/app/qml/documentPage/SharePage.qml'
--- src/app/qml/documentPage/SharePage.qml 2015-09-09 17:18:12 +0000
+++ src/app/qml/documentPage/SharePage.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Content 1.1
Page {
=== modified file 'src/app/qml/documentPage/SortSettingsDialog.qml'
--- src/app/qml/documentPage/SortSettingsDialog.qml 2015-07-14 15:43:11 +0000
+++ src/app/qml/documentPage/SortSettingsDialog.qml 2015-10-19 11:44:23 +0000
@@ -15,8 +15,8 @@
along with this program. If not, see http://www.gnu.org/licenses/.
*/
-import QtQuick 2.0
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
import QtQuick.Layouts 1.1
@@ -51,6 +51,7 @@
Button {
text: i18n.tr("Close")
+ color: UbuntuColors.green
onClicked: PopupUtils.close(sortSettingsDialog)
}
}
=== removed file 'src/app/qml/documentPage/TileBase.qml'
--- src/app/qml/documentPage/TileBase.qml 2015-07-14 13:20:35 +0000
+++ src/app/qml/documentPage/TileBase.qml 1970-01-01 00:00:00 +0000
@@ -1,369 +0,0 @@
-/*
- Copyright (C) 2014, 2015 Canonical Ltd.
-
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License 3 as published by
- the Free Software Foundation.
-
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
-
- You should have received a copy of the GNU General Public License
- along with this program. If not, see http://www.gnu.org/licenses/.
-*/
-
-import QtQuick 2.0
-import Ubuntu.Components 1.1
-import Ubuntu.Components.Popups 1.0
-import Ubuntu.Components.ListItems 1.0 as ListItem
-
-AbstractButton {
- id: root
-
- property bool selected: false
- property bool selectionMode: false
-
- default property alias content: tileContent.data
-
- property alias title: titleLabel.text
- property alias text: textLabel.text
- property alias subText: subTextLabel.text
-
- // We don't really have swipe gesture here, but we anyway use the same
- // properties' name used for UITK1.2 ListItem just for consistency.
- property list<Action> trailingActions // Right to Left gesture in ListItem
- property list<Action> leadingActions // Left to Right gesture in ListItem
-
- Rectangle {
- id: rect
-
- anchors { fill: parent; margins: units.gu(0.5) }
-
- color: Qt.lighter(UbuntuColors.lightGrey)
- clip: true
-
- Item {
- id: tileContent
-
- height: parent.height - captionsLayout.height * 0.3 - units.gu(2)
- anchors {
- left: parent.left
- right: parent.right
- verticalCenter: parent.verticalCenter
- verticalCenterOffset: - captionsLayout.height * 0.3
- }
- }
-
- Loader {
- id: overflowButton
-
- anchors {
- right: parent.right
- top: parent.top
- }
-
- z: 10
-
- sourceComponent: actionsOverflowButton
-
- onStatusChanged: {
- if (status === Loader.Ready) {
- item.iconName = "contextual-menu"
- item.color = UbuntuColors.darkGrey
- item.width = overflowButton.width
- item.height = overflowButton.height
-
- item.triggered.connect(function() {
- var overflowPanel = PopupUtils.open(actionsOverflowPopoverComponent, item)
- item.overflowPanelVisible = overflowPanel.visible;
-
- overflowPanel.visibleChanged.connect(function() {
- item.overflowPanelVisible = overflowPanel.visible
- });
- });
- }
- }
-
- width: units.gu(5)
- height: units.gu(5)
- visible: rect.state !== "select" && (trailingActions.length > 0 || leadingActions.length > 0)
-
- Behavior on opacity {
- NumberAnimation {
- duration: UbuntuAnimation.SnapDuration
- }
- }
- }
-
- Loader {
- id: selectionIcon
-
- anchors {
- right: parent.right
- top: parent.top
- }
-
- z: 10
-
- width: (status === Loader.Ready) ? item.implicitWidth : 0
- visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
- Behavior on opacity {
- NumberAnimation {
- duration: UbuntuAnimation.SnapDuration
- }
- }
- }
-
- // Tile captions
- Rectangle {
- id: captionsRect
-
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
-
- height: captionsLayout.height + units.gu(1)
-
- color: UbuntuColors.darkGrey
- opacity: 0.75
- layer.enabled: true
-
- Column {
- id: captionsLayout
- anchors {
- left: parent.left;
- right: parent.right
- verticalCenter: parent.verticalCenter
- margins: units.gu(0.5)
- }
-
- Label {
- id: titleLabel
- color: "white"
-
- elide: Text.ElideRight
- font.weight: Font.DemiBold
- fontSize: "small"
-
- anchors { left: parent.left; right: parent.right }
- }
-
- Label {
- id: textLabel
- color: "white"
- fontSize: "small"
-
- anchors { left: parent.left; right: parent.right }
- }
-
- Label {
- id: subTextLabel
- color: "white"
- fontSize: "small"
-
- anchors { left: parent.left; right: parent.right }
- }
- }
- }
-
- states: [
- State {
- name: "select"
- when: selectionMode || selected
- PropertyChanges {
- target: selectionIcon
- sourceComponent: selectionCheckBox
- anchors.margins: units.gu(1)
- }
- }
- ]
- }
-
- // *** COMPONENTS
- Component {
- id: selectionCheckBox
-
- CheckBox {
- checked: root.selected
- width: implicitWidth
- // disable item mouse area to avoid conflicts with parent mouse area
- __mouseArea.enabled: false
- }
- }
-
- Component {
- id: actionsOverflowButton
-
- AbstractButton {
- id: button
-
- property alias color: icon.color
- property bool overflowPanelVisible: false
-
- width: visible ? units.gu(5) : 0
- height: parent ? parent.height : undefined
- Rectangle {
- visible: button.pressed || button.overflowPanelVisible
- anchors.fill: parent
- color: Theme.palette.selected.background
- }
-
- Icon {
- id: icon
- anchors.centerIn: parent
-
- // prevent trying to render the icon with an invalid source
- // when the button is invisible by setting width and height to 0
- width: visible ? units.gu(2.5) : 0
- height: visible ? units.gu(2.5) : 0
- source: button.iconSource
- color: Qt.rgba(0, 0, 0, 0)
- opacity: button.enabled ? 1.0 : 0.3
- }
-
- Component {
- id: labelComponent
- Label {
- id: label
- objectName: button.objectName + "_label"
- color: button.color
- opacity: button.enabled ? 1.0 : 0.3
- text: button.text
- fontSize: "xx-small"
- }
- }
- Loader {
- anchors {
- top: icon.bottom
- topMargin: units.gu(0.5)
- horizontalCenter: parent.horizontalCenter
- }
- sourceComponent: button.state === "IconAndLabel" ? labelComponent : null
- }
- }
- }
-
- Component {
- id: actionsOverflowPopoverComponent
-
- Popover {
- id: actionsOverflowPopover
- property bool square: true
- callerMargin: -units.gu(1) + units.dp(4)
- contentWidth: units.gu(20)
- contentHeight: popoverActionsLayout.height
-
- Connections {
- target: root
- onLeadingActionsChanged: {
- actionsOverflowPopover.hide();
- }
- onTrailingActionsChanged: {
- actionsOverflowPopover.hide();
- }
- }
-
- Column {
- id: popoverActionsLayout
- anchors {
- left: parent.left
- top: parent.top
- right: parent.right
- }
- Repeater {
- id: overflowTrailingRepeater
- model: root.trailingActions
-
- delegate: overflowPanelDelegate
- onItemAdded: {
- item.action = model[index]
- item.clicked.connect(function() {
- actionsOverflowPopover.hide()
- })
-
- item.showDivider = (overflowLeadingRepeater.count === 0) ? (index !== overflowTrailingRepeater.count - 1) : true
- }
- }
-
- Repeater {
- id: overflowLeadingRepeater
- model: root.leadingActions
-
- delegate: overflowPanelDelegate
- onItemAdded: {
- item.action = model[index]
- item.clicked.connect(function() {
- actionsOverflowPopover.hide()
- })
-
- item.showDivider = (index !== overflowLeadingRepeater.count - 1)
- }
- }
- }
- }
- }
-
- Component {
- id: overflowPanelDelegate
-
- AbstractButton {
- id: rootItem
- implicitHeight: units.gu(6) + bottomDividerLine.height
- width: parent ? parent.width : units.gu(31)
-
- property bool showDivider: true
- property color foregroundColor: Theme.palette.selected.backgroundText
-
- Rectangle {
- visible: parent.pressed
- anchors {
- left: parent.left
- right: parent.right
- top: parent.top
- }
- height: parent.height - bottomDividerLine.height
- color: Theme.palette.selected.background
- }
-
- Icon {
- id: actionIcon
- source: action.iconSource
- color: rootItem.foregroundColor
- anchors {
- verticalCenter: parent.verticalCenter
- verticalCenterOffset: units.dp(-1)
- left: parent.left
- leftMargin: units.gu(2)
- }
- width: units.gu(2)
- height: units.gu(2)
- opacity: action.enabled ? 1.0 : 0.5
- }
-
- Label {
- anchors {
- verticalCenter: parent.verticalCenter
- verticalCenterOffset: units.dp(-1)
- left: actionIcon.right
- leftMargin: units.gu(2)
- right: parent.right
- }
- fontSize: "small"
- elide: Text.ElideRight
- text: action.text
- color: rootItem.foregroundColor
- opacity: action.enabled ? 1.0 : 0.5
- }
-
- ListItem.ThinDivider {
- id: bottomDividerLine
- anchors.bottom: parent.bottom
- visible: rootItem.showDivider
- }
- }
- }
-}
=== modified file 'src/app/qml/loView/KeybHelper.js'
--- src/app/qml/loView/KeybHelper.js 2015-09-23 16:48:39 +0000
+++ src/app/qml/loView/KeybHelper.js 2015-10-19 11:44:23 +0000
@@ -18,7 +18,7 @@
var pixelDiff = 5;
var view = loPageContentLoader.item.loView
- var isPresentation = view.document.documentType === LO.Document.PresentationDocument
+ var isPresentation = view.document.documentType === LibreOffice.Document.PresentationDocument
if (event.key == Qt.Key_PageUp) {
if (isPresentation)
=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-10-11 12:49:58 +0000
+++ src/app/qml/loView/LOViewDefaultHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
import DocumentViewer.LibreOffice 1.0 as LibreOffice
=== modified file 'src/app/qml/loView/LOViewGotoDialog.qml'
--- src/app/qml/loView/LOViewGotoDialog.qml 2015-10-10 12:13:40 +0000
+++ src/app/qml/loView/LOViewGotoDialog.qml 2015-10-19 11:44:23 +0000
@@ -14,9 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
+import QtQuick.Layouts 1.1
// TODO: Use page breaks detection, when LibreOfficeKit will support it.
@@ -41,18 +42,28 @@
Component.onCompleted: forceActiveFocus()
}
- Button {
- objectName:"GOButton"
- text: i18n.tr("GO!")
- color: UbuntuColors.green
-
- enabled: goToPageTextField.acceptableInput
- onClicked: goToPage()
- }
-
- Button {
- text: i18n.tr("Cancel")
- onClicked: PopupUtils.close(goToPageDialog)
+ RowLayout {
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: units.gu(-1)
+ }
+
+ Button {
+ text: i18n.tr("Cancel")
+ onClicked: PopupUtils.close(goToPageDialog)
+ Layout.fillWidth: true
+ }
+
+ Button {
+ objectName:"GOButton"
+ text: i18n.tr("GO!")
+ color: UbuntuColors.green
+ Layout.fillWidth: true
+
+ enabled: goToPageTextField.acceptableInput
+ onClicked: goToPage()
+ }
}
function goToPage() {
=== modified file 'src/app/qml/loView/LOViewPage.qml'
--- src/app/qml/loView/LOViewPage.qml 2015-10-11 11:27:29 +0000
+++ src/app/qml/loView/LOViewPage.qml 2015-10-19 11:44:23 +0000
@@ -14,10 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Layouts 1.0
-import DocumentViewer.LibreOffice 1.0 as LO
+import DocumentViewer.LibreOffice 1.0 as LibreOffice
import "../upstreamComponents"
@@ -37,7 +37,7 @@
return false
// else
- return loPageContentLoader.item.loDocument.documentType == LO.Document.PresentationDocument && !wideWindow
+ return loPageContentLoader.item.loDocument.documentType == LibreOffice.Document.PresentationDocument && !wideWindow
}
Loader {
@@ -50,7 +50,7 @@
onLoaded: {
if (loaded) {
// FIXME: At the moment don't hide header if the document is a presentation
- var isPresentation = (item.loDocument.documentType === LO.Document.PresentationDocument)
+ var isPresentation = (item.loDocument.documentType === LibreOffice.Document.PresentationDocument)
loPage.flickable = isPresentation ? null : item.loView
loPage.bottomEdgePageComponent = item.bottomEdgePartsPage
@@ -100,7 +100,7 @@
}
model: loView.partsModel
- visible: loDocument.documentType == LO.Document.PresentationDocument
+ visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
width: visible ? units.gu(40) : 0
}
@@ -125,7 +125,7 @@
Item {
id: bottomBarLayoutItem
- visible: loDocument.documentType == LO.Document.PresentationDocument
+ visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
height: visible ? units.gu(5) : 0
anchors {
left: parent.left
@@ -139,7 +139,7 @@
}
]
- LO.Viewer {
+ LibreOffice.Viewer {
id: loView
objectName: "loView"
Layouts.item: "loView"
@@ -173,7 +173,7 @@
SlideControllerPanel {
id: bottomBar
Layouts.item: "bottomBar"
- visible: loDocument.documentType == LO.Document.PresentationDocument
+ visible: loDocument.documentType == LibreOffice.Document.PresentationDocument
height: visible ? units.gu(5) : 0
anchors {
left: parent.left
=== modified file 'src/app/qml/loView/LOViewZoomHeader.qml'
--- src/app/qml/loView/LOViewZoomHeader.qml 2015-09-22 19:02:46 +0000
+++ src/app/qml/loView/LOViewZoomHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
import Ubuntu.Components.Popups 1.0
=== modified file 'src/app/qml/loView/PanelButton.qml'
--- src/app/qml/loView/PanelButton.qml 2015-09-14 18:59:09 +0000
+++ src/app/qml/loView/PanelButton.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
AbstractButton {
width: units.gu(4); height: parent.height
=== modified file 'src/app/qml/loView/PartsView.qml'
--- src/app/qml/loView/PartsView.qml 2015-10-11 11:27:29 +0000
+++ src/app/qml/loView/PartsView.qml 2015-10-19 11:44:23 +0000
@@ -14,13 +14,11 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
import DocumentViewer.LibreOffice 1.0 as LibreOffice
-import "../upstreamComponents"
-
ListView {
id: view
objectName: "view"
@@ -31,7 +29,7 @@
currentIndex: view.model ? loView.document.currentPart : -1
highlightMoveDuration: UbuntuAnimation.SnapDuration
- delegate: ListItemWithActions {
+ delegate: ListItem {
id: delegate
width: parent.width
@@ -56,7 +54,11 @@
}
RowLayout {
- anchors.fill: parent
+ anchors {
+ fill: parent
+ leftMargin: units.gu(1)
+ rightMargin: units.gu(1)
+ }
spacing: units.gu(1)
Image {
@@ -74,13 +76,13 @@
wrapMode: Text.WordWrap
text: model.name
color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
- : Theme.palette.selected.backgroundText
+ : Theme.palette.selected.backgroundText
}
Label {
text: model.index + 1
color: (loView.document.currentPart === model.index) ? UbuntuColors.orange
- : Theme.palette.selected.backgroundText
+ : Theme.palette.selected.backgroundText
}
}
}
=== modified file 'src/app/qml/loView/SlideControllerPanel.qml'
--- src/app/qml/loView/SlideControllerPanel.qml 2015-09-26 13:46:07 +0000
+++ src/app/qml/loView/SlideControllerPanel.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
import Ubuntu.Components.ListItems 1.0 as ListItems
=== modified file 'src/app/qml/loView/ZoomSelector.qml'
--- src/app/qml/loView/ZoomSelector.qml 2015-09-22 19:02:46 +0000
+++ src/app/qml/loView/ZoomSelector.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
import DocumentViewer.LibreOffice 1.0 as LibreOffice
=== modified file 'src/app/qml/pdfView/PdfContentsPage.qml'
--- src/app/qml/pdfView/PdfContentsPage.qml 2015-05-02 14:45:06 +0000
+++ src/app/qml/pdfView/PdfContentsPage.qml 2015-10-19 11:44:23 +0000
@@ -15,8 +15,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.0
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
import "../upstreamComponents"
@@ -69,31 +69,34 @@
model: poppler.tocModel
- delegate: ListItemWithActions {
+ delegate: ListItem {
id: delegate
objectName: "delegate" + index
- width: parent.width
- height: (model.level === 0) ? units.gu(7) : units.gu(6)
-
- // Don't use 'selected' property here, since it shows a CheckBox
- color: (view.currentIndex == model.index) ? Qt.lighter(UbuntuColors.lightGrey)
- : Theme.palette.normal.background
-
- AbstractButton {
- objectName: "abstractbutton"
+ anchors {
+ left: parent.left; right: parent.right
+ leftMargin: units.gu(2) + (model.level * units.gu(2))
+ rightMargin: units.gu(2)
+ }
+
+ onClicked: {
+ pdfView.positionAtIndex(model.pageIndex);
+ pageStack.pop();
+ }
+
+ // Highlighted property of ListItem is read-only. In order to
+ // provide an highlight for the current page, we need to duplicate
+ // the overlay.
+ Rectangle {
anchors.fill: parent
-
- onClicked: {
- pdfView.positionAtIndex(model.pageIndex);
- pageStack.pop();
- }
+ color: Qt.rgba(0, 0, 0, 0.05)
+ visible: view.currentIndex == model.index
}
RowLayout {
anchors {
fill: parent
- leftMargin: units.gu(1) + (units.gu(2) * model.level)
+ leftMargin: units.gu(1)
rightMargin: units.gu(1)
}
@@ -107,31 +110,35 @@
elide: Text.ElideRight
font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
- color: (model.level === 0) ? UbuntuColors.midAubergine
- : Theme.palette.selected.backgroundText
+ color: (model.level == 0) ? UbuntuColors.midAubergine
+ : Theme.palette.selected.backgroundText
+ }
+
+ /*
+ TODO: Needs UX team's review.
+ UX specifications for ListItem suggest to use a "tick" icon
+ as indicator for a selected state.
+ This currently looks a bit redundant, since we already
+ use a grey overlay (see above).
+ */
+ Icon {
+ Layout.preferredHeight: units.gu(2)
+ Layout.preferredWidth: units.gu(2)
+ name: "tick"
+ color: UbuntuColors.green
+ visible: view.currentIndex == model.index
}
Label {
objectName: "pageindex"
text: model.pageIndex + 1
font.weight: model.level == 0 ? Font.DemiBold : Font.Normal
- color: (model.level === 0) ? UbuntuColors.midAubergine
- : Theme.palette.selected.backgroundText
- }
- }
-
- Rectangle {
- anchors {
- left: parent.left
- right: parent.right
- bottom: parent.bottom
- }
-
- height: units.gu(0.1)
- visible: model.level == 0
- color: (view.currentIndex === model.index) ? "transparent"
- : UbuntuColors.midAubergine
+ color: (model.level == 0) ? UbuntuColors.midAubergine
+ : Theme.palette.selected.backgroundText
+ }
}
}
}
+
+ Scrollbar { flickableItem: view }
}
=== modified file 'src/app/qml/pdfView/PdfView.qml'
--- src/app/qml/pdfView/PdfView.qml 2015-04-15 14:47:28 +0000
+++ src/app/qml/pdfView/PdfView.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import DocumentViewer.PDF 1.0 as PDF
import "../common/utils.js" as Utils
=== modified file 'src/app/qml/pdfView/PdfViewDefaultHeader.qml'
--- src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-03-26 13:58:31 +0000
+++ src/app/qml/pdfView/PdfViewDefaultHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
import Ubuntu.Components.Popups 1.0
=== modified file 'src/app/qml/pdfView/PdfViewDelegate.qml'
--- src/app/qml/pdfView/PdfViewDelegate.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/pdfView/PdfViewDelegate.qml 2015-10-19 11:44:23 +0000
@@ -13,8 +13,8 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
Rectangle {
id: pdfPage
=== modified file 'src/app/qml/pdfView/PdfViewGotoDialog.qml'
--- src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-03-03 15:41:11 +0000
+++ src/app/qml/pdfView/PdfViewGotoDialog.qml 2015-10-19 11:44:23 +0000
@@ -14,9 +14,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
+import QtQuick.Layouts 1.1
Dialog {
id: goToPageDialog
@@ -39,18 +40,28 @@
Component.onCompleted: forceActiveFocus()
}
- Button {
- objectName:"GOButton"
- text: i18n.tr("GO!")
- color: UbuntuColors.green
-
- enabled: goToPageTextField.acceptableInput
- onClicked: goToPage()
- }
-
- Button {
- text: i18n.tr("Cancel")
- onClicked: PopupUtils.close(goToPageDialog)
+ RowLayout {
+ anchors {
+ left: parent.left
+ right: parent.right
+ margins: units.gu(-1)
+ }
+
+ Button {
+ text: i18n.tr("Cancel")
+ onClicked: PopupUtils.close(goToPageDialog)
+ Layout.fillWidth: true
+ }
+
+ Button {
+ objectName:"GOButton"
+ text: i18n.tr("GO!")
+ color: UbuntuColors.green
+ Layout.fillWidth: true
+
+ enabled: goToPageTextField.acceptableInput
+ onClicked: goToPage()
+ }
}
function goToPage() {
=== modified file 'src/app/qml/textView/TextView.qml'
--- src/app/qml/textView/TextView.qml 2015-03-26 13:58:31 +0000
+++ src/app/qml/textView/TextView.qml 2015-10-19 11:44:23 +0000
@@ -14,9 +14,9 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
-import Ubuntu.Components.Themes.Ambiance 0.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
+import Ubuntu.Components.Themes.Ambiance 1.2
import "../common/utils.js" as Utils
=== modified file 'src/app/qml/textView/TextViewDefaultHeader.qml'
--- src/app/qml/textView/TextViewDefaultHeader.qml 2015-04-15 14:21:48 +0000
+++ src/app/qml/textView/TextViewDefaultHeader.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import QtQuick.Layouts 1.1
import Ubuntu.Components.Popups 1.0
=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
--- src/app/qml/ubuntu-docviewer-app.qml 2015-10-05 20:53:25 +0000
+++ src/app/qml/ubuntu-docviewer-app.qml 2015-10-19 11:44:23 +0000
@@ -14,8 +14,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
import Ubuntu.Components.Popups 1.0
import DocumentViewer 1.0
import QtQuick.Window 2.0
@@ -34,7 +34,6 @@
Screen.orientation == Qt.InvertedLandscapeOrientation
applicationName: "com.ubuntu.docviewer"
- useDeprecatedToolbar: false
automaticOrientation: true
width: units.gu(150)
@@ -145,6 +144,7 @@
customDir: DOC_VIEWER.documentsDir
}
+ // TODO: Expose an enum from DocumentViewer module.
sort.property: {
switch (sortSettings.sortMode) {
case 0:
=== modified file 'src/app/qml/upstreamComponents/EmptyState.qml'
--- src/app/qml/upstreamComponents/EmptyState.qml 2015-02-26 20:16:32 +0000
+++ src/app/qml/upstreamComponents/EmptyState.qml 2015-10-19 11:44:23 +0000
@@ -16,8 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-import QtQuick 2.3
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
/*
Component which displays an empty state (approved by design). It offers an
=== removed file 'src/app/qml/upstreamComponents/HeaderButton.qml'
--- src/app/qml/upstreamComponents/HeaderButton.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/upstreamComponents/HeaderButton.qml 1970-01-01 00:00:00 +0000
@@ -1,65 +0,0 @@
-/*
- * Copyright (C) 2014 Canonical Ltd
- *
- * This file is part of Ubuntu Clock App
- *
- * Ubuntu Clock App is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Ubuntu Clock App is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.3
-import Ubuntu.Components 1.1
-
-AbstractButton {
- id: headerButton
-
- property alias iconSource: _icon.source
- property alias iconName: _icon.name
- property alias text: _label.text
-
- width: units.gu(6)
- height: parent ? parent.height : undefined
-
- Rectangle {
- anchors.fill: parent
- visible: headerButton.pressed
- color: Theme.palette.selected.background
- }
-
- Column {
- id: buttonHolder
-
- width: _label.width
- height: childrenRect.height
-
- spacing: units.gu(0.2)
- anchors.centerIn: parent
- anchors.verticalCenterOffset: units.gu(0.3)
-
- Icon {
- id: _icon
- color: UbuntuColors.darkGrey
- width: units.gu(2.5)
- height: width
- opacity: headerButton.enabled ? 1.0 : 0.3
- anchors.horizontalCenter: parent.horizontalCenter
- }
-
- Label {
- id: _label
- color: UbuntuColors.darkGrey
- fontSize: "xx-small"
- opacity: headerButton.enabled ? 1.0 : 0.3
- anchors.horizontalCenter: _icon.horizontalCenter
- }
- }
-}
=== removed file 'src/app/qml/upstreamComponents/ListItemWithActions.qml'
--- src/app/qml/upstreamComponents/ListItemWithActions.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/upstreamComponents/ListItemWithActions.qml 1970-01-01 00:00:00 +0000
@@ -1,453 +0,0 @@
-/*
- * Copyright (C) 2012-2014 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.3
-import Ubuntu.Components 1.1
-
-Item {
- id: root
-
- property Action leftSideAction: null
- property list<Action> rightSideActions
- property double defaultHeight: units.gu(8)
- property bool locked: false
- property Action activeAction: null
- property var activeItem: null
- property bool triggerActionOnMouseRelease: false
- property color color: Theme.palette.normal.background
- property color selectedColor: "#E6E6E6"
- property bool selected: false
- property bool selectionMode: false
- property alias internalAnchors: mainContents.anchors
- default property alias contents: mainContents.children
-
- readonly property double actionWidth: units.gu(4)
- readonly property double leftActionWidth: units.gu(10)
- readonly property double actionThreshold: actionWidth * 0.4
- readonly property double threshold: 0.4
- readonly property string swipeState: main.x == 0 ? "Normal" : main.x > 0 ? "LeftToRight" : "RightToLeft"
- readonly property alias swipping: mainItemMoving.running
- readonly property bool _showActions: mouseArea.pressed || swipeState != "Normal" || swipping
-
- /* internal */
- property var _visibleRightSideActions: filterVisibleActions(rightSideActions)
-
- signal itemClicked(var mouse)
- signal itemPressAndHold(var mouse)
-
- function returnToBoundsRTL(direction)
- {
- var actionFullWidth = actionWidth + units.gu(2)
-
- // go back to normal state if swipping reverse
- if (direction === "LTR") {
- updatePosition(0)
- return
- } else if (!triggerActionOnMouseRelease) {
- updatePosition(-rightActionsView.width + units.gu(2))
- return
- }
-
- var xOffset = Math.abs(main.x)
- var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
- var newX = 0
- if (index === _visibleRightSideActions.length) {
- newX = -(rightActionsView.width - units.gu(2))
- } else if (index >= 1) {
- newX = -(actionFullWidth * index)
- }
- updatePosition(newX)
- }
-
- function returnToBoundsLTR(direction)
- {
- var finalX = leftActionWidth
- if ((direction === "RTL") || (main.x <= (finalX * root.threshold)))
- finalX = 0
- updatePosition(finalX)
- }
-
- function returnToBounds(direction)
- {
- if (main.x < 0) {
- returnToBoundsRTL(direction)
- } else if (main.x > 0) {
- returnToBoundsLTR(direction)
- } else {
- updatePosition(0)
- }
- }
-
- function contains(item, point, marginX)
- {
- var itemStartX = item.x - marginX
- var itemEndX = item.x + item.width + marginX
- return (point.x >= itemStartX) && (point.x <= itemEndX) &&
- (point.y >= item.y) && (point.y <= (item.y + item.height));
- }
-
- function getActionAt(point)
- {
- if (contains(leftActionView, point, 0)) {
- return leftSideAction
- } else if (contains(rightActionsView, point, 0)) {
- var newPoint = root.mapToItem(rightActionsView, point.x, point.y)
- for (var i = 0; i < rightActionsRepeater.count; i++) {
- var child = rightActionsRepeater.itemAt(i)
- if (contains(child, newPoint, units.gu(1))) {
- return i
- }
- }
- }
- return -1
- }
-
- function updateActiveAction()
- {
- if (triggerActionOnMouseRelease &&
- (main.x <= -(root.actionWidth + units.gu(2))) &&
- (main.x > -(rightActionsView.width - units.gu(2)))) {
- var actionFullWidth = actionWidth + units.gu(2)
- var xOffset = Math.abs(main.x)
- var index = Math.min(Math.floor(xOffset / actionFullWidth), _visibleRightSideActions.length)
- index = index - 1
- if (index > -1) {
- root.activeItem = rightActionsRepeater.itemAt(index)
- root.activeAction = root._visibleRightSideActions[index]
- }
- } else {
- root.activeAction = null
- }
- }
-
- function resetSwipe()
- {
- updatePosition(0)
- }
-
- function filterVisibleActions(actions)
- {
- var visibleActions = []
- for(var i = 0; i < actions.length; i++) {
- var action = actions[i]
- if (action.visible) {
- visibleActions.push(action)
- }
- }
- return visibleActions
- }
-
- function updatePosition(pos)
- {
- if (!root.triggerActionOnMouseRelease && (pos !== 0)) {
- mouseArea.state = pos > 0 ? "RightToLeft" : "LeftToRight"
- } else {
- mouseArea.state = ""
- }
- main.x = pos
- }
-
- states: [
- State {
- name: "select"
- when: selectionMode || selected
- PropertyChanges {
- target: selectionIcon
- source: Qt.resolvedUrl("ListItemWithActionsCheckBox.qml")
- anchors.leftMargin: units.gu(2)
- }
- PropertyChanges {
- target: root
- locked: true
- }
- PropertyChanges {
- target: main
- x: 0
- }
- }
- ]
-
- height: defaultHeight
- clip: height !== defaultHeight
-
- Rectangle {
- id: leftActionView
-
- anchors {
- top: parent.top
- bottom: parent.bottom
- right: main.left
- }
- width: root.leftActionWidth + actionThreshold
- visible: leftSideAction
- color: UbuntuColors.red
-
- Icon {
- anchors {
- centerIn: parent
- horizontalCenterOffset: actionThreshold / 2
- }
- name: leftSideAction && _showActions ? leftSideAction.iconName : ""
- color: Theme.palette.selected.field
- height: units.gu(3)
- width: units.gu(3)
- }
- }
-
- Rectangle {
- id: rightActionsView
-
- anchors {
- top: main.top
- left: main.right
- bottom: main.bottom
- }
- visible: _visibleRightSideActions.length > 0
- width: rightActionsRepeater.count > 0 ? rightActionsRepeater.count * (root.actionWidth + units.gu(2)) + root.actionThreshold + units.gu(2) : 0
- color: "white"
- Row {
- anchors{
- top: parent.top
- left: parent.left
- leftMargin: units.gu(2)
- right: parent.right
- rightMargin: units.gu(2)
- bottom: parent.bottom
- }
- spacing: units.gu(2)
- Repeater {
- id: rightActionsRepeater
-
- model: _showActions ? _visibleRightSideActions : []
- Item {
- property alias image: img
-
- height: rightActionsView.height
- width: root.actionWidth
-
- Icon {
- id: img
-
- anchors.centerIn: parent
- width: units.gu(3)
- height: units.gu(3)
- name: modelData.iconName
- color: root.activeAction === modelData ? UbuntuColors.lightAubergine : UbuntuColors.lightGrey
- }
- }
- }
- }
- }
-
-
- Rectangle {
- id: main
- objectName: "mainItem"
-
- anchors {
- top: parent.top
- bottom: parent.bottom
- }
-
- width: parent.width
- color: root.selected ? root.selectedColor : root.color
-
- Loader {
- id: selectionIcon
-
- anchors {
- left: main.left
- verticalCenter: main.verticalCenter
- }
- width: (status === Loader.Ready) ? item.implicitWidth : 0
- visible: (status === Loader.Ready) && (item.width === item.implicitWidth)
- Behavior on width {
- NumberAnimation {
- duration: UbuntuAnimation.SnapDuration
- }
- }
- }
-
-
- Item {
- id: mainContents
-
- anchors {
- left: selectionIcon.right
- leftMargin: units.gu(2)
- top: parent.top
- topMargin: units.gu(1)
- right: parent.right
- rightMargin: units.gu(2)
- bottom: parent.bottom
- bottomMargin: units.gu(1)
- }
- }
-
- Behavior on x {
- UbuntuNumberAnimation {
- id: mainItemMoving
-
- easing.type: Easing.OutElastic
- duration: UbuntuAnimation.SlowDuration
- }
- }
- Behavior on color {
- ColorAnimation {}
- }
- }
-
- SequentialAnimation {
- id: triggerAction
-
- property var currentItem: root.activeItem ? root.activeItem.image : null
-
- running: false
- ParallelAnimation {
- UbuntuNumberAnimation {
- target: triggerAction.currentItem
- property: "opacity"
- from: 1.0
- to: 0.0
- duration: UbuntuAnimation.SlowDuration
- easing {type: Easing.InOutBack; }
- }
- UbuntuNumberAnimation {
- target: triggerAction.currentItem
- properties: "width, height"
- from: units.gu(3)
- to: root.actionWidth
- duration: UbuntuAnimation.SlowDuration
- easing {type: Easing.InOutBack; }
- }
- }
- PropertyAction {
- target: triggerAction.currentItem
- properties: "width, height"
- value: units.gu(3)
- }
- PropertyAction {
- target: triggerAction.currentItem
- properties: "opacity"
- value: 1.0
- }
- ScriptAction {
- script: {
- root.activeAction.triggered(root)
- mouseArea.state = ""
- }
- }
- PauseAnimation {
- duration: 500
- }
- UbuntuNumberAnimation {
- target: main
- property: "x"
- to: 0
-
- }
- }
-
- MouseArea {
- id: mouseArea
-
- property bool locked: root.locked || ((root.leftSideAction === null) && (root._visibleRightSideActions.count === 0))
- property bool manual: false
- property string direction: "None"
- property real lastX: -1
-
- anchors.fill: parent
- drag {
- target: locked ? null : main
- axis: Drag.XAxis
- minimumX: rightActionsView.visible ? -(rightActionsView.width) : 0
- maximumX: leftActionView.visible ? leftActionView.width : 0
- threshold: root.actionThreshold
- }
-
- states: [
- State {
- name: "LeftToRight"
- PropertyChanges {
- target: mouseArea
- drag.maximumX: 0
- }
- },
- State {
- name: "RightToLeft"
- PropertyChanges {
- target: mouseArea
- drag.minimumX: 0
- }
- }
- ]
-
- onMouseXChanged: {
- var offset = (lastX - mouseX)
- if (Math.abs(offset) <= root.actionThreshold) {
- return
- }
- lastX = mouseX
- direction = offset > 0 ? "RTL" : "LTR";
- }
-
- onPressed: {
- lastX = mouse.x
- }
-
- onReleased: {
- if (root.triggerActionOnMouseRelease && root.activeAction) {
- triggerAction.start()
- } else {
- root.returnToBounds(direction)
- root.activeAction = null
- }
- lastX = -1
- direction = "None"
- }
- onClicked: {
- if (main.x === 0) {
- root.itemClicked(mouse)
- } else if (main.x > 0) {
- var action = getActionAt(Qt.point(mouse.x, mouse.y))
- if (action && action !== -1) {
- action.triggered(root)
- }
- } else {
- var actionIndex = getActionAt(Qt.point(mouse.x, mouse.y))
- if (actionIndex !== -1) {
- root.activeItem = rightActionsRepeater.itemAt(actionIndex)
- root.activeAction = root._visibleRightSideActions[actionIndex]
- triggerAction.start()
- return
- }
- }
- root.resetSwipe()
- }
-
- onPositionChanged: {
- if (mouseArea.pressed) {
- updateActiveAction()
- }
- }
- onPressAndHold: {
- if (main.x === 0) {
- root.itemPressAndHold(mouse)
- }
- }
- z: -1
- }
-}
=== removed file 'src/app/qml/upstreamComponents/ListItemWithActionsCheckBox.qml'
--- src/app/qml/upstreamComponents/ListItemWithActionsCheckBox.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/upstreamComponents/ListItemWithActionsCheckBox.qml 1970-01-01 00:00:00 +0000
@@ -1,25 +0,0 @@
-/*
- * Copyright (C) 2012-2014 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.3
-import Ubuntu.Components 1.1
-
-CheckBox {
- checked: root.selected
- width: implicitWidth
- // disable item mouse area to avoid conflicts with parent mouse area
- __mouseArea.enabled: false
-}
=== removed file 'src/app/qml/upstreamComponents/MultipleSelectionGridView.qml'
--- src/app/qml/upstreamComponents/MultipleSelectionGridView.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/upstreamComponents/MultipleSelectionGridView.qml 1970-01-01 00:00:00 +0000
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.3
-import Ubuntu.Components 1.1
-import Ubuntu.Components.Popups 1.0 as Popups
-
-/*!
- \qmltype ContactSimpleListView
- \inqmlmodule Ubuntu.Contacts 0.1
- \ingroup ubuntu
- \brief The MultipleSelectionListView provides a ListView with support to multiple selection
-
- The MultipleSelectionListViewprovides a ListView with support to multiple selection which can be used by any
- application.
-
- Example:
- \qml
- import Ubuntu.Contacts 0.1
-
- MultipleSelectionListView {
- id: view
- anchors.fill: paret
- model: 100
- delegate: Rectangle {
- width: parent.width
- height: 100
- color: view.selectedItems.indexOf(index) == -1 ? "white" : "blue"
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (view.isInSelectionModel) {
- view.selectItem(index)
- }
- }
- onPressAndHold: view.startSelection()
- }
- }
- onSelectionDone: console.debug("Selected items:" + view.selectedItems)
- }
- \endqml
-*/
-
-GridView {
- id: listView
-
- /*!
- \qmlproperty model selectedItems
-
- This property holds the list of selected items
- */
- readonly property alias selectedItems: visualModel.selectedItems
- /*!
- \qmlproperty bool multipleSelection
-
- This property holds if the selection will accept multiple items or single items
- */
- property bool multipleSelection: true
-
- /*!
- \qmlproperty model listModel
-
- This property holds the model providing data for the list.
- */
- property alias listModel: visualModel.model
- /*!
- \qmlproperty Component listDelegate
-
- The delegate provides a template defining each item instantiated by the view.
- */
- property alias listDelegate: visualModel.delegate
-
- /*!
- \qmlproperty bool isInSelectionMode
-
- This property holds a list with the index of selected items
- */
- readonly property bool isInSelectionMode: state === "selection"
- /*!
- This handler is called when the selection mode is finished without be canceled
- */
- signal selectionDone(var items)
- /*!
- This handler is called when the selection mode is canceled
- */
- signal selectionCanceled()
-
- /*!
- Start the selection mode on the list view.
- */
- function startSelection()
- {
- state = "selection"
- }
- /*!
- Check if the item is selected
- Returns true if the item was marked as selected or false if the item is unselected
- */
- function isSelected(item)
- {
- if (item && item.VisualDataModel) {
- return (item.VisualDataModel.inSelected === true)
- } else {
- return false
- }
- }
- /*!
- Mark the item as selected
- Returns true if the item was marked as selected or false if the item is already selected
- */
- function selectItem(item)
- {
- if (item.VisualDataModel.inSelected) {
- return false
- } else {
- if (!multipleSelection) {
- clearSelection()
- }
- item.VisualDataModel.inSelected = true
- return true
- }
- }
- /*!
- Remove the index from the selected list
- */
- function deselectItem(item)
- {
- var result = false
- if (item.VisualDataModel.inSelected) {
- item.VisualDataModel.inSelected = false
- result = true
- }
- return result
- }
- /*!
- Finish the selection mode with sucess
- */
- function endSelection()
- {
- selectionDone(listView.selectedItems)
- clearSelection()
- state = ""
- }
- /*!
- Cancel the selection
- */
- function cancelSelection()
- {
- selectionCanceled()
- clearSelection()
- state = ""
- }
- /*!
- Remove any selected item from the selection list
- */
- function clearSelection()
- {
- if (selectedItems.count > 0) {
- selectedItems.remove(0, selectedItems.count)
- }
- }
- /*!
- Select all items in the list
- */
- function selectAll()
- {
- if (multipleSelection) {
- visualModel.items.addGroups(0, visualModel.items.count, ["selected"] )
- }
- }
-
- model: visualModel
-
- MultipleSelectionVisualModel {
- id: visualModel
- }
-
- Component.onCompleted: {
- // FIXME: workaround for qtubuntu not returning values depending on the grid unit definition
- // for Flickable.maximumFlickVelocity and Flickable.flickDeceleration
- var scaleFactor = units.gridUnit / 8;
- maximumFlickVelocity = maximumFlickVelocity * scaleFactor;
- flickDeceleration = flickDeceleration * scaleFactor;
- }
-}
=== removed file 'src/app/qml/upstreamComponents/MultipleSelectionListView.qml'
--- src/app/qml/upstreamComponents/MultipleSelectionListView.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/upstreamComponents/MultipleSelectionListView.qml 1970-01-01 00:00:00 +0000
@@ -1,199 +0,0 @@
-/*
- * Copyright (C) 2013 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.3
-import Ubuntu.Components 1.1
-import Ubuntu.Components.Popups 1.0 as Popups
-
-/*!
- \qmltype ContactSimpleListView
- \inqmlmodule Ubuntu.Contacts 0.1
- \ingroup ubuntu
- \brief The MultipleSelectionListView provides a ListView with support to multiple selection
-
- The MultipleSelectionListViewprovides a ListView with support to multiple selection which can be used by any
- application.
-
- Example:
- \qml
- import Ubuntu.Contacts 0.1
-
- MultipleSelectionListView {
- id: view
- anchors.fill: paret
- model: 100
- delegate: Rectangle {
- width: parent.width
- height: 100
- color: view.selectedItems.indexOf(index) == -1 ? "white" : "blue"
-
- MouseArea {
- anchors.fill: parent
- onClicked: {
- if (view.isInSelectionModel) {
- view.selectItem(index)
- }
- }
- onPressAndHold: view.startSelection()
- }
- }
- onSelectionDone: console.debug("Selected items:" + view.selectedItems)
- }
- \endqml
-*/
-
-ListView {
- id: listView
-
- /*!
- \qmlproperty model selectedItems
-
- This property holds the list of selected items
- */
- readonly property alias selectedItems: visualModel.selectedItems
- /*!
- \qmlproperty bool multipleSelection
-
- This property holds if the selection will accept multiple items or single items
- */
- property bool multipleSelection: true
-
- /*!
- \qmlproperty model listModel
-
- This property holds the model providing data for the list.
- */
- property alias listModel: visualModel.model
- /*!
- \qmlproperty Component listDelegate
-
- The delegate provides a template defining each item instantiated by the view.
- */
- property alias listDelegate: visualModel.delegate
-
- /*!
- \qmlproperty bool isInSelectionMode
-
- This property holds a list with the index of selected items
- */
- readonly property bool isInSelectionMode: state === "selection"
- /*!
- This handler is called when the selection mode is finished without be canceled
- */
- signal selectionDone(var items)
- /*!
- This handler is called when the selection mode is canceled
- */
- signal selectionCanceled()
-
- /*!
- Start the selection mode on the list view.
- */
- function startSelection()
- {
- state = "selection"
- }
- /*!
- Check if the item is selected
- Returns true if the item was marked as selected or false if the item is unselected
- */
- function isSelected(item)
- {
- if (item && item.VisualDataModel) {
- return (item.VisualDataModel.inSelected === true)
- } else {
- return false
- }
- }
- /*!
- Mark the item as selected
- Returns true if the item was marked as selected or false if the item is already selected
- */
- function selectItem(item)
- {
- if (item.VisualDataModel.inSelected) {
- return false
- } else {
- if (!multipleSelection) {
- clearSelection()
- }
- item.VisualDataModel.inSelected = true
- return true
- }
- }
- /*!
- Remove the index from the selected list
- */
- function deselectItem(item)
- {
- var result = false
- if (item.VisualDataModel.inSelected) {
- item.VisualDataModel.inSelected = false
- result = true
- }
- return result
- }
- /*!
- Finish the selection mode with sucess
- */
- function endSelection()
- {
- selectionDone(listView.selectedItems)
- clearSelection()
- state = ""
- }
- /*!
- Cancel the selection
- */
- function cancelSelection()
- {
- selectionCanceled()
- clearSelection()
- state = ""
- }
- /*!
- Remove any selected item from the selection list
- */
- function clearSelection()
- {
- if (selectedItems.count > 0) {
- selectedItems.remove(0, selectedItems.count)
- }
- }
- /*!
- Select all items in the list
- */
- function selectAll()
- {
- if (multipleSelection) {
- visualModel.items.addGroups(0, visualModel.items.count, ["selected"] )
- }
- }
-
- model: visualModel
-
- MultipleSelectionVisualModel {
- id: visualModel
- }
-
- Component.onCompleted: {
- // FIXME: workaround for qtubuntu not returning values depending on the grid unit definition
- // for Flickable.maximumFlickVelocity and Flickable.flickDeceleration
- var scaleFactor = units.gridUnit / 8;
- maximumFlickVelocity = maximumFlickVelocity * scaleFactor;
- flickDeceleration = flickDeceleration * scaleFactor;
- }
-}
=== removed file 'src/app/qml/upstreamComponents/MultipleSelectionVisualModel.qml'
--- src/app/qml/upstreamComponents/MultipleSelectionVisualModel.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/upstreamComponents/MultipleSelectionVisualModel.qml 1970-01-01 00:00:00 +0000
@@ -1,31 +0,0 @@
-/*
- * Copyright (C) 2012-2013 Canonical, Ltd.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; version 3.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- */
-
-import QtQuick 2.3
-
-VisualDataModel {
- id: contactVisualModel
-
- property alias selectedItems: selectedGroup
-
- groups: [
- VisualDataGroup {
- id: selectedGroup
-
- name: "selected"
- }
- ]
-}
=== modified file 'src/app/qml/upstreamComponents/PageWithBottomEdge.qml'
--- src/app/qml/upstreamComponents/PageWithBottomEdge.qml 2015-02-13 15:30:01 +0000
+++ src/app/qml/upstreamComponents/PageWithBottomEdge.qml 2015-10-19 11:44:23 +0000
@@ -62,8 +62,8 @@
*/
-import QtQuick 2.2
-import Ubuntu.Components 1.1
+import QtQuick 2.4
+import Ubuntu.Components 1.2
Page {
id: page
Follow ups
-
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: noreply, 2015-10-20
-
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Ubuntu Phone Apps Jenkins Bot, 2015-10-20
-
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Roman Shchekin, 2015-10-20
-
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Ubuntu Phone Apps Jenkins Bot, 2015-10-20
-
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Ubuntu Phone Apps Jenkins Bot, 2015-10-20
-
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Roman Shchekin, 2015-10-20
-
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Ubuntu Phone Apps Jenkins Bot, 2015-10-19
-
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Stefano Verzegnassi, 2015-10-19
-
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Roman Shchekin, 2015-10-19
-
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Ubuntu Phone Apps Jenkins Bot, 2015-10-19
-
Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-uitk12 into lp:ubuntu-docviewer-app/reboot
From: Stefano Verzegnassi, 2015-10-19