ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #05012
[Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-lok-goto-dialog into lp:ubuntu-docviewer-app/reboot
Stefano Verzegnassi has proposed merging lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-lok-goto-dialog into lp:ubuntu-docviewer-app/reboot.
Commit message:
* [loviewer] Use percentage for 'go to' dialog.
* [loviewer] Enable 'go to' dialog only for LibreOffice.TextDocument type
Requested reviews:
Ubuntu Document Viewer Developers (ubuntu-docviewer-dev)
For more details, see:
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/reboot-lok-goto-dialog/+merge/271700
Workaround for page break detection missing in LibreOffice 5.0.
We use percentage instead of page number in order to get an (almost) equivalent functionality.
Also, the "Go to position" dialog is only available for LibreOffice text documents (at least until we don't have a proper support for presentation type).
--
Your team Ubuntu Document Viewer Developers is requested to review the proposed merge of lp:~verzegnassi-stefano/ubuntu-docviewer-app/reboot-lok-goto-dialog into lp:ubuntu-docviewer-app/reboot.
=== modified file 'po/com.ubuntu.docviewer.pot'
--- po/com.ubuntu.docviewer.pot 2015-09-16 19:13:16 +0000
+++ po/com.ubuntu.docviewer.pot 2015-09-18 18:34:55 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2015-09-09 19:15+0200\n"
+"POT-Creation-Date: 2015-09-18 20:28+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -33,12 +33,12 @@
msgstr ""
#: ../src/app/docviewer-application.cpp:171
-#: /tmp/build-reboot-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_15_04_vivid-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
+#: /home/stefano/Progetti/docviewer/LAUNCHPAD/build-reboot-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
msgid "Document Viewer"
msgstr ""
#: ../src/app/qml/common/DetailsPage.qml:27
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:112
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:114
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:97
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:83
msgid "Details"
@@ -77,7 +77,7 @@
#: ../src/app/qml/common/RejectedImportDialog.qml:38
#: ../src/app/qml/documentPage/DocumentPageSelectionModeHeader.qml:32
#: ../src/app/qml/documentPage/SortSettingsDialog.qml:53
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:76
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:77
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:61
msgid "Close"
@@ -169,7 +169,7 @@
#: ../src/app/qml/documentPage/DeleteFileDialog.qml:44
#: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:27
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:52
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:54
#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:52
msgid "Cancel"
msgstr ""
@@ -272,7 +272,7 @@
msgstr ""
#: ../src/app/qml/documentPage/DocumentPageSearchHeader.qml:27
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:76
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:77
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:61
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:61
msgid "Back"
@@ -330,59 +330,55 @@
msgid "Page %1 of %2"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:57
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:58
msgid "LibreOffice text document"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:59
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:60
msgid "LibreOffice spread sheet"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:61
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:62
msgid "LibreOffice presentation"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:63
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:64
msgid "LibreOffice Draw document"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:65
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:66
msgid "Unknown LibreOffice document"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:67
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:68
msgid "Unknown type document"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:100
-#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:85
-msgid "Go to page..."
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:101
+msgid "Go to position..."
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:106
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:108
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:91
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:77
msgid "Disable night mode"
msgstr ""
-#: ../src/app/qml/loView/LOViewDefaultHeader.qml:106
+#: ../src/app/qml/loView/LOViewDefaultHeader.qml:108
#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:91
#: ../src/app/qml/textView/TextViewDefaultHeader.qml:77
msgid "Enable night mode"
msgstr ""
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:25
-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:25
-msgid "Go to page"
-msgstr ""
-
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:26
-#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
-#, qt-format
-msgid "Choose a page between 1 and %1"
-msgstr ""
-
-#: ../src/app/qml/loView/LOViewGotoDialog.qml:44
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:27
+msgid "Go to position"
+msgstr ""
+
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:28
+msgid "Choose a position between 1% and 100%"
+msgstr ""
+
+#: ../src/app/qml/loView/LOViewGotoDialog.qml:46
#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:44
msgid "GO!"
msgstr ""
@@ -397,6 +393,19 @@
msgid "Hide table of contents"
msgstr ""
+#: ../src/app/qml/pdfView/PdfViewDefaultHeader.qml:85
+msgid "Go to page..."
+msgstr ""
+
+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:25
+msgid "Go to page"
+msgstr ""
+
+#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:26
+#, qt-format
+msgid "Choose a page between 1 and %1"
+msgstr ""
+
#: ../src/app/qml/textView/TextView.qml:42
msgid "Loading..."
msgstr ""
@@ -411,6 +420,6 @@
msgid "Open"
msgstr ""
-#: /tmp/build-reboot-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_15_04_vivid-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
+#: /home/stefano/Progetti/docviewer/LAUNCHPAD/build-reboot-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
msgid "documents;viewer;pdf;reader;"
msgstr ""
=== modified file 'src/app/qml/loView/LOViewDefaultHeader.qml'
--- src/app/qml/loView/LOViewDefaultHeader.qml 2015-06-26 14:56:23 +0000
+++ src/app/qml/loView/LOViewDefaultHeader.qml 2015-09-18 18:34:55 +0000
@@ -18,6 +18,7 @@
import Ubuntu.Components 1.1
import QtQuick.Layouts 1.1
import Ubuntu.Components.Popups 1.0
+import DocumentViewer.LibreOffice 1.0 as LibreOffice
PageHeadState {
id: rootItem
@@ -95,10 +96,11 @@
},
Action {
- objectName:"gotopage"
+ objectName: "gotopage"
iconName: "browser-tabs"
- text: i18n.tr("Go to page...")
+ text: i18n.tr("Go to position...")
onTriggered: PopupUtils.open(Qt.resolvedUrl("LOViewGotoDialog.qml"), targetPage)
+ visible: loDocument.documentType == LibreOffice.Document.TextDocument
},
Action {
=== modified file 'src/app/qml/loView/LOViewGotoDialog.qml'
--- src/app/qml/loView/LOViewGotoDialog.qml 2015-06-24 12:04:16 +0000
+++ src/app/qml/loView/LOViewGotoDialog.qml 2015-09-18 18:34:55 +0000
@@ -18,12 +18,14 @@
import Ubuntu.Components 1.1
import Ubuntu.Components.Popups 1.0
+// TODO: Use page breaks detection, when LibreOfficeKit will support it.
+
Dialog {
id: goToPageDialog
- objectName:"LOViewGotoDialog"
+ objectName: "LOViewGotoDialog"
- title: i18n.tr("Go to page")
- text: i18n.tr("Choose a page between 1 and %1").arg(loView.count)
+ title: i18n.tr("Go to position")
+ text: i18n.tr("Choose a position between 1% and 100%")
TextField {
id: goToPageTextField
@@ -33,7 +35,7 @@
hasClearButton: true
inputMethodHints: Qt.ImhFormattedNumbersOnly
- validator: IntValidator{ bottom: 1; top: loView.count }
+ validator: IntValidator{ bottom: 1; top: 100 }
Keys.onReturnPressed: goToPage()
Component.onCompleted: forceActiveFocus()
@@ -54,7 +56,9 @@
}
function goToPage() {
- loView.positionAtIndex((goToPageTextField.text - 1))
+ var pos = loView.contentHeight * parseInt(goToPageTextField.text) / 100
+
+ loView.contentY = Math.min(pos, (loView.contentHeight - loView.height))
PopupUtils.close(goToPageDialog)
}
}
Follow ups