author | benmeyer <benmeyer> | 2002-11-04 15:17:58 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-11-04 15:17:58 (UTC) |
commit | 17a29825dcf56cb0e224848e71e24ee6a884890b (patch) (unidiff) | |
tree | 91a7f024de51081800a13312dd1b16822d86c188 /noncore/net/networksetup/interfaces/interface.cpp | |
parent | a5f1f8a58a5a654503d72042b12f36ab30216a16 (diff) | |
download | opie-17a29825dcf56cb0e224848e71e24ee6a884890b.zip opie-17a29825dcf56cb0e224848e71e24ee6a884890b.tar.gz opie-17a29825dcf56cb0e224848e71e24ee6a884890b.tar.bz2 |
Fix bug and gives more user feedback now
Diffstat (limited to 'noncore/net/networksetup/interfaces/interface.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interfaces/interface.cpp | 24 |
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){ | |||
63 | */ | 63 | */ |
64 | void Interface::start(){ | 64 | void 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 | */ |
81 | void Interface::stop(){ | 86 | void 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 | /** |