summaryrefslogtreecommitdiff
path: root/noncore
Unidiff
Diffstat (limited to 'noncore') (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
@@ -10,20 +10,19 @@
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#define DEVELOPERS_VERSION 12#define DEVELOPERS_VERSION
13#include "advancedfm.h" 13#include "advancedfm.h"
14 14
15#include <opie2/odebug.h> 15#include <opie2/odebug.h>
16 16#include <opie2/oresource.h>
17#include <opie2/ostorageinfo.h> 17#include <opie2/ostorageinfo.h>
18 18
19#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
20#include <qpe/config.h> 20#include <qpe/config.h>
21#include <qpe/mimetype.h> 21#include <qpe/mimetype.h>
22#include <qpe/applnk.h> 22#include <qpe/applnk.h>
23#include <qpe/resource.h>
24#include <qpe/menubutton.h> 23#include <qpe/menubutton.h>
25 24
26#include <qcombobox.h> 25#include <qcombobox.h>
27#include <qpopupmenu.h> 26#include <qpopupmenu.h>
28#include <qlistview.h> 27#include <qlistview.h>
29#include <qmessagebox.h> 28#include <qmessagebox.h>
@@ -41,13 +40,13 @@ using namespace Opie::Ui;
41 40
42AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags ) 41AdvancedFm::AdvancedFm(QWidget *,const char*, WFlags )
43 : QMainWindow( ) { 42 : QMainWindow( ) {
44 init(); 43 init();
45 renameBox = 0; 44 renameBox = 0;
46 whichTab = 1; 45 whichTab = 1;
47 unknownXpm = Resource::loadImage("UnknownDocument").smoothScale(AppLnk::smallIconSize(),AppLnk::smallIconSize() ); 46 unknownXpm = Opie::Core::OResource::loadImage("UnknownDocument", Opie::Core::OResource::SmallIcon);
48 47
49 initConnections(); 48 initConnections();
50 rePopulate(); 49 rePopulate();
51 channel = new QCopChannel( "QPE/Application/advancedfm", this ); 50 channel = new QCopChannel( "QPE/Application/advancedfm", this );
52 connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&))); 51 connect(channel,SIGNAL(received(const QCString&,const QByteArray&)),this,SLOT(qcopReceive(const QCString&,const QByteArray&)));
53 switchToLocalTab(); 52 switchToLocalTab();
@@ -133,42 +132,37 @@ void AdvancedFm::populateView() {
133 if(fileL !="./" && fi->exists()) { 132 if(fileL !="./" && fi->exists()) {
134 item = new QListViewItem( thisView, fileL, fileS , fileDate); 133 item = new QListViewItem( thisView, fileL, fileS , fileDate);
135 134
136 if(isDir || fileL.find("/",0,TRUE) != -1) { 135 if(isDir || fileL.find("/",0,TRUE) != -1) {
137 136
138 if( !QDir( fi->filePath() ).isReadable()) //is directory 137 if( !QDir( fi->filePath() ).isReadable()) //is directory
139 pm.convertFromImage( Resource::loadImage( "lockedfolder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 138 pm = Opie::Core::OResource::loadPixmap( "lockedfolder", Opie::Core::OResource::SmallIcon );
140 else 139 else
141 pm.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 140 pm = Opie::Core::OResource::loadPixmap( "folder", Opie::Core::OResource::SmallIcon );
142 } 141 }
143 else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) { 142 else if ( fs == "vfat" && fileInfo.filePath().contains("/bin") ) {
144 pm.convertFromImage( Resource::loadImage( "exec" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 143 pm = Opie::Core::OResource::loadPixmap( "exec", Opie::Core::OResource::SmallIcon );
145 } 144 }
146 else if( (fileInfo.permission( QFileInfo::ExeUser) 145 else if( (fileInfo.permission( QFileInfo::ExeUser)
147 | fileInfo.permission( QFileInfo::ExeGroup) 146 | fileInfo.permission( QFileInfo::ExeGroup)
148 | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) { 147 | fileInfo.permission( QFileInfo::ExeOther)) && fs != "vfat" ) {
149 pm.convertFromImage( Resource::loadImage( "exec" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 148 pm = Opie::Core::OResource::loadPixmap( "exec", Opie::Core::OResource::SmallIcon );
150 } 149 }
151 else if( !fi->isReadable() ) { 150 else if( !fi->isReadable() ) {
152 pm.convertFromImage( Resource::loadImage( "locked" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 151 pm = Opie::Core::OResource::loadPixmap( "locked", Opie::Core::OResource::SmallIcon );
153 } 152 }
154 else { //everything else goes by mimetype 153 else { //everything else goes by mimetype
155 MimeType mt(fi->filePath()); 154 MimeType mt(fi->filePath());
156 pm=mt.pixmap(); //sets the correct pixmap for mimetype 155 pm=mt.pixmap(); //sets the correct pixmap for mimetype
157 if(pm.isNull()) { 156 if(pm.isNull()) {
158 pm = unknownXpm; 157 pm = unknownXpm;
159 } 158 }
160 } 159 }
161 if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) { 160 if( fi->isSymLink() || fileL.find("->",0,TRUE) != -1) {
162 // odebug << " overlay link image" << oendl; 161 // odebug << " overlay link image" << oendl;
163 pm.convertFromImage( Resource::loadImage( "advancedfm/symlink" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 162 pm = Opie::Core::OResource::loadPixmap( "advancedfm/symlink", Opie::Core::OResource::SmallIcon );
164 // pm= Resource::loadPixmap( "folder" );
165// QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
166// QPainter painter( &pm );
167// painter.drawPixmap( pm.width()-lnk.width(), pm.height()-lnk.height(), lnk );
168// pm.setMask( pm.createHeuristicMask( FALSE ) );
169 } 163 }
170 item->setPixmap( 0, pm ); 164 item->setPixmap( 0, pm );
171 165
172 } 166 }
173 isDir=FALSE; 167 isDir=FALSE;
174 ++it; 168 ++it;
@@ -457,13 +451,14 @@ void AdvancedFm::showFileMenu() {
457 } else { 451 } else {
458 452
459 if (app) 453 if (app)
460 m->insertItem(app->pixmap(),tr("Open in " + app->name()),this,SLOT(runThis())); 454 m->insertItem(app->pixmap(),tr("Open in " + app->name()),this,SLOT(runThis()));
461 else if(QFileInfo(fi).isExecutable() ) //damn opie doesnt like this 455 else if(QFileInfo(fi).isExecutable() ) //damn opie doesnt like this
462 m->insertItem(tr("Execute"),this,SLOT(runThis())); 456 m->insertItem(tr("Execute"),this,SLOT(runThis()));
463 m->insertItem(Resource::loadPixmap("txt"),tr("Open as text"),this,SLOT(runText())); 457 m->insertItem( Opie::Core::OResource::loadPixmap( "txt", Opie::Core::OResource::SmallIcon ),
458 tr("Open as text"),this,SLOT(runText()));
464 } 459 }
465 460
466 m->insertItem(tr("Actions"),n); 461 m->insertItem(tr("Actions"),n);
467 n->insertItem(tr("Make Directory"),this,SLOT(makeDir())); 462 n->insertItem(tr("Make Directory"),this,SLOT(makeDir()));
468 463
469 n->insertItem(tr("Make Symlink"),this,SLOT(mkSym())); 464 n->insertItem(tr("Make Symlink"),this,SLOT(mkSym()));
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
@@ -10,16 +10,16 @@
10 * (at your option) any later version. * 10 * (at your option) any later version. *
11 ***************************************************************************/ 11 ***************************************************************************/
12#include "advancedfm.h" 12#include "advancedfm.h"
13 13
14/* OPIE */ 14/* OPIE */
15#include <opie2/odebug.h> 15#include <opie2/odebug.h>
16#include <opie2/oresource.h>
16#include <qpe/applnk.h> 17#include <qpe/applnk.h>
17#include <qpe/storage.h> 18#include <qpe/storage.h>
18#include <qpe/qpeapplication.h> 19#include <qpe/qpeapplication.h>
19#include <qpe/resource.h>
20#include <qpe/menubutton.h> 20#include <qpe/menubutton.h>
21using namespace Opie::Core; 21using namespace Opie::Core;
22using namespace Opie::Ui; 22using namespace Opie::Ui;
23 23
24/* QT */ 24/* QT */
25#include <qlayout.h> 25#include <qlayout.h>
@@ -49,46 +49,47 @@ void AdvancedFm::init() {
49 49
50 layout->addWidget( menuBar ); 50 layout->addWidget( menuBar );
51 51
52 menuBar->insertItem( tr( "File" ), fileMenu); 52 menuBar->insertItem( tr( "File" ), fileMenu);
53 menuBar->insertItem( tr( "View" ), viewMenu); 53 menuBar->insertItem( tr( "View" ), viewMenu);
54 54
55 QPixmap pm; 55 bool useBigIcon = qApp->desktop()->size().width() > 330;
56
56 cdUpButton = new QToolButton( 0,"cdUpButton"); 57 cdUpButton = new QToolButton( 0,"cdUpButton");
57 pm.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 58 cdUpButton->setUsesBigPixmap( useBigIcon );
58 cdUpButton->setPixmap( pm ); 59 cdUpButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) );
59 cdUpButton->setAutoRaise( true ); 60 cdUpButton->setAutoRaise( true );
60 menuBar->insertItem( cdUpButton ); 61 menuBar->insertItem( cdUpButton );
61 62
62 qpeDirButton= new QToolButton( 0,"QPEButton"); 63 qpeDirButton= new QToolButton( 0,"QPEButton");
63 pm.convertFromImage( Resource::loadImage( "logo/opielogo" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 64 qpeDirButton->setUsesBigPixmap( useBigIcon );
64 qpeDirButton->setPixmap( pm );//,"",this,"QPEButton"); 65 qpeDirButton->setPixmap( Opie::Core::OResource::loadPixmap( "logo/opielogo", Opie::Core::OResource::SmallIcon ) );
65 qpeDirButton->setAutoRaise( true ); 66 qpeDirButton->setAutoRaise( true );
66 menuBar->insertItem( qpeDirButton ); 67 menuBar->insertItem( qpeDirButton );
67 68
68 cfButton = new QToolButton( 0, "CFButton"); 69 cfButton = new QToolButton( 0, "CFButton");
69 pm.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 70 cfButton->setUsesBigPixmap( useBigIcon );
70 cfButton->setPixmap( pm ); 71 cfButton->setPixmap( Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ) );
71 cfButton->setAutoRaise( true ); 72 cfButton->setAutoRaise( true );
72 menuBar->insertItem( cfButton ); 73 menuBar->insertItem( cfButton );
73 74
74 sdButton = new QToolButton( 0, "SDButton"); 75 sdButton = new QToolButton( 0, "SDButton");
75 pm.convertFromImage( Resource::loadImage( "advancedfm/sdcard" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 76 sdButton->setUsesBigPixmap( useBigIcon );
76 sdButton->setPixmap( pm ); 77 sdButton->setPixmap( Opie::Core::OResource::loadPixmap( "advancedfm/sdcard", Opie::Core::OResource::SmallIcon ) );
77 sdButton->setAutoRaise( true ); 78 sdButton->setAutoRaise( true );
78 menuBar->insertItem( sdButton ); 79 menuBar->insertItem( sdButton );
79 80
80 docButton = new QToolButton( 0,"docsButton"); 81 docButton = new QToolButton( 0,"docsButton");
81 pm.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 82 docButton->setUsesBigPixmap( useBigIcon );
82 docButton->setPixmap( pm ); 83 docButton->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) );
83 docButton->setAutoRaise( true ); 84 docButton->setAutoRaise( true );
84 menuBar->insertItem( docButton ); 85 menuBar->insertItem( docButton );
85 86
86 homeButton = new QToolButton( 0, "homeButton"); 87 homeButton = new QToolButton( 0, "homeButton");
87 pm.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 88 homeButton->setUsesBigPixmap( useBigIcon );
88 homeButton->setPixmap( pm ); 89 homeButton->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) );
89 homeButton->setAutoRaise( true ); 90 homeButton->setAutoRaise( true );
90 menuBar->insertItem( homeButton ); 91 menuBar->insertItem( homeButton );
91 92
92 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); 93 fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() ));
93 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); 94 fileMenu->setItemChecked( fileMenu->idAt(0),TRUE);
94 fileMenu->insertSeparator(); 95 fileMenu->insertSeparator();