[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/work/knetworkmanager/knetworkmanager-0.7/src
From:       Helmut Schaa <hschaa () suse ! de>
Date:       2008-06-16 8:57:36
Message-ID: 1213606656.512603.26553.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 821058 by hschaa:

Add offline notification again, add possibility to edit notifications


 M  +17 -1     knetworkmanager-tray.cpp  
 M  +1 -0      knetworkmanager-tray.h  


--- branches/work/knetworkmanager/knetworkmanager-0.7/src/knetworkmanager-tray.cpp #821057:821058
@@ -264,6 +264,10 @@
 		menu->insertItem (subhead, -1, -1);
 	}
 
+	// Notifications
+	KAction* notif = actionCollection()->action("configure_notifications");
+	notif->plug(menu);
+
 	// Connection Editor
 	KAction* edit = actionCollection ()->action ("edit_connections");
 	edit->plug(menu);
@@ -646,13 +650,21 @@
 		case NM_STATE_CONNECTED:
 			KNotifyClient::event( winId(), "knm-nm-connected", i18n("NetworkManager is now connected") );
 			break;
+		case NM_STATE_ASLEEP:
+			KNotifyClient::event( winId(), "knm-nm-sleeping", i18n("KNetworkManager Offline") );
+			break;
 		case NM_STATE_UNKNOWN:
-		case NM_STATE_ASLEEP:
+
 		default:
 			break;
 	}
 }
 
+void Tray::slotEditNotifications()
+{
+	KNotifyDialog::configure(this);
+}
+
 Tray::Tray () : KSystemTray ()
 {
 	d = new TrayPrivate(this);
@@ -683,6 +695,10 @@
 					     SmallIcon ("edit",  QIconSet::Automatic), 0,
 					     this, SLOT (slotEditConnections()), actionCollection (), "edit_connections");
 
+	new KAction (i18n ("Configure Notifications"),
+					     SmallIcon ("knotify",  QIconSet::Automatic), 0,
+					     this, SLOT (slotEditNotifications()), actionCollection (), "configure_notifications");
+
 	// this action is only connected when the menu is shown, hence the 0 receiver
 	new KAction (i18n ("New connection ..."),
 					     SmallIcon ("filenew",  QIconSet::Automatic), 0,
--- branches/work/knetworkmanager/knetworkmanager-0.7/src/knetworkmanager-tray.h #821057:821058
@@ -91,6 +91,7 @@
 		void trayComponentNeedsCenterStage(TrayComponent*, bool);
 		void slotUpdateDeviceState(NMDeviceState);
 		void trayUiChanged();
+		void slotEditNotifications();
 
 	private:
 		void updateTrayIcon(NMDeviceState);
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic