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]
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

@ -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,

@ -48,6 +48,9 @@ class VPNTrayComponent : public TrayComponent
public slots:
void slotShowNewConnectionDialog();
private slots:
void vpnEventHandler(TDENetworkVPNEventType::TDENetworkVPNEventType event, TQString message);
private:
};

Loading…
Cancel
Save