summaryrefslogtreecommitdiff
path: root/libopie/ofileselector/ofileselector.cpp
authorzecke <zecke>2002-10-05 22:20:57 (UTC)
committer zecke <zecke>2002-10-05 22:20:57 (UTC)
commit99425255c4afcd75ee6b2f903487cb958d3acdee (patch) (unidiff)
tree8cce0b096ce9a000291044def444f30934c79888 /libopie/ofileselector/ofileselector.cpp
parent94180a2019a945e6a492405dc6a30420c760529f (diff)
downloadopie-99425255c4afcd75ee6b2f903487cb958d3acdee.zip
opie-99425255c4afcd75ee6b2f903487cb958d3acdee.tar.gz
opie-99425255c4afcd75ee6b2f903487cb958d3acdee.tar.bz2
So now switching is about to be implemented the next commit will have a completed OListe/OFileView switch
Diffstat (limited to 'libopie/ofileselector/ofileselector.cpp') (more/less context) (show whitespace changes)
-rw-r--r--libopie/ofileselector/ofileselector.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/libopie/ofileselector/ofileselector.cpp b/libopie/ofileselector/ofileselector.cpp
index 458d432..91a510f 100644
--- a/libopie/ofileselector/ofileselector.cpp
+++ b/libopie/ofileselector/ofileselector.cpp
@@ -31,12 +31,13 @@
31 31
32#include "ofileview.h" 32#include "ofileview.h"
33#include "ofileselectormain.h" 33#include "ofileselectormain.h"
34#include "ofileselector.h" 34#include "ofileselector.h"
35#include "olocallister.h" 35#include "olocallister.h"
36#include "olister.h" 36#include "olister.h"
37#include "odefaultfactories.h"
37 38
38QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0; 39QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0;
39 40
40namespace { 41namespace {
41 /* let's find the index for a specified string */ 42 /* let's find the index for a specified string */
42 int indexByString( const QComboBox *box, const QString &str ){ 43 int indexByString( const QComboBox *box, const QString &str ){
@@ -294,15 +295,13 @@ QStringList OFileSelector::selectedNames()const
294 */ 295 */
295QString OFileSelector::selectedPath()const 296QString OFileSelector::selectedPath()const
296{ 297{
297 QString path; 298 QString path;
298 if( m_selector == Normal ){ 299 if( m_selector == Normal ){
299 path = QPEApplication::documentDir(); 300 path = QPEApplication::documentDir();
300 } /*else if( m_selector == Extended || m_selector == ExtendedAll ){ 301 } /* normal case to do */
301 ;
302 }*/
303 return path; 302 return path;
304} 303}
305QStringList OFileSelector::selectedPaths() const 304QStringList OFileSelector::selectedPaths() const
306{ 305{
307 QStringList list; 306 QStringList list;
308 list << selectedPath(); 307 list << selectedPath();
@@ -369,21 +368,14 @@ void OFileSelector::slotCancel()
369void OFileSelector::slotViewCheck(const QString &sel) 368void OFileSelector::slotViewCheck(const QString &sel)
370{ 369{
371 if( sel == tr("Documents" ) ){ 370 if( sel == tr("Documents" ) ){
372 initializeOldSelector(); 371 initializeOldSelector();
373 m_selector = Normal; 372 m_selector = Normal;
374 373
375 }else if( sel == tr("Files") ){ 374 }else {
376 m_selector = Extended; 375;
377
378 // FIXME call the factory
379 //reparse();
380 }else if( sel == tr("All Files") ){
381 m_selector = ExtendedAll;
382/* see above
383 reparse(); */
384 } 376 }
385} 377}
386 378
387QString OFileSelector::currentMimeType() const{ 379QString OFileSelector::currentMimeType() const{
388 QString mime; 380 QString mime;
389 QString currentText; 381 QString currentText;
@@ -471,12 +463,13 @@ void OFileSelector::locationComboChanged()
471 cd( m_location->lineEdit()->text() ); 463 cd( m_location->lineEdit()->text() );
472 464
473 reparse(); 465 reparse();
474} 466}
475void OFileSelector::init() 467void OFileSelector::init()
476{ 468{
469 initFactory();
477 m_lay = new QVBoxLayout( this ); 470 m_lay = new QVBoxLayout( this );
478 m_lay->setSpacing(0 ); 471 m_lay->setSpacing(0 );
479 472
480 /* take care of the main view... */ 473 /* take care of the main view... */
481 initToolbar(); 474 initToolbar();
482 475
@@ -650,16 +643,12 @@ void OFileSelector::initializeChooser()
650 m_boxView = new QHBox( this ); 643 m_boxView = new QHBox( this );
651 m_viewCheck = new QComboBox( m_boxView, "view check"); 644 m_viewCheck = new QComboBox( m_boxView, "view check");
652 m_mimeCheck = new QComboBox( m_boxView, "mime check"); 645 m_mimeCheck = new QComboBox( m_boxView, "mime check");
653 m_boxView->setSpacing( 8 ); 646 m_boxView->setSpacing( 8 );
654 m_lay->addWidget(m_boxView, 0 ); 647 m_lay->addWidget(m_boxView, 0 );
655 648
656 m_viewCheck->insertItem( tr("Documents") );
657 m_viewCheck->insertItem( tr("Files") );
658 m_viewCheck->insertItem( tr("All Files") );
659 /* update to custom views */
660 649
661 updateMimeCheck(); 650 updateMimeCheck();
662 651
663 connect( m_viewCheck, SIGNAL( activated(const QString & ) ), 652 connect( m_viewCheck, SIGNAL( activated(const QString & ) ),
664 this, SLOT( slotViewCheck(const QString & ) ) ); 653 this, SLOT( slotViewCheck(const QString & ) ) );
665 connect( m_mimeCheck, SIGNAL( activated(const QString & ) ), 654 connect( m_mimeCheck, SIGNAL( activated(const QString & ) ),
@@ -948,12 +937,23 @@ void OFileSelector::reparse()
948 m_location->insertItem( m_currentDir ); 937 m_location->insertItem( m_currentDir );
949 938
950 } 939 }
951 // reenable painting and updates 940 // reenable painting and updates
952} 941}
953 942
943/*
944 * the factory
945 */
946void OFileSelector::initFactory() {
947 m_fileFactory = new OFileFactory();
948 m_fileFactory->addLister(tr("Files"), newLocalLister );
949 m_fileFactory->addView(tr("List View"), newFileListView );
950 /* the factory is just a dummy */
951 m_fileFactory->addView(tr("Documents"), newFileListView );
952}
953
954 954
955OFileView* OFileSelector::currentView() { 955OFileView* OFileSelector::currentView() {
956 return m_fileView; 956 return m_fileView;
957} 957}
958OFileView* OFileSelector::currentView() const{ 958OFileView* OFileSelector::currentView() const{
959 return m_fileView; 959 return m_fileView;