-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 25 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 29 |
2 files changed, 25 insertions, 29 deletions
diff --git a/noncore/apps/advancedfm/advancedfm.cpp b/noncore/apps/advancedfm/advancedfm.cpp index 979549d..828f5a1 100644 --- a/noncore/apps/advancedfm/advancedfm.cpp +++ b/noncore/apps/advancedfm/advancedfm.cpp @@ -14,5 +14,5 @@ #include <opie2/odebug.h> - +#include <opie2/oresource.h> #include <opie2/ostorageinfo.h> @@ -21,5 +21,4 @@ #include <qpe/mimetype.h> #include <qpe/applnk.h> -#include <qpe/resource.h> #include <qpe/menubutton.h> @@ -45,5 +44,5 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) renameBox = 0; whichTab = 1; - unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() ); + unknownXpm = Opie::Core::OResource::loadImage("UnknownDocument", Opie::Core::OResource::SmallIcon); initConnections(); @@ -137,18 +136,18 @@ void AdvancedFm::populateView() { if( !QDir( fi->filePath() ).isReadable()) //is directory - pm.convertFromImage( Resource::loadImage( "lockedfolder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + pm = Opie::Core::OResource::loadPixmap( "lockedfolder", Opie::Core::OResource::SmallIcon ); else - pm.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + pm = Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon ); } else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) { - pm.convertFromImage( Resource::loadImage( "exec" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + pm = Opie::Core::OResource::loadPixmap( "exec", Opie::Core::OResource::SmallIcon ); } else if( (fileInfo.permission( QFileInfo::ExeUser) | fileInfo.permission( QFileInfo::ExeGroup) | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) { - pm.convertFromImage( Resource::loadImage( "exec" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + pm = Opie::Core::OResource::loadPixmap( "exec", Opie::Core::OResource::SmallIcon ); } else if( !fi->isReadable() ) { - pm.convertFromImage( Resource::loadImage( "locked" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + pm = Opie::Core::OResource::loadPixmap( "locked", Opie::Core::OResource::SmallIcon ); } else { //everything else goes by mimetype @@ -161,10 +160,5 @@ void AdvancedFm::populateView() { if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { // odebug << " overlay link image" << oendl; - pm.convertFromImage( Resource::loadImage( "advancedfm/symlink" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - // pm= Resource::loadPixmap( "folder" ); -// QPixmap lnk = Resource::loadPixmap( "opie/symlink" ); -// QPainter painter( &pm ); -// painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk ); -// pm.setMask( pm.createHeuristicMask( FALSE ) ); + pm = Opie::Core::OResource::loadPixmap( "advancedfm/symlink", Opie::Core::OResource::SmallIcon ); } item->setPixmap( 0, pm ); @@ -461,5 +455,6 @@ void AdvancedFm::showFileMenu() { else if(QFileInfo(fi).isExecutable() ) //damn opie doesnt like this m->insertItem(tr("Execute"),this,SLOT(runThis())); - m->insertItem(Resource::loadPixmap("txt"),tr("Open as text"),this,SLOT(runText())); + m->insertItem( Opie::Core::OResource::loadPixmap( "txt", Opie::Core::OResource::SmallIcon ), + tr("Open as text"),this,SLOT(runText())); } diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index b43d2ba..aa9db52 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp @@ -14,8 +14,8 @@ /* OPIE */ #include <opie2/odebug.h> +#include <opie2/oresource.h> #include <qpe/applnk.h> #include <qpe/storage.h> #include <qpe/qpeapplication.h> -#include <qpe/resource.h> #include <qpe/menubutton.h> using namespace Opie::Core; @@ -53,38 +53,39 @@ void AdvancedFm::init() { menuBar->insertItem( tr( "View" ), viewMenu); - QPixmap pm; + bool useBigIcon = qApp->desktop()->size().width() > 330; + cdUpButton = new QToolButton( 0,"cdUpButton"); - pm.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - cdUpButton->setPixmap( pm ); + cdUpButton->setUsesBigPixmap( useBigIcon ); + cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); cdUpButton->setAutoRaise( true ); menuBar->insertItem( cdUpButton ); qpeDirButton= new QToolButton( 0,"QPEButton"); - pm.convertFromImage( Resource::loadImage( "logo/opielogo" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - qpeDirButton->setPixmap( pm );//,"",this,"QPEButton"); + qpeDirButton->setUsesBigPixmap( useBigIcon ); + qpeDirButton->setPixmap( Opie::Core::OResource::loadPixmap( "logo/opielogo", Opie::Core::OResource::SmallIcon ) ); qpeDirButton->setAutoRaise( true ); menuBar->insertItem( qpeDirButton ); cfButton = new QToolButton( 0, "CFButton"); - pm.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - cfButton->setPixmap( pm ); + cfButton->setUsesBigPixmap( useBigIcon ); + cfButton->setPixmap( Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ) ); cfButton->setAutoRaise( true ); menuBar->insertItem( cfButton ); sdButton = new QToolButton( 0, "SDButton"); - pm.convertFromImage( Resource::loadImage( "advancedfm/sdcard" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - sdButton->setPixmap( pm ); + sdButton->setUsesBigPixmap( useBigIcon ); + sdButton->setPixmap( Opie::Core::OResource::loadPixmap( "advancedfm/sdcard", Opie::Core::OResource::SmallIcon ) ); sdButton->setAutoRaise( true ); menuBar->insertItem( sdButton ); docButton = new QToolButton( 0,"docsButton"); - pm.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - docButton->setPixmap( pm ); + docButton->setUsesBigPixmap( useBigIcon ); + docButton->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) ); docButton->setAutoRaise( true ); menuBar->insertItem( docButton ); homeButton = new QToolButton( 0, "homeButton"); - pm.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); - homeButton->setPixmap( pm ); + homeButton->setUsesBigPixmap( useBigIcon ); + homeButton->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) ); homeButton->setAutoRaise( true ); menuBar->insertItem( homeButton ); |