Diffstat (limited to 'noncore/settings/networksettings/mainwindowimp.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/settings/networksettings/mainwindowimp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindowimp.cpp index a0b3113..4119490 100644 --- a/noncore/settings/networksettings/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindowimp.cpp | |||
@@ -450,97 +450,97 @@ void MainWindowImp::informationClicked(){ | |||
450 | QWidget *moduleInformation = i->getModuleOwner()->information(i); | 450 | QWidget *moduleInformation = i->getModuleOwner()->information(i); |
451 | if(moduleInformation != NULL){ | 451 | if(moduleInformation != NULL){ |
452 | moduleInformation->showMaximized(); | 452 | moduleInformation->showMaximized(); |
453 | #ifdef DEBUG | 453 | #ifdef DEBUG |
454 | qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed."); | 454 | qDebug("MainWindowImp::informationClicked:: Module owner has created, we showed."); |
455 | #endif | 455 | #endif |
456 | return; | 456 | return; |
457 | } | 457 | } |
458 | } | 458 | } |
459 | InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); | 459 | InterfaceInformationImp *information = new InterfaceInformationImp(this, "InterfaceSetupImp", i, Qt::WType_Modal | Qt::WDestructiveClose | Qt::WStyle_Dialog); |
460 | information->showMaximized(); | 460 | information->showMaximized(); |
461 | } | 461 | } |
462 | 462 | ||
463 | /** | 463 | /** |
464 | * Update this interface. If no QListViewItem exists create one. | 464 | * Update this interface. If no QListViewItem exists create one. |
465 | * @param Interface* pointer to the interface that needs to be updated. | 465 | * @param Interface* pointer to the interface that needs to be updated. |
466 | */ | 466 | */ |
467 | void MainWindowImp::updateInterface(Interface *i){ | 467 | void MainWindowImp::updateInterface(Interface *i){ |
468 | if(!advancedUserMode){ | 468 | if(!advancedUserMode){ |
469 | if(i->getInterfaceName() == "lo") | 469 | if(i->getInterfaceName() == "lo") |
470 | return; | 470 | return; |
471 | } | 471 | } |
472 | 472 | ||
473 | QListViewItem *item = NULL; | 473 | QListViewItem *item = NULL; |
474 | 474 | ||
475 | // Find the interface, making it if needed. | 475 | // Find the interface, making it if needed. |
476 | if(items.find(i) == items.end()){ | 476 | if(items.find(i) == items.end()){ |
477 | item = new QListViewItem(connectionList, "", "", ""); | 477 | item = new QListViewItem(connectionList, "", "", ""); |
478 | // See if you can't find a module owner for this interface | 478 | // See if you can't find a module owner for this interface |
479 | QMap<Module*, QLibrary*>::Iterator it; | 479 | QMap<Module*, QLibrary*>::Iterator it; |
480 | for( it = libraries.begin(); it != libraries.end(); ++it ){ | 480 | for( it = libraries.begin(); it != libraries.end(); ++it ){ |
481 | if(it.key()->isOwner(i)) | 481 | if(it.key()->isOwner(i)) |
482 | i->setModuleOwner(it.key()); | 482 | i->setModuleOwner(it.key()); |
483 | } | 483 | } |
484 | items.insert(i, item); | 484 | items.insert(i, item); |
485 | interfaceItems.insert(item, i); | 485 | interfaceItems.insert(item, i); |
486 | } | 486 | } |
487 | else | 487 | else |
488 | item = items[i]; | 488 | item = items[i]; |
489 | 489 | ||
490 | // Update the icons and information | 490 | // Update the icons and information |
491 | #ifdef QWS | 491 | #ifdef QWS |
492 | item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down"))); | 492 | item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down"))); |
493 | #else | 493 | #else |
494 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); | 494 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); |
495 | #endif | 495 | #endif |
496 | 496 | ||
497 | QString typeName = "lan"; | 497 | QString typeName = "lan"; |
498 | if(i->getHardwareName().contains("Local Loopback")) | 498 | if(i->getInterfaceName() == "lo") |
499 | typeName = "lo"; | 499 | typeName = "lo"; |
500 | if(i->getInterfaceName().contains("irda")) | 500 | if(i->getInterfaceName().contains("irda")) |
501 | typeName = "irda"; | 501 | typeName = "irda"; |
502 | if(i->getInterfaceName().contains("wlan")) | 502 | if(i->getInterfaceName().contains("wlan")) |
503 | typeName = "wlan"; | 503 | typeName = "wlan"; |
504 | if(i->getInterfaceName().contains("usb")) | 504 | if(i->getInterfaceName().contains("usb")) |
505 | typeName = "usb"; | 505 | typeName = "usb"; |
506 | 506 | ||
507 | if(!i->isAttached()) | 507 | if(!i->isAttached()) |
508 | typeName = "connect_no"; | 508 | typeName = "connect_no"; |
509 | // Actually try to use the Module | 509 | // Actually try to use the Module |
510 | if(i->getModuleOwner() != NULL) | 510 | if(i->getModuleOwner() != NULL) |
511 | typeName = i->getModuleOwner()->getPixmapName(i); | 511 | typeName = i->getModuleOwner()->getPixmapName(i); |
512 | 512 | ||
513 | #ifdef QWS | 513 | #ifdef QWS |
514 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); | 514 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); |
515 | #else | 515 | #else |
516 | item->setPixmap(1, (SmallIcon(typeName))); | 516 | item->setPixmap(1, (SmallIcon(typeName))); |
517 | #endif | 517 | #endif |
518 | item->setText(2, i->getHardwareName()); | 518 | item->setText(2, i->getHardwareName()); |
519 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); | 519 | item->setText(3, QString("(%1)").arg(i->getInterfaceName())); |
520 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); | 520 | item->setText(4, (i->getStatus()) ? i->getIp() : QString("")); |
521 | } | 521 | } |
522 | 522 | ||
523 | void MainWindowImp::newProfileChanged(const QString& newText){ | 523 | void MainWindowImp::newProfileChanged(const QString& newText){ |
524 | if(newText.length() > 0) | 524 | if(newText.length() > 0) |
525 | newProfileButton->setEnabled(true); | 525 | newProfileButton->setEnabled(true); |
526 | else | 526 | else |
527 | newProfileButton->setEnabled(false); | 527 | newProfileButton->setEnabled(false); |
528 | } | 528 | } |
529 | 529 | ||
530 | /** | 530 | /** |
531 | * Adds a new profile to the list of profiles. | 531 | * Adds a new profile to the list of profiles. |
532 | * Don't add profiles that already exists. | 532 | * Don't add profiles that already exists. |
533 | * Appends to the list and QStringList | 533 | * Appends to the list and QStringList |
534 | */ | 534 | */ |
535 | void MainWindowImp::addProfile(){ | 535 | void MainWindowImp::addProfile(){ |
536 | QString newProfileName = newProfile->text(); | 536 | QString newProfileName = newProfile->text(); |
537 | if(profiles.grep(newProfileName).count() > 0){ | 537 | if(profiles.grep(newProfileName).count() > 0){ |
538 | QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok); | 538 | QMessageBox::information(this, "Can't Add","Profile already exists.", QMessageBox::Ok); |
539 | return; | 539 | return; |
540 | } | 540 | } |
541 | profiles.append(newProfileName); | 541 | profiles.append(newProfileName); |
542 | profilesList->insertItem(newProfileName); | 542 | profilesList->insertItem(newProfileName); |
543 | } | 543 | } |
544 | 544 | ||
545 | /** | 545 | /** |
546 | * Removes the currently selected profile in the combo. | 546 | * Removes the currently selected profile in the combo. |