author | drw <drw> | 2005-03-04 22:07:55 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-04 22:07:55 (UTC) |
commit | 206e91c510caba81f41704f11b097307d8daa6cb (patch) (unidiff) | |
tree | 6170fc7285ca6d5e0cc3574df1768770277e1217 | |
parent | 9df83023cf5db974ba78b7b562be019791052f2f (diff) | |
download | opie-206e91c510caba81f41704f11b097307d8daa6cb.zip opie-206e91c510caba81f41704f11b097307d8daa6cb.tar.gz opie-206e91c510caba81f41704f11b097307d8daa6cb.tar.bz2 |
Scale icons appropriately
-rw-r--r-- | noncore/settings/networksettings/mainwindow/mainwindowimp.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp index 8feb7a5..f83e370 100644 --- a/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp +++ b/noncore/settings/networksettings/mainwindow/mainwindowimp.cpp | |||
@@ -1,34 +1,35 @@ | |||
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 <qpe/applnk.h> | ||
11 | #include <qpe/qcopenvelope_qws.h> | 12 | #include <qpe/qcopenvelope_qws.h> |
12 | #include <qpe/qpeapplication.h> | 13 | #include <qpe/qpeapplication.h> |
13 | #include <qpe/config.h> | 14 | #include <qpe/config.h> |
14 | #include <qpe/qlibrary.h> | 15 | #include <qpe/qlibrary.h> |
15 | #include <qpe/resource.h> | 16 | #include <qpe/resource.h> |
16 | 17 | ||
17 | /* QT */ | 18 | /* QT */ |
18 | #include <qpushbutton.h> | 19 | #include <qpushbutton.h> |
19 | #include <qlistbox.h> | 20 | #include <qlistbox.h> |
20 | #include <qlineedit.h> | 21 | #include <qlineedit.h> |
21 | #include <qlistview.h> | 22 | #include <qlistview.h> |
22 | #include <qheader.h> | 23 | #include <qheader.h> |
23 | #include <qlabel.h> | 24 | #include <qlabel.h> |
24 | #include <qtabwidget.h> // in order to disable the profiles tab | 25 | #include <qtabwidget.h> // in order to disable the profiles tab |
25 | #include <qmessagebox.h> | 26 | #include <qmessagebox.h> |
26 | 27 | ||
27 | 28 | ||
28 | #if QT_VERSION < 0x030000 | 29 | #if QT_VERSION < 0x030000 |
29 | #include <qlist.h> | 30 | #include <qlist.h> |
30 | #else | 31 | #else |
31 | #include <qptrlist.h> | 32 | #include <qptrlist.h> |
32 | #endif | 33 | #endif |
33 | #include <qdir.h> | 34 | #include <qdir.h> |
34 | #include <qfile.h> | 35 | #include <qfile.h> |
@@ -499,49 +500,51 @@ void MainWindowImp::updateInterface(Interface *i) | |||
499 | return; | 500 | return; |
500 | } | 501 | } |
501 | 502 | ||
502 | QListViewItem *item = NULL; | 503 | QListViewItem *item = NULL; |
503 | 504 | ||
504 | // Find the interface, making it if needed. | 505 | // Find the interface, making it if needed. |
505 | if(items.find(i) == items.end()) | 506 | if(items.find(i) == items.end()) |
506 | { | 507 | { |
507 | item = new QListViewItem(connectionList, "", "", ""); | 508 | item = new QListViewItem(connectionList, "", "", ""); |
508 | // See if you can't find a module owner for this interface | 509 | // See if you can't find a module owner for this interface |
509 | QMap<Module*, QLibrary*>::Iterator it; | 510 | QMap<Module*, QLibrary*>::Iterator it; |
510 | for( it = libraries.begin(); it != libraries.end(); ++it ) | 511 | for( it = libraries.begin(); it != libraries.end(); ++it ) |
511 | { | 512 | { |
512 | if(it.key()->isOwner(i)) | 513 | if(it.key()->isOwner(i)) |
513 | i->setModuleOwner(it.key()); | 514 | i->setModuleOwner(it.key()); |
514 | } | 515 | } |
515 | items.insert(i, item); | 516 | items.insert(i, item); |
516 | interfaceItems.insert(item, i); | 517 | interfaceItems.insert(item, i); |
517 | } | 518 | } |
518 | else | 519 | else |
519 | item = items[i]; | 520 | item = items[i]; |
520 | 521 | ||
521 | // Update the icons and information | 522 | // Update the icons and information |
522 | #ifdef QWS | 523 | #ifdef QWS |
523 | item->setPixmap(0, (Resource::loadPixmap(i->getStatus() ? "up": "down"))); | 524 | QPixmap pic; |
525 | pic.convertFromImage( Resource::loadImage( i->getStatus() ? "up": "down" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
526 | item->setPixmap(0, ( pic )); | ||
524 | #else | 527 | #else |
525 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); | 528 | item->setPixmap(0, (SmallIcon(i->getStatus() ? "up": "down"))); |
526 | #endif | 529 | #endif |
527 | 530 | ||
528 | QString typeName = "lan"; | 531 | QString typeName = "lan"; |
529 | if(i->getInterfaceName() == "lo") | 532 | if(i->getInterfaceName() == "lo") |
530 | typeName = "lo"; | 533 | typeName = "lo"; |
531 | if(i->getInterfaceName().contains("irda")) | 534 | if(i->getInterfaceName().contains("irda")) |
532 | typeName = "irda"; | 535 | typeName = "irda"; |
533 | if(i->getInterfaceName().contains("wlan")) | 536 | if(i->getInterfaceName().contains("wlan")) |
534 | typeName = "wlan"; | 537 | typeName = "wlan"; |
535 | if(i->getInterfaceName().contains("usb")) | 538 | if(i->getInterfaceName().contains("usb")) |
536 | typeName = "usb"; | 539 | typeName = "usb"; |
537 | 540 | ||
538 | if(!i->isAttached()) | 541 | if(!i->isAttached()) |
539 | typeName = "connect_no"; | 542 | typeName = "connect_no"; |
540 | // Actually try to use the Module | 543 | // Actually try to use the Module |
541 | if(i->getModuleOwner() != NULL) | 544 | if(i->getModuleOwner() != NULL) |
542 | typeName = i->getModuleOwner()->getPixmapName(i); | 545 | typeName = i->getModuleOwner()->getPixmapName(i); |
543 | 546 | ||
544 | #ifdef QWS | 547 | #ifdef QWS |
545 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); | 548 | item->setPixmap(1, (Resource::loadPixmap(QString("networksettings/") + typeName))); |
546 | #else | 549 | #else |
547 | item->setPixmap(1, (SmallIcon(typeName))); | 550 | item->setPixmap(1, (SmallIcon(typeName))); |