Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp index 698dfd3..ff65424 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | |||
@@ -1,104 +1,104 @@ | |||
1 | 1 | ||
2 | #include "interfaceinformationimp.h" | 2 | #include "interfaceinformationimp.h" |
3 | #include "interfaceadvanced.h" | 3 | #include "interfaceadvanced.h" |
4 | 4 | ||
5 | /* OPIE */ | 5 | /* OPIE */ |
6 | #include <qpe/config.h> | 6 | #include <qpe/config.h> |
7 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | 8 | ||
9 | /* QT */ | 9 | /* QT */ |
10 | #include <qcheckbox.h> | 10 | #include <qcheckbox.h> |
11 | #include <qpushbutton.h> | 11 | #include <qpushbutton.h> |
12 | #include <qlabel.h> | 12 | #include <qlabel.h> |
13 | #include <qgroupbox.h> | 13 | #include <qgroupbox.h> |
14 | #include <qmessagebox.h> | 14 | #include <qmessagebox.h> |
15 | 15 | ||
16 | 16 | ||
17 | #ifdef QWS | 17 | #ifdef QWS |
18 | #else | 18 | #else |
19 | #define showMaximized show | 19 | #define showMaximized show |
20 | #endif | 20 | #endif |
21 | 21 | ||
22 | /** | 22 | /** |
23 | * Constructor for the InterfaceInformationImp class. This class pretty much | 23 | * Constructor for the InterfaceInformationImp class. This class pretty much |
24 | * 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. |
25 | */ | 25 | */ |
26 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i) | 26 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i) |
27 | { | 27 | { |
28 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 28 | connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*))); |
29 | connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); | 29 | connect(i, SIGNAL(updateMessage(const QString&)), this, SLOT(showMessage(const QString&))); |
30 | updateInterface(interface); | 30 | updateInterface(interface); |
31 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); | 31 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); |
32 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); | 32 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); |
33 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); | 33 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); |
34 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); | 34 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); |
35 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 35 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
36 | Config cfg("networksettings", Config::User); | 36 | Config cfg("networksettings", Config::User); |
37 | cfg.setGroup("interface"); | 37 | cfg.setGroup("interface"); |
38 | CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); | 38 | CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); |
39 | } | 39 | } |
40 | 40 | ||
41 | InterfaceInformationImp::~InterfaceInformationImp() | 41 | InterfaceInformationImp::~InterfaceInformationImp() |
42 | { | 42 | { |
43 | Config cfg("networksettings", Config::User); | 43 | Config cfg("networksettings", Config::User); |
44 | cfg.setGroup("interface"); | 44 | cfg.setGroup("interface"); |
45 | cfg.writeEntry("silent", CheckBoxSilent->isChecked() ); | 45 | cfg.writeEntry("silent", CheckBoxSilent->isChecked() ); |
46 | } | 46 | } |
47 | 47 | ||
48 | /** | 48 | /** |
49 | * Update the interface information and buttons. | 49 | * Update the interface information and buttons. |
50 | * @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 |
51 | * know about). | 51 | * know about). |
52 | */ | 52 | */ |
53 | void InterfaceInformationImp::updateInterface(Interface *) | 53 | void InterfaceInformationImp::updateInterface(Interface *) |
54 | { | 54 | { |
55 | if(interface->getStatus()) | 55 | if(interface->getStatus()) |
56 | { | 56 | { |
57 | startButton->setEnabled(false); | 57 | startButton->setEnabled(false); |
58 | stopButton->setEnabled(true); | 58 | stopButton->setEnabled(true); |
59 | restartButton->setEnabled(true); | 59 | restartButton->setEnabled(true); |
60 | } | 60 | } |
61 | else | 61 | else |
62 | { | 62 | { |
63 | startButton->setEnabled(true); | 63 | startButton->setEnabled(true); |
64 | stopButton->setEnabled(false); | 64 | stopButton->setEnabled(false); |
65 | restartButton->setEnabled(false); | 65 | restartButton->setEnabled(false); |
66 | } | 66 | } |
67 | macAddressLabel->setText(interface->getMacAddress()); | 67 | macAddressLabel->setText(interface->getMacAddress()); |
68 | ipAddressLabel->setText(interface->getIp()); | 68 | ipAddressLabel->setText(interface->getIp()); |
69 | subnetMaskLabel->setText(interface->getSubnetMask()); | 69 | subnetMaskLabel->setText(interface->getSubnetMask()); |
70 | broadcastLabel->setText(interface->getBroadcast()); | 70 | broadcastLabel->setText(interface->getBroadcast()); |
71 | } | 71 | } |
72 | 72 | ||
73 | /** | 73 | /** |
74 | * 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. |
75 | * Display it. | 75 | * Display it. |
76 | */ | 76 | */ |
77 | void InterfaceInformationImp::advanced() | 77 | void InterfaceInformationImp::advanced() |
78 | { | 78 | { |
79 | 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); |
80 | a->interfaceName->setText(interface->getInterfaceName()); | 80 | a->interfaceName->setText(interface->getInterfaceName()); |
81 | a->macAddressLabel->setText(interface->getMacAddress()); | 81 | a->macAddressLabel->setText(interface->getMacAddress()); |
82 | a->ipAddressLabel->setText(interface->getIp()); | 82 | a->ipAddressLabel->setText(interface->getIp()); |
83 | a->subnetMaskLabel->setText(interface->getSubnetMask()); | 83 | a->subnetMaskLabel->setText(interface->getSubnetMask()); |
84 | a->broadcastLabel->setText(interface->getBroadcast()); | 84 | a->broadcastLabel->setText(interface->getBroadcast()); |
85 | a->dhcpServerLabel->setText(interface->getDhcpServerIp()); | 85 | a->dhcpServerLabel->setText(interface->getDhcpServerIp()); |
86 | a->leaseObtainedLabel->setText(interface->getLeaseObtained()); | 86 | a->leaseObtainedLabel->setText(interface->getLeaseObtained()); |
87 | a->leaseExpiresLabel->setText(interface->getLeaseExpires()); | 87 | a->leaseExpiresLabel->setText(interface->getLeaseExpires()); |
88 | a->dhcpInformation->setEnabled(interface->isDhcp()); | 88 | a->dhcpInformation->setEnabled(interface->isDhcp()); |
89 | QPEApplication::showWidget( a ); | 89 | QPEApplication::showWidget( a ); |
90 | } | 90 | } |
91 | 91 | ||
92 | /** | 92 | /** |
93 | * Messages from the interface if start/stop went as planned. | 93 | * Messages from the interface if start/stop went as planned. |
94 | * Purly for user feedback. | 94 | * Purly for user feedback. |
95 | * @param message the message to display. | 95 | * @param message the message to display. |
96 | */ | 96 | */ |
97 | void InterfaceInformationImp::showMessage(const QString &message) | 97 | void InterfaceInformationImp::showMessage(const QString &message) |
98 | { | 98 | { |
99 | if (CheckBoxSilent->isChecked()) return; | 99 | if (CheckBoxSilent->isChecked()) return; |
100 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); | 100 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); |
101 | } | 101 | } |
102 | 102 | ||
103 | // infoimp.cpp | 103 | // infoimp.cpp |
104 | 104 | ||