-rw-r--r-- | noncore/settings/networksettings/mainwindow.ui | 2 | ||||
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/noncore/settings/networksettings/mainwindow.ui b/noncore/settings/networksettings/mainwindow.ui index 8e17cb3..f61a1ae 100644 --- a/noncore/settings/networksettings/mainwindow.ui +++ b/noncore/settings/networksettings/mainwindow.ui | |||
@@ -81,193 +81,193 @@ | |||
81 | <name>clickable</name> | 81 | <name>clickable</name> |
82 | <bool>true</bool> | 82 | <bool>true</bool> |
83 | </property> | 83 | </property> |
84 | <property> | 84 | <property> |
85 | <name>resizeable</name> | 85 | <name>resizeable</name> |
86 | <bool>true</bool> | 86 | <bool>true</bool> |
87 | </property> | 87 | </property> |
88 | </column> | 88 | </column> |
89 | <column> | 89 | <column> |
90 | <property> | 90 | <property> |
91 | <name>text</name> | 91 | <name>text</name> |
92 | <string>Name</string> | 92 | <string>Name</string> |
93 | </property> | 93 | </property> |
94 | <property> | 94 | <property> |
95 | <name>clickable</name> | 95 | <name>clickable</name> |
96 | <bool>true</bool> | 96 | <bool>true</bool> |
97 | </property> | 97 | </property> |
98 | <property> | 98 | <property> |
99 | <name>resizeable</name> | 99 | <name>resizeable</name> |
100 | <bool>true</bool> | 100 | <bool>true</bool> |
101 | </property> | 101 | </property> |
102 | </column> | 102 | </column> |
103 | <column> | 103 | <column> |
104 | <property> | 104 | <property> |
105 | <name>text</name> | 105 | <name>text</name> |
106 | <string>in</string> | 106 | <string>in</string> |
107 | </property> | 107 | </property> |
108 | <property> | 108 | <property> |
109 | <name>clickable</name> | 109 | <name>clickable</name> |
110 | <bool>true</bool> | 110 | <bool>true</bool> |
111 | </property> | 111 | </property> |
112 | <property> | 112 | <property> |
113 | <name>resizeable</name> | 113 | <name>resizeable</name> |
114 | <bool>true</bool> | 114 | <bool>true</bool> |
115 | </property> | 115 | </property> |
116 | </column> | 116 | </column> |
117 | <column> | 117 | <column> |
118 | <property> | 118 | <property> |
119 | <name>text</name> | 119 | <name>text</name> |
120 | <string>IP</string> | 120 | <string>IP</string> |
121 | </property> | 121 | </property> |
122 | <property> | 122 | <property> |
123 | <name>clickable</name> | 123 | <name>clickable</name> |
124 | <bool>true</bool> | 124 | <bool>true</bool> |
125 | </property> | 125 | </property> |
126 | <property> | 126 | <property> |
127 | <name>resizeable</name> | 127 | <name>resizeable</name> |
128 | <bool>true</bool> | 128 | <bool>true</bool> |
129 | </property> | 129 | </property> |
130 | </column> | 130 | </column> |
131 | <property stdset="1"> | 131 | <property stdset="1"> |
132 | <name>name</name> | 132 | <name>name</name> |
133 | <cstring>connectionList</cstring> | 133 | <cstring>connectionList</cstring> |
134 | </property> | 134 | </property> |
135 | <property stdset="1"> | 135 | <property stdset="1"> |
136 | <name>allColumnsShowFocus</name> | 136 | <name>allColumnsShowFocus</name> |
137 | <bool>true</bool> | 137 | <bool>true</bool> |
138 | </property> | 138 | </property> |
139 | </widget> | 139 | </widget> |
140 | <widget> | 140 | <widget> |
141 | <class>QLayoutWidget</class> | 141 | <class>QLayoutWidget</class> |
142 | <property stdset="1"> | 142 | <property stdset="1"> |
143 | <name>name</name> | 143 | <name>name</name> |
144 | <cstring>Layout2</cstring> | 144 | <cstring>Layout2</cstring> |
145 | </property> | 145 | </property> |
146 | <property> | 146 | <property> |
147 | <name>layoutMargin</name> | 147 | <name>layoutMargin</name> |
148 | </property> | 148 | </property> |
149 | <grid> | 149 | <grid> |
150 | <property stdset="1"> | 150 | <property stdset="1"> |
151 | <name>margin</name> | 151 | <name>margin</name> |
152 | <number>5</number> | 152 | <number>5</number> |
153 | </property> | 153 | </property> |
154 | <property stdset="1"> | 154 | <property stdset="1"> |
155 | <name>spacing</name> | 155 | <name>spacing</name> |
156 | <number>6</number> | 156 | <number>6</number> |
157 | </property> | 157 | </property> |
158 | <widget row="1" column="0" > | 158 | <widget row="1" column="0" > |
159 | <class>QPushButton</class> | 159 | <class>QPushButton</class> |
160 | <property stdset="1"> | 160 | <property stdset="1"> |
161 | <name>name</name> | 161 | <name>name</name> |
162 | <cstring>addConnectionButton</cstring> | 162 | <cstring>addConnectionButton</cstring> |
163 | </property> | 163 | </property> |
164 | <property stdset="1"> | 164 | <property stdset="1"> |
165 | <name>text</name> | 165 | <name>text</name> |
166 | <string>&Add</string> | 166 | <string>&Add</string> |
167 | </property> | 167 | </property> |
168 | </widget> | 168 | </widget> |
169 | <widget row="0" column="0" > | 169 | <widget row="0" column="0" > |
170 | <class>QPushButton</class> | 170 | <class>QPushButton</class> |
171 | <property stdset="1"> | 171 | <property stdset="1"> |
172 | <name>name</name> | 172 | <name>name</name> |
173 | <cstring>informationConnectionButton</cstring> | 173 | <cstring>informationConnectionButton</cstring> |
174 | </property> | 174 | </property> |
175 | <property stdset="1"> | 175 | <property stdset="1"> |
176 | <name>text</name> | 176 | <name>text</name> |
177 | <string>&Information</string> | 177 | <string>&Start/Stop</string> |
178 | </property> | 178 | </property> |
179 | </widget> | 179 | </widget> |
180 | <widget row="0" column="1" > | 180 | <widget row="0" column="1" > |
181 | <class>QPushButton</class> | 181 | <class>QPushButton</class> |
182 | <property stdset="1"> | 182 | <property stdset="1"> |
183 | <name>name</name> | 183 | <name>name</name> |
184 | <cstring>configureConnectionButton</cstring> | 184 | <cstring>configureConnectionButton</cstring> |
185 | </property> | 185 | </property> |
186 | <property stdset="1"> | 186 | <property stdset="1"> |
187 | <name>text</name> | 187 | <name>text</name> |
188 | <string>&Configure</string> | 188 | <string>&Configure</string> |
189 | </property> | 189 | </property> |
190 | </widget> | 190 | </widget> |
191 | <widget row="1" column="1" > | 191 | <widget row="1" column="1" > |
192 | <class>QPushButton</class> | 192 | <class>QPushButton</class> |
193 | <property stdset="1"> | 193 | <property stdset="1"> |
194 | <name>name</name> | 194 | <name>name</name> |
195 | <cstring>removeConnectionButton</cstring> | 195 | <cstring>removeConnectionButton</cstring> |
196 | </property> | 196 | </property> |
197 | <property stdset="1"> | 197 | <property stdset="1"> |
198 | <name>text</name> | 198 | <name>text</name> |
199 | <string>&Remove</string> | 199 | <string>&Remove</string> |
200 | </property> | 200 | </property> |
201 | </widget> | 201 | </widget> |
202 | </grid> | 202 | </grid> |
203 | </widget> | 203 | </widget> |
204 | </vbox> | 204 | </vbox> |
205 | </widget> | 205 | </widget> |
206 | <widget> | 206 | <widget> |
207 | <class>QWidget</class> | 207 | <class>QWidget</class> |
208 | <property stdset="1"> | 208 | <property stdset="1"> |
209 | <name>name</name> | 209 | <name>name</name> |
210 | <cstring>tab</cstring> | 210 | <cstring>tab</cstring> |
211 | </property> | 211 | </property> |
212 | <attribute> | 212 | <attribute> |
213 | <name>title</name> | 213 | <name>title</name> |
214 | <string>Profiles</string> | 214 | <string>Profiles</string> |
215 | </attribute> | 215 | </attribute> |
216 | <grid> | 216 | <grid> |
217 | <property stdset="1"> | 217 | <property stdset="1"> |
218 | <name>margin</name> | 218 | <name>margin</name> |
219 | <number>11</number> | 219 | <number>11</number> |
220 | </property> | 220 | </property> |
221 | <property stdset="1"> | 221 | <property stdset="1"> |
222 | <name>spacing</name> | 222 | <name>spacing</name> |
223 | <number>6</number> | 223 | <number>6</number> |
224 | </property> | 224 | </property> |
225 | <spacer row="7" column="2" > | 225 | <spacer row="7" column="2" > |
226 | <property> | 226 | <property> |
227 | <name>name</name> | 227 | <name>name</name> |
228 | <cstring>Spacer16</cstring> | 228 | <cstring>Spacer16</cstring> |
229 | </property> | 229 | </property> |
230 | <property stdset="1"> | 230 | <property stdset="1"> |
231 | <name>orientation</name> | 231 | <name>orientation</name> |
232 | <enum>Vertical</enum> | 232 | <enum>Vertical</enum> |
233 | </property> | 233 | </property> |
234 | <property stdset="1"> | 234 | <property stdset="1"> |
235 | <name>sizeType</name> | 235 | <name>sizeType</name> |
236 | <enum>Expanding</enum> | 236 | <enum>Expanding</enum> |
237 | </property> | 237 | </property> |
238 | <property> | 238 | <property> |
239 | <name>sizeHint</name> | 239 | <name>sizeHint</name> |
240 | <size> | 240 | <size> |
241 | <width>20</width> | 241 | <width>20</width> |
242 | <height>20</height> | 242 | <height>20</height> |
243 | </size> | 243 | </size> |
244 | </property> | 244 | </property> |
245 | </spacer> | 245 | </spacer> |
246 | <widget row="0" column="1" > | 246 | <widget row="0" column="1" > |
247 | <class>QLabel</class> | 247 | <class>QLabel</class> |
248 | <property stdset="1"> | 248 | <property stdset="1"> |
249 | <name>name</name> | 249 | <name>name</name> |
250 | <cstring>currentProfileLabel</cstring> | 250 | <cstring>currentProfileLabel</cstring> |
251 | </property> | 251 | </property> |
252 | <property stdset="1"> | 252 | <property stdset="1"> |
253 | <name>frameShape</name> | 253 | <name>frameShape</name> |
254 | <enum>Panel</enum> | 254 | <enum>Panel</enum> |
255 | </property> | 255 | </property> |
256 | <property stdset="1"> | 256 | <property stdset="1"> |
257 | <name>frameShadow</name> | 257 | <name>frameShadow</name> |
258 | <enum>Sunken</enum> | 258 | <enum>Sunken</enum> |
259 | </property> | 259 | </property> |
260 | <property stdset="1"> | 260 | <property stdset="1"> |
261 | <name>text</name> | 261 | <name>text</name> |
262 | <string>All</string> | 262 | <string>All</string> |
263 | </property> | 263 | </property> |
264 | </widget> | 264 | </widget> |
265 | <widget row="3" column="2" > | 265 | <widget row="3" column="2" > |
266 | <class>QPushButton</class> | 266 | <class>QPushButton</class> |
267 | <property stdset="1"> | 267 | <property stdset="1"> |
268 | <name>name</name> | 268 | <name>name</name> |
269 | <cstring>setCurrentProfileButton</cstring> | 269 | <cstring>setCurrentProfileButton</cstring> |
270 | </property> | 270 | </property> |
271 | <property stdset="1"> | 271 | <property stdset="1"> |
272 | <name>text</name> | 272 | <name>text</name> |
273 | <string>&Set Current</string> | 273 | <string>&Set Current</string> |
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index 56bbd2c..a61f620 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp | |||
@@ -327,196 +327,196 @@ void MainWindowImp::addClicked(){ | |||
327 | if(list.count() == 0){ | 327 | if(list.count() == 0){ |
328 | QMessageBox::information(this, "Sorry", "Nothing to add.", QMessageBox::Ok); | 328 | QMessageBox::information(this, "Sorry", "Nothing to add.", QMessageBox::Ok); |
329 | return; | 329 | return; |
330 | } | 330 | } |
331 | AddConnectionImp addNewConnection(this, "AddConnectionImp", true); | 331 | AddConnectionImp addNewConnection(this, "AddConnectionImp", true); |
332 | addNewConnection.addConnections(list); | 332 | addNewConnection.addConnections(list); |
333 | addNewConnection.showMaximized(); | 333 | addNewConnection.showMaximized(); |
334 | if(QDialog::Accepted == addNewConnection.exec()){ | 334 | if(QDialog::Accepted == addNewConnection.exec()){ |
335 | QListViewItem *item = addNewConnection.registeredServicesList->currentItem(); | 335 | QListViewItem *item = addNewConnection.registeredServicesList->currentItem(); |
336 | if(!item) | 336 | if(!item) |
337 | return; | 337 | return; |
338 | 338 | ||
339 | for( it = libraries.begin(); it != libraries.end(); ++it ){ | 339 | for( it = libraries.begin(); it != libraries.end(); ++it ){ |
340 | if(it.key()){ | 340 | if(it.key()){ |
341 | Interface *i = (it.key())->addNewInterface(item->text(0)); | 341 | Interface *i = (it.key())->addNewInterface(item->text(0)); |
342 | if(i){ | 342 | if(i){ |
343 | qDebug("iface name %s",i->getInterfaceName().latin1()); | 343 | qDebug("iface name %s",i->getInterfaceName().latin1()); |
344 | interfaceNames.insert(i->getInterfaceName(), i); | 344 | interfaceNames.insert(i->getInterfaceName(), i); |
345 | updateInterface(i); | 345 | updateInterface(i); |
346 | } | 346 | } |
347 | } | 347 | } |
348 | } | 348 | } |
349 | } | 349 | } |
350 | } | 350 | } |
351 | 351 | ||
352 | /** | 352 | /** |
353 | * Prompt the user to see if they really want to do this. | 353 | * Prompt the user to see if they really want to do this. |
354 | * If they do then remove from the list and unload. | 354 | * If they do then remove from the list and unload. |
355 | */ | 355 | */ |
356 | void MainWindowImp::removeClicked(){ | 356 | void MainWindowImp::removeClicked(){ |
357 | QListViewItem *item = connectionList->currentItem(); | 357 | QListViewItem *item = connectionList->currentItem(); |
358 | if(!item) { | 358 | if(!item) { |
359 | QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); | 359 | QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); |
360 | return; | 360 | return; |
361 | } | 361 | } |
362 | 362 | ||
363 | Interface *i = interfaceItems[item]; | 363 | Interface *i = interfaceItems[item]; |
364 | if(i->getModuleOwner() == NULL){ | 364 | if(i->getModuleOwner() == NULL){ |
365 | QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", QMessageBox::Ok); | 365 | QMessageBox::information(this, "Can't remove interface.", "Interface is built in.", QMessageBox::Ok); |
366 | } | 366 | } |
367 | else{ | 367 | else{ |
368 | if(!i->getModuleOwner()->remove(i)) | 368 | if(!i->getModuleOwner()->remove(i)) |
369 | QMessageBox::information(this, "Error", "Unable to remove.", QMessageBox::Ok); | 369 | QMessageBox::information(this, "Error", "Unable to remove.", QMessageBox::Ok); |
370 | else{ | 370 | else{ |
371 | QMessageBox::information(this, "Success", "Interface was removed.", QMessageBox::Ok); | 371 | QMessageBox::information(this, "Success", "Interface was removed.", QMessageBox::Ok); |
372 | // TODO memory managment.... | 372 | // TODO memory managment.... |
373 | // who deletes the interface? | 373 | // who deletes the interface? |
374 | } | 374 | } |
375 | } | 375 | } |
376 | } | 376 | } |
377 | 377 | ||
378 | /** | 378 | /** |
379 | * Pull up the configure about the currently selected interface. | 379 | * Pull up the configure about the currently selected interface. |
380 | * Report an error if no interface is selected. | 380 | * Report an error if no interface is selected. |
381 | * If the interface has a module owner then request its configure. | 381 | * If the interface has a module owner then request its configure. |
382 | */ | 382 | */ |
383 | void MainWindowImp::configureClicked(){ | 383 | void MainWindowImp::configureClicked(){ |
384 | QListViewItem *item = connectionList->currentItem(); | 384 | QListViewItem *item = connectionList->currentItem(); |
385 | if(!item){ | 385 | if(!item){ |
386 | QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok); | 386 | QMessageBox::information(this, "Sorry","Please select an interface first.", QMessageBox::Ok); |
387 | return; | 387 | return; |
388 | } | 388 | } |
389 | 389 | ||
390 | QString currentProfileText = currentProfileLabel->text(); | 390 | QString currentProfileText = currentProfileLabel->text(); |
391 | if(currentProfileText.upper() == "ALL"); | 391 | if(currentProfileText.upper() == "ALL"); |
392 | currentProfileText = ""; | 392 | currentProfileText = ""; |
393 | 393 | ||
394 | Interface *i = interfaceItems[item]; | 394 | Interface *i = interfaceItems[item]; |
395 | 395 | ||
396 | if(i->getModuleOwner()){ | 396 | if(i->getModuleOwner()){ |
397 | QWidget *moduleConfigure = i->getModuleOwner()->configure(i); | 397 | QWidget *moduleConfigure = i->getModuleOwner()->configure(i); |
398 | if(moduleConfigure != NULL){ | 398 | if(moduleConfigure != NULL){ |
399 | i->getModuleOwner()->setProfile(currentProfileText); | 399 | i->getModuleOwner()->setProfile(currentProfileText); |
400 | moduleConfigure->showMaximized(); | 400 | moduleConfigure->showMaximized(); |
401 | return; | 401 | return; |
402 | } | 402 | } |
403 | } | 403 | } |
404 | 404 | ||
405 | InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WDestructiveClose ); | 405 | InterfaceSetupImpDialog *configure = new InterfaceSetupImpDialog(this, "InterfaceSetupImp", i, true, Qt::WDestructiveClose ); |
406 | configure->setProfile(currentProfileText); | 406 | configure->setProfile(currentProfileText); |
407 | configure->showMaximized(); | 407 | configure->showMaximized(); |
408 | } | 408 | } |
409 | 409 | ||
410 | /** | 410 | /** |
411 | * Pull up the information about the currently selected interface. | 411 | * Pull up the information about the currently selected interface. |
412 | * Report an error if no interface is selected. | 412 | * Report an error if no interface is selected. |
413 | * If the interface has a module owner then request its configure. | 413 | * If the interface has a module owner then request its configure. |
414 | */ | 414 | */ |
415 | void MainWindowImp::informationClicked(){ | 415 | void MainWindowImp::informationClicked(){ |
416 | QListViewItem *item = connectionList->currentItem(); | 416 | QListViewItem *item = connectionList->currentItem(); |
417 | if(!item){ | 417 | if(!item){ |
418 | QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); | 418 | QMessageBox::information(this, "Sorry","Please select an interface First.", QMessageBox::Ok); |
419 | return; | 419 | return; |
420 | } | 420 | } |
421 | 421 | ||
422 | Interface *i = interfaceItems[item]; | 422 | Interface *i = interfaceItems[item]; |
423 | if(!i->isAttached()){ | 423 | // if(!i->isAttached()){ |
424 | QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok); | 424 | // QMessageBox::information(this, "Sorry","No information about\na disconnected interface.", QMessageBox::Ok); |
425 | return; | 425 | // return; |
426 | } | 426 | // } |
427 | 427 | ||
428 | if(i->getModuleOwner()){ | 428 | if(i->getModuleOwner()){ |
429 | QWidget *moduleInformation = i->getModuleOwner()->information(i); | 429 | QWidget *moduleInformation = i->getModuleOwner()->information(i); |
430 | if(moduleInformation != NULL){ | 430 | if(moduleInformation != NULL){ |
431 | moduleInformation->showMaximized(); | 431 | moduleInformation->showMaximized(); |
432 | #ifdef DEBUG | 432 | #ifdef DEBUG |
433 | qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed."); | 433 | qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed."); |
434 | #endif | 434 | #endif |
435 | return; | 435 | return; |
436 | } | 436 | } |
437 | } | 437 | } |
438 | InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); | 438 | InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); |
439 | information->showMaximized(); | 439 | information->showMaximized(); |
440 | } | 440 | } |
441 | 441 | ||
442 | /** | 442 | /** |
443 | * Update this interface. If no QListViewItem exists create one. | 443 | * Update this interface. If no QListViewItem exists create one. |
444 | * @param Interface* pointer to the interface that needs to be updated. | 444 | * @param Interface* pointer to the interface that needs to be updated. |
445 | */ | 445 | */ |
446 | void MainWindowImp::updateInterface(Interface *i){ | 446 | void MainWindowImp::updateInterface(Interface *i){ |
447 | if(!advancedUserMode){ | 447 | if(!advancedUserMode){ |
448 | if(i->getInterfaceName() == "lo") | 448 | if(i->getInterfaceName() == "lo") |
449 | return; | 449 | return; |
450 | } | 450 | } |
451 | 451 | ||
452 | QListViewItem *item = NULL; | 452 | QListViewItem *item = NULL; |
453 | 453 | ||
454 | // Find the interface, making it if needed. | 454 | // Find the interface, making it if needed. |
455 | if(items.find(i) == items.end()){ | 455 | if(items.find(i) == items.end()){ |
456 | item = new QListViewItem(connectionList, "", "", ""); | 456 | item = new QListViewItem(connectionList, "", "", ""); |
457 | // See if you can't find a module owner for this interface | 457 | // See if you can't find a module owner for this interface |
458 | QMap<Module*, QLibrary*>::Iterator it; | 458 | QMap<Module*, QLibrary*>::Iterator it; |
459 | for( it = libraries.begin(); it != libraries.end(); ++it ){ | 459 | for( it = libraries.begin(); it != libraries.end(); ++it ){ |
460 | if(it.key()->isOwner(i)) | 460 | if(it.key()->isOwner(i)) |
461 | i->setModuleOwner(it.key()); | 461 | i->setModuleOwner(it.key()); |
462 | } | 462 | } |
463 | items.insert(i, item); | 463 | items.insert(i, item); |
464 | interfaceItems.insert(item, i); | 464 | interfaceItems.insert(item, i); |
465 | } | 465 | } |
466 | else | 466 | else |
467 | item = items[i]; | 467 | item = items[i]; |
468 | 468 | ||
469 | // Update the icons and information | 469 | // Update the icons and information |
470 | #ifdef QWS | 470 | #ifdef QWS |
471 | item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down"))); | 471 | item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down"))); |
472 | #else | 472 | #else |
473 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); | 473 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); |
474 | #endif | 474 | #endif |
475 | 475 | ||
476 | QString typeName = "lan"; | 476 | QString typeName = "lan"; |
477 | if(i->getHardwareName().contains("Local Loopback")) | 477 | if(i->getHardwareName().contains("Local Loopback")) |
478 | typeName = "lo"; | 478 | typeName = "lo"; |
479 | if(i->getInterfaceName().contains("irda")) | 479 | if(i->getInterfaceName().contains("irda")) |
480 | typeName = "irda"; | 480 | typeName = "irda"; |
481 | if(i->getInterfaceName().contains("wlan")) | 481 | if(i->getInterfaceName().contains("wlan")) |
482 | typeName = "wlan"; | 482 | typeName = "wlan"; |
483 | if(i->getInterfaceName().contains("usb")) | 483 | if(i->getInterfaceName().contains("usb")) |
484 | typeName = "usb"; | 484 | typeName = "usb"; |
485 | 485 | ||
486 | if(!i->isAttached()) | 486 | if(!i->isAttached()) |
487 | typeName = "connect_no"; | 487 | typeName = "connect_no"; |
488 | // Actually try to use the Module | 488 | // Actually try to use the Module |
489 | if(i->getModuleOwner() != NULL) | 489 | if(i->getModuleOwner() != NULL) |
490 | typeName = i->getModuleOwner()->getPixmapName(i); | 490 | typeName = i->getModuleOwner()->getPixmapName(i); |
491 | 491 | ||
492 | #ifdef QWS | 492 | #ifdef QWS |
493 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); | 493 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); |
494 | #else | 494 | #else |
495 | item->setPixmap(1, (SmallIcon(typeName))); | 495 | item->setPixmap(1, (SmallIcon(typeName))); |
496 | #endif | 496 | #endif |
497 | item->setText(2, i->getHardwareName()); | 497 | item->setText(2, i->getHardwareName()); |
498 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); | 498 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); |
499 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); | 499 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); |
500 | } | 500 | } |
501 | 501 | ||
502 | void MainWindowImp::newProfileChanged(const QString& newText){ | 502 | void MainWindowImp::newProfileChanged(const QString& newText){ |
503 | if(newText.length() > 0) | 503 | if(newText.length() > 0) |
504 | newProfileButton->setEnabled(true); | 504 | newProfileButton->setEnabled(true); |
505 | else | 505 | else |
506 | newProfileButton->setEnabled(false); | 506 | newProfileButton->setEnabled(false); |
507 | } | 507 | } |
508 | 508 | ||
509 | /** | 509 | /** |
510 | * Adds a new profile to the list of profiles. | 510 | * Adds a new profile to the list of profiles. |
511 | * Don't add profiles that already exists. | 511 | * Don't add profiles that already exists. |
512 | * Appends to the list and QStringList | 512 | * Appends to the list and QStringList |
513 | */ | 513 | */ |
514 | void MainWindowImp::addProfile(){ | 514 | void MainWindowImp::addProfile(){ |
515 | QString newProfileName = newProfile->text(); | 515 | QString newProfileName = newProfile->text(); |
516 | if(profiles.grep(newProfileName).count() > 0){ | 516 | if(profiles.grep(newProfileName).count() > 0){ |
517 | QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok); | 517 | QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok); |
518 | return; | 518 | return; |
519 | } | 519 | } |
520 | profiles.append(newProfileName); | 520 | profiles.append(newProfileName); |
521 | profilesList->insertItem(newProfileName); | 521 | profilesList->insertItem(newProfileName); |
522 | } | 522 | } |