|
|
@ -42,7 +42,7 @@
|
|
|
|
#include <klocale.h>
|
|
|
|
#include <klocale.h>
|
|
|
|
#include <knotifyclient.h>
|
|
|
|
#include <knotifyclient.h>
|
|
|
|
|
|
|
|
|
|
|
|
// TDENM includes
|
|
|
|
// KNM includes
|
|
|
|
#include "tdenetman-wireless_device_tray.h"
|
|
|
|
#include "tdenetman-wireless_device_tray.h"
|
|
|
|
#include "tdenetman-wireless_menuitem.h"
|
|
|
|
#include "tdenetman-wireless_menuitem.h"
|
|
|
|
#include "tdenetman-wireless_network.h"
|
|
|
|
#include "tdenetman-wireless_network.h"
|
|
|
@ -52,9 +52,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
using namespace ConnectionSettings;
|
|
|
|
using namespace ConnectionSettings;
|
|
|
|
|
|
|
|
|
|
|
|
extern char use_new_wireless_essid;
|
|
|
|
|
|
|
|
extern TQByteArray new_wireless_essid;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class WirelessDeviceTrayPrivate
|
|
|
|
class WirelessDeviceTrayPrivate
|
|
|
|
{
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
public:
|
|
|
@ -82,6 +79,11 @@ TQStringList WirelessDeviceTray::getToolTipText()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::newConnection()
|
|
|
|
void WirelessDeviceTray::newConnection()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
newConnection(0);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::newConnection(int id)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TDEGlobalNetworkManager* nm = KGlobal::networkManager();
|
|
|
|
TDEGlobalNetworkManager* nm = KGlobal::networkManager();
|
|
|
|
|
|
|
|
|
|
|
@ -90,8 +92,11 @@ void WirelessDeviceTray::newConnection()
|
|
|
|
nm->loadConnectionAllowedValues(conn);
|
|
|
|
nm->loadConnectionAllowedValues(conn);
|
|
|
|
|
|
|
|
|
|
|
|
// open a dialog for editing the connection
|
|
|
|
// open a dialog for editing the connection
|
|
|
|
use_new_wireless_essid = 0; // deactivate autofill for now
|
|
|
|
char use_new_wireless_essid = 0;
|
|
|
|
ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, true, tray(), "connect_something", false, TQt::WDestructiveClose);
|
|
|
|
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();
|
|
|
|
dlg->show();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -215,6 +220,7 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
uint newnetworkItemsAdded = 0;
|
|
|
|
uint newnetworkItemsAdded = 0;
|
|
|
|
TQValueList<WirelessNetwork> newnets = WirelessManager::getWirelessNetworks(0, WirelessNetwork::MATCH_SSID);
|
|
|
|
TQValueList<WirelessNetwork> newnets = WirelessManager::getWirelessNetworks(0, WirelessNetwork::MATCH_SSID);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newWirelessPopupSSIDMap.clear();
|
|
|
|
for (TQValueList<WirelessNetwork>::Iterator it = newnets.begin(); it != newnets.end(); ++it)
|
|
|
|
for (TQValueList<WirelessNetwork>::Iterator it = newnets.begin(); it != newnets.end(); ++it)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Only display networks with no existing connnection
|
|
|
|
// Only display networks with no existing connnection
|
|
|
@ -229,7 +235,8 @@ void WirelessDeviceTray::addWirelessNetworks(KPopupMenu* menu)
|
|
|
|
false);
|
|
|
|
false);
|
|
|
|
|
|
|
|
|
|
|
|
int id = newpopup->insertItem (wirelessNetworkItem, -1, -1);
|
|
|
|
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;
|
|
|
|
newnetworkItemsAdded += 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -397,12 +404,12 @@ void WirelessDeviceTray::apPropertyChanged(TDEMACAddress BSSID, TDENetworkAPEven
|
|
|
|
|
|
|
|
|
|
|
|
void WirelessDeviceTray::slotAccessPointAdded(TDENetworkWiFiAPInfo* ap)
|
|
|
|
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)
|
|
|
|
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)
|
|
|
|
void WirelessDeviceTray::tdeHardwareEventHandler(TDEHardwareEvent::TDEHardwareEvent event, TQString)
|
|
|
|