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