summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
authorar <ar>2004-02-21 18:32:37 (UTC)
committer ar <ar>2004-02-21 18:32:37 (UTC)
commit536f271b1e6a1d1886e96a28524a3503c4c38c4e (patch) (unidiff)
tree63b3c0ce472a89a0f9731195fececc701bf4ca67 /noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
parentdb2afda83e495bff9fc19fa14a30072f1cd4c67a (diff)
downloadopie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.zip
opie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.tar.gz
opie-536f271b1e6a1d1886e96a28524a3503c4c38c4e.tar.bz2
improve support for BigScreen
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp') (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 @@
1
1#include "interfaceinformationimp.h" 2#include "interfaceinformationimp.h"
2#include "interfaceadvanced.h" 3#include "interfaceadvanced.h"
3 4
5/* OPIE */
6#include <qpe/config.h>
7#include <qpe/qpeapplication.h>
8
9/* QT */
4#include <qcheckbox.h> 10#include <qcheckbox.h>
5#include <qpushbutton.h> 11#include <qpushbutton.h>
6#include <qlabel.h> 12#include <qlabel.h>
7#include <qgroupbox.h> 13#include <qgroupbox.h>
8#include <qmessagebox.h> 14#include <qmessagebox.h>
9 15
10#include <qpe/config.h>
11 16
12#ifdef QWS 17#ifdef QWS
13#else 18#else
@@ -18,18 +23,19 @@
18 * Constructor for the InterfaceInformationImp class. This class pretty much 23 * Constructor for the InterfaceInformationImp class. This class pretty much
19 * just display's information about the interface that is passed to it. 24 * just display's information about the interface that is passed to it.
20 */ 25 */
21InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){ 26InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i)
22 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 27{
23 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); 28 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
24 updateInterface(interface); 29 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &)));
25 connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); 30 updateInterface(interface);
26 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); 31 connect(startButton, SIGNAL(clicked()), interface, SLOT(start()));
27 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); 32 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop()));
28 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); 33 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart()));
29 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); 34 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh()));
30 Config cfg("networksettings", Config::User); 35 connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced()));
31 cfg.setGroup("interface"); 36 Config cfg("networksettings", Config::User);
32 CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); 37 cfg.setGroup("interface");
38 CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) );
33} 39}
34 40
35InterfaceInformationImp::~InterfaceInformationImp() 41InterfaceInformationImp::~InterfaceInformationImp()
@@ -44,39 +50,43 @@ InterfaceInformationImp::~InterfaceInformationImp()
44 * @param Intarface *i the interface to update (should be the one we already 50 * @param Intarface *i the interface to update (should be the one we already
45 * know about). 51 * know about).
46 */ 52 */
47void InterfaceInformationImp::updateInterface(Interface *){ 53void InterfaceInformationImp::updateInterface(Interface *)
48 if(interface->getStatus()){ 54{
49 startButton->setEnabled(false); 55 if(interface->getStatus())
50 stopButton->setEnabled(true); 56 {
51 restartButton->setEnabled(true); 57 startButton->setEnabled(false);
52 } 58 stopButton->setEnabled(true);
53 else{ 59 restartButton->setEnabled(true);
54 startButton->setEnabled(true); 60 }
55 stopButton->setEnabled(false); 61 else
56 restartButton->setEnabled(false); 62 {
57 } 63 startButton->setEnabled(true);
58 macAddressLabel->setText(interface->getMacAddress()); 64 stopButton->setEnabled(false);
59 ipAddressLabel->setText(interface->getIp()); 65 restartButton->setEnabled(false);
60 subnetMaskLabel->setText(interface->getSubnetMask()); 66 }
61 broadcastLabel->setText(interface->getBroadcast()); 67 macAddressLabel->setText(interface->getMacAddress());
68 ipAddressLabel->setText(interface->getIp());
69 subnetMaskLabel->setText(interface->getSubnetMask());
70 broadcastLabel->setText(interface->getBroadcast());
62} 71}
63 72
64/** 73/**
65 * Create the advanced widget. Fill it with the current interface's information. 74 * Create the advanced widget. Fill it with the current interface's information.
66 * Display it. 75 * Display it.
67 */ 76 */
68void InterfaceInformationImp::advanced(){ 77void InterfaceInformationImp::advanced()
69 InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); 78{
70 a->interfaceName->setText(interface->getInterfaceName()); 79 InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
71 a->macAddressLabel->setText(interface->getMacAddress()); 80 a->interfaceName->setText(interface->getInterfaceName());
72 a->ipAddressLabel->setText(interface->getIp()); 81 a->macAddressLabel->setText(interface->getMacAddress());
73 a->subnetMaskLabel->setText(interface->getSubnetMask()); 82 a->ipAddressLabel->setText(interface->getIp());
74 a->broadcastLabel->setText(interface->getBroadcast()); 83 a->subnetMaskLabel->setText(interface->getSubnetMask());
75 a->dhcpServerLabel->setText(interface->getDhcpServerIp()); 84 a->broadcastLabel->setText(interface->getBroadcast());
76 a->leaseObtainedLabel->setText(interface->getLeaseObtained()); 85 a->dhcpServerLabel->setText(interface->getDhcpServerIp());
77 a->leaseExpiresLabel->setText(interface->getLeaseExpires()); 86 a->leaseObtainedLabel->setText(interface->getLeaseObtained());
78 a->dhcpInformation->setEnabled(interface->isDhcp()); 87 a->leaseExpiresLabel->setText(interface->getLeaseExpires());
79 a->showMaximized(); 88 a->dhcpInformation->setEnabled(interface->isDhcp());
89 QPEApplication::showWidget( a );
80} 90}
81 91
82/** 92/**
@@ -84,9 +94,10 @@ void InterfaceInformationImp::advanced(){
84 * Purly for user feedback. 94 * Purly for user feedback.
85 * @param message the message to display. 95 * @param message the message to display.
86 */ 96 */
87void InterfaceInformationImp::showMessage(const QString &message){ 97void InterfaceInformationImp::showMessage(const QString &message)
88 if (CheckBoxSilent->isChecked()) return; 98{
89 QMessageBox::information(this, "Message", message, QMessageBox::Ok); 99 if (CheckBoxSilent->isChecked()) return;
100 QMessageBox::information(this, "Message", message, QMessageBox::Ok);
90} 101}
91 102
92// infoimp.cpp 103// infoimp.cpp