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
=== modified file 'ImageView.qml'
--- ImageView.qml 2013-10-14 16:50:23 +0000
+++ ImageView.qml 2014-05-08 20:15:28 +0000
@@ -46,26 +46,26 @@
46 }46 }
47 }47 }
4848
49 Image{49 Image {
5050
51 property real startWidth51 property real startWidth
5252
53 id: image53 id: image
54 objectName: "imageItem"54 objectName: "imageItem"
5555
56 source: file.path56 source: file.path
57 smooth: true57 smooth: true
58 fillMode: Image.PreserveAspectFit58 fillMode: Image.PreserveAspectFit
59 width: parent.width59 width: parent.width
6060
61 Component.onCompleted: {61 Component.onCompleted: {
62 if (width > sourceSize.width)62 if (width > sourceSize.width)
63 startWidth = sourceSize.width63 startWidth = sourceSize.width
64 else64 else
65 startWidth = width65 startWidth = width
6666
6767
68 }
69 }68 }
69 }
7070
71}71}
7272
=== modified file 'PdfView.qml'
--- PdfView.qml 2013-10-14 16:50:23 +0000
+++ PdfView.qml 2014-05-08 20:15:28 +0000
@@ -80,7 +80,7 @@
8080
81 }81 }
8282
83 Component.onCompleted : {83 Component.onCompleted: {
8484
85 var i=0;85 var i=0;
86 for(i=1; i <= popplerProp.numPages; i++)86 for(i=1; i <= popplerProp.numPages; i++)
8787
=== modified file 'TextView.qml'
--- TextView.qml 2013-09-05 11:03:57 +0000
+++ TextView.qml 2014-05-08 20:15:28 +0000
@@ -24,7 +24,7 @@
24 autoSize: true24 autoSize: true
25 maximumLineCount: 025 maximumLineCount: 0
26 readOnly: true26 readOnly: true
27 //activeFocusOnPress: false;27 //activeFocusOnPress: true;
28 highlighted: true28 highlighted: true
2929
30 text: "Loading..."30 text: "Loading..."
@@ -47,5 +47,28 @@
47 }47 }
48 }48 }
4949
50 Keys.onPressed: {
51 if (event.key === Qt.Key_PageDown) {
52 if (!flickable.atYEnd)
53 flickable.contentY = flickable.contentY + height / 2;
54 event.accepted = true;
55 } else if (event.key === Qt.Key_PageUp) {
56 if (!flickable.atYBeginning)
57 flickable.contentY = flickable.contentY - height / 2;
58 event.accepted = true;
59 }
60 }
61 Keys.onLeftPressed: {
62 flickable.flick( -width / 2, 0)
63 }
64 Keys.onRightPressed: {
65 flickable.flick( width / 2, 0)
66 }
67 Keys.onUpPressed: {
68 flickable.flick( 0, height / 2)
69 }
70 Keys.onDownPressed: {
71 flickable.flick( 0, -height / 2)
72 }
50}73}
5174
5275
=== modified file 'UnknowTypeDialog.qml'
--- UnknowTypeDialog.qml 2013-08-04 17:51:23 +0000
+++ UnknowTypeDialog.qml 2014-05-08 20:15:28 +0000
@@ -5,24 +5,25 @@
5import "loadComponent.js" as LoadComponent5import "loadComponent.js" as LoadComponent
66
7Dialog {7Dialog {
8 id: unknowDialog8 id: unknownDialog
9 title: "Unknow type"9 objectName: "unknownDialog"
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")
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?")
11 Button {12 Button {
12 text: "Yes"13 text: i18n.tr("Yes")
13 color: "green"14 color: "green"
1415
15 onClicked: {16 onClicked: {
16 LoadComponent.load("text/plain");17 LoadComponent.load("text/plain");
17 unknowDialog.destroy();18 unknownDialog.destroy();
18 }19 }
19 }20 }
20 Button {21 Button {
21 text: "No"22 text: i18n.tr("No")
22 color: "red"23 color: "red"
2324
24 onClicked: {25 onClicked: {
25 unknowDialog.destroy();26 unknownDialog.destroy();
26 }27 }
27 }28 }
28}29}
2930
=== modified file 'debian/copyright'
--- debian/copyright 2013-07-24 21:32:24 +0000
+++ debian/copyright 2014-05-08 20:15:28 +0000
@@ -6,6 +6,7 @@
6Copyright: 2013 Canonical Ltd.6Copyright: 2013 Canonical Ltd.
7 2013 Granger Anthony <grangeranthony@gmail.com>7 2013 Granger Anthony <grangeranthony@gmail.com>
8 2013 Omer Akram <om26er@ubuntu.com>8 2013 Omer Akram <om26er@ubuntu.com>
9 2014 Bartosz Kosiorek <bartosz.kosiorek@gmail.com>
9License: GPL-310License: GPL-3
1011
11Files: debian/*12Files: debian/*
1213
=== modified file 'loadComponent.js'
--- loadComponent.js 2013-08-08 13:34:38 +0000
+++ loadComponent.js 2014-05-08 20:15:28 +0000
@@ -11,7 +11,10 @@
1111
12 var qmlToLoad = "";12 var qmlToLoad = "";
1313
14 if (mimetype === "text/plain")14 // Open all text files in text editor
15 // With that fix it is possible to open LICENSE file
16 // which was recognised as text/x-pascal
17 if (mimetype.substring(0, 5) === "text/")
15 {18 {
16 qmlToLoad = "TextView";19 qmlToLoad = "TextView";
17 }20 }
@@ -45,6 +48,8 @@
45 }48 }
46 else49 else
47 {50 {
48 runUnknowTypeDialog();51 console.debug("Unknown MIME type: "+ mimetype);
52 runUnknownTypeDialog();
49 }53 }
54 return mimetype;
50}55}
5156
=== 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 20:15:28 +0000
@@ -92,7 +92,7 @@
92 self.launch_test_installed(self.sample_dir + filePath)92 self.launch_test_installed(self.sample_dir + filePath)
9393
94 self.assertThat(94 self.assertThat(
95 self.app.select_single("Dialog", title="Unknow type").visible,95 self.app.select_single("Dialog", objectName="unknownDialog").visible,
96 Eventually(Equals(True)))96 Eventually(Equals(True)))
9797
98 def test_open_pdf_file_type(self):98 def test_open_pdf_file_type(self):
9999
=== modified file 'ubuntu-docviewer-app.json'
--- ubuntu-docviewer-app.json 2013-10-14 16:50:23 +0000
+++ ubuntu-docviewer-app.json 2014-05-08 20:15:28 +0000
@@ -1,3 +1,5 @@
1{1{
2 "policy_version": 1.02 "policy_groups": [
3 ],
4 "policy_version": 1
3}5}
46
=== modified file 'ubuntu-docviewer-app.qml'
--- ubuntu-docviewer-app.qml 2013-10-14 16:50:23 +0000
+++ ubuntu-docviewer-app.qml 2014-05-08 20:15:28 +0000
@@ -35,8 +35,8 @@
35 path: Utils.relToAbs(args.defaultArgument.at(0))35 path: Utils.relToAbs(args.defaultArgument.at(0))
3636
37 onMimetypeChanged: {37 onMimetypeChanged: {
38 mimetypeItem.value = file.mimetype;38 var mimetypeValue = file.mimetype;
39 LoadComponent.load(file.mimetype);39 mimetypeItem.value = LoadComponent.load(mimetypeValue);
40 }40 }
41 }41 }
42 42
@@ -50,7 +50,7 @@
5050
51 51
52 title: Utils.getNameOfFile(file.path);52 title: Utils.getNameOfFile(file.path);
53 53
54 page: Page {54 page: Page {
55 id: pageMain55 id: pageMain
5656
@@ -73,7 +73,8 @@
73 title: i18n.tr("Details")73 title: i18n.tr("Details")
74 page: Page {74 page: Page {
75 Column {75 Column {
76 width: units.gu(50)76 width: parent.width
77
77 ListItem.SingleValue {78 ListItem.SingleValue {
78 text: i18n.tr("Location")79 text: i18n.tr("Location")
79 value: file.path80 value: file.path
@@ -84,6 +85,11 @@
84 }85 }
8586
86 ListItem.SingleValue {87 ListItem.SingleValue {
88 text: i18n.tr("Created")
89 value: qsTr("%1").arg(file.creationTime.toLocaleString(Qt.locale()))
90 }
91
92 ListItem.SingleValue {
87 text: i18n.tr("Last modified")93 text: i18n.tr("Last modified")
88 value: qsTr("%1").arg(file.lastModified.toLocaleString(Qt.locale()))94 value: qsTr("%1").arg(file.lastModified.toLocaleString(Qt.locale()))
89 }95 }
@@ -91,7 +97,7 @@
91 ListItem.SingleValue {97 ListItem.SingleValue {
92 id: mimetypeItem98 id: mimetypeItem
93 objectName: "mimetypeItem"99 objectName: "mimetypeItem"
94 text: i18n.tr("Mimetype")100 text: i18n.tr("MIME type")
95 value: "none"101 value: "none"
96 }102 }
97 }103 }
@@ -100,14 +106,14 @@
100 }106 }
101107
102 Component {108 Component {
103 id: unknowTypeDialog109 id: unknownTypeDialog
104 UnknowTypeDialog {110 UnknowTypeDialog {
105111
106 }112 }
107 }113 }
108114
109 function runUnknowTypeDialog()115 function runUnknownTypeDialog()
110 {116 {
111 PopupUtils.open(unknowTypeDialog, pageMain);117 PopupUtils.open(unknownTypeDialog, pageMain);
112 }118 }
113}119}
114120
=== modified file 'ubuntu-docviewer-app.qmlproject'
--- ubuntu-docviewer-app.qmlproject 2013-04-22 22:41:57 +0000
+++ ubuntu-docviewer-app.qmlproject 2014-05-08 20:15:28 +0000
@@ -15,6 +15,17 @@
15 ImageFiles {15 ImageFiles {
16 directory: "."16 directory: "."
17 }17 }
18 /* Shows the README files in the project view */
19 Files {
20 filter: "README*"
21 }
22 /* Shows the translation files and the .pro file used to generate the .pot template */
23 Files {
24 filter: "*.po*"
25 }
26 Files {
27 filter: "*.pro"
28 }
18 /* List of plugin directories passed to QML runtime */29 /* List of plugin directories passed to QML runtime */
19 importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ]30 importPaths: [ "." ,"/usr/lib/x86_64-linux-gnu/qt5/qml" ]
20}31}

Subscribers

People subscribed via source and target branches