Changeset View
Changeset View
Standalone View
Standalone View
applets/digital-clock/package/contents/config/config.qml
Show All 14 Lines | |||||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
16 | * GNU General Public License for more details. | 16 | * GNU General Public License for more details. | ||
17 | * | 17 | * | ||
18 | * You should have received a copy of the GNU General Public License | 18 | * You should have received a copy of the GNU General Public License | ||
19 | * along with this program. If not, see <http://www.gnu.org/licenses/> | 19 | * along with this program. If not, see <http://www.gnu.org/licenses/> | ||
20 | */ | 20 | */ | ||
21 | 21 | | |||
22 | import QtQuick 2.0 | 22 | import QtQuick 2.0 | ||
23 | import QtQml 2.2 | ||||
23 | 24 | | |||
24 | import org.kde.plasma.configuration 2.0 | 25 | import org.kde.plasma.configuration 2.0 | ||
25 | import org.kde.plasma.calendar 2.0 as PlasmaCalendar | 26 | import org.kde.plasma.calendar 2.0 as PlasmaCalendar | ||
26 | 27 | | |||
27 | ConfigModel { | 28 | ConfigModel { | ||
28 | id: configModel | 29 | id: configModel | ||
29 | 30 | | |||
30 | ConfigCategory { | 31 | ConfigCategory { | ||
31 | name: i18n("Appearance") | 32 | name: i18n("Appearance") | ||
32 | icon: "preferences-desktop-color" | 33 | icon: "preferences-desktop-color" | ||
33 | source: "configAppearance.qml" | 34 | source: "configAppearance.qml" | ||
34 | } | 35 | } | ||
35 | ConfigCategory { | 36 | ConfigCategory { | ||
36 | name: i18n("Calendar") | 37 | name: i18n("Calendar") | ||
37 | icon: "view-calendar" | 38 | icon: "view-calendar" | ||
38 | source: "configCalendar.qml" | 39 | source: "configCalendar.qml" | ||
39 | } | 40 | } | ||
40 | ConfigCategory { | 41 | ConfigCategory { | ||
41 | name: i18n("Time Zones") | 42 | name: i18n("Time Zones") | ||
42 | icon: "preferences-system-time" | 43 | icon: "preferences-system-time" | ||
43 | source: "configTimeZones.qml" | 44 | source: "configTimeZones.qml" | ||
44 | } | 45 | } | ||
45 | 46 | | |||
46 | Component.onCompleted: { | 47 | property Instantiator __eventPlugins: Instantiator { | ||
47 | var model = PlasmaCalendar.EventPluginsManager.model; | 48 | model: PlasmaCalendar.EventPluginsManager.model | ||
48 | 49 | delegate: ConfigCategory { | |||
49 | for (var i = 0; i < model.rowCount(); i++) { | 50 | name: model.display | ||
50 | //FIXME: this check doesn't work because the engines | 51 | icon: model.decoration | ||
51 | // of the applet and the config are not shared | 52 | source: model.configUi | ||
52 | // if (model.get(i, "checked") == true) { | 53 | visible: plasmoid.configuration.enabledCalendarPlugins.indexOf(model.pluginPath) > -1 | ||
53 | configModel.appendCategory(model.get(i, "decoration"), | | |||
54 | model.get(i, "display"), | | |||
55 | model.get(i, "configUi"), | | |||
56 | "", | | |||
57 | true); | | |||
58 | // } | | |||
59 | } | 54 | } | ||
55 | | ||||
56 | onObjectAdded: configModel.appendCategory(object) | ||||
57 | onObjectRemoved: configModel.removeCategory(object) | ||||
60 | } | 58 | } | ||
61 | } | 59 | } |