author | benmeyer <benmeyer> | 2002-10-01 21:21:48 (UTC) |
---|---|---|
committer | benmeyer <benmeyer> | 2002-10-01 21:21:48 (UTC) |
commit | 1ed782f91c1af59e31c117809ca5d9150b8b6654 (patch) (unidiff) | |
tree | d29c3f84dee9a01649d246a625a71d38274dbaae | |
parent | 2987dafbdfa6602c5e165fe862546ea32f5fd3ca (diff) | |
download | opie-1ed782f91c1af59e31c117809ca5d9150b8b6654.zip opie-1ed782f91c1af59e31c117809ca5d9150b8b6654.tar.gz opie-1ed782f91c1af59e31c117809ca5d9150b8b6654.tar.bz2 |
Getting modules to work
-rw-r--r-- | noncore/net/networksetup/interface.cpp | 2 | ||||
-rw-r--r-- | noncore/net/networksetup/interface.h | 7 | ||||
-rw-r--r-- | noncore/net/networksetup/interfacesetup.ui | 258 | ||||
-rw-r--r-- | noncore/net/networksetup/mainwindow.ui | 74 | ||||
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.cpp | 59 | ||||
-rw-r--r-- | noncore/net/networksetup/mainwindowimp.h | 1 | ||||
-rw-r--r-- | noncore/net/networksetup/module.h | 7 | ||||
-rw-r--r-- | noncore/net/networksetup/networksetup.pro | 4 | ||||
-rw-r--r-- | noncore/settings/networksettings/interface.cpp | 2 | ||||
-rw-r--r-- | noncore/settings/networksettings/interface.h | 7 | ||||
-rw-r--r-- | noncore/settings/networksettings/interfacesetup.ui | 258 | ||||
-rw-r--r-- | noncore/settings/networksettings/mainwindow.ui | 74 | ||||
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 59 | ||||
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.h | 1 | ||||
-rw-r--r-- | noncore/settings/networksettings/module.h | 7 | ||||
-rw-r--r-- | noncore/settings/networksettings/networksetup.pro | 4 |
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 | |||
@@ -11,5 +11,5 @@ | |||
11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
12 | 12 | ||
13 | Interface::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){ | 13 | Interface::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 | } |
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 | |||
@@ -4,4 +4,5 @@ | |||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | 5 | ||
6 | class Module; | ||
6 | class Interface { | 7 | class Interface { |
7 | 8 | ||
@@ -22,6 +23,6 @@ public: | |||
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. |
@@ -46,5 +47,5 @@ private: | |||
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 |
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 | |||
@@ -12,6 +12,6 @@ | |||
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> |
@@ -20,5 +20,5 @@ | |||
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> |
@@ -29,16 +29,5 @@ | |||
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"> |
@@ -51,99 +40,133 @@ | |||
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"> |
@@ -156,4 +179,12 @@ | |||
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> |
@@ -260,5 +291,26 @@ | |||
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> |
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 | |||
@@ -12,5 +12,5 @@ | |||
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> |
@@ -195,5 +195,16 @@ | |||
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"> |
@@ -206,5 +217,5 @@ | |||
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"> |
@@ -225,16 +236,26 @@ | |||
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> |
@@ -257,12 +278,5 @@ | |||
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"> |
@@ -275,5 +289,5 @@ | |||
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"> |
@@ -286,5 +300,5 @@ | |||
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"> |
@@ -297,4 +311,22 @@ | |||
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> |
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 | |||
@@ -152,5 +152,5 @@ void MainWindowImp::removeClicked(){ | |||
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 | } |
@@ -172,5 +172,5 @@ void MainWindowImp::configureClicked(){ | |||
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(); |
@@ -178,6 +178,21 @@ void MainWindowImp::configureClicked(){ | |||
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 | } |
@@ -194,5 +209,5 @@ void MainWindowImp::informationClicked(){ | |||
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(); |
@@ -200,8 +215,20 @@ void MainWindowImp::informationClicked(){ | |||
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 | } |
@@ -287,8 +314,10 @@ void MainWindowImp::updateInterface(Interface *i){ | |||
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); |
@@ -310,4 +339,8 @@ void MainWindowImp::updateInterface(Interface *i){ | |||
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); |
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 | |||
@@ -43,5 +43,4 @@ private: | |||
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; |
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 | |||
@@ -8,4 +8,5 @@ | |||
8 | 8 | ||
9 | class QWidget; | 9 | class QWidget; |
10 | class QTabWidget; | ||
10 | 11 | ||
11 | class Module : QObject{ | 12 | class Module : QObject{ |
@@ -18,11 +19,11 @@ public: | |||
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 | }; |
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,5 +1,5 @@ | |||
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 |
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 | |||
@@ -11,5 +11,5 @@ | |||
11 | #include <stdlib.h> | 11 | #include <stdlib.h> |
12 | 12 | ||
13 | Interface::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){ | 13 | Interface::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 | } |
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 | |||
@@ -4,4 +4,5 @@ | |||
4 | #include <qstring.h> | 4 | #include <qstring.h> |
5 | 5 | ||
6 | class Module; | ||
6 | class Interface { | 7 | class Interface { |
7 | 8 | ||
@@ -22,6 +23,6 @@ public: | |||
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. |
@@ -46,5 +47,5 @@ private: | |||
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 |
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 | |||
@@ -12,6 +12,6 @@ | |||
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> |
@@ -20,5 +20,5 @@ | |||
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> |
@@ -29,16 +29,5 @@ | |||
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"> |
@@ -51,99 +40,133 @@ | |||
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"> |
@@ -156,4 +179,12 @@ | |||
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> |
@@ -260,5 +291,26 @@ | |||
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> |
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 | |||
@@ -12,5 +12,5 @@ | |||
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> |
@@ -195,5 +195,16 @@ | |||
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"> |
@@ -206,5 +217,5 @@ | |||
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"> |
@@ -225,16 +236,26 @@ | |||
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> |
@@ -257,12 +278,5 @@ | |||
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"> |
@@ -275,5 +289,5 @@ | |||
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"> |
@@ -286,5 +300,5 @@ | |||
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"> |
@@ -297,4 +311,22 @@ | |||
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> |
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 | |||
@@ -152,5 +152,5 @@ void MainWindowImp::removeClicked(){ | |||
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 | } |
@@ -172,5 +172,5 @@ void MainWindowImp::configureClicked(){ | |||
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(); |
@@ -178,6 +178,21 @@ void MainWindowImp::configureClicked(){ | |||
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 | } |
@@ -194,5 +209,5 @@ void MainWindowImp::informationClicked(){ | |||
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(); |
@@ -200,8 +215,20 @@ void MainWindowImp::informationClicked(){ | |||
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 | } |
@@ -287,8 +314,10 @@ void MainWindowImp::updateInterface(Interface *i){ | |||
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); |
@@ -310,4 +339,8 @@ void MainWindowImp::updateInterface(Interface *i){ | |||
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); |
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 | |||
@@ -43,5 +43,4 @@ private: | |||
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; |
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 | |||
@@ -8,4 +8,5 @@ | |||
8 | 8 | ||
9 | class QWidget; | 9 | class QWidget; |
10 | class QTabWidget; | ||
10 | 11 | ||
11 | class Module : QObject{ | 12 | class Module : QObject{ |
@@ -18,11 +19,11 @@ public: | |||
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 | }; |
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,5 +1,5 @@ | |||
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 |