author | benmeyer <benmeyer> | 2002-10-17 15:29:40 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-17 15:29:40 (UTC) |
commit | e1005c586b436d8edb7958632c7d71b4f5b00c2f (patch) (side-by-side diff) | |
tree | e39830884da8238cc355f96cde39c002eb1d7ed3 | |
parent | 8a9b63594f8500ffbb5e58a74e98504bcf20fcb9 (diff) | |
download | opie-e1005c586b436d8edb7958632c7d71b4f5b00c2f.zip opie-e1005c586b436d8edb7958632c7d71b4f5b00c2f.tar.gz opie-e1005c586b436d8edb7958632c7d71b4f5b00c2f.tar.bz2 |
usb now supported
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.cpp | 36 | ||||
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 36 |
2 files changed, 46 insertions, 26 deletions
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp index 24af1ec..b46362f 100644 --- a/noncore/net/networksetup/mainwindowimp.cpp +++ b/noncore/net/networksetup/mainwindowimp.cpp @@ -242,2 +242,6 @@ void MainWindowImp::informationClicked(){ Interface *i = interfaceItems[item];
+ if(!i->isAttached()){
+ QMessageBox::information(this, "Error","No information about\na disconnected interface.", QMessageBox::Ok);
+ return;
+ }
if(i->getModuleOwner()){
@@ -271,3 +275,2 @@ void MainWindowImp::getInterfaceList(){ threads.insert(processAll, TEMP_ALL);
- processAll->start(KShellProcess::NotifyOnExit);
@@ -278,2 +281,4 @@ void MainWindowImp::getInterfaceList(){ threads.insert(process, TEMP_UP);
+
+ processAll->start(KShellProcess::NotifyOnExit);
process->start(KShellProcess::NotifyOnExit);
@@ -300,6 +305,2 @@ void MainWindowImp::jobDone(KProcess *process){ QString interfaceName = line.mid(0, space);
- if(!advancedUserMode){
- if(interfaceName == "lo")
- break;
- }
Interface *i;
@@ -336,2 +337,3 @@ void MainWindowImp::jobDone(KProcess *process){ QFile::remove(fileName);
+
if(threads.count() == 0){
@@ -341,11 +343,14 @@ void MainWindowImp::jobDone(KProcess *process){ for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
+ bool found = false;
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);
- }
+ if(it.key() == (*ni))
+ found = true;
+ }
+ if(!found){
+ 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);
}
@@ -360,2 +365,7 @@ void MainWindowImp::jobDone(KProcess *process){ void MainWindowImp::updateInterface(Interface *i){
+ if(!advancedUserMode){
+ if(i->getInterfaceName() == "lo")
+ return;
+ }
+
QListViewItem *item = NULL;
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index 24af1ec..b46362f 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp @@ -242,2 +242,6 @@ void MainWindowImp::informationClicked(){ Interface *i = interfaceItems[item];
+ if(!i->isAttached()){
+ QMessageBox::information(this, "Error","No information about\na disconnected interface.", QMessageBox::Ok);
+ return;
+ }
if(i->getModuleOwner()){
@@ -271,3 +275,2 @@ void MainWindowImp::getInterfaceList(){ threads.insert(processAll, TEMP_ALL);
- processAll->start(KShellProcess::NotifyOnExit);
@@ -278,2 +281,4 @@ void MainWindowImp::getInterfaceList(){ threads.insert(process, TEMP_UP);
+
+ processAll->start(KShellProcess::NotifyOnExit);
process->start(KShellProcess::NotifyOnExit);
@@ -300,6 +305,2 @@ void MainWindowImp::jobDone(KProcess *process){ QString interfaceName = line.mid(0, space);
- if(!advancedUserMode){
- if(interfaceName == "lo")
- break;
- }
Interface *i;
@@ -336,2 +337,3 @@ void MainWindowImp::jobDone(KProcess *process){ QFile::remove(fileName);
+
if(threads.count() == 0){
@@ -341,11 +343,14 @@ void MainWindowImp::jobDone(KProcess *process){ for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) {
+ bool found = false;
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);
- }
+ if(it.key() == (*ni))
+ found = true;
+ }
+ if(!found){
+ 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);
}
@@ -360,2 +365,7 @@ void MainWindowImp::jobDone(KProcess *process){ void MainWindowImp::updateInterface(Interface *i){
+ if(!advancedUserMode){
+ if(i->getInterfaceName() == "lo")
+ return;
+ }
+
QListViewItem *item = NULL;
|