Merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/desktop-support into lp:ubuntu-docviewer-app

Proposed by Stefano Verzegnassi
Status: Superseded
Proposed branch: lp:~verzegnassi-stefano/ubuntu-docviewer-app/desktop-support
Merge into: lp:ubuntu-docviewer-app
Prerequisite: lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk-bottom-edge
Diff against target: 3349 lines (+1451/-991)
29 files modified
debian/control (+3/-1)
po/com.ubuntu.docviewer.pot (+23/-34)
po/ja.po (+0/-448)
po/ro.po (+0/-449)
src/app/qml/common/ContentHubProxy.qml (+5/-5)
src/app/qml/common/DetailsPage.qml (+2/-2)
src/app/qml/common/PickImportedDialog.qml (+1/-1)
src/app/qml/loView/LOViewDefaultHeader.qml (+1/-1)
src/app/qml/loView/LOViewPage.qml (+1/-1)
src/app/qml/pdfView/PdfView.qml (+2/-5)
src/app/qml/textView/TextView.qml (+1/-1)
src/app/qml/ubuntu-docviewer-app.qml (+8/-1)
src/plugin/file-qml-plugin/CMakeLists.txt (+27/-2)
src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt (+39/-0)
src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp (+288/-0)
src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h (+98/-0)
src/plugin/file-qml-plugin/InputInfo/plugin.cpp (+32/-0)
src/plugin/file-qml-plugin/InputInfo/plugin.h (+30/-0)
src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp (+196/-0)
src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h (+102/-0)
src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp (+270/-0)
src/plugin/file-qml-plugin/InputInfo/qinputinfo.h (+143/-0)
src/plugin/file-qml-plugin/InputInfo/qmldir (+3/-0)
src/plugin/file-qml-plugin/backend.cpp (+21/-10)
src/plugin/file-qml-plugin/documentmodel.cpp (+2/-2)
src/plugin/file-qml-plugin/fileutils.cpp (+11/-21)
src/plugin/file-qml-plugin/fileutils.h (+4/-7)
src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp (+82/-0)
src/plugin/file-qml-plugin/ubuntuconvergenceutils.h (+56/-0)
To merge this branch: bzr merge lp:~verzegnassi-stefano/ubuntu-docviewer-app/desktop-support
Reviewer Review Type Date Requested Status
Stefano Verzegnassi Disapprove
Nicholas Skaggs (community) Needs Fixing
Jenkins Bot continuous-integration Needs Fixing
Review via email: mp+282639@code.launchpad.net

Commit message

Better desktop/pocket-desktop support, by detecting the number of mice and touchpads connected to the device. This uses QInputInfo, available in the Qt snapshots - imported version from unity 8 trunk (rev.2080).

WORKAROUND: This makes new BottomEdge component fully working on desktop

Description of the change

Better desktop/pocket-desktop support, by detecting the number of mice and touchpads connected to the device. This uses QInputInfo, available in the Qt snapshots - imported version from unity 8 trunk (rev.2080).

WORKAROUND: This makes new BottomEdge component fully working on desktop

To post a comment you must log in.
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
242. By Stefano Verzegnassi

Added translation committed in trunk, removed by mistake

243. By Stefano Verzegnassi

updated pot

Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Jenkins Bot (ubuntu-core-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Nicholas Skaggs (nskaggs) wrote :

Text conflict in po/com.ubuntu.docviewer.pot
Conflict adding file po/ja.po. Moved existing file to po/ja.po.moved.
Conflict adding file po/ro.po. Moved existing file to po/ro.po.moved.
Text conflict in src/app/qml/loView/LOViewPage.qml
Text conflict in src/app/qml/pdfView/PdfView.qml
5 conflicts encountered.
bzr: ERROR: Conflicts from merge

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

I did some mistake when I merged trunk (.po conflicts). I will create a new branch for this and propose a new MP.

review: Disapprove

Unmerged revisions

243. By Stefano Verzegnassi

updated pot

242. By Stefano Verzegnassi

Added translation committed in trunk, removed by mistake

241. By Stefano Verzegnassi

Added 'mouseAttached' property so that BottomEdgeHint can properly work on desktop

240. By Stefano Verzegnassi

Merged trunk

239. By Stefano Verzegnassi

Added ConvergenceUtils singleton. Improved desktop/pocket desktop support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'debian/control'
--- debian/control 2015-11-27 16:39:21 +0000
+++ debian/control 2016-01-14 17:54:32 +0000
@@ -17,7 +17,9 @@
17 qtdeclarative5-qtquick2-plugin,17 qtdeclarative5-qtquick2-plugin,
18 qtdeclarative5-private-dev,18 qtdeclarative5-private-dev,
19 qtbase5-private-dev,19 qtbase5-private-dev,
20 qtdeclarative5-test-plugin20 qtdeclarative5-test-plugin,
21 libudev-dev,
22 libevdev-dev,
21Standards-Version: 3.9.623Standards-Version: 3.9.6
22Section: misc24Section: misc
23Homepage: https://launchpad.net/ubuntu-docviewer-app25Homepage: https://launchpad.net/ubuntu-docviewer-app
2426
=== modified file 'po/com.ubuntu.docviewer.pot'
--- po/com.ubuntu.docviewer.pot 2016-01-14 17:54:32 +0000
+++ po/com.ubuntu.docviewer.pot 2016-01-14 17:54:32 +0000
@@ -8,11 +8,7 @@
8msgstr ""8msgstr ""
9"Project-Id-Version: \n"9"Project-Id-Version: \n"
10"Report-Msgid-Bugs-To: \n"10"Report-Msgid-Bugs-To: \n"
11<<<<<<< TREE11"POT-Creation-Date: 2016-01-14 18:54+0100\n"
12"POT-Creation-Date: 2015-12-27 13:06+0100\n"
13=======
14"POT-Creation-Date: 2015-12-15 20:33+0100\n"
15>>>>>>> MERGE-SOURCE
16"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
17"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
18"Language-Team: LANGUAGE <LL@li.org>\n"14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -46,7 +42,7 @@
4642
47#: ../src/app/qml/common/DetailsPage.qml:2643#: ../src/app/qml/common/DetailsPage.qml:26
48#: ../src/app/qml/loView/LOViewDefaultHeader.qml:10744#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
49#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:8345#: ../src/app/qml/pdfView/PdfView.qml:224
50#: ../src/app/qml/textView/TextViewDefaultHeader.qml:6946#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
51msgid "Details"47msgid "Details"
52msgstr ""48msgstr ""
@@ -121,6 +117,7 @@
121#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55117#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
122#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28118#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
123#: ../src/app/qml/loView/LOViewGotoDialog.qml:55119#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
120#: ../src/app/qml/pdfView/PdfView.qml:177
124#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51121#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
125msgid "Cancel"122msgid "Cancel"
126msgstr ""123msgstr ""
@@ -193,33 +190,33 @@
193190
194#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.191#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
195#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum192#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
196#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100193#: ../src/app/qml/documentPage/DocumentListDelegate.qml:103
197#, qt-format194#, qt-format
198msgid "Today, %1"195msgid "Today, %1"
199msgstr ""196msgstr ""
200197
201#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.198#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
202#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum199#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
203#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105200#: ../src/app/qml/documentPage/DocumentListDelegate.qml:108
204#, qt-format201#, qt-format
205msgid "Yesterday, %1"202msgid "Yesterday, %1"
206msgstr ""203msgstr ""
207204
208#. TRANSLATORS: this is a datetime formatting string,205#. TRANSLATORS: this is a datetime formatting string,
209#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.206#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
210#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112207#: ../src/app/qml/documentPage/DocumentListDelegate.qml:115
211#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131208#: ../src/app/qml/documentPage/DocumentListDelegate.qml:134
212msgid "yyyy/MM/dd hh:mm"209msgid "yyyy/MM/dd hh:mm"
213msgstr ""210msgstr ""
214211
215#. TRANSLATORS: this is a datetime formatting string,212#. TRANSLATORS: this is a datetime formatting string,
216#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.213#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
217#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125214#: ../src/app/qml/documentPage/DocumentListDelegate.qml:128
218msgid "dddd, hh:mm"215msgid "dddd, hh:mm"
219msgstr ""216msgstr ""
220217
221#: ../src/app/qml/documentPage/DocumentPage.qml:23218#: ../src/app/qml/documentPage/DocumentPage.qml:23
222#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3219#: /tmp/uitk-bottom-edge-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
223msgid "Documents"220msgid "Documents"
224msgstr ""221msgstr ""
225222
@@ -346,13 +343,13 @@
346msgstr ""343msgstr ""
347344
348#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100345#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
349#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77346#: ../src/app/qml/pdfView/PdfView.qml:217
350#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63347#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
351msgid "Disable night mode"348msgid "Disable night mode"
352msgstr ""349msgstr ""
353350
354#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100351#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
355#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77352#: ../src/app/qml/pdfView/PdfView.qml:217
356#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63353#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
357msgid "Enable night mode"354msgid "Enable night mode"
358msgstr ""355msgstr ""
@@ -396,31 +393,23 @@
396msgstr ""393msgstr ""
397394
398#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.395#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
399#: ../src/app/qml/pdfView/PdfContentsPage.qml:30396#: ../src/app/qml/pdfView/PdfContentsPage.qml:31
400<<<<<<< TREE397#: ../src/app/qml/pdfView/PdfView.qml:150
401#: ../src/app/qml/pdfView/PdfView.qml:38
402=======
403#: ../src/app/qml/pdfView/PdfView.qml:40
404>>>>>>> MERGE-SOURCE
405msgid "Contents"398msgid "Contents"
406msgstr ""399msgstr ""
407400
408#: ../src/app/qml/pdfView/PdfContentsPage.qml:33
409msgid "Hide table of contents"
410msgstr ""
411
412#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,401#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
413#. while the second one (%2) refers to the total pages count.402#. while the second one (%2) refers to the total pages count.
414<<<<<<< TREE403#: ../src/app/qml/pdfView/PdfView.qml:56
415#: ../src/app/qml/pdfView/PdfView.qml:35
416=======
417#: ../src/app/qml/pdfView/PdfView.qml:32
418>>>>>>> MERGE-SOURCE
419#, qt-format404#, qt-format
420msgid "Page %1 of %2"405msgid "Page %1 of %2"
421msgstr ""406msgstr ""
422407
423#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71408#: ../src/app/qml/pdfView/PdfView.qml:200
409msgid "Search"
410msgstr ""
411
412#: ../src/app/qml/pdfView/PdfView.qml:210
424msgid "Go to page..."413msgid "Go to page..."
425msgstr ""414msgstr ""
426415
@@ -433,7 +422,7 @@
433msgid "Choose a page between 1 and %1"422msgid "Choose a page between 1 and %1"
434msgstr ""423msgstr ""
435424
436#: ../src/app/qml/ubuntu-docviewer-app.qml:124425#: ../src/app/qml/ubuntu-docviewer-app.qml:118
437msgid "File does not exist."426msgid "File does not exist."
438msgstr ""427msgstr ""
439428
@@ -446,15 +435,15 @@
446#.435#.
447#. where "2" is given by the argument "%1"436#. where "2" is given by the argument "%1"
448#.437#.
449#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111438#: ../src/plugin/file-qml-plugin/fileutils.cpp:101
450#, qt-format439#, qt-format
451msgid "copy %1"440msgid "copy %1"
452msgstr ""441msgstr ""
453442
454#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1443#: /tmp/uitk-bottom-edge-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
455msgid "Document Viewer"444msgid "Document Viewer"
456msgstr ""445msgstr ""
457446
458#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2447#: /tmp/uitk-bottom-edge-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
459msgid "documents;viewer;pdf;reader;"448msgid "documents;viewer;pdf;reader;"
460msgstr ""449msgstr ""
461450
=== removed file 'po/ja.po'
--- po/ja.po 2016-01-05 05:47:43 +0000
+++ po/ja.po 1970-01-01 00:00:00 +0000
@@ -1,448 +0,0 @@
1# Japanese translation for ubuntu-docviewer-app
2# Copyright (c) 2016 Rosetta Contributors and Canonical Ltd 2016
3# This file is distributed under the same license as the ubuntu-docviewer-app package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
5#
6msgid ""
7msgstr ""
8"Project-Id-Version: ubuntu-docviewer-app\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2015-12-27 13:06+0100\n"
11"PO-Revision-Date: 2016-01-03 18:49+0000\n"
12"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Language-Team: Japanese <ja@li.org>\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=1; plural=0;\n"
18"X-Launchpad-Export-Date: 2016-01-05 05:47+0000\n"
19"X-Generator: Launchpad (build 17876)\n"
20
21#: ../src/app/qml/common/CommandLineProxy.qml:49
22msgid "Some of the provided arguments are not valid."
23msgstr ""
24
25#: ../src/app/qml/common/CommandLineProxy.qml:58
26msgid "Open ubuntu-docviewer-app displaying the selected file"
27msgstr ""
28
29#: ../src/app/qml/common/CommandLineProxy.qml:65
30msgid "Run fullscreen"
31msgstr ""
32
33#: ../src/app/qml/common/CommandLineProxy.qml:71
34msgid "Open ubuntu-docviewer-app in pick mode. Used for tests only."
35msgstr ""
36
37#: ../src/app/qml/common/CommandLineProxy.qml:77
38msgid ""
39"Show documents from the given folder, instead of ~/Documents.\n"
40"The path must exist prior to running ubuntu-docviewer-app"
41msgstr ""
42
43#: ../src/app/qml/common/DetailsPage.qml:26
44#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
45#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
46#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
47msgid "Details"
48msgstr ""
49
50#: ../src/app/qml/common/DetailsPage.qml:42
51msgid "File"
52msgstr ""
53
54#: ../src/app/qml/common/DetailsPage.qml:47
55msgid "Location"
56msgstr ""
57
58#: ../src/app/qml/common/DetailsPage.qml:52
59msgid "Size"
60msgstr ""
61
62#: ../src/app/qml/common/DetailsPage.qml:57
63msgid "Created"
64msgstr ""
65
66#: ../src/app/qml/common/DetailsPage.qml:62
67msgid "Last modified"
68msgstr ""
69
70#: ../src/app/qml/common/DetailsPage.qml:69
71msgid "MIME type"
72msgstr ""
73
74#: ../src/app/qml/common/ErrorDialog.qml:23
75msgid "Error"
76msgstr ""
77
78#: ../src/app/qml/common/ErrorDialog.qml:26
79#: ../src/app/qml/common/PickImportedDialog.qml:54
80#: ../src/app/qml/common/RejectedImportDialog.qml:38
81#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:31
82#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
83msgid "Close"
84msgstr ""
85
86#: ../src/app/qml/common/PickImportedDialog.qml:29
87msgid "Multiple documents imported"
88msgstr ""
89
90#: ../src/app/qml/common/PickImportedDialog.qml:30
91msgid "Choose which one to open:"
92msgstr ""
93
94#: ../src/app/qml/common/RejectedImportDialog.qml:28
95msgid "File not supported"
96msgid_plural "Files not supported"
97msgstr[0] ""
98msgstr[1] ""
99
100#: ../src/app/qml/common/RejectedImportDialog.qml:29
101msgid "Following document has not been imported:"
102msgid_plural "Following documents have not been imported:"
103msgstr[0] ""
104msgstr[1] ""
105
106#: ../src/app/qml/common/UnknownTypeDialog.qml:27
107msgid "Unknown file type"
108msgstr ""
109
110#: ../src/app/qml/common/UnknownTypeDialog.qml:28
111msgid ""
112"This file is not supported.\n"
113"Do you want to open it as a plain text?"
114msgstr ""
115
116#: ../src/app/qml/common/UnknownTypeDialog.qml:38
117#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
118#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
119#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
120#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
121msgid "Cancel"
122msgstr ""
123
124#: ../src/app/qml/common/UnknownTypeDialog.qml:44
125msgid "Yes"
126msgstr ""
127
128#. TRANSLATORS: %1 is the size of a file, expressed in GB
129#: ../src/app/qml/common/utils.js:22
130#, qt-format
131msgid "%1 GB"
132msgstr ""
133
134#. TRANSLATORS: %1 is the size of a file, expressed in MB
135#: ../src/app/qml/common/utils.js:26
136#, qt-format
137msgid "%1 MB"
138msgstr ""
139
140#. TRANSLATORS: %1 is the size of a file, expressed in kB
141#: ../src/app/qml/common/utils.js:30
142#, qt-format
143msgid "%1 kB"
144msgstr ""
145
146#. TRANSLATORS: %1 is the size of a file, expressed in byte
147#: ../src/app/qml/common/utils.js:33
148#, qt-format
149msgid "%1 byte"
150msgstr ""
151
152#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
153msgid "Delete file"
154msgstr ""
155
156#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
157#, qt-format
158msgid "Delete %1 file"
159msgid_plural "Delete %1 files"
160msgstr[0] ""
161msgstr[1] ""
162
163#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
164#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
165msgid "Are you sure you want to permanently delete this file?"
166msgid_plural "Are you sure you want to permanently delete these files?"
167msgstr[0] ""
168msgstr[1] ""
169
170#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
171#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
172#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:53
173msgid "Delete"
174msgstr ""
175
176#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:44
177msgid "Share"
178msgstr ""
179
180#: ../src/app/qml/documentPage/DocumentEmptyState.qml:75
181msgid "No document found"
182msgstr ""
183
184#: ../src/app/qml/documentPage/DocumentEmptyState.qml:84
185msgid ""
186"Connect your device to any computer and simply drag files to the Documents "
187"folder or insert removable media with documents."
188msgstr ""
189
190#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
191#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
192#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
193#, qt-format
194msgid "Today, %1"
195msgstr ""
196
197#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
198#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
199#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105
200#, qt-format
201msgid "Yesterday, %1"
202msgstr ""
203
204#. TRANSLATORS: this is a datetime formatting string,
205#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
206#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112
207#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131
208msgid "yyyy/MM/dd hh:mm"
209msgstr ""
210
211#. TRANSLATORS: this is a datetime formatting string,
212#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
213#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125
214msgid "dddd, hh:mm"
215msgstr ""
216
217#: ../src/app/qml/documentPage/DocumentPage.qml:23
218#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
219msgid "Documents"
220msgstr ""
221
222#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:29
223msgid "Search..."
224msgstr ""
225
226#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
227msgid "Sorting settings..."
228msgstr ""
229
230#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
231msgid "Switch to single column list"
232msgstr ""
233
234#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
235msgid "Switch to grid"
236msgstr ""
237
238#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:49
239msgid "Pick"
240msgstr ""
241
242#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
243msgid "Back"
244msgstr ""
245
246#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:47
247msgid "search in documents..."
248msgstr ""
249
250#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
251msgid "Select None"
252msgstr ""
253
254#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
255msgid "Select All"
256msgstr ""
257
258#: ../src/app/qml/documentPage/SearchEmptyState.qml:24
259msgid "No matching document found"
260msgstr ""
261
262#: ../src/app/qml/documentPage/SearchEmptyState.qml:26
263msgid ""
264"Please ensure that your query is not misspelled and/or try a different query."
265msgstr ""
266
267#: ../src/app/qml/documentPage/SectionHeader.qml:13
268msgid "Today"
269msgstr ""
270
271#: ../src/app/qml/documentPage/SectionHeader.qml:16
272msgid "Yesterday"
273msgstr ""
274
275#: ../src/app/qml/documentPage/SectionHeader.qml:19
276msgid "Earlier this week"
277msgstr ""
278
279#: ../src/app/qml/documentPage/SectionHeader.qml:22
280msgid "Earlier this month"
281msgstr ""
282
283#: ../src/app/qml/documentPage/SectionHeader.qml:24
284msgid "Even earlier..."
285msgstr ""
286
287#: ../src/app/qml/documentPage/SharePage.qml:23
288msgid "Share to"
289msgstr ""
290
291#: ../src/app/qml/documentPage/SortSettingsDialog.qml:26
292msgid "Sorting settings"
293msgstr ""
294
295#: ../src/app/qml/documentPage/SortSettingsDialog.qml:31
296msgid "Sort by date (Latest first)"
297msgstr ""
298
299#: ../src/app/qml/documentPage/SortSettingsDialog.qml:32
300msgid "Sort by name (A-Z)"
301msgstr ""
302
303#: ../src/app/qml/documentPage/SortSettingsDialog.qml:33
304msgid "Sort by size (Smaller first)"
305msgstr ""
306
307#: ../src/app/qml/documentPage/SortSettingsDialog.qml:47
308msgid "Reverse order"
309msgstr ""
310
311#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
312#: ../src/app/qml/textView/TextView.qml:43
313msgid "Loading..."
314msgstr ""
315
316#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
317msgid "LibreOffice text document"
318msgstr ""
319
320#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
321msgid "LibreOffice spread sheet"
322msgstr ""
323
324#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
325msgid "LibreOffice presentation"
326msgstr ""
327
328#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
329msgid "LibreOffice Draw document"
330msgstr ""
331
332#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
333msgid "Unknown LibreOffice document"
334msgstr ""
335
336#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
337msgid "Unknown type document"
338msgstr ""
339
340#: ../src/app/qml/loView/LOViewDefaultHeader.qml:85
341msgid "Go to position..."
342msgstr ""
343
344#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
345#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
346#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
347msgid "Disable night mode"
348msgstr ""
349
350#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
351#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
352#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
353msgid "Enable night mode"
354msgstr ""
355
356#: ../src/app/qml/loView/LOViewGotoDialog.qml:30
357msgid "Go to position"
358msgstr ""
359
360#: ../src/app/qml/loView/LOViewGotoDialog.qml:31
361msgid "Choose a position between 1% and 100%"
362msgstr ""
363
364#: ../src/app/qml/loView/LOViewGotoDialog.qml:62
365#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
366msgid "GO!"
367msgstr ""
368
369#: ../src/app/qml/loView/LOViewPage.qml:129
370msgid "LibreOffice binaries not found."
371msgstr ""
372
373#: ../src/app/qml/loView/LOViewPage.qml:132
374msgid "Error while loading LibreOffice."
375msgstr ""
376
377#: ../src/app/qml/loView/LOViewPage.qml:135
378msgid ""
379"Document not loaded.\n"
380"The requested document may be corrupt or protected by a password."
381msgstr ""
382
383#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
384#. Document Viewer for rendering LibreOffice/MS-Office documents.
385#. Ref. https://docs.libreoffice.org/libreofficekit.html
386#: ../src/app/qml/loView/Splashscreen.qml:45
387msgid "Powered by LibreOfficeKit"
388msgstr ""
389
390#: ../src/app/qml/loView/ZoomSelector.qml:110
391msgid "Fit width"
392msgstr ""
393
394#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
395#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
396#: ../src/app/qml/pdfView/PdfView.qml:38
397msgid "Contents"
398msgstr ""
399
400#: ../src/app/qml/pdfView/PdfContentsPage.qml:36
401msgid "Hide table of contents"
402msgstr ""
403
404#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
405#. while the second one (%2) refers to the total pages count.
406#: ../src/app/qml/pdfView/PdfView.qml:35
407#, qt-format
408msgid "Page %1 of %2"
409msgstr ""
410
411#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
412msgid "Go to page..."
413msgstr ""
414
415#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
416msgid "Go to page"
417msgstr ""
418
419#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
420#, qt-format
421msgid "Choose a page between 1 and %1"
422msgstr ""
423
424#: ../src/app/qml/ubuntu-docviewer-app.qml:118
425msgid "File does not exist."
426msgstr ""
427
428#. TRANSLATORS: This string is used for renaming a copied file,
429#. when a file with the same name already exists in user's
430#. Documents folder.
431#.
432#. e.g. "Manual_Aquaris_E4.5_ubuntu_EN.pdf" will become
433#. "Manual_Aquaris_E4.5_ubuntu_EN (copy 2).pdf"
434#.
435#. where "2" is given by the argument "%1"
436#.
437#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111
438#, qt-format
439msgid "copy %1"
440msgstr ""
441
442#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
443msgid "Document Viewer"
444msgstr ""
445
446#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
447msgid "documents;viewer;pdf;reader;"
448msgstr ""
4490
=== added file 'po/ro.po'
--- po/ro.po 1970-01-01 00:00:00 +0000
+++ po/ro.po 2016-01-14 17:54:32 +0000
@@ -0,0 +1,449 @@
1# Romanian translation for ubuntu-docviewer-app
2# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
3# This file is distributed under the same license as the ubuntu-docviewer-app package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
5#
6msgid ""
7msgstr ""
8"Project-Id-Version: ubuntu-docviewer-app\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2015-12-27 13:06+0100\n"
11"PO-Revision-Date: 2015-12-23 20:27+0000\n"
12"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Language-Team: Romanian <ro@li.org>\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=3; plural=(n == 1 ? 0: (((n % 100 > 19) || ((n % 100 "
18"== 0) && (n != 0))) ? 2: 1));\n"
19"X-Launchpad-Export-Date: 2016-01-05 05:47+0000\n"
20"X-Generator: Launchpad (build 17876)\n"
21
22#: ../src/app/qml/common/CommandLineProxy.qml:49
23msgid "Some of the provided arguments are not valid."
24msgstr ""
25
26#: ../src/app/qml/common/CommandLineProxy.qml:58
27msgid "Open ubuntu-docviewer-app displaying the selected file"
28msgstr ""
29
30#: ../src/app/qml/common/CommandLineProxy.qml:65
31msgid "Run fullscreen"
32msgstr ""
33
34#: ../src/app/qml/common/CommandLineProxy.qml:71
35msgid "Open ubuntu-docviewer-app in pick mode. Used for tests only."
36msgstr ""
37
38#: ../src/app/qml/common/CommandLineProxy.qml:77
39msgid ""
40"Show documents from the given folder, instead of ~/Documents.\n"
41"The path must exist prior to running ubuntu-docviewer-app"
42msgstr ""
43
44#: ../src/app/qml/common/DetailsPage.qml:26
45#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
46#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
47#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
48msgid "Details"
49msgstr ""
50
51#: ../src/app/qml/common/DetailsPage.qml:42
52msgid "File"
53msgstr ""
54
55#: ../src/app/qml/common/DetailsPage.qml:47
56msgid "Location"
57msgstr ""
58
59#: ../src/app/qml/common/DetailsPage.qml:52
60msgid "Size"
61msgstr ""
62
63#: ../src/app/qml/common/DetailsPage.qml:57
64msgid "Created"
65msgstr ""
66
67#: ../src/app/qml/common/DetailsPage.qml:62
68msgid "Last modified"
69msgstr ""
70
71#: ../src/app/qml/common/DetailsPage.qml:69
72msgid "MIME type"
73msgstr ""
74
75#: ../src/app/qml/common/ErrorDialog.qml:23
76msgid "Error"
77msgstr ""
78
79#: ../src/app/qml/common/ErrorDialog.qml:26
80#: ../src/app/qml/common/PickImportedDialog.qml:54
81#: ../src/app/qml/common/RejectedImportDialog.qml:38
82#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:31
83#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
84msgid "Close"
85msgstr ""
86
87#: ../src/app/qml/common/PickImportedDialog.qml:29
88msgid "Multiple documents imported"
89msgstr ""
90
91#: ../src/app/qml/common/PickImportedDialog.qml:30
92msgid "Choose which one to open:"
93msgstr ""
94
95#: ../src/app/qml/common/RejectedImportDialog.qml:28
96msgid "File not supported"
97msgid_plural "Files not supported"
98msgstr[0] ""
99msgstr[1] ""
100
101#: ../src/app/qml/common/RejectedImportDialog.qml:29
102msgid "Following document has not been imported:"
103msgid_plural "Following documents have not been imported:"
104msgstr[0] ""
105msgstr[1] ""
106
107#: ../src/app/qml/common/UnknownTypeDialog.qml:27
108msgid "Unknown file type"
109msgstr ""
110
111#: ../src/app/qml/common/UnknownTypeDialog.qml:28
112msgid ""
113"This file is not supported.\n"
114"Do you want to open it as a plain text?"
115msgstr ""
116
117#: ../src/app/qml/common/UnknownTypeDialog.qml:38
118#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
119#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
120#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
121#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
122msgid "Cancel"
123msgstr ""
124
125#: ../src/app/qml/common/UnknownTypeDialog.qml:44
126msgid "Yes"
127msgstr ""
128
129#. TRANSLATORS: %1 is the size of a file, expressed in GB
130#: ../src/app/qml/common/utils.js:22
131#, qt-format
132msgid "%1 GB"
133msgstr ""
134
135#. TRANSLATORS: %1 is the size of a file, expressed in MB
136#: ../src/app/qml/common/utils.js:26
137#, qt-format
138msgid "%1 MB"
139msgstr ""
140
141#. TRANSLATORS: %1 is the size of a file, expressed in kB
142#: ../src/app/qml/common/utils.js:30
143#, qt-format
144msgid "%1 kB"
145msgstr ""
146
147#. TRANSLATORS: %1 is the size of a file, expressed in byte
148#: ../src/app/qml/common/utils.js:33
149#, qt-format
150msgid "%1 byte"
151msgstr ""
152
153#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
154msgid "Delete file"
155msgstr ""
156
157#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
158#, qt-format
159msgid "Delete %1 file"
160msgid_plural "Delete %1 files"
161msgstr[0] ""
162msgstr[1] ""
163
164#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
165#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
166msgid "Are you sure you want to permanently delete this file?"
167msgid_plural "Are you sure you want to permanently delete these files?"
168msgstr[0] ""
169msgstr[1] ""
170
171#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
172#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
173#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:53
174msgid "Delete"
175msgstr ""
176
177#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:44
178msgid "Share"
179msgstr ""
180
181#: ../src/app/qml/documentPage/DocumentEmptyState.qml:75
182msgid "No document found"
183msgstr ""
184
185#: ../src/app/qml/documentPage/DocumentEmptyState.qml:84
186msgid ""
187"Connect your device to any computer and simply drag files to the Documents "
188"folder or insert removable media with documents."
189msgstr ""
190
191#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
192#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
193#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
194#, qt-format
195msgid "Today, %1"
196msgstr ""
197
198#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
199#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
200#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105
201#, qt-format
202msgid "Yesterday, %1"
203msgstr ""
204
205#. TRANSLATORS: this is a datetime formatting string,
206#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
207#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112
208#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131
209msgid "yyyy/MM/dd hh:mm"
210msgstr ""
211
212#. TRANSLATORS: this is a datetime formatting string,
213#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
214#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125
215msgid "dddd, hh:mm"
216msgstr ""
217
218#: ../src/app/qml/documentPage/DocumentPage.qml:23
219#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
220msgid "Documents"
221msgstr ""
222
223#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:29
224msgid "Search..."
225msgstr ""
226
227#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
228msgid "Sorting settings..."
229msgstr ""
230
231#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
232msgid "Switch to single column list"
233msgstr ""
234
235#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
236msgid "Switch to grid"
237msgstr ""
238
239#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:49
240msgid "Pick"
241msgstr ""
242
243#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
244msgid "Back"
245msgstr ""
246
247#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:47
248msgid "search in documents..."
249msgstr ""
250
251#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
252msgid "Select None"
253msgstr ""
254
255#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
256msgid "Select All"
257msgstr ""
258
259#: ../src/app/qml/documentPage/SearchEmptyState.qml:24
260msgid "No matching document found"
261msgstr ""
262
263#: ../src/app/qml/documentPage/SearchEmptyState.qml:26
264msgid ""
265"Please ensure that your query is not misspelled and/or try a different query."
266msgstr ""
267
268#: ../src/app/qml/documentPage/SectionHeader.qml:13
269msgid "Today"
270msgstr ""
271
272#: ../src/app/qml/documentPage/SectionHeader.qml:16
273msgid "Yesterday"
274msgstr ""
275
276#: ../src/app/qml/documentPage/SectionHeader.qml:19
277msgid "Earlier this week"
278msgstr ""
279
280#: ../src/app/qml/documentPage/SectionHeader.qml:22
281msgid "Earlier this month"
282msgstr ""
283
284#: ../src/app/qml/documentPage/SectionHeader.qml:24
285msgid "Even earlier..."
286msgstr ""
287
288#: ../src/app/qml/documentPage/SharePage.qml:23
289msgid "Share to"
290msgstr ""
291
292#: ../src/app/qml/documentPage/SortSettingsDialog.qml:26
293msgid "Sorting settings"
294msgstr ""
295
296#: ../src/app/qml/documentPage/SortSettingsDialog.qml:31
297msgid "Sort by date (Latest first)"
298msgstr ""
299
300#: ../src/app/qml/documentPage/SortSettingsDialog.qml:32
301msgid "Sort by name (A-Z)"
302msgstr ""
303
304#: ../src/app/qml/documentPage/SortSettingsDialog.qml:33
305msgid "Sort by size (Smaller first)"
306msgstr ""
307
308#: ../src/app/qml/documentPage/SortSettingsDialog.qml:47
309msgid "Reverse order"
310msgstr ""
311
312#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
313#: ../src/app/qml/textView/TextView.qml:43
314msgid "Loading..."
315msgstr ""
316
317#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
318msgid "LibreOffice text document"
319msgstr ""
320
321#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
322msgid "LibreOffice spread sheet"
323msgstr ""
324
325#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
326msgid "LibreOffice presentation"
327msgstr ""
328
329#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
330msgid "LibreOffice Draw document"
331msgstr ""
332
333#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
334msgid "Unknown LibreOffice document"
335msgstr ""
336
337#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
338msgid "Unknown type document"
339msgstr ""
340
341#: ../src/app/qml/loView/LOViewDefaultHeader.qml:85
342msgid "Go to position..."
343msgstr ""
344
345#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
346#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
347#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
348msgid "Disable night mode"
349msgstr ""
350
351#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
352#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
353#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
354msgid "Enable night mode"
355msgstr ""
356
357#: ../src/app/qml/loView/LOViewGotoDialog.qml:30
358msgid "Go to position"
359msgstr ""
360
361#: ../src/app/qml/loView/LOViewGotoDialog.qml:31
362msgid "Choose a position between 1% and 100%"
363msgstr ""
364
365#: ../src/app/qml/loView/LOViewGotoDialog.qml:62
366#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
367msgid "GO!"
368msgstr ""
369
370#: ../src/app/qml/loView/LOViewPage.qml:129
371msgid "LibreOffice binaries not found."
372msgstr ""
373
374#: ../src/app/qml/loView/LOViewPage.qml:132
375msgid "Error while loading LibreOffice."
376msgstr ""
377
378#: ../src/app/qml/loView/LOViewPage.qml:135
379msgid ""
380"Document not loaded.\n"
381"The requested document may be corrupt or protected by a password."
382msgstr ""
383
384#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
385#. Document Viewer for rendering LibreOffice/MS-Office documents.
386#. Ref. https://docs.libreoffice.org/libreofficekit.html
387#: ../src/app/qml/loView/Splashscreen.qml:45
388msgid "Powered by LibreOfficeKit"
389msgstr ""
390
391#: ../src/app/qml/loView/ZoomSelector.qml:110
392msgid "Fit width"
393msgstr ""
394
395#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
396#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
397#: ../src/app/qml/pdfView/PdfView.qml:38
398msgid "Contents"
399msgstr ""
400
401#: ../src/app/qml/pdfView/PdfContentsPage.qml:36
402msgid "Hide table of contents"
403msgstr ""
404
405#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
406#. while the second one (%2) refers to the total pages count.
407#: ../src/app/qml/pdfView/PdfView.qml:35
408#, qt-format
409msgid "Page %1 of %2"
410msgstr ""
411
412#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
413msgid "Go to page..."
414msgstr ""
415
416#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
417msgid "Go to page"
418msgstr ""
419
420#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
421#, qt-format
422msgid "Choose a page between 1 and %1"
423msgstr ""
424
425#: ../src/app/qml/ubuntu-docviewer-app.qml:118
426msgid "File does not exist."
427msgstr ""
428
429#. TRANSLATORS: This string is used for renaming a copied file,
430#. when a file with the same name already exists in user's
431#. Documents folder.
432#.
433#. e.g. "Manual_Aquaris_E4.5_ubuntu_EN.pdf" will become
434#. "Manual_Aquaris_E4.5_ubuntu_EN (copy 2).pdf"
435#.
436#. where "2" is given by the argument "%1"
437#.
438#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111
439#, qt-format
440msgid "copy %1"
441msgstr ""
442
443#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
444msgid "Document Viewer"
445msgstr ""
446
447#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
448msgid "documents;viewer;pdf;reader;"
449msgstr ""
0450
=== removed file 'po/ro.po'
--- po/ro.po 2016-01-05 05:47:43 +0000
+++ po/ro.po 1970-01-01 00:00:00 +0000
@@ -1,449 +0,0 @@
1# Romanian translation for ubuntu-docviewer-app
2# Copyright (c) 2015 Rosetta Contributors and Canonical Ltd 2015
3# This file is distributed under the same license as the ubuntu-docviewer-app package.
4# FIRST AUTHOR <EMAIL@ADDRESS>, 2015.
5#
6msgid ""
7msgstr ""
8"Project-Id-Version: ubuntu-docviewer-app\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2015-12-27 13:06+0100\n"
11"PO-Revision-Date: 2015-12-23 20:27+0000\n"
12"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Language-Team: Romanian <ro@li.org>\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=3; plural=(n == 1 ? 0: (((n % 100 > 19) || ((n % 100 "
18"== 0) && (n != 0))) ? 2: 1));\n"
19"X-Launchpad-Export-Date: 2016-01-05 05:47+0000\n"
20"X-Generator: Launchpad (build 17876)\n"
21
22#: ../src/app/qml/common/CommandLineProxy.qml:49
23msgid "Some of the provided arguments are not valid."
24msgstr ""
25
26#: ../src/app/qml/common/CommandLineProxy.qml:58
27msgid "Open ubuntu-docviewer-app displaying the selected file"
28msgstr ""
29
30#: ../src/app/qml/common/CommandLineProxy.qml:65
31msgid "Run fullscreen"
32msgstr ""
33
34#: ../src/app/qml/common/CommandLineProxy.qml:71
35msgid "Open ubuntu-docviewer-app in pick mode. Used for tests only."
36msgstr ""
37
38#: ../src/app/qml/common/CommandLineProxy.qml:77
39msgid ""
40"Show documents from the given folder, instead of ~/Documents.\n"
41"The path must exist prior to running ubuntu-docviewer-app"
42msgstr ""
43
44#: ../src/app/qml/common/DetailsPage.qml:26
45#: ../src/app/qml/loView/LOViewDefaultHeader.qml:107
46#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:83
47#: ../src/app/qml/textView/TextViewDefaultHeader.qml:69
48msgid "Details"
49msgstr ""
50
51#: ../src/app/qml/common/DetailsPage.qml:42
52msgid "File"
53msgstr ""
54
55#: ../src/app/qml/common/DetailsPage.qml:47
56msgid "Location"
57msgstr ""
58
59#: ../src/app/qml/common/DetailsPage.qml:52
60msgid "Size"
61msgstr ""
62
63#: ../src/app/qml/common/DetailsPage.qml:57
64msgid "Created"
65msgstr ""
66
67#: ../src/app/qml/common/DetailsPage.qml:62
68msgid "Last modified"
69msgstr ""
70
71#: ../src/app/qml/common/DetailsPage.qml:69
72msgid "MIME type"
73msgstr ""
74
75#: ../src/app/qml/common/ErrorDialog.qml:23
76msgid "Error"
77msgstr ""
78
79#: ../src/app/qml/common/ErrorDialog.qml:26
80#: ../src/app/qml/common/PickImportedDialog.qml:54
81#: ../src/app/qml/common/RejectedImportDialog.qml:38
82#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:31
83#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
84msgid "Close"
85msgstr ""
86
87#: ../src/app/qml/common/PickImportedDialog.qml:29
88msgid "Multiple documents imported"
89msgstr ""
90
91#: ../src/app/qml/common/PickImportedDialog.qml:30
92msgid "Choose which one to open:"
93msgstr ""
94
95#: ../src/app/qml/common/RejectedImportDialog.qml:28
96msgid "File not supported"
97msgid_plural "Files not supported"
98msgstr[0] ""
99msgstr[1] ""
100
101#: ../src/app/qml/common/RejectedImportDialog.qml:29
102msgid "Following document has not been imported:"
103msgid_plural "Following documents have not been imported:"
104msgstr[0] ""
105msgstr[1] ""
106
107#: ../src/app/qml/common/UnknownTypeDialog.qml:27
108msgid "Unknown file type"
109msgstr ""
110
111#: ../src/app/qml/common/UnknownTypeDialog.qml:28
112msgid ""
113"This file is not supported.\n"
114"Do you want to open it as a plain text?"
115msgstr ""
116
117#: ../src/app/qml/common/UnknownTypeDialog.qml:38
118#: ../src/app/qml/documentPage/DeleteFileDialog.qml:55
119#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:28
120#: ../src/app/qml/loView/LOViewGotoDialog.qml:55
121#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:51
122msgid "Cancel"
123msgstr ""
124
125#: ../src/app/qml/common/UnknownTypeDialog.qml:44
126msgid "Yes"
127msgstr ""
128
129#. TRANSLATORS: %1 is the size of a file, expressed in GB
130#: ../src/app/qml/common/utils.js:22
131#, qt-format
132msgid "%1 GB"
133msgstr ""
134
135#. TRANSLATORS: %1 is the size of a file, expressed in MB
136#: ../src/app/qml/common/utils.js:26
137#, qt-format
138msgid "%1 MB"
139msgstr ""
140
141#. TRANSLATORS: %1 is the size of a file, expressed in kB
142#: ../src/app/qml/common/utils.js:30
143#, qt-format
144msgid "%1 kB"
145msgstr ""
146
147#. TRANSLATORS: %1 is the size of a file, expressed in byte
148#: ../src/app/qml/common/utils.js:33
149#, qt-format
150msgid "%1 byte"
151msgstr ""
152
153#: ../src/app/qml/documentPage/DeleteFileDialog.qml:39
154msgid "Delete file"
155msgstr ""
156
157#: ../src/app/qml/documentPage/DeleteFileDialog.qml:40
158#, qt-format
159msgid "Delete %1 file"
160msgid_plural "Delete %1 files"
161msgstr[0] ""
162msgstr[1] ""
163
164#: ../src/app/qml/documentPage/DeleteFileDialog.qml:41
165#: ../src/app/qml/documentPage/DeleteFileDialog.qml:42
166msgid "Are you sure you want to permanently delete this file?"
167msgid_plural "Are you sure you want to permanently delete these files?"
168msgstr[0] ""
169msgstr[1] ""
170
171#: ../src/app/qml/documentPage/DeleteFileDialog.qml:61
172#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:25
173#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:53
174msgid "Delete"
175msgstr ""
176
177#: ../src/app/qml/documentPage/DocumentDelegateActions.qml:44
178msgid "Share"
179msgstr ""
180
181#: ../src/app/qml/documentPage/DocumentEmptyState.qml:75
182msgid "No document found"
183msgstr ""
184
185#: ../src/app/qml/documentPage/DocumentEmptyState.qml:84
186msgid ""
187"Connect your device to any computer and simply drag files to the Documents "
188"folder or insert removable media with documents."
189msgstr ""
190
191#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
192#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
193#: ../src/app/qml/documentPage/DocumentListDelegate.qml:100
194#, qt-format
195msgid "Today, %1"
196msgstr ""
197
198#. TRANSLATORS: %1 refers to a time formatted as Locale.ShortFormat (e.g. hh:mm). It depends on system settings.
199#. http://qt-project.org/doc/qt-4.8/qlocale.html#FormatType-enum
200#: ../src/app/qml/documentPage/DocumentListDelegate.qml:105
201#, qt-format
202msgid "Yesterday, %1"
203msgstr ""
204
205#. TRANSLATORS: this is a datetime formatting string,
206#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
207#: ../src/app/qml/documentPage/DocumentListDelegate.qml:112
208#: ../src/app/qml/documentPage/DocumentListDelegate.qml:131
209msgid "yyyy/MM/dd hh:mm"
210msgstr ""
211
212#. TRANSLATORS: this is a datetime formatting string,
213#. see http://qt-project.org/doc/qt-5/qml-qtqml-date.html#details for valid expressions.
214#: ../src/app/qml/documentPage/DocumentListDelegate.qml:125
215msgid "dddd, hh:mm"
216msgstr ""
217
218#: ../src/app/qml/documentPage/DocumentPage.qml:23
219#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:3
220msgid "Documents"
221msgstr ""
222
223#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:29
224msgid "Search..."
225msgstr ""
226
227#: ../src/app/qml/documentPage/DocumentPageDefaultHeader.qml:36
228msgid "Sorting settings..."
229msgstr ""
230
231#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
232msgid "Switch to single column list"
233msgstr ""
234
235#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:41
236msgid "Switch to grid"
237msgstr ""
238
239#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:49
240msgid "Pick"
241msgstr ""
242
243#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
244msgid "Back"
245msgstr ""
246
247#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:47
248msgid "search in documents..."
249msgstr ""
250
251#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
252msgid "Select None"
253msgstr ""
254
255#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:40
256msgid "Select All"
257msgstr ""
258
259#: ../src/app/qml/documentPage/SearchEmptyState.qml:24
260msgid "No matching document found"
261msgstr ""
262
263#: ../src/app/qml/documentPage/SearchEmptyState.qml:26
264msgid ""
265"Please ensure that your query is not misspelled and/or try a different query."
266msgstr ""
267
268#: ../src/app/qml/documentPage/SectionHeader.qml:13
269msgid "Today"
270msgstr ""
271
272#: ../src/app/qml/documentPage/SectionHeader.qml:16
273msgid "Yesterday"
274msgstr ""
275
276#: ../src/app/qml/documentPage/SectionHeader.qml:19
277msgid "Earlier this week"
278msgstr ""
279
280#: ../src/app/qml/documentPage/SectionHeader.qml:22
281msgid "Earlier this month"
282msgstr ""
283
284#: ../src/app/qml/documentPage/SectionHeader.qml:24
285msgid "Even earlier..."
286msgstr ""
287
288#: ../src/app/qml/documentPage/SharePage.qml:23
289msgid "Share to"
290msgstr ""
291
292#: ../src/app/qml/documentPage/SortSettingsDialog.qml:26
293msgid "Sorting settings"
294msgstr ""
295
296#: ../src/app/qml/documentPage/SortSettingsDialog.qml:31
297msgid "Sort by date (Latest first)"
298msgstr ""
299
300#: ../src/app/qml/documentPage/SortSettingsDialog.qml:32
301msgid "Sort by name (A-Z)"
302msgstr ""
303
304#: ../src/app/qml/documentPage/SortSettingsDialog.qml:33
305msgid "Sort by size (Smaller first)"
306msgstr ""
307
308#: ../src/app/qml/documentPage/SortSettingsDialog.qml:47
309msgid "Reverse order"
310msgstr ""
311
312#: ../src/app/qml/loView/LOViewDefaultHeader.qml:51
313#: ../src/app/qml/textView/TextView.qml:43
314msgid "Loading..."
315msgstr ""
316
317#: ../src/app/qml/loView/LOViewDefaultHeader.qml:55
318msgid "LibreOffice text document"
319msgstr ""
320
321#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
322msgid "LibreOffice spread sheet"
323msgstr ""
324
325#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
326msgid "LibreOffice presentation"
327msgstr ""
328
329#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
330msgid "LibreOffice Draw document"
331msgstr ""
332
333#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
334msgid "Unknown LibreOffice document"
335msgstr ""
336
337#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
338msgid "Unknown type document"
339msgstr ""
340
341#: ../src/app/qml/loView/LOViewDefaultHeader.qml:85
342msgid "Go to position..."
343msgstr ""
344
345#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
346#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
347#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
348msgid "Disable night mode"
349msgstr ""
350
351#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
352#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:77
353#: ../src/app/qml/textView/TextViewDefaultHeader.qml:63
354msgid "Enable night mode"
355msgstr ""
356
357#: ../src/app/qml/loView/LOViewGotoDialog.qml:30
358msgid "Go to position"
359msgstr ""
360
361#: ../src/app/qml/loView/LOViewGotoDialog.qml:31
362msgid "Choose a position between 1% and 100%"
363msgstr ""
364
365#: ../src/app/qml/loView/LOViewGotoDialog.qml:62
366#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:58
367msgid "GO!"
368msgstr ""
369
370#: ../src/app/qml/loView/LOViewPage.qml:129
371msgid "LibreOffice binaries not found."
372msgstr ""
373
374#: ../src/app/qml/loView/LOViewPage.qml:132
375msgid "Error while loading LibreOffice."
376msgstr ""
377
378#: ../src/app/qml/loView/LOViewPage.qml:135
379msgid ""
380"Document not loaded.\n"
381"The requested document may be corrupt or protected by a password."
382msgstr ""
383
384#. TRANSLATORS: 'LibreOfficeKit' is the name of the library used by
385#. Document Viewer for rendering LibreOffice/MS-Office documents.
386#. Ref. https://docs.libreoffice.org/libreofficekit.html
387#: ../src/app/qml/loView/Splashscreen.qml:45
388msgid "Powered by LibreOfficeKit"
389msgstr ""
390
391#: ../src/app/qml/loView/ZoomSelector.qml:110
392msgid "Fit width"
393msgstr ""
394
395#. TRANSLATORS: "Contents" refers to the "Table of Contents" of a PDF document.
396#: ../src/app/qml/pdfView/PdfContentsPage.qml:30
397#: ../src/app/qml/pdfView/PdfView.qml:38
398msgid "Contents"
399msgstr ""
400
401#: ../src/app/qml/pdfView/PdfContentsPage.qml:36
402msgid "Hide table of contents"
403msgstr ""
404
405#. TRANSLATORS: the first argument (%1) refers to the page currently shown on the screen,
406#. while the second one (%2) refers to the total pages count.
407#: ../src/app/qml/pdfView/PdfView.qml:35
408#, qt-format
409msgid "Page %1 of %2"
410msgstr ""
411
412#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:71
413msgid "Go to page..."
414msgstr ""
415
416#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
417msgid "Go to page"
418msgstr ""
419
420#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:27
421#, qt-format
422msgid "Choose a page between 1 and %1"
423msgstr ""
424
425#: ../src/app/qml/ubuntu-docviewer-app.qml:118
426msgid "File does not exist."
427msgstr ""
428
429#. TRANSLATORS: This string is used for renaming a copied file,
430#. when a file with the same name already exists in user's
431#. Documents folder.
432#.
433#. e.g. "Manual_Aquaris_E4.5_ubuntu_EN.pdf" will become
434#. "Manual_Aquaris_E4.5_ubuntu_EN (copy 2).pdf"
435#.
436#. where "2" is given by the argument "%1"
437#.
438#: ../src/plugin/file-qml-plugin/docviewerutils.cpp:111
439#, qt-format
440msgid "copy %1"
441msgstr ""
442
443#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:1
444msgid "Document Viewer"
445msgstr ""
446
447#: /tmp/ubuntu-docviewer-app-build/po/com.ubuntu.docviewer.desktop.in.in.h:2
448msgid "documents;viewer;pdf;reader;"
449msgstr ""
4500
=== modified file 'src/app/qml/common/ContentHubProxy.qml'
--- src/app/qml/common/ContentHubProxy.qml 2015-10-10 12:03:30 +0000
+++ src/app/qml/common/ContentHubProxy.qml 2016-01-14 17:54:32 +0000
@@ -53,11 +53,11 @@
53 for (var i=0; i<activeTransfer.items.length; i++) {53 for (var i=0; i<activeTransfer.items.length; i++) {
54 var sourcePath = internal.getPathFromUrl(activeTransfer.items[i].url)54 var sourcePath = internal.getPathFromUrl(activeTransfer.items[i].url)
5555
56 if (DocumentViewer.isFileSupported(sourcePath)) {56 if (FileUtils.isFileSupported(sourcePath)) {
57 var documentsLocation = DocumentViewer.getXdgDocumentsLocation()57 var documentsLocation = FileUtils.getXdgDocumentsLocation()
5858
59 // Check if we have already imported the same document in the past.59 // Check if we have already imported the same document in the past.
60 var earlierImportedFile = DocumentViewer.checkIfFileAlreadyImported(sourcePath, [documentsLocation])60 var earlierImportedFile = FileUtils.checkIfFileAlreadyImported(sourcePath, [documentsLocation])
61 if (earlierImportedFile.length > 0) {61 if (earlierImportedFile.length > 0) {
62 // Document has been already imported in the past.62 // Document has been already imported in the past.
63 // Append the path of the earlier copy of the63 // Append the path of the earlier copy of the
@@ -65,7 +65,7 @@
65 importedDocsModel.append({ path: earlierImportedFile })65 importedDocsModel.append({ path: earlierImportedFile })
66 } else {66 } else {
67 // No document has been found, so we can safely copy it.67 // No document has been found, so we can safely copy it.
68 var destPath = DocumentViewer.buildDestinationPath(documentsLocation, sourcePath);68 var destPath = FileUtils.buildDestinationPath(documentsLocation, sourcePath);
6969
70 internal.importDocument(sourcePath, destPath)70 internal.importDocument(sourcePath, destPath)
71 }71 }
@@ -120,7 +120,7 @@
120 }120 }
121121
122 function importDocument(sourcePath, destPath) {122 function importDocument(sourcePath, destPath) {
123 DocumentViewer.copy(sourcePath, destPath)123 FileUtils.copy(sourcePath, destPath)
124 importedDocsModel.append({ path: destPath })124 importedDocsModel.append({ path: destPath })
125 }125 }
126126
127127
=== modified file 'src/app/qml/common/DetailsPage.qml'
--- src/app/qml/common/DetailsPage.qml 2015-12-27 12:10:06 +0000
+++ src/app/qml/common/DetailsPage.qml 2016-01-14 17:54:32 +0000
@@ -40,12 +40,12 @@
4040
41 SubtitledListItem {41 SubtitledListItem {
42 text: i18n.tr("File")42 text: i18n.tr("File")
43 subText: DocumentViewer.getFileNameFromPath(file.path)43 subText: FileUtils.getFileNameFromPath(file.path)
44 }44 }
4545
46 SubtitledListItem {46 SubtitledListItem {
47 text: i18n.tr("Location")47 text: i18n.tr("Location")
48 subText: DocumentViewer.getCanonicalPath(file.path)48 subText: FileUtils.getCanonicalPath(file.path)
49 }49 }
5050
51 SubtitledListItem {51 SubtitledListItem {
5252
=== modified file 'src/app/qml/common/PickImportedDialog.qml'
--- src/app/qml/common/PickImportedDialog.qml 2015-12-26 18:27:13 +0000
+++ src/app/qml/common/PickImportedDialog.qml 2016-01-14 17:54:32 +0000
@@ -40,7 +40,7 @@
40 }40 }
4141
42 Label {42 Label {
43 text: DocumentViewer.getFileBaseNameFromPath(model.path)43 text: FileUtils.getFileBaseNameFromPath(model.path)
44 anchors {44 anchors {
45 left: parent.left; right: parent.right45 left: parent.left; right: parent.right
46 margins: units.gu(2)46 margins: units.gu(2)
4747
=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-11-30 12:12:10 +0000
+++ src/app/qml/loView/LOViewDefaultHeader.qml 2016-01-14 17:54:32 +0000
@@ -73,7 +73,7 @@
73 Layout.preferredHeight: units.gu(4)73 Layout.preferredHeight: units.gu(4)
7474
75 view: targetPage.contentItem.loView75 view: targetPage.contentItem.loView
76 visible: targetPage.contentItem && (DocumentViewer.desktopMode || mainView.wideWindow)76 visible: targetPage.contentItem && (ConvergenceUtils.desktopMode || mainView.wideWindow)
77 }77 }
78 }78 }
7979
8080
=== modified file 'src/app/qml/loView/LOViewPage.qml'
--- src/app/qml/loView/LOViewPage.qml 2015-12-27 07:30:41 +0000
+++ src/app/qml/loView/LOViewPage.qml 2016-01-14 17:54:32 +0000
@@ -31,7 +31,7 @@
31 property bool isPresentation: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.PresentationDocument)31 property bool isPresentation: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.PresentationDocument)
32 property bool isTextDocument: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.TextDocument)32 property bool isTextDocument: loPage.contentItem && (loPage.contentItem.loDocument.documentType === LibreOffice.Document.TextDocument)
3333
34 title: DocumentViewer.getFileBaseNameFromPath(file.path);34 title: FileUtils.getFileBaseNameFromPath(file.path);
35 flickable: isTextDocument ? loPage.contentItem.loView : null35 flickable: isTextDocument ? loPage.contentItem.loView : null
3636
37 splashScreen: Splashscreen { }37 splashScreen: Splashscreen { }
3838
=== modified file 'src/app/qml/pdfView/PdfView.qml'
--- src/app/qml/pdfView/PdfView.qml 2016-01-14 17:54:32 +0000
+++ src/app/qml/pdfView/PdfView.qml 2016-01-14 17:54:32 +0000
@@ -16,12 +16,9 @@
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.318import Ubuntu.Components 1.3
19<<<<<<< TREE
20import DocumentViewer 1.0
21=======
22import Ubuntu.Components.Popups 1.319import Ubuntu.Components.Popups 1.3
23import QtQuick.Layouts 1.120import QtQuick.Layouts 1.1
24>>>>>>> MERGE-SOURCE21import DocumentViewer 1.0
25import DocumentViewer.PDF 1.0 as PDF22import DocumentViewer.PDF 1.0 as PDF
2623
27import "../common"24import "../common"
@@ -29,7 +26,7 @@
2926
30Page {27Page {
31 id: pdfPage28 id: pdfPage
32 title: DocumentViewer.getFileBaseNameFromPath(file.path)29 title: FileUtils.getFileBaseNameFromPath(file.path)
3330
34 header: PageHeader {31 header: PageHeader {
35 flickable: pdfView32 flickable: pdfView
3633
=== modified file 'src/app/qml/textView/TextView.qml'
--- src/app/qml/textView/TextView.qml 2015-12-26 18:27:13 +0000
+++ src/app/qml/textView/TextView.qml 2016-01-14 17:54:32 +0000
@@ -23,7 +23,7 @@
2323
24Page {24Page {
25 id: textPage25 id: textPage
26 title: DocumentViewer.getFileBaseNameFromPath(file.path)26 title: FileUtils.getFileBaseNameFromPath(file.path)
2727
28 // Reset night mode shader settings when closing the page28 // Reset night mode shader settings when closing the page
29 // Component.onDestruction: mainView.nightModeEnabled = false29 // Component.onDestruction: mainView.nightModeEnabled = false
3030
=== modified file 'src/app/qml/ubuntu-docviewer-app.qml'
--- src/app/qml/ubuntu-docviewer-app.qml 2015-11-30 12:12:10 +0000
+++ src/app/qml/ubuntu-docviewer-app.qml 2016-01-14 17:54:32 +0000
@@ -80,7 +80,7 @@
80 onIsLandscapeChanged: {80 onIsLandscapeChanged: {
81 // If device orientation is landscape and screen width is limited,81 // If device orientation is landscape and screen width is limited,
82 // force hiding Unity 8 indicators panel.82 // force hiding Unity 8 indicators panel.
83 if (!DocumentViewer.desktopMode && mainView.isLandscape &&83 if (!ConvergenceUtils.desktopMode && mainView.isLandscape &&
84 mainView.width < units.gu(51)) {84 mainView.width < units.gu(51)) {
85 mainView.fullscreen = true85 mainView.fullscreen = true
86 return;86 return;
@@ -202,6 +202,13 @@
202 }202 }
203 }203 }
204204
205 // WORKAROUND: Not yet implemented in the SDK
206 Binding {
207 target: QuickUtils
208 property: "mouseAttached"
209 value: ConvergenceUtils.mouseAttached
210 }
211
205 property bool nightModeEnabled: false212 property bool nightModeEnabled: false
206 layer.effect: NightModeShader {}213 layer.effect: NightModeShader {}
207 layer.enabled: nightModeEnabled && (pageStack.depth > 1)214 layer.enabled: nightModeEnabled && (pageStack.depth > 1)
208215
=== modified file 'src/plugin/file-qml-plugin/CMakeLists.txt'
--- src/plugin/file-qml-plugin/CMakeLists.txt 2015-10-21 13:16:12 +0000
+++ src/plugin/file-qml-plugin/CMakeLists.txt 2016-01-14 17:54:32 +0000
@@ -1,23 +1,48 @@
1# This includes a temporary snapshot of the WIP QInputInfo API as we
2# require this in docviewer now but upstream isn't finished yet.
3# Eventually this should be dropped in favor of the upstream
4# QInputInfo API.
5
1set(PLUGIN_DIR DocumentViewer)6set(PLUGIN_DIR DocumentViewer)
2include_directories(${CMAKE_CURRENT_SOURCE_DIR})
37
4find_package(Qt5Core)8find_package(Qt5Core)
5find_package(Qt5Qml)9find_package(Qt5Qml)
6find_package(Qt5Quick)10find_package(Qt5Quick)
711
12pkg_check_modules(LIBUDEV REQUIRED libudev)
13pkg_check_modules(LIBEVDEV REQUIRED libevdev)
14
15include_directories(
16 ${CMAKE_CURRENT_SOURCE_DIR}
17 ${LIBUDEV_INCLUDE_DIRS}
18 ${LIBEVDEV_INCLUDE_DIRS}
19 InputInfo/
20)
21
22# QInputInfo sources
23set(inputinfo_SRCS
24 InputInfo/qinputinfo.cpp
25 InputInfo/qinputinfo.h
26 InputInfo/linux/qinputdeviceinfo_linux.cpp
27 InputInfo/linux/qinputdeviceinfo_linux_p.h
28)
29
8#add the sources to compile30#add the sources to compile
9set(fileqmlplugin_SRCS31set(fileqmlplugin_SRCS
10 backend.cpp32 backend.cpp
11 documentmodel.cpp33 documentmodel.cpp
12 fswatcher.cpp34 fswatcher.cpp
13 docviewerfile.cpp35 docviewerfile.cpp
14 docviewerutils.cpp36 fileutils.cpp
37 ubuntuconvergenceutils.cpp
15)38)
1639
17add_library(fileqmlplugin MODULE40add_library(fileqmlplugin MODULE
41 ${inputinfo_SRCS}
18 ${fileqmlplugin_SRCS}42 ${fileqmlplugin_SRCS}
19)43)
2044
45target_link_libraries(fileqmlplugin ${LIBUDEV_LDFLAGS} ${LIBEVDEV_LDFLAGS} )
21qt5_use_modules(fileqmlplugin Qml Quick)46qt5_use_modules(fileqmlplugin Qml Quick)
2247
23# Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator48# Copy the plugin, the qmldir file and other assets to the build dir for running in QtCreator
2449
=== added directory 'src/plugin/file-qml-plugin/InputInfo'
=== added file 'src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt'
--- src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/CMakeLists.txt 2016-01-14 17:54:32 +0000
@@ -0,0 +1,39 @@
1# This is a temporary snapshot of the WIP QInputInfo API as we
2# require this in unity now but upstream isn't finished yet.
3# Eventually this should be dropped in favor of the upstream
4# QInputInfo API.
5
6project(InputInfo)
7
8find_package(Qt5Core REQUIRED)
9find_package(Qt5Quick REQUIRED)
10
11pkg_check_modules(LIBUDEV REQUIRED libudev)
12pkg_check_modules(LIBEVDEV REQUIRED libevdev)
13
14include_directories(
15 ${CMAKE_CURRENT_SOURCE_DIR}
16 ${CMAKE_CURRENT_BINARY_DIR}
17 ${LIBUDEV_INCLUDE_DIRS}
18 ${LIBEVDEV_INCLUDE_DIRS}
19)
20
21set(InputInfo_SOURCES
22 plugin.cpp
23 qinputinfo.cpp
24 qdeclarativeinputdevicemodel.cpp
25 linux/qinputdeviceinfo_linux.cpp
26)
27
28add_library(InputInfo SHARED
29 ${InputInfo_SOURCES}
30)
31
32target_link_libraries(InputInfo
33 ${LIBUDEV_LDFLAGS}
34 ${LIBEVDEV_LDFLAGS}
35)
36
37qt5_use_modules(InputInfo Core Qml Quick)
38
39add_unity8_plugin(Unity.InputInfo 0.1 Unity/InputInfo TARGETS InputInfo)
040
=== added directory 'src/plugin/file-qml-plugin/InputInfo/linux'
=== added file 'src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp'
--- src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux.cpp 2016-01-14 17:54:32 +0000
@@ -0,0 +1,288 @@
1/****************************************************************************
2**
3** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtSystems module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "qinputdeviceinfo_linux_p.h"
43
44#include <libudev.h>
45#include <libevdev/libevdev.h>
46#include <fcntl.h>
47#include <QDebug>
48#include <QSocketNotifier>
49#include <QTimer>
50#include <QDir>
51
52QInputDeviceManagerPrivate::QInputDeviceManagerPrivate(QObject *parent) :
53 QObject(parent),
54 currentFilter(QInputDevice::Unknown),
55 udevice(0)
56{
57 QTimer::singleShot(250,this,SLOT(init()));
58}
59
60QInputDeviceManagerPrivate::~QInputDeviceManagerPrivate()
61{
62 udev_unref(udevice);
63 udev_monitor_unref(udevMonitor);
64}
65
66void QInputDeviceManagerPrivate::init()
67{
68 if (!udevice)
69 udevice = udev_new();
70
71 udev_list_entry *devices;
72 udev_list_entry *dev_list_entry;
73 udev_device *dev;
74
75 QString subsystem = QStringLiteral("input");
76 struct udev_enumerate *enumerate = 0;
77
78 if (udevice) {
79
80 udevMonitor = udev_monitor_new_from_netlink(udevice, "udev");
81 udev_monitor_filter_add_match_subsystem_devtype(udevMonitor, subsystem.toLatin1(), NULL);
82 enumerate = udev_enumerate_new(udevice);
83 udev_enumerate_add_match_subsystem(enumerate, subsystem.toLatin1());
84
85 udev_monitor_enable_receiving(udevMonitor);
86 notifierFd = udev_monitor_get_fd(udevMonitor);
87
88 notifier = new QSocketNotifier(notifierFd, QSocketNotifier::Read, this);
89 connect(notifier, SIGNAL(activated(int)), this, SLOT(onUDevChanges()));
90
91 udev_enumerate_scan_devices(enumerate);
92 devices = udev_enumerate_get_list_entry(enumerate);
93
94 udev_list_entry_foreach(dev_list_entry, devices) {
95 const char *path;
96 path = udev_list_entry_get_name(dev_list_entry);
97
98 dev = udev_device_new_from_syspath(udevice, path);
99 if (qstrcmp(udev_device_get_subsystem(dev), "input") == 0 ) {
100 QInputDevice *iDevice = addDevice(dev);
101 if (iDevice && !iDevice->devicePath().isEmpty()) {
102 deviceMap.insert(iDevice->devicePath(),iDevice);
103 }
104 }
105 udev_device_unref(dev);
106 }
107 udev_enumerate_unref(enumerate);
108 }
109 // udev_unref(udevice);
110 Q_FOREACH (const QString &devicePath, deviceMap.keys()) {
111 Q_EMIT deviceAdded(devicePath);
112 }
113 Q_EMIT ready();
114}
115
116QInputDevice::InputTypeFlags QInputDeviceManagerPrivate::getInputTypeFlags(struct udev_device *dev)
117{
118 QInputDevice::InputTypeFlags flags = QInputDevice::Unknown;
119 if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEY"), "1") == 0 ) {
120 flags |= QInputDevice::Button;
121 }
122 if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_MOUSE"), "1") == 0) {
123 flags |= QInputDevice::Mouse;
124 }
125 if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TOUCHPAD"), "1") == 0) {
126 flags |= QInputDevice::TouchPad;
127 }
128 if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TOUCHSCREEN"), "1") == 0
129 || qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_TABLET"), "1") == 0) {
130 flags |= QInputDevice::TouchScreen;
131 }
132 if (qstrcmp(udev_device_get_property_value(dev, "ID_INPUT_KEYBOARD"), "1") == 0 ) {
133 flags |= QInputDevice::Keyboard;
134 }
135 if (!QString::fromLatin1(udev_device_get_property_value(dev, "SW")).isEmpty()) {
136 flags |= QInputDevice::Switch;
137 }
138
139 return flags;
140}
141
142QInputDevice *QInputDeviceManagerPrivate::addDevice(struct udev_device *udev)
143{
144 QString eventPath = QString::fromLatin1(udev_device_get_sysname(udev));
145
146 if (eventPath.contains(QStringLiteral("event")))
147 eventPath.prepend(QStringLiteral("/dev/input/"));
148
149 if (deviceMap.contains(eventPath)) {
150 return Q_NULLPTR;
151 }
152 struct libevdev *dev = NULL;
153 int fd;
154 int rc = 1;
155 QInputDevice *inputDevice;
156 inputDevice = addUdevDevice(udev);
157 if (!inputDevice) {
158 return Q_NULLPTR;
159 }
160 eventPath = inputDevice->devicePath();
161
162 fd = open(eventPath.toLatin1(), O_RDONLY|O_NONBLOCK);
163 if (fd == -1) {
164 return inputDevice;
165 }
166 rc = libevdev_new_from_fd(fd, &dev);
167 if (rc < 0) {
168 qWarning() << "Failed to init libevdev ("<< strerror(-rc) << ")";
169 return Q_NULLPTR;
170 }
171
172 for (int i = 0; i < EV_MAX; i++) {
173 if (i == EV_KEY || i == EV_SW || i == EV_REL
174 || i == EV_REL || i == EV_ABS) {
175 for (int j = 0; j < libevdev_event_type_get_max(i); j++) {
176 if (libevdev_has_event_code(dev, i, j)) {
177 switch (i) {
178 case EV_KEY:
179 inputDevice->addButton(j);
180 break;
181 case EV_SW:
182 inputDevice->addSwitch(j);
183 break;
184 case EV_REL:
185 inputDevice->addRelativeAxis(j);
186 break;
187 case EV_ABS:
188 inputDevice->addAbsoluteAxis(j);
189 break;
190 };
191 }
192 }
193 }
194 }
195
196 return inputDevice;
197}
198
199void QInputDeviceManagerPrivate::addDetails(struct udev_device *)
200{
201}
202
203void QInputDeviceManagerPrivate::removeDevice(const QString &path)
204{
205 // this path is not a full evdev path
206 Q_FOREACH (const QString devicePath, deviceMap.keys()) {
207 if (devicePath.contains(path)) {
208 deviceMap.remove(devicePath);
209 Q_EMIT deviceRemoved(devicePath);
210 }
211 }
212}
213
214QInputDevice *QInputDeviceManagerPrivate::addUdevDevice(struct udev_device *udev)
215{
216 QInputDevice *iDevice;
217
218 struct udev_list_entry *list;
219 struct udev_list_entry *node;
220
221 list = udev_device_get_properties_list_entry (udev);
222 QString syspath = QString::fromLatin1(udev_device_get_syspath(udev));
223 QDir sysdir(syspath);
224
225 QStringList infoList = sysdir.entryList(QStringList() << QStringLiteral("event*"),QDir::Dirs);
226
227 if (infoList.count() > 0) {
228 QString token = infoList.at(0);
229
230 token.prepend(QStringLiteral("/dev/input/"));
231 iDevice = new QInputDevice(this);
232 iDevice->setDevicePath(token);
233 } else {
234 return Q_NULLPTR;
235 }
236 udev_list_entry_foreach (node, list) {
237
238 QString key = QString::fromLatin1(udev_list_entry_get_name(node));
239 QString value = QString::fromLatin1(udev_list_entry_get_value(node));
240
241 if (key == QStringLiteral("NAME")) {
242 iDevice->setName(value.remove(QStringLiteral("\"")));
243 }
244 }
245 iDevice->setType(getInputTypeFlags(udev));
246 return iDevice;
247}
248
249void QInputDeviceManagerPrivate::onUDevChanges()
250{
251 if (!udevMonitor)
252 return;
253
254 udev_device *dev = udev_monitor_receive_device(udevMonitor);
255
256 if (dev) {
257 if (qstrcmp(udev_device_get_subsystem(dev), "input") == 0 ) {
258 QString eventPath = QString::fromLatin1(udev_device_get_sysname(dev));
259
260 QString action = QString::fromStdString(udev_device_get_action(dev));
261
262 if (!eventPath.contains(QStringLiteral("/dev/input/")))
263 eventPath.prepend(QStringLiteral("/dev/input/"));
264
265 if (action == QStringLiteral("add")) {
266 if (deviceMap.contains(eventPath)){
267 udev_device_unref(dev);
268 return;
269 }
270
271 QInputDevice *iDevice = addDevice(dev);
272 if (!iDevice) {
273 delete iDevice;
274 return;
275 }
276 iDevice->setType(getInputTypeFlags(dev));
277 udev_device_unref(dev);
278
279 deviceMap.insert(eventPath,iDevice);
280
281 Q_EMIT deviceAdded(eventPath);
282
283 } else if (action == QStringLiteral("remove")) {
284 removeDevice(eventPath);
285 }
286 }
287 }
288}
0289
=== added file 'src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h'
--- src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/linux/qinputdeviceinfo_linux_p.h 2016-01-14 17:54:32 +0000
@@ -0,0 +1,98 @@
1/****************************************************************************
2**
3** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtSystems module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QINPUTDEVICEINFO_LINUX_P_H
43#define QINPUTDEVICEINFO_LINUX_P_H
44
45#include <QObject>
46#include "qinputinfo.h"
47#include <libudev.h>
48
49class QInputDevicePrivate : public QObject
50{
51 Q_OBJECT
52public:
53 explicit QInputDevicePrivate(QObject *parent = 0);
54
55 QString name;
56 QString devicePath;
57 QList <int> buttons; //keys
58 QList <int> switches;
59 QList <int> relativeAxis;
60 QList <int> absoluteAxis;
61 QInputDevice::InputTypeFlags type;
62};
63
64class QInputDeviceManagerPrivate : public QObject
65{
66 Q_OBJECT
67public:
68 explicit QInputDeviceManagerPrivate(QObject *parent = 0);
69 ~QInputDeviceManagerPrivate();
70 QVector <QInputDevice *> deviceList;
71 QMap <QString, QInputDevice *> deviceMap;
72 static QInputDeviceManagerPrivate * instance();
73 QInputDevice::InputType currentFilter;
74
75Q_SIGNALS:
76 void deviceAdded(const QString &);
77 void deviceRemoved(const QString &);
78 void ready();
79
80private:
81 QInputDevice *addDevice(struct udev_device *udev);
82 QInputDevice *addUdevDevice(struct udev_device *);
83
84 QInputDevice *addDevice(const QString &path);
85 void removeDevice(const QString &path);
86 QSocketNotifier *notifier;
87 int notifierFd;
88 struct udev_monitor *udevMonitor;
89 QInputDevice::InputTypeFlags getInputTypeFlags(struct udev_device *);
90 struct udev *udevice;
91 void addDetails(struct udev_device *);
92
93private Q_SLOTS:
94 void onUDevChanges();
95 void init();
96};
97
98#endif // QINPUTDEVICEINFO_LINUX_P_H
099
=== added file 'src/plugin/file-qml-plugin/InputInfo/plugin.cpp'
--- src/plugin/file-qml-plugin/InputInfo/plugin.cpp 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/plugin.cpp 2016-01-14 17:54:32 +0000
@@ -0,0 +1,32 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17// Qt
18#include <QtQml/qqml.h>
19
20// self
21#include "plugin.h"
22
23// local
24#include "qdeclarativeinputdevicemodel_p.h"
25
26void InputInfoPlugin::registerTypes(const char *uri)
27{
28 int major = 0;
29 int minor = 1;
30 qmlRegisterType<QDeclarativeInputDeviceModel>(uri, major, minor, "InputDeviceModel");
31 qmlRegisterType<QInputDevice>(uri, major, minor, "InputInfo");
32}
033
=== added file 'src/plugin/file-qml-plugin/InputInfo/plugin.h'
--- src/plugin/file-qml-plugin/InputInfo/plugin.h 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/plugin.h 2016-01-14 17:54:32 +0000
@@ -0,0 +1,30 @@
1/*
2 * Copyright 2015 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef INPUTINFO_PLUGIN_H
18#define INPUTINFO_PLUGIN_H
19
20#include <QtQml/QQmlExtensionPlugin>
21
22class InputInfoPlugin : public QQmlExtensionPlugin
23{
24 Q_OBJECT
25 Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QQmlExtensionInterface")
26public:
27 void registerTypes(const char *uri);
28};
29
30#endif // INPUTINFO_PLUGIN_H
031
=== added file 'src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp'
--- src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel.cpp 2016-01-14 17:54:32 +0000
@@ -0,0 +1,196 @@
1/****************************************************************************
2**
3** Copyright (C) 2015 Jolla.
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtSystems module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41#include "qdeclarativeinputdevicemodel_p.h"
42#include "qinputinfo.h"
43
44QDeclarativeInputDeviceModel::QDeclarativeInputDeviceModel(QObject *parent) :
45 QAbstractListModel(parent),
46 deviceInfo(new QInputDeviceManager),
47 currentFilter(QInputDevice::Unknown)
48{
49 connect(deviceInfo,SIGNAL(ready()),this,SLOT(updateDeviceList()));
50 connect(deviceInfo, &QInputDeviceManager::deviceAdded,this,&QDeclarativeInputDeviceModel::addedDevice);
51 connect(deviceInfo, &QInputDeviceManager::deviceRemoved,this,&QDeclarativeInputDeviceModel::removedDevice);
52}
53
54QDeclarativeInputDeviceModel::~QDeclarativeInputDeviceModel()
55{
56 delete deviceInfo;
57}
58
59QVariant QDeclarativeInputDeviceModel::data(const QModelIndex &index, int role) const
60{
61 switch (role) {
62 case ServiceRole:
63 return QVariant::fromValue(static_cast<QObject *>(inputDevices.value(index.row())));
64 break;
65 case NameRole:
66 return QVariant::fromValue(static_cast<QString>(inputDevices.value(index.row())->name()));
67 break;
68 case DevicePathRole:
69 return QVariant::fromValue(static_cast<QString>(inputDevices.value(index.row())->devicePath()));
70 break;
71 case ButtonsRole:
72 return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->buttons()));
73 break;
74 case SwitchesRole:
75 return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->switches()));
76 break;
77 case RelativeAxisRole:
78 return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->relativeAxis()));
79 break;
80 case AbsoluteAxisRole:
81 return QVariant::fromValue(static_cast<QList <int> >(inputDevices.value(index.row())->absoluteAxis()));
82 break;
83 case TypesRole:
84 return QVariant::fromValue(static_cast<int>(inputDevices.value(index.row())->type()));
85 break;
86 };
87
88 return QVariant();
89}
90
91int QDeclarativeInputDeviceModel::rowCount(const QModelIndex &parent) const
92{
93 Q_UNUSED(parent);
94
95 return inputDevices.count();
96}
97
98int QDeclarativeInputDeviceModel::indexOf(const QString &devicePath) const
99{
100 int idx(-1);
101 Q_FOREACH (QInputDevice *device, inputDevices) {
102 idx++;
103 if (device->devicePath() == devicePath) return idx;
104 }
105
106 return -1;
107}
108
109QInputDevice *QDeclarativeInputDeviceModel::get(int index) const
110{
111 if (index < 0 || index > inputDevices.count())
112 return 0;
113 return inputDevices.value(index);
114}
115
116void QDeclarativeInputDeviceModel::updateDeviceList()
117{
118 QVector <QInputDevice *> newDevices = deviceInfo->deviceListOfType(currentFilter);
119
120 int numNew = newDevices.count();
121
122 for (int i = 0; i < numNew; i++) {
123 int j = inputDevices.indexOf(newDevices.value(i));
124
125 if (j == -1) {
126 beginInsertRows(QModelIndex(), i, i);
127 inputDevices.insert(i, newDevices.value(i));
128 endInsertRows();
129 Q_EMIT countChanged();
130 } else if (i != j) {
131 // changed its position -> move it
132 QInputDevice* device = inputDevices.value(j);
133 beginMoveRows(QModelIndex(), j, j, QModelIndex(), i);
134 inputDevices.remove(j);
135 inputDevices.insert(i, device);
136 endMoveRows();
137 Q_EMIT countChanged();
138 } //else {
139 QModelIndex changedIndex(this->index(j, 0, QModelIndex()));
140 Q_EMIT dataChanged(changedIndex, changedIndex);
141 }
142
143 int numOld = inputDevices.count();
144 if (numOld > numNew) {
145 beginRemoveRows(QModelIndex(), numNew, numOld - 1);
146 inputDevices.remove(numNew, numOld - numNew);
147 endRemoveRows();
148 Q_EMIT countChanged();
149 }
150}
151
152void QDeclarativeInputDeviceModel::addedDevice(const QString &devicePath)
153{
154 updateDeviceList();
155 Q_EMIT deviceAdded(devicePath);
156}
157
158void QDeclarativeInputDeviceModel::removedDevice(const QString &devicePath)
159{
160 updateDeviceList();
161 Q_EMIT deviceRemoved(devicePath);
162}
163
164QHash<int,QByteArray> QDeclarativeInputDeviceModel::roleNames() const
165{
166 QHash<int, QByteArray> roles;
167 roles[NameRole] = "name";
168 roles[DevicePathRole] = "devicePath";
169 roles[ButtonsRole] = "buttons";
170 roles[SwitchesRole] = "switches";
171 roles[RelativeAxisRole] = "rAxis";
172 roles[AbsoluteAxisRole] = "aAxis";
173 roles[TypesRole] = "types";
174 return roles;
175}
176
177/*
178 * Returns the currently set device filter.
179 * */
180QInputDevice::InputType QDeclarativeInputDeviceModel::deviceFilter()
181{
182 return currentFilter;
183}
184
185/*
186 * Sets the current input device filter to filter.
187 * */
188void QDeclarativeInputDeviceModel::setDeviceFilter(QInputDevice::InputType filter)
189{
190 if (filter != currentFilter) {
191 deviceInfo->setDeviceFilter(filter);
192 currentFilter = filter;
193 updateDeviceList();
194 Q_EMIT deviceFilterChanged(filter);
195 }
196}
0197
=== added file 'src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h'
--- src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/qdeclarativeinputdevicemodel_p.h 2016-01-14 17:54:32 +0000
@@ -0,0 +1,102 @@
1/****************************************************************************
2**
3** Copyright (C) 2015 Jolla.
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtSystems module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QDECLARATIVEINPUTDEVICEMODEL_H
43#define QDECLARATIVEINPUTDEVICEMODEL_H
44
45#include <QObject>
46#include <QAbstractListModel>
47#include "qinputinfo.h"
48
49class QDeclarativeInputDeviceModel : public QAbstractListModel
50{
51 Q_OBJECT
52 Q_DISABLE_COPY(QDeclarativeInputDeviceModel)
53 Q_PROPERTY(QInputDevice::InputType deviceFilter READ deviceFilter WRITE setDeviceFilter NOTIFY deviceFilterChanged)
54
55 Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
56
57public:
58 enum ItemRoles {
59 ServiceRole = Qt::UserRole + 1,
60 NameRole,
61 DevicePathRole,
62 ButtonsRole,
63 SwitchesRole,
64 RelativeAxisRole,
65 AbsoluteAxisRole,
66 TypesRole
67 };
68
69 explicit QDeclarativeInputDeviceModel(QObject *parent = 0);
70 virtual ~QDeclarativeInputDeviceModel();
71
72 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
73 int rowCount(const QModelIndex &parent = QModelIndex()) const;
74
75 void setDeviceFilter(QInputDevice::InputType filter);
76 QInputDevice::InputType deviceFilter();
77
78 Q_INVOKABLE int indexOf(const QString &devicePath) const;
79
80 Q_INVOKABLE QInputDevice *get(int index) const;
81 QHash<int, QByteArray> roleNames() const;
82
83Q_SIGNALS:
84 void deviceAdded(const QString &devicePath);
85 void deviceRemoved(const QString &devicePath);
86 void deviceFilterChanged(const QInputDevice::InputType filter);
87 void countChanged();
88
89public Q_SLOTS:
90 void updateDeviceList();
91private:
92 QInputDeviceManager *deviceInfo;
93 QVector<QInputDevice *> inputDevices;
94 QInputDevice::InputType currentFilter;
95
96private Q_SLOTS:
97 void addedDevice(const QString &);
98 void removedDevice(const QString &path);
99
100};
101
102#endif // QDECLARATIVEINPUTDEVICEMODEL_H
0103
=== added file 'src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp'
--- src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/qinputinfo.cpp 2016-01-14 17:54:32 +0000
@@ -0,0 +1,270 @@
1/****************************************************************************
2**
3** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtSystems module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#include "qinputinfo.h"
43
44#if defined(UNITY_MOCKS)
45#include "qinputdeviceinfo_mock_p.h"
46#elif defined(Q_OS_LINUX)
47#include "linux/qinputdeviceinfo_linux_p.h"
48#endif
49
50Q_GLOBAL_STATIC(QInputDeviceManagerPrivate, inputDeviceManagerPrivate)
51
52QT_BEGIN_NAMESPACE
53
54QInputDeviceManagerPrivate * QInputDeviceManagerPrivate::instance()
55{
56 QInputDeviceManagerPrivate *priv = inputDeviceManagerPrivate();
57 return priv;
58}
59
60QInputDevicePrivate::QInputDevicePrivate(QObject *parent) :
61 QObject(parent),
62 type(QInputDevice::Unknown)
63{
64}
65
66QInputDevice::QInputDevice(QObject *parent) :
67 QObject(parent),
68 d_ptr(new QInputDevicePrivate(this))
69{
70}
71
72/*
73 * Returns the name of this input device.
74 */
75QString QInputDevice::name() const
76{
77 return d_ptr->name;
78}
79
80/*
81 * Sets the name of this input device to \b name.
82 */
83void QInputDevice::setName(const QString &name)
84{
85 d_ptr->name = name;
86}
87
88/*
89 * Returns the device path of this device.
90 */
91QString QInputDevice::devicePath() const
92{
93 return d_ptr->devicePath;
94}
95
96/*
97 * Sets the device ppath of this device to /b path.
98 */
99void QInputDevice::setDevicePath(const QString &path)
100{
101 d_ptr->devicePath = path;
102}
103
104/*
105 * Returns the number of buttons this device has.
106 */
107QList <int> QInputDevice::buttons() const
108{
109 return d_ptr->buttons;
110}
111
112/*
113 * Adds a button
114 */
115void QInputDevice::addButton(int buttonCode)
116{
117 d_ptr->buttons.append(buttonCode);
118}
119
120/*
121 * Returns the number of switch of this device.
122 */
123QList <int> QInputDevice::switches() const
124{
125 return d_ptr->switches;
126}
127
128/*
129 * Adds a switch
130 */
131void QInputDevice::addSwitch(int switchCode)
132{
133 d_ptr->switches.append(switchCode);
134}
135
136/*
137 * Returns a list of the relative axis of this device
138 */
139QList <int> QInputDevice::relativeAxis() const
140{
141 return d_ptr->relativeAxis;
142}
143
144/*
145 */
146void QInputDevice::addRelativeAxis(int axisCode)
147{
148 d_ptr->relativeAxis.append(axisCode);
149}
150
151/*
152 * Returns a list of the absolute axis of this device
153 */
154QList <int> QInputDevice::absoluteAxis() const
155{
156 return d_ptr->absoluteAxis;
157}
158
159/*
160 */
161void QInputDevice::addAbsoluteAxis(int axisCode)
162{
163 d_ptr->absoluteAxis.append(axisCode);
164}
165
166/*
167 * Returns a QInputDevice::InputTypeFlags of all the types of types.
168 */
169QInputDevice::InputTypeFlags QInputDevice::type() const
170{
171 return d_ptr->type;
172}
173
174/*
175 */
176void QInputDevice::setType(QInputDevice::InputTypeFlags type) //? setTypes?
177{
178 d_ptr->type = type;
179}
180
181QInputDeviceManager::QInputDeviceManager(QObject *parent) :
182 QObject(parent),
183 d_ptr(inputDeviceManagerPrivate)
184{
185 connect(d_ptr, &QInputDeviceManagerPrivate::deviceAdded,this,&QInputDeviceManager::addedDevice);
186 connect(d_ptr, &QInputDeviceManagerPrivate::deviceRemoved,this,&QInputDeviceManager::deviceRemoved);
187
188 connect(d_ptr,SIGNAL(ready()),this,SIGNAL(ready()));
189}
190
191/*
192 * Returns a QMap of known input devices.
193 */
194QMap <QString, QInputDevice *> QInputDeviceManager::deviceMap()
195{
196 return d_ptr->deviceMap;
197}
198
199/*
200 */
201void QInputDeviceManager::addedDevice(const QString & devicePath)
202{
203 Q_EMIT deviceAdded(devicePath);
204}
205
206/*
207 * Returns a QVector of InputDevices of type filter
208 * */
209QVector <QInputDevice *> QInputDeviceManager::deviceListOfType(QInputDevice::InputType filter)
210{
211 QVector <QInputDevice *> dList;
212 QMapIterator<QString, QInputDevice *> i(d_ptr->deviceMap);
213 while (i.hasNext()) {
214 i.next();
215 if (i.value()->type().testFlag(filter) || filter == QInputDevice::Unknown) {
216 dList.append(i.value());
217 }
218 }
219 return dList;
220}
221
222/*
223 * Returns the number of input devices with the currently set QInputDevice::InputType filter.
224 * If no device filter has been set, returns number of all available input devices.
225 * If filter has not been set, returns all available input devices
226 */
227int QInputDeviceManager::deviceCount() const
228{
229 return deviceCount(static_cast< QInputDevice::InputType >(d_ptr->currentFilter));
230}
231
232/*
233 * Returns the number of input devices of the type filter.
234 */
235int QInputDeviceManager::deviceCount(const QInputDevice::InputType filter) const
236{
237 int dList = 0;
238 QMapIterator<QString, QInputDevice *> i(d_ptr->deviceMap);
239 while (i.hasNext()) {
240 i.next();
241// qDebug() << i.value()->name() << i.value()->devicePath();
242// qDebug() << i.value()->type() << i.value()->type().testFlag(filter);
243
244 if (i.value()->type().testFlag(filter)) {
245 dList++;
246 }
247 }
248 return dList;
249}
250
251/*
252 * Returns the currently set device filter.
253 * */
254QInputDevice::InputType QInputDeviceManager::deviceFilter()
255{
256 return d_ptr->currentFilter;
257}
258
259/*
260 * Sets the current input device filter to filter.
261 * */
262void QInputDeviceManager::setDeviceFilter(QInputDevice::InputType filter)
263{
264 if (filter != d_ptr->currentFilter) {
265 d_ptr->currentFilter = filter;
266 Q_EMIT deviceFilterChanged(filter);
267 }
268}
269
270QT_END_NAMESPACE
0271
=== added file 'src/plugin/file-qml-plugin/InputInfo/qinputinfo.h'
--- src/plugin/file-qml-plugin/InputInfo/qinputinfo.h 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/qinputinfo.h 2016-01-14 17:54:32 +0000
@@ -0,0 +1,143 @@
1/****************************************************************************
2**
3** Copyright (C) 2014 Canonical, Ltd. and/or its subsidiary(-ies).
4** Contact: http://www.qt-project.org/legal
5**
6** This file is part of the QtSystems module of the Qt Toolkit.
7**
8** $QT_BEGIN_LICENSE:LGPL$
9** Commercial License Usage
10** Licensees holding valid commercial Qt licenses may use this file in
11** accordance with the commercial license agreement provided with the
12** Software or, alternatively, in accordance with the terms contained in
13** a written agreement between you and Digia. For licensing terms and
14** conditions see http://qt.digia.com/licensing. For further information
15** use the contact form at http://qt.digia.com/contact-us.
16**
17** GNU Lesser General Public License Usage
18** Alternatively, this file may be used under the terms of the GNU Lesser
19** General Public License version 2.1 as published by the Free Software
20** Foundation and appearing in the file LICENSE.LGPL included in the
21** packaging of this file. Please review the following information to
22** ensure the GNU Lesser General Public License version 2.1 requirements
23** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
24**
25** In addition, as a special exception, Digia gives you certain additional
26** rights. These rights are described in the Digia Qt LGPL Exception
27** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
28**
29** GNU General Public License Usage
30** Alternatively, this file may be used under the terms of the GNU
31** General Public License version 3.0 as published by the Free Software
32** Foundation and appearing in the file LICENSE.GPL included in the
33** packaging of this file. Please review the following information to
34** ensure the GNU General Public License version 3.0 requirements will be
35** met: http://www.gnu.org/copyleft/gpl.html.
36**
37**
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42#ifndef QINPUTINFO_H
43#define QINPUTINFO_H
44
45#include <QObject>
46#include <QVector>
47#include <QMap>
48#include <QSocketNotifier>
49#include <QDebug>
50
51class QInputDeviceManagerPrivate;
52class QInputDevicePrivate;
53class QInputDevice;
54
55class QInputDeviceManager;
56
57class QInputDevice : public QObject
58{
59 Q_OBJECT
60 Q_ENUMS(InputType)
61 Q_FLAGS(InputType InputTypeFlags)
62 friend class QInputDeviceManagerPrivate;
63
64public:
65
66 enum InputType {
67 Unknown = 0,
68 Button = 1,
69 Mouse = 2,
70 TouchPad = 4,
71 TouchScreen = 8,
72 Keyboard = 16,
73 Switch = 32
74 };
75 Q_ENUMS(InputType)
76 Q_DECLARE_FLAGS(InputTypeFlags, InputType)
77
78 explicit QInputDevice(QObject *parent = 0);
79 QString name() const;
80 QString devicePath() const;
81 QList <int> buttons() const; //keys event code
82 QList <int> switches() const;
83 QList <int> relativeAxis() const;
84 QList <int> absoluteAxis() const;
85 QInputDevice::InputTypeFlags type() const;
86
87private:
88
89 QInputDevicePrivate *d_ptr;
90 void setName(const QString &);
91 void setDevicePath(const QString &);
92 void addButton(int);
93 void addSwitch(int);
94 void addRelativeAxis(int);
95 void addAbsoluteAxis(int);
96 void setType(QInputDevice::InputTypeFlags flags);
97
98};
99
100Q_DECLARE_METATYPE(QInputDevice::InputType)
101Q_DECLARE_METATYPE(QInputDevice::InputTypeFlags)
102
103class QInputDeviceManagerPrivate;
104
105class QInputDeviceManager : public QObject
106{
107 Q_OBJECT
108 Q_PROPERTY(int deviceCount READ deviceCount NOTIFY deviceCountChanged)
109 Q_PROPERTY(QInputDevice::InputType deviceFilter READ deviceFilter WRITE setDeviceFilter NOTIFY deviceFilterChanged)
110public:
111
112 explicit QInputDeviceManager(QObject *parent = 0);
113
114 int deviceCount() const;
115 int deviceCount(const QInputDevice::InputType filter) const;
116
117 void setDeviceFilter(QInputDevice::InputType filter);
118 QInputDevice::InputType deviceFilter();
119
120 QMap <QString, QInputDevice *> deviceMap();
121 Q_INVOKABLE QVector <QInputDevice *> deviceListOfType(QInputDevice::InputType filter);
122
123Q_SIGNALS:
124
125 void deviceAdded(const QString & devicePath);
126 void deviceRemoved(const QString & devicePath);
127
128 void ready();
129 void deviceCountChanged(int count);
130 void deviceFilterChanged(const QInputDevice::InputType filter);
131
132public Q_SLOTS:
133 void addedDevice(const QString & devicePath);
134
135private:
136 Q_DISABLE_COPY(QInputDeviceManager)
137#if !defined(QT_SIMULATOR)
138 QInputDeviceManagerPrivate *const d_ptr;
139 Q_DECLARE_PRIVATE(QInputDeviceManager)
140#endif
141};
142
143#endif // QINPUTINFO_H
0144
=== added file 'src/plugin/file-qml-plugin/InputInfo/qmldir'
--- src/plugin/file-qml-plugin/InputInfo/qmldir 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/InputInfo/qmldir 2016-01-14 17:54:32 +0000
@@ -0,0 +1,3 @@
1module Unity.InputInfo
2plugin InputInfo
3typeinfo InputInfo.qmltypes
04
=== modified file 'src/plugin/file-qml-plugin/backend.cpp'
--- src/plugin/file-qml-plugin/backend.cpp 2015-09-19 15:40:22 +0000
+++ src/plugin/file-qml-plugin/backend.cpp 2016-01-14 17:54:32 +0000
@@ -21,15 +21,25 @@
21#include "backend.h"21#include "backend.h"
22#include "documentmodel.h"22#include "documentmodel.h"
23#include "docviewerfile.h"23#include "docviewerfile.h"
24#include "docviewerutils.h"24#include "fileutils.h"
2525#include "ubuntuconvergenceutils.h"
26static QObject *registerDocviewerUtils (QQmlEngine *engine, QJSEngine *scriptEngine)26
27{27static QObject *registerFileUtils (QQmlEngine *engine, QJSEngine *scriptEngine)
28 Q_UNUSED(engine)28{
29 Q_UNUSED(scriptEngine)29 Q_UNUSED(engine)
3030 Q_UNUSED(scriptEngine)
31 DocviewerUtils *ch = new DocviewerUtils();31
32 return ch;32 DocviewerFileUtils *f = new DocviewerFileUtils();
33 return f;
34}
35
36static QObject *registerConvergenceUtils (QQmlEngine *engine, QJSEngine *scriptEngine)
37{
38 Q_UNUSED(engine)
39 Q_UNUSED(scriptEngine)
40
41 UbuntuConvergenceUtils *c = new UbuntuConvergenceUtils();
42 return c;
33}43}
3444
35void BackendPlugin::registerTypes(const char *uri)45void BackendPlugin::registerTypes(const char *uri)
@@ -41,7 +51,8 @@
41 qmlRegisterType<DocumentModel>(uri, 1, 0, "DocumentsModel");51 qmlRegisterType<DocumentModel>(uri, 1, 0, "DocumentsModel");
42 qmlRegisterType<DocviewerFile>(uri, 1, 0, "File");52 qmlRegisterType<DocviewerFile>(uri, 1, 0, "File");
4353
44 qmlRegisterSingletonType<DocviewerUtils>(uri, 1, 0, "DocumentViewer", registerDocviewerUtils);54 qmlRegisterSingletonType<DocviewerFileUtils>(uri, 1, 0, "FileUtils", registerFileUtils);
55 qmlRegisterSingletonType<UbuntuConvergenceUtils>(uri, 1, 0, "ConvergenceUtils", registerConvergenceUtils);
45}56}
4657
47void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)58void BackendPlugin::initializeEngine(QQmlEngine *engine, const char *uri)
4859
=== modified file 'src/plugin/file-qml-plugin/documentmodel.cpp'
--- src/plugin/file-qml-plugin/documentmodel.cpp 2015-09-19 15:40:22 +0000
+++ src/plugin/file-qml-plugin/documentmodel.cpp 2016-01-14 17:54:32 +0000
@@ -17,7 +17,7 @@
1717
18#include "documentmodel.h"18#include "documentmodel.h"
19#include "fswatcher.h"19#include "fswatcher.h"
20#include "docviewerutils.h"20#include "fileutils.h"
2121
22#include <QStandardPaths>22#include <QStandardPaths>
23#include <QDir>23#include <QDir>
@@ -115,7 +115,7 @@
115115
116bool DocumentModel::isFileSupported(const QString &path)116bool DocumentModel::isFileSupported(const QString &path)
117{117{
118 return DocviewerUtils::isFileSupported(path);118 return DocviewerFileUtils::isFileSupported(path);
119}119}
120120
121QHash<int, QByteArray> DocumentModel::roleNames() const121QHash<int, QByteArray> DocumentModel::roleNames() const
122122
=== renamed file 'src/plugin/file-qml-plugin/docviewerutils.cpp' => 'src/plugin/file-qml-plugin/fileutils.cpp'
--- src/plugin/file-qml-plugin/docviewerutils.cpp 2015-12-27 12:10:06 +0000
+++ src/plugin/file-qml-plugin/fileutils.cpp 2016-01-14 17:54:32 +0000
@@ -14,7 +14,7 @@
14 along with this program. If not, see http://www.gnu.org/licenses/.14 along with this program. If not, see http://www.gnu.org/licenses/.
15*/15*/
1616
17#include "docviewerutils.h"17#include "fileutils.h"
1818
19#include <QFileInfo>19#include <QFileInfo>
20#include <QDir>20#include <QDir>
@@ -22,18 +22,8 @@
22#include <QStandardPaths>22#include <QStandardPaths>
23#include <QDirIterator>23#include <QDirIterator>
24#include <QDateTime>24#include <QDateTime>
25#include <QtGui/QGuiApplication>25
2626bool DocviewerFileUtils::exists(const QString &path)
27bool DocviewerUtils::desktopMode() const
28{
29 // Assume that platformName (QtUbuntu) with ubuntu
30 // in name means it's running on device
31 // TODO: replace this check with SDK call for formfactor
32 QString platform = QGuiApplication::platformName();
33 return !((platform == "ubuntu") || (platform == "ubuntumirclient"));
34}
35
36bool DocviewerUtils::exists(const QString &path)
37{27{
38 QFileInfo fi(path);28 QFileInfo fi(path);
3929
@@ -44,12 +34,12 @@
44 return QDir(path).exists();34 return QDir(path).exists();
45}35}
4636
47bool DocviewerUtils::copy(const QString &source, const QString &destination)37bool DocviewerFileUtils::copy(const QString &source, const QString &destination)
48{38{
49 return QFile::copy(source, destination);39 return QFile::copy(source, destination);
50}40}
5141
52bool DocviewerUtils::isFileSupported(const QString &path)42bool DocviewerFileUtils::isFileSupported(const QString &path)
53{43{
54 QMimeDatabase mdb;44 QMimeDatabase mdb;
55 const QString mimetype = mdb.mimeTypeForFile(path).name();45 const QString mimetype = mdb.mimeTypeForFile(path).name();
@@ -65,12 +55,12 @@
65 || mimetype == "application/vnd.ms-powerpoint";55 || mimetype == "application/vnd.ms-powerpoint";
66}56}
6757
68QString DocviewerUtils::getXdgDocumentsLocation()58QString DocviewerFileUtils::getXdgDocumentsLocation()
69{59{
70 return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);60 return QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation);
71}61}
7262
73QString DocviewerUtils::buildDestinationPath(const QString &destinationDir, const QString &sourcePath)63QString DocviewerFileUtils::buildDestinationPath(const QString &destinationDir, const QString &sourcePath)
74{64{
75 QFileInfo fi(sourcePath);65 QFileInfo fi(sourcePath);
7666
@@ -135,7 +125,7 @@
135// Return the path of the file, if found in the storageLocation paths,125// Return the path of the file, if found in the storageLocation paths,
136// otherwise return an empty string.126// otherwise return an empty string.
137// Used for prevent importing of a second copy of a file through ContentHub.127// Used for prevent importing of a second copy of a file through ContentHub.
138QString DocviewerUtils::checkIfFileAlreadyImported(const QString &filePath, const QStringList &storageLocationList)128QString DocviewerFileUtils::checkIfFileAlreadyImported(const QString &filePath, const QStringList &storageLocationList)
139{129{
140 QFileInfo fi(filePath);130 QFileInfo fi(filePath);
141 QStringList files;131 QStringList files;
@@ -168,17 +158,17 @@
168 return QString();158 return QString();
169}159}
170160
171QString DocviewerUtils::getFileBaseNameFromPath(const QString &filePath)161QString DocviewerFileUtils::getFileBaseNameFromPath(const QString &filePath)
172{162{
173 return QFileInfo(filePath).completeBaseName();163 return QFileInfo(filePath).completeBaseName();
174}164}
175165
176QString DocviewerUtils::getFileNameFromPath(const QString &filePath)166QString DocviewerFileUtils::getFileNameFromPath(const QString &filePath)
177{167{
178 return QFileInfo(filePath).fileName();168 return QFileInfo(filePath).fileName();
179}169}
180170
181QString DocviewerUtils::getCanonicalPath(const QString &filePath)171QString DocviewerFileUtils::getCanonicalPath(const QString &filePath)
182{172{
183 return QFileInfo(filePath).canonicalPath();173 return QFileInfo(filePath).canonicalPath();
184}174}
185175
=== renamed file 'src/plugin/file-qml-plugin/docviewerutils.h' => 'src/plugin/file-qml-plugin/fileutils.h'
--- src/plugin/file-qml-plugin/docviewerutils.h 2015-12-27 12:10:06 +0000
+++ src/plugin/file-qml-plugin/fileutils.h 2016-01-14 17:54:32 +0000
@@ -14,19 +14,16 @@
14 along with this program. If not, see http://www.gnu.org/licenses/.14 along with this program. If not, see http://www.gnu.org/licenses/.
15*/15*/
1616
17#ifndef DOCVIEWERUTILS_H17#ifndef DOCVIEWER_FILEUTILS_H
18#define DOCVIEWERUTILS_H18#define DOCVIEWER_FILEUTILS_H
1919
20#include <QObject>20#include <QObject>
2121
22class DocviewerUtils : public QObject22class DocviewerFileUtils : public QObject
23{23{
24 Q_OBJECT24 Q_OBJECT
25 Q_PROPERTY(bool desktopMode READ desktopMode CONSTANT)
2625
27public:26public:
28 bool desktopMode() const;
29
30 Q_INVOKABLE static bool exists(const QString &path);27 Q_INVOKABLE static bool exists(const QString &path);
31 Q_INVOKABLE static bool copy(const QString &source, const QString &destination);28 Q_INVOKABLE static bool copy(const QString &source, const QString &destination);
3229
@@ -42,4 +39,4 @@
42 Q_INVOKABLE static QString getCanonicalPath(const QString &filePath);39 Q_INVOKABLE static QString getCanonicalPath(const QString &filePath);
43};40};
4441
45#endif // DOCVIEWERUTILS_H42#endif // DOCVIEWER_FILEUTILS_H
4643
=== added file 'src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp'
--- src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/ubuntuconvergenceutils.cpp 2016-01-14 17:54:32 +0000
@@ -0,0 +1,82 @@
1/*
2 Copyright (C) 2015 Stefano Verzegnassi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License 3 as published by
6 the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see http://www.gnu.org/licenses/.
15*/
16
17#include "ubuntuconvergenceutils.h"
18#include "InputInfo/qinputinfo.h"
19
20#include <QtGui/QGuiApplication>
21
22bool isUnity8Env()
23{
24 // Assume that platformName (QtUbuntu) with ubuntu
25 // in name means it's running on device
26 QString platform = QGuiApplication::platformName();
27 return (platform == "ubuntu") || (platform == "ubuntumirclient");
28}
29
30UbuntuConvergenceUtils::UbuntuConvergenceUtils(QObject *parent) :
31 QObject(parent),
32 m_desktopMode(false),
33 m_mouseAttached(false),
34 m_inputDevicesWatcher(new QInputDeviceManager())
35{
36 // Initialize signals when the watcher is ready.
37 // QInputDeviceManager() emits deviceAdded() signal multiple times during its
38 // initializations.
39 connect(m_inputDevicesWatcher, &QInputDeviceManager::ready,
40 this, &UbuntuConvergenceUtils::init);
41}
42
43void UbuntuConvergenceUtils::init()
44{
45 // Connect signals
46 connect(m_inputDevicesWatcher, SIGNAL(deviceAdded(QString)), this, SLOT(checkPointersCount()));
47 connect(m_inputDevicesWatcher, SIGNAL(deviceRemoved(QString)), this, SLOT(checkPointersCount()));
48
49 checkPointersCount();
50}
51
52void UbuntuConvergenceUtils::checkPointersCount()
53{
54 int mouseCount = m_inputDevicesWatcher->deviceCount(QInputDevice::Mouse);
55 int touchPadCount = m_inputDevicesWatcher->deviceCount(QInputDevice::TouchPad);
56
57 setMouseAttached(mouseCount || touchPadCount);
58 setDesktopMode(isUnity8Env() || m_mouseAttached);
59}
60
61void UbuntuConvergenceUtils::setDesktopMode(bool desktopMode)
62{
63 if (m_desktopMode == desktopMode)
64 return;
65
66 m_desktopMode = desktopMode;
67 Q_EMIT desktopModeChanged();
68}
69
70void UbuntuConvergenceUtils::setMouseAttached(bool mouseAttached)
71{
72 if (m_mouseAttached == mouseAttached)
73 return;
74
75 m_mouseAttached = mouseAttached;
76 Q_EMIT mouseAttachedChanged();
77}
78
79UbuntuConvergenceUtils::~UbuntuConvergenceUtils()
80{
81 delete m_inputDevicesWatcher;
82}
083
=== added file 'src/plugin/file-qml-plugin/ubuntuconvergenceutils.h'
--- src/plugin/file-qml-plugin/ubuntuconvergenceutils.h 1970-01-01 00:00:00 +0000
+++ src/plugin/file-qml-plugin/ubuntuconvergenceutils.h 2016-01-14 17:54:32 +0000
@@ -0,0 +1,56 @@
1/*
2 Copyright (C) 2015 Stefano Verzegnassi
3
4 This program is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License 3 as published by
6 the Free Software Foundation.
7
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12
13 You should have received a copy of the GNU General Public License
14 along with this program. If not, see http://www.gnu.org/licenses/.
15*/
16
17#ifndef DOCVIEWER_CONVERGENCEUTILS_H
18#define DOCVIEWER_CONVERGENCEUTILS_H
19
20#include <QObject>
21
22class QInputDeviceManager;
23
24class UbuntuConvergenceUtils : public QObject
25{
26 Q_OBJECT
27 Q_PROPERTY(bool desktopMode READ desktopMode NOTIFY desktopModeChanged)
28 Q_PROPERTY(bool mouseAttached READ mouseAttached NOTIFY mouseAttachedChanged)
29
30public:
31 UbuntuConvergenceUtils(QObject *parent = 0);
32 ~UbuntuConvergenceUtils();
33
34 bool desktopMode() const { return m_desktopMode; }
35 bool mouseAttached() const { return m_mouseAttached; }
36
37Q_SIGNALS:
38 void desktopModeChanged();
39 void mouseAttachedChanged();
40
41private slots:
42 void checkPointersCount();
43 void init();
44
45private:
46 bool m_desktopMode;
47 bool m_mouseAttached;
48
49private:
50 QInputDeviceManager* m_inputDevicesWatcher;
51
52 void setDesktopMode(bool desktopMode);
53 void setMouseAttached(bool mouseAttached);
54};
55
56#endif // DOCVIEWER_CONVERGENCEUTILS_H

Subscribers

People subscribed via source and target branches