diff --git a/tdenetworkmanager/src/CMakeLists.txt b/tdenetworkmanager/src/CMakeLists.txt
index cef1cd7..293cfcb 100644
--- a/tdenetworkmanager/src/CMakeLists.txt
+++ b/tdenetworkmanager/src/CMakeLists.txt
@@ -11,8 +11,8 @@
add_definitions( -UQT_NO_ASCII_CAST )
-add_subdirectory( settings )
-add_subdirectory( configwidgets )
+#add_subdirectory( settings )
+#add_subdirectory( configwidgets )
include_directories(
${CMAKE_CURRENT_BINARY_DIR}
@@ -50,26 +50,22 @@ tde_add_tdeinit_executable( knetworkmanager AUTOMOC
SOURCES
connection_editor.ui
vpnauthentication.ui main.cpp knetworkmanager.cpp knetworkmanager-tray.cpp
- knetworkmanager-hal_device_proxy.cpp knetworkmanager-nm_proxy.cpp knetworkmanager-device.cpp
- knetworkmanager-cdma_device.cpp knetworkmanager-cellular_device.cpp knetworkmanager-gsm_device.cpp
- knetworkmanager-wired_device.cpp knetworkmanager-vpn_device.cpp knetworkmanager-vpn_plugin.cpp
- knetworkmanager-wireless_device.cpp knetworkmanager-devicestore.cpp
+ #knetworkmanager-vpn_plugin.cpp
knetworkmanager-cellular_device_tray.cpp knetworkmanager-device_tray.cpp
knetworkmanager-wired_device_tray.cpp knetworkmanager-wireless_device_tray.cpp
- knetworkmanager-accesspoint.cpp knetworkmanager-wireless_menuitem.cpp knetworkmanager-menuitem.cpp
- knetworkmanager-menu_subhead.cpp
- knetworkmanager-connection_dbus.cpp knetworkmanager-connection_secrets_dbus.cpp
- knetworkmanager-connection.cpp knetworkmanager-generic_connection.cpp
+ knetworkmanager-wireless_menuitem.cpp knetworkmanager-menuitem.cpp
+ knetworkmanager-menu_subhead.cpp
+ knetworkmanager-generic_connection.cpp
knetworkmanager-cdma_connection.cpp knetworkmanager-gsm_connection.cpp
knetworkmanager-ppp_connection.cpp knetworkmanager-wireless_connection.cpp
knetworkmanager-wired_connection.cpp knetworkmanager-vpn_connection.cpp
- knetworkmanager-connection_store.cpp knetworkmanager-nmsettings.cpp
- sha1.cpp md5.cpp xmlmarshaller.cpp knetworkmanager-storage.cpp
+ knetworkmanager-nmsettings.cpp
+ sha1.cpp md5.cpp xmlmarshaller.cpp
knetworkmanager-wireless_network.cpp knetworkmanager-wireless_manager.cpp
knetworkmanager-connection_editor.cpp knetworkmanager-plugin.cpp knetworkmanager-vpnplugin.cpp
knetworkmanager-pluginmanager.cpp knetworkmanager-vpnservice.cpp knetworkmanager-vpnmanager.cpp
knetworkmanager-vpnauthenticationdialog.cpp devicetraycomponent.cpp traycomponent.cpp
- vpn_tray_component.cpp secret_storage_plugin.cpp
+ vpn_tray_component.cpp
EMBED tdenetwork-connection-configwidgets-static tdenetwork-connection-settings-static
LINK tdecore-shared tdeui-shared kutils-shared ${DBUS_TQT_LIBRARIES}
)
diff --git a/tdenetworkmanager/src/devicetraycomponent.cpp b/tdenetworkmanager/src/devicetraycomponent.cpp
index d42db60..d0a3f97 100644
--- a/tdenetworkmanager/src/devicetraycomponent.cpp
+++ b/tdenetworkmanager/src/devicetraycomponent.cpp
@@ -27,40 +27,79 @@ along with this program. If not, see .
#include "knetworkmanager-device.h"
#include "knetworkmanager-nm_proxy.h"
+TQString pixmapForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) {
+ TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = 0x80000000;
+ while (flag > 0) {
+ if (state & flag) {
+ if (m_pixmaps.contains(flag)) {
+ return m_pixmaps[flag];
+ }
+ }
+ flag = flag >> 1;
+ }
+ return TQString::null;
+}
+
+TQString movieForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) {
+ TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = 0x80000000;
+ while (flag > 0) {
+ if (state & flag) {
+ if (m_movies.contains(flag)) {
+ return m_movies[flag];
+ }
+ }
+ flag = flag >> 1;
+ }
+ return TQString::null;
+}
+
+TQString tooltipForConnState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state) {
+ TDENetworkConnectionStatus::TDENetworkConnectionStatus flag = 0x80000000;
+ while (flag > 0) {
+ if (state & flag) {
+ if (m_tooltips.contains(flag)) {
+ return m_tooltips[flag];
+ }
+ }
+ flag = flag >> 1;
+ }
+ return TQString::null;
+}
+
DeviceTrayComponent::DeviceTrayComponent(Device * device, KSystemTray * parent, const char * name )
: TrayComponent(parent, name), m_device(device)
{
- connect( m_device, TQT_SIGNAL(StateChanged(NMDeviceState)), TQT_SLOT(deviceStateChanged(NMDeviceState)));
-
- m_pixmaps[NM_DEVICE_STATE_UNKNOWN] = "nm_no_connection";
- m_pixmaps[NM_DEVICE_STATE_UNMANAGED] = "nm_no_connection";
- m_pixmaps[NM_DEVICE_STATE_UNAVAILABLE] = "nm_no_connection";
- m_pixmaps[NM_DEVICE_STATE_DISCONNECTED] = "nm_no_connection";
- m_pixmaps[NM_DEVICE_STATE_ACTIVATED] = "ok";
- m_pixmaps[NM_DEVICE_STATE_FAILED] = "nm_no_connection";
-
- m_movies[NM_DEVICE_STATE_PREPARE] = "nm_stage01_connecting";
- m_movies[NM_DEVICE_STATE_CONFIG] = "nm_stage02_connecting";
- m_movies[NM_DEVICE_STATE_IP_CONFIG] = "nm_stage03_connecting";
- m_movies[NM_DEVICE_STATE_NEED_AUTH] = m_movies[NM_DEVICE_STATE_CONFIG];
-
- m_tooltips[NM_DEVICE_STATE_UNKNOWN] = i18n("Unknown");
- m_tooltips[NM_DEVICE_STATE_UNAVAILABLE] = i18n("Down");
- m_tooltips[NM_DEVICE_STATE_UNMANAGED] = i18n("Unmanaged");
- m_tooltips[NM_DEVICE_STATE_DISCONNECTED] = i18n("Disconnected");
- m_tooltips[NM_DEVICE_STATE_PREPARE] = i18n("Preparing");
- m_tooltips[NM_DEVICE_STATE_CONFIG] = i18n("Configuration");
- m_tooltips[NM_DEVICE_STATE_NEED_AUTH] = i18n("Awaiting authentication");
- m_tooltips[NM_DEVICE_STATE_IP_CONFIG] = i18n("IP configuration");
- m_tooltips[NM_DEVICE_STATE_ACTIVATED] = i18n("Activated");
- m_tooltips[NM_DEVICE_STATE_FAILED] = i18n("Failed");
+ connect( m_device, TQT_SIGNAL(StateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus)), TQT_SLOT(deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus)));
+
+ m_pixmaps[TDENetworkConnectionStatus::Invalid] = "nm_no_connection";
+ m_pixmaps[TDENetworkConnectionStatus::UnManaged] = "nm_no_connection";
+ m_pixmaps[TDENetworkConnectionStatus::LinkUnavailable] = "nm_no_connection";
+ m_pixmaps[TDENetworkConnectionStatus::Disconnected] = "nm_no_connection";
+ m_pixmaps[TDENetworkConnectionStatus::Connected] = "ok";
+ m_pixmaps[TDENetworkConnectionStatus::Failed] = "nm_no_connection";
+
+ m_movies[TDENetworkConnectionStatus::EstablishingLink] = "nm_stage01_connecting";
+ m_movies[TDENetworkConnectionStatus::ConfiguringProtocols] = "nm_stage02_connecting";
+ m_movies[TDENetworkConnectionStatus::VerifyingProtocols] = "nm_stage03_connecting";
+ m_movies[TDENetworkConnectionStatus::NeedAuthorization] = m_movies[TDENetworkConnectionStatus::ConfiguringProtocols];
+
+ m_tooltips[TDENetworkConnectionStatus::Invalid] = i18n("Unknown");
+ m_tooltips[TDENetworkConnectionStatus::LinkUnavailable] = i18n("Down");
+ m_tooltips[TDENetworkConnectionStatus::UnManaged] = i18n("Unmanaged");
+ m_tooltips[TDENetworkConnectionStatus::Disconnected] = i18n("Disconnected");
+ m_tooltips[TDENetworkConnectionStatus::EstablishingLink] = i18n("Preparing");
+ m_tooltips[TDENetworkConnectionStatus::ConfiguringProtocols] = i18n("Configuration");
+ m_tooltips[TDENetworkConnectionStatus::NeedAuthorization] = i18n("Awaiting authentication");
+ m_tooltips[TDENetworkConnectionStatus::VerifyingProtocols] = i18n("IP configuration");
+ m_tooltips[TDENetworkConnectionStatus::Connected] = i18n("Activated");
+ m_tooltips[TDENetworkConnectionStatus::Failed] = i18n("Failed");
}
DeviceTrayComponent::~DeviceTrayComponent()
{
}
-Device* DeviceTrayComponent::device() const
+TDENetworkDevice* DeviceTrayComponent::device() const
{
return m_device;
}
@@ -68,62 +107,62 @@ Device* DeviceTrayComponent::device() const
TQStringList DeviceTrayComponent::getToolTipText()
{
TQStringList list;
- NMDeviceState state = m_device->getState();
- if (m_tooltips.contains(state)) {
+ TDENetworkConnectionStatus::TDENetworkConnectionStatus state = m_device->getState();
+ if (tooltipForConnState(state) != "") {
list.append(i18n("Device: %1").arg(m_device->getInterface()));
- list.append(i18n("State: %1").arg(m_tooltips[state]));
+ list.append(i18n("State: %1").arg(tooltipForConnState(state)));
}
return list;
}
-TQPixmap DeviceTrayComponent::pixmapForState(NMDeviceState state)
+TQPixmap DeviceTrayComponent::pixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
{
- if (m_pixmaps.contains(state)) {
- return KSystemTray::loadIcon(m_pixmaps[state]);
+ if (pixmapForConnState(state) != "") {
+ return KSystemTray::loadIcon(pixmapForConnState(state));
} else {
return TQPixmap();
}
}
-TQMovie DeviceTrayComponent::movieForState(NMDeviceState state)
+TQMovie DeviceTrayComponent::movieForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
{
- if (m_movies.contains(state)) {
- return TQMovie( KGlobal::iconLoader()->moviePath(m_movies[state], KIcon::Panel));
+ if (movieForConnState(state) != "") {
+ return TQMovie( KGlobal::iconLoader()->moviePath(movieForConnState(state), KIcon::Panel));
} else {
return TQMovie();
}
}
-void DeviceTrayComponent::setMovieForState(NMDeviceState state, TQString movie)
+void DeviceTrayComponent::setMovieForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state, TQString movie)
{
m_movies[state] = movie;
}
-void DeviceTrayComponent::setPixmapForState(NMDeviceState state, TQString pixmap)
+void DeviceTrayComponent::setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state, TQString pixmap)
{
m_pixmaps[state] = pixmap;
}
-void DeviceTrayComponent::deviceStateChanged(NMDeviceState state)
+void DeviceTrayComponent::deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus state)
{
//check if our device now holds the default active connection
// if it is the default active connection
// or if it is activating. what if 2 devices are activating simultaneously?
NMProxy * nm = 0;
switch (state) {
- case NM_DEVICE_STATE_PREPARE:
+ case TDENetworkConnectionStatus::EstablishingLink:
emit needsCenterStage(this, true);
break;
- case NM_DEVICE_STATE_ACTIVATED:
+ case TDENetworkConnectionStatus::Connected:
nm = NMProxy::getInstance();
if ( m_device == nm->getDefaultDevice() ) {
emit needsCenterStage(this, true);
}
break;
- case NM_DEVICE_STATE_UNAVAILABLE:
- case NM_DEVICE_STATE_DISCONNECTED:
- case NM_DEVICE_STATE_FAILED:
+ case TDENetworkConnectionStatus::LinkUnavailable:
+ case TDENetworkConnectionStatus::Disconnected:
+ case TDENetworkConnectionStatus::Failed:
emit needsCenterStage(this, false);
break;
default:
diff --git a/tdenetworkmanager/src/devicetraycomponent.h b/tdenetworkmanager/src/devicetraycomponent.h
index 729076f..e162020 100644
--- a/tdenetworkmanager/src/devicetraycomponent.h
+++ b/tdenetworkmanager/src/devicetraycomponent.h
@@ -21,16 +21,17 @@ along with this program. If not, see .
#ifndef DEVICE_TRAY_COMPONENT_H
#define DEVICE_TRAY_COMPONENT_H
-#include
-
#include
#include
#include
#include
+#include
+#include
+
#include "traycomponent.h"
-class Device;
+class TDENetworkDevice;
class KPopupMenu;
class KSystemTray;
@@ -39,25 +40,25 @@ class DeviceTrayComponent : public TrayComponent
Q_OBJECT
public:
- DeviceTrayComponent(Device * device, KSystemTray * parent, const char * name );
+ DeviceTrayComponent(TDENetworkDevice * device, KSystemTray * parent, const char * name );
virtual ~DeviceTrayComponent();
- TQPixmap pixmapForState(NMDeviceState state);
- TQMovie movieForState(NMDeviceState state);
+ TQPixmap pixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state);
+ TQMovie movieForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus state);
virtual TQStringList getToolTipText();
- Device* device() const;
+ TDENetworkDevice* device() const;
signals:
void needsCenterStage(TrayComponent *, bool);
public slots:
virtual void newConnection() = 0;
protected slots:
- void deviceStateChanged(NMDeviceState);
+ void deviceStateChanged(TDENetworkConnectionStatus::TDENetworkConnectionStatus);
protected:
- void setMovieForState(NMDeviceState, TQString);
- void setPixmapForState(NMDeviceState, TQString);
+ void setMovieForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString);
+ void setPixmapForState(TDENetworkConnectionStatus::TDENetworkConnectionStatus, TQString);
private:
- Device * m_device;
- TQMap m_movies;
- TQMap m_pixmaps;
- TQMap m_tooltips;
+ TDENetworkDevice * m_device;
+ TQMap m_movies;
+ TQMap m_pixmaps;
+ TQMap m_tooltips;
};
#endif // DEVICE_TRAY_COMPONENT_H
diff --git a/tdenetworkmanager/src/knetworkmanager-accesspoint.cpp b/tdenetworkmanager/src/knetworkmanager-accesspoint.cpp
deleted file mode 100644
index 0bd5528..0000000
--- a/tdenetworkmanager/src/knetworkmanager-accesspoint.cpp
+++ /dev/null
@@ -1,222 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-accesspoint.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-// TQt
-#include
-
-// TQT_DBus includes
-#include
-#include
-#include
-
-// NM includes
-#include
-
-// KNM includes
-#include "knetworkmanager.h"
-#include "knetworkmanager-accesspoint.h"
-#include "dbus/accesspointproxy.h"
-
-class AccessPointPrivate
-{
-public:
- AccessPointPrivate(TQString objpath = TQString(), const DBus::AccessPointProxy* proxy = NULL)
- : nmAccessPoint(proxy)
- , objPath(objpath)
- {
- }
-
- ~AccessPointPrivate() { }
-
- // pointer to the shared DBus proxy
- TQGuardedPtr nmAccessPoint;
- // DBus object path
- TQString objPath;
-
- // Properties
- TQ_UINT32 flags;
- TQ_UINT32 wpaFlags;
- TQ_UINT32 rsnFlags;
- TQValueList ssid;
- TQ_UINT32 freq;
- TQString hwAddress;
- TQ_INT32 mode;
- TQ_UINT32 rate;
- TQ_UINT8 strength;
-};
-
-TQ_UINT32 AccessPoint::getFlags() const
-{
- return d->flags;
-}
-
-TQ_UINT32 AccessPoint::getWpaFlags() const
-{
- return d->wpaFlags;
-}
-
-TQ_UINT32 AccessPoint::getRsnFlags() const
-{
- return d->rsnFlags;
-}
-
-TQValueList AccessPoint::getSsid() const
-{
- return d->ssid;
-}
-
-TQ_UINT32 AccessPoint::getFrequency() const
-{
- return d->freq;
-}
-
-TQString AccessPoint::getHwAddress() const
-{
- return d->hwAddress;
-}
-
-TQ_INT32 AccessPoint::getMode() const
-{
- return d->mode;
-}
-
-TQ_UINT32 AccessPoint::getRate() const
-{
- return d->rate;
-}
-
-TQ_UINT8 AccessPoint::getStrength() const
-{
- return d->strength;
-}
-
-const TQByteArray AccessPoint::getSsidByteArray() const
-{
- // FIXME: Wow, thats ugly
- TQValueList ssid = d->ssid;
- TQByteArray ret_ssid(ssid.count());
- TQByteArray::Iterator byteit = ret_ssid.begin();
- for (TQValueList::iterator it = ssid.begin(); it != ssid.end(); ++it)
- {
- (*byteit) = (*it);
- ++byteit;
- }
- return ret_ssid;
-}
-
-TQString AccessPoint::getDisplaySsid() const
-{
- return TQString(getSsidByteArray());
-}
-
-bool AccessPoint::isEncrypted() const
-{
- return (getFlags() && NM_802_11_AP_FLAGS_PRIVACY);
-}
-
-void AccessPoint::slotPropertiesChanged(const TQMap& properties)
-{
- updateProperties();
-}
-
-void AccessPoint::updateProperties()
-{
- //TODO do this proper-like
- TQT_DBusError err;
- if (d->nmAccessPoint.isNull())
- return;
-
- d->flags = d->nmAccessPoint->getFlags(err);
- d->wpaFlags = d->nmAccessPoint->getWpaFlags(err);
- d->rsnFlags = d->nmAccessPoint->getRsnFlags(err);
- d->ssid = d->nmAccessPoint->getSsid(err);
- d->freq = d->nmAccessPoint->getFrequency(err);
- d->hwAddress = d->nmAccessPoint->getHwAddress(err);
- d->mode = d->nmAccessPoint->getMode(err);
- d->rate = d->nmAccessPoint->getMaxBitrate(err);
- d->strength = d->nmAccessPoint->getStrength(err);
- emit strengthChanged(d->strength);
-}
-
-TQString AccessPoint::getObjectPath() const
-{
- return d->objPath;
-}
-
-bool AccessPoint::isValid() const
-{
- return !(d->objPath.isEmpty());
-}
-
-bool AccessPoint::operator== (const AccessPoint& other) const
-{
- return (other.getObjectPath() == getObjectPath());
-}
-#if 0
-AccessPoint& AccessPoint::operator= (const AccessPoint& other)
-{
- kdDebug() << "AccessPoint::operator=\n" << endl;
- d->objPath = other.d->objPath;
- d->nmAccessPoint = other.d->nmAccessPoint;
- connect(d->nmAccessPoint, TQT_SIGNAL(PropertiesChanged(const TQMap&)), this, TQT_SLOT(slotPropertiesChanged(const TQMap&)));
-
- updateProperties();
-
- return *this;
-}
-#endif
-AccessPoint::AccessPoint(TQString obj_path, TQObject * parent, const char * name)
-: TQObject(parent, name)
-{
- DBus::AccessPointProxy * proxy = new DBus::AccessPointProxy(NM_DBUS_SERVICE, obj_path);
- proxy->setConnection(TQT_DBusConnection::systemBus());
- d = new AccessPointPrivate(obj_path, proxy);
-
- if (!d->nmAccessPoint.isNull())
- connect(d->nmAccessPoint, TQT_SIGNAL(PropertiesChanged(const TQMap&)), this, TQT_SLOT(slotPropertiesChanged(const TQMap&)));
-
- updateProperties();
-}
-#if 0
-// copy constructor
-AccessPoint::AccessPoint(const AccessPoint& other)
- : TQObject()
-{
- // just copy the private data from other
- d = new AccessPointPrivate(*other.d);
-
- if (!d->nmAccessPoint.isNull())
- connect(d->nmAccessPoint, TQT_SIGNAL(PropertiesChanged(const TQMap&)), this, TQT_SLOT(slotPropertiesChanged(const TQMap&)));
-
- updateProperties();
-}
-#endif
-AccessPoint::~AccessPoint()
-{
- delete d->nmAccessPoint;
- delete d;
-}
-
-
-#include "knetworkmanager-accesspoint.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-accesspoint.h b/tdenetworkmanager/src/knetworkmanager-accesspoint.h
deleted file mode 100644
index d9e7a60..0000000
--- a/tdenetworkmanager/src/knetworkmanager-accesspoint.h
+++ /dev/null
@@ -1,75 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-device.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Timo Hoenig ,
- * Will Stephenson ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_ACCESSPOINT_H
-#define KNETWORKMANAGER_ACCESSPOINT_H
-
-#include "knetworkmanager.h"
-#include
-
-class AccessPointPrivate;
-namespace DBus
-{
- class AccessPointProxy;
-};
-
-class AccessPoint : public TQObject
-{
- Q_OBJECT
-
- public:
- AccessPoint (const AccessPoint&);
- AccessPoint (TQString objpath = TQString(), TQObject * parent = 0, const char * name = 0);
- ~AccessPoint ();
-
- AccessPoint& operator= (const AccessPoint& other);
- bool operator== (const AccessPoint& other) const;
-
- TQ_UINT32 getFlags() const;
- TQ_UINT32 getWpaFlags() const;
- TQ_UINT32 getRsnFlags() const;
- TQValueList getSsid() const;
- TQ_UINT32 getFrequency() const;
- TQString getHwAddress() const;
- TQ_INT32 getMode() const;
- TQ_UINT32 getRate() const;
- TQ_UINT8 getStrength() const;
- TQString getDisplaySsid() const;
- const TQByteArray getSsidByteArray() const;
- bool isEncrypted() const;
- TQString getObjectPath() const;
- bool isValid() const;
- signals:
- void strengthChanged(TQ_UINT8);
- private slots:
- void slotPropertiesChanged(const TQMap& properties);
- void updateProperties();
-
- private:
-
- AccessPointPrivate * d;
-};
-
-#endif /* KNETWORKMANAGER_DEVICE_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-cdma_device.cpp b/tdenetworkmanager/src/knetworkmanager-cdma_device.cpp
deleted file mode 100644
index 0aecade..0000000
--- a/tdenetworkmanager/src/knetworkmanager-cdma_device.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-cdma_device.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-// KDE includes
-#include
-
-// TQt includes
-#include
-
-// TQT_DBus includes
-#include
-#include
-
-// NM includes
-#include
-
-// KNM includes
-#include "knetworkmanager.h"
-#include "knetworkmanager-cdma_device.h"
-#include "dbus/cdmaproxy.h"
-
-class CDMADevicePrivate
-{
-public:
- CDMADevicePrivate(TQString service, TQString obj_path)
- : nmCDMA(service, obj_path)
- {}
- ~CDMADevicePrivate() {}
-
- DBus::CDMADeviceProxy nmCDMA;
-};
-
-CDMADevice::CDMADevice (const TQString & obj_path)
- : CellularDevice(obj_path)
-{
- d = new CDMADevicePrivate(NM_DBUS_SERVICE, obj_path);
- d->nmCDMA.setConnection(TQT_DBusConnection::systemBus());
-}
-
-CDMADevice::~CDMADevice ()
-{
- delete d;
-}
-
-
-#include "knetworkmanager-cdma_device.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-cdma_device.h b/tdenetworkmanager/src/knetworkmanager-cdma_device.h
deleted file mode 100644
index 2de56d7..0000000
--- a/tdenetworkmanager/src/knetworkmanager-cdma_device.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-cdma_device.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_CDMADEVICE_H
-#define KNETWORKMANAGER_CDMADEVICE_H
-
-// std includes
-#include
-
-// KNM includes
-#include "knetworkmanager.h"
-#include "knetworkmanager-cellular_device.h"
-
-class KNetworkManager;
-
-class CDMADevicePrivate;
-
-class CDMADevice : public CellularDevice
-{
- Q_OBJECT
-
- public:
- CDMADevice (const TQString & obj_path );
- ~CDMADevice ();
-
- private:
- CDMADevicePrivate * d;
-};
-
-#endif /* KNETWORKMANAGER_CDMADEVICE_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-cellular_device.cpp b/tdenetworkmanager/src/knetworkmanager-cellular_device.cpp
deleted file mode 100644
index e74c590..0000000
--- a/tdenetworkmanager/src/knetworkmanager-cellular_device.cpp
+++ /dev/null
@@ -1,37 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-cellular_device.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2008 Novell, Inc.
- *
- * Author: Will Stephenson
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-// KNM includes
-#include "knetworkmanager-cellular_device.h"
-
-CellularDevice::CellularDevice (const TQString & obj_path)
- : Device(obj_path)
-{
-}
-
-CellularDevice::~CellularDevice()
-{
-}
-
-#include "knetworkmanager-cellular_device.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-cellular_device.h b/tdenetworkmanager/src/knetworkmanager-cellular_device.h
deleted file mode 100644
index d680490..0000000
--- a/tdenetworkmanager/src/knetworkmanager-cellular_device.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-cellular_device.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2008 Novell, Inc.
- *
- * Author: Will Stephenson
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_CELLULARDEVICE_H
-#define KNETWORKMANAGER_CELLULARDEVICE_H
-
-// KNM includes
-#include "knetworkmanager-device.h"
-
-class CellularDevice : public Device
-{
- Q_OBJECT
-
- public:
- CellularDevice (const TQString & obj_path );
- ~CellularDevice ();
-};
-
-#endif /* KNETWORKMANAGER_CELLULARDEVICE_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.cpp b/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.cpp
index ea88749..49a3ab2 100644
--- a/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.cpp
+++ b/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.cpp
@@ -62,7 +62,7 @@ class CellularDeviceTrayPrivate
CellularDeviceTrayPrivate() {}
~CellularDeviceTrayPrivate() {}
- CellularDevice* dev;
+ TDENetworkDevice* dev;
};
void CellularDeviceTray::newConnection()
@@ -166,7 +166,7 @@ void CellularDeviceTray::addMenuItems(KPopupMenu* menu)
menu->insertSeparator();
}
-CellularDeviceTray::CellularDeviceTray (CellularDevice* dev, KSystemTray * parent, const char * name)
+CellularDeviceTray::CellularDeviceTray (TDENetworkDevice* dev, KSystemTray * parent, const char * name)
: DeviceTrayComponent (dev, parent, name)
{
d = new CellularDeviceTrayPrivate();
diff --git a/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.h b/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.h
index 282cc3e..323a559 100644
--- a/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.h
+++ b/tdenetworkmanager/src/knetworkmanager-cellular_device_tray.h
@@ -40,7 +40,7 @@ class CellularDeviceTray : public DeviceTrayComponent
Q_OBJECT
public:
- CellularDeviceTray (CellularDevice*, KSystemTray * parent = 0, const char * name = 0);
+ CellularDeviceTray (TDENetworkDevice*, KSystemTray * parent = 0, const char * name = 0);
~CellularDeviceTray ();
void addMenuItems(KPopupMenu* menu);
diff --git a/tdenetworkmanager/src/knetworkmanager-connection.cpp b/tdenetworkmanager/src/knetworkmanager-connection.cpp
deleted file mode 100644
index 2c6ea8b..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection.cpp
+++ /dev/null
@@ -1,296 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-connection.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-/* qt headers */
-#include
-
-/* kde headers */
-#include
-#include
-
-/* TQDbus headers */
-#include
-#include
-#include
-#include
-#include
-
-/* knetworkmanager headers */
-#include "knetworkmanager.h"
-#include "knetworkmanager-connection.h"
-#include "knetworkmanager-connection_dbus.h"
-#include "knetworkmanager-connection_secrets_dbus.h"
-#include "knetworkmanager-connection_setting.h"
-#include "knetworkmanager-nmsettings.h"
-#include
-
-extern unsigned char vpn_new_credentials_needed;
-
-using namespace ConnectionSettings;
-
-namespace ConnectionSettings
-{
-
-class ConnectionPrivate
-{
- public:
- ConnectionPrivate(Connection* parent)
- {
- conn_dbus = new ConnectionDBus(parent);
- conn_secrets_dbus = new ConnectionSecretsDBus(parent);
- secrets_requested = false;
- }
- ~ConnectionPrivate() {}
-
- TQT_DBusObjectPath obj_path;
- ConnectionDBus* conn_dbus;
- ConnectionSecretsDBus* conn_secrets_dbus;
- TQValueList settings;
- TQString specific_object;
- bool secrets_requested;
-};
-
-}
-
-/*
- class Connection
-*/
-Connection::Connection()
-{
- d = new ConnectionPrivate(this);
-
- NMSettings* nmSettings = NMSettings::getInstance();
- d->obj_path = nmSettings->getObjPathForConnection();
-
- TQT_DBusConnection conn = TQT_DBusConnection::systemBus();
-
- if (!registerObject(conn, objectPath()))
- kdError() << "registerobjectpath failed" << endl;
-
- // get notified whenever NM needs a secret
- connect(d->conn_secrets_dbus, TQT_SIGNAL(SecretsNeeded(const TQString&, const TQStringList&, bool)), this, TQT_SLOT(slotSecretsNeeded(const TQString&, const TQStringList&, bool)));
-}
-
-Connection::~Connection()
-{
- for (TQValueList::Iterator it= d->settings.begin(); it != d->settings.end(); ++it)
- {
- delete (*it);
- *it = NULL;
- }
- delete d;
-}
-
-ConnectionSetting*
-Connection::getSetting(const TQString& type) const
-{
- // find a setting by its type
- for (TQValueList::ConstIterator it = d->settings.begin(); it != d->settings.end(); ++it)
- {
- if ((*it)->getType() == type)
- return (*it);
- }
- return NULL;
-}
-
-TQValueList
-Connection::getSettings() const
-{
- return d->settings;
-}
-
-void
-Connection::appendSetting(ConnectionSetting* setting)
-{
- // that's our setting now :)
- d->settings.append(setting);
- connect(setting, TQT_SIGNAL(validityChanged()), this, TQT_SLOT(slotSettingValidityChanged()));
-}
-
-void
-Connection::setSpecificObject(const TQString& obj_path)
-{
- d->specific_object = obj_path;
-}
-
-TQString
-Connection::getSpecificObject() const
-{
- return d->specific_object;
-}
-
-TQT_DBusObjectPath
-Connection::getObjectPath() const
-{
- return d->obj_path;
-}
-
-TQString
-Connection::objectPath() const
-{
- return d->obj_path;
-}
-
-bool
-Connection::isValid() const
-{
- bool retval = true;
- // check if every enabled setting is valid
- for (TQValueList::ConstIterator it = d->settings.begin(); it != d->settings.end(); ++it)
- {
- if ((*it)->getEnabled())
- retval &= (*it)->isValid();
- }
- return retval;
-}
-
-void
-Connection::slotSecretsNeeded(const TQString& setting_name, const TQStringList& hints, bool request_new)
-{
- printf("Connection::slotSecretsNeeded %s, new: %s\n\r", setting_name.ascii(), (request_new ? "yes" : "no"));
- kdDebug() << "Connection::slotSecretsNeeded " << setting_name.ascii() << ", new: " << (request_new ? "yes" : "no") << endl;
- ConnectionSetting* setting = getSetting(setting_name);
-
- // If needed, request new VPN credentials
- if (strcmp("vpn", setting_name.ascii()) == 0) {
- if (vpn_new_credentials_needed == 1) {
- vpn_new_credentials_needed = 0;
- request_new = 1;
- }
- }
-
- if (!setting)
- {
- // send an error to NM
- d->conn_secrets_dbus->SendGetSecretsReply(NULL);
- }
- else
- {
- if (!request_new && setting->hasSecrets())
- {
- // if the setting has secrets just send them
- d->conn_secrets_dbus->SendGetSecretsReply(setting);
- }
- else
- {
- // NetworkManager asks for new secrets, ask user for new secrets/retry
- d->secrets_requested = true;
- emit SecretsNeeded(this, setting, hints, request_new);
- }
- }
-}
-
-void
-Connection::slotSecretsProvided(ConnectionSetting* setting)
-{
- if (!d->secrets_requested)
- return;
-
- if (!setting)
- {
- // send all settings to NM
- d->conn_secrets_dbus->SendGetSecretsReply(NULL);
- }
- else
- {
- // if we have the secrets already send them to NM
- d->conn_secrets_dbus->SendGetSecretsReply(setting);
- }
- d->secrets_requested = false;
-}
-
-void
-Connection::slotSecretsError()
-{
- if (!d->secrets_requested)
- return;
-
- d->conn_secrets_dbus->SendGetSecretsError();
- d->secrets_requested = false;
-}
-
-TQT_DBusObjectBase*
-Connection::createInterface(const TQString& interfaceName)
-{
- // the interfaces are already created, just return the right one
- if (interfaceName == NM_DBUS_IFACE_SETTINGS_CONNECTION)
- return d->conn_dbus;
-
- if (interfaceName == NM_DBUS_IFACE_SETTINGS_CONNECTION_SECRETS)
- return d->conn_secrets_dbus;
-
- return NULL;
-}
-
-TQString
-Connection::getType()
-{
- return TQString();
-}
-
-void
-Connection::slotSettingValidityChanged()
-{
- emit validityChanged();
-}
-
-void
-Connection::slotAboutToBeRemoved()
-{
- d->conn_dbus->slotAboutToBeRemoved();
-}
-void
-Connection::slotUpdated()
-{
- d->conn_dbus->slotUpdated();
-}
-
-void
-Connection::updateSettings(Connection* conn)
-{
- TQValueList settings = conn->getSettings();
- // copy all settings over to the new connection
- for (TQValueList::Iterator it = settings.begin(); it != settings.end(); ++it)
- {
- ConnectionSetting* other_setting = *it;
- ConnectionSetting* my_setting = getSetting(other_setting->getType());
- if (my_setting)
- {
- my_setting->fromMap(other_setting->toMap());
- my_setting->fromSecretsMap(other_setting->toSecretsMap(false));
- }
- else
- {
- // should not happen
- }
- }
-}
-
-bool
-Connection::awaitingSecrets()
-{
- return d->secrets_requested;
-}
-
-#include "knetworkmanager-connection.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-connection.h b/tdenetworkmanager/src/knetworkmanager-connection.h
deleted file mode 100644
index 695408c..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection.h
+++ /dev/null
@@ -1,131 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-connection.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_CONNECTION_H
-#define KNETWORKMANAGER_CONNECTION_H
-
-#include
-#include
-
-#include "knetworkmanager-connection_setting.h"
-
-class AccessPoint;
-class TQT_DBusObjectPath;
-
-namespace ConnectionSettings
-{
-
- class WirelessSecurity;
- class Connection;
- class ConnectionSetting;
- class ConnectionPrivate;
- class Info;
- class Wired;
- class Wireless;
- class WirelessSecurity;
- class IPv4;
-
- typedef TQMap ConnectionMap;
-
- // a connection wraps multiple settings
- class Connection : public TQObject, DBus::ConnectionNode
- {
- Q_OBJECT
-
- public:
- Connection();
- virtual ~Connection();
-
- virtual TQString getID() const = 0;
- virtual void setID(const TQString& id) = 0;
-
- // get a specific setting
- ConnectionSetting* getSetting(const TQString&) const;
-
- // get all settings of this connection
- TQValueList getSettings() const;
-
- // attach a new setting
- virtual void appendSetting(ConnectionSetting* setting);
-
- // ugly stuff introduced by NM
- void setSpecificObject(const TQString&);
- TQString getSpecificObject() const;
-
- // sometimes its usefull to have the object_path
- TQT_DBusObjectPath getObjectPath() const;
-
- // is the connection valid?
- virtual bool isValid() const;
-
- // the connections type (only for KNM use)
- virtual TQString getType();
-
- // duplicate
- virtual Connection* duplicate() = 0;
-
- // update the settings from another connection
- void updateSettings(Connection*);
-
- // true if the NM requested new secrets for this connection
- bool awaitingSecrets();
-
- public slots:
-
- // gets called from NM when it needs the secrets
- void slotSecretsNeeded(const TQString& setting_name, const TQStringList& hints, bool request_new);
-
- // gets called when the GUI provided new secrets
- void slotSecretsProvided(ConnectionSetting* setting);
-
- // signal a failure in getting new secrets
- void slotSecretsError();
-
- // gets called when a settings validity changes
- void slotSettingValidityChanged();
-
- // gets called when the connection is about to be removed
- void slotAboutToBeRemoved();
-
- // gets called when the connections settings changed
- void slotUpdated();
-
- protected:
- // implementations for ConnectionNode
- TQT_DBusObjectBase* createInterface(const TQString& interfaceName);
- TQString objectPath() const;
-
- signals:
-
- // signal when we need new secrets
- void SecretsNeeded(Connection* connection, ConnectionSetting* setting, const TQStringList& hints, bool request_new);
-
- // signal gets emitted when connections validity changes
- void validityChanged();
-
- private:
- ConnectionPrivate* d;
- };
-}
-#endif /* KNETWORKMANAGER_CONNECTION_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_dbus.cpp b/tdenetworkmanager/src/knetworkmanager-connection_dbus.cpp
deleted file mode 100644
index ecca0f5..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection_dbus.cpp
+++ /dev/null
@@ -1,200 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-devicestore_dbus.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-/* qt headers */
-#include
-
-/* kde headers */
-#include
-#include
-
-/* TQDbus headers */
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* NM headers */
-#include
-
-/* knetworkmanager headers */
-#include "knetworkmanager.h"
-#include "knetworkmanager-connection.h"
-#include "knetworkmanager-connection_dbus.h"
-#include "knetworkmanager-connection_setting.h"
-#include "knetworkmanager-nmsettings.h"
-#include "xmlmarshaller.h"
-
-using namespace ConnectionSettings;
-
-namespace ConnectionSettings
-{
-
-class ConnectionDBusPrivate
-{
- public:
- ConnectionDBusPrivate() {}
- ~ConnectionDBusPrivate() {}
-
- ConnectionSettings::Connection* parent;
-};
-}
-
-/*
- class Connection
-*/
-ConnectionDBus::ConnectionDBus(ConnectionSettings::Connection* parent)
- : TQObject(parent)
-{
- d = new ConnectionDBusPrivate();
- d->parent = parent;
-}
-
-ConnectionDBus::~ConnectionDBus()
-{
- delete d;
-}
-
-bool
-ConnectionDBus::GetID(TQString& id, TQT_DBusError& /*error*/)
-{
- kdDebug() << "Connection::GetID" << endl;
- id = d->parent->getID();
-
- return true;
-}
-
-bool
-ConnectionDBus::GetSettings(TQT_DBusDataMap& settings, TQT_DBusError& /*error*/)
-{
- kdDebug() << "Connection::GetSettings, obj: " << objectPath().ascii() << endl;
-
- TQValueList all_settings = d->parent->getSettings();
-
- // FIXME: ugly conversions, ask Kevin on how to make it better
- for (TQValueList::Iterator it = all_settings.begin(); it != all_settings.end(); ++it)
- {
- kdDebug() << " Processing Setting '" << (*it)->getType().ascii() << "'" << endl;
- // only append this setting if it is really used
- if (!(*it)->getEnabled())
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is not enabled, discarding" << endl;
- continue;
- }
-
- if (!(*it)->isValid())
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is not valid, discarding" << endl;
- continue;
- }
-
- // copy the settingsmap over to a variantmap
- TQMap map = (*it)->toMap();
-
- // only take used settings
- if (map.size() == 0)
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is empty, discarding" << endl;
- continue;
- }
-
- kdDebug() << " Attach setting '" << (*it)->getType().ascii() << "'" << endl;
-
- TQMap variant_map;
-
- for (TQMap::Iterator it2 = map.begin(); it2 != map.end(); ++it2)
- {
- TQString dataxml = XMLMarshaller::fromTQT_DBusData(it2.data());
- kdDebug() << " " << it2.key().ascii() << ": " << dataxml.replace('\n', ' ').ascii() << endl;
- TQT_DBusVariant var;
- var.value = it2.data();
- var.signature = var.value.buildDBusSignature();
- variant_map.insert(it2.key(), var);
- }
-
- // convert the variantma
- TQT_DBusDataMap map2 = TQT_DBusDataMap(variant_map);
- TQT_DBusData data = TQT_DBusData::fromStringKeyMap(map2);
-
- // insert this setting
- settings.insert((*it)->getType(), data);
- }
-
- return true;
-}
-
-bool
-ConnectionDBus::Update(const TQT_DBusDataMap& properties, TQT_DBusError& error)
-{
- // FIXME
- return true;
-}
-
-bool
-ConnectionDBus::Delete(TQT_DBusError& error)
-{
- // FIXME
- return true;
-}
-
-
-void
-ConnectionDBus::handleMethodReply(const TQT_DBusMessage& reply)
-{
- TQT_DBusConnection::systemBus().send(reply);
-}
-
-bool
-ConnectionDBus::handleSignalSend(const TQT_DBusMessage& reply)
-{
- TQT_DBusConnection::systemBus().send(reply);
- return true;
-}
-
-
-TQString
-ConnectionDBus::objectPath() const
-{
- return TQString(d->parent->getObjectPath());
-}
-
-void
-ConnectionDBus::slotAboutToBeRemoved()
-{
- // tell NM about us being removed
- emitRemoved();
-}
-
-void
-ConnectionDBus::slotUpdated()
-{
- TQT_DBusDataMap settings;
- TQT_DBusError error;
- if (GetSettings(settings, error))
- emitUpdated(settings);
-}
-
-#include "knetworkmanager-connection_dbus.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_dbus.h b/tdenetworkmanager/src/knetworkmanager-connection_dbus.h
deleted file mode 100644
index f7bdc00..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection_dbus.h
+++ /dev/null
@@ -1,77 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-devicestore_dbus.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_CONNECTION_DBUS_H
-#define KNETWORKMANAGER_CONNECTION_DBUS_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "knetworkmanager-connection_setting.h"
-#include "dbus/connection.h"
-#include "dbus/connectionnode.h"
-
-class TQT_DBusObjectPath;
-
-namespace ConnectionSettings
-{
-
- class Connection;
- class ConnectionSetting;
- class ConnectionDBusPrivate;
-
- // DBUS abstraction for a connection
- class ConnectionDBus : public TQObject, public DBus::Connection
- {
- Q_OBJECT
-
- public:
- ConnectionDBus(ConnectionSettings::Connection* parent);
- ~ConnectionDBus();
-
- public slots:
- void slotAboutToBeRemoved();
- void slotUpdated();
-
- protected:
- // implementations of the Setting DBus-interface
- bool GetID(TQString& id, TQT_DBusError& error);
- bool GetSettings(TQT_DBusDataMap& settings, TQT_DBusError& error);
- bool Update(const TQT_DBusDataMap& properties, TQT_DBusError& error);
- bool Delete(TQT_DBusError& error);
-
- // used from both interfaces
- void handleMethodReply(const TQT_DBusMessage& reply);
- bool handleSignalSend(const TQT_DBusMessage& reply);
- TQString objectPath() const;
-
- private:
- ConnectionDBusPrivate* d;
- };
-}
-#endif /* KNETWORKMANAGER_CONNECTION_DBUS_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_editor.cpp b/tdenetworkmanager/src/knetworkmanager-connection_editor.cpp
index e787a79..a80f014 100644
--- a/tdenetworkmanager/src/knetworkmanager-connection_editor.cpp
+++ b/tdenetworkmanager/src/knetworkmanager-connection_editor.cpp
@@ -50,7 +50,6 @@
#include "knetworkmanager-connection_store.h"
#include "knetworkmanager-connection_editor.h"
#include "knetworkmanager-connection_settings_dialog.h"
-#include "knetworkmanager-storage.h"
#include "knetworkmanager-vpnservice.h"
#include "knetworkmanager-vpnmanager.h"
@@ -63,7 +62,7 @@ class ConnectionListViewItem : public KListViewItem
{
public:
- ConnectionListViewItem(TQListView* parent, GenericConnection* connection)
+ ConnectionListViewItem(TQListView* parent, TDENetworkConnection* connection)
: KListViewItem(parent)
, _conn(connection)
{
@@ -84,7 +83,7 @@ class ConnectionListViewItem : public KListViewItem
}
}
- GenericConnection* _conn;
+ TDENetworkConnection* _conn;
};
/*
@@ -161,10 +160,10 @@ void ConnectionEditorImpl::slotNewVPNConnection()
/*
*
*/
-void ConnectionEditorImpl::slotEditNewConnection(Connection* conn)
+void ConnectionEditorImpl::slotEditNewConnection(TDENetworkConnection* conn)
{
// open a dialog for editing the connection
- ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, true, NULL, this, "connect_something", false, TQt::WDestructiveClose);
+ ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, true, this, "connect_something", false, TQt::WDestructiveClose);
connect(dlg, TQT_SIGNAL(connectionSaved()), this, TQT_SLOT(slotRefershConnectionList()));
dlg->show();
}
@@ -183,7 +182,7 @@ void ConnectionEditorImpl::slotEditCurrentConnection()
if (!item)
return;
- Connection* conn = item->_conn;
+ TDENetworkConnection* conn = item->_conn;
Storage* storage = Storage::getInstance();
bool hasSecretsStored = storage->hasSecretsStored(conn);
@@ -191,7 +190,7 @@ void ConnectionEditorImpl::slotEditCurrentConnection()
if (hasSecretsStored)
storage->restoreAllSecrets(conn);
- ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, false, NULL, this, "connect_something", false, TQt::WDestructiveClose);
+ ConnectionSettingsDialogImpl* dlg = new ConnectionSettingsDialogImpl(conn, false, this, "connect_something", false, TQt::WDestructiveClose);
dlg->show();
// save all connections (if not done already)
@@ -209,7 +208,7 @@ void ConnectionEditorImpl::slotRemoveCurrentConnection()
return;
ConnectionStore* cstore = ConnectionStore::getInstance();
- Connection* conn = item->_conn;
+ TDENetworkConnection* conn = item->_conn;
lvConnections->takeItem(item);
delete item;
@@ -223,14 +222,14 @@ void ConnectionEditorImpl::slotRemoveCurrentConnection()
void ConnectionEditorImpl::fillConnectionList()
{
ConnectionStore* cstore = ConnectionStore::getInstance();
- TQValueList conns = cstore->getConnections();
- TQValueList::Iterator it = conns.begin();
+ TQValueList conns = cstore->getConnections();
+ TQValueList::Iterator it = conns.begin();
lvConnections->clear();
for (; it != conns.end(); ++it)
{
- GenericConnection* conn = dynamic_cast(*it);
+ TDENetworkConnection* conn = *it;
if (conn)
{
Info* info = conn->getInfoSetting();
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_editor.h b/tdenetworkmanager/src/knetworkmanager-connection_editor.h
index a0a7567..e853787 100644
--- a/tdenetworkmanager/src/knetworkmanager-connection_editor.h
+++ b/tdenetworkmanager/src/knetworkmanager-connection_editor.h
@@ -56,7 +56,7 @@ class ConnectionEditorImpl : public ConnectionEditor
void slotEditCurrentConnection();
void slotNewWirelessConnection();
void slotNewWiredConnection();
- void slotEditNewConnection(Connection* conn);
+ void slotEditNewConnection(TDENetworkConnection* conn);
void slotRefershConnectionList();
void slotNewVPNConnection();
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_secrets_dbus.cpp b/tdenetworkmanager/src/knetworkmanager-connection_secrets_dbus.cpp
deleted file mode 100644
index aa64666..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection_secrets_dbus.cpp
+++ /dev/null
@@ -1,230 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-devicestore_dbus.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-/* qt headers */
-#include
-#include
-#include
-
-/* kde headers */
-#include
-#include
-
-/* TQDbus headers */
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-/* NM headers */
-#include
-
-/* knetworkmanager headers */
-#include "knetworkmanager.h"
-#include "knetworkmanager-connection.h"
-#include "knetworkmanager-connection_secrets_dbus.h"
-#include "knetworkmanager-connection_dbus.h"
-#include "knetworkmanager-connection_setting.h"
-#include "knetworkmanager-connection_setting_info.h"
-#include "knetworkmanager-connection_setting_ipv4.h"
-#include "knetworkmanager-connection_setting_wired.h"
-#include "knetworkmanager-connection_setting_wireless.h"
-#include "knetworkmanager-connection_setting_wireless_security.h"
-#include "knetworkmanager-accesspoint.h"
-#include "knetworkmanager-nmsettings.h"
-#include "xmlmarshaller.h"
-#include "stdio.h"
-
-using namespace ConnectionSettings;
-
-namespace ConnectionSettings
-{
-
-class ConnectionSecretsDBusPrivate
-{
- public:
- ConnectionSecretsDBusPrivate(Connection* par)
- : parent(par)
- , currentRequest(-1)
- {}
- ~ConnectionSecretsDBusPrivate() {}
-
- Connection* parent;
- int currentRequest;
-};
-
-}
-
-/*
- class Connection
-*/
-ConnectionSecretsDBus::ConnectionSecretsDBus(Connection* parent)
- : TQObject(parent)
-{
- d = new ConnectionSecretsDBusPrivate(parent);
-}
-
-ConnectionSecretsDBus::~ConnectionSecretsDBus()
-{
- delete d;
-}
-
-void
-ConnectionSecretsDBus::SendGetSecretsError()
-{
- GetSecretsAsyncError(d->currentRequest, TQT_DBusError::stdFailed("Requested setting is empty"));
-}
-
-void
-ConnectionSecretsDBus::SendGetSecretsReply(ConnectionSettings::ConnectionSetting* setting)
-{
- TQT_DBusMessage reply;
-
- kdDebug() << "SendGetSecretsReply1 id " << d->currentRequest << endl;
-
- // if no secret is needed we should not send one, right?
- if (d->currentRequest < 0)
- return;
- kdDebug() << "SendGetSecretsReply2" << endl;
-/*
- // no such setting
- if (!setting)
- {
- GetSecretsAsyncError(d->currentRequest, TQT_DBusError::stdFailed("Requested setting is unknown"));
- }
- else
- {
- kdDebud() << "SendGetSecretsReply3" << endl;
- // copy the settingsmap over to a variantmap
- TQMap map = setting->toSecretsMap();
-
- // only take used settings
- if (map.size() == 0)
- {
- kdDebug() << "SendGetSecretsReply4" << endl;
- GetSecretsAsyncError(d->currentRequest, TQT_DBusError::stdFailed("Requested setting is empty"));
- }
- else
- {
- kdDebug() << "SendGetSecretsReply5" << endl;
- TQT_DBusDataMap secrets(map);
-
- TQMap secrets;
- for (TQMap::Iterator it2 = map.begin(); it2 != map.end(); ++it2)
- {
- TQT_DBusVariant var;
- var.value = it2.data();
- var.signature = var.value.buildDBusSignature();
- secrets.insert(it2.key(), var);
- }
- kdDebug() << "SendGetSecretsReply6" << endl;
-
- GetSecretsAsyncReply(d->currentRequest, secrets);
- }
- }*/
-
- TQT_DBusDataMap settings;
- TQValueList all_settings = d->parent->getSettings();
-
- // FIXME: ugly conversions, ask Kevin on how to make it better
- for (TQValueList::Iterator it = all_settings.begin(); it != all_settings.end(); ++it)
- {
- kdDebug() << " Processing Setting '" << (*it)->getType().ascii() << "'" << endl;
- if (!(*it)->isValid())
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is not valid, discarding" << endl;
- continue;
- }
-
- // copy the settingsmap over to a variantmap
- TQMap map = (*it)->toSecretsMap();
-
- // only take used settings
- if (map.size() == 0)
- {
- kdDebug() << " Setting '" << (*it)->getType().ascii() << "' is empty, discarding" << endl;
- continue;
- }
-
- kdDebug() << " Attach setting '" << (*it)->getType().ascii() << "'" << endl;
-
- TQMap variant_map;
-
- for (TQMap::Iterator it2 = map.begin(); it2 != map.end(); ++it2)
- {
- TQString dataxml = XMLMarshaller::fromTQT_DBusData(it2.data());
- kdDebug() << " " << it2.key().ascii() << ": " << dataxml.replace('\n', ' ').ascii() << endl;
- TQT_DBusVariant var;
- var.value = it2.data();
- var.signature = var.value.buildDBusSignature();
- variant_map.insert(it2.key(), var);
- }
-
- // convert the variantma
- TQT_DBusDataMap map2 = TQT_DBusDataMap(variant_map);
- TQT_DBusData data = TQT_DBusData::fromStringKeyMap(map2);
-
- // insert this setting
- settings.insert((*it)->getType(), data);
- }
-
- GetSecretsAsyncReply(d->currentRequest, settings);
- d->currentRequest = -1;
-
-}
-
-void
-ConnectionSecretsDBus::GetSecretsAsync(int id, const TQString& setting_name, const TQStringList& hints, bool request_new)
-{
- printf("Connection::GetSecretsAsync for setting %s, %s\n\r", setting_name.ascii(), id);
- kdDebug() << "Connection::GetSecretsAsync for setting " << setting_name.ascii() << ", " << id << endl;
- d->currentRequest = id;
- emit SecretsNeeded(setting_name, hints, request_new);
-}
-
-void
-ConnectionSecretsDBus::handleMethodReply(const TQT_DBusMessage& reply)
-{
- TQT_DBusConnection::systemBus().send(reply);
-}
-
-bool
-ConnectionSecretsDBus::handleSignalSend(const TQT_DBusMessage& reply)
-{
- TQT_DBusConnection::systemBus().send(reply);
- return true;
-}
-
-TQString
-ConnectionSecretsDBus::objectPath() const
-{
- return TQString(d->parent->getObjectPath());
-}
-
-
-#include "knetworkmanager-connection_secrets_dbus.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_secrets_dbus.h b/tdenetworkmanager/src/knetworkmanager-connection_secrets_dbus.h
deleted file mode 100644
index 78a6303..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection_secrets_dbus.h
+++ /dev/null
@@ -1,76 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-devicestore_dbus.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_CONNECTION_SECRETS_DBUS_H
-#define KNETWORKMANAGER_CONNECTION_SECRETS_DBUS_H
-
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include "knetworkmanager-connection_setting.h"
-#include "dbus/connection.h"
-#include "dbus/connectionnode.h"
-
-class AccessPoint;
-class TQT_DBusObjectPath;
-namespace ConnectionSettings
-{
-
- class WirelessSecurity;
- class Connection;
- class ConnectionSetting;
- class ConnectionSecretsDBusPrivate;
-
- // a connection wraps multiple settings
- class ConnectionSecretsDBus : public TQObject, public DBus::Secrets
- {
- Q_OBJECT
-
- public:
- ConnectionSecretsDBus(ConnectionSettings::Connection* parent);
- virtual ~ConnectionSecretsDBus();
-
- void SendGetSecretsReply(ConnectionSettings::ConnectionSetting* setting);
- void SendGetSecretsError();
-
- protected:
- // implementation of the Secrets DBus-interface
- void GetSecretsAsync(int, const TQString&, const TQStringList&, bool);
- void handleMethodReply(const TQT_DBusMessage& reply);
- bool handleSignalSend(const TQT_DBusMessage& reply);
- TQString objectPath() const;
-
- signals:
- void SecretsNeeded(const TQString& setting_name, const TQStringList& hints, bool request_new);
-
- private:
- ConnectionSecretsDBusPrivate* d;
- };
-
-}
-#endif /* KNETWORKMANAGER_CONNECTION_SECRETS_DBUS_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_store.cpp b/tdenetworkmanager/src/knetworkmanager-connection_store.cpp
deleted file mode 100644
index aeb3b60..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection_store.cpp
+++ /dev/null
@@ -1,191 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-connection_store.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#include
-#include
-#include
-
-#include
-#include
-#include
-
-#include "knetworkmanager-connection_store.h"
-#include "knetworkmanager-connection.h"
-#include "knetworkmanager-connection_setting.h"
-#include "knetworkmanager-connection_setting_info.h"
-#include "knetworkmanager-connection_setting_ipv4.h"
-#include "knetworkmanager-connection_setting_wired.h"
-#include "knetworkmanager-connection_setting_wireless.h"
-#include "knetworkmanager-connection_setting_wireless_security.h"
-
-using namespace ConnectionSettings;
-
-static KStaticDeleter sd;
-
-ConnectionStore* ConnectionStore::_instance = NULL;
-
-ConnectionStore*
-ConnectionStore::getInstance()
-{
- if (_instance)
- return _instance;
- return sd.setObject(_instance, new ConnectionStore());
-}
-
-ConnectionStore::ConnectionStore()
- : _connectionList()
-{
- // defer the connection init a bit
- TQTimer::singleShot(0, this, TQT_SLOT(slotInit()));
-}
-
-ConnectionStore::~ConnectionStore()
-{
- for (TQValueList::Iterator it = _connectionList.begin(); it != _connectionList.end(); ++it)
- {
- delete (*it);
- *it = NULL;
- }
-}
-
-void
-ConnectionStore::slotInit()
-{
-
-}
-
-void
-ConnectionStore::slotSecretsNeeded(Connection* conn, ConnectionSetting* setting, const TQStringList& hints, bool request_new)
-{
- kdDebug() << "ConnectionStore::slotSecretsNeeded" << endl;
- emit SecretsNeeded(conn, setting, hints, request_new);
-}
-
-void
-ConnectionStore::addConnection(Connection* con)
-{
- if (_connectionList.find(con) != _connectionList.end())
- {
- con->slotUpdated();
- emit signalConnectionUpdated(con);
- return;
- }
-
- // check if the connection has an ID already
- if (con->getID().isEmpty())
- {
- // set unique id for this connection
- con->setID(createNewConnectionID());
- }
-
- // we own the connection now
- _connectionList.append(con);
-
- // let's get notified if the connection asks for new secrets
- connect(con, TQT_SIGNAL(SecretsNeeded(Connection*, ConnectionSetting*, const TQStringList&, bool)),
- this, TQT_SLOT(slotSecretsNeeded(Connection*, ConnectionSetting*, const TQStringList&, bool)));
-
- // new connection, ring ring
- emit signalConnectionAdded(con);
-}
-
-void
-ConnectionStore::removeConnection(Connection* con)
-{
- // check if the connection is != NULL
- if (!con)
- return;
-
- // remove the object from our list
- if (_connectionList.remove(con) == 0)
- return;
-
- // notify everybody about the removed connection
- emit signalConnectionRemoved(con);
-
- // delete the connection, it will deregister itself from NM
- con->slotAboutToBeRemoved();
- delete con;
-}
-
-Connection*
-ConnectionStore::getConnection(const TQString& obj_path)
-{
- // find a connection by obj_path
- TQValueList::Iterator it = _connectionList.begin();
- for (; it != _connectionList.end(); ++it)
- if (TQString((*it)->getObjectPath()) == obj_path)
- return (*it);
- return NULL;
-}
-
-TQValueList
-ConnectionStore::getConnections(const TQString& type)
-{
- // return a list of connection
- if (type.isEmpty())
- return _connectionList;
- else
- {
- TQValueList ret;
- for (TQValueList::Iterator it = _connectionList.begin(); it != _connectionList.end(); ++it)
- {
- if ( (*it)->getType() == type)
- ret.append(*it);
- }
- return ret;
- }
-}
-
-TQString
-ConnectionStore::createNewConnectionID()
-{
- bool unique;
- TQString id;
-
- do
- {
- unique = true;
-
- // 16 bytes of randomness should be enougth for getting a unique ID
- id = TQUuid::createUuid().toString();
- id = id.replace("{","");
- id = id.replace("}","");
-
- // nevertheless check if the id is used already
- TQValueList::Iterator it = _connectionList.begin();
- for (; it != _connectionList.end(); ++it)
- {
- if ((*it)->getID() == id)
- {
- unique = false;
- break;
- }
- }
- } while (unique == false);
-
- return id;
-}
-
-#include "knetworkmanager-connection_store.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-connection_store.h b/tdenetworkmanager/src/knetworkmanager-connection_store.h
deleted file mode 100644
index a399270..0000000
--- a/tdenetworkmanager/src/knetworkmanager-connection_store.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-connection_store.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_CONNECTION_STORE_H
-#define KNETWORKMANAGER_CONNECTION_STORE_H
-
-#include
-#include
-
-namespace ConnectionSettings
-{
- class Connection;
- class ConnectionSetting;
-}
-
-using namespace ConnectionSettings;
-
-class ConnectionStore : public TQObject
-{
- Q_OBJECT
-
-
- public:
- static ConnectionStore* getInstance();
- ~ConnectionStore();
-
- // add a new connection to the store
- void addConnection(ConnectionSettings::Connection*);
-
- // get all connections
- TQValueList getConnections(const TQString& type = TQString());
-
- // get a connection by ID
- ConnectionSettings::Connection* getConnection(const TQString&);
-
- // delete the specified connection from the store and delete it
- void removeConnection(ConnectionSettings::Connection*);
-
- public slots:
- // has to be called as response to the signal SecretsNeeded
- void slotSecretsNeeded(Connection* connection, ConnectionSetting* setting, const TQStringList& hints, bool request_new);
-
- signals:
- // emitted when a new connection is added to the store
- void signalConnectionAdded(ConnectionSettings::Connection*);
-
- // emitted when a connection was updated
- void signalConnectionUpdated(ConnectionSettings::Connection*);
-
- // emitted when a connection is removed from the store
- void signalConnectionRemoved(ConnectionSettings::Connection*);
-
- // emitted when a connection needs new secrets
- void SecretsNeeded(ConnectionSettings::Connection* connection, ConnectionSettings::ConnectionSetting* setting, const TQStringList& hints, bool request_new);
-
- private slots:
- void slotInit();
-
- private:
- ConnectionStore();
- TQString createNewConnectionID();
-
- TQValueList _connectionList;
- static ConnectionStore* _instance;
-};
-
-#endif /* KNETWORKMANAGER_CONNECTION_STORE_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-device.cpp b/tdenetworkmanager/src/knetworkmanager-device.cpp
deleted file mode 100644
index 585ce8d..0000000
--- a/tdenetworkmanager/src/knetworkmanager-device.cpp
+++ /dev/null
@@ -1,166 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-device.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Timo Hoenig ,
- * Will Stephenson ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#include
-
-#include "knetworkmanager.h"
-#include "knetworkmanager-nm_proxy.h"
-#include "knetworkmanager-device.h"
-#include "dbus/deviceproxy.h"
-#include "knetworkmanager-hal_device_proxy.h"
-
-
-#include
-#include
-
-#include
-#include
-#include
-
-
-class NMDeviceProxy : public DBus::DeviceProxy
-{
- public:
- NMDeviceProxy(const TQString& service, const TQString& path, TQObject* parent = 0, const char* name = 0)
- : DeviceProxy(service, path, parent, name)
- {
-
- }
-
- TQString getObjectPath() const
- {
- return m_baseProxy->path();
- }
-};
-
-class DevicePrivate
-{
-public:
- DevicePrivate(TQString service, TQString obj_path)
- : nmDevice(service, obj_path)
- , halDevice(NULL)
- {}
- ~DevicePrivate() {}
-
- NMDeviceProxy nmDevice;
- HalDeviceProxy* halDevice;
-};
-
-TQ_UINT32 Device::getDeviceType() const
-{
- TQT_DBusError err;
- TQ_UINT32 type = d->nmDevice.getDeviceType(err);
- kdWarning() << k_funcinfo << err.name() << err.message() << endl;
- return type;
-}
-
-TQString Device::getInterface() const
-{
- TQT_DBusError err;
- return d->nmDevice.getInterface(err);
-}
-
-TQString Device::getUdi() const
-{
- TQT_DBusError err;
- return d->nmDevice.getUdi(err);
-}
-
-TQString Device::getDriver() const
-{
- TQT_DBusError err;
- return d->nmDevice.getDriver(err);
-}
-
-TQ_UINT32 Device::getCapabilities() const
-{
- TQT_DBusError err;
- return d->nmDevice.getCapabilities(err);
-}
-
-TQ_INT32 Device::getIp4Address() const
-{
- TQT_DBusError err;
- return d->nmDevice.getIp4Address(err);
-}
-
-NMDeviceState Device::getState() const
-{
- TQT_DBusError err;
- return (NMDeviceState)d->nmDevice.getState(err);
-}
-
-TQString Device::getVendor() const
-{
- // FIXME: ask hal
- return "";
-}
-
-TQString Device::getProduct() const
-{
- // FIXME: ask hal
- return "";
-}
-
-TQString Device::getObjectPath() const
-{
- return d->nmDevice.getObjectPath();
-}
-
-void Device::slotStateChanged(TQ_UINT32 state)
-{
- emit StateChanged((NMDeviceState)state);
-}
-
-void Device::slotDeactivate()
-{
- // FIXME: the method was removed from NM API, use nm_proxy instead
- NMProxy* nm = NMProxy::getInstance();
-
- nm->deactivateDevice(this);
-
-// TQT_DBusError err;
-// d->nmDevice.Deactivate(err);
-}
-
-Device::Device (const TQString & obj_path)
-{
- d = new DevicePrivate(NM_DBUS_SERVICE, obj_path);
-
- // create the NM Device Proxy
- d->nmDevice.setConnection(TQT_DBusConnection::systemBus());
-
- connect(&(d->nmDevice), TQT_SIGNAL(StateChanged(TQ_UINT32)), this, TQT_SLOT(slotStateChanged(TQ_UINT32)));
-// d->halDevice = new HalDeviceProxy();
-}
-
-Device::~Device ()
-{
-// delete d->halDevice;
- delete d;
-}
-
-
-#include "knetworkmanager-device.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-device.h b/tdenetworkmanager/src/knetworkmanager-device.h
deleted file mode 100644
index bd6e863..0000000
--- a/tdenetworkmanager/src/knetworkmanager-device.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-device.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Timo Hoenig ,
- * Will Stephenson ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_DEVICE_H
-#define KNETWORKMANAGER_DEVICE_H
-
-#include "knetworkmanager.h"
-
-#include
-
-class KNetworkManager;
-class Network;
-class IP4Config;
-
-class DevicePrivate;
-
-class Device : public TQObject
-{
- Q_OBJECT
-
- public:
- Device (const TQString & obj_path );
- ~Device ();
-
- TQ_UINT32 getDeviceType() const;
- TQString getInterface() const;
- TQString getUdi() const;
- TQString getDriver() const;
- TQ_UINT32 getCapabilities() const;
- TQ_INT32 getIp4Address() const;
- NMDeviceState getState() const;
-// FIXME: should return IPv4-objects
-// TQDBusObjectPath getIp4Config() const;
-
- TQString getVendor() const;
- TQString getProduct() const;
- TQString getObjectPath() const;
-
- signals:
- void StateChanged(NMDeviceState);
-
- public slots:
- void slotStateChanged(TQ_UINT32);
- void slotDeactivate();
-
- private:
- DevicePrivate * d;
-};
-
-#endif /* KNETWORKMANAGER_DEVICE_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-devicestore.cpp b/tdenetworkmanager/src/knetworkmanager-devicestore.cpp
deleted file mode 100644
index 6f217c1..0000000
--- a/tdenetworkmanager/src/knetworkmanager-devicestore.cpp
+++ /dev/null
@@ -1,220 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-devicestore.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#include
-
-#include "knetworkmanager.h"
-#include "knetworkmanager-devicestore.h"
-#include "knetworkmanager-wired_device.h"
-#include "knetworkmanager-wireless_device.h"
-#include "knetworkmanager-gsm_device.h"
-#include "knetworkmanager-cdma_device.h"
-#include "knetworkmanager-device.h"
-#include "knetworkmanager-nm_proxy.h"
-#include "dbus/deviceproxy.h"
-
-#include
-#include
-#include
-
-#include
-
-#if !defined(NM_CHECK_VERSION)
-#define NM_CHECK_VERSION(x,y,z) 0
-#endif
-
-class DeviceStorePrivate
-{
- public:
- DeviceStorePrivate() {}
- ~DeviceStorePrivate() {}
-
- TQMap devices;
- static DeviceStore* store;
-};
-
-DeviceStore* DeviceStorePrivate::store = NULL;
-
-DeviceStore* DeviceStore::getInstance()
-{
- if (DeviceStorePrivate::store)
- return DeviceStorePrivate::store;
- return (DeviceStorePrivate::store = new DeviceStore());
-}
-
-void DeviceStore::slotDeviceRemoved(const TQT_DBusObjectPath & obj_path)
-{
- kdDebug() << "DeviceStore::slotDeviceRemoved" << endl;
- TQMap::Iterator it = d->devices.find(TQString(obj_path));
- if (it != d->devices.end())
- {
- // remove this device
- Device* dev = it.data();
-
- emit DeviceRemoved(dev);
-
- d->devices.remove(it);
- delete dev;
- dev = NULL;
- }
-}
-
-void DeviceStore::slotDeviceAdded(const TQT_DBusObjectPath & obj_path)
-{
- // just start an update
- Device* dev = createDevice(obj_path);
- if (dev)
- emit DeviceAdded(dev);
-}
-
-Device* DeviceStore::createDevice(const TQT_DBusObjectPath &obj_path)
-{
- TQT_DBusError err;
- // if we have this device already in our list goto the next one
- TQMap::Iterator it = d->devices.find(obj_path);
- if ( it != d->devices.end())
- return it.data();
-
- // FIXME: ugly stuff is going on here, better pass the DeviceProxy to the Device's constructor instead of the object_path
- DBus::DeviceProxy* dev = new DBus::DeviceProxy(NM_DBUS_SERVICE, obj_path);
- Device* new_dev = NULL;
-
- if (dev)
- {
- dev->setConnection(TQT_DBusConnection::systemBus());
- TQ_UINT32 type = dev->getDeviceType(err);
-
- //printf("Device obj_path: %s\n\r", obj_path->data());
-
- // FIXME: This should not be hardcoded, it would be better if wireless, wired etc. modules register their device type
- // select the right device type and create the appropriate objects
- switch(type)
- {
-#if NM_CHECK_VERSION(0,8,992)
- case NM_DEVICE_TYPE_WIFI:
-#else
- case DEVICE_TYPE_802_11_WIRELESS:
-#endif
- new_dev = new WirelessDevice(obj_path);
- break;
-#if NM_CHECK_VERSION(0,8,992)
- case NM_DEVICE_TYPE_ETHERNET:
-#else
- case DEVICE_TYPE_802_3_ETHERNET:
-#endif
- new_dev = new WiredDevice(obj_path);
- break;
-#if NM_CHECK_VERSION(0,8,992)
- case NM_DEVICE_TYPE_MODEM:
-#else
- case DEVICE_TYPE_GSM:
-#endif
- new_dev = new GSMDevice(obj_path);
- break;
-#if NM_CHECK_VERSION(0,8,992)
-#else
- case DEVICE_TYPE_CDMA:
-#endif
- new_dev = new CDMADevice(obj_path);
- break;
- default:
- kdWarning() << k_funcinfo << "Unknown devicetype" << endl;
- new_dev = new Device(obj_path);
- break;
- }
-
- // insert the new device into our list
- if (new_dev)
- d->devices.insert(obj_path, new_dev);
-
- delete dev;
- }
- else
- kdWarning() << k_funcinfo << "Dev is Null" << endl;
-
- return new_dev;
-}
-
-void DeviceStore::updateDevices()
-{
- NMProxy* nm = NMProxy::getInstance();
- TQValueList obj_paths;
- TQT_DBusError err;
-
- // get a list of NM devices
- nm->GetDevices(obj_paths, err);
-
- // create a list of KNM devices
- for (TQValueList::Iterator it = obj_paths.begin(); it != obj_paths.end(); ++it)
- {
- createDevice((*it));
- }
-}
-
-TQValueList DeviceStore::getDevices(TQ_UINT32 type)
-{
- updateDevices();
-
- if (type == 0)
- return d->devices.values();
- else
- {
- // only return devices of a special type
- TQValueList devs;
- for (TQMap::Iterator it = d->devices.begin(); it != d->devices.end(); ++it)
- {
- if (it.data()->getDeviceType() == type)
- devs.append(it.data());
- }
- return devs;
- }
-}
-
-Device* DeviceStore::getDevice(TQT_DBusObjectPath objpath)
-{
- return d->devices[objpath];
-}
-
-DeviceStore::DeviceStore ( TQObject * parent, const char * name ) : TQObject( parent, name )
-{
- d = new DeviceStorePrivate();
-
- // get notified from NM when devices are added or removed
- NMProxy* nm = NMProxy::getInstance();
- connect(nm, TQT_SIGNAL(DeviceAdded(const TQT_DBusObjectPath& )), this, TQT_SLOT(slotDeviceAdded(const TQT_DBusObjectPath&)));
- connect(nm, TQT_SIGNAL(DeviceRemoved(const TQT_DBusObjectPath& )), this, TQT_SLOT(slotDeviceRemoved(const TQT_DBusObjectPath&)));
-}
-
-DeviceStore::~DeviceStore ()
-{
- // delete all devicepointers
- while (d->devices.begin() != d->devices.end())
- delete d->devices.begin().data();
-
- // delete private data
- delete d;
-}
-
-
-#include "knetworkmanager-devicestore.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-devicestore.h b/tdenetworkmanager/src/knetworkmanager-devicestore.h
deleted file mode 100644
index caf8428..0000000
--- a/tdenetworkmanager/src/knetworkmanager-devicestore.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-devicestore.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Timo Hoenig ,
- * Will Stephenson ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_DEVICESTORE_H
-#define KNETWORKMANAGER_DEVICESTORE_H
-
-#include "knetworkmanager.h"
-
-class TQT_DBusObjectPath;
-class DeviceStorePrivate;
-class Device;
-
-class DeviceStore : public TQObject
-{
- Q_OBJECT
-
-
- public:
- static DeviceStore* getInstance();
- TQValueList getDevices(TQ_UINT32 type = 0);
- Device* getDevice(TQT_DBusObjectPath);
-
- public slots:
- void slotDeviceAdded(const TQT_DBusObjectPath&);
- void slotDeviceRemoved(const TQT_DBusObjectPath&);
-
- protected:
- DeviceStore ( TQObject * parent = 0, const char * name = 0);
- ~DeviceStore ();
-
- signals:
- void DeviceStoreChanged();
- void DeviceAdded(Device*);
- void DeviceRemoved(Device*);
-
- private:
- void updateDevices();
- Device* createDevice(const TQT_DBusObjectPath&);
-
- DeviceStorePrivate* d;
-};
-
-#endif /* KNETWORKMANAGER_DEVICESTORE_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-gsm_device.cpp b/tdenetworkmanager/src/knetworkmanager-gsm_device.cpp
deleted file mode 100644
index e978b49..0000000
--- a/tdenetworkmanager/src/knetworkmanager-gsm_device.cpp
+++ /dev/null
@@ -1,67 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-gsm_device.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-// KDE includes
-#include
-
-// TQt includes
-#include
-
-// TQT_DBus includes
-#include
-#include
-
-// NM includes
-#include
-
-// KNM includes
-#include "knetworkmanager.h"
-#include "knetworkmanager-gsm_device.h"
-#include "dbus/gsmproxy.h"
-
-class GSMDevicePrivate
-{
-public:
- GSMDevicePrivate(TQString service, TQString obj_path)
- : nmGSM(service, obj_path)
- {}
- ~GSMDevicePrivate() {}
-
- DBus::GSMDeviceProxy nmGSM;
-};
-
-GSMDevice::GSMDevice (const TQString & obj_path)
- : CellularDevice(obj_path)
-{
- d = new GSMDevicePrivate(NM_DBUS_SERVICE, obj_path);
- d->nmGSM.setConnection(TQT_DBusConnection::systemBus());
-}
-
-GSMDevice::~GSMDevice ()
-{
- delete d;
-}
-
-
-#include "knetworkmanager-gsm_device.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-gsm_device.h b/tdenetworkmanager/src/knetworkmanager-gsm_device.h
deleted file mode 100644
index 6149890..0000000
--- a/tdenetworkmanager/src/knetworkmanager-gsm_device.h
+++ /dev/null
@@ -1,51 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-gsm_device.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Helmut Schaa ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_GSMDEVICE_H
-#define KNETWORKMANAGER_GSMDEVICE_H
-
-// std includes
-#include
-
-// KNM includes
-#include "knetworkmanager.h"
-#include "knetworkmanager-cellular_device.h"
-
-class KNetworkManager;
-
-class GSMDevicePrivate;
-
-class GSMDevice : public CellularDevice
-{
- Q_OBJECT
-
- public:
- GSMDevice (const TQString & obj_path );
- ~GSMDevice ();
-
- private:
- GSMDevicePrivate * d;
-};
-
-#endif /* KNETWORKMANAGER_GSMDEVICE_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-hal_device_proxy.cpp b/tdenetworkmanager/src/knetworkmanager-hal_device_proxy.cpp
deleted file mode 100644
index dda50aa..0000000
--- a/tdenetworkmanager/src/knetworkmanager-hal_device_proxy.cpp
+++ /dev/null
@@ -1,126 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-device.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Timo Hoenig ,
- * Will Stephenson ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#include "knetworkmanager.h"
-#include "knetworkmanager-hal_device_proxy.h"
-
-#include
-#include
-
-class HalDeviceProxyPrivate
-{
-public:
- HalDeviceProxyPrivate() {}
- ~HalDeviceProxyPrivate() {}
-
- void getHalProperty (const TQCString& udi, const TQCString& property, TQCString& result);
-
- TQString udi;
-};
-
-HalDeviceProxy::HalDeviceProxy (const TQString & udi)
-{
- d = new HalDeviceProxyPrivate;
- d->udi = udi;
-}
-
-HalDeviceProxy::~HalDeviceProxy ()
-{
- delete d;
-}
-
-bustype
-HalDeviceProxy::getBustype () const
-{
- TQCString device_udi = d->udi.utf8();
- TQCString parent_udi = "";
- TQCString subsystem = "";
-
- d->getHalProperty (device_udi, "info.parent", parent_udi);
- d->getHalProperty (parent_udi, "linux.subsystem", subsystem);
-
- if (TQString::compare (subsystem, "pci") == 0)
- return BUS_PCI;
- else if (TQString::compare (subsystem, "usb") == 0)
- return BUS_USB;
- else if (TQString::compare (subsystem, "pcmcia") == 0)
- return BUS_PCMCIA;
- else
- return BUS_UNKNOWN;
-}
-
-TQString
-HalDeviceProxy::getProduct () const
-{
- return "";
-}
-
-TQString
-HalDeviceProxy::getVendor () const
-{
- return "";
-}
-
-void
-HalDeviceProxyPrivate::getHalProperty (const TQCString& udi, const TQCString& property, TQCString& result)
-{
-//FIXME: convert to qt3-dbus-api
-/*
- DBusConnection* con = _ctx->getDBus ()->getConnection ();
- LibHalContext* hal_ctx = NULL;
- char* prop_val = NULL;
-
- if (!con || !property) {
- goto out;
- }
-
- if (!dbus_bus_name_has_owner (con, "org.freedesktop.Hal", NULL)) {
- kdDebug() << "Error: HAL seems not to be running." << endl;
- goto out;
- }
-
- hal_ctx = libhal_ctx_new ();
-
- if (!libhal_ctx_set_dbus_connection (hal_ctx, con)) {
- goto out;
- }
-
- if (!libhal_ctx_init (hal_ctx, NULL)) {
- goto out;
- }
-
- prop_val = libhal_device_get_property_string (hal_ctx, udi, property, NULL);
- result = prop_val;
- libhal_free_string (prop_val);
-out:
- if (hal_ctx) {
- libhal_ctx_shutdown (hal_ctx, NULL);
- libhal_ctx_free (hal_ctx);
- }
-*/
- return;
-}
-
-#include "knetworkmanager-hal_device_proxy.moc"
diff --git a/tdenetworkmanager/src/knetworkmanager-hal_device_proxy.h b/tdenetworkmanager/src/knetworkmanager-hal_device_proxy.h
deleted file mode 100644
index 663301e..0000000
--- a/tdenetworkmanager/src/knetworkmanager-hal_device_proxy.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-device.h - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Timo Hoenig ,
- * Will Stephenson ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-#ifndef KNETWORKMANAGER_HALDEVICEPROXY_H
-#define KNETWORKMANAGER_HALDEVICEPROXY_H
-
-// KNM includes
-#include "knetworkmanager.h"
-
-// HAL includes
-#include
-
-// std includes
-#include
-
-class KNetworkManager;
-
-enum bustype {
- BUS_PCI = 0,
- BUS_USB = 1,
- BUS_PCMCIA = 2,
- BUS_UNKNOWN = 15
-};
-
-class HalDeviceProxyPrivate;
-
-class HalDeviceProxy : public TQObject
-{
- Q_OBJECT
-
- public:
- HalDeviceProxy (const TQString & udi);
- ~HalDeviceProxy ();
-
- bustype getBustype (void) const;
- TQString getProduct (void) const;
- TQString getVendor (void) const;
-
- private:
- HalDeviceProxyPrivate * d;
-};
-
-#endif /* KNETWORKMANAGER_HALDEVICEPROXY_H */
diff --git a/tdenetworkmanager/src/knetworkmanager-nm_proxy.cpp b/tdenetworkmanager/src/knetworkmanager-nm_proxy.cpp
deleted file mode 100644
index 3cfe642..0000000
--- a/tdenetworkmanager/src/knetworkmanager-nm_proxy.cpp
+++ /dev/null
@@ -1,329 +0,0 @@
-/***************************************************************************
- *
- * knetworkmanager-device.cpp - A NetworkManager frontend for KDE
- *
- * Copyright (C) 2005, 2006 Novell, Inc.
- *
- * Author: Timo Hoenig ,
- * Will Stephenson ,
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
- *
- **************************************************************************/
-
-// KDE includes
-#include
-
-// TQtDBus includes
-#include
-#include
-#include
-#include
-#include
-#include
-
-// NM includes
-#include
-
-// KNM includes
-#include "knetworkmanager.h"
-#include "knetworkmanager-nm_proxy.h"
-#include "knetworkmanager-device.h"
-#include "knetworkmanager-devicestore.h"
-#include "knetworkmanager-connection.h"
-#include "knetworkmanager-connection_store.h"
-#include "dbus/activeconnectionproxy.h"
-
-class NMProxyPrivate
-{
- public:
- NMProxyPrivate()
- {}
-
- static NMProxy* nm;
-};
-
-NMProxy* NMProxyPrivate::nm = NULL;
-
-Device* NMProxy::getDefaultDevice()
-{
- TQT_DBusObjectPath connpath = getDefaultActiveConnection();
- if (!connpath.isEmpty())
- {
- TQT_DBusObjectPath devpath = getDeviceForActiveConnection(connpath);
- if (!devpath.isEmpty())
- return DeviceStore::getInstance()->getDevice(devpath);
- }
- return NULL;
-}
-
-TQT_DBusObjectPath NMProxy::getDeviceForActiveConnection(TQT_DBusObjectPath act_conn_path)
-{
- TQT_DBusError err;
-
- // we need a proxy for every active connection
- DBus::ActiveConnectionProxy* act_conn = new DBus::ActiveConnectionProxy(NM_DBUS_SERVICE, act_conn_path);
- act_conn->setConnection(TQT_DBusConnection::systemBus());
-
- if (act_conn)
- {
- // get details about the active connection
- TQValueList devs = act_conn->getDevices(err);
- if (!devs.isEmpty())
- return devs.first();
- delete act_conn;
- }
-
- return TQT_DBusObjectPath();
-
-}
-
-TQT_DBusObjectPath NMProxy::getDefaultActiveConnection()
-{
- TQT_DBusError err;
- TQValueList connections;
-
- // get a list of all active connections from NM
- connections = NetworkManagerProxy::getActiveConnections(err);
-
- for (TQValueList::Iterator it = connections.begin(); it != connections.end(); ++it)
- {
- // we need a proxy for every active connection
- DBus::ActiveConnectionProxy* act_conn = new DBus::ActiveConnectionProxy(NM_DBUS_SERVICE, (*it));
- act_conn->setConnection(TQT_DBusConnection::systemBus());
-
- if (act_conn)
- {
- if (act_conn->getDefault(err))
- {
- delete act_conn;
- return *it;
- }
- delete act_conn;
- }
-
- }
-
- return TQT_DBusObjectPath();
-
-}
-
-ConnectionSettings::Connection* NMProxy::getActiveConnection(const Device* dev)
-{
- TQT_DBusError err;
- TQValueList connections;
-
- // get a list of all active connections from NM
- connections = NetworkManagerProxy::getActiveConnections(err);
-
- for (TQValueList::Iterator it = connections.begin(); it != connections.end(); ++it)
- {
- // we need a proxy for every active connection
- DBus::ActiveConnectionProxy* act_conn = new DBus::ActiveConnectionProxy(NM_DBUS_SERVICE, (*it));
- act_conn->setConnection(TQT_DBusConnection::systemBus());
-
- if (act_conn)
- {
- // get details about the active connection
- TQString service = act_conn->getServiceName(err);
- TQT_DBusObjectPath conn = act_conn->getConnection(err);
- TQT_DBusObjectPath specific_obj = act_conn->getSpecificObject(err);
- TQValueList devs = act_conn->getDevices(err);
- for (TQValueList::Iterator it2 = devs.begin(); it2 != devs.end(); ++it2)
- {
- if (TQString(*it2) == dev->getObjectPath())
- {
- // here is the connection we were looking for
- ConnectionStore* cstore = ConnectionStore::getInstance();
- if (cstore)
- return cstore->getConnection(TQString(conn));
- }
- }
- delete act_conn;
- }
-
- }
-
- return NULL;
-}
-
-TQValueList > NMProxy::getActiveConnectionsMap()
-{
- TQT_DBusError err;
- TQValueList connections;
- TQValueList > map;
- ConnectionStore* cstore = ConnectionStore::getInstance();
- DeviceStore* dstore = DeviceStore::getInstance();
- bool found = false;
-
- if (!dstore || !cstore)
- return map;
-
- // get a list of all active connections from NM
- connections = NetworkManagerProxy::getActiveConnections(err);
-
- for (TQValueList::Iterator it = connections.begin(); it != connections.end(); ++it)
- {
- // we need a proxy for every active connection
- DBus::ActiveConnectionProxy* act_conn = new DBus::ActiveConnectionProxy(NM_DBUS_SERVICE, (*it));
- act_conn->setConnection(TQT_DBusConnection::systemBus());
-
- if (act_conn)
- {
- // get details about the active connection
- TQString service = act_conn->getServiceName(err);
- TQT_DBusObjectPath conn = act_conn->getConnection(err);
- TQT_DBusObjectPath specific_obj = act_conn->getSpecificObject(err);
- TQValueList devs = act_conn->getDevices(err);
- found = false;
- for (TQValueList::Iterator it2 = devs.begin(); it2 != devs.end(); ++it2)
- {
- Device* device = dstore->getDevice(*it2);
- ConnectionSettings::Connection* connection = cstore->getConnection(TQString(conn));
- if (connection)
- {
- map.append(TQPair(connection, device));
- found = true;
- }
- }
- if (!found)
- {
- // no device found for this connection -> just add it without device
- ConnectionSettings::Connection* connection = cstore->getConnection(TQString(conn));
- if (connection)
- map.append(TQPair(connection, NULL));
- }
- delete act_conn;
- }
-
- }
-
- return map;
-}
-
-NMProxy::NMProxy()
- : NetworkManagerProxy(NM_DBUS_SERVICE, NM_DBUS_PATH)
-{
- d = new NMProxyPrivate();
- NetworkManagerProxy::setConnection(TQT_DBusConnection::systemBus());
-}
-
-void NMProxy::deactivateConnection(const ConnectionSettings::Connection* conn, const Device* dev)
-{
- TQT_DBusError err;
- TQValueList connections;
-
- // get a list of all active connections from NM
- connections = NetworkManagerProxy::getActiveConnections(err);
-
- for (TQValueList