2
* Copyright (C) 2015 Canonical, Ltd.
4
* This program is free software; you can redistribute it and/or modify
5
* it under the terms of the GNU General Public License as published by
6
* the Free Software Foundation; version 3.
8
* This program is distributed in the hope that it will be useful,
9
* but WITHOUT ANY WARRANTY; without even the implied warranty of
10
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
* GNU General Public License for more details.
13
* You should have received a copy of the GNU General Public License
14
* along with this program. If not, see <http://www.gnu.org/licenses/>.
18
import Ubuntu.Components 1.1
19
import Ubuntu.Components.Popups 1.0
20
import Qt.labs.settings 1.0
25
title: i18n.tr("Document Viewer")
28
property bool useGridView: false
31
property alias useGridView: documentPage.useGridView
34
property alias view: viewLoader
39
source: (folderModel.count === 0) ? Qt.resolvedUrl("./DocumentEmptyState.qml")
40
: useGridView ? Qt.resolvedUrl("./DocumentGridView.qml")
41
: Qt.resolvedUrl("./DocumentListView.qml")
46
DocumentPageDefaultHeader {
48
targetPage: documentPage
49
when: !mainView.pickMode && !viewLoader.item.isInSelectionMode
52
DocumentPagePickModeHeader {
54
targetPage: documentPage
55
when: mainView.pickMode
58
DocumentPageSelectionModeHeader {
60
targetPage: documentPage
61
when: !mainView.pickMode && viewLoader.item.isInSelectionMode
68
onPickModeEnabledChanged: {
69
if (DOC_VIEWER.pickModeEnabled) {
70
viewLoader.item.startSelection()
72
viewLoader.item.cancelSelection()