[Ubuntu-touch-coreapps-reviewers] [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

2016-03-31 Thread noreply
The proposal to merge 
lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into 
lp:ubuntu-docviewer-app has been updated.

Status: Approved => Merged

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048
-- 
Your team Ubuntu Document Viewer Developers is subscribed to branch 
lp:ubuntu-docviewer-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-touch-coreapps-reviewers] [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

2016-03-31 Thread Roman Shchekin
The proposal to merge 
lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into 
lp:ubuntu-docviewer-app has been updated.

Status: Needs review => Approved

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048
-- 
Your team Ubuntu Document Viewer Developers is subscribed to branch 
lp:ubuntu-docviewer-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

2016-03-30 Thread Jenkins Bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:321
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-ci/269/
Executed test runs:
None: https://core-apps-jenkins.ubuntu.com/job/generic-update-mp/837/console

Click here to trigger a rebuild:
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-ci/269/rebuild

-- 
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048
Your team Ubuntu Document Viewer Developers is subscribed to branch 
lp:ubuntu-docviewer-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

2016-03-30 Thread Stefano Verzegnassi
> Haha, are you enjoyed deleting this code? ;)
Ahah, you can be sure of it! :)

> Why did you switch it [PageHeader.flickable] off? Just for information.
I was having trouble in setting the anchors for the content of the 
ViewerPage[1], and the LibreOffice Viewer had strange bindings that were 
causing a continuous flickering and reloading of the document content, every 
time the header was changing its status (i.e. visible/hidden).

I spent some time on it again (after you review), and now it seems to behave 
correctly. Pushing the new commit...

[1] We load LOViewPage asynchronously, but the loading logic is placed in a 
different file.
-- 
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048
Your team Ubuntu Document Viewer Developers is subscribed to branch 
lp:ubuntu-docviewer-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

2016-03-29 Thread Roman Shchekin
Review: Needs Information

See inline comments!

Diff comments:

> 
> === modified file 'src/app/qml/loView/KeybHelper.js'
> --- src/app/qml/loView/KeybHelper.js  2015-12-14 00:40:55 +
> +++ src/app/qml/loView/KeybHelper.js  2016-03-24 15:02:54 +
> @@ -14,83 +14,59 @@
>   * along with this program.  If not, see .
>   */
>   
> +// Here we handle all the key events that are not
> +// recognised by UITK ScrollView
> +
>  function parseEvent(event) {
> -var pixelDiff = 5;
> -
>  var view = loPage.contentItem.loView
>  var isPresentation = view.document.documentType === 
> LibreOffice.Document.PresentationDocument
>  
>  if (event.key == Qt.Key_PageUp) {
> -if (isPresentation)
> +if (isPresentation) {
>  view.currentPart -= 1
> -else
> -view.moveView("vertical", -view.height)
> - 
> +event.accepted = true
> +}
>  return;
>  }
>   
>  if (event.key == Qt.Key_PageDown) {
> -if (isPresentation)
> +if (isPresentation) {
>  view.currentPart += 1
> -else
> -view.moveView("vertical", view.height)
> - 
> +event.accepted = true
> +}
>  return;
>  }
>   
>  if (event.key == Qt.Key_Home) {
> -if (event.modifiers & Qt.ControlModifier) {
> -view.contentX = 0
> -view.contentY = 0
> +if (event.modifiers & Qt.ControlModifier)
>  view.currentPart = 0
> -} else {
> -view.contentX = 0
> -view.contentY = 0
> -}
> +
> +event.accepted = false
> +return
>  }
>  
>  if (event.key == Qt.Key_End) {
> -if (event.modifiers & Qt.ControlModifier) {
> -view.contentX = view.contentWidth - view.width
> -view.contentY = view.contentHeight - view.height
> -console.log(view.currentPart, view.document.partsCount - 1)
> +if (event.modifiers & Qt.ControlModifier)
>  view.currentPart = view.document.partsCount - 1
> -} else {
> -view.contentX = view.contentWidth - view.width
> -view.contentY = view.contentHeight - view.height
> -}
> -}
>  

Haha, are you enjoyed deleting this code? ;)

> -if (event.key == Qt.Key_Up) {
> -view.moveView("vertical", -pixelDiff)
> -return;
> -}
> - 
> -if (event.key == Qt.Key_Down) {
> -view.moveView("vertical", pixelDiff)
> -return;
> -}
> - 
> -if (event.key == Qt.Key_Left) {
> -view.moveView("horizontal", -pixelDiff)
> -return;
> -}
> - 
> -if (event.key == Qt.Key_Right) {
> -view.moveView("horizontal", pixelDiff)
> -return;
> +event.accepted = false
> +return
>  }
>  
>  if (event.key == Qt.Key_Plus) {
>  if (event.modifiers & Qt.ControlModifier) {
> -view.zoomFactor = Math.max(4.0, view.zoomFactor + 0.25)
> +view.setZoom(Math.min(view.zoomSettings.maximumZoom, 
> view.zoomSettings.zoomFactor + 0.25))
>  }
> +
> +return
>  }
>  
>  if (event.key == Qt.Key_Minus) {
>  if (event.modifiers & Qt.ControlModifier) {
> -view.zoomFactor = Math.min(0.5, view.zoomFactor - 0.25)
> +view.setZoom(Math.max(view.zoomSettings.minimumZoom, 
> view.zoomSettings.zoomFactor - 0.25))
>  }
> +
> +return
>  }
>  
>  
> 
> === modified file 'src/app/qml/loView/LOViewPage.qml'
> --- src/app/qml/loView/LOViewPage.qml 2016-02-03 21:35:53 +
> +++ src/app/qml/loView/LOViewPage.qml 2016-03-24 15:02:54 +
> @@ -265,12 +269,21 @@
>  }
>  }
>  
> -// *** HEADER ***
> -state: "default"
> -states: [
> -LOViewDefaultHeader {
> -name: "default"
> -targetPage: loPage
> -}
> -]
> +
> +/*** Headers ***/
> +
> +LOViewDefaultHeader {
> +id: defaultHeader
> +visible: loPage.loaded
> +title: DocumentViewer.getFileBaseNameFromPath(file.path);

Why did you switch it off? Just for information.

> +// FIXME: re-enable
> +//flickable: isTextDocument ? loPage.contentItem.loView : null
> +targetPage: loPage
> +}
> +
> +PageHeader {
> +id: loadingHeader
> +visible: !loPage.loaded
> +// When we're still loading LibreOffice, show an empty header
> +}
>  }


-- 
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048
Your team Ubuntu Document Viewer Developers is subscribed to branch 
lp:ubuntu-docviewer-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


Re: [Ubuntu-touch-coreapps-reviewers] [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

2016-03-24 Thread Jenkins Bot
Review: Approve continuous-integration

PASSED: Continuous integration, rev:320
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-ci/261/
Executed test runs:
None: https://core-apps-jenkins.ubuntu.com/job/generic-update-mp/811/console

Click here to trigger a rebuild:
https://core-apps-jenkins.ubuntu.com/job/docviewer-app-ci/261/rebuild

-- 
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048
Your team Ubuntu Document Viewer Developers is requested to review the proposed 
merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into 
lp:ubuntu-docviewer-app.

-- 
Mailing list: https://launchpad.net/~ubuntu-touch-coreapps-reviewers
Post to : ubuntu-touch-coreapps-reviewers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~ubuntu-touch-coreapps-reviewers
More help   : https://help.launchpad.net/ListHelp


[Ubuntu-touch-coreapps-reviewers] [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into lp:ubuntu-docviewer-app

2016-03-24 Thread Stefano Verzegnassi
Stefano Verzegnassi has proposed merging 
lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into 
lp:ubuntu-docviewer-app.

Commit message:
* WORKAROUND: make the lok-viewer header static (avoid unpredictable binding)
* Use new PageHeader and ScrollView components
* UI: Show an empty header when loading LibreOffice

Requested reviews:
  Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)

For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page/+merge/290048

* WORKAROUND: make the lok-viewer header static (avoid unpredictable binding)
* Use new PageHeader and ScrollView components
* UI: Show an empty header when loading LibreOffice
-- 
Your team Ubuntu Document Viewer Developers is requested to review the proposed 
merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/uitk13-lok-page into 
lp:ubuntu-docviewer-app.
=== modified file 'src/app/qml/common/ViewerPage.qml'
--- src/app/qml/common/ViewerPage.qml	2015-11-30 12:12:10 +
+++ src/app/qml/common/ViewerPage.qml	2016-03-24 15:02:54 +
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Stefano Verzegnassi 
+ * Copyright (C) 2015, 2016 Stefano Verzegnassi 
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -36,7 +36,6 @@
 Loader {
 id: contentLoader
 anchors.fill: parent
-
 asynchronous: true
 sourceComponent: viewerPage.contents
 
@@ -46,7 +45,6 @@
 Item {
 id: splashScreenItem
 anchors.fill: parent
-
 visible: contentLoader.status != Loader.Ready
 enabled: visible
 }

=== modified file 'src/app/qml/loView/KeybHelper.js'
--- src/app/qml/loView/KeybHelper.js	2015-12-14 00:40:55 +
+++ src/app/qml/loView/KeybHelper.js	2016-03-24 15:02:54 +
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2015 Stefano Verzegnassi
+ * Copyright (C) 2015, 2016 Stefano Verzegnassi
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -14,83 +14,59 @@
  * along with this program.  If not, see .
  */
  
+// Here we handle all the key events that are not
+// recognised by UITK ScrollView
+
 function parseEvent(event) {
-var pixelDiff = 5;
-
 var view = loPage.contentItem.loView
 var isPresentation = view.document.documentType === LibreOffice.Document.PresentationDocument
 
 if (event.key == Qt.Key_PageUp) {
-if (isPresentation)
+if (isPresentation) {
 view.currentPart -= 1
-else
-view.moveView("vertical", -view.height)
- 
+event.accepted = true
+}
 return;
 }
  
 if (event.key == Qt.Key_PageDown) {
-if (isPresentation)
+if (isPresentation) {
 view.currentPart += 1
-else
-view.moveView("vertical", view.height)
- 
+event.accepted = true
+}
 return;
 }
  
 if (event.key == Qt.Key_Home) {
-if (event.modifiers & Qt.ControlModifier) {
-view.contentX = 0
-view.contentY = 0
+if (event.modifiers & Qt.ControlModifier)
 view.currentPart = 0
-} else {
-view.contentX = 0
-view.contentY = 0
-}
+
+event.accepted = false
+return
 }
 
 if (event.key == Qt.Key_End) {
-if (event.modifiers & Qt.ControlModifier) {
-view.contentX = view.contentWidth - view.width
-view.contentY = view.contentHeight - view.height
-console.log(view.currentPart, view.document.partsCount - 1)
+if (event.modifiers & Qt.ControlModifier)
 view.currentPart = view.document.partsCount - 1
-} else {
-view.contentX = view.contentWidth - view.width
-view.contentY = view.contentHeight - view.height
-}
-}
 
-if (event.key == Qt.Key_Up) {
-view.moveView("vertical", -pixelDiff)
-return;
-}
- 
-if (event.key == Qt.Key_Down) {
-view.moveView("vertical", pixelDiff)
-return;
-}
- 
-if (event.key == Qt.Key_Left) {
-view.moveView("horizontal", -pixelDiff)
-return;
-}
- 
-if (event.key == Qt.Key_Right) {
-view.moveView("horizontal", pixelDiff)
-return;
+event.accepted = false
+return
 }
 
 if (event.key == Qt.Key_Plus) {
 if (event.modifiers & Qt.ControlModifier) {
-view.zoomFactor = Math.max(4.0, view.zoomFactor + 0.25)
+view.setZoom(Math.min(view.zoomSettings.maximumZoom, view.zoomSettings.zoomFactor + 0.25))
 }
+
+return
 }
 
 if (event.key == Qt.Key_Minus) {
 if (event.modifiers & Qt.ControlModifier) {
-view.zoomFactor = Math.min(0.5, view.zoomFactor - 0.25)
+view.setZoom(Math.