summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/advancedfm/advancedfm.cpp27
-rw-r--r--noncore/apps/advancedfm/advancedfmData.cpp29
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
@@ -13,14 +13,13 @@
#include "advancedfm.h"
#include <opie2/odebug.h>
-
+#include <opie2/oresource.h>
#include <opie2/ostorageinfo.h>
#include <qpe/qpeapplication.h>
#include <qpe/config.h>
#include <qpe/mimetype.h>
#include <qpe/applnk.h>
-#include <qpe/resource.h>
#include <qpe/menubutton.h>
#include <qcombobox.h>
@@ -44,7 +43,7 @@ AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
init();
renameBox = 0;
whichTab = 1;
- unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() );
+ unknownXpm = Opie::Core::OResource::loadImage("UnknownDocument", Opie::Core::OResource::SmallIcon);
initConnections();
rePopulate();
@@ -136,20 +135,20 @@ void AdvancedFm::populateView() {
if(isDir || fileL.find("/",0,TRUE) != -1) {
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
MimeType mt(fi->filePath());
@@ -160,12 +159,7 @@ 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 );
@@ -460,7 +454,8 @@ void AdvancedFm::showFileMenu() {
m->insertItem(app->pixmap(),tr("Open in " + app->name()),this,SLOT(runThis()));
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()));
}
m->insertItem(tr("Actions"),n);
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
@@ -13,10 +13,10 @@
/* 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;
using namespace Opie::Ui;
@@ -52,40 +52,41 @@ void AdvancedFm::init() {
menuBar->insertItem( tr( "File" ), fileMenu);
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 );