Warning, /pim/kube/framework/qml/CalendarSelector.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  *  Copyright (C) 2018 Michael Bohlender, <bohlender@kolabsys.com>
0003  *  Copyright (C) 2019 Christian Mollekopf, <mollekopf@kolabsys.com>
0004  *
0005  *  This program is free software; you can redistribute it and/or modify
0006  *  it under the terms of the GNU General Public License as published by
0007  *  the Free Software Foundation; either version 2 of the License, or
0008  *  (at your option) any later version.
0009  *
0010  *  This program is distributed in the hope that it will be useful,
0011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
0012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
0013  *  GNU General Public License for more details.
0014  *
0015  *  You should have received a copy of the GNU General Public License along
0016  *  with this program; if not, write to the Free Software Foundation, Inc.,
0017  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
0018  */
0019 
0020 import QtQuick 2.9
0021 import QtQuick.Controls 2
0022 import QtQuick.Layouts 1.2
0023 
0024 import org.kube.framework 1.0 as Kube
0025 
0026 Kube.EntitySelector {
0027     id: root
0028 
0029     property string contentType: "event"
0030 
0031     entityType: "calendar"
0032     roles: ["name", "color", "enabled"]
0033     sortRole: "name"
0034     filter: {"contentTypes": contentType}
0035 
0036     Kube.EntityController {
0037         id: entityController
0038     }
0039 
0040     onEntityCreated: {
0041         entityController.create({type: entityType, account: accountId, entity: {
0042             "name": text,
0043             "color": Kube.Colors.jazzberryJam,
0044             "contentTypes": [contentType],
0045             "enabled": true,
0046         }})
0047     }
0048 
0049     onEntityRemoved: {
0050         entityController.remove(entityType, entity)
0051     }
0052 }