Warning, /pim/kdepim-addons/plugins/plasma/pimeventsplugin/PimEventsConfig.qml is written in an unsupported language. File is not indexed.

0001 /*
0002  * SPDX-FileCopyrightText: 2016 Daniel Vrátil <dvratil@kde.org>
0003  *
0004  * SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005  */
0006 
0007 import QtQuick
0008 import QtQuick.Layouts
0009 import QtQuick.Controls as QQC2
0010 import org.kde.plasma.PimCalendars
0011 import org.kde.kirigamiaddons.delegates as Delegates
0012 import org.kde.kitemmodels
0013 import org.kde.kirigami as Kirigami
0014 import org.kde.kcmutils as KCMUtils
0015 
0016 KCMUtils.ScrollViewKCM {
0017     id: pimEventsConfig
0018 
0019     signal configurationChanged
0020 
0021     function saveConfig() {
0022         calendarModel.saveConfig();
0023     }
0024 
0025     view: ListView {
0026         currentIndex: -1
0027 
0028         clip: true // Avoid visual glitches
0029         focus: true // keyboard navigation
0030         activeFocusOnTab: true // keyboard navigation
0031 
0032         model: KDescendantsProxyModel {
0033             model: PimCalendarsModel {
0034                 id: calendarModel
0035             }
0036         }
0037 
0038         delegate: Delegates.RoundedTreeDelegate {
0039             id: collection
0040 
0041             required property int collectionId
0042             required property string name
0043             required property string iconName
0044 
0045             icon.name: iconName
0046             text: name
0047 
0048             contentItem: RowLayout {
0049                 QQC2.CheckBox {
0050                     id: checkbox
0051                     visible: collection.enabled
0052                     checked: collection.checked
0053                     onCheckedChanged: {
0054                         if (checked === collection.checked) {
0055                             return;
0056                         }
0057                         calendarModel.setChecked(collection.collectionId, checked);
0058                         pimEventsConfig.configurationChanged();
0059                     }
0060                 }
0061 
0062                 Delegates.DefaultContentItem {
0063                     itemDelegate: collection
0064                 }
0065             }
0066         }
0067     }
0068 }