summaryrefslogtreecommitdiff
authorbenmeyer <benmeyer>2002-10-17 15:03:35 (UTC)
committer benmeyer <benmeyer>2002-10-17 15:03:35 (UTC)
commit1fa7ebd9512ac0497c3ede198621899a10e961af (patch) (side-by-side diff)
tree45be4e45b5408f46c3f2e59b1241aebf9a9bf869
parent6c8ae3c8af454c87f5f467fe17cbdffe4c8f5494 (diff)
downloadopie-1fa7ebd9512ac0497c3ede198621899a10e961af.zip
opie-1fa7ebd9512ac0497c3ede198621899a10e961af.tar.gz
opie-1fa7ebd9512ac0497c3ede198621899a10e961af.tar.bz2
added interface listing
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/networksetup/TODO1
-rw-r--r--noncore/net/networksetup/interfaces.cpp26
-rw-r--r--noncore/net/networksetup/interfaces.h1
-rw-r--r--noncore/net/networksetup/mainwindowimp.cpp22
-rw-r--r--noncore/net/networksetup/networksetup.pro6
-rw-r--r--noncore/settings/networksettings/TODO1
-rw-r--r--noncore/settings/networksettings/interfaces.cpp26
-rw-r--r--noncore/settings/networksettings/interfaces.h1
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp22
-rw-r--r--noncore/settings/networksettings/networksetup.pro6
10 files changed, 104 insertions, 8 deletions
diff --git a/noncore/net/networksetup/TODO b/noncore/net/networksetup/TODO
index 70d6717..7386646 100644
--- a/noncore/net/networksetup/TODO
+++ b/noncore/net/networksetup/TODO
@@ -7 +7,2 @@
out ifup/ifdown) from the gui.
+ -Ben- Click information, then click up or down... :-D
diff --git a/noncore/net/networksetup/interfaces.cpp b/noncore/net/networksetup/interfaces.cpp
index b8a3e7f..1287d90 100644
--- a/noncore/net/networksetup/interfaces.cpp
+++ b/noncore/net/networksetup/interfaces.cpp
@@ -42,2 +42,26 @@ Interfaces::Interfaces(QString useInterfacesFile){
+
+/**
+ * Get a list of all interfaces in the interface file. Usefull for
+ * hardware that is not currently connected such as an 802.11b card
+ * not plugged in, but configured for when it is plugged in.
+ * @return Return string list of interfaces.
+ **/
+QStringList Interfaces::getInterfaceList(){
+ QStringList list;
+ for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
+ QString line = (*it).simplifyWhiteSpace();
+ if(line.contains(IFACE)){
+ line = line.mid(QString(IFACE).length() +1, line.length());
+ line = line.simplifyWhiteSpace();
+ int findSpace = line.find(" ");
+ if( findSpace >= 0){
+ line = line.mid(0, findSpace);
+ list.append(line);
+ }
+ }
+ }
+ return list;
+}
+
/**
@@ -45,3 +69,3 @@ Interfaces::Interfaces(QString useInterfacesFile){
* Report any duplicates such as eth0 being in two differnt auto's
- * @param
+ * @param interface interface to check to see if it is on or not.
* @return true is interface is in auto
diff --git a/noncore/net/networksetup/interfaces.h b/noncore/net/networksetup/interfaces.h
index 2cc9689..8b4788c 100644
--- a/noncore/net/networksetup/interfaces.h
+++ b/noncore/net/networksetup/interfaces.h
@@ -25,2 +25,3 @@ public:
Interfaces(QString useInterfacesFile = "/etc/network/interfaces");
+ QStringList getInterfaceList();
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp
index 36f12e0..24af1ec 100644
--- a/noncore/net/networksetup/mainwindowimp.cpp
+++ b/noncore/net/networksetup/mainwindowimp.cpp
@@ -4,2 +4,4 @@
#include "interfacesetupimp.h"
+#include "interfaces.h"
+
#include "module.h"
@@ -334,2 +336,19 @@ void MainWindowImp::jobDone(KProcess *process){
QFile::remove(fileName);
+ if(threads.count() == 0){
+ Interfaces i;
+ QStringList list = i.getInterfaceList();
+ QMap<QString, Interface*>::Iterator it;
+ for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
+ for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
+ if(it.key() == (*ni)){
+ Interface *i = new Interface(*ni, false);
+ i->setAttached(false);
+ i->setHardwareName(QString("Disconnected (%1)").arg(*ni));
+ i->setInterfaceName(*ni);
+ interfaceNames.insert(i->getInterfaceName(), i);
+ updateInterface(i);
+ }
+ }
+ }
+ }
}
@@ -368,2 +387,5 @@ void MainWindowImp::updateInterface(Interface *i){
typeName = "wlan";
+
+ if(!i->isAttached())
+ typeName = "connect_no";
// Actually try to use the Module
diff --git a/noncore/net/networksetup/networksetup.pro b/noncore/net/networksetup/networksetup.pro
index f09db93..441bbaa 100644
--- a/noncore/net/networksetup/networksetup.pro
+++ b/noncore/net/networksetup/networksetup.pro
@@ -1,2 +1,2 @@
-DESTDIR = $(OPIEDIR)/bin
+#DESTDIR = $(OPIEDIR)/bin
TEMPLATE = app
@@ -6,4 +6,4 @@ HEADERS = mainwindowimp.h addconnectionimp.h interface.h interfaceinformationim
SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp
-INCLUDEPATH += $(OPIEDIR)/include
-DEPENDPATH += $(OPIEDIR)/include
+#INCLUDEPATH += $(OPIEDIR)/include
+#DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe
diff --git a/noncore/settings/networksettings/TODO b/noncore/settings/networksettings/TODO
index 70d6717..7386646 100644
--- a/noncore/settings/networksettings/TODO
+++ b/noncore/settings/networksettings/TODO
@@ -7 +7,2 @@
out ifup/ifdown) from the gui.
+ -Ben- Click information, then click up or down... :-D
diff --git a/noncore/settings/networksettings/interfaces.cpp b/noncore/settings/networksettings/interfaces.cpp
index b8a3e7f..1287d90 100644
--- a/noncore/settings/networksettings/interfaces.cpp
+++ b/noncore/settings/networksettings/interfaces.cpp
@@ -42,2 +42,26 @@ Interfaces::Interfaces(QString useInterfacesFile){
+
+/**
+ * Get a list of all interfaces in the interface file. Usefull for
+ * hardware that is not currently connected such as an 802.11b card
+ * not plugged in, but configured for when it is plugged in.
+ * @return Return string list of interfaces.
+ **/
+QStringList Interfaces::getInterfaceList(){
+ QStringList list;
+ for ( QStringList::Iterator it = interfaces.begin(); it != interfaces.end(); ++it ) {
+ QString line = (*it).simplifyWhiteSpace();
+ if(line.contains(IFACE)){
+ line = line.mid(QString(IFACE).length() +1, line.length());
+ line = line.simplifyWhiteSpace();
+ int findSpace = line.find(" ");
+ if( findSpace >= 0){
+ line = line.mid(0, findSpace);
+ list.append(line);
+ }
+ }
+ }
+ return list;
+}
+
/**
@@ -45,3 +69,3 @@ Interfaces::Interfaces(QString useInterfacesFile){
* Report any duplicates such as eth0 being in two differnt auto's
- * @param
+ * @param interface interface to check to see if it is on or not.
* @return true is interface is in auto
diff --git a/noncore/settings/networksettings/interfaces.h b/noncore/settings/networksettings/interfaces.h
index 2cc9689..8b4788c 100644
--- a/noncore/settings/networksettings/interfaces.h
+++ b/noncore/settings/networksettings/interfaces.h
@@ -25,2 +25,3 @@ public:
Interfaces(QString useInterfacesFile = "/etc/network/interfaces");
+ QStringList getInterfaceList();
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 36f12e0..24af1ec 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -4,2 +4,4 @@
#include "interfacesetupimp.h"
+#include "interfaces.h"
+
#include "module.h"
@@ -334,2 +336,19 @@ void MainWindowImp::jobDone(KProcess *process){
QFile::remove(fileName);
+ if(threads.count() == 0){
+ Interfaces i;
+ QStringList list = i.getInterfaceList();
+ QMap<QString, Interface*>::Iterator it;
+ for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
+ for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ){
+ if(it.key() == (*ni)){
+ Interface *i = new Interface(*ni, false);
+ i->setAttached(false);
+ i->setHardwareName(QString("Disconnected (%1)").arg(*ni));
+ i->setInterfaceName(*ni);
+ interfaceNames.insert(i->getInterfaceName(), i);
+ updateInterface(i);
+ }
+ }
+ }
+ }
}
@@ -368,2 +387,5 @@ void MainWindowImp::updateInterface(Interface *i){
typeName = "wlan";
+
+ if(!i->isAttached())
+ typeName = "connect_no";
// Actually try to use the Module
diff --git a/noncore/settings/networksettings/networksetup.pro b/noncore/settings/networksettings/networksetup.pro
index f09db93..441bbaa 100644
--- a/noncore/settings/networksettings/networksetup.pro
+++ b/noncore/settings/networksettings/networksetup.pro
@@ -1,2 +1,2 @@
-DESTDIR = $(OPIEDIR)/bin
+#DESTDIR = $(OPIEDIR)/bin
TEMPLATE = app
@@ -6,4 +6,4 @@ HEADERS = mainwindowimp.h addconnectionimp.h interface.h interfaceinformationim
SOURCES = main.cpp mainwindowimp.cpp addconnectionimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp
-INCLUDEPATH += $(OPIEDIR)/include
-DEPENDPATH += $(OPIEDIR)/include
+#INCLUDEPATH += $(OPIEDIR)/include
+#DEPENDPATH += $(OPIEDIR)/include
LIBS += -lqpe