summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp27
1 files changed, 19 insertions, 8 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
index 37c3a91..698dfd3 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
@@ -1,13 +1,18 @@
+
#include "interfaceinformationimp.h"
#include "interfaceadvanced.h"
+/* OPIE */
+#include <qpe/config.h>
+#include <qpe/qpeapplication.h>
+
+/* QT */
#include <qcheckbox.h>
#include <qpushbutton.h>
#include <qlabel.h>
#include <qgroupbox.h>
#include <qmessagebox.h>
-#include <qpe/config.h>
#ifdef QWS
#else
@@ -18,7 +23,8 @@
* Constructor for the InterfaceInformationImp class. This class pretty much
* just display's information about the interface that is passed to it.
*/
-InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){
+InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i)
+{
connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &)));
updateInterface(interface);
@@ -44,13 +50,16 @@ InterfaceInformationImp::~InterfaceInformationImp()
* @param Intarface *i the interface to update (should be the one we already
* know about).
*/
-void InterfaceInformationImp::updateInterface(Interface *){
- if(interface->getStatus()){
+void InterfaceInformationImp::updateInterface(Interface *)
+{
+ if(interface->getStatus())
+ {
startButton->setEnabled(false);
stopButton->setEnabled(true);
restartButton->setEnabled(true);
}
- else{
+ else
+ {
startButton->setEnabled(true);
stopButton->setEnabled(false);
restartButton->setEnabled(false);
@@ -65,7 +74,8 @@ void InterfaceInformationImp::updateInterface(Interface *){
* Create the advanced widget. Fill it with the current interface's information.
* Display it.
*/
-void InterfaceInformationImp::advanced(){
+void InterfaceInformationImp::advanced()
+{
InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
a->interfaceName->setText(interface->getInterfaceName());
a->macAddressLabel->setText(interface->getMacAddress());
@@ -76,7 +86,7 @@ void InterfaceInformationImp::advanced(){
a->leaseObtainedLabel->setText(interface->getLeaseObtained());
a->leaseExpiresLabel->setText(interface->getLeaseExpires());
a->dhcpInformation->setEnabled(interface->isDhcp());
- a->showMaximized();
+ QPEApplication::showWidget( a );
}
/**
@@ -84,7 +94,8 @@ void InterfaceInformationImp::advanced(){
* Purly for user feedback.
* @param message the message to display.
*/
-void InterfaceInformationImp::showMessage(const QString &message){
+void InterfaceInformationImp::showMessage(const QString &message)
+{
if (CheckBoxSilent->isChecked()) return;
QMessageBox::information(this, "Message", message, QMessageBox::Ok);
}