summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
Unidiff
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,27 +1,33 @@
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
14 #define showMaximized show 19 #define showMaximized show
15#endif 20#endif
16 21
17/** 22/**
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)
27{
22 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); 28 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
23 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); 29 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &)));
24 updateInterface(interface); 30 updateInterface(interface);
25 connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); 31 connect(startButton, SIGNAL(clicked()), interface, SLOT(start()));
26 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); 32 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop()));
27 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); 33 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart()));
@@ -41,19 +47,22 @@ InterfaceInformationImp::~InterfaceInformationImp()
41 47
42/** 48/**
43 * Update the interface information and buttons. 49 * Update the interface information and buttons.
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{
55 if(interface->getStatus())
56 {
49 startButton->setEnabled(false); 57 startButton->setEnabled(false);
50 stopButton->setEnabled(true); 58 stopButton->setEnabled(true);
51 restartButton->setEnabled(true); 59 restartButton->setEnabled(true);
52 } 60 }
53 else{ 61 else
62 {
54 startButton->setEnabled(true); 63 startButton->setEnabled(true);
55 stopButton->setEnabled(false); 64 stopButton->setEnabled(false);
56 restartButton->setEnabled(false); 65 restartButton->setEnabled(false);
57 } 66 }
58 macAddressLabel->setText(interface->getMacAddress()); 67 macAddressLabel->setText(interface->getMacAddress());
59 ipAddressLabel->setText(interface->getIp()); 68 ipAddressLabel->setText(interface->getIp());
@@ -62,32 +71,34 @@ void InterfaceInformationImp::updateInterface(Interface *){
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()
78{
69 InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); 79 InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog);
70 a->interfaceName->setText(interface->getInterfaceName()); 80 a->interfaceName->setText(interface->getInterfaceName());
71 a->macAddressLabel->setText(interface->getMacAddress()); 81 a->macAddressLabel->setText(interface->getMacAddress());
72 a->ipAddressLabel->setText(interface->getIp()); 82 a->ipAddressLabel->setText(interface->getIp());
73 a->subnetMaskLabel->setText(interface->getSubnetMask()); 83 a->subnetMaskLabel->setText(interface->getSubnetMask());
74 a->broadcastLabel->setText(interface->getBroadcast()); 84 a->broadcastLabel->setText(interface->getBroadcast());
75 a->dhcpServerLabel->setText(interface->getDhcpServerIp()); 85 a->dhcpServerLabel->setText(interface->getDhcpServerIp());
76 a->leaseObtainedLabel->setText(interface->getLeaseObtained()); 86 a->leaseObtainedLabel->setText(interface->getLeaseObtained());
77 a->leaseExpiresLabel->setText(interface->getLeaseExpires()); 87 a->leaseExpiresLabel->setText(interface->getLeaseExpires());
78 a->dhcpInformation->setEnabled(interface->isDhcp()); 88 a->dhcpInformation->setEnabled(interface->isDhcp());
79 a->showMaximized(); 89 QPEApplication::showWidget( a );
80} 90}
81 91
82/** 92/**
83 * Messages from the interface if start/stop went as planned. 93 * Messages from the interface if start/stop went as planned.
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)
98{
88 if (CheckBoxSilent->isChecked()) return; 99 if (CheckBoxSilent->isChecked()) return;
89 QMessageBox::information(this, "Message", message, QMessageBox::Ok); 100 QMessageBox::information(this, "Message", message, QMessageBox::Ok);
90} 101}
91 102
92// infoimp.cpp 103// infoimp.cpp
93 104