~mutse-young/ubuntu-docviewer-app/trunk

« back to all changes in this revision

Viewing changes to src/app/qml/PdfView.qml

  • Committer: Tarmac
  • Author(s): Stefano Verzegnassi
  • Date: 2014-11-07 22:02:18 UTC
  • mfrom: (36.3.6 content-hub-support)
  • Revision ID: tarmac-20141107220218-gpy3rrsdl8lgierw
Added ContentHub support. Fixes: https://bugs.launchpad.net/bugs/1387025, https://bugs.launchpad.net/bugs/1387026.

Approved by Arthur Mello, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
47
47
            /* FIXME: Don't set 'path' property directly, but set it through onCompleted signal.
48
48
               By doing otherwise, PDF pages are loaded two times, but only
49
49
               the first delegates are working. Asking to the image provider
50
 
               to get the second ones makes the app instable.
 
50
               to get the second ones, makes the app instable.
51
51
               (e.g. We have a PDF document with 10 pages. The plugin loads
52
52
               them twice - 2x10 = 20 pages - but only the first 10 are shown.
53
53
               While trying to get the 11th, the app crashes). */
126
126
 
127
127
            backAction: Action {
128
128
                iconName: "back"
 
129
                text: (pageStack.depth > 1) ? i18n.tr("Back") : i18n.tr("Close")
 
130
                onTriggered: {
 
131
                    if (pageStack.depth > 1) {
 
132
                        // Go back to Welcome page
 
133
                        pageStack.pop();
 
134
                    } else {
 
135
                        // File has been imported through Content Hub (or was not chosen through WelcomePage)
 
136
                        // Close the application and show our source app (e.g. ubuntu-filemanager-app if used to open a document)
 
137
                        Qt.quit()
 
138
                    }
 
139
                }
129
140
            }
130
141
 
131
142
            actions: [
143
154
                },
144
155
 
145
156
                Action {
 
157
                    objectName: "detailsAction"
146
158
                    text: i18n.tr("Details")
147
159
                    iconName: "info"
148
160
                    onTriggered: pageStack.push(Qt.resolvedUrl("DetailsPage.qml"))