Diffstat (limited to 'noncore/net/networksetup/interfaceinformationimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/net/networksetup/interfaceinformationimp.cpp | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/noncore/net/networksetup/interfaceinformationimp.cpp b/noncore/net/networksetup/interfaceinformationimp.cpp index e37e0f8..59a6400 100644 --- a/noncore/net/networksetup/interfaceinformationimp.cpp +++ b/noncore/net/networksetup/interfaceinformationimp.cpp | |||
@@ -15,7 +15,8 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
15 | interface = i; | 15 | interface = i; |
16 | updateInterface(); | 16 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); |
17 | connect(startButton, SIGNAL(clicked()), this, SLOT(start())); | 17 | updateInterface(interface); |
18 | connect(stopButton, SIGNAL(clicked()), this, SLOT(stop())); | 18 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); |
19 | connect(restartButton, SIGNAL(clicked()), this, SLOT(restart())); | 19 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); |
20 | connect(refreshButton, SIGNAL(clicked()), this, SLOT(refresh())); | 20 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); |
21 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); | ||
21 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 22 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
@@ -24,3 +25,8 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
24 | 25 | ||
25 | void InterfaceInformationImp::updateInterface(){ | 26 | /** |
27 | * Update the interface information and buttons. | ||
28 | * @param Intarface *i the interface to update (should be the one we already | ||
29 | * know about). | ||
30 | */ | ||
31 | void InterfaceInformationImp::updateInterface(Interface *i){ | ||
26 | if(interface->getStatus()){ | 32 | if(interface->getStatus()){ |
@@ -42,35 +48,2 @@ void InterfaceInformationImp::updateInterface(){ | |||
42 | /** | 48 | /** |
43 | * Start the interface. Update the information if successfull | ||
44 | */ | ||
45 | void InterfaceInformationImp::start(){ | ||
46 | if(interface->start()){ | ||
47 | updateInterface(); | ||
48 | } | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * Stop the interface. | ||
53 | */ | ||
54 | void InterfaceInformationImp::stop(){ | ||
55 | if(interface->stop()){ | ||
56 | updateInterface(); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | /*** | ||
61 | * Tell the interface to refresh its information. | ||
62 | **/ | ||
63 | void InterfaceInformationImp::refresh(){ | ||
64 | if(interface->refresh()) | ||
65 | updateInterface(); | ||
66 | } | ||
67 | |||
68 | void InterfaceInformationImp::restart(){ | ||
69 | if(interface->restart()){ | ||
70 | updateInterface(); | ||
71 | } | ||
72 | } | ||
73 | |||
74 | |||
75 | /** | ||
76 | * Create the advanced widget. Fill it with the current interface's information. | 49 | * Create the advanced widget. Fill it with the current interface's information. |