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 @@ -13,16 +13,22 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na assert(i); interface = i; - updateInterface(); - connect(startButton, SIGNAL(clicked()), this, SLOT(start())); - connect(stopButton, SIGNAL(clicked()), this, SLOT(stop())); - connect(restartButton, SIGNAL(clicked()), this, SLOT(restart())); - connect(refreshButton, SIGNAL(clicked()), this, SLOT(refresh())); + connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); + updateInterface(interface); + connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); + connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); + connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); + connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); } -void InterfaceInformationImp::updateInterface(){ +/** + * Update the interface information and buttons. + * @param Intarface *i the interface to update (should be the one we already + * know about). + */ +void InterfaceInformationImp::updateInterface(Interface *i){ if(interface->getStatus()){ startButton->setEnabled(false); stopButton->setEnabled(true); @@ -40,39 +46,6 @@ void InterfaceInformationImp::updateInterface(){ } /** - * Start the interface. Update the information if successfull - */ -void InterfaceInformationImp::start(){ - if(interface->start()){ - updateInterface(); - } -} - -/** - * Stop the interface. - */ -void InterfaceInformationImp::stop(){ - if(interface->stop()){ - updateInterface(); - } -} - -/*** - * Tell the interface to refresh its information. - **/ -void InterfaceInformationImp::refresh(){ - if(interface->refresh()) - updateInterface(); -} - -void InterfaceInformationImp::restart(){ - if(interface->restart()){ - updateInterface(); - } -} - - -/** * Create the advanced widget. Fill it with the current interface's information. * Display it. */ |