Diffstat (limited to 'noncore/settings/networksettings/interfaces') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | 97 |
1 files changed, 54 insertions, 43 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 +1,2 @@ | |||
1 | |||
1 | #include "interfaceinformationimp.h" | 2 | #include "interfaceinformationimp.h" |
@@ -3,2 +4,7 @@ | |||
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> |
@@ -9,3 +15,2 @@ | |||
9 | 15 | ||
10 | #include <qpe/config.h> | ||
11 | 16 | ||
@@ -20,14 +25,15 @@ | |||
20 | */ | 25 | */ |
21 | 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) |
22 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); | 27 | { |
23 | connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); | 28 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); |
24 | updateInterface(interface); | 29 | connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); |
25 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); | 30 | updateInterface(interface); |
26 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); | 31 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); |
27 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); | 32 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); |
28 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); | 33 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); |
29 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 34 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); |
30 | Config cfg("networksettings", Config::User); | 35 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
31 | cfg.setGroup("interface"); | 36 | Config cfg("networksettings", Config::User); |
32 | CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); | 37 | cfg.setGroup("interface"); |
38 | CheckBoxSilent->setChecked( cfg.readBoolEntry("silent", false) ); | ||
33 | } | 39 | } |
@@ -46,17 +52,20 @@ InterfaceInformationImp::~InterfaceInformationImp() | |||
46 | */ | 52 | */ |
47 | void InterfaceInformationImp::updateInterface(Interface *){ | 53 | void InterfaceInformationImp::updateInterface(Interface *) |
48 | if(interface->getStatus()){ | 54 | { |
49 | startButton->setEnabled(false); | 55 | if(interface->getStatus()) |
50 | stopButton->setEnabled(true); | 56 | { |
51 | restartButton->setEnabled(true); | 57 | startButton->setEnabled(false); |
52 | } | 58 | stopButton->setEnabled(true); |
53 | else{ | 59 | restartButton->setEnabled(true); |
54 | startButton->setEnabled(true); | 60 | } |
55 | stopButton->setEnabled(false); | 61 | else |
56 | restartButton->setEnabled(false); | 62 | { |
57 | } | 63 | startButton->setEnabled(true); |
58 | macAddressLabel->setText(interface->getMacAddress()); | 64 | stopButton->setEnabled(false); |
59 | ipAddressLabel->setText(interface->getIp()); | 65 | restartButton->setEnabled(false); |
60 | subnetMaskLabel->setText(interface->getSubnetMask()); | 66 | } |
61 | broadcastLabel->setText(interface->getBroadcast()); | 67 | macAddressLabel->setText(interface->getMacAddress()); |
68 | ipAddressLabel->setText(interface->getIp()); | ||
69 | subnetMaskLabel->setText(interface->getSubnetMask()); | ||
70 | broadcastLabel->setText(interface->getBroadcast()); | ||
62 | } | 71 | } |
@@ -67,14 +76,15 @@ void InterfaceInformationImp::updateInterface(Interface *){ | |||
67 | */ | 76 | */ |
68 | void InterfaceInformationImp::advanced(){ | 77 | void InterfaceInformationImp::advanced() |
69 | InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); | 78 | { |
70 | a->interfaceName->setText(interface->getInterfaceName()); | 79 | InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); |
71 | a->macAddressLabel->setText(interface->getMacAddress()); | 80 | a->interfaceName->setText(interface->getInterfaceName()); |
72 | a->ipAddressLabel->setText(interface->getIp()); | 81 | a->macAddressLabel->setText(interface->getMacAddress()); |
73 | a->subnetMaskLabel->setText(interface->getSubnetMask()); | 82 | a->ipAddressLabel->setText(interface->getIp()); |
74 | a->broadcastLabel->setText(interface->getBroadcast()); | 83 | a->subnetMaskLabel->setText(interface->getSubnetMask()); |
75 | a->dhcpServerLabel->setText(interface->getDhcpServerIp()); | 84 | a->broadcastLabel->setText(interface->getBroadcast()); |
76 | a->leaseObtainedLabel->setText(interface->getLeaseObtained()); | 85 | a->dhcpServerLabel->setText(interface->getDhcpServerIp()); |
77 | a->leaseExpiresLabel->setText(interface->getLeaseExpires()); | 86 | a->leaseObtainedLabel->setText(interface->getLeaseObtained()); |
78 | a->dhcpInformation->setEnabled(interface->isDhcp()); | 87 | a->leaseExpiresLabel->setText(interface->getLeaseExpires()); |
79 | a->showMaximized(); | 88 | a->dhcpInformation->setEnabled(interface->isDhcp()); |
89 | QPEApplication::showWidget( a ); | ||
80 | } | 90 | } |
@@ -86,5 +96,6 @@ void InterfaceInformationImp::advanced(){ | |||
86 | */ | 96 | */ |
87 | void InterfaceInformationImp::showMessage(const QString &message){ | 97 | void InterfaceInformationImp::showMessage(const QString &message) |
88 | if (CheckBoxSilent->isChecked()) return; | 98 | { |
89 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); | 99 | if (CheckBoxSilent->isChecked()) return; |
100 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); | ||
90 | } | 101 | } |