~bfiller/gallery-app/revert-1245

« back to all changes in this revision

Viewing changes to rc/qml/EventsOverview.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
1
/*
2
 
 * Copyright (C) 2012-2015 Canonical Ltd
 
2
 * Copyright (C) 2012 Canonical Ltd
3
3
 *
4
4
 * This program is free software: you can redistribute it and/or modify
5
5
 * it under the terms of the GNU General Public License version 3 as
14
14
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
15
15
 */
16
16
 
17
 
import QtQuick 2.4
18
 
import Ubuntu.Components 1.3
19
 
import Ubuntu.Components.Popups 1.3
 
17
import QtQuick 2.0
 
18
import Ubuntu.Components 0.1
 
19
import Ubuntu.Components.Popups 0.1
20
20
import Gallery 1.0
21
 
import Ubuntu.Content 1.3
 
21
import Ubuntu.Content 0.1
22
22
import "Components"
23
23
import "OrganicView"
24
24
import "Utility"
102
102
        }
103
103
    }
104
104
 
105
 
    property list<Action> overviewActions: [
106
 
        Action {
107
 
            objectName: "selectButton"
108
 
            text: i18n.tr("Select")
109
 
            iconName: "select"
110
 
            enabled: selection !== null
111
 
            onTriggered: selection.inSelectionMode = true;
112
 
        },
113
 
        Action {
114
 
            objectName: "cameraButton"
115
 
            text: i18n.tr("Camera")
116
 
            visible: !APP.desktopMode
117
 
            iconName: "camera-app-symbolic"
118
 
            onTriggered: Qt.openUrlExternally("appid://com.ubuntu.camera/camera/current-user-version")
119
 
        }
120
 
    ]
121
 
 
122
 
    property list<Action> selectActions: [
123
 
        Action {
124
 
            id: addButton
125
 
            objectName: "addButton"
126
 
 
127
 
            text: i18n.tr("Add")
128
 
            iconName: "add"
129
 
            enabled: selection.selectedCount > 0
130
 
            onTriggered: __albumPicker = PopupUtils.open(Qt.resolvedUrl("Components/PopupAlbumPicker.qml"),
131
 
                                                         null,
132
 
                                                         {contentHeight: organicEventView.__pickerContentHeight});
133
 
 
134
 
        },
135
 
        Action {
136
 
            objectName: "deleteButton"
137
 
 
138
 
            text: i18n.tr("Delete")
139
 
            iconName: "delete"
140
 
            enabled: selection.selectedCount > 0
141
 
            onTriggered: PopupUtils.open(deleteDialog, null);
142
 
        },
143
 
        Action {
144
 
            objectName: "shareButton"
145
 
            text: i18n.tr("Share")
146
 
            iconName: "share"
147
 
            enabled: selection.selectedMediaCount == 1
148
 
            onTriggered: {
149
 
                overview.pushPage(sharePicker)
150
 
                sharePicker.visible = true;
151
 
            }
152
 
        }
153
 
    ]
154
 
 
155
 
    property Action selectBackAction: Action {
156
 
        text: i18n.tr("Cancel")
157
 
        iconName: "back"
158
 
        onTriggered: organicEventView.leaveSelectionMode();
159
 
    } 
 
105
    property Item overviewTools: PhotosToolbarActions {
 
106
        selection: organicEventView.selection
 
107
    }
160
108
 
161
109
    property int __pickerContentHeight: height - units.gu(20)
162
110
    property PopupAlbumPicker __albumPicker
168
116
        }
169
117
    }
170
118
 
 
119
    property Item selectionTools: SelectionToolbarAction {
 
120
        selection: organicEventView.selection
 
121
 
 
122
        onCancelClicked: {
 
123
            organicEventView.leaveSelectionMode();
 
124
        }
 
125
        onAddClicked: {
 
126
            __albumPicker = PopupUtils.open(Qt.resolvedUrl("Components/PopupAlbumPicker.qml"),
 
127
                                            null,
 
128
                                            {contentHeight: organicEventView.__pickerContentHeight});
 
129
        }
 
130
        onDeleteClicked: {
 
131
            PopupUtils.open(deleteDialog, null);
 
132
        }
 
133
 
 
134
        onShareClicked: {
 
135
            overview.pushPage(sharePicker);
 
136
            sharePicker.visible = true;
 
137
        }
 
138
    }
 
139
 
171
140
    property bool selectionMode: selection.inSelectionMode
172
 
 
173
 
    head.actions: selectionMode ? selectActions : overviewActions
174
 
    head.backAction: selectionMode ? selectBackAction : null
 
141
    tools: selectionMode ? selectionTools : overviewTools
175
142
 
176
143
    Component {
177
144
        id: contentItemComp