summaryrefslogtreecommitdiff
authorzecke <zecke>2002-06-26 20:41:06 (UTC)
committer zecke <zecke>2002-06-26 20:41:06 (UTC)
commita078163b38383870dd5a659c1f0964e1238867b3 (patch) (unidiff)
tree68a517f1adc23cc0fa70b979fe772bcaa53790ab
parentc229565c40d478555a9ed0aa4910b9ab8181884c (diff)
downloadopie-a078163b38383870dd5a659c1f0964e1238867b3.zip
opie-a078163b38383870dd5a659c1f0964e1238867b3.tar.gz
opie-a078163b38383870dd5a659c1f0964e1238867b3.tar.bz2
OFileSelector is now a complete drop in replacement
of the QPE fileselector
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cc36
1 files changed, 30 insertions, 6 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 98290e0..824acf2 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -126,5 +126,5 @@ OFileSelector::OFileSelector(const QString &mimeFilter, QWidget *parent,
126 initVars(); 126 initVars();
127 m_currentDir = QPEApplication::documentDir(); 127 m_currentDir = QPEApplication::documentDir();
128 m_mode = OPEN; 128 m_mode = FILESELECTOR;
129 m_selector = NORMAL; 129 m_selector = NORMAL;
130 m_shClose = closeVisible; 130 m_shClose = closeVisible;
@@ -156,4 +156,6 @@ void OFileSelector::setNewVisible( bool visible )
156 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ), 156 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
157 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) ); 157 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
158 connect(m_select, SIGNAL(closeMe() ),
159 this, SIGNAL(closeMe() ) );
158 //connect to close me and other signals as well 160 //connect to close me and other signals as well
159 m_stack->addWidget( m_select, NORMAL ); 161 m_stack->addWidget( m_select, NORMAL );
@@ -436,7 +438,9 @@ void OFileSelector::slotViewCheck(const QString &sel)
436 m_select = new FileSelector(mime, 438 m_select = new FileSelector(mime,
437 m_stack, "fileselector", 439 m_stack, "fileselector",
438 FALSE, FALSE); 440 m_shNew, m_shClose);
439 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ), 441 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
440 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) ); 442 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
443 connect(m_select, SIGNAL(closeMe() ),
444 this, SIGNAL(closeMe() ) );
441 //connect to close me and other signals as well 445 //connect to close me and other signals as well
442 446
@@ -495,8 +499,10 @@ void OFileSelector::slotMimeCheck(const QString &mime)
495 m_select = new FileSelector( newMimeType, 499 m_select = new FileSelector( newMimeType,
496 m_stack, "fileselector", 500 m_stack, "fileselector",
497 FALSE, FALSE); 501 m_shNew, m_shClose);
498 502
499 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ), 503 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
500 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) ); 504 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
505 connect(m_select, SIGNAL(closeMe() ),
506 this, SIGNAL(closeMe() ) );
501 //connect to close me and other signals as well 507 //connect to close me and other signals as well
502 m_stack->addWidget( m_select, NORMAL ); 508 m_stack->addWidget( m_select, NORMAL );
@@ -561,8 +567,10 @@ void OFileSelector::init()
561 m_select = new FileSelector(mime, 567 m_select = new FileSelector(mime,
562 m_stack, "fileselector", 568 m_stack, "fileselector",
563 FALSE, FALSE); 569 m_shNew, m_shClose);
564 570
565 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ), 571 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
566 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) ); 572 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
573 connect(m_select, SIGNAL(closeMe() ),
574 this, SIGNAL( closeMe() ) );
567 //connect to close me and other signals as well 575 //connect to close me and other signals as well
568 576
@@ -875,6 +883,6 @@ void OFileSelector::initializeListView()
875 if(!m_shClose ) 883 if(!m_shClose )
876 m_close->hide(); 884 m_close->hide();
877 if(!m_shNew) 885 //if(!m_shNew)
878 m_close->hide(); 886 //m_close->hide();
879 887
880 } // off toolbar 888 } // off toolbar
@@ -1023,7 +1031,16 @@ void OFileSelector::slotCurrentChanged(QListViewItem* item )
1023 if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ) { 1031 if( m_selector == EXTENDED || m_selector == EXTENDED_ALL ) {
1024 OFileSelectorItem *sel = (OFileSelectorItem*) item; // start to use the C++ casts ;) 1032 OFileSelectorItem *sel = (OFileSelectorItem*) item; // start to use the C++ casts ;)
1033 qWarning("current changed");
1025 if(!sel->isDir() ){ 1034 if(!sel->isDir() ){
1026 if( m_shLne ) 1035 if( m_shLne )
1027 m_edit->setText( sel->text(1) ); 1036 m_edit->setText( sel->text(1) );
1037
1038 if (m_mode == FILESELECTOR ) {
1039 QStringList str = QStringList::split("->", sel->text(1) );
1040 QString path =sel->directory() + "/" + str[0].stripWhiteSpace();
1041 emit fileSelected(path );
1042 DocLnk lnk( path );
1043 emit fileSelected(lnk );
1044 }
1028 } 1045 }
1029 } 1046 }
@@ -1051,5 +1068,9 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
1051 if( m_shLne ) 1068 if( m_shLne )
1052 m_edit->setText( str[0].stripWhiteSpace() ); 1069 m_edit->setText( str[0].stripWhiteSpace() );
1070 qWarning("selected here in slot clicked");
1053 emit fileSelected( sel->directory() + "/" + str[0].stripWhiteSpace() ); 1071 emit fileSelected( sel->directory() + "/" + str[0].stripWhiteSpace() );
1072 DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() );
1073 qWarning("file selected");
1074 emit fileSelected( lnk );
1054 } 1075 }
1055 } 1076 }
@@ -1085,4 +1106,7 @@ void OFileSelector::slotOpen()
1085 QStringList str = QStringList::split("->", sel->text(1) ); 1106 QStringList str = QStringList::split("->", sel->text(1) );
1086 slotFileSelected( sel->directory() +"/" +str[0].stripWhiteSpace() ); 1107 slotFileSelected( sel->directory() +"/" +str[0].stripWhiteSpace() );
1108 qWarning("slot open");
1109 // DocLnk lnk( sel->directory() + "/" + str[0].stripWhiteSpace() );
1110 //emit fileSelected( lnk );
1087 } 1111 }
1088} 1112}