|
|
|
@ -42,7 +42,7 @@
|
|
|
|
|
#include <klocale.h>
|
|
|
|
|
#include <knotifyclient.h>
|
|
|
|
|
|
|
|
|
|
// TDENM includes
|
|
|
|
|
// KNM includes
|
|
|
|
|
#include "tdenetman-wireless_device_tray.h"
|
|
|
|
|
#include "tdenetman-wireless_menuitem.h"
|
|
|
|
|
#include "tdenetman-wireless_network.h"
|
|
|
|
@ -52,9 +52,6 @@
|
|
|
|
|
|
|
|
|
|
using namespace ConnectionSettings;
|
|
|
|
|
|
|
|
|
|
extern char use_new_wireless_essid;
|
|
|
|
|
extern TQByteArray new_wireless_essid;
|
|
|
|
|
|
|
|
|
|
class WirelessDeviceTrayPrivate
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
@ -82,6 +79,11 @@ TQStringList WirelessDeviceTray::getToolTipText()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::newConnection()
|
|
|
|
|
{
|
|
|
|
|
newConnection(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::newConnection(int id)
|
|
|
|
|
{
|
|
|
|
|
TDEGlobalNetworkManager* nm = KGlobal::networkManager();
|
|
|
|
|
|
|
|
|
@ -90,8 +92,11 @@ void WirelessDeviceTray::newConnection()
|
|
|
|
|
nm->loadConnectionAllowedValues(conn);
|
|
|
|
|
|
|
|
|
|
// open a dialog for editing the connection
|
|
|
|
|
use_new_wireless_essid = 0; // deactivate autofill for now
|
|
|
|
|
ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, true, tray(), "connect_something", false, TQt::WDestructiveClose);
|
|
|
|
|
char use_new_wireless_essid = 0;
|
|
|
|
|
if ((id < 0) && newWirelessPopupSSIDMap.contains(id)) {
|
|
|
|
|
use_new_wireless_essid = 1;
|
|
|
|
|
}
|
|
|
|
|
ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, true, (use_new_wireless_essid)?newWirelessPopupSSIDMap[id]:TQByteArray(), tray(), "connect_something", false, TQt::WDestructiveClose);
|
|
|
|
|
dlg->show();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -214,7 +219,8 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
|
TQPopupMenu* newpopup = new TQPopupMenu(menu);
|
|
|
|
|
uint newnetworkItemsAdded = 0;
|
|
|
|
|
TQValueList<WirelessNetwork> newnets = WirelessManager::getWirelessNetworks(0, WirelessNetwork::MATCH_SSID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newWirelessPopupSSIDMap.clear();
|
|
|
|
|
for (TQValueList<WirelessNetwork>::Iterator it = newnets.begin(); it != newnets.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
// Only display networks with no existing connnection
|
|
|
|
@ -229,7 +235,8 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
|
false);
|
|
|
|
|
|
|
|
|
|
int id = newpopup->insertItem (wirelessNetworkItem, -1, -1);
|
|
|
|
|
newpopup->connectItem(id, this, TQT_SLOT(newConnection()));
|
|
|
|
|
newWirelessPopupSSIDMap[id] = (*it).getSsid();
|
|
|
|
|
newpopup->connectItem(id, this, TQT_SLOT(newConnection(int)));
|
|
|
|
|
|
|
|
|
|
newnetworkItemsAdded += 1;
|
|
|
|
|
}
|
|
|
|
@ -397,12 +404,12 @@ void WirelessDeviceTray::apPropertyChanged(TDEMACAddress BSSID, TDENetworkAPEven
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::slotAccessPointAdded(TDENetworkWiFiAPInfo* ap)
|
|
|
|
|
{
|
|
|
|
|
KNotifyClient::event( tray()->winId(), "tdenm-nm-network-found", i18n("TDENetworkManager New Wireless Network Found") );
|
|
|
|
|
KNotifyClient::event( tray()->winId(), "knm-nm-network-found", i18n("TDENetworkManager New Wireless Network Found") );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::slotAccessPointRemoved(TDEMACAddress)
|
|
|
|
|
{
|
|
|
|
|
KNotifyClient::event( tray()->winId(), "tdenm-nm-network-gone", i18n("TDENetworkManager Wireless Network Disappeared") );
|
|
|
|
|
KNotifyClient::event( tray()->winId(), "knm-nm-network-gone", i18n("TDENetworkManager Wireless Network Disappeared") );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent event, TQString)
|
|
|
|
|