2022-08-28 21:48:51 +00:00
|
|
|
/*
|
|
|
|
* Copyright 2013 Bhushan Shah <bhush94@gmail.com>
|
|
|
|
* Copyright 2015 Martin Klapetek <mklapetek@kde.org>
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
* modify it under the terms of the GNU General Public License as
|
|
|
|
* published by the Free Software Foundation; either version 2 of
|
|
|
|
* the License or (at your option) version 3 or any later version
|
|
|
|
* accepted by the membership of KDE e.V. (or its successor approved
|
|
|
|
* by the membership of KDE e.V.), which shall act as a proxy
|
|
|
|
* defined in Section 14 of version 3 of the license.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
|
|
*/
|
|
|
|
|
|
|
|
import QtQuick 2.0
|
|
|
|
import QtQml 2.2
|
|
|
|
|
2024-08-09 01:20:25 +00:00
|
|
|
import org.kde.plasma.plasmoid 2.0
|
2022-08-28 21:48:51 +00:00
|
|
|
import org.kde.plasma.configuration 2.0
|
2024-08-09 01:20:25 +00:00
|
|
|
import org.kde.plasma.workspace.calendar 2.0 as PlasmaCalendar
|
2022-08-28 21:48:51 +00:00
|
|
|
|
|
|
|
ConfigModel {
|
|
|
|
id: configModel
|
|
|
|
|
|
|
|
ConfigCategory {
|
|
|
|
name: i18n("Appearance")
|
|
|
|
icon: "preferences-desktop-color"
|
|
|
|
source: "configAppearance.qml"
|
|
|
|
}
|
|
|
|
ConfigCategory {
|
|
|
|
name: i18n("Calendar")
|
2024-08-09 01:20:25 +00:00
|
|
|
icon: "preferences-system-time"
|
2022-08-28 21:48:51 +00:00
|
|
|
source: "configCalendar.qml"
|
|
|
|
}
|
|
|
|
ConfigCategory {
|
|
|
|
name: i18n("Time Zones")
|
2024-08-09 01:20:25 +00:00
|
|
|
icon: "preferences-desktop-locale"
|
2022-08-28 21:48:51 +00:00
|
|
|
source: "configTimeZones.qml"
|
|
|
|
}
|
|
|
|
|
2024-08-09 01:20:25 +00:00
|
|
|
property QtObject eventPluginsManager: PlasmaCalendar.EventPluginsManager {
|
|
|
|
Component.onCompleted: {
|
|
|
|
populateEnabledPluginsList(Plasmoid.configuration.enabledCalendarPlugins);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2022-08-28 21:48:51 +00:00
|
|
|
property Instantiator __eventPlugins: Instantiator {
|
2024-08-09 01:20:25 +00:00
|
|
|
model: eventPluginsManager.model
|
2022-08-28 21:48:51 +00:00
|
|
|
delegate: ConfigCategory {
|
|
|
|
name: model.display
|
2024-08-09 01:20:25 +00:00
|
|
|
icon: { console.log(model.decoration); return model.decoration }
|
2022-08-28 21:48:51 +00:00
|
|
|
source: model.configUi
|
2024-08-09 01:20:25 +00:00
|
|
|
includeMargins: false
|
|
|
|
visible: Plasmoid.configuration.enabledCalendarPlugins.indexOf(model.pluginId) > -1
|
2022-08-28 21:48:51 +00:00
|
|
|
}
|
|
|
|
|
2024-08-09 01:20:25 +00:00
|
|
|
|
|
|
|
onObjectAdded: (index, object) => configModel.appendCategory(object)
|
|
|
|
onObjectRemoved: (index, object) => configModel.removeCategory(object)
|
|
|
|
//onObjectAdded: configModel.appendCategory(object)
|
|
|
|
//onObjectRemoved: configModel.removeCategory(object)
|
2022-08-28 21:48:51 +00:00
|
|
|
}
|
2024-08-09 01:20:25 +00:00
|
|
|
|
2022-08-28 21:48:51 +00:00
|
|
|
}
|