Diffstat (limited to 'examples/networksettings/exampleiface.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | examples/networksettings/exampleiface.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/examples/networksettings/exampleiface.cpp b/examples/networksettings/exampleiface.cpp index 5267a9c..8012bb2 100644 --- a/examples/networksettings/exampleiface.cpp +++ b/examples/networksettings/exampleiface.cpp | |||
@@ -1,43 +1,46 @@ | |||
1 | #include "exampleiface.h" | 1 | #include "exampleiface.h" |
2 | 2 | ||
3 | #include <opie2/odebug.h> | ||
4 | using namespace Opie::Core; | ||
5 | |||
3 | VirtualInterface::VirtualInterface( QObject* parent, | 6 | VirtualInterface::VirtualInterface( QObject* parent, |
4 | const char* name, | 7 | const char* name, |
5 | bool status ) | 8 | bool status ) |
6 | : Interface(parent, name, status ) | 9 | : Interface(parent, name, status ) |
7 | { | 10 | { |
8 | } | 11 | } |
9 | 12 | ||
10 | VirtualInterface::~VirtualInterface() { | 13 | VirtualInterface::~VirtualInterface() { |
11 | } | 14 | } |
12 | 15 | ||
13 | bool VirtualInterface::refresh() { | 16 | bool VirtualInterface::refresh() { |
14 | /* we do VPN over ppp | 17 | /* we do VPN over ppp |
15 | * so replace the interfaceName with | 18 | * so replace the interfaceName with |
16 | * something actual existing | 19 | * something actual existing |
17 | * I take wlan0 in my case | 20 | * I take wlan0 in my case |
18 | */ | 21 | */ |
19 | QString old = getInterfaceName(); | 22 | QString old = getInterfaceName(); |
20 | qWarning("Interface name was " + old ); | 23 | odebug << "Interface name was " << old << oendl; |
21 | setInterfaceName( "wlan0" ); | 24 | setInterfaceName( "wlan0" ); |
22 | 25 | ||
23 | bool b =Interface::refresh(); | 26 | bool b =Interface::refresh(); |
24 | setInterfaceName( old ); | 27 | setInterfaceName( old ); |
25 | 28 | ||
26 | /* new and old interface name */ | 29 | /* new and old interface name */ |
27 | emit updateInterface(this); | 30 | emit updateInterface(this); |
28 | return b; | 31 | return b; |
29 | } | 32 | } |
30 | 33 | ||
31 | 34 | ||
32 | void VirtualInterface::start() { | 35 | void VirtualInterface::start() { |
33 | // call pptp | 36 | // call pptp |
34 | setStatus(true); | 37 | setStatus(true); |
35 | refresh(); | 38 | refresh(); |
36 | emit updateMessage("VPN started"); | 39 | emit updateMessage("VPN started"); |
37 | } | 40 | } |
38 | 41 | ||
39 | void VirtualInterface::stop() { | 42 | void VirtualInterface::stop() { |
40 | setStatus(false ); | 43 | setStatus(false ); |
41 | refresh(); | 44 | refresh(); |
42 | emit updateMessage("VPN halted"); | 45 | emit updateMessage("VPN halted"); |
43 | } | 46 | } |