~bfiller/gallery-app/revert-1245

« back to all changes in this revision

Viewing changes to rc/qml/Utility/PhotosToolbarActions.qml

  • Committer: Bill Filler
  • Date: 2015-11-10 02:39:01 UTC
  • Revision ID: bill.filler@canonical.com-20151110023901-h0w20x8dyznnzldy
revert back to rev 1242

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright (C) 2013 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 version 3 as
 
6
 * published by the Free Software Foundation.
 
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.0
 
18
import Ubuntu.Components 0.1
 
19
 
 
20
/*!
 
21
  The actions for the toolbar for the event and photos view
 
22
  */
 
23
ToolbarItems {
 
24
    id: root
 
25
    /// The selection state item to use for enable / disable the select mode
 
26
    property SelectionState selection: null
 
27
 
 
28
    /// Emittedt when the camera action was triggered
 
29
    signal startCamera()
 
30
 
 
31
    ToolbarButton {
 
32
        action: Action {
 
33
            objectName: "selectButton"
 
34
            text: i18n.tr("Select")
 
35
            iconSource: Qt.resolvedUrl("../../img/select.png")
 
36
            enabled: root.selection !== null
 
37
            onTriggered: root.selection.inSelectionMode = true;
 
38
        }
 
39
    }
 
40
    ToolbarButton {
 
41
        objectName: "importButton"
 
42
        action: Action {
 
43
            text: i18n.tr("Import")
 
44
            iconSource: Qt.resolvedUrl("../../img/import-image.png")
 
45
            visible: false
 
46
        }
 
47
    }
 
48
    ToolbarButton {
 
49
        action: Action {
 
50
            objectName: "cameraButton"
 
51
            text: i18n.tr("Camera")
 
52
            visible: !APP.desktopMode
 
53
            iconSource: Qt.resolvedUrl("../../img/camera.png")
 
54
            onTriggered: Qt.openUrlExternally("appid://com.ubuntu.camera/camera/current-user-version")
 
55
        }
 
56
    }
 
57
}