summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tdenetworkmanager/src/eventsrc10
-rw-r--r--tdenetworkmanager/src/vpn_tray_component.cpp15
-rw-r--r--tdenetworkmanager/src/vpn_tray_component.h7
3 files changed, 27 insertions, 5 deletions
diff --git a/tdenetworkmanager/src/eventsrc b/tdenetworkmanager/src/eventsrc
index 16438de..6d8ec24 100644
--- a/tdenetworkmanager/src/eventsrc
+++ b/tdenetworkmanager/src/eventsrc
@@ -7,7 +7,11 @@ Comment[sv]=Nätverkshantering
[tdenm-nm-vpn-banner]
Comment=VPN Banner Notification Received
-default_presentation=0
+default_presentation=17
+
+[tdenm-nm-vpn-connection-attempt-failed]
+Name=VPN Connection Attempt Failed
+default_presentation=17
[tdenm-nm-sleeping]
Name=TDENetworkManager Offline
@@ -198,7 +202,7 @@ Comment[sr]=Нађен је нови мрежни уређај
Comment[sr@Latn]=Nađen je novi mrežni uređaj
Comment[sv]=Ny nätverksenhet hittades
Comment[tr]=Yeni ağ aygıtı bulundu
-default_presentation=0
+default_presentation=17
[tdenm-nm-device-removed]
Name=TDENetworkManager Device Removed
@@ -236,7 +240,7 @@ Comment[sr]=Мрежни уређај је уклоњен
Comment[sr@Latn]=Mrežni uređaj je uklonjen
Comment[sv]=Nätverksenhet borttagen
Comment[tr]=Ağ aygıtı kaldırıldı
-default_presentation=0
+default_presentation=17
[tdenm-nm-network-found]
Name=TDENetworkManager New Wireless Network Found
diff --git a/tdenetworkmanager/src/vpn_tray_component.cpp b/tdenetworkmanager/src/vpn_tray_component.cpp
index cc696b7..421f0e9 100644
--- a/tdenetworkmanager/src/vpn_tray_component.cpp
+++ b/tdenetworkmanager/src/vpn_tray_component.cpp
@@ -26,6 +26,8 @@
#include <kdebug.h>
#include <klocale.h>
#include <kiconloader.h>
+#include <knotifyclient.h>
+#include <knotifydialog.h>
// TDENM includes
#include "vpn_tray_component.h"
@@ -161,9 +163,22 @@ void VPNTrayComponent::addMenuItems(KPopupMenu* menu)
}
}
+void VPNTrayComponent::vpnEventHandler(TDENetworkVPNEventType::TDENetworkVPNEventType event, TQString message) {
+ kdDebug() << "Tray::vpnEventHandler" << endl;
+
+ if (event == TDENetworkVPNEventType::Failure) {
+ KNotifyClient::event( tray()->winId(), "tdenm-nm-vpn-connection-attempt-failed", i18n(message) );
+ }
+}
+
VPNTrayComponent::VPNTrayComponent (KSystemTray * parent, const char * name )
: TrayComponent (parent, name)
{
+ TDEGlobalNetworkManager* nm = KGlobal::networkManager();
+
+ // Monitor VPN messages
+ connect(nm, SIGNAL(vpnEvent(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)), this, SLOT(vpnEventHandler(TDENetworkVPNEventType::TDENetworkVPNEventType, TQString)));
+
//Actions used for plugging into the menu
new KAction (i18n ("New connection ..."),
SmallIcon ("encrypted", TQIconSet::Automatic), 0,
diff --git a/tdenetworkmanager/src/vpn_tray_component.h b/tdenetworkmanager/src/vpn_tray_component.h
index 3f1af35..56b6e93 100644
--- a/tdenetworkmanager/src/vpn_tray_component.h
+++ b/tdenetworkmanager/src/vpn_tray_component.h
@@ -40,14 +40,17 @@ class VPNTrayComponent : public TrayComponent
public:
- VPNTrayComponent (KSystemTray * parent = 0, const char * name = 0);
- ~VPNTrayComponent ();
+ VPNTrayComponent (KSystemTray * parent = 0, const char * name = 0);
+ ~VPNTrayComponent ();
void addMenuItems(KPopupMenu* menu);
public slots:
void slotShowNewConnectionDialog();
+ private slots:
+ void vpnEventHandler(TDENetworkVPNEventType::TDENetworkVPNEventType event, TQString message);
+
private:
};