Merge lp:~gang65/ubuntu-docviewer-app/ubuntu-docviewer-desktop-improvements into lp:ubuntu-docviewer-app/trunk
- ubuntu-docviewer-desktop-improvements
- Merge into trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Approved by: | David Planella | ||||
Approved revision: | 27 | ||||
Merged at revision: | 25 | ||||
Proposed branch: | lp:~gang65/ubuntu-docviewer-app/ubuntu-docviewer-desktop-improvements | ||||
Merge into: | lp:ubuntu-docviewer-app/trunk | ||||
Diff against target: |
299 lines (+90/-41) 10 files modified
ImageView.qml (+20/-20) PdfView.qml (+1/-1) TextView.qml (+24/-1) UnknowTypeDialog.qml (+8/-7) debian/copyright (+1/-0) loadComponent.js (+7/-2) tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py (+1/-1) ubuntu-docviewer-app.json (+3/-1) ubuntu-docviewer-app.qml (+14/-8) ubuntu-docviewer-app.qmlproject (+11/-0) |
||||
To merge this branch: | bzr merge lp:~gang65/ubuntu-docviewer-app/ubuntu-docviewer-desktop-improvements | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
David Planella | Approve | ||
Ubuntu Phone Apps Jenkins Bot | continuous-integration | Approve | |
Review via email: mp+210866@code.launchpad.net |
Commit message
Added keyboard support, improve opening text files (now all text files are opening in TextView), add Creation Time row to Details tab, improve horizontal scalability of the Details Tab, fix "unknow" typo and localize all remaining texts.
Description of the change
added keyboard support, improve opening text files (now all text files are opening in TextView), add Creation Time row to Details tab, improve horizontal scalability of the Details Tab, fix "unknow" typo and localize all remaining texts.
- 25. By Bartosz Kosiorek
-
Improve Ubuntu-
docviewer- app for desktop
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
David Planella (dpm) wrote : | # |
Jenkins is failing on:
Autopilot Package Version: 1.4+14.
could not import package ubuntu_
Was the name of the app changed at some point in the tests code?
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:25
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:25
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
David Planella (dpm) wrote : | # |
Now the failure is on:
The following packages have unmet dependencies:
ubuntu-
However, the package seems to be in the PPA. Perhaps there's something wrong with the trusty package?:
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:25
http://
Executed test runs:
UNSTABLE: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Francis Ginther (fginther) wrote : | # |
file-qml-plugin needed to be rebuilt because one of it's qt dependencies was no longer available. The job was retriggered and can now install the necessary packages.
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:25
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : | # |
You fixed the misspelling, so update the test as well :-)
=== modified file 'tests/
--- tests/autopilot
+++ tests/autopilot
@@ -92,7 +92,7 @@
- self.app.
+ self.app.
def test_open_
- 26. By Bartosz Kosiorek
-
Update autopilot test
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
FAILED: Continuous integration, rev:26
http://
Executed test runs:
UNSTABLE: http://
deb: http://
UNSTABLE: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Nicholas Skaggs (nskaggs) wrote : | # |
Tests work for me by searching for the dialog with a unique objectName. Note I changed the qml as well here.
=== modified file 'UnknowTypeDial
--- UnknowTypeDialo
+++ UnknowTypeDialo
@@ -6,6 +6,7 @@
Dialog {
id: unknownDialog
+ objectName: "unknownDialog"
title: i18n.tr("Unknown file type")
text: i18n.tr("Sorry but we can't find a way to display this file. Do you want to open it as a plain text?")
Button {
=== modified file 'tests/
--- tests/autopilot
+++ tests/autopilot
@@ -92,7 +92,7 @@
- self.app.
+ self.app.
def test_open_
- 27. By Bartosz Kosiorek
-
Fix Autopilot Unknown file type test
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote : | # |
PASSED: Continuous integration, rev:27
http://
Executed test runs:
SUCCESS: http://
deb: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
David Planella (dpm) wrote : | # |
Looks good to me now, thanks!
Preview Diff
1 | === modified file 'ImageView.qml' | |||
2 | --- ImageView.qml 2013-10-14 16:50:23 +0000 | |||
3 | +++ ImageView.qml 2014-05-08 20:15:28 +0000 | |||
4 | @@ -46,26 +46,26 @@ | |||
5 | 46 | } | 46 | } |
6 | 47 | } | 47 | } |
7 | 48 | 48 | ||
28 | 49 | Image{ | 49 | Image { |
29 | 50 | 50 | ||
30 | 51 | property real startWidth | 51 | property real startWidth |
31 | 52 | 52 | ||
32 | 53 | id: image | 53 | id: image |
33 | 54 | objectName: "imageItem" | 54 | objectName: "imageItem" |
34 | 55 | 55 | ||
35 | 56 | source: file.path | 56 | source: file.path |
36 | 57 | smooth: true | 57 | smooth: true |
37 | 58 | fillMode: Image.PreserveAspectFit | 58 | fillMode: Image.PreserveAspectFit |
38 | 59 | width: parent.width | 59 | width: parent.width |
39 | 60 | 60 | ||
40 | 61 | Component.onCompleted: { | 61 | Component.onCompleted: { |
41 | 62 | if (width > sourceSize.width) | 62 | if (width > sourceSize.width) |
42 | 63 | startWidth = sourceSize.width | 63 | startWidth = sourceSize.width |
43 | 64 | else | 64 | else |
44 | 65 | startWidth = width | 65 | startWidth = width |
45 | 66 | 66 | ||
46 | 67 | 67 | ||
27 | 68 | } | ||
47 | 69 | } | 68 | } |
48 | 69 | } | ||
49 | 70 | 70 | ||
50 | 71 | } | 71 | } |
51 | 72 | 72 | ||
52 | === modified file 'PdfView.qml' | |||
53 | --- PdfView.qml 2013-10-14 16:50:23 +0000 | |||
54 | +++ PdfView.qml 2014-05-08 20:15:28 +0000 | |||
55 | @@ -80,7 +80,7 @@ | |||
56 | 80 | 80 | ||
57 | 81 | } | 81 | } |
58 | 82 | 82 | ||
60 | 83 | Component.onCompleted : { | 83 | Component.onCompleted: { |
61 | 84 | 84 | ||
62 | 85 | var i=0; | 85 | var i=0; |
63 | 86 | for(i=1; i <= popplerProp.numPages; i++) | 86 | for(i=1; i <= popplerProp.numPages; i++) |
64 | 87 | 87 | ||
65 | === modified file 'TextView.qml' | |||
66 | --- TextView.qml 2013-09-05 11:03:57 +0000 | |||
67 | +++ TextView.qml 2014-05-08 20:15:28 +0000 | |||
68 | @@ -24,7 +24,7 @@ | |||
69 | 24 | autoSize: true | 24 | autoSize: true |
70 | 25 | maximumLineCount: 0 | 25 | maximumLineCount: 0 |
71 | 26 | readOnly: true | 26 | readOnly: true |
73 | 27 | //activeFocusOnPress: false; | 27 | //activeFocusOnPress: true; |
74 | 28 | highlighted: true | 28 | highlighted: true |
75 | 29 | 29 | ||
76 | 30 | text: "Loading..." | 30 | text: "Loading..." |
77 | @@ -47,5 +47,28 @@ | |||
78 | 47 | } | 47 | } |
79 | 48 | } | 48 | } |
80 | 49 | 49 | ||
81 | 50 | Keys.onPressed: { | ||
82 | 51 | if (event.key === Qt.Key_PageDown) { | ||
83 | 52 | if (!flickable.atYEnd) | ||
84 | 53 | flickable.contentY = flickable.contentY + height / 2; | ||
85 | 54 | event.accepted = true; | ||
86 | 55 | } else if (event.key === Qt.Key_PageUp) { | ||
87 | 56 | if (!flickable.atYBeginning) | ||
88 | 57 | flickable.contentY = flickable.contentY - height / 2; | ||
89 | 58 | event.accepted = true; | ||
90 | 59 | } | ||
91 | 60 | } | ||
92 | 61 | Keys.onLeftPressed: { | ||
93 | 62 | flickable.flick( -width / 2, 0) | ||
94 | 63 | } | ||
95 | 64 | Keys.onRightPressed: { | ||
96 | 65 | flickable.flick( width / 2, 0) | ||
97 | 66 | } | ||
98 | 67 | Keys.onUpPressed: { | ||
99 | 68 | flickable.flick( 0, height / 2) | ||
100 | 69 | } | ||
101 | 70 | Keys.onDownPressed: { | ||
102 | 71 | flickable.flick( 0, -height / 2) | ||
103 | 72 | } | ||
104 | 50 | } | 73 | } |
105 | 51 | 74 | ||
106 | 52 | 75 | ||
107 | === modified file 'UnknowTypeDialog.qml' | |||
108 | --- UnknowTypeDialog.qml 2013-08-04 17:51:23 +0000 | |||
109 | +++ UnknowTypeDialog.qml 2014-05-08 20:15:28 +0000 | |||
110 | @@ -5,24 +5,25 @@ | |||
111 | 5 | import "loadComponent.js" as LoadComponent | 5 | import "loadComponent.js" as LoadComponent |
112 | 6 | 6 | ||
113 | 7 | Dialog { | 7 | Dialog { |
117 | 8 | id: unknowDialog | 8 | id: unknownDialog |
118 | 9 | title: "Unknow type" | 9 | objectName: "unknownDialog" |
119 | 10 | text: "Sorry but we can't find a way to display this file. Do you want to open it as a plain text ?" | 10 | title: i18n.tr("Unknown file type") |
120 | 11 | text: i18n.tr("Sorry but we can't find a way to display this file. Do you want to open it as a plain text?") | ||
121 | 11 | Button { | 12 | Button { |
123 | 12 | text: "Yes" | 13 | text: i18n.tr("Yes") |
124 | 13 | color: "green" | 14 | color: "green" |
125 | 14 | 15 | ||
126 | 15 | onClicked: { | 16 | onClicked: { |
127 | 16 | LoadComponent.load("text/plain"); | 17 | LoadComponent.load("text/plain"); |
129 | 17 | unknowDialog.destroy(); | 18 | unknownDialog.destroy(); |
130 | 18 | } | 19 | } |
131 | 19 | } | 20 | } |
132 | 20 | Button { | 21 | Button { |
134 | 21 | text: "No" | 22 | text: i18n.tr("No") |
135 | 22 | color: "red" | 23 | color: "red" |
136 | 23 | 24 | ||
137 | 24 | onClicked: { | 25 | onClicked: { |
139 | 25 | unknowDialog.destroy(); | 26 | unknownDialog.destroy(); |
140 | 26 | } | 27 | } |
141 | 27 | } | 28 | } |
142 | 28 | } | 29 | } |
143 | 29 | 30 | ||
144 | === modified file 'debian/copyright' | |||
145 | --- debian/copyright 2013-07-24 21:32:24 +0000 | |||
146 | +++ debian/copyright 2014-05-08 20:15:28 +0000 | |||
147 | @@ -6,6 +6,7 @@ | |||
148 | 6 | Copyright: 2013 Canonical Ltd. | 6 | Copyright: 2013 Canonical Ltd. |
149 | 7 | 2013 Granger Anthony <grangeranthony@gmail.com> | 7 | 2013 Granger Anthony <grangeranthony@gmail.com> |
150 | 8 | 2013 Omer Akram <om26er@ubuntu.com> | 8 | 2013 Omer Akram <om26er@ubuntu.com> |
151 | 9 | 2014 Bartosz Kosiorek <bartosz.kosiorek@gmail.com> | ||
152 | 9 | License: GPL-3 | 10 | License: GPL-3 |
153 | 10 | 11 | ||
154 | 11 | Files: debian/* | 12 | Files: debian/* |
155 | 12 | 13 | ||
156 | === modified file 'loadComponent.js' | |||
157 | --- loadComponent.js 2013-08-08 13:34:38 +0000 | |||
158 | +++ loadComponent.js 2014-05-08 20:15:28 +0000 | |||
159 | @@ -11,7 +11,10 @@ | |||
160 | 11 | 11 | ||
161 | 12 | var qmlToLoad = ""; | 12 | var qmlToLoad = ""; |
162 | 13 | 13 | ||
164 | 14 | if (mimetype === "text/plain") | 14 | // Open all text files in text editor |
165 | 15 | // With that fix it is possible to open LICENSE file | ||
166 | 16 | // which was recognised as text/x-pascal | ||
167 | 17 | if (mimetype.substring(0, 5) === "text/") | ||
168 | 15 | { | 18 | { |
169 | 16 | qmlToLoad = "TextView"; | 19 | qmlToLoad = "TextView"; |
170 | 17 | } | 20 | } |
171 | @@ -45,6 +48,8 @@ | |||
172 | 45 | } | 48 | } |
173 | 46 | else | 49 | else |
174 | 47 | { | 50 | { |
176 | 48 | runUnknowTypeDialog(); | 51 | console.debug("Unknown MIME type: "+ mimetype); |
177 | 52 | runUnknownTypeDialog(); | ||
178 | 49 | } | 53 | } |
179 | 54 | return mimetype; | ||
180 | 50 | } | 55 | } |
181 | 51 | 56 | ||
182 | === modified file 'tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py' | |||
183 | --- tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2013-09-28 09:21:26 +0000 | |||
184 | +++ tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2014-05-08 20:15:28 +0000 | |||
185 | @@ -92,7 +92,7 @@ | |||
186 | 92 | self.launch_test_installed(self.sample_dir + filePath) | 92 | self.launch_test_installed(self.sample_dir + filePath) |
187 | 93 | 93 | ||
188 | 94 | self.assertThat( | 94 | self.assertThat( |
190 | 95 | self.app.select_single("Dialog", title="Unknow type").visible, | 95 | self.app.select_single("Dialog", objectName="unknownDialog").visible, |
191 | 96 | Eventually(Equals(True))) | 96 | Eventually(Equals(True))) |
192 | 97 | 97 | ||
193 | 98 | def test_open_pdf_file_type(self): | 98 | def test_open_pdf_file_type(self): |
194 | 99 | 99 | ||
195 | === modified file 'ubuntu-docviewer-app.json' | |||
196 | --- ubuntu-docviewer-app.json 2013-10-14 16:50:23 +0000 | |||
197 | +++ ubuntu-docviewer-app.json 2014-05-08 20:15:28 +0000 | |||
198 | @@ -1,3 +1,5 @@ | |||
199 | 1 | { | 1 | { |
201 | 2 | "policy_version": 1.0 | 2 | "policy_groups": [ |
202 | 3 | ], | ||
203 | 4 | "policy_version": 1 | ||
204 | 3 | } | 5 | } |
205 | 4 | 6 | ||
206 | === modified file 'ubuntu-docviewer-app.qml' | |||
207 | --- ubuntu-docviewer-app.qml 2013-10-14 16:50:23 +0000 | |||
208 | +++ ubuntu-docviewer-app.qml 2014-05-08 20:15:28 +0000 | |||
209 | @@ -35,8 +35,8 @@ | |||
210 | 35 | path: Utils.relToAbs(args.defaultArgument.at(0)) | 35 | path: Utils.relToAbs(args.defaultArgument.at(0)) |
211 | 36 | 36 | ||
212 | 37 | onMimetypeChanged: { | 37 | onMimetypeChanged: { |
215 | 38 | mimetypeItem.value = file.mimetype; | 38 | var mimetypeValue = file.mimetype; |
216 | 39 | LoadComponent.load(file.mimetype); | 39 | mimetypeItem.value = LoadComponent.load(mimetypeValue); |
217 | 40 | } | 40 | } |
218 | 41 | } | 41 | } |
219 | 42 | 42 | ||
220 | @@ -50,7 +50,7 @@ | |||
221 | 50 | 50 | ||
222 | 51 | 51 | ||
223 | 52 | title: Utils.getNameOfFile(file.path); | 52 | title: Utils.getNameOfFile(file.path); |
225 | 53 | 53 | ||
226 | 54 | page: Page { | 54 | page: Page { |
227 | 55 | id: pageMain | 55 | id: pageMain |
228 | 56 | 56 | ||
229 | @@ -73,7 +73,8 @@ | |||
230 | 73 | title: i18n.tr("Details") | 73 | title: i18n.tr("Details") |
231 | 74 | page: Page { | 74 | page: Page { |
232 | 75 | Column { | 75 | Column { |
234 | 76 | width: units.gu(50) | 76 | width: parent.width |
235 | 77 | |||
236 | 77 | ListItem.SingleValue { | 78 | ListItem.SingleValue { |
237 | 78 | text: i18n.tr("Location") | 79 | text: i18n.tr("Location") |
238 | 79 | value: file.path | 80 | value: file.path |
239 | @@ -84,6 +85,11 @@ | |||
240 | 84 | } | 85 | } |
241 | 85 | 86 | ||
242 | 86 | ListItem.SingleValue { | 87 | ListItem.SingleValue { |
243 | 88 | text: i18n.tr("Created") | ||
244 | 89 | value: qsTr("%1").arg(file.creationTime.toLocaleString(Qt.locale())) | ||
245 | 90 | } | ||
246 | 91 | |||
247 | 92 | ListItem.SingleValue { | ||
248 | 87 | text: i18n.tr("Last modified") | 93 | text: i18n.tr("Last modified") |
249 | 88 | value: qsTr("%1").arg(file.lastModified.toLocaleString(Qt.locale())) | 94 | value: qsTr("%1").arg(file.lastModified.toLocaleString(Qt.locale())) |
250 | 89 | } | 95 | } |
251 | @@ -91,7 +97,7 @@ | |||
252 | 91 | ListItem.SingleValue { | 97 | ListItem.SingleValue { |
253 | 92 | id: mimetypeItem | 98 | id: mimetypeItem |
254 | 93 | objectName: "mimetypeItem" | 99 | objectName: "mimetypeItem" |
256 | 94 | text: i18n.tr("Mimetype") | 100 | text: i18n.tr("MIME type") |
257 | 95 | value: "none" | 101 | value: "none" |
258 | 96 | } | 102 | } |
259 | 97 | } | 103 | } |
260 | @@ -100,14 +106,14 @@ | |||
261 | 100 | } | 106 | } |
262 | 101 | 107 | ||
263 | 102 | Component { | 108 | Component { |
265 | 103 | id: unknowTypeDialog | 109 | id: unknownTypeDialog |
266 | 104 | UnknowTypeDialog { | 110 | UnknowTypeDialog { |
267 | 105 | 111 | ||
268 | 106 | } | 112 | } |
269 | 107 | } | 113 | } |
270 | 108 | 114 | ||
272 | 109 | function runUnknowTypeDialog() | 115 | function runUnknownTypeDialog() |
273 | 110 | { | 116 | { |
275 | 111 | PopupUtils.open(unknowTypeDialog, pageMain); | 117 | PopupUtils.open(unknownTypeDialog, pageMain); |
276 | 112 | } | 118 | } |
277 | 113 | } | 119 | } |
278 | 114 | 120 | ||
279 | === modified file 'ubuntu-docviewer-app.qmlproject' | |||
280 | --- ubuntu-docviewer-app.qmlproject 2013-04-22 22:41:57 +0000 | |||
281 | +++ ubuntu-docviewer-app.qmlproject 2014-05-08 20:15:28 +0000 | |||
282 | @@ -15,6 +15,17 @@ | |||
283 | 15 | ImageFiles { | 15 | ImageFiles { |
284 | 16 | directory: "." | 16 | directory: "." |
285 | 17 | } | 17 | } |
286 | 18 | /* Shows the README files in the project view */ | ||
287 | 19 | Files { | ||
288 | 20 | filter: "README*" | ||
289 | 21 | } | ||
290 | 22 | /* Shows the translation files and the .pro file used to generate the .pot template */ | ||
291 | 23 | Files { | ||
292 | 24 | filter: "*.po*" | ||
293 | 25 | } | ||
294 | 26 | Files { | ||
295 | 27 | filter: "*.pro" | ||
296 | 28 | } | ||
297 | 18 | /* List of plugin directories passed to QML runtime */ | 29 | /* List of plugin directories passed to QML runtime */ |
298 | 19 | importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ] | 30 | importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ] |
299 | 20 | } | 31 | } |
FAILED: Continuous integration, rev:25 91.189. 93.70:8080/ job/ubuntu- docviewer- app-ci/ 24/ 91.189. 93.70:8080/ job/generic- mediumtests- trusty/ 1886/console 91.189. 93.70:8080/ job/ubuntu- docviewer- app-raring- amd64-ci/ 24 91.189. 93.70:8080/ job/ubuntu- docviewer- app-saucy- amd64-ci/ 24 91.189. 93.70:8080/ job/ubuntu- docviewer- app-trusty- amd64-ci/ 1
http://
Executed test runs:
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: 91.189. 93.70:8080/ job/ubuntu- docviewer- app-ci/ 24/rebuild
http://