~verzegnassi-stefano/ubuntu-docviewer-app/reboot-document-last-position

« back to all changes in this revision

Viewing changes to src/app/qml/documentPage/DocumentPagePickModeHeader.qml

  • Committer: Stefano Verzegnassi
  • Date: 2015-02-13 15:30:01 UTC
  • mto: This revision was merged to the branch mainline in revision 86.
  • Revision ID: stefano92.100@gmail.com-20150213153001-qryx268e54guvleu
Basically:
 - Refactored project structure (too much QML files in the same folder)
 - Added full content-hub support
 - Uri handler support
 - In-app browser
 - Document Viewer has now rw permissions in /home/stefano/Documents

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2014-2015 Canonical, Ltd.
 
3
 *
 
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.
 
7
 *
 
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.
 
12
 *
 
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/>.
 
15
 */
 
16
 
 
17
import QtQuick 2.3
 
18
import Ubuntu.Components 1.1
 
19
import QtQuick.Layouts 1.1
 
20
import Ubuntu.Components.Popups 1.0
 
21
 
 
22
PageHeadState {
 
23
    id: rootItem
 
24
 
 
25
    property Page targetPage
 
26
    head: targetPage.head
 
27
 
 
28
    backAction: Action {
 
29
        text: i18n.tr("Cancel")
 
30
        objectName: "cancelButton"
 
31
        iconName: "close"
 
32
        onTriggered: DOC_VIEWER.contentPickingCanceled()
 
33
    }
 
34
 
 
35
    actions: [
 
36
        Action {
 
37
            text: targetPage.useGridView ? i18n.tr("Switch to single column list") : i18n.tr("Switch to grid")
 
38
            iconName: targetPage.useGridView ? "view-list-symbolic" : "view-grid-symbolic"
 
39
            onTriggered: targetPage.useGridView = !targetPage.useGridView
 
40
 
 
41
            visible: folderModel.count !== 0
 
42
        },
 
43
 
 
44
        Action {
 
45
            text: i18n.tr("Pick")
 
46
            objectName: "pickButton"
 
47
            enabled: viewLoader.item.selectedItems.count > 0
 
48
            iconName: "ok"
 
49
            onTriggered: {
 
50
                if (!enabled)
 
51
                    return;
 
52
 
 
53
                var urlList = []
 
54
                var items = documentPage.view.item.selectedItems;
 
55
 
 
56
                for (var i=0; i < items.count; i++) {
 
57
                    urlList.push(items.get(i).model.path);
 
58
                }
 
59
 
 
60
                DOC_VIEWER.returnPickedContent(urlList);
 
61
            }
 
62
        }
 
63
    ]
 
64
}
 
65