summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interface.cpp
Unidiff
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
@@ -63,16 +63,21 @@ void Interface::setModuleOwner(Module *owner){
63 */ 63 */
64void Interface::start(){ 64void Interface::start(){
65 // check to see if we are already running. 65 // check to see if we are already running.
66 if(true == status) 66 if(true == status){
67 emit (updateMessage("Unable to start interface,\n already started"));
67 return; 68 return;
68 69 }
70
69 int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1()); 71 int ret = system(QString("%1 %2 up").arg(IFCONFIG).arg(this->name()).latin1());
70 // See if it was successfull... 72 // See if it was successfull...
71 if(ret != 0) 73 if(ret != 0){
74 emit (updateMessage("Starting interface failed."));
72 return; 75 return;
73 76 }
77
74 status = true; 78 status = true;
75 refresh(); 79 refresh();
80 emit (updateMessage("Start successfull"));
76} 81}
77 82
78/** 83/**
@@ -80,15 +85,20 @@ void Interface::start(){
80 */ 85 */
81void Interface::stop(){ 86void Interface::stop(){
82 // check to see if we are already stopped. 87 // check to see if we are already stopped.
83 if(false == status) 88 if(false == status){
89 emit (updateMessage("Unable to stop interface,\n already stopped"));
84 return; 90 return;
91 }
85 92
86 int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1()); 93 int ret = system(QString("%1 %2 down").arg(IFCONFIG).arg(this->name()).latin1());
87 if(ret != 0) 94 if(ret != 0){
95 emit (updateMessage("Stopping interface failed."));
88 return; 96 return;
97 }
89 98
90 status = true; 99 status = false;
91 refresh(); 100 refresh();
101 emit (updateMessage("Stop successfull"));
92} 102}
93 103
94/** 104/**