author | drw <drw> | 2005-05-16 20:38:10 (UTC) |
---|---|---|
committer | drw <drw> | 2005-05-16 20:38:10 (UTC) |
commit | 28503944437feb62c0f2c0a8314385bbca3e9eaf (patch) (side-by-side diff) | |
tree | 2b613d2b1bde21bf3e002bb4dc8c474c4d781fe1 | |
parent | 348314c7411500e23ca467289ed92e446be9121b (diff) | |
download | opie-28503944437feb62c0f2c0a8314385bbca3e9eaf.zip opie-28503944437feb62c0f2c0a8314385bbca3e9eaf.tar.gz opie-28503944437feb62c0f2c0a8314385bbca3e9eaf.tar.bz2 |
Resource -> OResource
-rw-r--r-- | noncore/apps/advancedfm/advancedfm.cpp | 27 | ||||
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 29 |
2 files changed, 26 insertions, 30 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 @@ -15,3 +15,3 @@ #include <opie2/odebug.h> - +#include <opie2/oresource.h> #include <opie2/ostorageinfo.h> @@ -22,3 +22,2 @@ #include <qpe/applnk.h> -#include <qpe/resource.h> #include <qpe/menubutton.h> @@ -46,3 +45,3 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) whichTab = 1; - unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() ); + unknownXpm = Opie::Core::OResource::loadImage("UnknownDocument", Opie::Core::OResource::SmallIcon); @@ -138,8 +137,8 @@ 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 ); } @@ -148,6 +147,6 @@ void AdvancedFm::populateView() { | 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 ); } @@ -162,8 +161,3 @@ void AdvancedFm::populateView() { // 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 ); } @@ -462,3 +456,4 @@ void AdvancedFm::showFileMenu() { 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 @@ -15,2 +15,3 @@ #include <opie2/odebug.h> +#include <opie2/oresource.h> #include <qpe/applnk.h> @@ -18,3 +19,2 @@ #include <qpe/qpeapplication.h> -#include <qpe/resource.h> #include <qpe/menubutton.h> @@ -54,6 +54,7 @@ void AdvancedFm::init() { - 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 ); @@ -62,4 +63,4 @@ void AdvancedFm::init() { 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 ); @@ -68,4 +69,4 @@ void AdvancedFm::init() { 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 ); @@ -74,4 +75,4 @@ void AdvancedFm::init() { 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 ); @@ -80,4 +81,4 @@ void AdvancedFm::init() { 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 ); @@ -86,4 +87,4 @@ void AdvancedFm::init() { 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 ); |