Merge lp:~gang65/ubuntu-docviewer-app/ubuntu-docviewer-desktop-improvements into lp:ubuntu-docviewer-app/trunk

Proposed by Bartosz Kosiorek
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
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.

To post a comment you must log in.
25. By Bartosz Kosiorek

Improve Ubuntu-docviewer-app for desktop

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Jenkins is failing on:

Autopilot Package Version: 1.4+14.04.20140213-0ubuntu1
could not import package ubuntu_docviewer_app: No module named ubuntu_docviewer_app

Was the name of the app changed at some point in the tests code?

review: Needs Information
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Now the failure is on:

The following packages have unmet dependencies:
 ubuntu-docviewer-app : Depends: file-qml-plugin but it is not going to be installed

However, the package seems to be in the PPA. Perhaps there's something wrong with the trusty package?:

https://launchpad.net/~ubuntu-touch-coreapps-drivers/+archive/daily/+packages?field.name_filter=file&field.status_filter=published&field.series_filter=

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
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.

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

You fixed the misspelling, so update the test as well :-)

=== modified file 'tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py'
--- tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2013-09-28 09:21:26 +0000
+++ tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2014-05-08 14:06:55 +0000
@@ -92,7 +92,7 @@
             self.launch_test_installed(self.sample_dir + filePath)

         self.assertThat(
- self.app.select_single("Dialog", title="Unknow type").visible,
+ self.app.select_single("Dialog", title="Unknown type").visible,
             Eventually(Equals(True)))

     def test_open_pdf_file_type(self)

26. By Bartosz Kosiorek

Update autopilot test

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
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 'UnknowTypeDialog.qml'
--- UnknowTypeDialog.qml 2014-03-13 18:11:54 +0000
+++ UnknowTypeDialog.qml 2014-05-08 17:57:55 +0000
@@ -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/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py'
--- tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2013-09-28 09:21:26 +0000
+++ tests/autopilot/ubuntu_docviewer_app/tests/test_docviewer.py 2014-05-08 17:58:10 +0000
@@ -92,7 +92,7 @@
             self.launch_test_installed(self.sample_dir + filePath)

         self.assertThat(
- self.app.select_single("Dialog", title="Unknow type").visible,
+ self.app.select_single("Dialog", objectName="unknownDialog").visible,
             Eventually(Equals(True)))

     def test_open_pdf_file_type(self):

27. By Bartosz Kosiorek

Fix Autopilot Unknown file type test

Revision history for this message
Ubuntu Phone Apps Jenkins Bot (ubuntu-phone-apps-jenkins-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
David Planella (dpm) wrote :

Looks good to me now, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
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 }
6 }
7
8- Image{
9-
10- property real startWidth
11-
12- id: image
13- objectName: "imageItem"
14-
15- source: file.path
16- smooth: true
17- fillMode: Image.PreserveAspectFit
18- width: parent.width
19-
20- Component.onCompleted: {
21- if (width > sourceSize.width)
22- startWidth = sourceSize.width
23- else
24- startWidth = width
25-
26-
27- }
28+ Image {
29+
30+ property real startWidth
31+
32+ id: image
33+ objectName: "imageItem"
34+
35+ source: file.path
36+ smooth: true
37+ fillMode: Image.PreserveAspectFit
38+ width: parent.width
39+
40+ Component.onCompleted: {
41+ if (width > sourceSize.width)
42+ startWidth = sourceSize.width
43+ else
44+ startWidth = width
45+
46+
47 }
48+ }
49
50 }
51
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
57 }
58
59- Component.onCompleted : {
60+ Component.onCompleted: {
61
62 var i=0;
63 for(i=1; i <= popplerProp.numPages; i++)
64
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 autoSize: true
70 maximumLineCount: 0
71 readOnly: true
72- //activeFocusOnPress: false;
73+ //activeFocusOnPress: true;
74 highlighted: true
75
76 text: "Loading..."
77@@ -47,5 +47,28 @@
78 }
79 }
80
81+ Keys.onPressed: {
82+ if (event.key === Qt.Key_PageDown) {
83+ if (!flickable.atYEnd)
84+ flickable.contentY = flickable.contentY + height / 2;
85+ event.accepted = true;
86+ } else if (event.key === Qt.Key_PageUp) {
87+ if (!flickable.atYBeginning)
88+ flickable.contentY = flickable.contentY - height / 2;
89+ event.accepted = true;
90+ }
91+ }
92+ Keys.onLeftPressed: {
93+ flickable.flick( -width / 2, 0)
94+ }
95+ Keys.onRightPressed: {
96+ flickable.flick( width / 2, 0)
97+ }
98+ Keys.onUpPressed: {
99+ flickable.flick( 0, height / 2)
100+ }
101+ Keys.onDownPressed: {
102+ flickable.flick( 0, -height / 2)
103+ }
104 }
105
106
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 import "loadComponent.js" as LoadComponent
112
113 Dialog {
114- id: unknowDialog
115- title: "Unknow type"
116- text: "Sorry but we can't find a way to display this file. Do you want to open it as a plain text ?"
117+ id: unknownDialog
118+ objectName: "unknownDialog"
119+ title: i18n.tr("Unknown file type")
120+ 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 Button {
122- text: "Yes"
123+ text: i18n.tr("Yes")
124 color: "green"
125
126 onClicked: {
127 LoadComponent.load("text/plain");
128- unknowDialog.destroy();
129+ unknownDialog.destroy();
130 }
131 }
132 Button {
133- text: "No"
134+ text: i18n.tr("No")
135 color: "red"
136
137 onClicked: {
138- unknowDialog.destroy();
139+ unknownDialog.destroy();
140 }
141 }
142 }
143
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 Copyright: 2013 Canonical Ltd.
149 2013 Granger Anthony <grangeranthony@gmail.com>
150 2013 Omer Akram <om26er@ubuntu.com>
151+ 2014 Bartosz Kosiorek <bartosz.kosiorek@gmail.com>
152 License: GPL-3
153
154 Files: debian/*
155
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
161 var qmlToLoad = "";
162
163- if (mimetype === "text/plain")
164+ // Open all text files in text editor
165+ // With that fix it is possible to open LICENSE file
166+ // which was recognised as text/x-pascal
167+ if (mimetype.substring(0, 5) === "text/")
168 {
169 qmlToLoad = "TextView";
170 }
171@@ -45,6 +48,8 @@
172 }
173 else
174 {
175- runUnknowTypeDialog();
176+ console.debug("Unknown MIME type: "+ mimetype);
177+ runUnknownTypeDialog();
178 }
179+ return mimetype;
180 }
181
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 self.launch_test_installed(self.sample_dir + filePath)
187
188 self.assertThat(
189- self.app.select_single("Dialog", title="Unknow type").visible,
190+ self.app.select_single("Dialog", objectName="unknownDialog").visible,
191 Eventually(Equals(True)))
192
193 def test_open_pdf_file_type(self):
194
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 {
200- "policy_version": 1.0
201+ "policy_groups": [
202+ ],
203+ "policy_version": 1
204 }
205
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 path: Utils.relToAbs(args.defaultArgument.at(0))
211
212 onMimetypeChanged: {
213- mimetypeItem.value = file.mimetype;
214- LoadComponent.load(file.mimetype);
215+ var mimetypeValue = file.mimetype;
216+ mimetypeItem.value = LoadComponent.load(mimetypeValue);
217 }
218 }
219
220@@ -50,7 +50,7 @@
221
222
223 title: Utils.getNameOfFile(file.path);
224-
225+
226 page: Page {
227 id: pageMain
228
229@@ -73,7 +73,8 @@
230 title: i18n.tr("Details")
231 page: Page {
232 Column {
233- width: units.gu(50)
234+ width: parent.width
235+
236 ListItem.SingleValue {
237 text: i18n.tr("Location")
238 value: file.path
239@@ -84,6 +85,11 @@
240 }
241
242 ListItem.SingleValue {
243+ text: i18n.tr("Created")
244+ value: qsTr("%1").arg(file.creationTime.toLocaleString(Qt.locale()))
245+ }
246+
247+ ListItem.SingleValue {
248 text: i18n.tr("Last modified")
249 value: qsTr("%1").arg(file.lastModified.toLocaleString(Qt.locale()))
250 }
251@@ -91,7 +97,7 @@
252 ListItem.SingleValue {
253 id: mimetypeItem
254 objectName: "mimetypeItem"
255- text: i18n.tr("Mimetype")
256+ text: i18n.tr("MIME type")
257 value: "none"
258 }
259 }
260@@ -100,14 +106,14 @@
261 }
262
263 Component {
264- id: unknowTypeDialog
265+ id: unknownTypeDialog
266 UnknowTypeDialog {
267
268 }
269 }
270
271- function runUnknowTypeDialog()
272+ function runUnknownTypeDialog()
273 {
274- PopupUtils.open(unknowTypeDialog, pageMain);
275+ PopupUtils.open(unknownTypeDialog, pageMain);
276 }
277 }
278
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 ImageFiles {
284 directory: "."
285 }
286+ /* Shows the README files in the project view */
287+ Files {
288+ filter: "README*"
289+ }
290+ /* Shows the translation files and the .pro file used to generate the .pot template */
291+ Files {
292+ filter: "*.po*"
293+ }
294+ Files {
295+ filter: "*.pro"
296+ }
297 /* List of plugin directories passed to QML runtime */
298 importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ]
299 }

Subscribers

People subscribed via source and target branches