2
* Copyright (C) 2013-2014 Canonical Ltd
4
* This file is part of Ubuntu Calendar App
6
* Ubuntu Calendar App is free software: you can redistribute it and/or modify
7
* it under the terms of the GNU General Public License version 3 as
8
* published by the Free Software Foundation.
10
* Ubuntu Calendar App is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
15
* You should have received a copy of the GNU General Public License
16
* along with this program. If not, see <http://www.gnu.org/licenses/>.
19
import Ubuntu.Components 1.1
20
import Ubuntu.Components.Popups 1.0
21
import Ubuntu.Components.ListItems 1.0 as ListItem
22
import QtOrganizer 5.0
29
signal collectionUpdated();
32
title: i18n.tr("Calendars")
39
root.collectionUpdated();
45
head.actions: Action {
46
iconName: "contact-group"
47
objectName: "contactGroup"
48
text: i18n.tr("Accounts")
50
Qt.openUrlExternally("settings:///online-accounts")
59
model : root.model.getCollections();
60
delegate: ListItem.Standard {
67
height: width - units.gu(2)
71
leftMargin: units.gu(2)
72
verticalCenter: parent.verticalCenter
75
color: modelData.color
76
opacity: checkBox.checked ? 1.0 : 0.8
82
var dialog = PopupUtils.open(Qt.resolvedUrl("ColorPickerDialog.qml"),root);
83
dialog.accepted.connect(function(color) {
84
var collection = root.model.collection(modelData.collectionId);
85
collection.color = color;
86
root.model.saveCollection(collection);
94
elide: Text.ElideRight
95
opacity: checkBox.checked ? 1.0 : 0.8
96
color: UbuntuColors.midAubergine
97
width: parent.width - calendarColorCode.width - checkBox.width - units.gu(6) /*margins*/
99
left: calendarColorCode.right
101
verticalCenter: parent.verticalCenter
107
checked: modelData.extendedMetaData("collection-selected")
108
enabled: !root.isInEditMode
110
modelData.setExtendedMetaData("collection-selected",checkBox.checked)
111
var collection = root.model.collection(modelData.collectionId);
112
root.model.saveCollection(collection);