Commit 41e27fa5 authored by Kai Uwe Broulik's avatar Kai Uwe Broulik 🍇
Browse files

[Notifications KCM] Add "Other Applications" category

Settings in there will influence all non-identifyable applications.

Differential Revision: https://phabricator.kde.org/D26161
parent ae8732ed
......@@ -35,6 +35,8 @@ ColumnLayout {
property var rootIndex
readonly property string otherAppsId: "@other"
readonly property string appDisplayName: kcm.sourcesModel.data(rootIndex, Qt.DisplayRole) || ""
readonly property string appIconName: kcm.sourcesModel.data(rootIndex, Qt.DecorationRole) || ""
readonly property string desktopEntry: kcm.sourcesModel.data(rootIndex, Private.SourcesModel.DesktopEntryRole) || ""
......@@ -117,13 +119,14 @@ ColumnLayout {
QtControls.CheckBox {
text: i18n("Show notification badges")
enabled: !!configColumn.desktopEntry
enabled: !!configColumn.desktopEntry && configColumn.desktopEntry !== configColumn.otherAppsId
checked: configColumn.behavior & NotificationManager.Settings.ShowBadges
onClicked: configColumn.setBehavior(NotificationManager.Settings.ShowBadges, checked)
}
Kirigami.Separator {
Kirigami.FormData.isSection: true
visible: configureEventsButton.visible || noEventsLabel.visible
}
QtControls.Button {
......@@ -136,11 +139,12 @@ ColumnLayout {
}
QtControls.Label {
id: noEventsLabel
Layout.alignment: Qt.AlignHCenter
Layout.preferredWidth: form.implicitWidth
text: i18n("This application does not support configuring notifications on a per-event basis.");
wrapMode: Text.WordWrap
visible: !configColumn.notifyRcName
visible: !configColumn.notifyRcName && configColumn.desktopEntry !== configColumn.otherAppsId
}
// compact layout
......
......@@ -31,6 +31,7 @@
#include <KConfig>
#include <KConfigGroup>
#include <KLocalizedString>
#include <KSharedConfig>
#include <KService>
#include <KServiceTypeTrader>
......@@ -346,6 +347,17 @@ void SourcesModel::load()
};
std::sort(appsData.begin(), appsData.end(), sortData);
// Fake entry for configuring non-identifyable applications
appsData << SourceData{
i18n("Other Applications"),
{},
QStringLiteral("applications-other"),
QString(),
QStringLiteral("@other"),
{}
};
std::sort(servicesData.begin(), servicesData.end(), sortData);
m_data << appsData << servicesData;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment