3 files changed, 174 insertions, 2 deletions
diff --git a/noncore/settings/networksettings/mainwindow/mainwindow.ui b/noncore/settings/networksettings/mainwindow/mainwindow.ui index a730dd5..185b345 100644 --- a/noncore/settings/networksettings/mainwindow/mainwindow.ui +++ b/noncore/settings/networksettings/mainwindow/mainwindow.ui | |||
@@ -1,235 +1,238 @@ | |||
1 | <!DOCTYPE UI><UI> | 1 | <!DOCTYPE UI><UI> |
2 | <class>MainWindow</class> | 2 | <class>MainWindow</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QWidget</class> | 4 | <class>QWidget</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>MainWindow</cstring> | 7 | <cstring>MainWindow</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>240</width> | 14 | <width>340</width> |
15 | <height>289</height> | 15 | <height>289</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>Network Settings</string> | 20 | <string>Network Settings</string> |
21 | </property> | 21 | </property> |
22 | <vbox> | 22 | <vbox> |
23 | <property stdset="1"> | 23 | <property stdset="1"> |
24 | <name>margin</name> | 24 | <name>margin</name> |
25 | <number>0</number> | 25 | <number>0</number> |
26 | </property> | 26 | </property> |
27 | <property stdset="1"> | 27 | <property stdset="1"> |
28 | <name>spacing</name> | 28 | <name>spacing</name> |
29 | <number>6</number> | 29 | <number>6</number> |
30 | </property> | 30 | </property> |
31 | <widget> | 31 | <widget> |
32 | <class>QTabWidget</class> | 32 | <class>QTabWidget</class> |
33 | <property stdset="1"> | 33 | <property stdset="1"> |
34 | <name>name</name> | 34 | <name>name</name> |
35 | <cstring>tabWidget</cstring> | 35 | <cstring>tabWidget</cstring> |
36 | </property> | 36 | </property> |
37 | <property stdset="1"> | 37 | <property stdset="1"> |
38 | <name>enabled</name> | 38 | <name>enabled</name> |
39 | <bool>true</bool> | 39 | <bool>true</bool> |
40 | </property> | 40 | </property> |
41 | <property> | 41 | <property> |
42 | <name>layoutMargin</name> | 42 | <name>layoutMargin</name> |
43 | </property> | 43 | </property> |
44 | <property> | ||
45 | <name>layoutSpacing</name> | ||
46 | </property> | ||
44 | <widget> | 47 | <widget> |
45 | <class>QWidget</class> | 48 | <class>QWidget</class> |
46 | <property stdset="1"> | 49 | <property stdset="1"> |
47 | <name>name</name> | 50 | <name>name</name> |
48 | <cstring>Widget3</cstring> | 51 | <cstring>Widget3</cstring> |
49 | </property> | 52 | </property> |
50 | <attribute> | 53 | <attribute> |
51 | <name>title</name> | 54 | <name>title</name> |
52 | <string>Connections</string> | 55 | <string>Connections</string> |
53 | </attribute> | 56 | </attribute> |
54 | <vbox> | 57 | <vbox> |
55 | <property stdset="1"> | 58 | <property stdset="1"> |
56 | <name>margin</name> | 59 | <name>margin</name> |
57 | <number>0</number> | 60 | <number>0</number> |
58 | </property> | 61 | </property> |
59 | <property stdset="1"> | 62 | <property stdset="1"> |
60 | <name>spacing</name> | 63 | <name>spacing</name> |
61 | <number>6</number> | 64 | <number>6</number> |
62 | </property> | 65 | </property> |
63 | <widget> | 66 | <widget> |
64 | <class>QListView</class> | 67 | <class>QListView</class> |
65 | <column> | 68 | <column> |
66 | <property> | 69 | <property> |
67 | <name>text</name> | 70 | <name>text</name> |
68 | <string>s</string> | 71 | <string>s</string> |
69 | </property> | 72 | </property> |
70 | <property> | 73 | <property> |
71 | <name>clickable</name> | 74 | <name>clickable</name> |
72 | <bool>true</bool> | 75 | <bool>true</bool> |
73 | </property> | 76 | </property> |
74 | <property> | 77 | <property> |
75 | <name>resizeable</name> | 78 | <name>resizeable</name> |
76 | <bool>true</bool> | 79 | <bool>true</bool> |
77 | </property> | 80 | </property> |
78 | </column> | 81 | </column> |
79 | <column> | 82 | <column> |
80 | <property> | 83 | <property> |
81 | <name>text</name> | 84 | <name>text</name> |
82 | <string>t</string> | 85 | <string>t</string> |
83 | </property> | 86 | </property> |
84 | <property> | 87 | <property> |
85 | <name>clickable</name> | 88 | <name>clickable</name> |
86 | <bool>true</bool> | 89 | <bool>true</bool> |
87 | </property> | 90 | </property> |
88 | <property> | 91 | <property> |
89 | <name>resizeable</name> | 92 | <name>resizeable</name> |
90 | <bool>true</bool> | 93 | <bool>true</bool> |
91 | </property> | 94 | </property> |
92 | </column> | 95 | </column> |
93 | <column> | 96 | <column> |
94 | <property> | 97 | <property> |
95 | <name>text</name> | 98 | <name>text</name> |
96 | <string>Name</string> | 99 | <string>Name</string> |
97 | </property> | 100 | </property> |
98 | <property> | 101 | <property> |
99 | <name>clickable</name> | 102 | <name>clickable</name> |
100 | <bool>true</bool> | 103 | <bool>true</bool> |
101 | </property> | 104 | </property> |
102 | <property> | 105 | <property> |
103 | <name>resizeable</name> | 106 | <name>resizeable</name> |
104 | <bool>true</bool> | 107 | <bool>true</bool> |
105 | </property> | 108 | </property> |
106 | </column> | 109 | </column> |
107 | <column> | 110 | <column> |
108 | <property> | 111 | <property> |
109 | <name>text</name> | 112 | <name>text</name> |
110 | <string>in</string> | 113 | <string>in</string> |
111 | </property> | 114 | </property> |
112 | <property> | 115 | <property> |
113 | <name>clickable</name> | 116 | <name>clickable</name> |
114 | <bool>true</bool> | 117 | <bool>true</bool> |
115 | </property> | 118 | </property> |
116 | <property> | 119 | <property> |
117 | <name>resizeable</name> | 120 | <name>resizeable</name> |
118 | <bool>true</bool> | 121 | <bool>true</bool> |
119 | </property> | 122 | </property> |
120 | </column> | 123 | </column> |
121 | <column> | 124 | <column> |
122 | <property> | 125 | <property> |
123 | <name>text</name> | 126 | <name>text</name> |
124 | <string>IP</string> | 127 | <string>IP</string> |
125 | </property> | 128 | </property> |
126 | <property> | 129 | <property> |
127 | <name>clickable</name> | 130 | <name>clickable</name> |
128 | <bool>true</bool> | 131 | <bool>true</bool> |
129 | </property> | 132 | </property> |
130 | <property> | 133 | <property> |
131 | <name>resizeable</name> | 134 | <name>resizeable</name> |
132 | <bool>true</bool> | 135 | <bool>true</bool> |
133 | </property> | 136 | </property> |
134 | </column> | 137 | </column> |
135 | <property stdset="1"> | 138 | <property stdset="1"> |
136 | <name>name</name> | 139 | <name>name</name> |
137 | <cstring>connectionList</cstring> | 140 | <cstring>connectionList</cstring> |
138 | </property> | 141 | </property> |
139 | <property stdset="1"> | 142 | <property stdset="1"> |
140 | <name>allColumnsShowFocus</name> | 143 | <name>allColumnsShowFocus</name> |
141 | <bool>true</bool> | 144 | <bool>true</bool> |
142 | </property> | 145 | </property> |
143 | <property> | 146 | <property> |
144 | <name>whatsThis</name> | 147 | <name>whatsThis</name> |
145 | <string>A list of network settings to be choosen from</string> | 148 | <string>A list of network settings to be choosen from</string> |
146 | </property> | 149 | </property> |
147 | </widget> | 150 | </widget> |
148 | <widget> | 151 | <widget> |
149 | <class>QLayoutWidget</class> | 152 | <class>QLayoutWidget</class> |
150 | <property stdset="1"> | 153 | <property stdset="1"> |
151 | <name>name</name> | 154 | <name>name</name> |
152 | <cstring>Layout2</cstring> | 155 | <cstring>Layout2</cstring> |
153 | </property> | 156 | </property> |
154 | <property> | 157 | <property> |
155 | <name>layoutMargin</name> | 158 | <name>layoutMargin</name> |
156 | </property> | 159 | </property> |
157 | <grid> | 160 | <grid> |
158 | <property stdset="1"> | 161 | <property stdset="1"> |
159 | <name>margin</name> | 162 | <name>margin</name> |
160 | <number>5</number> | 163 | <number>5</number> |
161 | </property> | 164 | </property> |
162 | <property stdset="1"> | 165 | <property stdset="1"> |
163 | <name>spacing</name> | 166 | <name>spacing</name> |
164 | <number>6</number> | 167 | <number>6</number> |
165 | </property> | 168 | </property> |
166 | <widget row="1" column="0" > | 169 | <widget row="1" column="0" > |
167 | <class>QPushButton</class> | 170 | <class>QPushButton</class> |
168 | <property stdset="1"> | 171 | <property stdset="1"> |
169 | <name>name</name> | 172 | <name>name</name> |
170 | <cstring>addConnectionButton</cstring> | 173 | <cstring>addConnectionButton</cstring> |
171 | </property> | 174 | </property> |
172 | <property stdset="1"> | 175 | <property stdset="1"> |
173 | <name>text</name> | 176 | <name>text</name> |
174 | <string>&Add</string> | 177 | <string>&Add</string> |
175 | </property> | 178 | </property> |
176 | <property> | 179 | <property> |
177 | <name>whatsThis</name> | 180 | <name>whatsThis</name> |
178 | <string>Add a new interface to the list.</string> | 181 | <string>Add a new interface to the list.</string> |
179 | </property> | 182 | </property> |
180 | </widget> | 183 | </widget> |
181 | <widget row="0" column="0" > | 184 | <widget row="0" column="0" > |
182 | <class>QPushButton</class> | 185 | <class>QPushButton</class> |
183 | <property stdset="1"> | 186 | <property stdset="1"> |
184 | <name>name</name> | 187 | <name>name</name> |
185 | <cstring>informationConnectionButton</cstring> | 188 | <cstring>informationConnectionButton</cstring> |
186 | </property> | 189 | </property> |
187 | <property stdset="1"> | 190 | <property stdset="1"> |
188 | <name>text</name> | 191 | <name>text</name> |
189 | <string>&Start/Stop</string> | 192 | <string>&Start/Stop</string> |
190 | </property> | 193 | </property> |
191 | <property> | 194 | <property> |
192 | <name>whatsThis</name> | 195 | <name>whatsThis</name> |
193 | <string>Start and Stop the current interface, gives additional information about the interface.</string> | 196 | <string>Start and Stop the current interface, gives additional information about the interface.</string> |
194 | </property> | 197 | </property> |
195 | </widget> | 198 | </widget> |
196 | <widget row="0" column="1" > | 199 | <widget row="0" column="1" > |
197 | <class>QPushButton</class> | 200 | <class>QPushButton</class> |
198 | <property stdset="1"> | 201 | <property stdset="1"> |
199 | <name>name</name> | 202 | <name>name</name> |
200 | <cstring>configureConnectionButton</cstring> | 203 | <cstring>configureConnectionButton</cstring> |
201 | </property> | 204 | </property> |
202 | <property stdset="1"> | 205 | <property stdset="1"> |
203 | <name>text</name> | 206 | <name>text</name> |
204 | <string>&Configure</string> | 207 | <string>&Configure</string> |
205 | </property> | 208 | </property> |
206 | <property> | 209 | <property> |
207 | <name>whatsThis</name> | 210 | <name>whatsThis</name> |
208 | <string>Configure the current interface</string> | 211 | <string>Configure the current interface</string> |
209 | </property> | 212 | </property> |
210 | </widget> | 213 | </widget> |
211 | <widget row="1" column="1" > | 214 | <widget row="1" column="1" > |
212 | <class>QPushButton</class> | 215 | <class>QPushButton</class> |
213 | <property stdset="1"> | 216 | <property stdset="1"> |
214 | <name>name</name> | 217 | <name>name</name> |
215 | <cstring>removeConnectionButton</cstring> | 218 | <cstring>removeConnectionButton</cstring> |
216 | </property> | 219 | </property> |
217 | <property stdset="1"> | 220 | <property stdset="1"> |
218 | <name>text</name> | 221 | <name>text</name> |
219 | <string>&Remove</string> | 222 | <string>&Remove</string> |
220 | </property> | 223 | </property> |
221 | <property> | 224 | <property> |
222 | <name>whatsThis</name> | 225 | <name>whatsThis</name> |
223 | <string>Remove the current interface from the list.</string> | 226 | <string>Remove the current interface from the list.</string> |
224 | </property> | 227 | </property> |
225 | </widget> | 228 | </widget> |
226 | </grid> | 229 | </grid> |
227 | </widget> | 230 | </widget> |
228 | </vbox> | 231 | </vbox> |
229 | </widget> | 232 | </widget> |
230 | <widget> | 233 | <widget> |
231 | <class>QWidget</class> | 234 | <class>QWidget</class> |
232 | <property stdset="1"> | 235 | <property stdset="1"> |
233 | <name>name</name> | 236 | <name>name</name> |
234 | <cstring>tab</cstring> | 237 | <cstring>tab</cstring> |
235 | </property> | 238 | </property> |
@@ -243,209 +246,308 @@ | |||
243 | <number>11</number> | 246 | <number>11</number> |
244 | </property> | 247 | </property> |
245 | <property stdset="1"> | 248 | <property stdset="1"> |
246 | <name>spacing</name> | 249 | <name>spacing</name> |
247 | <number>6</number> | 250 | <number>6</number> |
248 | </property> | 251 | </property> |
249 | <spacer row="7" column="2" > | 252 | <spacer row="7" column="2" > |
250 | <property> | 253 | <property> |
251 | <name>name</name> | 254 | <name>name</name> |
252 | <cstring>Spacer16</cstring> | 255 | <cstring>Spacer16</cstring> |
253 | </property> | 256 | </property> |
254 | <property stdset="1"> | 257 | <property stdset="1"> |
255 | <name>orientation</name> | 258 | <name>orientation</name> |
256 | <enum>Vertical</enum> | 259 | <enum>Vertical</enum> |
257 | </property> | 260 | </property> |
258 | <property stdset="1"> | 261 | <property stdset="1"> |
259 | <name>sizeType</name> | 262 | <name>sizeType</name> |
260 | <enum>Expanding</enum> | 263 | <enum>Expanding</enum> |
261 | </property> | 264 | </property> |
262 | <property> | 265 | <property> |
263 | <name>sizeHint</name> | 266 | <name>sizeHint</name> |
264 | <size> | 267 | <size> |
265 | <width>20</width> | 268 | <width>20</width> |
266 | <height>20</height> | 269 | <height>20</height> |
267 | </size> | 270 | </size> |
268 | </property> | 271 | </property> |
269 | </spacer> | 272 | </spacer> |
270 | <widget row="0" column="1" > | 273 | <widget row="0" column="1" > |
271 | <class>QLabel</class> | 274 | <class>QLabel</class> |
272 | <property stdset="1"> | 275 | <property stdset="1"> |
273 | <name>name</name> | 276 | <name>name</name> |
274 | <cstring>currentProfileLabel</cstring> | 277 | <cstring>currentProfileLabel</cstring> |
275 | </property> | 278 | </property> |
276 | <property stdset="1"> | 279 | <property stdset="1"> |
277 | <name>frameShape</name> | 280 | <name>frameShape</name> |
278 | <enum>Panel</enum> | 281 | <enum>Panel</enum> |
279 | </property> | 282 | </property> |
280 | <property stdset="1"> | 283 | <property stdset="1"> |
281 | <name>frameShadow</name> | 284 | <name>frameShadow</name> |
282 | <enum>Sunken</enum> | 285 | <enum>Sunken</enum> |
283 | </property> | 286 | </property> |
284 | <property stdset="1"> | 287 | <property stdset="1"> |
285 | <name>text</name> | 288 | <name>text</name> |
286 | <string>All</string> | 289 | <string>All</string> |
287 | </property> | 290 | </property> |
288 | </widget> | 291 | </widget> |
289 | <widget row="3" column="2" > | 292 | <widget row="3" column="2" > |
290 | <class>QPushButton</class> | 293 | <class>QPushButton</class> |
291 | <property stdset="1"> | 294 | <property stdset="1"> |
292 | <name>name</name> | 295 | <name>name</name> |
293 | <cstring>setCurrentProfileButton</cstring> | 296 | <cstring>setCurrentProfileButton</cstring> |
294 | </property> | 297 | </property> |
295 | <property stdset="1"> | 298 | <property stdset="1"> |
296 | <name>text</name> | 299 | <name>text</name> |
297 | <string>&Set Current</string> | 300 | <string>&Set Current</string> |
298 | </property> | 301 | </property> |
299 | </widget> | 302 | </widget> |
300 | <widget row="5" column="0" rowspan="1" colspan="3" > | 303 | <widget row="5" column="0" rowspan="1" colspan="3" > |
301 | <class>Line</class> | 304 | <class>Line</class> |
302 | <property stdset="1"> | 305 | <property stdset="1"> |
303 | <name>name</name> | 306 | <name>name</name> |
304 | <cstring>Line6</cstring> | 307 | <cstring>Line6</cstring> |
305 | </property> | 308 | </property> |
306 | <property stdset="1"> | 309 | <property stdset="1"> |
307 | <name>orientation</name> | 310 | <name>orientation</name> |
308 | <enum>Horizontal</enum> | 311 | <enum>Horizontal</enum> |
309 | </property> | 312 | </property> |
310 | </widget> | 313 | </widget> |
311 | <widget row="1" column="0" rowspan="1" colspan="3" > | 314 | <widget row="1" column="0" rowspan="1" colspan="3" > |
312 | <class>Line</class> | 315 | <class>Line</class> |
313 | <property stdset="1"> | 316 | <property stdset="1"> |
314 | <name>name</name> | 317 | <name>name</name> |
315 | <cstring>Line1</cstring> | 318 | <cstring>Line1</cstring> |
316 | </property> | 319 | </property> |
317 | <property stdset="1"> | 320 | <property stdset="1"> |
318 | <name>orientation</name> | 321 | <name>orientation</name> |
319 | <enum>Horizontal</enum> | 322 | <enum>Horizontal</enum> |
320 | </property> | 323 | </property> |
321 | </widget> | 324 | </widget> |
322 | <widget row="0" column="0" > | 325 | <widget row="0" column="0" > |
323 | <class>QLabel</class> | 326 | <class>QLabel</class> |
324 | <property stdset="1"> | 327 | <property stdset="1"> |
325 | <name>name</name> | 328 | <name>name</name> |
326 | <cstring>TextLabel1</cstring> | 329 | <cstring>TextLabel1</cstring> |
327 | </property> | 330 | </property> |
328 | <property stdset="1"> | 331 | <property stdset="1"> |
329 | <name>text</name> | 332 | <name>text</name> |
330 | <string>Current Profile</string> | 333 | <string>Current Profile</string> |
331 | </property> | 334 | </property> |
332 | </widget> | 335 | </widget> |
333 | <widget row="4" column="2" > | 336 | <widget row="4" column="2" > |
334 | <class>QPushButton</class> | 337 | <class>QPushButton</class> |
335 | <property stdset="1"> | 338 | <property stdset="1"> |
336 | <name>name</name> | 339 | <name>name</name> |
337 | <cstring>removeProfileButton</cstring> | 340 | <cstring>removeProfileButton</cstring> |
338 | </property> | 341 | </property> |
339 | <property stdset="1"> | 342 | <property stdset="1"> |
340 | <name>text</name> | 343 | <name>text</name> |
341 | <string>&Remove</string> | 344 | <string>&Remove</string> |
342 | </property> | 345 | </property> |
343 | </widget> | 346 | </widget> |
344 | <widget row="3" column="0" rowspan="2" colspan="2" > | 347 | <widget row="3" column="0" rowspan="2" colspan="2" > |
345 | <class>QListBox</class> | 348 | <class>QListBox</class> |
346 | <property stdset="1"> | 349 | <property stdset="1"> |
347 | <name>name</name> | 350 | <name>name</name> |
348 | <cstring>profilesList</cstring> | 351 | <cstring>profilesList</cstring> |
349 | </property> | 352 | </property> |
350 | </widget> | 353 | </widget> |
351 | <spacer row="0" column="2" > | 354 | <spacer row="0" column="2" > |
352 | <property> | 355 | <property> |
353 | <name>name</name> | 356 | <name>name</name> |
354 | <cstring>Spacer2</cstring> | 357 | <cstring>Spacer2</cstring> |
355 | </property> | 358 | </property> |
356 | <property stdset="1"> | 359 | <property stdset="1"> |
357 | <name>orientation</name> | 360 | <name>orientation</name> |
358 | <enum>Horizontal</enum> | 361 | <enum>Horizontal</enum> |
359 | </property> | 362 | </property> |
360 | <property stdset="1"> | 363 | <property stdset="1"> |
361 | <name>sizeType</name> | 364 | <name>sizeType</name> |
362 | <enum>Expanding</enum> | 365 | <enum>Expanding</enum> |
363 | </property> | 366 | </property> |
364 | <property> | 367 | <property> |
365 | <name>sizeHint</name> | 368 | <name>sizeHint</name> |
366 | <size> | 369 | <size> |
367 | <width>20</width> | 370 | <width>20</width> |
368 | <height>20</height> | 371 | <height>20</height> |
369 | </size> | 372 | </size> |
370 | </property> | 373 | </property> |
371 | </spacer> | 374 | </spacer> |
372 | <widget row="2" column="0" > | 375 | <widget row="2" column="0" > |
373 | <class>QLabel</class> | 376 | <class>QLabel</class> |
374 | <property stdset="1"> | 377 | <property stdset="1"> |
375 | <name>name</name> | 378 | <name>name</name> |
376 | <cstring>TextLabel1_2</cstring> | 379 | <cstring>TextLabel1_2</cstring> |
377 | </property> | 380 | </property> |
378 | <property stdset="1"> | 381 | <property stdset="1"> |
379 | <name>text</name> | 382 | <name>text</name> |
380 | <string>Profiles</string> | 383 | <string>Profiles</string> |
381 | </property> | 384 | </property> |
382 | </widget> | 385 | </widget> |
383 | <widget row="6" column="0" rowspan="1" colspan="3" > | 386 | <widget row="6" column="0" rowspan="1" colspan="3" > |
384 | <class>QLayoutWidget</class> | 387 | <class>QLayoutWidget</class> |
385 | <property stdset="1"> | 388 | <property stdset="1"> |
386 | <name>name</name> | 389 | <name>name</name> |
387 | <cstring>Layout6</cstring> | 390 | <cstring>Layout6</cstring> |
388 | </property> | 391 | </property> |
389 | <hbox> | 392 | <hbox> |
390 | <property stdset="1"> | 393 | <property stdset="1"> |
391 | <name>margin</name> | 394 | <name>margin</name> |
392 | <number>0</number> | 395 | <number>0</number> |
393 | </property> | 396 | </property> |
394 | <property stdset="1"> | 397 | <property stdset="1"> |
395 | <name>spacing</name> | 398 | <name>spacing</name> |
396 | <number>6</number> | 399 | <number>6</number> |
397 | </property> | 400 | </property> |
398 | <widget> | 401 | <widget> |
399 | <class>QLabel</class> | 402 | <class>QLabel</class> |
400 | <property stdset="1"> | 403 | <property stdset="1"> |
401 | <name>name</name> | 404 | <name>name</name> |
402 | <cstring>TextLabel1_3</cstring> | 405 | <cstring>TextLabel1_3</cstring> |
403 | </property> | 406 | </property> |
404 | <property stdset="1"> | 407 | <property stdset="1"> |
405 | <name>text</name> | 408 | <name>text</name> |
406 | <string>New Profile</string> | 409 | <string>New Profile</string> |
407 | </property> | 410 | </property> |
408 | </widget> | 411 | </widget> |
409 | <widget> | 412 | <widget> |
410 | <class>QLineEdit</class> | 413 | <class>QLineEdit</class> |
411 | <property stdset="1"> | 414 | <property stdset="1"> |
412 | <name>name</name> | 415 | <name>name</name> |
413 | <cstring>newProfile</cstring> | 416 | <cstring>newProfile</cstring> |
414 | </property> | 417 | </property> |
415 | </widget> | 418 | </widget> |
416 | <widget> | 419 | <widget> |
417 | <class>QPushButton</class> | 420 | <class>QPushButton</class> |
418 | <property stdset="1"> | 421 | <property stdset="1"> |
419 | <name>name</name> | 422 | <name>name</name> |
420 | <cstring>newProfileButton</cstring> | 423 | <cstring>newProfileButton</cstring> |
421 | </property> | 424 | </property> |
422 | <property stdset="1"> | 425 | <property stdset="1"> |
423 | <name>enabled</name> | 426 | <name>enabled</name> |
424 | <bool>false</bool> | 427 | <bool>false</bool> |
425 | </property> | 428 | </property> |
426 | <property stdset="1"> | 429 | <property stdset="1"> |
427 | <name>text</name> | 430 | <name>text</name> |
428 | <string>&Add</string> | 431 | <string>&Add</string> |
429 | </property> | 432 | </property> |
430 | </widget> | 433 | </widget> |
431 | </hbox> | 434 | </hbox> |
432 | </widget> | 435 | </widget> |
433 | </grid> | 436 | </grid> |
434 | </widget> | 437 | </widget> |
438 | <widget> | ||
439 | <class>QWidget</class> | ||
440 | <property stdset="1"> | ||
441 | <name>name</name> | ||
442 | <cstring>devicenametab</cstring> | ||
443 | </property> | ||
444 | <attribute> | ||
445 | <name>title</name> | ||
446 | <string>Device name</string> | ||
447 | </attribute> | ||
448 | <vbox> | ||
449 | <property stdset="1"> | ||
450 | <name>margin</name> | ||
451 | <number>11</number> | ||
452 | </property> | ||
453 | <property stdset="1"> | ||
454 | <name>spacing</name> | ||
455 | <number>6</number> | ||
456 | </property> | ||
457 | <widget> | ||
458 | <class>QLabel</class> | ||
459 | <property stdset="1"> | ||
460 | <name>name</name> | ||
461 | <cstring>m_NameHead</cstring> | ||
462 | </property> | ||
463 | <property stdset="1"> | ||
464 | <name>text</name> | ||
465 | <string><b>Name of the device</b></string> | ||
466 | </property> | ||
467 | </widget> | ||
468 | <widget> | ||
469 | <class>QLineEdit</class> | ||
470 | <property stdset="1"> | ||
471 | <name>name</name> | ||
472 | <cstring>m_Nameinput</cstring> | ||
473 | </property> | ||
474 | </widget> | ||
475 | <widget> | ||
476 | <class>QPushButton</class> | ||
477 | <property stdset="1"> | ||
478 | <name>name</name> | ||
479 | <cstring>m_setButton</cstring> | ||
480 | </property> | ||
481 | <property stdset="1"> | ||
482 | <name>text</name> | ||
483 | <string>Set value</string> | ||
484 | </property> | ||
485 | </widget> | ||
486 | <widget> | ||
487 | <class>QLabel</class> | ||
488 | <property stdset="1"> | ||
489 | <name>name</name> | ||
490 | <cstring>m_Infolabel</cstring> | ||
491 | </property> | ||
492 | <property stdset="1"> | ||
493 | <name>sizePolicy</name> | ||
494 | <sizepolicy> | ||
495 | <hsizetype>3</hsizetype> | ||
496 | <vsizetype>3</vsizetype> | ||
497 | </sizepolicy> | ||
498 | </property> | ||
499 | <property stdset="1"> | ||
500 | <name>text</name> | ||
501 | <string>The name here is that one your device identifying with on | ||
502 | console or infrared.</string> | ||
503 | </property> | ||
504 | </widget> | ||
505 | <spacer> | ||
506 | <property> | ||
507 | <name>name</name> | ||
508 | <cstring>Spacer5</cstring> | ||
509 | </property> | ||
510 | <property stdset="1"> | ||
511 | <name>orientation</name> | ||
512 | <enum>Vertical</enum> | ||
513 | </property> | ||
514 | <property stdset="1"> | ||
515 | <name>sizeType</name> | ||
516 | <enum>Expanding</enum> | ||
517 | </property> | ||
518 | <property> | ||
519 | <name>sizeHint</name> | ||
520 | <size> | ||
521 | <width>20</width> | ||
522 | <height>20</height> | ||
523 | </size> | ||
524 | </property> | ||
525 | </spacer> | ||
526 | </vbox> | ||
527 | </widget> | ||
435 | </widget> | 528 | </widget> |
436 | </vbox> | 529 | </vbox> |
437 | </widget> | 530 | </widget> |
531 | <connections> | ||
532 | <connection> | ||
533 | <sender>m_setButton</sender> | ||
534 | <signal>clicked()</signal> | ||
535 | <receiver>MainWindow</receiver> | ||
536 | <slot>setHostname()</slot> | ||
537 | </connection> | ||
538 | <slot access="protected">setHostname()</slot> | ||
539 | </connections> | ||
438 | <tabstops> | 540 | <tabstops> |
439 | <tabstop>tabWidget</tabstop> | 541 | <tabstop>tabWidget</tabstop> |
440 | <tabstop>connectionList</tabstop> | 542 | <tabstop>connectionList</tabstop> |
441 | <tabstop>informationConnectionButton</tabstop> | 543 | <tabstop>informationConnectionButton</tabstop> |
442 | <tabstop>configureConnectionButton</tabstop> | 544 | <tabstop>configureConnectionButton</tabstop> |
443 | <tabstop>addConnectionButton</tabstop> | 545 | <tabstop>addConnectionButton</tabstop> |
444 | <tabstop>removeConnectionButton</tabstop> | 546 | <tabstop>removeConnectionButton</tabstop> |
445 | <tabstop>profilesList</tabstop> | 547 | <tabstop>profilesList</tabstop> |
446 | <tabstop>setCurrentProfileButton</tabstop> | 548 | <tabstop>setCurrentProfileButton</tabstop> |
447 | <tabstop>removeProfileButton</tabstop> | 549 | <tabstop>removeProfileButton</tabstop> |
448 | <tabstop>newProfile</tabstop> | 550 | <tabstop>newProfile</tabstop> |
449 | <tabstop>newProfileButton</tabstop> | 551 | <tabstop>newProfileButton</tabstop> |
450 | </tabstops> | 552 | </tabstops> |
451 | </UI> | 553 | </UI> |
diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp index f83e370..0a3312c 100644 --- a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp | |||
@@ -1,316 +1,325 @@ | |||
1 | 1 | ||
2 | #include "mainwindowimp.h" | 2 | #include "mainwindowimp.h" |
3 | #include "addconnectionimp.h" | 3 | #include "addconnectionimp.h" |
4 | #include "interfaceinformationimp.h" | 4 | #include "interfaceinformationimp.h" |
5 | #include "interfacesetupimp.h" | 5 | #include "interfacesetupimp.h" |
6 | #include "interfaces.h" | 6 | #include "interfaces.h" |
7 | #include "module.h" | 7 | #include "module.h" |
8 | 8 | ||
9 | /* OPIE */ | 9 | /* OPIE */ |
10 | #include <opie2/odebug.h> | 10 | #include <opie2/odebug.h> |
11 | #include <opie2/oprocess.h> | ||
11 | #include <qpe/applnk.h> | 12 | #include <qpe/applnk.h> |
12 | #include <qpe/qcopenvelope_qws.h> | 13 | #include <qpe/qcopenvelope_qws.h> |
13 | #include <qpe/qpeapplication.h> | 14 | #include <qpe/qpeapplication.h> |
14 | #include <qpe/config.h> | 15 | #include <qpe/config.h> |
15 | #include <qpe/qlibrary.h> | 16 | #include <qpe/qlibrary.h> |
16 | #include <qpe/resource.h> | 17 | #include <qpe/resource.h> |
17 | 18 | ||
18 | /* QT */ | 19 | /* QT */ |
19 | #include <qpushbutton.h> | 20 | #include <qpushbutton.h> |
20 | #include <qlistbox.h> | 21 | #include <qlistbox.h> |
21 | #include <qlineedit.h> | 22 | #include <qlineedit.h> |
22 | #include <qlistview.h> | 23 | #include <qlistview.h> |
23 | #include <qheader.h> | 24 | #include <qheader.h> |
24 | #include <qlabel.h> | 25 | #include <qlabel.h> |
25 | #include <qtabwidget.h> // in order to disable the profiles tab | 26 | #include <qtabwidget.h> // in order to disable the profiles tab |
26 | #include <qmessagebox.h> | 27 | #include <qmessagebox.h> |
28 | #include <qtextstream.h> | ||
27 | 29 | ||
28 | 30 | ||
29 | #if QT_VERSION < 0x030000 | 31 | #if QT_VERSION < 0x030000 |
30 | #include <qlist.h> | 32 | #include <qlist.h> |
31 | #else | 33 | #else |
32 | #include <qptrlist.h> | 34 | #include <qptrlist.h> |
33 | #endif | 35 | #endif |
34 | #include <qdir.h> | 36 | #include <qdir.h> |
35 | #include <qfile.h> | 37 | #include <qfile.h> |
36 | #include <qtextstream.h> | 38 | #include <qtextstream.h> |
37 | #include <qregexp.h> | 39 | #include <qregexp.h> |
38 | 40 | ||
39 | /* STD */ | 41 | /* STD */ |
40 | #include <net/if.h> | 42 | #include <net/if.h> |
41 | #include <sys/ioctl.h> | 43 | #include <sys/ioctl.h> |
42 | #include <sys/socket.h> | 44 | #include <sys/socket.h> |
43 | 45 | ||
44 | #define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" | 46 | #define DEFAULT_SCHEME "/var/lib/pcmcia/scheme" |
45 | #define _PROCNETDEV "/proc/net/dev" | 47 | #define _PROCNETDEV "/proc/net/dev" |
46 | 48 | ||
49 | // is this always right? | ||
50 | #define _HOSTFILE "/etc/hostname" | ||
51 | #define _IRDANAME "/proc/sys/net/irda/devname" | ||
52 | |||
53 | using namespace Opie::Core; | ||
54 | |||
47 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME) | 55 | MainWindowImp::MainWindowImp(QWidget *parent, const char *name, WFlags) : MainWindow(parent, name, Qt::WStyle_ContextHelp), advancedUserMode(true), scheme(DEFAULT_SCHEME) |
48 | { | 56 | { |
49 | connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); | 57 | connect(addConnectionButton, SIGNAL(clicked()), this, SLOT(addClicked())); |
50 | connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); | 58 | connect(removeConnectionButton, SIGNAL(clicked()), this, SLOT(removeClicked())); |
51 | connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); | 59 | connect(informationConnectionButton, SIGNAL(clicked()), this, SLOT(informationClicked())); |
52 | connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); | 60 | connect(configureConnectionButton, SIGNAL(clicked()), this, SLOT(configureClicked())); |
53 | 61 | ||
54 | //remove tab with no function | 62 | //remove tab with no function |
55 | tabWidget->removePage( tab ); | 63 | tabWidget->removePage( tab ); |
56 | 64 | ||
57 | // Load connections. | 65 | // Load connections. |
58 | // /usr/local/kde/lib/libinterfaces.la | 66 | // /usr/local/kde/lib/libinterfaces.la |
59 | loadModules(QPEApplication::qpeDir() + "plugins/networksettings"); | 67 | loadModules(QPEApplication::qpeDir() + "plugins/networksettings"); |
60 | getAllInterfaces(); | 68 | getAllInterfaces(); |
61 | 69 | ||
62 | Interfaces i; | 70 | Interfaces i; |
63 | QStringList list = i.getInterfaceList(); | 71 | QStringList list = i.getInterfaceList(); |
64 | QMap<QString, Interface*>::Iterator it; | 72 | QMap<QString, Interface*>::Iterator it; |
65 | for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) | 73 | for ( QStringList::Iterator ni = list.begin(); ni != list.end(); ++ni ) |
66 | { | 74 | { |
67 | /* | 75 | /* |
68 | * we skipped it in getAllInterfaces now | 76 | * we skipped it in getAllInterfaces now |
69 | * we need to ignore it as well | 77 | * we need to ignore it as well |
70 | */ | 78 | */ |
71 | if (m_handledIfaces.contains( *ni) ) | 79 | if (m_handledIfaces.contains( *ni) ) |
72 | { | 80 | { |
73 | odebug << "Not up iface handled by module" << oendl; | 81 | odebug << "Not up iface handled by module" << oendl; |
74 | continue; | 82 | continue; |
75 | } | 83 | } |
76 | bool found = false; | 84 | bool found = false; |
77 | for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ) | 85 | for( it = interfaceNames.begin(); it != interfaceNames.end(); ++it ) |
78 | { | 86 | { |
79 | if(it.key() == (*ni)) | 87 | if(it.key() == (*ni)) |
80 | found = true; | 88 | found = true; |
81 | } | 89 | } |
82 | if(!found) | 90 | if(!found) |
83 | { | 91 | { |
84 | if(!(*ni).contains("_")) | 92 | if(!(*ni).contains("_")) |
85 | { | 93 | { |
86 | Interface *i = new Interface(this, *ni, false); | 94 | Interface *i = new Interface(this, *ni, false); |
87 | i->setAttached(false); | 95 | i->setAttached(false); |
88 | i->setHardwareName(tr("Disconnected")); | 96 | i->setHardwareName(tr("Disconnected")); |
89 | interfaceNames.insert(i->getInterfaceName(), i); | 97 | interfaceNames.insert(i->getInterfaceName(), i); |
90 | updateInterface(i); | 98 | updateInterface(i); |
91 | connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*))); | 99 | connect(i, SIGNAL(updateInterface(Interface*)), this, SLOT(updateInterface(Interface*))); |
92 | } | 100 | } |
93 | } | 101 | } |
94 | } | 102 | } |
95 | 103 | ||
96 | //getInterfaceList(); | 104 | //getInterfaceList(); |
97 | connectionList->header()->hide(); | 105 | connectionList->header()->hide(); |
98 | 106 | ||
99 | Config cfg("NetworkSetup"); | 107 | Config cfg("NetworkSetup"); |
100 | profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); | 108 | profiles = QStringList::split(" ", cfg.readEntry("Profiles", "All")); |
101 | for ( QStringList::Iterator it = profiles.begin(); | 109 | for ( QStringList::Iterator it = profiles.begin(); |
102 | it != profiles.end(); ++it) | 110 | it != profiles.end(); ++it) |
103 | profilesList->insertItem((*it)); | 111 | profilesList->insertItem((*it)); |
104 | currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All")); | 112 | currentProfileLabel->setText(cfg.readEntry("CurrentProfile", "All")); |
105 | advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); | 113 | advancedUserMode = cfg.readBoolEntry("AdvancedUserMode", false); |
106 | scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); | 114 | scheme = cfg.readEntry("SchemeFile", DEFAULT_SCHEME); |
107 | 115 | ||
108 | QFile file(scheme); | 116 | QFile file(scheme); |
109 | if ( file.open(IO_ReadOnly) ) | 117 | if ( file.open(IO_ReadOnly) ) |
110 | { // file opened successfully | 118 | { // file opened successfully |
111 | QTextStream stream( &file ); // use a text stream | 119 | QTextStream stream( &file ); // use a text stream |
112 | while ( !stream.eof() ) | 120 | while ( !stream.eof() ) |
113 | { // until end of file... | 121 | { // until end of file... |
114 | QString line = stream.readLine(); // line of text excluding '\n' | 122 | QString line = stream.readLine(); // line of text excluding '\n' |
115 | if(line.contains("SCHEME")) | 123 | if(line.contains("SCHEME")) |
116 | { | 124 | { |
117 | line = line.mid(7, line.length()); | 125 | line = line.mid(7, line.length()); |
118 | currentProfileLabel->setText(line); | 126 | currentProfileLabel->setText(line); |
119 | break; | 127 | break; |
120 | } | 128 | } |
121 | } | 129 | } |
122 | file.close(); | 130 | file.close(); |
123 | } | 131 | } |
124 | makeChannel(); | 132 | makeChannel(); |
133 | initHostname(); | ||
125 | } | 134 | } |
126 | 135 | ||
127 | /** | 136 | /** |
128 | * Deconstructor. Save profiles. Delete loaded libraries. | 137 | * Deconstructor. Save profiles. Delete loaded libraries. |
129 | */ | 138 | */ |
130 | MainWindowImp::~MainWindowImp() | 139 | MainWindowImp::~MainWindowImp() |
131 | { | 140 | { |
132 | // Save profiles. | 141 | // Save profiles. |
133 | Config cfg("NetworkSetup"); | 142 | Config cfg("NetworkSetup"); |
134 | cfg.setGroup("General"); | 143 | cfg.setGroup("General"); |
135 | cfg.writeEntry("Profiles", profiles.join(" ")); | 144 | cfg.writeEntry("Profiles", profiles.join(" ")); |
136 | 145 | ||
137 | // Delete all interfaces that don't have owners. | 146 | // Delete all interfaces that don't have owners. |
138 | QMap<Interface*, QListViewItem*>::Iterator iIt; | 147 | QMap<Interface*, QListViewItem*>::Iterator iIt; |
139 | for( iIt = items.begin(); iIt != items.end(); ++iIt ) | 148 | for( iIt = items.begin(); iIt != items.end(); ++iIt ) |
140 | { | 149 | { |
141 | if(iIt.key()->getModuleOwner() == NULL) | 150 | if(iIt.key()->getModuleOwner() == NULL) |
142 | delete iIt.key(); | 151 | delete iIt.key(); |
143 | } | 152 | } |
144 | 153 | ||
145 | // Delete Modules and Libraries | 154 | // Delete Modules and Libraries |
146 | QMap<Module*, QLibrary*>::Iterator it; | 155 | QMap<Module*, QLibrary*>::Iterator it; |
147 | for( it = libraries.begin(); it != libraries.end(); ++it ) | 156 | for( it = libraries.begin(); it != libraries.end(); ++it ) |
148 | { | 157 | { |
149 | delete it.key(); | 158 | delete it.key(); |
150 | // I wonder why I can't delete the libraries | 159 | // I wonder why I can't delete the libraries |
151 | // What fucking shit this is. | 160 | // What fucking shit this is. |
152 | //delete it.data(); | 161 | //delete it.data(); |
153 | } | 162 | } |
154 | } | 163 | } |
155 | 164 | ||
156 | /** | 165 | /** |
157 | * Query the kernel for all of the interfaces. | 166 | * Query the kernel for all of the interfaces. |
158 | */ | 167 | */ |
159 | void MainWindowImp::getAllInterfaces() | 168 | void MainWindowImp::getAllInterfaces() |
160 | { | 169 | { |
161 | int sockfd = socket(PF_INET, SOCK_DGRAM, 0); | 170 | int sockfd = socket(PF_INET, SOCK_DGRAM, 0); |
162 | if(sockfd == -1) | 171 | if(sockfd == -1) |
163 | return; | 172 | return; |
164 | 173 | ||
165 | struct ifreq ifr; | 174 | struct ifreq ifr; |
166 | QStringList ifaces; | 175 | QStringList ifaces; |
167 | QFile procFile(QString(_PROCNETDEV)); | 176 | QFile procFile(QString(_PROCNETDEV)); |
168 | int result; | 177 | int result; |
169 | Interface *i; | 178 | Interface *i; |
170 | 179 | ||
171 | if (! procFile.exists()) | 180 | if (! procFile.exists()) |
172 | { | 181 | { |
173 | struct ifreq ifrs[100]; | 182 | struct ifreq ifrs[100]; |
174 | struct ifconf ifc; | 183 | struct ifconf ifc; |
175 | ifc.ifc_len = sizeof(ifrs); | 184 | ifc.ifc_len = sizeof(ifrs); |
176 | ifc.ifc_req = ifrs; | 185 | ifc.ifc_req = ifrs; |
177 | result = ioctl(sockfd, SIOCGIFCONF, &ifc); | 186 | result = ioctl(sockfd, SIOCGIFCONF, &ifc); |
178 | 187 | ||
179 | for (unsigned int i = 0; i < ifc.ifc_len / sizeof(struct ifreq); i++) | 188 | for (unsigned int i = 0; i < ifc.ifc_len / sizeof(struct ifreq); i++) |
180 | { | 189 | { |
181 | struct ifreq *pifr = &ifrs[i]; | 190 | struct ifreq *pifr = &ifrs[i]; |
182 | 191 | ||
183 | ifaces += pifr->ifr_name; | 192 | ifaces += pifr->ifr_name; |
184 | } | 193 | } |
185 | } | 194 | } |
186 | else | 195 | else |
187 | { | 196 | { |
188 | procFile.open(IO_ReadOnly); | 197 | procFile.open(IO_ReadOnly); |
189 | QString line; | 198 | QString line; |
190 | QTextStream procTs(&procFile); | 199 | QTextStream procTs(&procFile); |
191 | int loc = -1; | 200 | int loc = -1; |
192 | 201 | ||
193 | procTs.readLine(); // eat a line | 202 | procTs.readLine(); // eat a line |
194 | procTs.readLine(); // eat a line | 203 | procTs.readLine(); // eat a line |
195 | while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null) | 204 | while((line = procTs.readLine().simplifyWhiteSpace()) != QString::null) |
196 | { | 205 | { |
197 | if((loc = line.find(":")) != -1) | 206 | if((loc = line.find(":")) != -1) |
198 | { | 207 | { |
199 | ifaces += line.left(loc); | 208 | ifaces += line.left(loc); |
200 | } | 209 | } |
201 | } | 210 | } |
202 | } | 211 | } |
203 | 212 | ||
204 | for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) | 213 | for (QStringList::Iterator it = ifaces.begin(); it != ifaces.end(); ++it) |
205 | { | 214 | { |
206 | int flags = 0; | 215 | int flags = 0; |
207 | if ( m_handledIfaces.contains( (*it) ) ) | 216 | if ( m_handledIfaces.contains( (*it) ) ) |
208 | { | 217 | { |
209 | odebug << " " << (*it).latin1() << " is handled by a module" << oendl; | 218 | odebug << " " << (*it).latin1() << " is handled by a module" << oendl; |
210 | continue; | 219 | continue; |
211 | } | 220 | } |
212 | // int family; | 221 | // int family; |
213 | i = NULL; | 222 | i = NULL; |
214 | 223 | ||
215 | strcpy(ifr.ifr_name, (*it).latin1()); | 224 | strcpy(ifr.ifr_name, (*it).latin1()); |
216 | 225 | ||
217 | struct ifreq ifcopy; | 226 | struct ifreq ifcopy; |
218 | ifcopy = ifr; | 227 | ifcopy = ifr; |
219 | result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy); | 228 | result = ioctl(sockfd, SIOCGIFFLAGS, &ifcopy); |
220 | flags = ifcopy.ifr_flags; | 229 | flags = ifcopy.ifr_flags; |
221 | i = new Interface(this, ifr.ifr_name, false); | 230 | i = new Interface(this, ifr.ifr_name, false); |
222 | i->setAttached(true); | 231 | i->setAttached(true); |
223 | if ((flags & IFF_UP) == IFF_UP) | 232 | if ((flags & IFF_UP) == IFF_UP) |
224 | i->setStatus(true); | 233 | i->setStatus(true); |
225 | else | 234 | else |
226 | i->setStatus(false); | 235 | i->setStatus(false); |
227 | 236 | ||
228 | if ((flags & IFF_BROADCAST) == IFF_BROADCAST) | 237 | if ((flags & IFF_BROADCAST) == IFF_BROADCAST) |
229 | i->setHardwareName("Ethernet"); | 238 | i->setHardwareName("Ethernet"); |
230 | else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT) | 239 | else if ((flags & IFF_POINTOPOINT) == IFF_POINTOPOINT) |
231 | i->setHardwareName("Point to Point"); | 240 | i->setHardwareName("Point to Point"); |
232 | else if ((flags & IFF_MULTICAST) == IFF_MULTICAST) | 241 | else if ((flags & IFF_MULTICAST) == IFF_MULTICAST) |
233 | i->setHardwareName("Multicast"); | 242 | i->setHardwareName("Multicast"); |
234 | else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK) | 243 | else if ((flags & IFF_LOOPBACK) == IFF_LOOPBACK) |
235 | i->setHardwareName("Loopback"); | 244 | i->setHardwareName("Loopback"); |
236 | else | 245 | else |
237 | i->setHardwareName("Unknown"); | 246 | i->setHardwareName("Unknown"); |
238 | 247 | ||
239 | owarn << "Adding interface " << ifr.ifr_name << " to interfaceNames\n" << oendl; | 248 | owarn << "Adding interface " << ifr.ifr_name << " to interfaceNames\n" << oendl; |
240 | interfaceNames.insert(i->getInterfaceName(), i); | 249 | interfaceNames.insert(i->getInterfaceName(), i); |
241 | updateInterface(i); | 250 | updateInterface(i); |
242 | connect(i, SIGNAL(updateInterface(Interface*)), | 251 | connect(i, SIGNAL(updateInterface(Interface*)), |
243 | this, SLOT(updateInterface(Interface*))); | 252 | this, SLOT(updateInterface(Interface*))); |
244 | } | 253 | } |
245 | // now lets ask the plugins too ;) | 254 | // now lets ask the plugins too ;) |
246 | QMap<Module*, QLibrary*>::Iterator it; | 255 | QMap<Module*, QLibrary*>::Iterator it; |
247 | QList<Interface> ilist; | 256 | QList<Interface> ilist; |
248 | for( it = libraries.begin(); it != libraries.end(); ++it ) | 257 | for( it = libraries.begin(); it != libraries.end(); ++it ) |
249 | { | 258 | { |
250 | if(it.key()) | 259 | if(it.key()) |
251 | { | 260 | { |
252 | ilist = it.key()->getInterfaces(); | 261 | ilist = it.key()->getInterfaces(); |
253 | for( i = ilist.first(); i != 0; i = ilist.next() ) | 262 | for( i = ilist.first(); i != 0; i = ilist.next() ) |
254 | { | 263 | { |
255 | owarn << "Adding interface " << i->getInterfaceName().latin1() << " to interfaceNames\n" << oendl; | 264 | owarn << "Adding interface " << i->getInterfaceName().latin1() << " to interfaceNames\n" << oendl; |
256 | interfaceNames.insert(i->getInterfaceName(), i); | 265 | interfaceNames.insert(i->getInterfaceName(), i); |
257 | updateInterface(i); | 266 | updateInterface(i); |
258 | connect(i, SIGNAL(updateInterface(Interface*)), | 267 | connect(i, SIGNAL(updateInterface(Interface*)), |
259 | this, SLOT(updateInterface(Interface*))); | 268 | this, SLOT(updateInterface(Interface*))); |
260 | } | 269 | } |
261 | } | 270 | } |
262 | } | 271 | } |
263 | } | 272 | } |
264 | 273 | ||
265 | /** | 274 | /** |
266 | * Load all modules that are found in the path | 275 | * Load all modules that are found in the path |
267 | * @param path a directory that is scaned for any plugins that can be loaded | 276 | * @param path a directory that is scaned for any plugins that can be loaded |
268 | * and attempts to load them | 277 | * and attempts to load them |
269 | */ | 278 | */ |
270 | void MainWindowImp::loadModules(const QString &path) | 279 | void MainWindowImp::loadModules(const QString &path) |
271 | { | 280 | { |
272 | #ifdef DEBUG | 281 | #ifdef DEBUG |
273 | odebug << "MainWindowImp::loadModules: " << path.latin1() << "" << oendl; | 282 | odebug << "MainWindowImp::loadModules: " << path.latin1() << "" << oendl; |
274 | #endif | 283 | #endif |
275 | QDir d(path); | 284 | QDir d(path); |
276 | if(!d.exists()) | 285 | if(!d.exists()) |
277 | return; | 286 | return; |
278 | 287 | ||
279 | QString lang = ::getenv("LANG"); | 288 | QString lang = ::getenv("LANG"); |
280 | // Don't want sym links | 289 | // Don't want sym links |
281 | d.setFilter( QDir::Files | QDir::NoSymLinks ); | 290 | d.setFilter( QDir::Files | QDir::NoSymLinks ); |
282 | const QFileInfoList *list = d.entryInfoList(); | 291 | const QFileInfoList *list = d.entryInfoList(); |
283 | QFileInfoListIterator it( *list ); | 292 | QFileInfoListIterator it( *list ); |
284 | QFileInfo *fi; | 293 | QFileInfo *fi; |
285 | while ( (fi=it.current()) ) | 294 | while ( (fi=it.current()) ) |
286 | { | 295 | { |
287 | if(fi->fileName().contains(".so")) | 296 | if(fi->fileName().contains(".so")) |
288 | { | 297 | { |
289 | /* if loaded install translation */ | 298 | /* if loaded install translation */ |
290 | if( loadPlugin(path + "/" + fi->fileName()) != 0l ){ | 299 | if( loadPlugin(path + "/" + fi->fileName()) != 0l ){ |
291 | QTranslator *trans = new QTranslator(qApp); | 300 | QTranslator *trans = new QTranslator(qApp); |
292 | QString fn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+ fi->fileName().left( fi->fileName().find(".") )+".qm"; | 301 | QString fn = QPEApplication::qpeDir()+"i18n/"+lang+"/"+ fi->fileName().left( fi->fileName().find(".") )+".qm"; |
293 | if( trans->load( fn ) ) | 302 | if( trans->load( fn ) ) |
294 | qApp->installTranslator( trans ); | 303 | qApp->installTranslator( trans ); |
295 | else | 304 | else |
296 | delete trans; | 305 | delete trans; |
297 | } | 306 | } |
298 | odebug << "loaded plugin: >" << QString(path + "/" + fi->fileName()).latin1() << "< " << oendl; | 307 | odebug << "loaded plugin: >" << QString(path + "/" + fi->fileName()).latin1() << "< " << oendl; |
299 | } | 308 | } |
300 | ++it; | 309 | ++it; |
301 | } | 310 | } |
302 | } | 311 | } |
303 | 312 | ||
304 | /** | 313 | /** |
305 | * Attempt to load a function and resolve a function. | 314 | * Attempt to load a function and resolve a function. |
306 | * @param pluginFileName - the name of the file in which to attempt to load | 315 | * @param pluginFileName - the name of the file in which to attempt to load |
307 | * @param resolveString - function pointer to resolve | 316 | * @param resolveString - function pointer to resolve |
308 | * @return pointer to the function with name resolveString or NULL | 317 | * @return pointer to the function with name resolveString or NULL |
309 | */ | 318 | */ |
310 | Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString) | 319 | Module* MainWindowImp::loadPlugin(const QString &pluginFileName, const QString &resolveString) |
311 | { | 320 | { |
312 | #ifdef DEBUG | 321 | #ifdef DEBUG |
313 | odebug << "MainWindowImp::loadPlugin: " << pluginFileName.latin1() << ": resolving " << resolveString.latin1() << "" << oendl; | 322 | odebug << "MainWindowImp::loadPlugin: " << pluginFileName.latin1() << ": resolving " << resolveString.latin1() << "" << oendl; |
314 | #endif | 323 | #endif |
315 | QLibrary *lib = new QLibrary(pluginFileName); | 324 | QLibrary *lib = new QLibrary(pluginFileName); |
316 | void *functionPointer = lib->resolve(resolveString); | 325 | void *functionPointer = lib->resolve(resolveString); |
@@ -525,192 +534,242 @@ void MainWindowImp::updateInterface(Interface *i) | |||
525 | pic.convertFromImage( Resource::loadImage( i->getStatus() ? "up": "down" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | 534 | pic.convertFromImage( Resource::loadImage( i->getStatus() ? "up": "down" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
526 | item->setPixmap(0, ( pic )); | 535 | item->setPixmap(0, ( pic )); |
527 | #else | 536 | #else |
528 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); | 537 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); |
529 | #endif | 538 | #endif |
530 | 539 | ||
531 | QString typeName = "lan"; | 540 | QString typeName = "lan"; |
532 | if(i->getInterfaceName() == "lo") | 541 | if(i->getInterfaceName() == "lo") |
533 | typeName = "lo"; | 542 | typeName = "lo"; |
534 | if(i->getInterfaceName().contains("irda")) | 543 | if(i->getInterfaceName().contains("irda")) |
535 | typeName = "irda"; | 544 | typeName = "irda"; |
536 | if(i->getInterfaceName().contains("wlan")) | 545 | if(i->getInterfaceName().contains("wlan")) |
537 | typeName = "wlan"; | 546 | typeName = "wlan"; |
538 | if(i->getInterfaceName().contains("usb")) | 547 | if(i->getInterfaceName().contains("usb")) |
539 | typeName = "usb"; | 548 | typeName = "usb"; |
540 | 549 | ||
541 | if(!i->isAttached()) | 550 | if(!i->isAttached()) |
542 | typeName = "connect_no"; | 551 | typeName = "connect_no"; |
543 | // Actually try to use the Module | 552 | // Actually try to use the Module |
544 | if(i->getModuleOwner() != NULL) | 553 | if(i->getModuleOwner() != NULL) |
545 | typeName = i->getModuleOwner()->getPixmapName(i); | 554 | typeName = i->getModuleOwner()->getPixmapName(i); |
546 | 555 | ||
547 | #ifdef QWS | 556 | #ifdef QWS |
548 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); | 557 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); |
549 | #else | 558 | #else |
550 | item->setPixmap(1, (SmallIcon(typeName))); | 559 | item->setPixmap(1, (SmallIcon(typeName))); |
551 | #endif | 560 | #endif |
552 | item->setText(2, i->getHardwareName()); | 561 | item->setText(2, i->getHardwareName()); |
553 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); | 562 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); |
554 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); | 563 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); |
555 | } | 564 | } |
556 | 565 | ||
557 | void MainWindowImp::newProfileChanged(const QString& newText) | 566 | void MainWindowImp::newProfileChanged(const QString& newText) |
558 | { | 567 | { |
559 | if(newText.length() > 0) | 568 | if(newText.length() > 0) |
560 | newProfileButton->setEnabled(true); | 569 | newProfileButton->setEnabled(true); |
561 | else | 570 | else |
562 | newProfileButton->setEnabled(false); | 571 | newProfileButton->setEnabled(false); |
563 | } | 572 | } |
564 | 573 | ||
565 | /** | 574 | /** |
566 | * Adds a new profile to the list of profiles. | 575 | * Adds a new profile to the list of profiles. |
567 | * Don't add profiles that already exists. | 576 | * Don't add profiles that already exists. |
568 | * Appends to the list and QStringList | 577 | * Appends to the list and QStringList |
569 | */ | 578 | */ |
570 | void MainWindowImp::addProfile() | 579 | void MainWindowImp::addProfile() |
571 | { | 580 | { |
572 | QString newProfileName = newProfile->text(); | 581 | QString newProfileName = newProfile->text(); |
573 | if(profiles.grep(newProfileName).count() > 0) | 582 | if(profiles.grep(newProfileName).count() > 0) |
574 | { | 583 | { |
575 | QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok); | 584 | QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok); |
576 | return; | 585 | return; |
577 | } | 586 | } |
578 | profiles.append(newProfileName); | 587 | profiles.append(newProfileName); |
579 | profilesList->insertItem(newProfileName); | 588 | profilesList->insertItem(newProfileName); |
580 | } | 589 | } |
581 | 590 | ||
582 | /** | 591 | /** |
583 | * Removes the currently selected profile in the combo. | 592 | * Removes the currently selected profile in the combo. |
584 | * Doesn't delete if there are less then 2 profiles. | 593 | * Doesn't delete if there are less then 2 profiles. |
585 | */ | 594 | */ |
586 | void MainWindowImp::removeProfile() | 595 | void MainWindowImp::removeProfile() |
587 | { | 596 | { |
588 | if(profilesList->count() <= 1) | 597 | if(profilesList->count() <= 1) |
589 | { | 598 | { |
590 | QMessageBox::information(this, "Can't remove.","At least one profile\nis needed.", QMessageBox::Ok); | 599 | QMessageBox::information(this, "Can't remove.","At least one profile\nis needed.", QMessageBox::Ok); |
591 | return; | 600 | return; |
592 | } | 601 | } |
593 | QString profileToRemove = profilesList->currentText(); | 602 | QString profileToRemove = profilesList->currentText(); |
594 | if(profileToRemove == "All") | 603 | if(profileToRemove == "All") |
595 | { | 604 | { |
596 | QMessageBox::information(this, "Can't remove.","Can't remove default.", QMessageBox::Ok); | 605 | QMessageBox::information(this, "Can't remove.","Can't remove default.", QMessageBox::Ok); |
597 | return; | 606 | return; |
598 | } | 607 | } |
599 | // Can't remove the curent profile | 608 | // Can't remove the curent profile |
600 | if(profileToRemove == currentProfileLabel->text()) | 609 | if(profileToRemove == currentProfileLabel->text()) |
601 | { | 610 | { |
602 | QMessageBox::information(this, "Can't remove.",QString("%1 is the current profile.").arg(profileToRemove), QMessageBox::Ok); | 611 | QMessageBox::information(this, "Can't remove.",QString("%1 is the current profile.").arg(profileToRemove), QMessageBox::Ok); |
603 | return; | 612 | return; |
604 | 613 | ||
605 | } | 614 | } |
606 | 615 | ||
607 | if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) | 616 | if(QMessageBox::information(this, "Question",QString("Remove profile: %1").arg(profileToRemove), QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Ok) |
608 | { | 617 | { |
609 | profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), "")); | 618 | profiles = QStringList::split(" ", profiles.join(" ").replace(QRegExp(profileToRemove), "")); |
610 | profilesList->clear(); | 619 | profilesList->clear(); |
611 | for ( QStringList::Iterator it = profiles.begin(); it != profiles.end(); ++it) | 620 | for ( QStringList::Iterator it = profiles.begin(); it != profiles.end(); ++it) |
612 | profilesList->insertItem((*it)); | 621 | profilesList->insertItem((*it)); |
613 | 622 | ||
614 | // Remove any interface settings and mappings. | 623 | // Remove any interface settings and mappings. |
615 | Interfaces interfaces; | 624 | Interfaces interfaces; |
616 | // Go through them one by one | 625 | // Go through them one by one |
617 | QMap<Interface*, QListViewItem*>::Iterator it; | 626 | QMap<Interface*, QListViewItem*>::Iterator it; |
618 | for( it = items.begin(); it != items.end(); ++it ) | 627 | for( it = items.begin(); it != items.end(); ++it ) |
619 | { | 628 | { |
620 | QString interfaceName = it.key()->getInterfaceName(); | 629 | QString interfaceName = it.key()->getInterfaceName(); |
621 | odebug << interfaceName.latin1() << oendl; | 630 | odebug << interfaceName.latin1() << oendl; |
622 | if(interfaces.setInterface(interfaceName + "_" + profileToRemove)) | 631 | if(interfaces.setInterface(interfaceName + "_" + profileToRemove)) |
623 | { | 632 | { |
624 | interfaces.removeInterface(); | 633 | interfaces.removeInterface(); |
625 | if(interfaces.setMapping(interfaceName)) | 634 | if(interfaces.setMapping(interfaceName)) |
626 | { | 635 | { |
627 | if(profilesList->count() == 1) | 636 | if(profilesList->count() == 1) |
628 | interfaces.removeMapping(); | 637 | interfaces.removeMapping(); |
629 | else | 638 | else |
630 | { | 639 | { |
631 | interfaces.removeMap("map", interfaceName + "_" + profileToRemove); | 640 | interfaces.removeMap("map", interfaceName + "_" + profileToRemove); |
632 | } | 641 | } |
633 | } | 642 | } |
634 | interfaces.write(); | 643 | interfaces.write(); |
635 | break; | 644 | break; |
636 | } | 645 | } |
637 | } | 646 | } |
638 | } | 647 | } |
639 | } | 648 | } |
640 | 649 | ||
641 | /** | 650 | /** |
642 | * A new profile has been selected, change. | 651 | * A new profile has been selected, change. |
643 | * @param newProfile the new profile. | 652 | * @param newProfile the new profile. |
644 | */ | 653 | */ |
645 | void MainWindowImp::changeProfile() | 654 | void MainWindowImp::changeProfile() |
646 | { | 655 | { |
647 | if(profilesList->currentItem() == -1) | 656 | if(profilesList->currentItem() == -1) |
648 | { | 657 | { |
649 | QMessageBox::information(this, "Can't Change.","Please select a profile.", QMessageBox::Ok); | 658 | QMessageBox::information(this, "Can't Change.","Please select a profile.", QMessageBox::Ok); |
650 | return; | 659 | return; |
651 | } | 660 | } |
652 | QString newProfile = profilesList->text(profilesList->currentItem()); | 661 | QString newProfile = profilesList->text(profilesList->currentItem()); |
653 | if(newProfile != currentProfileLabel->text()) | 662 | if(newProfile != currentProfileLabel->text()) |
654 | { | 663 | { |
655 | currentProfileLabel->setText(newProfile); | 664 | currentProfileLabel->setText(newProfile); |
656 | QFile::remove(scheme); | 665 | QFile::remove(scheme); |
657 | QFile file(scheme); | 666 | QFile file(scheme); |
658 | if ( file.open(IO_ReadWrite) ) | 667 | if ( file.open(IO_ReadWrite) ) |
659 | { | 668 | { |
660 | QTextStream stream( &file ); | 669 | QTextStream stream( &file ); |
661 | stream << QString("SCHEME=%1").arg(newProfile); | 670 | stream << QString("SCHEME=%1").arg(newProfile); |
662 | file.close(); | 671 | file.close(); |
663 | } | 672 | } |
664 | // restart all up devices? | 673 | // restart all up devices? |
665 | if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok) | 674 | if(QMessageBox::information(this, "Question","Restart all running interfaces?", QMessageBox::Ok, QMessageBox::No) == QMessageBox::Ok) |
666 | { | 675 | { |
667 | // Go through them one by one | 676 | // Go through them one by one |
668 | QMap<Interface*, QListViewItem*>::Iterator it; | 677 | QMap<Interface*, QListViewItem*>::Iterator it; |
669 | for( it = items.begin(); it != items.end(); ++it ) | 678 | for( it = items.begin(); it != items.end(); ++it ) |
670 | { | 679 | { |
671 | if(it.key()->getStatus() == true) | 680 | if(it.key()->getStatus() == true) |
672 | it.key()->restart(); | 681 | it.key()->restart(); |
673 | } | 682 | } |
674 | } | 683 | } |
675 | } | 684 | } |
676 | // TODO change the profile in the modules | 685 | // TODO change the profile in the modules |
677 | } | 686 | } |
678 | 687 | ||
679 | 688 | ||
680 | void MainWindowImp::makeChannel() | 689 | void MainWindowImp::makeChannel() |
681 | { | 690 | { |
682 | channel = new QCopChannel( "QPE/Application/networksettings", this ); | 691 | channel = new QCopChannel( "QPE/Application/networksettings", this ); |
683 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), | 692 | connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), |
684 | this, SLOT(receive(const QCString&,const QByteArray&)) ); | 693 | this, SLOT(receive(const QCString&,const QByteArray&)) ); |
685 | } | 694 | } |
686 | 695 | ||
687 | void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) | 696 | void MainWindowImp::receive(const QCString &msg, const QByteArray &arg) |
688 | { | 697 | { |
689 | bool found = false; | 698 | bool found = false; |
690 | odebug << "MainWindowImp::receive QCop msg >"+msg+"<" << oendl; | 699 | odebug << "MainWindowImp::receive QCop msg >"+msg+"<" << oendl; |
691 | if (msg == "raise") | 700 | if (msg == "raise") |
692 | { | 701 | { |
693 | raise(); | 702 | raise(); |
694 | return; | 703 | return; |
695 | } | 704 | } |
696 | 705 | ||
697 | QString dest = msg.left(msg.find("(")); | 706 | QString dest = msg.left(msg.find("(")); |
698 | QCString param = msg.right(msg.length() - msg.find("(") - 1); | 707 | QCString param = msg.right(msg.length() - msg.find("(") - 1); |
699 | param = param.left( param.length() - 1 ); | 708 | param = param.left( param.length() - 1 ); |
700 | odebug << "dest >" << dest.latin1() << "< param >"+param+"<" << oendl; | 709 | odebug << "dest >" << dest.latin1() << "< param >"+param+"<" << oendl; |
701 | 710 | ||
702 | QMap<Module*, QLibrary*>::Iterator it; | 711 | QMap<Module*, QLibrary*>::Iterator it; |
703 | for( it = libraries.begin(); it != libraries.end(); ++it ) | 712 | for( it = libraries.begin(); it != libraries.end(); ++it ) |
704 | { | 713 | { |
705 | odebug << "plugin >" << it.key()->type().latin1() << "<" << oendl; | 714 | odebug << "plugin >" << it.key()->type().latin1() << "<" << oendl; |
706 | if(it.key()->type() == dest) | 715 | if(it.key()->type() == dest) |
707 | { | 716 | { |
708 | it.key()->receive( param, arg ); | 717 | it.key()->receive( param, arg ); |
709 | found = true; | 718 | found = true; |
710 | } | 719 | } |
711 | } | 720 | } |
712 | 721 | ||
713 | 722 | ||
714 | if (found) QPEApplication::setKeepRunning(); | 723 | if (found) QPEApplication::setKeepRunning(); |
715 | else odebug << "Huh what do ya want" << oendl; | 724 | else odebug << "Huh what do ya want" << oendl; |
716 | } | 725 | } |
726 | |||
727 | void MainWindowImp::setHostname() | ||
728 | { | ||
729 | QFile f(_HOSTFILE); | ||
730 | |||
731 | OProcess*h = new OProcess; | ||
732 | _procTemp=""; | ||
733 | *h << "hostname" << m_Nameinput->text(); | ||
734 | connect(h,SIGNAL(receivedStderr(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int))); | ||
735 | h->start(OProcess::Block,OProcess::Stderr); | ||
736 | odebug << "Got " << _procTemp << " - " << h->exitStatus() << oendl; | ||
737 | _procTemp=""; | ||
738 | delete h; | ||
739 | |||
740 | if (f.open(IO_Truncate|IO_WriteOnly)) | ||
741 | { | ||
742 | QTextStream s(&f); | ||
743 | s << m_Nameinput->text(); | ||
744 | } | ||
745 | f.close(); | ||
746 | f.setName(_IRDANAME); | ||
747 | if (f.open(IO_WriteOnly)) | ||
748 | { | ||
749 | QTextStream s(&f); | ||
750 | s << m_Nameinput->text(); | ||
751 | } | ||
752 | } | ||
753 | |||
754 | void MainWindowImp::initHostname() | ||
755 | { | ||
756 | OProcess h; | ||
757 | _procTemp=""; | ||
758 | |||
759 | h << "hostname"; | ||
760 | connect(&h,SIGNAL(receivedStdout(Opie::Core::OProcess*,char*,int)),this,SLOT(slotHostname(Opie::Core::OProcess*,char*,int))); | ||
761 | h.start(OProcess::Block,OProcess::AllOutput); | ||
762 | odebug << "Got " << _procTemp <<oendl; | ||
763 | m_Nameinput->setText(_procTemp); | ||
764 | _procTemp=""; | ||
765 | } | ||
766 | |||
767 | void MainWindowImp::slotHostname(Opie::Core::OProcess *proc, char *buffer, int buflen) | ||
768 | { | ||
769 | if (buflen < 1 || buffer==0) return; | ||
770 | char*_t = new char[buflen+1]; | ||
771 | ::memset(_t,0,buflen+1); | ||
772 | ::memcpy(_t,buffer,buflen); | ||
773 | _procTemp+=_t; | ||
774 | delete[]_t; | ||
775 | } | ||
diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.h b/noncore/settings/networksettings/mainwindow/mainwindowimp.h index f211d6e..da1bb8f 100644 --- a/noncore/settings/networksettings/mainwindow/mainwindowimp.h +++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.h | |||
@@ -1,75 +1,86 @@ | |||
1 | #ifndef MAINWINOWIMP_H | 1 | #ifndef MAINWINOWIMP_H |
2 | #define MAINWINOWIMP_H | 2 | #define MAINWINOWIMP_H |
3 | 3 | ||
4 | #include "mainwindow.h" | 4 | #include "mainwindow.h" |
5 | #include <qmap.h> | 5 | #include <qmap.h> |
6 | #include <qstringlist.h> | 6 | #include <qstringlist.h> |
7 | 7 | ||
8 | class Module; | 8 | class Module; |
9 | class Interface; | 9 | class Interface; |
10 | class QLibrary; | 10 | class QLibrary; |
11 | class KProcess; | 11 | class KProcess; |
12 | class QCopChannel; | 12 | class QCopChannel; |
13 | #ifdef QWS | 13 | #ifdef QWS |
14 | class QLibrary; | 14 | class QLibrary; |
15 | #else | 15 | #else |
16 | class KLibrary; | 16 | class KLibrary; |
17 | class KLibLoader; | 17 | class KLibLoader; |
18 | #define QLibrary KLibrary | 18 | #define QLibrary KLibrary |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | namespace Opie { | ||
22 | namespace Core { | ||
23 | class OProcess; | ||
24 | } | ||
25 | } | ||
21 | 26 | ||
22 | class MainWindowImp : public MainWindow { | 27 | class MainWindowImp : public MainWindow { |
23 | Q_OBJECT | 28 | Q_OBJECT |
24 | 29 | ||
25 | public: | 30 | public: |
26 | static QString appName() { return QString::fromLatin1("networksettings"); } | 31 | static QString appName() { return QString::fromLatin1("networksettings"); } |
27 | MainWindowImp(QWidget *parent=0, const char *name=0, WFlags fl = 0); | 32 | MainWindowImp(QWidget *parent=0, const char *name=0, WFlags fl = 0); |
28 | ~MainWindowImp(); | 33 | ~MainWindowImp(); |
29 | 34 | ||
30 | QCopChannel *channel; | 35 | QCopChannel *channel; |
31 | 36 | ||
32 | private slots: | 37 | private slots: |
33 | void getAllInterfaces(); | 38 | void getAllInterfaces(); |
34 | 39 | ||
35 | void addClicked(); | 40 | void addClicked(); |
36 | void removeClicked(); | 41 | void removeClicked(); |
37 | void configureClicked(); | 42 | void configureClicked(); |
38 | void informationClicked(); | 43 | void informationClicked(); |
39 | 44 | ||
40 | void addProfile(); | 45 | void addProfile(); |
41 | void removeProfile(); | 46 | void removeProfile(); |
42 | void changeProfile(); | 47 | void changeProfile(); |
43 | 48 | ||
44 | void updateInterface(Interface *i); | 49 | void updateInterface(Interface *i); |
45 | void newProfileChanged(const QString& newText); | 50 | void newProfileChanged(const QString& newText); |
46 | 51 | ||
47 | void receive (const QCString &, const QByteArray &); | 52 | void receive (const QCString &, const QByteArray &); |
48 | 53 | ||
54 | protected slots: | ||
55 | virtual void setHostname(); | ||
56 | virtual void slotHostname(Opie::Core::OProcess *proc, char *buffer, int buflen); | ||
57 | |||
49 | private: | 58 | private: |
50 | void makeChannel(); | 59 | void makeChannel(); |
51 | void loadModules(const QString &path); | 60 | void loadModules(const QString &path); |
61 | void initHostname(); | ||
52 | 62 | ||
53 | Module* loadPlugin(const QString &pluginFileName, | 63 | Module* loadPlugin(const QString &pluginFileName, |
54 | const QString &resolveString = "create_plugin"); | 64 | const QString &resolveString = "create_plugin"); |
55 | 65 | ||
56 | // For our local list of names | 66 | // For our local list of names |
57 | QMap<QString, Interface*> interfaceNames; | 67 | QMap<QString, Interface*> interfaceNames; |
58 | 68 | ||
59 | QMap<Module*, QLibrary*> libraries; | 69 | QMap<Module*, QLibrary*> libraries; |
60 | QMap<Interface*, QListViewItem*> items; | 70 | QMap<Interface*, QListViewItem*> items; |
61 | QMap<QListViewItem*, Interface*> interfaceItems; | 71 | QMap<QListViewItem*, Interface*> interfaceItems; |
62 | QStringList m_handledIfaces; | 72 | QStringList m_handledIfaces; |
63 | 73 | ||
64 | QMap<KProcess*, QString> threads; | 74 | QMap<KProcess*, QString> threads; |
65 | QStringList profiles; | 75 | QStringList profiles; |
66 | 76 | ||
67 | bool advancedUserMode; | 77 | bool advancedUserMode; |
68 | QString scheme; | 78 | QString scheme; |
79 | QString _procTemp; | ||
69 | #ifndef QWS | 80 | #ifndef QWS |
70 | KLibLoader *loader; | 81 | KLibLoader *loader; |
71 | #endif | 82 | #endif |
72 | }; | 83 | }; |
73 | 84 | ||
74 | #endif // MAINWINOWIMP_H | 85 | #endif // MAINWINOWIMP_H |
75 | 86 | ||