← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~verzegnassi-stefano/ubuntu-docviewer-app/fix-1418648 into lp:ubuntu-docviewer-app

 

Review: Needs Fixing



Diff comments:

> === modified file 'po/com.ubuntu.docviewer.pot'
> --- po/com.ubuntu.docviewer.pot	2015-04-13 15:56:00 +0000
> +++ po/com.ubuntu.docviewer.pot	2015-04-15 16:13:49 +0000
> @@ -8,7 +8,7 @@
>  msgstr ""
>  "Project-Id-Version: \n"
>  "Report-Msgid-Bugs-To: \n"
> -"POT-Creation-Date: 2015-04-13 17:55+0200\n"
> +"POT-Creation-Date: 2015-04-15 17:55+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"
> @@ -147,7 +147,7 @@
>  
>  #: ../src/app/qml/documentPage/DeleteFileDialog.qml:36
>  #: ../src/app/qml/documentPage/DocumentPagePickModeHeader.qml:27
> -#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:52
> +#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:70
>  msgid "Cancel"
>  msgstr ""
>  
> @@ -215,7 +215,7 @@
>  msgstr ""
>  
>  #: ../src/app/qml/documentPage/DocumentPage.qml:25
> -#: /home/stefano/Progetti/doc-viewer/build-adv-import-handler-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
> +#: /home/stefano/Progetti/doc-viewer/build-ubuntu-docviewer-app-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_14_10_utopic-Default/po/com.ubuntu.docviewer.desktop.in.in.h:1
>  msgid "Document Viewer"
>  msgstr ""
>  
> @@ -286,7 +286,7 @@
>  msgid "Choose a page between 1 and %1"
>  msgstr ""
>  
> -#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:44
> +#: ../src/app/qml/pdfView/PdfViewGotoDialog.qml:62
>  msgid "GO!"
>  msgstr ""
>  
> @@ -304,6 +304,6 @@
>  msgid "Open"
>  msgstr ""
>  
> -#: /home/stefano/Progetti/doc-viewer/build-adv-import-handler-Desktop-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
> +#: /home/stefano/Progetti/doc-viewer/build-ubuntu-docviewer-app-UbuntuSDK_for_armhf_GCC_ubuntu_sdk_14_10_utopic-Default/po/com.ubuntu.docviewer.desktop.in.in.h:2
>  msgid "documents;viewer;pdf;reader;"
>  msgstr ""
> 
> === modified file 'src/app/qml/pdfView/PdfViewGotoDialog.qml'
> --- src/app/qml/pdfView/PdfViewGotoDialog.qml	2015-03-03 15:41:11 +0000
> +++ src/app/qml/pdfView/PdfViewGotoDialog.qml	2015-04-15 16:13:49 +0000
> @@ -25,18 +25,36 @@
>      title: i18n.tr("Go to page")
>      text: i18n.tr("Choose a page between 1 and %1").arg(pdfView.count)
>  
> +    /*
> +      WORKAROUND:
> +      For some reason we need to delay the focus assignment to the TextField,
> +      otherwise the focus is stolen. 168ms is the minimum value that works.

Not gonna work. I can guarantee that this will cause bugs. It only takes a scope refreshing in the background and the 168ms are not enough any more. You better find the thing that steals the focus IMO.

> +
> +      This seems to happen in any app that includes a TextField inside a Dialog
> +      (e.g. filemanager-app, 'rename' dialog).
> +
> +      May these 168ms have some relation with UbuntuAnimation.FastDuration
> +      (which is 165ms)?
> +     */
> +    Component.onCompleted: timer.start()
> +    Timer {
> +        id: timer
> +        interval: 168
> +
> +        onTriggered: {
> +            goToPageTextField.forceActiveFocus()
> +        }
> +    }
> +
>      TextField {
>          id: goToPageTextField
>          objectName:"goToPageTextField"
>  
> -        width: parent.width
> -
>          hasClearButton: true
>          inputMethodHints: Qt.ImhFormattedNumbersOnly
> -        validator: IntValidator{ bottom: 1; top: pdfView.count }
> +        validator: IntValidator { bottom: 1; top: pdfView.count }
>  
> -        Keys.onReturnPressed: goToPage()
> -        Component.onCompleted: forceActiveFocus()
> +        onAccepted: goToPage()
>      }
>  
>      Button {
> @@ -54,7 +72,7 @@
>      }
>  
>      function goToPage() {
> -        pdfView.positionAtIndex((goToPageTextField.text - 1))
> +        pdfView.positionAtIndex(goToPageTextField.text - 1)
>          PopupUtils.close(goToPageDialog)
>      }
>  }
> 


-- 
https://code.launchpad.net/~verzegnassi-stefano/ubuntu-docviewer-app/fix-1418648/+merge/256354
Your team Ubuntu Document Viewer Developers is subscribed to branch lp:ubuntu-docviewer-app.


References