summaryrefslogtreecommitdiff
path: root/noncore/net/networksetup/interfaces/interface.cpp
Side-by-side diff
Diffstat (limited to 'noncore/net/networksetup/interfaces/interface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interfaces/interface.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/noncore/net/networksetup/interfaces/interface.cpp b/noncore/net/networksetup/interfaces/interface.cpp
index 929b3a1..e4f405e 100644
--- a/noncore/net/networksetup/interfaces/interface.cpp
+++ b/noncore/net/networksetup/interfaces/interface.cpp
@@ -63,16 +63,21 @@ void Interface::setModuleOwner(Module *owner){
*/
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"));
}
/**
@@ -80,15 +85,20 @@ void Interface::start(){
*/
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"));
}
/**