summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces
authorar <ar>2004-02-21 18:32:37 (UTC)
committer ar <ar>2004-02-21 18:32:37 (UTC)
commit536f271b1e6a1d1886e96a28524a3503c4c38c4e (patch) (side-by-side diff)
tree63b3c0ce472a89a0f9731195fececc701bf4ca67 /noncore/settings/networksettings/interfaces
parentdb2afda83e495bff9fc19fa14a30072f1cd4c67a (diff)
downloadopie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.zip
opie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.tar.gz
opie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.tar.bz2
improve support for BigScreen
Diffstat (limited to 'noncore/settings/networksettings/interfaces') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp97
1 files changed, 54 insertions, 43 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,18 +23,19 @@
* 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){
- connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
- connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &)));
- 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()));
- Config cfg("networksettings", Config::User);
- cfg.setGroup("interface");
- CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) );
+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);
+ 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()));
+ Config cfg("networksettings", Config::User);
+ cfg.setGroup("interface");
+ CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) );
}
InterfaceInformationImp::~InterfaceInformationImp()
@@ -44,39 +50,43 @@ InterfaceInformationImp::~InterfaceInformationImp()
* @param Intarface *i the interface to update (should be the one we already
* know about).
*/
-void InterfaceInformationImp::updateInterface(Interface *){
- if(interface->getStatus()){
- startButton->setEnabled(false);
- stopButton->setEnabled(true);
- restartButton->setEnabled(true);
- }
- else{
- startButton->setEnabled(true);
- stopButton->setEnabled(false);
- restartButton->setEnabled(false);
- }
- macAddressLabel->setText(interface->getMacAddress());
- ipAddressLabel->setText(interface->getIp());
- subnetMaskLabel->setText(interface->getSubnetMask());
- broadcastLabel->setText(interface->getBroadcast());
+void InterfaceInformationImp::updateInterface(Interface *)
+{
+ if(interface->getStatus())
+ {
+ startButton->setEnabled(false);
+ stopButton->setEnabled(true);
+ restartButton->setEnabled(true);
+ }
+ else
+ {
+ startButton->setEnabled(true);
+ stopButton->setEnabled(false);
+ restartButton->setEnabled(false);
+ }
+ macAddressLabel->setText(interface->getMacAddress());
+ ipAddressLabel->setText(interface->getIp());
+ subnetMaskLabel->setText(interface->getSubnetMask());
+ broadcastLabel->setText(interface->getBroadcast());
}
/**
* Create the advanced widget. Fill it with the current interface's information.
* Display it.
*/
-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());
- a->ipAddressLabel->setText(interface->getIp());
- a->subnetMaskLabel->setText(interface->getSubnetMask());
- a->broadcastLabel->setText(interface->getBroadcast());
- a->dhcpServerLabel->setText(interface->getDhcpServerIp());
- a->leaseObtainedLabel->setText(interface->getLeaseObtained());
- a->leaseExpiresLabel->setText(interface->getLeaseExpires());
- a->dhcpInformation->setEnabled(interface->isDhcp());
- a->showMaximized();
+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());
+ a->ipAddressLabel->setText(interface->getIp());
+ a->subnetMaskLabel->setText(interface->getSubnetMask());
+ a->broadcastLabel->setText(interface->getBroadcast());
+ a->dhcpServerLabel->setText(interface->getDhcpServerIp());
+ a->leaseObtainedLabel->setText(interface->getLeaseObtained());
+ a->leaseExpiresLabel->setText(interface->getLeaseExpires());
+ a->dhcpInformation->setEnabled(interface->isDhcp());
+ QPEApplication::showWidget( a );
}
/**
@@ -84,9 +94,10 @@ void InterfaceInformationImp::advanced(){
* Purly for user feedback.
* @param message the message to display.
*/
-void InterfaceInformationImp::showMessage(const QString &message){
- if (CheckBoxSilent->isChecked()) return;
- QMessageBox::information(this, "Message", message, QMessageBox::Ok);
+void InterfaceInformationImp::showMessage(const QString &message)
+{
+ if (CheckBoxSilent->isChecked()) return;
+ QMessageBox::information(this, "Message", message, QMessageBox::Ok);
}
// infoimp.cpp