summaryrefslogtreecommitdiff
authorzecke <zecke>2002-06-26 19:15:17 (UTC)
committer zecke <zecke>2002-06-26 19:15:17 (UTC)
commit7b3b485aff7fc5f5cdef40a7d4989295d5c8ab4a (patch) (unidiff)
tree661027703c822da5a109247b9ce54862af38932c
parentf6800ca0bed431aac90f09ec98e481fb424c7b31 (diff)
downloadopie-7b3b485aff7fc5f5cdef40a7d4989295d5c8ab4a.zip
opie-7b3b485aff7fc5f5cdef40a7d4989295d5c8ab4a.tar.gz
opie-7b3b485aff7fc5f5cdef40a7d4989295d5c8ab4a.tar.bz2
done for now
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 74b308e..98290e0 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -551,62 +551,66 @@ void OFileSelector::init()
551 m_stack = new QWidgetStack( this ); 551 m_stack = new QWidgetStack( this );
552 if( m_selector == NORMAL ){ 552 if( m_selector == NORMAL ){
553 QString mime; 553 QString mime;
554 if (!m_autoMime) { 554 if (!m_autoMime) {
555 if (!m_mimetypes.isEmpty() ) { 555 if (!m_mimetypes.isEmpty() ) {
556 QMap<QString, QStringList>::Iterator it; 556 QMap<QString, QStringList>::Iterator it;
557 it = m_mimetypes.begin(); // cause we're in the init 557 it = m_mimetypes.begin(); // cause we're in the init
558 mime = it.data().join(";"); 558 mime = it.data().join(";");
559 } 559 }
560 } 560 }
561 m_select = new FileSelector(mime, 561 m_select = new FileSelector(mime,
562 m_stack, "fileselector", 562 m_stack, "fileselector",
563 FALSE, FALSE); 563 FALSE, FALSE);
564 564
565 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ), 565 connect(m_select, SIGNAL(fileSelected( const DocLnk & ) ),
566 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) ); 566 this, SLOT( slotFileBridgeSelected(const DocLnk & ) ) );
567 //connect to close me and other signals as well 567 //connect to close me and other signals as well
568 568
569 m_stack->addWidget( m_select, NORMAL ); 569 m_stack->addWidget( m_select, NORMAL );
570 m_stack->raiseWidget( NORMAL ); 570 m_stack->raiseWidget( NORMAL );
571 }else{ // we're in init so it will be EXTENDED or EXTENDED_ALL 571 }else{ // we're in init so it will be EXTENDED or EXTENDED_ALL
572 // and initializeListview will take care of those 572 // and initializeListview will take care of those
573 // toolbar get's generade in initializeListView 573 // toolbar get's generade in initializeListView
574 initializeListView( ); // will raise the widget as well 574 initializeListView( ); // will raise the widget as well
575 m_stack->raiseWidget( EXTENDED );
575 } 576 }
576 m_lay->addWidget( m_stack, 100 ); // add to the layout 10 = stretch 577 m_lay->addWidget( m_stack, 100 ); // add to the layout 10 = stretch
577 578
578 if( m_shLne ) // the LineEdit with the current FileName 579 if( m_shLne ) // the LineEdit with the current FileName
579 initializeName(); 580 initializeName();
580 581
581 if( m_shPerm ) // the Permission QCheckBox 582 if( m_shPerm ) // the Permission QCheckBox
582 initializePerm(); 583 initializePerm();
583 584
584 if( m_shChooser ) // the Chooser for the view and Mimetypes 585 if( m_shChooser ) // the Chooser for the view and Mimetypes
585 initializeChooser(); 586 initializeChooser();
586 587
587 if( m_shYesNo ) // the Yes No button row 588 if( m_shYesNo ) // the Yes No button row
588 initializeYes( ); 589 initializeYes( );
590
591 if (m_selector != NORMAL )
592 reparse();
589} 593}
590void OFileSelector::updateMimes() 594void OFileSelector::updateMimes()
591{ 595{
592 if( m_autoMime ){ 596 if( m_autoMime ){
593 m_mimetypes.clear(); 597 m_mimetypes.clear();
594 m_mimetypes.insert( tr("All"), QString::null ); 598 m_mimetypes.insert( tr("All"), QString::null );
595 if( m_selector == NORMAL ){ 599 if( m_selector == NORMAL ){
596 DocLnkSet set; 600 DocLnkSet set;
597 Global::findDocuments(&set, QString::null ); 601 Global::findDocuments(&set, QString::null );
598 QListIterator<DocLnk> dit( set.children() ); 602 QListIterator<DocLnk> dit( set.children() );
599 for( ; dit.current(); ++dit ){ 603 for( ; dit.current(); ++dit ){
600 if( !m_mimetypes.contains( (*dit)->type() ) ) 604 if( !m_mimetypes.contains( (*dit)->type() ) )
601 m_mimetypes.insert( (*dit)->type(), (*dit)->type() ); 605 m_mimetypes.insert( (*dit)->type(), (*dit)->type() );
602 } 606 }
603 }// else done in reparse 607 }// else done in reparse
604 } 608 }
605} 609}
606void OFileSelector::initVars() 610void OFileSelector::initVars()
607{ 611{
608 if( m_mimetypes.isEmpty() ) 612 if( m_mimetypes.isEmpty() )
609 m_autoMime = true; 613 m_autoMime = true;
610 else 614 else
611 m_autoMime = false; 615 m_autoMime = false;
612 m_shClose = false; 616 m_shClose = false;
@@ -780,49 +784,51 @@ void OFileSelector::updateMimeCheck() {
780} 784}
781 785
782void OFileSelector::initializeChooser() 786void OFileSelector::initializeChooser()
783{ 787{
784 if( m_boxView == 0 ){ 788 if( m_boxView == 0 ){
785 m_boxView = new QHBox( this ); 789 m_boxView = new QHBox( this );
786 m_viewCheck = new QComboBox( m_boxView, "view check"); 790 m_viewCheck = new QComboBox( m_boxView, "view check");
787 m_mimeCheck = new QComboBox( m_boxView, "mime check"); 791 m_mimeCheck = new QComboBox( m_boxView, "mime check");
788 m_boxView->setSpacing( 8 ); 792 m_boxView->setSpacing( 8 );
789 m_lay->addWidget(m_boxView, 0 ); 793 m_lay->addWidget(m_boxView, 0 );
790 794
791 m_viewCheck->insertItem( tr("Documents") ); 795 m_viewCheck->insertItem( tr("Documents") );
792 m_viewCheck->insertItem( tr("Files") ); 796 m_viewCheck->insertItem( tr("Files") );
793 m_viewCheck->insertItem( tr("All Files") ); 797 m_viewCheck->insertItem( tr("All Files") );
794 updateMimeCheck(); 798 updateMimeCheck();
795 799
796 connect( m_viewCheck, SIGNAL( activated(const QString & ) ), 800 connect( m_viewCheck, SIGNAL( activated(const QString & ) ),
797 this, SLOT( slotViewCheck(const QString & ) ) ); 801 this, SLOT( slotViewCheck(const QString & ) ) );
798 connect( m_mimeCheck, SIGNAL( activated(const QString & ) ), 802 connect( m_mimeCheck, SIGNAL( activated(const QString & ) ),
799 this, SLOT( slotMimeCheck( const QString & ) ) ); 803 this, SLOT( slotMimeCheck( const QString & ) ) );
800 } 804 }
801} 805}
802void OFileSelector::initializeListView() 806void OFileSelector::initializeListView()
803{ 807{
808 qWarning("initializeListView");
804 if( m_pseudo == 0 ){ 809 if( m_pseudo == 0 ){
810 qWarning("init");
805 m_pseudo = new QWidget( m_stack, "Pseudo Widget"); 811 m_pseudo = new QWidget( m_stack, "Pseudo Widget");
806 m_pseudoLayout = new QVBoxLayout( m_pseudo ); 812 m_pseudoLayout = new QVBoxLayout( m_pseudo );
807 // toolbar 813 // toolbar
808 m_boxToolbar = new QHBox( m_pseudo ); 814 m_boxToolbar = new QHBox( m_pseudo );
809 m_boxToolbar->setSpacing(0 ); // next to each other please 815 m_boxToolbar->setSpacing(0 ); // next to each other please
810 816
811 // toolbar members 817 // toolbar members
812 { 818 {
813 // location QComboBox 819 // location QComboBox
814 m_location = new QComboBox( m_boxToolbar ); 820 m_location = new QComboBox( m_boxToolbar );
815 m_location->setEditable( TRUE ); 821 m_location->setEditable( TRUE );
816 m_location->setDuplicatesEnabled( FALSE ); 822 m_location->setDuplicatesEnabled( FALSE );
817 connect( m_location, SIGNAL(activated(const QString &) ), 823 connect( m_location, SIGNAL(activated(const QString &) ),
818 this, SLOT( slotLocationActivated(const QString &) ) ); 824 this, SLOT( slotLocationActivated(const QString &) ) );
819 connect( m_location->lineEdit(), SIGNAL(returnPressed() ), 825 connect( m_location->lineEdit(), SIGNAL(returnPressed() ),
820 this, SLOT(locationComboChanged() ) ); 826 this, SLOT(locationComboChanged() ) );
821 // UP Button 827 // UP Button
822 m_up = new QPushButton(Resource::loadIconSet("up"),"", 828 m_up = new QPushButton(Resource::loadIconSet("up"),"",
823 m_boxToolbar,"cdUpButton"); 829 m_boxToolbar,"cdUpButton");
824 m_up->setFixedSize( QSize( 20, 20 ) ); 830 m_up->setFixedSize( QSize( 20, 20 ) );
825 connect(m_up ,SIGNAL(clicked()),this,SLOT(cdUP() ) ); 831 connect(m_up ,SIGNAL(clicked()),this,SLOT(cdUP() ) );
826 m_up->setFlat(TRUE); 832 m_up->setFlat(TRUE);
827 833
828 // Home Button 834 // Home Button