desktop/kdebase-workspace/feature_history-notifications-enable-disable-kde#119207.patch.disabled

170 lines
6.7 KiB
Plaintext

diff -Naur kdebase-workspace-4.3.98.orig/plasma/generic/applets/systemtray/ui/applet.cpp kdebase-workspace-4.3.98/plasma/generic/applets/systemtray/ui/applet.cpp
--- kdebase-workspace-4.3.98.orig/plasma/generic/applets/systemtray/ui/applet.cpp 2010-01-31 20:30:44.000000000 +0100
+++ kdebase-workspace-4.3.98/plasma/generic/applets/systemtray/ui/applet.cpp 2010-02-01 22:39:20.000000000 +0100
@@ -189,7 +189,7 @@
m_taskArea->setAlwaysShownTypes(alwaysShownTypes);
m_shownCategories.clear();
-
+
if (cg.readEntry("ShowApplicationStatus", true)) {
m_shownCategories.insert(Task::ApplicationStatus);
}
@@ -216,6 +216,9 @@
KConfigGroup globalCg = globalConfig();
bool createExtenderTask = false;
+
+ m_notificationsHistory = globalCg.readEntry("NotificationsHistory", true);
+
if (globalCg.readEntry("ShowJobs", true)) {
createExtenderTask = true;
createJobGroups();
@@ -275,7 +278,7 @@
return;
}
- if (s_manager->notifications().count() > 0) {
+ if (s_manager->notifications().count() > 0 && m_notificationsHistory) {
if (!extender()->group("oldNotificationsGroup")) {
Plasma::ExtenderGroup *group = new Plasma::ExtenderGroup(extender());
group->setName("oldNotificationsGroup");
@@ -578,6 +581,7 @@
m_notificationUi.showJobs->setChecked(globalCg.readEntry("ShowJobs", true));
m_notificationUi.showNotifications->setChecked(globalCg.readEntry("ShowNotifications", true));
+ m_notificationUi.notificationsHistory->setChecked(globalCg.readEntry("NotificationsHistory", true));
m_notificationUi.showApplicationStatus->setChecked(globalCg.readEntry("ShowApplicationStatus", true));
m_notificationUi.showCommunications->setChecked(globalCg.readEntry("ShowCommunications", true));
@@ -681,6 +685,7 @@
KConfigGroup globalCg = globalConfig();
globalCg.writeEntry("ShowJobs", m_notificationUi.showJobs->isChecked());
globalCg.writeEntry("ShowNotifications", m_notificationUi.showNotifications->isChecked());
+ globalCg.writeEntry("NotificationsHistory", m_notificationUi.notificationsHistory->isChecked());
globalCg.writeEntry("ShowApplicationStatus", m_notificationUi.showApplicationStatus->isChecked());
globalCg.writeEntry("ShowCommunications", m_notificationUi.showCommunications->isChecked());
globalCg.writeEntry("ShowSystemServices", m_notificationUi.showSystemServices->isChecked());
@@ -749,40 +754,42 @@
} else {
showPopup(m_autoHideTimeout);
}
-
-
- bool found = false;
- for (int i = 0; i < m_notificationBar.data()->count(); ++i) {
- if (m_notificationBar.data()->tabText(i) == notification->applicationName()) {
- found = true;
- break;
- }
- }
-
- QList<Notification *> &appNotifications = m_notificationsForApp[notification->applicationName()];
- if (!appNotifications.contains(notification)) {
- appNotifications.append(notification);
- //FIXME: arbitrary limit
- if (appNotifications.count() > 10) {
- Notification *oldNotification = appNotifications.first();
- appNotifications.pop_front();
- oldNotification->deleteLater();
- }
+
+ if (m_notificationsHistory) {
+
+ bool found = false;
+ for (int i = 0; i < m_notificationBar.data()->count(); ++i) {
+ if (m_notificationBar.data()->tabText(i) == notification->applicationName()) {
+ found = true;
+ break;
+ }
+ }
+
+ QList<Notification *> &appNotifications = m_notificationsForApp[notification->applicationName()];
+ if (!appNotifications.contains(notification)) {
+ appNotifications.append(notification);
+ //FIXME: arbitrary limit
+ if (appNotifications.count() > 10) {
+ Notification *oldNotification = appNotifications.first();
+ appNotifications.pop_front();
+ oldNotification->deleteLater();
+ }
+ }
+
+ if (!m_recentNotifications.contains(notification)) {
+ m_recentNotifications.append(notification);
+ while (m_recentNotifications.count() > 10) {
+ Notification *oldNotification = m_recentNotifications.first();
+ m_recentNotifications.pop_front();
+ oldNotification->hide();
+ }
+ }
+
+ if (!found) {
+ m_notificationBar.data()->addTab(notification->applicationIcon(), notification->applicationName());
+ }
}
-
- if (!m_recentNotifications.contains(notification)) {
- m_recentNotifications.append(notification);
- while (m_recentNotifications.count() > 10) {
- Notification *oldNotification = m_recentNotifications.first();
- m_recentNotifications.pop_front();
- oldNotification->hide();
- }
- }
-
- if (!found) {
- m_notificationBar.data()->addTab(notification->applicationIcon(), notification->applicationName());
- }
-
+
disconnect(notification, 0, this, 0);
connect(notification, SIGNAL(notificationDestroyed(SystemTray::Notification *)), this, SLOT(notificationDestroyed(SystemTray::Notification *)));
diff -Naur kdebase-workspace-4.3.98.orig/plasma/generic/applets/systemtray/ui/applet.h kdebase-workspace-4.3.98/plasma/generic/applets/systemtray/ui/applet.h
--- kdebase-workspace-4.3.98.orig/plasma/generic/applets/systemtray/ui/applet.h 2010-01-20 00:19:14.000000000 +0100
+++ kdebase-workspace-4.3.98/plasma/generic/applets/systemtray/ui/applet.h 2010-02-01 22:39:20.000000000 +0100
@@ -113,6 +113,7 @@
JobTotalsWidget *m_jobSummaryWidget;
int m_autoHideTimeout;
int m_timerId;
+ bool m_notificationsHistory;
QHash<QString, QList<Notification*> > m_notificationsForApp;
QList<Notification*> m_recentNotifications;
diff -Naur kdebase-workspace-4.3.98.orig/plasma/generic/applets/systemtray/ui/protocols.ui kdebase-workspace-4.3.98/plasma/generic/applets/systemtray/ui/protocols.ui
--- kdebase-workspace-4.3.98.orig/plasma/generic/applets/systemtray/ui/protocols.ui 2009-09-16 13:40:54.000000000 +0200
+++ kdebase-workspace-4.3.98/plasma/generic/applets/systemtray/ui/protocols.ui 2010-02-01 22:39:20.000000000 +0100
@@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>213</width>
- <height>236</height>
+ <width>455</width>
+ <height>498</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@@ -158,6 +158,20 @@
</property>
</spacer>
</item>
+ <item row="5" column="0">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string>Notifications history</string>
+ </property>
+ </widget>
+ </item>
+ <item row="5" column="1">
+ <widget class="QCheckBox" name="notificationsHistory">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
<resources/>