summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector/ofileselector.cpp
Unidiff
Diffstat (limited to 'libopie2/opieui/fileselector/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp81
1 files changed, 38 insertions, 43 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp
index 8b53038..f3e7501 100644
--- a/libopie2/opieui/fileselector/ofileselector.cpp
+++ b/libopie2/opieui/fileselector/ofileselector.cpp
@@ -1,30 +1,31 @@
1
2/* 1/*
3               =. This file is part of the OPIE Project 2                 This file is part of the Opie Project
4             .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> 3
5           .>+-= 4 Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org>
6 _;:,     .>    :=|. This library is free software; you can 5 =.
7.> <`_,   >  .   <= redistribute it and/or modify it under 6 .=l.
8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 7           .>+-=
9.="- .-=="i,     .._ License as published by the Free Software 8 _;:,     .>    :=|. This program is free software; you can
10 - .   .-<_>     .<> Foundation; either version 2 of the License, 9.> <`_,   >  .   <= redistribute it and/or modify it under
11     ._= =}       : or (at your option) any later version. 10:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
12    .%`+i>       _;_. 11.="- .-=="i,     .._ License as published by the Free Software
13    .i_,=:_.      -<s. This library is distributed in the hope that 12 - .   .-<_>     .<> Foundation; either version 2 of the License,
14     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY; 13     ._= =}       : or (at your option) any later version.
15    : ..    .:,     . . . without even the implied warranty of 14    .%`+i>       _;_.
16    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A 15    .i_,=:_.      -<s. This program is distributed in the hope that
17  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU 16     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
18..}^=.=       =       ; Library General Public License for more 17 : ..    .:,     . . . without even the implied warranty of
19++=   -.     .`     .: details. 18    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
20 :     =  ...= . :.=- 19  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
21 -.   .:....=;==+<; You should have received a copy of the GNU 20..}^=.=       =       ; Library General Public License for more
22  -_. . .   )=.  = Library General Public License along with 21++=   -.     .`     .: details.
23    --        :-=` this library; see the file COPYING.LIB. 22 :     =  ...= . :.=-
23 -.   .:....=;==+<; You should have received a copy of the GNU
24  -_. . .   )=.  = Library General Public License along with
25    --        :-=` this library; see the file COPYING.LIB.
24 If not, write to the Free Software Foundation, 26 If not, write to the Free Software Foundation,
25 Inc., 59 Temple Place - Suite 330, 27 Inc., 59 Temple Place - Suite 330,
26 Boston, MA 02111-1307, USA. 28 Boston, MA 02111-1307, USA.
27
28*/ 29*/
29 30
30/* hacky but we need to get FileSelector::filter */ 31/* hacky but we need to get FileSelector::filter */
@@ -35,12 +36,12 @@
35#include "ofileselector_p.h" 36#include "ofileselector_p.h"
36 37
37/* OPIE */ 38/* OPIE */
38#include <opie2/ofileselector.h>
39#include <opie2/odebug.h> 39#include <opie2/odebug.h>
40#include <opie2/ofileselector.h>
41#include <opie2/oresource.h>
40 42
41#include <qpe/qpeapplication.h> 43#include <qpe/qpeapplication.h>
42#include <qpe/mimetype.h> 44#include <qpe/mimetype.h>
43#include <qpe/resource.h>
44#include <qpe/storage.h> 45#include <qpe/storage.h>
45 46
46/* QT */ 47/* QT */
@@ -334,47 +335,40 @@ OFileViewFileListView::OFileViewFileListView( QWidget* parent, const QString& st
334 box->setBackgroundMode( PaletteButton ); 335 box->setBackgroundMode( PaletteButton );
335 box->setSpacing( 0 ); 336 box->setSpacing( 0 );
336 337
337 QPixmap pic;
338 QToolButton *btn = new QToolButton( box ); 338 QToolButton *btn = new QToolButton( box );
339 btn->setUsesBigPixmap( true ); 339 btn->setUsesBigPixmap( true );
340 pic.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 340 btn->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) );
341 btn->setPixmap( pic );
342 connect(btn, SIGNAL(clicked() ), 341 connect(btn, SIGNAL(clicked() ),
343 this, SLOT( cdUP() ) ); 342 this, SLOT( cdUP() ) );
344 343
345 btn = new QToolButton( box ); 344 btn = new QToolButton( box );
346 btn->setUsesBigPixmap( true ); 345 btn->setUsesBigPixmap( true );
347 pic.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 346 btn->setPixmap( Opie::Core::OResource::loadPixmap( "home", Opie::Core::OResource::SmallIcon ) );
348 btn->setPixmap( pic );
349 connect(btn, SIGNAL(clicked() ), 347 connect(btn, SIGNAL(clicked() ),
350 this, SLOT( cdHome() ) ); 348 this, SLOT( cdHome() ) );
351 349
352 btn = new QToolButton( box ); 350 btn = new QToolButton( box );
353 btn->setUsesBigPixmap( true ); 351 btn->setUsesBigPixmap( true );
354 pic.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 352 btn->setPixmap( Opie::Core::OResource::loadPixmap( "DocsIcon", Opie::Core::OResource::SmallIcon ) );
355 btn->setPixmap( pic );
356 connect(btn, SIGNAL(clicked() ), 353 connect(btn, SIGNAL(clicked() ),
357 this, SLOT(cdDoc() ) ); 354 this, SLOT(cdDoc() ) );
358 355
359 m_btnNew = new QToolButton( box ); 356 m_btnNew = new QToolButton( box );
360 m_btnNew->setUsesBigPixmap( true ); 357 m_btnNew->setUsesBigPixmap( true );
361 pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 358 m_btnNew->setPixmap( Opie::Core::OResource::loadPixmap( "new", Opie::Core::OResource::SmallIcon ) );
362 m_btnNew->setPixmap( pic );
363 connect(m_btnNew, SIGNAL(clicked() ), 359 connect(m_btnNew, SIGNAL(clicked() ),
364 this, SLOT(slotNew() ) ); 360 this, SLOT(slotNew() ) );
365 361
366 362
367 m_btnClose = new QToolButton( box ); 363 m_btnClose = new QToolButton( box );
368 m_btnClose->setUsesBigPixmap( true ); 364 m_btnClose->setUsesBigPixmap( true );
369 pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 365 m_btnClose->setPixmap( Opie::Core::OResource::loadPixmap( "close", Opie::Core::OResource::SmallIcon ) );
370 m_btnClose->setPixmap( pic );
371 connect(m_btnClose, SIGNAL(clicked() ), 366 connect(m_btnClose, SIGNAL(clicked() ),
372 selector(), SIGNAL(closeMe() ) ); 367 selector(), SIGNAL(closeMe() ) );
373 368
374 btn = new QToolButton( box ); 369 btn = new QToolButton( box );
375 btn->setUsesBigPixmap( true ); 370 btn->setUsesBigPixmap( true );
376 pic.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); 371 btn->setPixmap( Opie::Core::OResource::loadPixmap( "cardmon/pcmcia", Opie::Core::OResource::SmallIcon ) );
377 btn->setPixmap( pic );
378 372
379 m_fsButton = btn; 373 m_fsButton = btn;
380 /* let's fill device parts */ 374 /* let's fill device parts */
@@ -639,7 +633,7 @@ void OFileViewFileListView::addFile( QFileInfo* info, bool symlink )
639 if ( pix.isNull() ) 633 if ( pix.isNull() )
640 { 634 {
641 QWMatrix matrix; 635 QWMatrix matrix;
642 QPixmap pixer(Resource::loadPixmap("UnknownDocument") ); 636 QPixmap pixer( Opie::Core::OResource::loadPixmap( "UnknownDocument" ) );
643 matrix.scale( .4, .4 ); 637 matrix.scale( .4, .4 );
644 pix = pixer.xForm( matrix ); 638 pix = pixer.xForm( matrix );
645 } 639 }
@@ -653,7 +647,8 @@ void OFileViewFileListView::addFile( QFileInfo* info, bool symlink )
653 if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) || 647 if ( ( (selector()->mode() == OFileSelector::Open)&& !info->isReadable() ) ||
654 ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) ) 648 ( (selector()->mode() == OFileSelector::Save)&& !info->isWritable() ) )
655 { 649 {
656 locked = true; pix = Resource::loadPixmap("locked"); 650 locked = true;
651 pix = Opie::Core::OResource::loadPixmap( "locked" );
657 } 652 }
658 } 653 }
659 (void)new OFileSelectorItem( m_view, pix, name, 654 (void)new OFileSelectorItem( m_view, pix, name,
@@ -670,12 +665,12 @@ void OFileViewFileListView::addDir( QFileInfo* info, bool symlink )
670 { 665 {
671 locked = true; 666 locked = true;
672 if ( symlink ) 667 if ( symlink )
673 pix = Resource::loadPixmap( "opie/symlink" ); 668 pix = Opie::Core::OResource::loadPixmap( "opie/symlink" );
674 else 669 else
675 pix = Resource::loadPixmap( "lockedfolder" ); 670 pix = Opie::Core::OResource::loadPixmap( "lockedfolder" );
676 } 671 }
677 else 672 else
678 pix = symlink ? Resource::loadPixmap( "opie/symlink") : Resource::loadPixmap("folder"); 673 pix = symlink ? Opie::Core::OResource::loadPixmap( "opie/symlink" ) : Opie::Core::OResource::loadPixmap( "folder" );
679 674
680 name = symlink ? info->fileName() + " -> " + createNewPath(info->dirPath(true),info->readLink()) : 675 name = symlink ? info->fileName() + " -> " + createNewPath(info->dirPath(true),info->readLink()) :
681 info->fileName(); 676 info->fileName();