Add passive notification on VPN connection failure

pull/1/head
Timothy Pearson 12 years ago
parent f285871c3c
commit 10dda38c1e

@ -7,7 +7,11 @@ Comment[sv]=Nätverkshantering
[tdenm-nm-vpn-banner] [tdenm-nm-vpn-banner]
Comment=VPN Banner Notification Received 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] [tdenm-nm-sleeping]
Name=TDENetworkManager Offline Name=TDENetworkManager Offline
@ -198,7 +202,7 @@ Comment[sr]=Нађен је нови мрежни уређај
Comment[sr@Latn]=Nađen je novi mrežni uređaj Comment[sr@Latn]=Nađen je novi mrežni uređaj
Comment[sv]=Ny nätverksenhet hittades Comment[sv]=Ny nätverksenhet hittades
Comment[tr]=Yeni ağ aygıtı bulundu Comment[tr]=Yeni ağ aygıtı bulundu
default_presentation=0 default_presentation=17
[tdenm-nm-device-removed] [tdenm-nm-device-removed]
Name=TDENetworkManager Device Removed Name=TDENetworkManager Device Removed
@ -236,7 +240,7 @@ Comment[sr]=Мрежни уређај је уклоњен
Comment[sr@Latn]=Mrežni uređaj je uklonjen Comment[sr@Latn]=Mrežni uređaj je uklonjen
Comment[sv]=Nätverksenhet borttagen Comment[sv]=Nätverksenhet borttagen
Comment[tr]=Ağ aygıtı kaldırıldı Comment[tr]=Ağ aygıtı kaldırıldı
default_presentation=0 default_presentation=17
[tdenm-nm-network-found] [tdenm-nm-network-found]
Name=TDENetworkManager New Wireless Network Found Name=TDENetworkManager New Wireless Network Found

@ -26,6 +26,8 @@
#include <kdebug.h> #include <kdebug.h>
#include <klocale.h> #include <klocale.h>
#include <kiconloader.h> #include <kiconloader.h>
#include <knotifyclient.h>
#include <knotifydialog.h>
// TDENM includes // TDENM includes
#include "vpn_tray_component.h" #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 ) VPNTrayComponent::VPNTrayComponent (KSystemTray * parent, const char * name )
: TrayComponent (parent, 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 //Actions used for plugging into the menu
new KAction (i18n ("New connection ..."), new KAction (i18n ("New connection ..."),
SmallIcon ("encrypted", TQIconSet::Automatic), 0, SmallIcon ("encrypted", TQIconSet::Automatic), 0,

@ -40,14 +40,17 @@ class VPNTrayComponent : public TrayComponent
public: public:
VPNTrayComponent (KSystemTray * parent = 0, const char * name = 0); VPNTrayComponent (KSystemTray * parent = 0, const char * name = 0);
~VPNTrayComponent (); ~VPNTrayComponent ();
void addMenuItems(KPopupMenu* menu); void addMenuItems(KPopupMenu* menu);
public slots: public slots:
void slotShowNewConnectionDialog(); void slotShowNewConnectionDialog();
private slots:
void vpnEventHandler(TDENetworkVPNEventType::TDENetworkVPNEventType event, TQString message);
private: private:
}; };

Loading…
Cancel
Save