Changeset View
Changeset View
Standalone View
Standalone View
kcms/ksplash/package/contents/ui/main.qml
Show All 25 Lines | |||||
26 | 26 | | |||
27 | KCM.GridViewKCM { | 27 | KCM.GridViewKCM { | ||
28 | KCM.ConfigModule.quickHelp: i18n("This module lets you choose the splash screen theme.") | 28 | KCM.ConfigModule.quickHelp: i18n("This module lets you choose the splash screen theme.") | ||
29 | 29 | | |||
30 | enabled: !kcm.testing | 30 | enabled: !kcm.testing | ||
31 | 31 | | |||
32 | view.model: kcm.splashModel | 32 | view.model: kcm.splashModel | ||
33 | //NOTE: pay attention to never break this binding | 33 | //NOTE: pay attention to never break this binding | ||
34 | view.currentIndex: kcm.selectedPluginIndex | 34 | view.currentIndex: kcm.pluginIndex(kcm.splashScreenSettings.theme) | ||
35 | 35 | | |||
36 | // putting the InlineMessage as header item causes it to show up initially despite visible false | 36 | // putting the InlineMessage as header item causes it to show up initially despite visible false | ||
37 | header: ColumnLayout { | 37 | header: ColumnLayout { | ||
38 | Kirigami.InlineMessage { | 38 | Kirigami.InlineMessage { | ||
39 | id: testingFailedLabel | 39 | id: testingFailedLabel | ||
40 | Layout.fillWidth: true | 40 | Layout.fillWidth: true | ||
41 | showCloseButton: true | 41 | showCloseButton: true | ||
42 | type: Kirigami.MessageType.Error | 42 | type: Kirigami.MessageType.Error | ||
Show All 23 Lines | 65 | actions: [ | |||
66 | Kirigami.Action { | 66 | Kirigami.Action { | ||
67 | visible: model.pluginName !== "None" | 67 | visible: model.pluginName !== "None" | ||
68 | iconName: "media-playback-start" | 68 | iconName: "media-playback-start" | ||
69 | tooltip: i18n("Preview Splash Screen") | 69 | tooltip: i18n("Preview Splash Screen") | ||
70 | onTriggered: kcm.test(model.pluginName) | 70 | onTriggered: kcm.test(model.pluginName) | ||
71 | } | 71 | } | ||
72 | ] | 72 | ] | ||
73 | onClicked: { | 73 | onClicked: { | ||
74 | kcm.selectedPlugin = model.pluginName; | 74 | kcm.splashScreenSettings.theme = model.pluginName; | ||
75 | view.forceActiveFocus(); | 75 | view.forceActiveFocus(); | ||
76 | } | 76 | } | ||
77 | } | 77 | } | ||
78 | 78 | | |||
79 | footer: RowLayout { | 79 | footer: RowLayout { | ||
80 | Item { | 80 | Item { | ||
81 | Layout.fillWidth: true | 81 | Layout.fillWidth: true | ||
82 | } | 82 | } | ||
83 | QtControls.Button { | 83 | QtControls.Button { | ||
84 | iconName: "get-hot-new-stuff" | 84 | iconName: "get-hot-new-stuff" | ||
85 | text: i18n("&Get New Splash Screens...") | 85 | text: i18n("&Get New Splash Screens...") | ||
86 | onClicked: kcm.getNewClicked(); | 86 | onClicked: kcm.getNewClicked(); | ||
87 | visible: KAuthorized.authorize("ghns") | 87 | visible: KAuthorized.authorize("ghns") | ||
88 | } | 88 | } | ||
89 | } | 89 | } | ||
90 | } | 90 | } |