~seb128/gallery-app/delete-dialogs-tweaks

« back to all changes in this revision

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

  • Committer: CI Train Bot
  • Author(s): Arthur Mello
  • Date: 2015-11-06 14:05:15 UTC
  • mfrom: (1241.1.30 gallery-app-sdk_1_3)
  • Revision ID: ci-train-bot@canonical.com-20151106140515-y27n4x5nt1ajn3jy
Update QML code to work with Ubuntu.Components 1.3 Fixes: #1508363
Approved by: Renato Araujo Oliveira Filho

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
 
import Ubuntu.Components.Popups 0.1
20
 
 
21
 
/*!
22
 
  The actions for the toolbar for the event and photos view in select mode
23
 
  */
24
 
ToolbarItems {
25
 
    id: root
26
 
    /// The selection state item
27
 
    property SelectionState selection: null
28
 
 
29
 
    /// Emitted when cancel was clicked
30
 
    signal cancelClicked()
31
 
    /// Emitted when add was clicked
32
 
    /// @param caller the item that caused the call (was clicked)
33
 
    signal addClicked(var caller)
34
 
    ///Emitted when delete was clicked
35
 
    signal deleteClicked()
36
 
    ///Emitted when share was clicked
37
 
    signal shareClicked()
38
 
 
39
 
    // in selection mode, never hide the toolbar:
40
 
    opened: true
41
 
    locked: true
42
 
 
43
 
    ToolbarButton {
44
 
        id: addButton
45
 
        objectName: "addButton"
46
 
        action: Action {
47
 
            text: i18n.tr("Add")
48
 
            iconName: "add"
49
 
            enabled: root.selection.selectedCount > 0
50
 
            onTriggered: root.addClicked(addButton);
51
 
        }
52
 
    }
53
 
    ToolbarButton {
54
 
        action: Action {
55
 
            objectName: "deleteButton"
56
 
            text: i18n.tr("Delete")
57
 
            iconName: "delete"
58
 
            enabled: root.selection.selectedCount > 0
59
 
            onTriggered:root.deleteClicked();
60
 
        }
61
 
    }
62
 
    ToolbarButton {
63
 
        action: Action {
64
 
            objectName: "shareButton"
65
 
            text: i18n.tr("Share")
66
 
            iconName: "share"
67
 
            enabled: root.selection.selectedMediaCount == 1
68
 
            onTriggered: root.shareClicked();
69
 
        }
70
 
    }
71
 
 
72
 
    back:  Button {
73
 
        objectName: "cancelButton"
74
 
        action: Action {
75
 
            text: i18n.tr("Cancel")
76
 
            iconName: "back"
77
 
            onTriggered: {
78
 
                root.cancelClicked();
79
 
            }
80
 
        }
81
 
    }
82
 
}