author | benmeyer <benmeyer> | 2002-10-17 16:30:44 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-17 16:30:44 (UTC) |
commit | 18cc7321db186865629a5c4702074211e42b92fd (patch) (unidiff) | |
tree | beb15112009c1cc966115904a322b32d465e47e6 /noncore/settings/networksettings/interfaceinformationimp.cpp | |
parent | 75f078ec92376db2c90a327bbc50d9bb5c1fb57a (diff) | |
download | opie-18cc7321db186865629a5c4702074211e42b92fd.zip opie-18cc7321db186865629a5c4702074211e42b92fd.tar.gz opie-18cc7321db186865629a5c4702074211e42b92fd.tar.bz2 |
interface is now a qobject
Diffstat (limited to 'noncore/settings/networksettings/interfaceinformationimp.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/interfaceinformationimp.cpp | 51 |
1 files changed, 12 insertions, 39 deletions
diff --git a/noncore/settings/networksettings/interfaceinformationimp.cpp b/noncore/settings/networksettings/interfaceinformationimp.cpp index e37e0f8..59a6400 100644 --- a/noncore/settings/networksettings/interfaceinformationimp.cpp +++ b/noncore/settings/networksettings/interfaceinformationimp.cpp | |||
@@ -13,16 +13,22 @@ InterfaceInformationImp::InterfaceInformationImp(QWidget *parent, const char *na | |||
13 | assert(i); | 13 | assert(i); |
14 | 14 | ||
15 | interface = i; | 15 | interface = i; |
16 | updateInterface(); | 16 | connect(i, SIGNAL(updateInterface(Interface *)), this, SLOT(updateInterface(Interface *))); |
17 | connect(startButton, SIGNAL(clicked()), this, SLOT(start())); | 17 | updateInterface(interface); |
18 | connect(stopButton, SIGNAL(clicked()), this, SLOT(stop())); | 18 | connect(startButton, SIGNAL(clicked()), interface, SLOT(start())); |
19 | connect(restartButton, SIGNAL(clicked()), this, SLOT(restart())); | 19 | connect(stopButton, SIGNAL(clicked()), interface, SLOT(stop())); |
20 | connect(refreshButton, SIGNAL(clicked()), this, SLOT(refresh())); | 20 | connect(restartButton, SIGNAL(clicked()), interface, SLOT(restart())); |
21 | connect(refreshButton, SIGNAL(clicked()), interface, SLOT(refresh())); | ||
21 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); | 22 | connect(advancedButton, SIGNAL(clicked()), this, SLOT(advanced())); |
22 | 23 | ||
23 | } | 24 | } |
24 | 25 | ||
25 | void InterfaceInformationImp::updateInterface(){ | 26 | /** |
27 | * Update the interface information and buttons. | ||
28 | * @param Intarface *i the interface to update (should be the one we already | ||
29 | * know about). | ||
30 | */ | ||
31 | void InterfaceInformationImp::updateInterface(Interface *i){ | ||
26 | if(interface->getStatus()){ | 32 | if(interface->getStatus()){ |
27 | startButton->setEnabled(false); | 33 | startButton->setEnabled(false); |
28 | stopButton->setEnabled(true); | 34 | stopButton->setEnabled(true); |
@@ -40,39 +46,6 @@ void InterfaceInformationImp::updateInterface(){ | |||
40 | } | 46 | } |
41 | 47 | ||
42 | /** | 48 | /** |
43 | * Start the interface. Update the information if successfull | ||
44 | */ | ||
45 | void InterfaceInformationImp::start(){ | ||
46 | if(interface->start()){ | ||
47 | updateInterface(); | ||
48 | } | ||
49 | } | ||
50 | |||
51 | /** | ||
52 | * Stop the interface. | ||
53 | */ | ||
54 | void InterfaceInformationImp::stop(){ | ||
55 | if(interface->stop()){ | ||
56 | updateInterface(); | ||
57 | } | ||
58 | } | ||
59 | |||
60 | /*** | ||
61 | * Tell the interface to refresh its information. | ||
62 | **/ | ||
63 | void InterfaceInformationImp::refresh(){ | ||
64 | if(interface->refresh()) | ||
65 | updateInterface(); | ||
66 | } | ||
67 | |||
68 | void InterfaceInformationImp::restart(){ | ||
69 | if(interface->restart()){ | ||
70 | updateInterface(); | ||
71 | } | ||
72 | } | ||
73 | |||
74 | |||
75 | /** | ||
76 | * Create the advanced widget. Fill it with the current interface's information. | 49 | * Create the advanced widget. Fill it with the current interface's information. |
77 | * Display it. | 50 | * Display it. |
78 | */ | 51 | */ |