summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/TODO6
-rw-r--r--noncore/net/networksetup/interfaces/interface.cpp2
-rw-r--r--noncore/net/networksetup/interfaces/interface.h41
-rw-r--r--noncore/net/networksetup/interfaces/interfaces.cpp6
-rw-r--r--noncore/net/networksetup/interfaces/interfaces.h8
-rw-r--r--noncore/net/networksetup/interfaces/interfaces.pro2
-rw-r--r--noncore/net/networksetup/ppp/pppmodule.cpp23
-rw-r--r--noncore/net/networksetup/wlan/infoimp.cpp3
-rw-r--r--noncore/settings/networksettings/TODO6
-rw-r--r--noncore/settings/networksettings/interfaces/interface.cpp2
-rw-r--r--noncore/settings/networksettings/interfaces/interface.h41
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.cpp6
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.h8
-rw-r--r--noncore/settings/networksettings/interfaces/interfaces.pro2
-rw-r--r--noncore/settings/networksettings/ppp/pppmodule.cpp23
-rw-r--r--noncore/settings/networksettings/wlan/infoimp.cpp3
16 files changed, 94 insertions, 88 deletions
diff --git a/noncore/net/networksetup/TODO b/noncore/net/networksetup/TODO
index 04b3a7c..020339f 100644
--- a/noncore/net/networksetup/TODO
+++ b/noncore/net/networksetup/TODO
@@ -1,16 +1,14 @@
1AndyQ - Fixed a bug in wlanimp.cpp : accept method - put braces round key 1test WEP
2 field if so that settings get saved if WEP is enabled 2WEP key in file wireless.conf is not encrypted !, therefore it is very easy to get the key out of the zaurus..
3
4CLEAN UP
5 3
6udchcp needs to output the dhcp information so interfaces can read it 4udchcp needs to output the dhcp information so interfaces can read it
7 5
8interfacesetupimp really doesn't need a interface* pointer 6interfacesetupimp really doesn't need a interface* pointer
9 7
10Possible other modules to write: ppp, ipsec, bluetooth, ipchains 8Possible other modules to write: ppp, ipsec, bluetooth, ipchains
11 9
12PPP module needs to scan pppd.tdb to see what is currently active 10PPP module needs to scan pppd.tdb to see what is currently active
13 11
14WLAN - add possiblity to input text or hex without knowing "s:" 12WLAN - add possiblity to input text or hex without knowing "s:"
15 13
16Interface setupimp needs to use kernel calls. 14Interface setupimp needs to use kernel calls.
diff --git a/noncore/net/networksetup/interfaces/interface.cpp b/noncore/net/networksetup/interfaces/interface.cpp
index 4129b3d..7ffa76f 100644
--- a/noncore/net/networksetup/interfaces/interface.cpp
+++ b/noncore/net/networksetup/interfaces/interface.cpp
@@ -2,25 +2,25 @@
2#include <qdatetime.h> 2#include <qdatetime.h>
3#include <qfile.h> 3#include <qfile.h>
4#include <qdir.h> 4#include <qdir.h>
5#include <qfileinfo.h> 5#include <qfileinfo.h>
6#include <qtextstream.h> 6#include <qtextstream.h>
7 7
8#define IFCONFIG "/sbin/ifconfig" 8#define IFCONFIG "/sbin/ifconfig"
9#define DHCP_INFO_DIR "/etc/dhcpc" 9#define DHCP_INFO_DIR "/etc/dhcpc"
10 10
11#include <stdio.h> 11#include <stdio.h>
12#include <stdlib.h> 12#include <stdlib.h>
13 13
14Interface::Interface(QObject * parent, const char * name, bool newSatus): QObject(parent, name), status(newSatus), attached(false), hardwareName("Unknown"), moduleOwner(NULL), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){ 14Interface::Interface(QObject * parent, const char * name, bool newSatus): QObject(parent, name), hardwareName("Unknown"), moduleOwner(NULL), status(newSatus), attached(false), dhcp(false), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"){
15 refresh(); 15 refresh();
16} 16}
17 17
18/** 18/**
19 * Set status 19 * Set status
20 * @param newStatus - the new status 20 * @param newStatus - the new status
21 * emit updateInterface 21 * emit updateInterface
22 */ 22 */
23void Interface::setStatus(bool newStatus){ 23void Interface::setStatus(bool newStatus){
24 if(status != newStatus){ 24 if(status != newStatus){
25 status = newStatus; 25 status = newStatus;
26 refresh(); 26 refresh();
diff --git a/noncore/net/networksetup/interfaces/interface.h b/noncore/net/networksetup/interfaces/interface.h
index 989d6d8..d37834a 100644
--- a/noncore/net/networksetup/interfaces/interface.h
+++ b/noncore/net/networksetup/interfaces/interface.h
@@ -7,65 +7,66 @@
7class Module; 7class Module;
8 8
9class Interface : public QObject{ 9class Interface : public QObject{
10 Q_OBJECT 10 Q_OBJECT
11 11
12signals: 12signals:
13 void updateInterface(Interface *i); 13 void updateInterface(Interface *i);
14 void updateMessage(const QString &message); 14 void updateMessage(const QString &message);
15 15
16public: 16public:
17 Interface(QObject * parent=0, const char * name= "unknown", bool status = false); 17 Interface(QObject * parent=0, const char * name= "unknown", bool status = false);
18 18
19 QString getInterfaceName(){ QString n(this->name()); return n; }; 19 QString getInterfaceName() const { QString n(this->name()); return n; };
20 20
21 bool getStatus(){ return status; }; 21 bool getStatus() const { return status; };
22 void setStatus(bool newStatus); 22 void setStatus(bool newStatus);
23 23
24 bool isAttached(){ return attached; }; 24 bool isAttached() const { return attached; };
25 void setAttached(bool isAttached=false); 25 void setAttached(bool isAttached=false);
26 26
27 QString getHardwareName(){ return hardwareName; }; 27 QString getHardwareName() const { return hardwareName; };
28 void setHardwareName(const QString &name="Unknown"); 28 void setHardwareName(const QString &name="Unknown");
29 29
30 Module* getModuleOwner(){ return moduleOwner; }; 30 Module* getModuleOwner() const { return moduleOwner; };
31 void setModuleOwner(Module *owner=NULL); 31 void setModuleOwner(Module *owner=NULL);
32 32
33 // inet information. 33 // inet information.
34 QString getMacAddress(){ return macAddress; }; 34 QString getMacAddress() const { return macAddress; };
35 QString getIp(){ return ip; }; 35 QString getIp() const { return ip; };
36 QString getSubnetMask(){ return subnetMask; }; 36 QString getSubnetMask() const { return subnetMask; };
37 QString getBroadcast(){ return broadcast; }; 37 QString getBroadcast() const { return broadcast; };
38 bool isDhcp(){ return dhcp; }; 38 bool isDhcp() const { return dhcp; };
39 QString getDhcpServerIp(){ return dhcpServerIp; }; 39 QString getDhcpServerIp() const { return dhcpServerIp; };
40 QString getLeaseObtained(){ return leaseObtained; }; 40 QString getLeaseObtained() const { return leaseObtained; };
41 QString getLeaseExpires(){ return leaseExpires; }; 41 QString getLeaseExpires() const { return leaseExpires; };
42 42
43public slots: 43public slots:
44 bool refresh(); 44 bool refresh();
45 void start(); 45 void start();
46 void stop(); 46 void stop();
47 void restart(); 47 void restart();
48 48
49private: 49private:
50 // Interface information 50 // Interface information
51 bool status;
52 bool attached;
53 QString hardwareName; 51 QString hardwareName;
54 Module *moduleOwner; 52 Module *moduleOwner;
55 53 bool status;
54 bool attached;
55
56 // Network information 56 // Network information
57 QString macAddress;
58 QString ip;
59 QString broadcast;
60 QString subnetMask;
61 bool dhcp; 57 bool dhcp;
62 QString dhcpServerIp; 58 QString dhcpServerIp;
63 QString leaseObtained; 59 QString leaseObtained;
64 QString leaseExpires; 60 QString leaseExpires;
65 61
62 QString macAddress;
63 QString ip;
64 QString broadcast;
65 QString subnetMask;
66
66}; 67};
67 68
68#endif 69#endif
69 70
70// interface.h 71// interface.h
71 72
diff --git a/noncore/net/networksetup/interfaces/interfaces.cpp b/noncore/net/networksetup/interfaces/interfaces.cpp
index e49998e..8f685fe 100644
--- a/noncore/net/networksetup/interfaces/interfaces.cpp
+++ b/noncore/net/networksetup/interfaces/interfaces.cpp
@@ -62,25 +62,25 @@ QStringList Interfaces::getInterfaceList(){
62 } 62 }
63 } 63 }
64 } 64 }
65 return list; 65 return list;
66} 66}
67 67
68/** 68/**
69 * Find out if interface is in an "auto" group or not. 69 * Find out if interface is in an "auto" group or not.
70 * Report any duplicates such as eth0 being in two differnt auto's 70 * Report any duplicates such as eth0 being in two differnt auto's
71 * @param interface interface to check to see if it is on or not. 71 * @param interface interface to check to see if it is on or not.
72 * @return true is interface is in auto 72 * @return true is interface is in auto
73 */ 73 */
74bool Interfaces::isAuto(const QString &interface){ 74bool Interfaces::isAuto(const QString &interface) const {
75 QStringList autoLines = interfaces.grep(QRegExp(AUTO)); 75 QStringList autoLines = interfaces.grep(QRegExp(AUTO));
76 QStringList awi = autoLines.grep(QRegExp(interface)); 76 QStringList awi = autoLines.grep(QRegExp(interface));
77 if(awi.count() > 1) 77 if(awi.count() > 1)
78 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); 78 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1());
79 if(awi.count() < 1) 79 if(awi.count() < 1)
80 return false; 80 return false;
81 return true; 81 return true;
82} 82}
83 83
84/** 84/**
85 * Attempt to set the auto option for interface to setAuto. 85 * Attempt to set the auto option for interface to setAuto.
86 * @param interface the interface to set 86 * @param interface the interface to set
@@ -130,26 +130,26 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){
130 * @return bool true if it is successfull. 130 * @return bool true if it is successfull.
131 */ 131 */
132bool Interfaces::setInterface(QString interface){ 132bool Interfaces::setInterface(QString interface){
133 interface = interface.simplifyWhiteSpace(); 133 interface = interface.simplifyWhiteSpace();
134 interface = interface.replace(QRegExp(" "), ""); 134 interface = interface.replace(QRegExp(" "), "");
135 return setStanza(IFACE, interface, currentIface); 135 return setStanza(IFACE, interface, currentIface);
136} 136}
137 137
138/** 138/**
139 * A quick helper funtion to see if the current interface is set. 139 * A quick helper funtion to see if the current interface is set.
140 * @return bool true if set, false otherwise. 140 * @return bool true if set, false otherwise.
141 */ 141 */
142bool Interfaces::isInterfaceSet(){ 142bool Interfaces::isInterfaceSet() const {
143 return (currentIface != interfaces.end()); 143 return (interfaces.end() != currentIface);
144} 144}
145 145
146/** 146/**
147 * Add a new interface of with the settings - family and method 147 * Add a new interface of with the settings - family and method
148 * @param interface the name of the interface to set. All whitespace is 148 * @param interface the name of the interface to set. All whitespace is
149 * removed from the interface name. 149 * removed from the interface name.
150 * @param family the family of this interface inet or inet, ipx or inet6 150 * @param family the family of this interface inet or inet, ipx or inet6
151 * Must of one of the families defined in interfaces.h 151 * Must of one of the families defined in interfaces.h
152 * @param method for the family. see interfaces man page for family methods. 152 * @param method for the family. see interfaces man page for family methods.
153 * @return true if successfull. 153 * @return true if successfull.
154 */ 154 */
155bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 155bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
diff --git a/noncore/net/networksetup/interfaces/interfaces.h b/noncore/net/networksetup/interfaces/interfaces.h
index d662919..bac2a7e 100644
--- a/noncore/net/networksetup/interfaces/interfaces.h
+++ b/noncore/net/networksetup/interfaces/interfaces.h
@@ -16,61 +16,61 @@
16 16
17/** 17/**
18 * This class provides a clean frontend for parsing the network interfaces file. 18 * This class provides a clean frontend for parsing the network interfaces file.
19 * It provides helper functions to minipulate the options within the file. 19 * It provides helper functions to minipulate the options within the file.
20 * See the interfaces man page for the syntax rules. 20 * See the interfaces man page for the syntax rules.
21 */ 21 */
22class Interfaces { 22class Interfaces {
23 23
24public: 24public:
25 Interfaces(QString useInterfacesFile = "/etc/network/interfaces"); 25 Interfaces(QString useInterfacesFile = "/etc/network/interfaces");
26 QStringList getInterfaceList(); 26 QStringList getInterfaceList();
27 27
28 bool isAuto(const QString &interface); 28 bool isAuto(const QString &interface) const ;
29 bool setAuto(const QString &interface, bool setAuto); 29 bool setAuto(const QString &interface, bool setAuto);
30 30
31 bool removeInterface(); 31 bool removeInterface();
32 bool addInterface(const QString &interface, const QString &family, const QString &method); 32 bool addInterface(const QString &interface, const QString &family, const QString &method);
33 bool copyInterface(const QString &oldInterface, const QString &newInterface); 33 bool copyInterface(const QString &oldInterface, const QString &newInterface);
34 bool setInterface(QString interface); 34 bool setInterface(QString interface);
35 bool isInterfaceSet(); 35 bool isInterfaceSet() const ;
36 QString getInterfaceName(bool &error); 36 QString getInterfaceName(bool &error);
37 bool setInterfaceName(const QString &newName); 37 bool setInterfaceName(const QString &newName);
38 QString getInterfaceFamily(bool &error); 38 QString getInterfaceFamily(bool &error);
39 bool setInterfaceFamily(const QString &newName); 39 bool setInterfaceFamily(const QString &newName);
40 QString getInterfaceMethod(bool &error); 40 QString getInterfaceMethod(bool &error);
41 bool setInterfaceMethod(const QString &newName); 41 bool setInterfaceMethod(const QString &newName);
42 QString getInterfaceOption(const QString &option, bool &error); 42 QString getInterfaceOption(const QString &option, bool &error);
43 bool setInterfaceOption(const QString &option, const QString &value); 43 bool setInterfaceOption(const QString &option, const QString &value);
44 bool removeInterfaceOption(const QString &option, const QString &value); 44 bool removeInterfaceOption(const QString &option, const QString &value);
45 bool removeAllInterfaceOptions(); 45 bool removeAllInterfaceOptions();
46 46
47 bool setMapping(const QString &interface); 47 bool setMapping(const QString &interface);
48 bool removeMapping(); 48 bool removeMapping();
49 void addMapping(const QString &options); 49 void addMapping(const QString &options);
50 bool setMap(const QString &map, const QString &value); 50 bool setMap(const QString &map, const QString &value);
51 bool removeMap(const QString &map, const QString &value); 51 bool removeMap(const QString &map, const QString &value);
52 QString getMap(const QString &map, bool &error); 52 QString getMap(const QString &map, bool &error);
53 bool setScript(const QString &argument); 53 bool setScript(const QString &argument);
54 QString getScript(bool &error); 54 QString getScript(bool &error);
55 55
56 bool write(); 56 bool write();
57 57
58private: 58private:
59 bool setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator); 59 bool setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator);
60 bool removeStanza(QStringList::Iterator &stanza);
60 bool setOption(const QStringList::Iterator &start, const QString &option, const QString &value); 61 bool setOption(const QStringList::Iterator &start, const QString &option, const QString &value);
62 bool removeAllOptions(const QStringList::Iterator &start);
61 bool removeOption(const QStringList::Iterator &start, const QString &option, const QString &value); 63 bool removeOption(const QStringList::Iterator &start, const QString &option, const QString &value);
62 QString getOption(const QStringList::Iterator &start, const QString &option, bool &error); 64 QString getOption(const QStringList::Iterator &start, const QString &option, bool &error);
63 bool removeStanza(QStringList::Iterator &stanza);
64 bool removeAllOptions(const QStringList::Iterator &start);
65 65
66 QString interfacesFile; 66 QString interfacesFile;
67 QStringList interfaces; 67 QStringList interfaces;
68 QStringList::Iterator currentIface; 68 QStringList::Iterator currentIface;
69 QStringList::Iterator currentMapping; 69 QStringList::Iterator currentMapping;
70 70
71 QStringList acceptedFamily; 71 QStringList acceptedFamily;
72}; 72};
73 73
74#endif 74#endif
75 75
76// interfaces 76// interfaces
diff --git a/noncore/net/networksetup/interfaces/interfaces.pro b/noncore/net/networksetup/interfaces/interfaces.pro
index 9a024f6..d6b43fb 100644
--- a/noncore/net/networksetup/interfaces/interfaces.pro
+++ b/noncore/net/networksetup/interfaces/interfaces.pro
@@ -1,12 +1,12 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 #CONFIG += qt warn_on debug 3 #CONFIG += qt warn_on debug
4 DESTDIR = $(QTDIR)/lib$(PROJMAK) 4 #DESTDIR = $(QTDIR)/lib$(PROJMAK)
5 HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h 5 HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h
6 SOURCES = interface.cpp interfaces.cpp interfaceinformationimp.cpp interfacesetupimp.cpp 6 SOURCES = interface.cpp interfaces.cpp interfaceinformationimp.cpp interfacesetupimp.cpp
7 INCLUDEPATH+= $(OPIEDIR)/include ../ 7 INCLUDEPATH+= $(OPIEDIR)/include ../
8 DEPENDPATH+= $(OPIEDIR)/include 8 DEPENDPATH+= $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe
10 INTERFACES= interfaceadvanced.ui interfaceinformation.ui interfacesetup.ui 10 INTERFACES= interfaceadvanced.ui interfaceinformation.ui interfacesetup.ui
11 TARGET = interfaces 11 TARGET = interfaces
12 VERSION = 1.0.0 12 VERSION = 1.0.0
diff --git a/noncore/net/networksetup/ppp/pppmodule.cpp b/noncore/net/networksetup/ppp/pppmodule.cpp
index 68bb0a0..72cd45e 100644
--- a/noncore/net/networksetup/ppp/pppmodule.cpp
+++ b/noncore/net/networksetup/ppp/pppmodule.cpp
@@ -1,13 +1,14 @@
1#include "pppmodule.h" 1#include "pppmodule.h"
2#include "pppimp.h"
2#include "interfaceinformationimp.h" 3#include "interfaceinformationimp.h"
3 4
4/** 5/**
5 * Constructor, find all of the possible interfaces 6 * Constructor, find all of the possible interfaces
6 */ 7 */
7PPPModule::PPPModule() : Module() { 8PPPModule::PPPModule() : Module() {
8} 9}
9 10
10/** 11/**
11 * Delete any interfaces that we own. 12 * Delete any interfaces that we own.
12 */ 13 */
13PPPModule::~PPPModule(){ 14PPPModule::~PPPModule(){
@@ -29,74 +30,76 @@ void PPPModule::setProfile(const QString &newProfile){
29 * @return QString the icon name (minus .png, .gif etc) 30 * @return QString the icon name (minus .png, .gif etc)
30 */ 31 */
31QString PPPModule::getPixmapName(Interface* ){ 32QString PPPModule::getPixmapName(Interface* ){
32 return "ppp"; 33 return "ppp";
33} 34}
34 35
35/** 36/**
36 * Check to see if the interface i is owned by this module. 37 * Check to see if the interface i is owned by this module.
37 * @param Interface* interface to check against 38 * @param Interface* interface to check against
38 * @return bool true if i is owned by this module, false otherwise. 39 * @return bool true if i is owned by this module, false otherwise.
39 */ 40 */
40bool PPPModule::isOwner(Interface *i){ 41bool PPPModule::isOwner(Interface *i){
41 // Scan the ppp database 42 if(!i->getInterfaceName().upper().contains("PPP"))
42 return false; 43 return false;
43 44
44 i->setHardwareName("PPP"); 45 i->setHardwareName("PPP");
45 list.append(i); 46 list.append(i);
46 return true; 47 return true;
47} 48}
48 49
49/** 50/**
50 * Create, and return the WLANConfigure Module 51 * Create, and return the WLANConfigure Module
51 * @return QWidget* pointer to this modules configure. 52 * @return QWidget* pointer to this modules configure.
52 */ 53 */
53QWidget *PPPModule::configure(Interface *i){ 54QWidget *PPPModule::configure(Interface *i){
54 return NULL; 55 return NULL;
55 //PPPConfigureImp *pppconfig = new PPPConfigureImp(0, "PPPConfig", i, false, Qt::WDestructiveClose); 56 //PPPConfigureImp *pppconfig = new PPPConfigureImp(0, "PPPConfig", i, false, Qt::WDestructiveClose);
56 //pppconfig->setProfile(profile); 57 //pppconfig->setProfile(profile);
57 //return wlanconfig; 58 //return wlanconfig;
58} 59}
59 60
60/** 61/**
61 * Create, and return the Information Module 62 * Create, and return the Information Module
62 * @return QWidget* pointer to this modules info. 63 * @return QWidget* pointer to this modules info.
63 */ 64 */
64QWidget *PPPModule::information(Interface *i){ 65QWidget *PPPModule::information(Interface *i){
65 return NULL; 66 // We don't have any advanced pppd information widget yet :-D
66 67 // TODO ^
67 //WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); 68 InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i);
68 //InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); 69 return information;
69 //info->tabWidget->insertTab(information, "TCP/IP");
70 //return info;
71} 70}
72 71
73/** 72/**
74 * Get all active (up or down) interfaces 73 * Get all active (up or down) interfaces
75 * @return QList<Interface> A list of interfaces that exsist that havn't 74 * @return QList<Interface> A list of interfaces that exsist that havn't
76 * been called by isOwner() 75 * been called by isOwner()
77 */ 76 */
78QList<Interface> PPPModule::getInterfaces(){ 77QList<Interface> PPPModule::getInterfaces(){
78 // List all of the files in the peer directory
79 return list; 79 return list;
80} 80}
81 81
82/** 82/**
83 * Attempt to add a new interface as defined by name 83 * Attempt to add a new interface as defined by name
84 * @param name the name of the type of interface that should be created given 84 * @param name the name of the type of interface that should be created given
85 * by possibleNewInterfaces(); 85 * by possibleNewInterfaces();
86 * @return Interface* NULL if it was unable to be created. 86 * @return Interface* NULL if it was unable to be created.
87 */ 87 */
88Interface *PPPModule::addNewInterface(const QString &newInterface){ 88Interface *PPPModule::addNewInterface(const QString &newInterface){
89 // We can't add a 802.11 interface, either the hardware will be there 89 // If the
90 // or it wont. 90 PPPConfigureImp imp(0, "PPPConfigImp");
91 if(imp.exec() == QDialog::Accepted ){
92
93 }
91 return NULL; 94 return NULL;
92} 95}
93 96
94/** 97/**
95 * Attempts to remove the interface, doesn't delete i 98 * Attempts to remove the interface, doesn't delete i
96 * @return bool true if successfull, false otherwise. 99 * @return bool true if successfull, false otherwise.
97 */ 100 */
98bool PPPModule::remove(Interface*){ 101bool PPPModule::remove(Interface*){
99 // Can't remove a hardware device, you can stop it though. 102 // Can't remove a hardware device, you can stop it though.
100 return false; 103 return false;
101} 104}
102 105
diff --git a/noncore/net/networksetup/wlan/infoimp.cpp b/noncore/net/networksetup/wlan/infoimp.cpp
index e1eef81..6d3e167 100644
--- a/noncore/net/networksetup/wlan/infoimp.cpp
+++ b/noncore/net/networksetup/wlan/infoimp.cpp
@@ -1,27 +1,28 @@
1#include "infoimp.h" 1#include "infoimp.h"
2#include "wextensions.h" 2#include "wextensions.h"
3
3#include <qtimer.h> 4#include <qtimer.h>
4#include <qprogressbar.h> 5#include <qprogressbar.h>
5#include <qlabel.h> 6#include <qlabel.h>
6 7
7/** 8/**
8 * Constructor. If wireless extensions are enabled on device name then 9 * Constructor. If wireless extensions are enabled on device name then
9 * start a timer that every second will update the information. 10 * start a timer that every second will update the information.
10 */ 11 */
11WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){ 12WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){
12 WExtensions *wExtensions = new WExtensions(name); 13 WExtensions *wExtensions = new WExtensions(name);
13 if(!wExtensions->doesHaveWirelessExtensions()){ 14 if(!wExtensions->doesHaveWirelessExtensions()){
14 delete wExtensions; 15 delete wExtensions;
15 qDebug("No extension"); 16 qDebug("WlanInfoImp::No wireless extension");
16 return; 17 return;
17 } 18 }
18 delete wExtensions; 19 delete wExtensions;
19 timer = new QTimer( this ); 20 timer = new QTimer( this );
20 connect( timer, SIGNAL(timeout()), this, SLOT(update())); 21 connect( timer, SIGNAL(timeout()), this, SLOT(update()));
21 timer->start( 1000, false ); 22 timer->start( 1000, false );
22} 23}
23 24
24/** 25/**
25 * Updates the information about the wireless device. 26 * Updates the information about the wireless device.
26 */ 27 */
27void WlanInfoImp::update(){ 28void WlanInfoImp::update(){
diff --git a/noncore/settings/networksettings/TODO b/noncore/settings/networksettings/TODO
index 04b3a7c..020339f 100644
--- a/noncore/settings/networksettings/TODO
+++ b/noncore/settings/networksettings/TODO
@@ -1,16 +1,14 @@
1AndyQ - Fixed a bug in wlanimp.cpp : accept method - put braces round key 1test WEP
2 field if so that settings get saved if WEP is enabled 2WEP key in file wireless.conf is not encrypted !, therefore it is very easy to get the key out of the zaurus..
3
4CLEAN UP
5 3
6udchcp needs to output the dhcp information so interfaces can read it 4udchcp needs to output the dhcp information so interfaces can read it
7 5
8interfacesetupimp really doesn't need a interface* pointer 6interfacesetupimp really doesn't need a interface* pointer
9 7
10Possible other modules to write: ppp, ipsec, bluetooth, ipchains 8Possible other modules to write: ppp, ipsec, bluetooth, ipchains
11 9
12PPP module needs to scan pppd.tdb to see what is currently active 10PPP module needs to scan pppd.tdb to see what is currently active
13 11
14WLAN - add possiblity to input text or hex without knowing "s:" 12WLAN - add possiblity to input text or hex without knowing "s:"
15 13
16Interface setupimp needs to use kernel calls. 14Interface setupimp needs to use kernel calls.
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp
index 4129b3d..7ffa76f 100644
--- a/noncore/settings/networksettings/interfaces/interface.cpp
+++ b/noncore/settings/networksettings/interfaces/interface.cpp
@@ -2,25 +2,25 @@
2#include <qdatetime.h> 2#include <qdatetime.h>
3#include <qfile.h> 3#include <qfile.h>
4#include <qdir.h> 4#include <qdir.h>
5#include <qfileinfo.h> 5#include <qfileinfo.h>
6#include <qtextstream.h> 6#include <qtextstream.h>
7 7
8#define IFCONFIG "/sbin/ifconfig" 8#define IFCONFIG "/sbin/ifconfig"
9#define DHCP_INFO_DIR "/etc/dhcpc" 9#define DHCP_INFO_DIR "/etc/dhcpc"
10 10
11#include <stdio.h> 11#include <stdio.h>
12#include <stdlib.h> 12#include <stdlib.h>
13 13
14Interface::Interface(QObject * parent, const char * name, bool newSatus): QObject(parent, name), status(newSatus), attached(false), hardwareName("Unknown"), moduleOwner(NULL), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){ 14Interface::Interface(QObject * parent, const char * name, bool newSatus): QObject(parent, name), hardwareName("Unknown"), moduleOwner(NULL), status(newSatus), attached(false), dhcp(false), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"){
15 refresh(); 15 refresh();
16} 16}
17 17
18/** 18/**
19 * Set status 19 * Set status
20 * @param newStatus - the new status 20 * @param newStatus - the new status
21 * emit updateInterface 21 * emit updateInterface
22 */ 22 */
23void Interface::setStatus(bool newStatus){ 23void Interface::setStatus(bool newStatus){
24 if(status != newStatus){ 24 if(status != newStatus){
25 status = newStatus; 25 status = newStatus;
26 refresh(); 26 refresh();
diff --git a/noncore/settings/networksettings/interfaces/interface.h b/noncore/settings/networksettings/interfaces/interface.h
index 989d6d8..d37834a 100644
--- a/noncore/settings/networksettings/interfaces/interface.h
+++ b/noncore/settings/networksettings/interfaces/interface.h
@@ -7,65 +7,66 @@
7class Module; 7class Module;
8 8
9class Interface : public QObject{ 9class Interface : public QObject{
10 Q_OBJECT 10 Q_OBJECT
11 11
12signals: 12signals:
13 void updateInterface(Interface *i); 13 void updateInterface(Interface *i);
14 void updateMessage(const QString &message); 14 void updateMessage(const QString &message);
15 15
16public: 16public:
17 Interface(QObject * parent=0, const char * name= "unknown", bool status = false); 17 Interface(QObject * parent=0, const char * name= "unknown", bool status = false);
18 18
19 QString getInterfaceName(){ QString n(this->name()); return n; }; 19 QString getInterfaceName() const { QString n(this->name()); return n; };
20 20
21 bool getStatus(){ return status; }; 21 bool getStatus() const { return status; };
22 void setStatus(bool newStatus); 22 void setStatus(bool newStatus);
23 23
24 bool isAttached(){ return attached; }; 24 bool isAttached() const { return attached; };
25 void setAttached(bool isAttached=false); 25 void setAttached(bool isAttached=false);
26 26
27 QString getHardwareName(){ return hardwareName; }; 27 QString getHardwareName() const { return hardwareName; };
28 void setHardwareName(const QString &name="Unknown"); 28 void setHardwareName(const QString &name="Unknown");
29 29
30 Module* getModuleOwner(){ return moduleOwner; }; 30 Module* getModuleOwner() const { return moduleOwner; };
31 void setModuleOwner(Module *owner=NULL); 31 void setModuleOwner(Module *owner=NULL);
32 32
33 // inet information. 33 // inet information.
34 QString getMacAddress(){ return macAddress; }; 34 QString getMacAddress() const { return macAddress; };
35 QString getIp(){ return ip; }; 35 QString getIp() const { return ip; };
36 QString getSubnetMask(){ return subnetMask; }; 36 QString getSubnetMask() const { return subnetMask; };
37 QString getBroadcast(){ return broadcast; }; 37 QString getBroadcast() const { return broadcast; };
38 bool isDhcp(){ return dhcp; }; 38 bool isDhcp() const { return dhcp; };
39 QString getDhcpServerIp(){ return dhcpServerIp; }; 39 QString getDhcpServerIp() const { return dhcpServerIp; };
40 QString getLeaseObtained(){ return leaseObtained; }; 40 QString getLeaseObtained() const { return leaseObtained; };
41 QString getLeaseExpires(){ return leaseExpires; }; 41 QString getLeaseExpires() const { return leaseExpires; };
42 42
43public slots: 43public slots:
44 bool refresh(); 44 bool refresh();
45 void start(); 45 void start();
46 void stop(); 46 void stop();
47 void restart(); 47 void restart();
48 48
49private: 49private:
50 // Interface information 50 // Interface information
51 bool status;
52 bool attached;
53 QString hardwareName; 51 QString hardwareName;
54 Module *moduleOwner; 52 Module *moduleOwner;
55 53 bool status;
54 bool attached;
55
56 // Network information 56 // Network information
57 QString macAddress;
58 QString ip;
59 QString broadcast;
60 QString subnetMask;
61 bool dhcp; 57 bool dhcp;
62 QString dhcpServerIp; 58 QString dhcpServerIp;
63 QString leaseObtained; 59 QString leaseObtained;
64 QString leaseExpires; 60 QString leaseExpires;
65 61
62 QString macAddress;
63 QString ip;
64 QString broadcast;
65 QString subnetMask;
66
66}; 67};
67 68
68#endif 69#endif
69 70
70// interface.h 71// interface.h
71 72
diff --git a/noncore/settings/networksettings/interfaces/interfaces.cpp b/noncore/settings/networksettings/interfaces/interfaces.cpp
index e49998e..8f685fe 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaces.cpp
@@ -62,25 +62,25 @@ QStringList Interfaces::getInterfaceList(){
62 } 62 }
63 } 63 }
64 } 64 }
65 return list; 65 return list;
66} 66}
67 67
68/** 68/**
69 * Find out if interface is in an "auto" group or not. 69 * Find out if interface is in an "auto" group or not.
70 * Report any duplicates such as eth0 being in two differnt auto's 70 * Report any duplicates such as eth0 being in two differnt auto's
71 * @param interface interface to check to see if it is on or not. 71 * @param interface interface to check to see if it is on or not.
72 * @return true is interface is in auto 72 * @return true is interface is in auto
73 */ 73 */
74bool Interfaces::isAuto(const QString &interface){ 74bool Interfaces::isAuto(const QString &interface) const {
75 QStringList autoLines = interfaces.grep(QRegExp(AUTO)); 75 QStringList autoLines = interfaces.grep(QRegExp(AUTO));
76 QStringList awi = autoLines.grep(QRegExp(interface)); 76 QStringList awi = autoLines.grep(QRegExp(interface));
77 if(awi.count() > 1) 77 if(awi.count() > 1)
78 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1()); 78 qDebug(QString("Interfaces: Found more then auto group with interface: %1.").arg(interface).latin1());
79 if(awi.count() < 1) 79 if(awi.count() < 1)
80 return false; 80 return false;
81 return true; 81 return true;
82} 82}
83 83
84/** 84/**
85 * Attempt to set the auto option for interface to setAuto. 85 * Attempt to set the auto option for interface to setAuto.
86 * @param interface the interface to set 86 * @param interface the interface to set
@@ -130,26 +130,26 @@ bool Interfaces::setAuto(const QString &interface, bool setAuto){
130 * @return bool true if it is successfull. 130 * @return bool true if it is successfull.
131 */ 131 */
132bool Interfaces::setInterface(QString interface){ 132bool Interfaces::setInterface(QString interface){
133 interface = interface.simplifyWhiteSpace(); 133 interface = interface.simplifyWhiteSpace();
134 interface = interface.replace(QRegExp(" "), ""); 134 interface = interface.replace(QRegExp(" "), "");
135 return setStanza(IFACE, interface, currentIface); 135 return setStanza(IFACE, interface, currentIface);
136} 136}
137 137
138/** 138/**
139 * A quick helper funtion to see if the current interface is set. 139 * A quick helper funtion to see if the current interface is set.
140 * @return bool true if set, false otherwise. 140 * @return bool true if set, false otherwise.
141 */ 141 */
142bool Interfaces::isInterfaceSet(){ 142bool Interfaces::isInterfaceSet() const {
143 return (currentIface != interfaces.end()); 143 return (interfaces.end() != currentIface);
144} 144}
145 145
146/** 146/**
147 * Add a new interface of with the settings - family and method 147 * Add a new interface of with the settings - family and method
148 * @param interface the name of the interface to set. All whitespace is 148 * @param interface the name of the interface to set. All whitespace is
149 * removed from the interface name. 149 * removed from the interface name.
150 * @param family the family of this interface inet or inet, ipx or inet6 150 * @param family the family of this interface inet or inet, ipx or inet6
151 * Must of one of the families defined in interfaces.h 151 * Must of one of the families defined in interfaces.h
152 * @param method for the family. see interfaces man page for family methods. 152 * @param method for the family. see interfaces man page for family methods.
153 * @return true if successfull. 153 * @return true if successfull.
154 */ 154 */
155bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){ 155bool Interfaces::addInterface(const QString &interface, const QString &family, const QString &method){
diff --git a/noncore/settings/networksettings/interfaces/interfaces.h b/noncore/settings/networksettings/interfaces/interfaces.h
index d662919..bac2a7e 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.h
+++ b/noncore/settings/networksettings/interfaces/interfaces.h
@@ -16,61 +16,61 @@
16 16
17/** 17/**
18 * This class provides a clean frontend for parsing the network interfaces file. 18 * This class provides a clean frontend for parsing the network interfaces file.
19 * It provides helper functions to minipulate the options within the file. 19 * It provides helper functions to minipulate the options within the file.
20 * See the interfaces man page for the syntax rules. 20 * See the interfaces man page for the syntax rules.
21 */ 21 */
22class Interfaces { 22class Interfaces {
23 23
24public: 24public:
25 Interfaces(QString useInterfacesFile = "/etc/network/interfaces"); 25 Interfaces(QString useInterfacesFile = "/etc/network/interfaces");
26 QStringList getInterfaceList(); 26 QStringList getInterfaceList();
27 27
28 bool isAuto(const QString &interface); 28 bool isAuto(const QString &interface) const ;
29 bool setAuto(const QString &interface, bool setAuto); 29 bool setAuto(const QString &interface, bool setAuto);
30 30
31 bool removeInterface(); 31 bool removeInterface();
32 bool addInterface(const QString &interface, const QString &family, const QString &method); 32 bool addInterface(const QString &interface, const QString &family, const QString &method);
33 bool copyInterface(const QString &oldInterface, const QString &newInterface); 33 bool copyInterface(const QString &oldInterface, const QString &newInterface);
34 bool setInterface(QString interface); 34 bool setInterface(QString interface);
35 bool isInterfaceSet(); 35 bool isInterfaceSet() const ;
36 QString getInterfaceName(bool &error); 36 QString getInterfaceName(bool &error);
37 bool setInterfaceName(const QString &newName); 37 bool setInterfaceName(const QString &newName);
38 QString getInterfaceFamily(bool &error); 38 QString getInterfaceFamily(bool &error);
39 bool setInterfaceFamily(const QString &newName); 39 bool setInterfaceFamily(const QString &newName);
40 QString getInterfaceMethod(bool &error); 40 QString getInterfaceMethod(bool &error);
41 bool setInterfaceMethod(const QString &newName); 41 bool setInterfaceMethod(const QString &newName);
42 QString getInterfaceOption(const QString &option, bool &error); 42 QString getInterfaceOption(const QString &option, bool &error);
43 bool setInterfaceOption(const QString &option, const QString &value); 43 bool setInterfaceOption(const QString &option, const QString &value);
44 bool removeInterfaceOption(const QString &option, const QString &value); 44 bool removeInterfaceOption(const QString &option, const QString &value);
45 bool removeAllInterfaceOptions(); 45 bool removeAllInterfaceOptions();
46 46
47 bool setMapping(const QString &interface); 47 bool setMapping(const QString &interface);
48 bool removeMapping(); 48 bool removeMapping();
49 void addMapping(const QString &options); 49 void addMapping(const QString &options);
50 bool setMap(const QString &map, const QString &value); 50 bool setMap(const QString &map, const QString &value);
51 bool removeMap(const QString &map, const QString &value); 51 bool removeMap(const QString &map, const QString &value);
52 QString getMap(const QString &map, bool &error); 52 QString getMap(const QString &map, bool &error);
53 bool setScript(const QString &argument); 53 bool setScript(const QString &argument);
54 QString getScript(bool &error); 54 QString getScript(bool &error);
55 55
56 bool write(); 56 bool write();
57 57
58private: 58private:
59 bool setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator); 59 bool setStanza(const QString &stanza, const QString &option, QStringList::Iterator &iterator);
60 bool removeStanza(QStringList::Iterator &stanza);
60 bool setOption(const QStringList::Iterator &start, const QString &option, const QString &value); 61 bool setOption(const QStringList::Iterator &start, const QString &option, const QString &value);
62 bool removeAllOptions(const QStringList::Iterator &start);
61 bool removeOption(const QStringList::Iterator &start, const QString &option, const QString &value); 63 bool removeOption(const QStringList::Iterator &start, const QString &option, const QString &value);
62 QString getOption(const QStringList::Iterator &start, const QString &option, bool &error); 64 QString getOption(const QStringList::Iterator &start, const QString &option, bool &error);
63 bool removeStanza(QStringList::Iterator &stanza);
64 bool removeAllOptions(const QStringList::Iterator &start);
65 65
66 QString interfacesFile; 66 QString interfacesFile;
67 QStringList interfaces; 67 QStringList interfaces;
68 QStringList::Iterator currentIface; 68 QStringList::Iterator currentIface;
69 QStringList::Iterator currentMapping; 69 QStringList::Iterator currentMapping;
70 70
71 QStringList acceptedFamily; 71 QStringList acceptedFamily;
72}; 72};
73 73
74#endif 74#endif
75 75
76// interfaces 76// interfaces
diff --git a/noncore/settings/networksettings/interfaces/interfaces.pro b/noncore/settings/networksettings/interfaces/interfaces.pro
index 9a024f6..d6b43fb 100644
--- a/noncore/settings/networksettings/interfaces/interfaces.pro
+++ b/noncore/settings/networksettings/interfaces/interfaces.pro
@@ -1,12 +1,12 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qt warn_on release 2CONFIG += qt warn_on release
3 #CONFIG += qt warn_on debug 3 #CONFIG += qt warn_on debug
4 DESTDIR = $(QTDIR)/lib$(PROJMAK) 4 #DESTDIR = $(QTDIR)/lib$(PROJMAK)
5 HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h 5 HEADERS = interface.h interfaceinformationimp.h interfaces.h interfacesetupimp.h
6 SOURCES = interface.cpp interfaces.cpp interfaceinformationimp.cpp interfacesetupimp.cpp 6 SOURCES = interface.cpp interfaces.cpp interfaceinformationimp.cpp interfacesetupimp.cpp
7 INCLUDEPATH+= $(OPIEDIR)/include ../ 7 INCLUDEPATH+= $(OPIEDIR)/include ../
8 DEPENDPATH+= $(OPIEDIR)/include 8 DEPENDPATH+= $(OPIEDIR)/include
9LIBS += -lqpe 9LIBS += -lqpe
10 INTERFACES= interfaceadvanced.ui interfaceinformation.ui interfacesetup.ui 10 INTERFACES= interfaceadvanced.ui interfaceinformation.ui interfacesetup.ui
11 TARGET = interfaces 11 TARGET = interfaces
12 VERSION = 1.0.0 12 VERSION = 1.0.0
diff --git a/noncore/settings/networksettings/ppp/pppmodule.cpp b/noncore/settings/networksettings/ppp/pppmodule.cpp
index 68bb0a0..72cd45e 100644
--- a/noncore/settings/networksettings/ppp/pppmodule.cpp
+++ b/noncore/settings/networksettings/ppp/pppmodule.cpp
@@ -1,13 +1,14 @@
1#include "pppmodule.h" 1#include "pppmodule.h"
2#include "pppimp.h"
2#include "interfaceinformationimp.h" 3#include "interfaceinformationimp.h"
3 4
4/** 5/**
5 * Constructor, find all of the possible interfaces 6 * Constructor, find all of the possible interfaces
6 */ 7 */
7PPPModule::PPPModule() : Module() { 8PPPModule::PPPModule() : Module() {
8} 9}
9 10
10/** 11/**
11 * Delete any interfaces that we own. 12 * Delete any interfaces that we own.
12 */ 13 */
13PPPModule::~PPPModule(){ 14PPPModule::~PPPModule(){
@@ -29,74 +30,76 @@ void PPPModule::setProfile(const QString &newProfile){
29 * @return QString the icon name (minus .png, .gif etc) 30 * @return QString the icon name (minus .png, .gif etc)
30 */ 31 */
31QString PPPModule::getPixmapName(Interface* ){ 32QString PPPModule::getPixmapName(Interface* ){
32 return "ppp"; 33 return "ppp";
33} 34}
34 35
35/** 36/**
36 * Check to see if the interface i is owned by this module. 37 * Check to see if the interface i is owned by this module.
37 * @param Interface* interface to check against 38 * @param Interface* interface to check against
38 * @return bool true if i is owned by this module, false otherwise. 39 * @return bool true if i is owned by this module, false otherwise.
39 */ 40 */
40bool PPPModule::isOwner(Interface *i){ 41bool PPPModule::isOwner(Interface *i){
41 // Scan the ppp database 42 if(!i->getInterfaceName().upper().contains("PPP"))
42 return false; 43 return false;
43 44
44 i->setHardwareName("PPP"); 45 i->setHardwareName("PPP");
45 list.append(i); 46 list.append(i);
46 return true; 47 return true;
47} 48}
48 49
49/** 50/**
50 * Create, and return the WLANConfigure Module 51 * Create, and return the WLANConfigure Module
51 * @return QWidget* pointer to this modules configure. 52 * @return QWidget* pointer to this modules configure.
52 */ 53 */
53QWidget *PPPModule::configure(Interface *i){ 54QWidget *PPPModule::configure(Interface *i){
54 return NULL; 55 return NULL;
55 //PPPConfigureImp *pppconfig = new PPPConfigureImp(0, "PPPConfig", i, false, Qt::WDestructiveClose); 56 //PPPConfigureImp *pppconfig = new PPPConfigureImp(0, "PPPConfig", i, false, Qt::WDestructiveClose);
56 //pppconfig->setProfile(profile); 57 //pppconfig->setProfile(profile);
57 //return wlanconfig; 58 //return wlanconfig;
58} 59}
59 60
60/** 61/**
61 * Create, and return the Information Module 62 * Create, and return the Information Module
62 * @return QWidget* pointer to this modules info. 63 * @return QWidget* pointer to this modules info.
63 */ 64 */
64QWidget *PPPModule::information(Interface *i){ 65QWidget *PPPModule::information(Interface *i){
65 return NULL; 66 // We don't have any advanced pppd information widget yet :-D
66 67 // TODO ^
67 //WlanInfoImp *info = new WlanInfoImp(0, i->getInterfaceName(), Qt::WDestructiveClose); 68 InterfaceInformationImp *information = new InterfaceInformationImp(0, "InterfaceSetupImp", i);
68 //InterfaceInformationImp *information = new InterfaceInformationImp(info->tabWidget, "InterfaceSetupImp", i); 69 return information;
69 //info->tabWidget->insertTab(information, "TCP/IP");
70 //return info;
71} 70}
72 71
73/** 72/**
74 * Get all active (up or down) interfaces 73 * Get all active (up or down) interfaces
75 * @return QList<Interface> A list of interfaces that exsist that havn't 74 * @return QList<Interface> A list of interfaces that exsist that havn't
76 * been called by isOwner() 75 * been called by isOwner()
77 */ 76 */
78QList<Interface> PPPModule::getInterfaces(){ 77QList<Interface> PPPModule::getInterfaces(){
78 // List all of the files in the peer directory
79 return list; 79 return list;
80} 80}
81 81
82/** 82/**
83 * Attempt to add a new interface as defined by name 83 * Attempt to add a new interface as defined by name
84 * @param name the name of the type of interface that should be created given 84 * @param name the name of the type of interface that should be created given
85 * by possibleNewInterfaces(); 85 * by possibleNewInterfaces();
86 * @return Interface* NULL if it was unable to be created. 86 * @return Interface* NULL if it was unable to be created.
87 */ 87 */
88Interface *PPPModule::addNewInterface(const QString &newInterface){ 88Interface *PPPModule::addNewInterface(const QString &newInterface){
89 // We can't add a 802.11 interface, either the hardware will be there 89 // If the
90 // or it wont. 90 PPPConfigureImp imp(0, "PPPConfigImp");
91 if(imp.exec() == QDialog::Accepted ){
92
93 }
91 return NULL; 94 return NULL;
92} 95}
93 96
94/** 97/**
95 * Attempts to remove the interface, doesn't delete i 98 * Attempts to remove the interface, doesn't delete i
96 * @return bool true if successfull, false otherwise. 99 * @return bool true if successfull, false otherwise.
97 */ 100 */
98bool PPPModule::remove(Interface*){ 101bool PPPModule::remove(Interface*){
99 // Can't remove a hardware device, you can stop it though. 102 // Can't remove a hardware device, you can stop it though.
100 return false; 103 return false;
101} 104}
102 105
diff --git a/noncore/settings/networksettings/wlan/infoimp.cpp b/noncore/settings/networksettings/wlan/infoimp.cpp
index e1eef81..6d3e167 100644
--- a/noncore/settings/networksettings/wlan/infoimp.cpp
+++ b/noncore/settings/networksettings/wlan/infoimp.cpp
@@ -1,27 +1,28 @@
1#include "infoimp.h" 1#include "infoimp.h"
2#include "wextensions.h" 2#include "wextensions.h"
3
3#include <qtimer.h> 4#include <qtimer.h>
4#include <qprogressbar.h> 5#include <qprogressbar.h>
5#include <qlabel.h> 6#include <qlabel.h>
6 7
7/** 8/**
8 * Constructor. If wireless extensions are enabled on device name then 9 * Constructor. If wireless extensions are enabled on device name then
9 * start a timer that every second will update the information. 10 * start a timer that every second will update the information.
10 */ 11 */
11WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){ 12WlanInfoImp::WlanInfoImp( QWidget* parent, const char* name, WFlags fl): WlanInfo(parent, name, fl){
12 WExtensions *wExtensions = new WExtensions(name); 13 WExtensions *wExtensions = new WExtensions(name);
13 if(!wExtensions->doesHaveWirelessExtensions()){ 14 if(!wExtensions->doesHaveWirelessExtensions()){
14 delete wExtensions; 15 delete wExtensions;
15 qDebug("No extension"); 16 qDebug("WlanInfoImp::No wireless extension");
16 return; 17 return;
17 } 18 }
18 delete wExtensions; 19 delete wExtensions;
19 timer = new QTimer( this ); 20 timer = new QTimer( this );
20 connect( timer, SIGNAL(timeout()), this, SLOT(update())); 21 connect( timer, SIGNAL(timeout()), this, SLOT(update()));
21 timer->start( 1000, false ); 22 timer->start( 1000, false );
22} 23}
23 24
24/** 25/**
25 * Updates the information about the wireless device. 26 * Updates the information about the wireless device.
26 */ 27 */
27void WlanInfoImp::update(){ 28void WlanInfoImp::update(){