Diffstat (limited to 'noncore/settings/networksettings/interfaceinformationimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaceinformationimp.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/settings/networksettings/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaceinformationimp.cpp index 59a6400..43483fb 100644 --- a/noncore/settings/networksettings/interfaceinformationimp.cpp +++ b/noncore/settings/networksettings/interfaceinformationimp.cpp | |||
@@ -1,29 +1,30 @@ | |||
1 | #include "interfaceinformationimp.h" | 1 | #include "interfaceinformationimp.h" |
2 | #include "interfaceadvanced.h" | 2 | #include "interfaceadvanced.h" |
3 | 3 | ||
4 | #include <qpushbutton.h> | 4 | #include <qpushbutton.h> |
5 | #include <qlabel.h> | 5 | #include <qlabel.h> |
6 | #include <qgroupbox.h> | ||
6 | #include <assert.h> | 7 | #include <assert.h> |
7 | 8 | ||
8 | /** | 9 | /** |
9 | * Constructor for the InterfaceInformationImp class. This class pretty much | 10 | * Constructor for the InterfaceInformationImp class. This class pretty much |
10 | * just display's information about the interface that is passed to it. | 11 | * just display's information about the interface that is passed to it. |
11 | */ | 12 | */ |
12 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f){ | 13 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f){ |
13 | assert(i); | 14 | assert(i); |
14 | 15 | ||
15 | interface = i; | 16 | interface = i; |
16 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 17 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); |
17 | updateInterface(interface); | 18 | updateInterface(interface); |
18 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); | 19 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); |
19 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); | 20 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); |
20 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); | 21 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); |
21 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); | 22 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); |
22 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 23 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
23 | 24 | ||
24 | } | 25 | } |
25 | 26 | ||
26 | /** | 27 | /** |
27 | * Update the interface information and buttons. | 28 | * Update the interface information and buttons. |
28 | * @param Intarface *i the interface to update (should be the one we already | 29 | * @param Intarface *i the interface to update (should be the one we already |
29 | * know about). | 30 | * know about). |
@@ -38,30 +39,32 @@ void InterfaceInformationImp::updateInterface(Interface *i){ | |||
38 | startButton->setEnabled(true); | 39 | startButton->setEnabled(true); |
39 | stopButton->setEnabled(false); | 40 | stopButton->setEnabled(false); |
40 | restartButton->setEnabled(false); | 41 | restartButton->setEnabled(false); |
41 | } | 42 | } |
42 | macAddressLabel->setText(interface->getMacAddress()); | 43 | macAddressLabel->setText(interface->getMacAddress()); |
43 | ipAddressLabel->setText(interface->getIp()); | 44 | ipAddressLabel->setText(interface->getIp()); |
44 | subnetMaskLabel->setText(interface->getSubnetMask()); | 45 | subnetMaskLabel->setText(interface->getSubnetMask()); |
45 | broadcastLabel->setText(interface->getBroadcast()); | 46 | broadcastLabel->setText(interface->getBroadcast()); |
46 | } | 47 | } |
47 | 48 | ||
48 | /** | 49 | /** |
49 | * Create the advanced widget. Fill it with the current interface's information. | 50 | * Create the advanced widget. Fill it with the current interface's information. |
50 | * Display it. | 51 | * Display it. |
51 | */ | 52 | */ |
52 | void InterfaceInformationImp::advanced(){ | 53 | void InterfaceInformationImp::advanced(){ |
53 | InterfaceAdvanced *a = new InterfaceAdvanced(0, "InterfaceAdvanced"); | 54 | InterfaceAdvanced *a = new InterfaceAdvanced(0, "InterfaceAdvanced"); |
54 | a->interfaceName->setText(interface->getInterfaceName()); | 55 | a->interfaceName->setText(interface->getInterfaceName()); |
55 | a->macAddressLabel->setText(interface->getMacAddress()); | 56 | a->macAddressLabel->setText(interface->getMacAddress()); |
56 | a->ipAddressLabel->setText(interface->getIp()); | 57 | a->ipAddressLabel->setText(interface->getIp()); |
57 | a->subnetMaskLabel->setText(interface->getSubnetMask()); | 58 | a->subnetMaskLabel->setText(interface->getSubnetMask()); |
58 | a->broadcastLabel->setText(interface->getBroadcast()); | 59 | a->broadcastLabel->setText(interface->getBroadcast()); |
59 | a->dhcpServerLabel->setText(interface->getDhcpServerIp()); | 60 | a->dhcpServerLabel->setText(interface->getDhcpServerIp()); |
60 | a->leaseObtainedLabel->setText(interface->getLeaseObtained()); | 61 | a->leaseObtainedLabel->setText(interface->getLeaseObtained()); |
61 | a->leaseExpiresLabel->setText(interface->getLeaseExpires()); | 62 | a->leaseExpiresLabel->setText(interface->getLeaseExpires()); |
63 | a->dhcpInformation->setEnabled(interface->isDhcp()); | ||
64 | |||
62 | a->showMaximized(); | 65 | a->showMaximized(); |
63 | a->show(); | 66 | a->show(); |
64 | } | 67 | } |
65 | 68 | ||
66 | // infoimp.cpp | 69 | // infoimp.cpp |
67 | 70 | ||