Diffstat (limited to 'noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp index 43483fb..39575c4 100644 --- a/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp +++ b/noncore/settings/networksettings/interfaces/interfaceinformationimp.cpp | |||
@@ -1,30 +1,32 @@ | |||
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> | ||
8 | |||
7 | #include <assert.h> | 9 | #include <assert.h> |
8 | 10 | ||
9 | /** | 11 | /** |
10 | * Constructor for the InterfaceInformationImp class. This class pretty much | 12 | * Constructor for the InterfaceInformationImp class. This class pretty much |
11 | * just display's information about the interface that is passed to it. | 13 | * just display's information about the interface that is passed to it. |
12 | */ | 14 | */ |
13 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f){ | 15 | InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *name, Interface *i, WFlags f):InterfaceInformation(parent, name, f){ |
14 | assert(i); | 16 | assert(i); |
15 | 17 | ||
16 | interface = i; | 18 | interface = i; |
17 | 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 &))); | ||
18 | updateInterface(interface); | 21 | updateInterface(interface); |
19 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); | 22 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); |
20 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); | 23 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); |
21 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); | 24 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); |
22 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); | 25 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); |
23 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 26 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
24 | |||
25 | } | 27 | } |
26 | 28 | ||
27 | /** | 29 | /** |
28 | * Update the interface information and buttons. | 30 | * Update the interface information and buttons. |
29 | * @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 |
30 | * know about). | 32 | * know about). |
@@ -63,8 +65,17 @@ void InterfaceInformationImp::advanced(){ | |||
63 | a->dhcpInformation->setEnabled(interface->isDhcp()); | 65 | a->dhcpInformation->setEnabled(interface->isDhcp()); |
64 | 66 | ||
65 | a->showMaximized(); | 67 | a->showMaximized(); |
66 | a->show(); | 68 | a->show(); |
67 | } | 69 | } |
68 | 70 | ||
71 | /** | ||
72 | * Messages from the interface if start/stop went as planned. | ||
73 | * Purly for user feedback. | ||
74 | * @param message the message to display. | ||
75 | */ | ||
76 | void InterfaceInformationImp::showMessage(const QString &message){ | ||
77 | QMessageBox::information(this, "Message", message, QMessageBox::Ok); | ||
78 | } | ||
79 | |||
69 | // infoimp.cpp | 80 | // infoimp.cpp |
70 | 81 | ||