summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/net/networksetup/interface.cpp2
-rw-r--r--noncore/net/networksetup/interface.h7
-rw-r--r--noncore/net/networksetup/interfacesetup.ui258
-rw-r--r--noncore/net/networksetup/mainwindow.ui74
-rw-r--r--noncore/net/networksetup/mainwindowimp.cpp59
-rw-r--r--noncore/net/networksetup/mainwindowimp.h1
-rw-r--r--noncore/net/networksetup/module.h7
-rw-r--r--noncore/net/networksetup/networksetup.pro4
-rw-r--r--noncore/settings/networksettings/interface.cpp2
-rw-r--r--noncore/settings/networksettings/interface.h7
-rw-r--r--noncore/settings/networksettings/interfacesetup.ui258
-rw-r--r--noncore/settings/networksettings/mainwindow.ui74
-rw-r--r--noncore/settings/networksettings/mainwindowimp.cpp59
-rw-r--r--noncore/settings/networksettings/mainwindowimp.h1
-rw-r--r--noncore/settings/networksettings/module.h7
-rw-r--r--noncore/settings/networksettings/networksetup.pro4
16 files changed, 530 insertions, 294 deletions
diff --git a/noncore/net/networksetup/interface.cpp b/noncore/net/networksetup/interface.cpp
index f6eed00..5b21364 100644
--- a/noncore/net/networksetup/interface.cpp
+++ b/noncore/net/networksetup/interface.cpp
@@ -10,7 +10,7 @@
10#include <stdio.h> 10#include <stdio.h>
11#include <stdlib.h> 11#include <stdlib.h>
12 12
13Interface::Interface(QString name, bool newSatus): status(newSatus), attached(false), interfaceName(name), hardareName("Unknown"), moduleOwner("Default"), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){ 13Interface::Interface(QString name, bool newSatus): status(newSatus), attached(false), interfaceName(name), hardareName("Unknown"), moduleOwner(NULL), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){
14 refresh(); 14 refresh();
15} 15}
16 16
diff --git a/noncore/net/networksetup/interface.h b/noncore/net/networksetup/interface.h
index 1ad71eb..5dc95a4 100644
--- a/noncore/net/networksetup/interface.h
+++ b/noncore/net/networksetup/interface.h
@@ -3,6 +3,7 @@
3 3
4#include <qstring.h> 4#include <qstring.h>
5 5
6class Module;
6class Interface { 7class Interface {
7 8
8public: 9public:
@@ -21,8 +22,8 @@ public:
21 virtual QString getHardwareName(){ return hardareName; }; 22 virtual QString getHardwareName(){ return hardareName; };
22 virtual void setHardwareName(QString name="Unknown"){ hardareName = name; }; 23 virtual void setHardwareName(QString name="Unknown"){ hardareName = name; };
23 24
24 virtual QString getModuleOwner(){ return moduleOwner; }; 25 virtual Module* getModuleOwner(){ return moduleOwner; };
25 virtual void setModuleOwner(QString owner="Default"){ moduleOwner = owner; }; 26 virtual void setModuleOwner(Module *owner=NULL){ moduleOwner = owner; };
26 27
27 // inet information. 28 // inet information.
28 QString getMacAddress(){ return macAddress; }; 29 QString getMacAddress(){ return macAddress; };
@@ -45,7 +46,7 @@ private:
45 bool attached; 46 bool attached;
46 QString interfaceName; 47 QString interfaceName;
47 QString hardareName; 48 QString hardareName;
48 QString moduleOwner; 49 Module *moduleOwner;
49 50
50 // Network information 51 // Network information
51 QString macAddress; 52 QString macAddress;
diff --git a/noncore/net/networksetup/interfacesetup.ui b/noncore/net/networksetup/interfacesetup.ui
index ff9810e..d367608 100644
--- a/noncore/net/networksetup/interfacesetup.ui
+++ b/noncore/net/networksetup/interfacesetup.ui
@@ -11,15 +11,15 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>177</width> 14 <width>271</width>
15 <height>320</height> 15 <height>280</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Interface Configuration</string> 20 <string>Interface Configuration</string>
21 </property> 21 </property>
22 <grid> 22 <vbox>
23 <property stdset="1"> 23 <property stdset="1">
24 <name>margin</name> 24 <name>margin</name>
25 <number>11</number> 25 <number>11</number>
@@ -28,18 +28,7 @@
28 <name>spacing</name> 28 <name>spacing</name>
29 <number>6</number> 29 <number>6</number>
30 </property> 30 </property>
31 <widget row="1" column="0" rowspan="1" colspan="2" > 31 <widget>
32 <class>Line</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>Line1</cstring>
36 </property>
37 <property stdset="1">
38 <name>orientation</name>
39 <enum>Horizontal</enum>
40 </property>
41 </widget>
42 <widget row="0" column="0" rowspan="1" colspan="2" >
43 <class>QCheckBox</class> 32 <class>QCheckBox</class>
44 <property stdset="1"> 33 <property stdset="1">
45 <name>name</name> 34 <name>name</name>
@@ -50,101 +39,135 @@
50 <string>Automaticly bring up</string> 39 <string>Automaticly bring up</string>
51 </property> 40 </property>
52 </widget> 41 </widget>
53 <widget row="2" column="1" > 42 <widget>
54 <class>QComboBox</class> 43 <class>QLayoutWidget</class>
55 <item>
56 <property>
57 <name>text</name>
58 <string>All</string>
59 </property>
60 </item>
61 <property stdset="1"> 44 <property stdset="1">
62 <name>name</name> 45 <name>name</name>
63 <cstring>profileCombo</cstring> 46 <cstring>Layout8</cstring>
64 </property>
65 </widget>
66 <widget row="4" column="0" >
67 <class>QLabel</class>
68 <property stdset="1">
69 <name>name</name>
70 <cstring>leaseHoursLabel</cstring>
71 </property>
72 <property stdset="1">
73 <name>text</name>
74 <string>Requested Lease</string>
75 </property>
76 </widget>
77 <widget row="3" column="0" rowspan="1" colspan="2" >
78 <class>QCheckBox</class>
79 <property stdset="1">
80 <name>name</name>
81 <cstring>dhcpCheckBox</cstring>
82 </property>
83 <property stdset="1">
84 <name>text</name>
85 <string>DHCP</string>
86 </property>
87 <property stdset="1">
88 <name>checked</name>
89 <bool>true</bool>
90 </property>
91 </widget>
92 <widget row="2" column="0" >
93 <class>QLabel</class>
94 <property stdset="1">
95 <name>name</name>
96 <cstring>TextLabel1</cstring>
97 </property>
98 <property stdset="1">
99 <name>text</name>
100 <string>Profile:</string>
101 </property> 47 </property>
48 <hbox>
49 <property stdset="1">
50 <name>margin</name>
51 <number>0</number>
52 </property>
53 <property stdset="1">
54 <name>spacing</name>
55 <number>6</number>
56 </property>
57 <widget>
58 <class>QLabel</class>
59 <property stdset="1">
60 <name>name</name>
61 <cstring>TextLabel1</cstring>
62 </property>
63 <property stdset="1">
64 <name>text</name>
65 <string>Profile</string>
66 </property>
67 </widget>
68 <widget>
69 <class>QComboBox</class>
70 <item>
71 <property>
72 <name>text</name>
73 <string>All</string>
74 </property>
75 </item>
76 <property stdset="1">
77 <name>name</name>
78 <cstring>profileCombo</cstring>
79 </property>
80 </widget>
81 <spacer>
82 <property>
83 <name>name</name>
84 <cstring>Spacer20</cstring>
85 </property>
86 <property stdset="1">
87 <name>orientation</name>
88 <enum>Horizontal</enum>
89 </property>
90 <property stdset="1">
91 <name>sizeType</name>
92 <enum>Expanding</enum>
93 </property>
94 <property>
95 <name>sizeHint</name>
96 <size>
97 <width>20</width>
98 <height>20</height>
99 </size>
100 </property>
101 </spacer>
102 </hbox>
102 </widget> 103 </widget>
103 <widget row="4" column="1" > 104 <widget>
104 <class>QSpinBox</class> 105 <class>QLayoutWidget</class>
105 <property stdset="1"> 106 <property stdset="1">
106 <name>name</name> 107 <name>name</name>
107 <cstring>leaseTime</cstring> 108 <cstring>Layout9</cstring>
108 </property>
109 <property stdset="1">
110 <name>suffix</name>
111 <string> hours</string>
112 </property>
113 <property stdset="1">
114 <name>maxValue</name>
115 <number>336</number>
116 </property>
117 <property stdset="1">
118 <name>minValue</name>
119 <number>1</number>
120 </property>
121 <property stdset="1">
122 <name>value</name>
123 <number>24</number>
124 </property> 109 </property>
110 <hbox>
111 <property stdset="1">
112 <name>margin</name>
113 <number>0</number>
114 </property>
115 <property stdset="1">
116 <name>spacing</name>
117 <number>6</number>
118 </property>
119 <widget>
120 <class>QCheckBox</class>
121 <property stdset="1">
122 <name>name</name>
123 <cstring>dhcpCheckBox</cstring>
124 </property>
125 <property stdset="1">
126 <name>text</name>
127 <string>DHCP</string>
128 </property>
129 <property stdset="1">
130 <name>checked</name>
131 <bool>true</bool>
132 </property>
133 </widget>
134 <widget>
135 <class>QLabel</class>
136 <property stdset="1">
137 <name>name</name>
138 <cstring>leaseHoursLabel</cstring>
139 </property>
140 <property stdset="1">
141 <name>text</name>
142 <string>Requested Lease</string>
143 </property>
144 </widget>
145 <widget>
146 <class>QSpinBox</class>
147 <property stdset="1">
148 <name>name</name>
149 <cstring>leaseTime</cstring>
150 </property>
151 <property stdset="1">
152 <name>suffix</name>
153 <string> hours</string>
154 </property>
155 <property stdset="1">
156 <name>maxValue</name>
157 <number>336</number>
158 </property>
159 <property stdset="1">
160 <name>minValue</name>
161 <number>1</number>
162 </property>
163 <property stdset="1">
164 <name>value</name>
165 <number>24</number>
166 </property>
167 </widget>
168 </hbox>
125 </widget> 169 </widget>
126 <spacer row="6" column="1" > 170 <widget>
127 <property>
128 <name>name</name>
129 <cstring>Spacer9</cstring>
130 </property>
131 <property stdset="1">
132 <name>orientation</name>
133 <enum>Vertical</enum>
134 </property>
135 <property stdset="1">
136 <name>sizeType</name>
137 <enum>Expanding</enum>
138 </property>
139 <property>
140 <name>sizeHint</name>
141 <size>
142 <width>20</width>
143 <height>20</height>
144 </size>
145 </property>
146 </spacer>
147 <widget row="5" column="0" rowspan="1" colspan="2" >
148 <class>QGroupBox</class> 171 <class>QGroupBox</class>
149 <property stdset="1"> 172 <property stdset="1">
150 <name>name</name> 173 <name>name</name>
@@ -155,6 +178,14 @@
155 <bool>false</bool> 178 <bool>false</bool>
156 </property> 179 </property>
157 <property stdset="1"> 180 <property stdset="1">
181 <name>frameShape</name>
182 <enum>Box</enum>
183 </property>
184 <property stdset="1">
185 <name>frameShadow</name>
186 <enum>Sunken</enum>
187 </property>
188 <property stdset="1">
158 <name>title</name> 189 <name>title</name>
159 <string>Static Ip Configuration</string> 190 <string>Static Ip Configuration</string>
160 </property> 191 </property>
@@ -259,7 +290,28 @@
259 </widget> 290 </widget>
260 </grid> 291 </grid>
261 </widget> 292 </widget>
262 </grid> 293 <spacer>
294 <property>
295 <name>name</name>
296 <cstring>Spacer9</cstring>
297 </property>
298 <property stdset="1">
299 <name>orientation</name>
300 <enum>Vertical</enum>
301 </property>
302 <property stdset="1">
303 <name>sizeType</name>
304 <enum>Expanding</enum>
305 </property>
306 <property>
307 <name>sizeHint</name>
308 <size>
309 <width>20</width>
310 <height>20</height>
311 </size>
312 </property>
313 </spacer>
314 </vbox>
263</widget> 315</widget>
264<connections> 316<connections>
265 <connection> 317 <connection>
diff --git a/noncore/net/networksetup/mainwindow.ui b/noncore/net/networksetup/mainwindow.ui
index c1fa101..a3f7bb1 100644
--- a/noncore/net/networksetup/mainwindow.ui
+++ b/noncore/net/networksetup/mainwindow.ui
@@ -11,7 +11,7 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>218</width> 14 <width>217</width>
15 <height>289</height> 15 <height>289</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -194,7 +194,18 @@
194 <name>spacing</name> 194 <name>spacing</name>
195 <number>6</number> 195 <number>6</number>
196 </property> 196 </property>
197 <widget row="0" column="0" rowspan="1" colspan="2" > 197 <widget row="1" column="0" rowspan="1" colspan="3" >
198 <class>Line</class>
199 <property stdset="1">
200 <name>name</name>
201 <cstring>Line1</cstring>
202 </property>
203 <property stdset="1">
204 <name>orientation</name>
205 <enum>Horizontal</enum>
206 </property>
207 </widget>
208 <widget row="0" column="0" >
198 <class>QLabel</class> 209 <class>QLabel</class>
199 <property stdset="1"> 210 <property stdset="1">
200 <name>name</name> 211 <name>name</name>
@@ -205,7 +216,7 @@
205 <string>Current Profile</string> 216 <string>Current Profile</string>
206 </property> 217 </property>
207 </widget> 218 </widget>
208 <widget row="0" column="2" > 219 <widget row="0" column="1" >
209 <class>QLabel</class> 220 <class>QLabel</class>
210 <property stdset="1"> 221 <property stdset="1">
211 <name>name</name> 222 <name>name</name>
@@ -224,18 +235,28 @@
224 <string>All</string> 235 <string>All</string>
225 </property> 236 </property>
226 </widget> 237 </widget>
227 <widget row="1" column="0" > 238 <spacer row="0" column="2" >
228 <class>QLabel</class> 239 <property>
229 <property stdset="1">
230 <name>name</name> 240 <name>name</name>
231 <cstring>TextLabel1_2</cstring> 241 <cstring>Spacer2</cstring>
232 </property> 242 </property>
233 <property stdset="1"> 243 <property stdset="1">
234 <name>text</name> 244 <name>orientation</name>
235 <string>Profiles</string> 245 <enum>Horizontal</enum>
246 </property>
247 <property stdset="1">
248 <name>sizeType</name>
249 <enum>Expanding</enum>
236 </property> 250 </property>
237 </widget> 251 <property>
238 <spacer row="5" column="2" > 252 <name>sizeHint</name>
253 <size>
254 <width>20</width>
255 <height>20</height>
256 </size>
257 </property>
258 </spacer>
259 <spacer row="6" column="2" >
239 <property> 260 <property>
240 <name>name</name> 261 <name>name</name>
241 <cstring>Spacer16</cstring> 262 <cstring>Spacer16</cstring>
@@ -256,14 +277,7 @@
256 </size> 277 </size>
257 </property> 278 </property>
258 </spacer> 279 </spacer>
259 <widget row="2" column="0" rowspan="3" colspan="1" > 280 <widget row="5" column="2" >
260 <class>QListBox</class>
261 <property stdset="1">
262 <name>name</name>
263 <cstring>profilesList</cstring>
264 </property>
265 </widget>
266 <widget row="4" column="1" rowspan="1" colspan="2" >
267 <class>QPushButton</class> 281 <class>QPushButton</class>
268 <property stdset="1"> 282 <property stdset="1">
269 <name>name</name> 283 <name>name</name>
@@ -274,7 +288,7 @@
274 <string>&amp;Set Current</string> 288 <string>&amp;Set Current</string>
275 </property> 289 </property>
276 </widget> 290 </widget>
277 <widget row="3" column="1" rowspan="1" colspan="2" > 291 <widget row="4" column="2" >
278 <class>QPushButton</class> 292 <class>QPushButton</class>
279 <property stdset="1"> 293 <property stdset="1">
280 <name>name</name> 294 <name>name</name>
@@ -285,7 +299,7 @@
285 <string>&amp;Remove</string> 299 <string>&amp;Remove</string>
286 </property> 300 </property>
287 </widget> 301 </widget>
288 <widget row="2" column="1" rowspan="1" colspan="2" > 302 <widget row="3" column="2" >
289 <class>QPushButton</class> 303 <class>QPushButton</class>
290 <property stdset="1"> 304 <property stdset="1">
291 <name>name</name> 305 <name>name</name>
@@ -296,6 +310,24 @@
296 <string>&amp;New</string> 310 <string>&amp;New</string>
297 </property> 311 </property>
298 </widget> 312 </widget>
313 <widget row="2" column="0" >
314 <class>QLabel</class>
315 <property stdset="1">
316 <name>name</name>
317 <cstring>TextLabel1_2</cstring>
318 </property>
319 <property stdset="1">
320 <name>text</name>
321 <string>Profiles</string>
322 </property>
323 </widget>
324 <widget row="3" column="0" rowspan="3" colspan="2" >
325 <class>QListBox</class>
326 <property stdset="1">
327 <name>name</name>
328 <cstring>profilesList</cstring>
329 </property>
330 </widget>
299 </grid> 331 </grid>
300 </widget> 332 </widget>
301 </widget> 333 </widget>
diff --git a/noncore/net/networksetup/mainwindowimp.cpp b/noncore/net/networksetup/mainwindowimp.cpp
index 0f48a4b..89dac6f 100644
--- a/noncore/net/networksetup/mainwindowimp.cpp
+++ b/noncore/net/networksetup/mainwindowimp.cpp
@@ -151,7 +151,7 @@ void MainWindowImp::removeClicked(){
151 return; 151 return;
152 } 152 }
153 153
154 if(modules.find(interfaceItems[item]) == modules.end()){ 154 if((interfaceItems[item])->getModuleOwner() == NULL){
155 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok"); 155 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok");
156 } 156 }
157 else{ 157 else{
@@ -171,14 +171,29 @@ void MainWindowImp::configureClicked(){
171 return; 171 return;
172 } 172 }
173 173
174 if(modules.find(interfaceItems[item]) == modules.end()){ 174 if((interfaceItems[item])->getModuleOwner() == NULL){
175 InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]); 175 InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]);
176 conf->showMaximized(); 176 conf->showMaximized();
177 conf->show(); 177 conf->show();
178 } 178 }
179 else{ 179 else{
180 InterfaceSetupImp *conf = new InterfaceSetupImp(this, "InterfaceConfiguration"); 180 QTabWidget *t = NULL;
181 conf->show(); 181 QWidget *conf = (interfaceItems[item])->getModuleOwner()->configure(&t);
182 if(conf != NULL){
183 qDebug("Conf found");
184 if(t != NULL){
185 qDebug("Adding Interface");
186 InterfaceSetupImp *i = new InterfaceSetupImp(t, "TCPIPInformation", interfaceItems[item], true);
187 t->insertTab(i, "TCP/IP");
188 }
189 conf->showMaximized();
190 conf->show();
191 }
192 else{
193 InterfaceSetupImp *i = new InterfaceSetupImp(0, "TCPIPInformation", interfaceItems[item], true);
194 i->showMaximized();
195 i->show();
196 }
182 } 197 }
183} 198}
184 199
@@ -193,16 +208,28 @@ void MainWindowImp::informationClicked(){
193 return; 208 return;
194 } 209 }
195 210
196 if(modules.find(interfaceItems[item]) == modules.end()){ 211 if( (interfaceItems[item])->getModuleOwner() == NULL){
197 InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]); 212 InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]);
198 i->showMaximized(); 213 i->showMaximized();
199 i->show(); 214 i->show();
200 } 215 }
201 else{ 216 else{
202 QTabWidget *t = new QTabWidget(this, "InterfaceInformationTAB"); 217 QTabWidget *t = NULL;
203 InterfaceInformationImp *i = new InterfaceInformationImp(t, "TCPIPInformation", interfaceItems[item], true); 218 QWidget *conf = (interfaceItems[item])->getModuleOwner()->information(&t);
204 t->insertTab(i, "TCP/IP"); 219 if(conf != NULL){
205 t->show(); 220 if(t){
221 qDebug("Adding Interface");
222 InterfaceInformationImp *i = new InterfaceInformationImp(t, "TCPIPInformation", interfaceItems[item], true);
223 t->insertTab(i, "TCP/IP");
224 }
225 conf->showMaximized();
226 conf->show();
227 }
228 else{
229 InterfaceInformationImp *i = new InterfaceInformationImp(0, "TCPIPInformation", interfaceItems[item], true);
230 i->showMaximized();
231 i->show();
232 }
206 } 233 }
207} 234}
208 235
@@ -286,10 +313,12 @@ void MainWindowImp::updateInterface(Interface *i){
286 if(items.find(i) == items.end()){ 313 if(items.find(i) == items.end()){
287 item = new QListViewItem(serviceList, "", "", ""); 314 item = new QListViewItem(serviceList, "", "", "");
288 // See if you can't find a module owner for this interface 315 // See if you can't find a module owner for this interface
289 //EmployeeMap::Iterator it; 316 QMap<Module*, QLibrary*>::Iterator it;
290 //for( it = map.begin(); it != map.end(); ++it ) 317 for( it = libraries.begin(); it != libraries.end(); ++it ){
291 // printf( "%s, %s earns %d\n", it.key().latin1(), it.data().name().latin1(), it.data().salary() ); 318 if(it.key()->isOwner(i))
292 319 i->setModuleOwner(it.key());
320 }
321
293 items.insert(i, item); 322 items.insert(i, item);
294 interfaceItems.insert(item, i); 323 interfaceItems.insert(item, i);
295 } 324 }
@@ -309,6 +338,10 @@ void MainWindowImp::updateInterface(Interface *i){
309 typeName = "irda"; 338 typeName = "irda";
310 if(i->getInterfaceName().contains("wlan")) 339 if(i->getInterfaceName().contains("wlan"))
311 typeName = "wlan"; 340 typeName = "wlan";
341 // Actually try to use the Module
342 if(i->getModuleOwner() != NULL){
343 typeName = i->getModuleOwner()->getPixmapName(i);
344 }
312 QPixmap type = (Resource::loadPixmap(typeName)); 345 QPixmap type = (Resource::loadPixmap(typeName));
313 item->setPixmap(1, type); 346 item->setPixmap(1, type);
314 347
diff --git a/noncore/net/networksetup/mainwindowimp.h b/noncore/net/networksetup/mainwindowimp.h
index 8e300bf..19ebaf2 100644
--- a/noncore/net/networksetup/mainwindowimp.h
+++ b/noncore/net/networksetup/mainwindowimp.h
@@ -42,7 +42,6 @@ private:
42 QMap<QString, Interface*> interfaceNames; 42 QMap<QString, Interface*> interfaceNames;
43 43
44 QMap<Module*, QLibrary*> libraries; 44 QMap<Module*, QLibrary*> libraries;
45 QMap<Interface*, Module*> modules;
46 QMap<Interface*, QListViewItem*> items; 45 QMap<Interface*, QListViewItem*> items;
47 QMap<QListViewItem*, Interface*> interfaceItems; 46 QMap<QListViewItem*, Interface*> interfaceItems;
48 47
diff --git a/noncore/net/networksetup/module.h b/noncore/net/networksetup/module.h
index 13fd523..c1e9488 100644
--- a/noncore/net/networksetup/module.h
+++ b/noncore/net/networksetup/module.h
@@ -7,6 +7,7 @@
7#include "interface.h" 7#include "interface.h"
8 8
9class QWidget; 9class QWidget;
10class QTabWidget;
10 11
11class Module : QObject{ 12class Module : QObject{
12 13
@@ -17,13 +18,13 @@ public:
17 Module(){}; 18 Module(){};
18 19
19 virtual bool isOwner(Interface *){ return false; }; 20 virtual bool isOwner(Interface *){ return false; };
20 virtual QWidget *configure(){ return NULL; } ; 21 virtual QWidget *configure(QTabWidget **tabWidget){ return NULL; } ;
21 virtual QWidget *information(){ return NULL; }; 22 virtual QWidget *information(QTabWidget **tabWidget){ return NULL; };
22 virtual QList<Interface> getInterfaces() = 0; 23 virtual QList<Interface> getInterfaces() = 0;
23 virtual QMap<QString, QString> possibleNewInterfaces() = 0; 24 virtual QMap<QString, QString> possibleNewInterfaces() = 0;
24 virtual Interface *addNewInterface(QString name) = 0; 25 virtual Interface *addNewInterface(QString name) = 0;
25 virtual bool remove(Interface* i) = 0; 26 virtual bool remove(Interface* i) = 0;
26 27 virtual QString getPixmapName(Interface* i) = 0;
27 28
28}; 29};
29 30
diff --git a/noncore/net/networksetup/networksetup.pro b/noncore/net/networksetup/networksetup.pro
index a01b050..0d48790 100644
--- a/noncore/net/networksetup/networksetup.pro
+++ b/noncore/net/networksetup/networksetup.pro
@@ -1,6 +1,6 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on debug 2 #CONFIG = qt warn_on debug
3 #CONFIG = qt warn_on release 3 CONFIG = qt warn_on release
4 HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h 4 HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h
5 SOURCES = main.cpp mainwindowimp.cpp addserviceimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp 5 SOURCES = main.cpp mainwindowimp.cpp addserviceimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp
6 #INCLUDEPATH+= $(QPEDIR)/include 6 #INCLUDEPATH+= $(QPEDIR)/include
diff --git a/noncore/settings/networksettings/interface.cpp b/noncore/settings/networksettings/interface.cpp
index f6eed00..5b21364 100644
--- a/noncore/settings/networksettings/interface.cpp
+++ b/noncore/settings/networksettings/interface.cpp
@@ -10,7 +10,7 @@
10#include <stdio.h> 10#include <stdio.h>
11#include <stdlib.h> 11#include <stdlib.h>
12 12
13Interface::Interface(QString name, bool newSatus): status(newSatus), attached(false), interfaceName(name), hardareName("Unknown"), moduleOwner("Default"), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){ 13Interface::Interface(QString name, bool newSatus): status(newSatus), attached(false), interfaceName(name), hardareName("Unknown"), moduleOwner(NULL), macAddress(""), ip("0.0.0.0"), broadcast(""), subnetMask("0.0.0.0"), dhcp(false){
14 refresh(); 14 refresh();
15} 15}
16 16
diff --git a/noncore/settings/networksettings/interface.h b/noncore/settings/networksettings/interface.h
index 1ad71eb..5dc95a4 100644
--- a/noncore/settings/networksettings/interface.h
+++ b/noncore/settings/networksettings/interface.h
@@ -3,6 +3,7 @@
3 3
4#include <qstring.h> 4#include <qstring.h>
5 5
6class Module;
6class Interface { 7class Interface {
7 8
8public: 9public:
@@ -21,8 +22,8 @@ public:
21 virtual QString getHardwareName(){ return hardareName; }; 22 virtual QString getHardwareName(){ return hardareName; };
22 virtual void setHardwareName(QString name="Unknown"){ hardareName = name; }; 23 virtual void setHardwareName(QString name="Unknown"){ hardareName = name; };
23 24
24 virtual QString getModuleOwner(){ return moduleOwner; }; 25 virtual Module* getModuleOwner(){ return moduleOwner; };
25 virtual void setModuleOwner(QString owner="Default"){ moduleOwner = owner; }; 26 virtual void setModuleOwner(Module *owner=NULL){ moduleOwner = owner; };
26 27
27 // inet information. 28 // inet information.
28 QString getMacAddress(){ return macAddress; }; 29 QString getMacAddress(){ return macAddress; };
@@ -45,7 +46,7 @@ private:
45 bool attached; 46 bool attached;
46 QString interfaceName; 47 QString interfaceName;
47 QString hardareName; 48 QString hardareName;
48 QString moduleOwner; 49 Module *moduleOwner;
49 50
50 // Network information 51 // Network information
51 QString macAddress; 52 QString macAddress;
diff --git a/noncore/settings/networksettings/interfacesetup.ui b/noncore/settings/networksettings/interfacesetup.ui
index ff9810e..d367608 100644
--- a/noncore/settings/networksettings/interfacesetup.ui
+++ b/noncore/settings/networksettings/interfacesetup.ui
@@ -11,15 +11,15 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>177</width> 14 <width>271</width>
15 <height>320</height> 15 <height>280</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
18 <property stdset="1"> 18 <property stdset="1">
19 <name>caption</name> 19 <name>caption</name>
20 <string>Interface Configuration</string> 20 <string>Interface Configuration</string>
21 </property> 21 </property>
22 <grid> 22 <vbox>
23 <property stdset="1"> 23 <property stdset="1">
24 <name>margin</name> 24 <name>margin</name>
25 <number>11</number> 25 <number>11</number>
@@ -28,18 +28,7 @@
28 <name>spacing</name> 28 <name>spacing</name>
29 <number>6</number> 29 <number>6</number>
30 </property> 30 </property>
31 <widget row="1" column="0" rowspan="1" colspan="2" > 31 <widget>
32 <class>Line</class>
33 <property stdset="1">
34 <name>name</name>
35 <cstring>Line1</cstring>
36 </property>
37 <property stdset="1">
38 <name>orientation</name>
39 <enum>Horizontal</enum>
40 </property>
41 </widget>
42 <widget row="0" column="0" rowspan="1" colspan="2" >
43 <class>QCheckBox</class> 32 <class>QCheckBox</class>
44 <property stdset="1"> 33 <property stdset="1">
45 <name>name</name> 34 <name>name</name>
@@ -50,101 +39,135 @@
50 <string>Automaticly bring up</string> 39 <string>Automaticly bring up</string>
51 </property> 40 </property>
52 </widget> 41 </widget>
53 <widget row="2" column="1" > 42 <widget>
54 <class>QComboBox</class> 43 <class>QLayoutWidget</class>
55 <item>
56 <property>
57 <name>text</name>
58 <string>All</string>
59 </property>
60 </item>
61 <property stdset="1"> 44 <property stdset="1">
62 <name>name</name> 45 <name>name</name>
63 <cstring>profileCombo</cstring> 46 <cstring>Layout8</cstring>
64 </property>
65 </widget>
66 <widget row="4" column="0" >
67 <class>QLabel</class>
68 <property stdset="1">
69 <name>name</name>
70 <cstring>leaseHoursLabel</cstring>
71 </property>
72 <property stdset="1">
73 <name>text</name>
74 <string>Requested Lease</string>
75 </property>
76 </widget>
77 <widget row="3" column="0" rowspan="1" colspan="2" >
78 <class>QCheckBox</class>
79 <property stdset="1">
80 <name>name</name>
81 <cstring>dhcpCheckBox</cstring>
82 </property>
83 <property stdset="1">
84 <name>text</name>
85 <string>DHCP</string>
86 </property>
87 <property stdset="1">
88 <name>checked</name>
89 <bool>true</bool>
90 </property>
91 </widget>
92 <widget row="2" column="0" >
93 <class>QLabel</class>
94 <property stdset="1">
95 <name>name</name>
96 <cstring>TextLabel1</cstring>
97 </property>
98 <property stdset="1">
99 <name>text</name>
100 <string>Profile:</string>
101 </property> 47 </property>
48 <hbox>
49 <property stdset="1">
50 <name>margin</name>
51 <number>0</number>
52 </property>
53 <property stdset="1">
54 <name>spacing</name>
55 <number>6</number>
56 </property>
57 <widget>
58 <class>QLabel</class>
59 <property stdset="1">
60 <name>name</name>
61 <cstring>TextLabel1</cstring>
62 </property>
63 <property stdset="1">
64 <name>text</name>
65 <string>Profile</string>
66 </property>
67 </widget>
68 <widget>
69 <class>QComboBox</class>
70 <item>
71 <property>
72 <name>text</name>
73 <string>All</string>
74 </property>
75 </item>
76 <property stdset="1">
77 <name>name</name>
78 <cstring>profileCombo</cstring>
79 </property>
80 </widget>
81 <spacer>
82 <property>
83 <name>name</name>
84 <cstring>Spacer20</cstring>
85 </property>
86 <property stdset="1">
87 <name>orientation</name>
88 <enum>Horizontal</enum>
89 </property>
90 <property stdset="1">
91 <name>sizeType</name>
92 <enum>Expanding</enum>
93 </property>
94 <property>
95 <name>sizeHint</name>
96 <size>
97 <width>20</width>
98 <height>20</height>
99 </size>
100 </property>
101 </spacer>
102 </hbox>
102 </widget> 103 </widget>
103 <widget row="4" column="1" > 104 <widget>
104 <class>QSpinBox</class> 105 <class>QLayoutWidget</class>
105 <property stdset="1"> 106 <property stdset="1">
106 <name>name</name> 107 <name>name</name>
107 <cstring>leaseTime</cstring> 108 <cstring>Layout9</cstring>
108 </property>
109 <property stdset="1">
110 <name>suffix</name>
111 <string> hours</string>
112 </property>
113 <property stdset="1">
114 <name>maxValue</name>
115 <number>336</number>
116 </property>
117 <property stdset="1">
118 <name>minValue</name>
119 <number>1</number>
120 </property>
121 <property stdset="1">
122 <name>value</name>
123 <number>24</number>
124 </property> 109 </property>
110 <hbox>
111 <property stdset="1">
112 <name>margin</name>
113 <number>0</number>
114 </property>
115 <property stdset="1">
116 <name>spacing</name>
117 <number>6</number>
118 </property>
119 <widget>
120 <class>QCheckBox</class>
121 <property stdset="1">
122 <name>name</name>
123 <cstring>dhcpCheckBox</cstring>
124 </property>
125 <property stdset="1">
126 <name>text</name>
127 <string>DHCP</string>
128 </property>
129 <property stdset="1">
130 <name>checked</name>
131 <bool>true</bool>
132 </property>
133 </widget>
134 <widget>
135 <class>QLabel</class>
136 <property stdset="1">
137 <name>name</name>
138 <cstring>leaseHoursLabel</cstring>
139 </property>
140 <property stdset="1">
141 <name>text</name>
142 <string>Requested Lease</string>
143 </property>
144 </widget>
145 <widget>
146 <class>QSpinBox</class>
147 <property stdset="1">
148 <name>name</name>
149 <cstring>leaseTime</cstring>
150 </property>
151 <property stdset="1">
152 <name>suffix</name>
153 <string> hours</string>
154 </property>
155 <property stdset="1">
156 <name>maxValue</name>
157 <number>336</number>
158 </property>
159 <property stdset="1">
160 <name>minValue</name>
161 <number>1</number>
162 </property>
163 <property stdset="1">
164 <name>value</name>
165 <number>24</number>
166 </property>
167 </widget>
168 </hbox>
125 </widget> 169 </widget>
126 <spacer row="6" column="1" > 170 <widget>
127 <property>
128 <name>name</name>
129 <cstring>Spacer9</cstring>
130 </property>
131 <property stdset="1">
132 <name>orientation</name>
133 <enum>Vertical</enum>
134 </property>
135 <property stdset="1">
136 <name>sizeType</name>
137 <enum>Expanding</enum>
138 </property>
139 <property>
140 <name>sizeHint</name>
141 <size>
142 <width>20</width>
143 <height>20</height>
144 </size>
145 </property>
146 </spacer>
147 <widget row="5" column="0" rowspan="1" colspan="2" >
148 <class>QGroupBox</class> 171 <class>QGroupBox</class>
149 <property stdset="1"> 172 <property stdset="1">
150 <name>name</name> 173 <name>name</name>
@@ -155,6 +178,14 @@
155 <bool>false</bool> 178 <bool>false</bool>
156 </property> 179 </property>
157 <property stdset="1"> 180 <property stdset="1">
181 <name>frameShape</name>
182 <enum>Box</enum>
183 </property>
184 <property stdset="1">
185 <name>frameShadow</name>
186 <enum>Sunken</enum>
187 </property>
188 <property stdset="1">
158 <name>title</name> 189 <name>title</name>
159 <string>Static Ip Configuration</string> 190 <string>Static Ip Configuration</string>
160 </property> 191 </property>
@@ -259,7 +290,28 @@
259 </widget> 290 </widget>
260 </grid> 291 </grid>
261 </widget> 292 </widget>
262 </grid> 293 <spacer>
294 <property>
295 <name>name</name>
296 <cstring>Spacer9</cstring>
297 </property>
298 <property stdset="1">
299 <name>orientation</name>
300 <enum>Vertical</enum>
301 </property>
302 <property stdset="1">
303 <name>sizeType</name>
304 <enum>Expanding</enum>
305 </property>
306 <property>
307 <name>sizeHint</name>
308 <size>
309 <width>20</width>
310 <height>20</height>
311 </size>
312 </property>
313 </spacer>
314 </vbox>
263</widget> 315</widget>
264<connections> 316<connections>
265 <connection> 317 <connection>
diff --git a/noncore/settings/networksettings/mainwindow.ui b/noncore/settings/networksettings/mainwindow.ui
index c1fa101..a3f7bb1 100644
--- a/noncore/settings/networksettings/mainwindow.ui
+++ b/noncore/settings/networksettings/mainwindow.ui
@@ -11,7 +11,7 @@
11 <rect> 11 <rect>
12 <x>0</x> 12 <x>0</x>
13 <y>0</y> 13 <y>0</y>
14 <width>218</width> 14 <width>217</width>
15 <height>289</height> 15 <height>289</height>
16 </rect> 16 </rect>
17 </property> 17 </property>
@@ -194,7 +194,18 @@
194 <name>spacing</name> 194 <name>spacing</name>
195 <number>6</number> 195 <number>6</number>
196 </property> 196 </property>
197 <widget row="0" column="0" rowspan="1" colspan="2" > 197 <widget row="1" column="0" rowspan="1" colspan="3" >
198 <class>Line</class>
199 <property stdset="1">
200 <name>name</name>
201 <cstring>Line1</cstring>
202 </property>
203 <property stdset="1">
204 <name>orientation</name>
205 <enum>Horizontal</enum>
206 </property>
207 </widget>
208 <widget row="0" column="0" >
198 <class>QLabel</class> 209 <class>QLabel</class>
199 <property stdset="1"> 210 <property stdset="1">
200 <name>name</name> 211 <name>name</name>
@@ -205,7 +216,7 @@
205 <string>Current Profile</string> 216 <string>Current Profile</string>
206 </property> 217 </property>
207 </widget> 218 </widget>
208 <widget row="0" column="2" > 219 <widget row="0" column="1" >
209 <class>QLabel</class> 220 <class>QLabel</class>
210 <property stdset="1"> 221 <property stdset="1">
211 <name>name</name> 222 <name>name</name>
@@ -224,18 +235,28 @@
224 <string>All</string> 235 <string>All</string>
225 </property> 236 </property>
226 </widget> 237 </widget>
227 <widget row="1" column="0" > 238 <spacer row="0" column="2" >
228 <class>QLabel</class> 239 <property>
229 <property stdset="1">
230 <name>name</name> 240 <name>name</name>
231 <cstring>TextLabel1_2</cstring> 241 <cstring>Spacer2</cstring>
232 </property> 242 </property>
233 <property stdset="1"> 243 <property stdset="1">
234 <name>text</name> 244 <name>orientation</name>
235 <string>Profiles</string> 245 <enum>Horizontal</enum>
246 </property>
247 <property stdset="1">
248 <name>sizeType</name>
249 <enum>Expanding</enum>
236 </property> 250 </property>
237 </widget> 251 <property>
238 <spacer row="5" column="2" > 252 <name>sizeHint</name>
253 <size>
254 <width>20</width>
255 <height>20</height>
256 </size>
257 </property>
258 </spacer>
259 <spacer row="6" column="2" >
239 <property> 260 <property>
240 <name>name</name> 261 <name>name</name>
241 <cstring>Spacer16</cstring> 262 <cstring>Spacer16</cstring>
@@ -256,14 +277,7 @@
256 </size> 277 </size>
257 </property> 278 </property>
258 </spacer> 279 </spacer>
259 <widget row="2" column="0" rowspan="3" colspan="1" > 280 <widget row="5" column="2" >
260 <class>QListBox</class>
261 <property stdset="1">
262 <name>name</name>
263 <cstring>profilesList</cstring>
264 </property>
265 </widget>
266 <widget row="4" column="1" rowspan="1" colspan="2" >
267 <class>QPushButton</class> 281 <class>QPushButton</class>
268 <property stdset="1"> 282 <property stdset="1">
269 <name>name</name> 283 <name>name</name>
@@ -274,7 +288,7 @@
274 <string>&amp;Set Current</string> 288 <string>&amp;Set Current</string>
275 </property> 289 </property>
276 </widget> 290 </widget>
277 <widget row="3" column="1" rowspan="1" colspan="2" > 291 <widget row="4" column="2" >
278 <class>QPushButton</class> 292 <class>QPushButton</class>
279 <property stdset="1"> 293 <property stdset="1">
280 <name>name</name> 294 <name>name</name>
@@ -285,7 +299,7 @@
285 <string>&amp;Remove</string> 299 <string>&amp;Remove</string>
286 </property> 300 </property>
287 </widget> 301 </widget>
288 <widget row="2" column="1" rowspan="1" colspan="2" > 302 <widget row="3" column="2" >
289 <class>QPushButton</class> 303 <class>QPushButton</class>
290 <property stdset="1"> 304 <property stdset="1">
291 <name>name</name> 305 <name>name</name>
@@ -296,6 +310,24 @@
296 <string>&amp;New</string> 310 <string>&amp;New</string>
297 </property> 311 </property>
298 </widget> 312 </widget>
313 <widget row="2" column="0" >
314 <class>QLabel</class>
315 <property stdset="1">
316 <name>name</name>
317 <cstring>TextLabel1_2</cstring>
318 </property>
319 <property stdset="1">
320 <name>text</name>
321 <string>Profiles</string>
322 </property>
323 </widget>
324 <widget row="3" column="0" rowspan="3" colspan="2" >
325 <class>QListBox</class>
326 <property stdset="1">
327 <name>name</name>
328 <cstring>profilesList</cstring>
329 </property>
330 </widget>
299 </grid> 331 </grid>
300 </widget> 332 </widget>
301 </widget> 333 </widget>
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp
index 0f48a4b..89dac6f 100644
--- a/noncore/settings/networksettings/mainwindowimp.cpp
+++ b/noncore/settings/networksettings/mainwindowimp.cpp
@@ -151,7 +151,7 @@ void MainWindowImp::removeClicked(){
151 return; 151 return;
152 } 152 }
153 153
154 if(modules.find(interfaceItems[item]) == modules.end()){ 154 if((interfaceItems[item])->getModuleOwner() == NULL){
155 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok"); 155 QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", "Ok");
156 } 156 }
157 else{ 157 else{
@@ -171,14 +171,29 @@ void MainWindowImp::configureClicked(){
171 return; 171 return;
172 } 172 }
173 173
174 if(modules.find(interfaceItems[item]) == modules.end()){ 174 if((interfaceItems[item])->getModuleOwner() == NULL){
175 InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]); 175 InterfaceSetupImp *conf = new InterfaceSetupImp(0, "InterfaceConfiguration", interfaceItems[item]);
176 conf->showMaximized(); 176 conf->showMaximized();
177 conf->show(); 177 conf->show();
178 } 178 }
179 else{ 179 else{
180 InterfaceSetupImp *conf = new InterfaceSetupImp(this, "InterfaceConfiguration"); 180 QTabWidget *t = NULL;
181 conf->show(); 181 QWidget *conf = (interfaceItems[item])->getModuleOwner()->configure(&t);
182 if(conf != NULL){
183 qDebug("Conf found");
184 if(t != NULL){
185 qDebug("Adding Interface");
186 InterfaceSetupImp *i = new InterfaceSetupImp(t, "TCPIPInformation", interfaceItems[item], true);
187 t->insertTab(i, "TCP/IP");
188 }
189 conf->showMaximized();
190 conf->show();
191 }
192 else{
193 InterfaceSetupImp *i = new InterfaceSetupImp(0, "TCPIPInformation", interfaceItems[item], true);
194 i->showMaximized();
195 i->show();
196 }
182 } 197 }
183} 198}
184 199
@@ -193,16 +208,28 @@ void MainWindowImp::informationClicked(){
193 return; 208 return;
194 } 209 }
195 210
196 if(modules.find(interfaceItems[item]) == modules.end()){ 211 if( (interfaceItems[item])->getModuleOwner() == NULL){
197 InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]); 212 InterfaceInformationImp *i = new InterfaceInformationImp(0, "InterfaceInformationImp", interfaceItems[item]);
198 i->showMaximized(); 213 i->showMaximized();
199 i->show(); 214 i->show();
200 } 215 }
201 else{ 216 else{
202 QTabWidget *t = new QTabWidget(this, "InterfaceInformationTAB"); 217 QTabWidget *t = NULL;
203 InterfaceInformationImp *i = new InterfaceInformationImp(t, "TCPIPInformation", interfaceItems[item], true); 218 QWidget *conf = (interfaceItems[item])->getModuleOwner()->information(&t);
204 t->insertTab(i, "TCP/IP"); 219 if(conf != NULL){
205 t->show(); 220 if(t){
221 qDebug("Adding Interface");
222 InterfaceInformationImp *i = new InterfaceInformationImp(t, "TCPIPInformation", interfaceItems[item], true);
223 t->insertTab(i, "TCP/IP");
224 }
225 conf->showMaximized();
226 conf->show();
227 }
228 else{
229 InterfaceInformationImp *i = new InterfaceInformationImp(0, "TCPIPInformation", interfaceItems[item], true);
230 i->showMaximized();
231 i->show();
232 }
206 } 233 }
207} 234}
208 235
@@ -286,10 +313,12 @@ void MainWindowImp::updateInterface(Interface *i){
286 if(items.find(i) == items.end()){ 313 if(items.find(i) == items.end()){
287 item = new QListViewItem(serviceList, "", "", ""); 314 item = new QListViewItem(serviceList, "", "", "");
288 // See if you can't find a module owner for this interface 315 // See if you can't find a module owner for this interface
289 //EmployeeMap::Iterator it; 316 QMap<Module*, QLibrary*>::Iterator it;
290 //for( it = map.begin(); it != map.end(); ++it ) 317 for( it = libraries.begin(); it != libraries.end(); ++it ){
291 // printf( "%s, %s earns %d\n", it.key().latin1(), it.data().name().latin1(), it.data().salary() ); 318 if(it.key()->isOwner(i))
292 319 i->setModuleOwner(it.key());
320 }
321
293 items.insert(i, item); 322 items.insert(i, item);
294 interfaceItems.insert(item, i); 323 interfaceItems.insert(item, i);
295 } 324 }
@@ -309,6 +338,10 @@ void MainWindowImp::updateInterface(Interface *i){
309 typeName = "irda"; 338 typeName = "irda";
310 if(i->getInterfaceName().contains("wlan")) 339 if(i->getInterfaceName().contains("wlan"))
311 typeName = "wlan"; 340 typeName = "wlan";
341 // Actually try to use the Module
342 if(i->getModuleOwner() != NULL){
343 typeName = i->getModuleOwner()->getPixmapName(i);
344 }
312 QPixmap type = (Resource::loadPixmap(typeName)); 345 QPixmap type = (Resource::loadPixmap(typeName));
313 item->setPixmap(1, type); 346 item->setPixmap(1, type);
314 347
diff --git a/noncore/settings/networksettings/mainwindowimp.h b/noncore/settings/networksettings/mainwindowimp.h
index 8e300bf..19ebaf2 100644
--- a/noncore/settings/networksettings/mainwindowimp.h
+++ b/noncore/settings/networksettings/mainwindowimp.h
@@ -42,7 +42,6 @@ private:
42 QMap<QString, Interface*> interfaceNames; 42 QMap<QString, Interface*> interfaceNames;
43 43
44 QMap<Module*, QLibrary*> libraries; 44 QMap<Module*, QLibrary*> libraries;
45 QMap<Interface*, Module*> modules;
46 QMap<Interface*, QListViewItem*> items; 45 QMap<Interface*, QListViewItem*> items;
47 QMap<QListViewItem*, Interface*> interfaceItems; 46 QMap<QListViewItem*, Interface*> interfaceItems;
48 47
diff --git a/noncore/settings/networksettings/module.h b/noncore/settings/networksettings/module.h
index 13fd523..c1e9488 100644
--- a/noncore/settings/networksettings/module.h
+++ b/noncore/settings/networksettings/module.h
@@ -7,6 +7,7 @@
7#include "interface.h" 7#include "interface.h"
8 8
9class QWidget; 9class QWidget;
10class QTabWidget;
10 11
11class Module : QObject{ 12class Module : QObject{
12 13
@@ -17,13 +18,13 @@ public:
17 Module(){}; 18 Module(){};
18 19
19 virtual bool isOwner(Interface *){ return false; }; 20 virtual bool isOwner(Interface *){ return false; };
20 virtual QWidget *configure(){ return NULL; } ; 21 virtual QWidget *configure(QTabWidget **tabWidget){ return NULL; } ;
21 virtual QWidget *information(){ return NULL; }; 22 virtual QWidget *information(QTabWidget **tabWidget){ return NULL; };
22 virtual QList<Interface> getInterfaces() = 0; 23 virtual QList<Interface> getInterfaces() = 0;
23 virtual QMap<QString, QString> possibleNewInterfaces() = 0; 24 virtual QMap<QString, QString> possibleNewInterfaces() = 0;
24 virtual Interface *addNewInterface(QString name) = 0; 25 virtual Interface *addNewInterface(QString name) = 0;
25 virtual bool remove(Interface* i) = 0; 26 virtual bool remove(Interface* i) = 0;
26 27 virtual QString getPixmapName(Interface* i) = 0;
27 28
28}; 29};
29 30
diff --git a/noncore/settings/networksettings/networksetup.pro b/noncore/settings/networksettings/networksetup.pro
index a01b050..0d48790 100644
--- a/noncore/settings/networksettings/networksetup.pro
+++ b/noncore/settings/networksettings/networksetup.pro
@@ -1,6 +1,6 @@
1 TEMPLATE= app 1 TEMPLATE= app
2 CONFIG = qt warn_on debug 2 #CONFIG = qt warn_on debug
3 #CONFIG = qt warn_on release 3 CONFIG = qt warn_on release
4 HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h 4 HEADERS = mainwindowimp.h addserviceimp.h interface.h interfaceinformationimp.h interfacesetupimp.h interfaces.h defaultmodule.h kprocctrl.h module.h kprocess.h
5 SOURCES = main.cpp mainwindowimp.cpp addserviceimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp 5 SOURCES = main.cpp mainwindowimp.cpp addserviceimp.cpp interface.cpp interfaceinformationimp.cpp interfacesetupimp.cpp kprocctrl.cpp kprocess.cpp interfaces.cpp
6 #INCLUDEPATH+= $(QPEDIR)/include 6 #INCLUDEPATH+= $(QPEDIR)/include