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