Changeset View
Changeset View
Standalone View
Standalone View
kcms/notifications/package/contents/ui/main.qml
Show All 20 Lines | |||||
21 | import QtQuick 2.9 | 21 | import QtQuick 2.9 | ||
22 | import QtQuick.Layouts 1.1 | 22 | import QtQuick.Layouts 1.1 | ||
23 | import QtQuick.Controls 2.3 as QtControls | 23 | import QtQuick.Controls 2.3 as QtControls | ||
24 | import org.kde.kirigami 2.4 as Kirigami | 24 | import org.kde.kirigami 2.4 as Kirigami | ||
25 | import org.kde.kcm 1.2 as KCM | 25 | import org.kde.kcm 1.2 as KCM | ||
26 | 26 | | |||
27 | import org.kde.notificationmanager 1.0 as NotificationManager | 27 | import org.kde.notificationmanager 1.0 as NotificationManager | ||
28 | 28 | | |||
29 | import org.kde.private.kcms.notifications 1.0 as Private | ||||
30 | | ||||
29 | KCM.SimpleKCM { | 31 | KCM.SimpleKCM { | ||
30 | id: root | 32 | id: root | ||
33 | | ||||
31 | KCM.ConfigModule.quickHelp: i18n("This module lets you manage application and system notifications.") | 34 | KCM.ConfigModule.quickHelp: i18n("This module lets you manage application and system notifications.") | ||
32 | KCM.ConfigModule.buttons: KCM.ConfigModule.Help | KCM.ConfigModule.Apply | 35 | KCM.ConfigModule.buttons: KCM.ConfigModule.Help | KCM.ConfigModule.Apply | ||
33 | // Sidebar on SourcesPage is 1/3 of the width at a minimum of 12, so assume 3 * 12 = 36 as preferred | 36 | // Sidebar on SourcesPage is 1/3 of the width at a minimum of 12, so assume 3 * 12 = 36 as preferred | ||
34 | implicitWidth: Kirigami.Units.gridUnit * 36 | 37 | implicitWidth: Kirigami.Units.gridUnit * 36 | ||
35 | 38 | | |||
36 | function openSourcesSettings() { | 39 | function openSourcesSettings() { | ||
37 | // TODO would be nice to re-use the current SourcesPage instead of pushing a new one that lost all state | 40 | // TODO would be nice to re-use the current SourcesPage instead of pushing a new one that lost all state | ||
38 | // but there's no pageAt(index) method in KConfigModuleQml | 41 | // but there's no pageAt(index) method in KConfigModuleQml | ||
39 | kcm.push("SourcesPage.qml"); | 42 | kcm.push("SourcesPage.qml"); | ||
40 | } | 43 | } | ||
41 | 44 | | |||
42 | Binding { | 45 | Binding { | ||
43 | target: kcm | 46 | target: kcm | ||
44 | property: "needsSave" | 47 | property: "needsSave" | ||
45 | value: kcm.settings.dirty // TODO or other stuff | 48 | value: kcm.settings.dirty // TODO or other stuff | ||
46 | } | 49 | } | ||
47 | 50 | | |||
48 | Kirigami.FormLayout { | 51 | Kirigami.FormLayout { | ||
52 | Kirigami.InlineMessage { | ||||
53 | Kirigami.FormData.isSection: true | ||||
54 | Layout.fillWidth: true | ||||
55 | type: Kirigami.MessageType.Error | ||||
56 | text: i18n("Could not find a 'Notifications' widget."); | ||||
ngraham: Maybe connect this with the reason why one the widget is needed:
"Could not find a… | |||||
57 | visible: kcm.serverStatus === Private.KCM.NotRunning | ||||
58 | } | ||||
59 | | ||||
60 | Kirigami.InlineMessage { | ||||
61 | Kirigami.FormData.isSection: true | ||||
62 | Layout.fillWidth: true | ||||
63 | type: Kirigami.MessageType.Information | ||||
64 | text: i18n("Notifications are currently provided by '%1' instead of Plasma.", kcm.serverName) | ||||
65 | visible: kcm.serverStatus === Private.KCM.Running && (kcm.serverVendor !== "KDE" || kcm.serverName !== "Plasma") | ||||
66 | } | ||||
67 | | ||||
49 | QtControls.CheckBox { | 68 | QtControls.CheckBox { | ||
50 | Kirigami.FormData.label: i18n("Do not disturb:") | 69 | Kirigami.FormData.label: i18n("Do not disturb:") | ||
51 | text: i18nc("Do not disturb when screens are mirrored", "When screens are mirrored") | 70 | text: i18nc("Do not disturb when screens are mirrored", "When screens are mirrored") | ||
52 | checked: kcm.settings.inhibitNotificationsWhenScreensMirrored | 71 | checked: kcm.settings.inhibitNotificationsWhenScreensMirrored | ||
53 | onClicked: kcm.settings.inhibitNotificationsWhenScreensMirrored = checked | 72 | onClicked: kcm.settings.inhibitNotificationsWhenScreensMirrored = checked | ||
54 | } | 73 | } | ||
55 | 74 | | |||
56 | QtControls.CheckBox { | 75 | QtControls.CheckBox { | ||
▲ Show 20 Lines • Show All 137 Lines • Show Last 20 Lines |
Maybe connect this with the reason why one the widget is needed:
"Could not find a 'Notifications' widget which is required for displaying notifications."