summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interface.cpp
authorbenmeyer <benmeyer>2002-11-04 15:17:58 (UTC)
committer benmeyer <benmeyer>2002-11-04 15:17:58 (UTC)
commit17a29825dcf56cb0e224848e71e24ee6a884890b (patch) (side-by-side diff)
tree91a7f024de51081800a13312dd1b16822d86c188 /noncore/settings/networksettings/interfaces/interface.cpp
parenta5f1f8a58a5a654503d72042b12f36ab30216a16 (diff)
downloadopie-17a29825dcf56cb0e224848e71e24ee6a884890b.zip
opie-17a29825dcf56cb0e224848e71e24ee6a884890b.tar.gz
opie-17a29825dcf56cb0e224848e71e24ee6a884890b.tar.bz2
Fix bug and gives more user feedback now
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interface.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/noncore/settings/networksettings/interfaces/interface.cpp b/noncore/settings/networksettings/interfaces/interface.cpp
index 929b3a1..e4f405e 100644
--- a/noncore/settings/networksettings/interfaces/interface.cpp
+++ b/noncore/settings/networksettings/interfaces/interface.cpp
@@ -54,50 +54,60 @@ void Interface::setHardwareName(QString name){
*/
void Interface::setModuleOwner(Module *owner){
moduleOwner = owner;
emit(updateInterface(this));
};
/**
* Try to start the interface.
*/
void Interface::start(){
// check to see if we are already running.
- if(true == status)
+ if(true == status){
+ emit (updateMessage("Unable to start interface,\n already started"));
return;
-
+ }
+
int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1());
// See if it was successfull...
- if(ret != 0)
+ if(ret != 0){
+ emit (updateMessage("Starting interface failed."));
return;
-
+ }
+
status = true;
refresh();
+ emit (updateMessage("Start successfull"));
}
/**
* Try to stop the interface.
*/
void Interface::stop(){
// check to see if we are already stopped.
- if(false == status)
+ if(false == status){
+ emit (updateMessage("Unable to stop interface,\n already stopped"));
return;
+ }
int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1());
- if(ret != 0)
+ if(ret != 0){
+ emit (updateMessage("Stopping interface failed."));
return;
+ }
- status = true;
+ status = false;
refresh();
+ emit (updateMessage("Stop successfull"));
}
/**
* Try to restart the interface.
*/
void Interface::restart(){
stop();
start();
}
/**
* Try to refresh the information about the interface.