summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
Unidiff
Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp9
1 files changed, 6 insertions, 3 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
index 1fa5d38..271bb78 100644
--- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
+++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp
@@ -1,20 +1,25 @@
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
10#else
11 #define showMaximized show
12#endif
13
9/** 14/**
10 * Constructor for the InterfaceInformationImp class. This class pretty much 15 * Constructor for the InterfaceInformationImp class. This class pretty much
11 * 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.
12 */ 17 */
13InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f), interface(i){ 18InterfaceInformationImp::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 *))); 19 connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *)));
15 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &))); 20 connect(i, SIGNAL(updateMessage(const QString &)), this, SLOT(showMessage(const QString &)));
16 updateInterface(interface); 21 updateInterface(interface);
17 connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); 22 connect(startButton, SIGNAL(clicked()), interface, SLOT(start()));
18 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); 23 connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop()));
19 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); 24 connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart()));
20 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); 25 connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh()));
@@ -39,37 +44,35 @@ void InterfaceInformationImp::updateInterface(Interface *){
39 } 44 }
40 macAddressLabel->setText(interface->getMacAddress()); 45 macAddressLabel->setText(interface->getMacAddress());
41 ipAddressLabel->setText(interface->getIp()); 46 ipAddressLabel->setText(interface->getIp());
42 subnetMaskLabel->setText(interface->getSubnetMask()); 47 subnetMaskLabel->setText(interface->getSubnetMask());
43 broadcastLabel->setText(interface->getBroadcast()); 48 broadcastLabel->setText(interface->getBroadcast());
44} 49}
45 50
46/** 51/**
47 * 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.
48 * Display it. 53 * Display it.
49 */ 54 */
50void InterfaceInformationImp::advanced(){ 55void InterfaceInformationImp::advanced(){
51 InterfaceAdvanced *a = new InterfaceAdvanced(0, "InterfaceAdvanced"); 56 InterfaceAdvanced *a = new InterfaceAdvanced(this, "InterfaceAdvanced", Qt::WShowModal | Qt::WDestructiveClose | Qt::WType_Dialog);
52 a->interfaceName->setText(interface->getInterfaceName()); 57 a->interfaceName->setText(interface->getInterfaceName());
53 a->macAddressLabel->setText(interface->getMacAddress()); 58 a->macAddressLabel->setText(interface->getMacAddress());
54 a->ipAddressLabel->setText(interface->getIp()); 59 a->ipAddressLabel->setText(interface->getIp());
55 a->subnetMaskLabel->setText(interface->getSubnetMask()); 60 a->subnetMaskLabel->setText(interface->getSubnetMask());
56 a->broadcastLabel->setText(interface->getBroadcast()); 61 a->broadcastLabel->setText(interface->getBroadcast());
57 a->dhcpServerLabel->setText(interface->getDhcpServerIp()); 62 a->dhcpServerLabel->setText(interface->getDhcpServerIp());
58 a->leaseObtainedLabel->setText(interface->getLeaseObtained()); 63 a->leaseObtainedLabel->setText(interface->getLeaseObtained());
59 a->leaseExpiresLabel->setText(interface->getLeaseExpires()); 64 a->leaseExpiresLabel->setText(interface->getLeaseExpires());
60 a->dhcpInformation->setEnabled(interface->isDhcp()); 65 a->dhcpInformation->setEnabled(interface->isDhcp());
61
62 a->showMaximized(); 66 a->showMaximized();
63 a->show();
64} 67}
65 68
66/** 69/**
67 * Messages from the interface if start/stop went as planned. 70 * Messages from the interface if start/stop went as planned.
68 * Purly for user feedback. 71 * Purly for user feedback.
69 * @param message the message to display. 72 * @param message the message to display.
70 */ 73 */
71void InterfaceInformationImp::showMessage(const QString &message){ 74void InterfaceInformationImp::showMessage(const QString &message){
72 QMessageBox::information(this, "Message", message, QMessageBox::Ok); 75 QMessageBox::information(this, "Message", message, QMessageBox::Ok);
73} 76}
74 77
75// infoimp.cpp 78// infoimp.cpp