summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-04-24 02:06:41 (UTC)
committer llornkcor <llornkcor>2002-04-24 02:06:41 (UTC)
commitc9159a3d5192799f5b2911d13337f04f50b1ac5a (patch) (unidiff)
treed7a09c5998c1e7b9fdc4d24f1dcf15f91fc95437
parent29e4dd18cbbe6d5967561b428a9632629cff3fde (diff)
downloadopie-c9159a3d5192799f5b2911d13337f04f50b1ac5a.zip
opie-c9159a3d5192799f5b2911d13337f04f50b1ac5a.tar.gz
opie-c9159a3d5192799f5b2911d13337f04f50b1ac5a.tar.bz2
changed symlink icon location, changed mimetype combo action, added spacing to bottom
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/libopie.control2
-rw-r--r--libopie/ofileselector.cc159
2 files changed, 80 insertions, 81 deletions
diff --git a/libopie/libopie.control b/libopie/libopie.control
index 80bd2fc..e5416bf 100644
--- a/libopie/libopie.control
+++ b/libopie/libopie.control
@@ -1,2 +1,2 @@
1Files: $QTDIR/lib/libopie.so.1.0.0 $QTDIR/lib/libopie.so.1.0 $QTDIR/lib/libopie.so.1 1Files: $QTDIR/lib/libopie.so.1.0.0 $QTDIR/lib/libopie.so.1.0 $QTDIR/lib/libopie.so.1 $QTDIR/pics/opie/*
2Priority: optional 2Priority: optional
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index ea19143..cb18039 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -68,4 +68,4 @@ namespace {
68 if( str == box->text(i ) ){ 68 if( str == box->text(i ) ){
69 index= i; 69 index= i;
70 break; 70 break;
71 } 71 }
@@ -79,3 +79,3 @@ namespace {
79OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName, 79OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString &dirName,
80 const QString &fileName, const QStringList &mimetypes ) : QWidget( wid ) 80 const QString &fileName, const QStringList &mimetypes ) : QWidget( wid )
81{ 81{
@@ -86,5 +86,5 @@ OFileSelector::OFileSelector(QWidget *wid, int mode, int selector, const QString
86 m_name = fileName; 86 m_name = fileName;
87 m_mimetypes = mimetypes; 87 m_mimetypes = mimetypes;
88 if( mimetypes.isEmpty() ) 88// if( mimetypes.isEmpty() )
89 m_autoMime = true; 89// m_autoMime = true;
90 90
@@ -141,3 +141,3 @@ void OFileSelector::initPics()
141 QPixmap pm = Resource::loadPixmap( "folder" ); 141 QPixmap pm = Resource::loadPixmap( "folder" );
142 QPixmap lnk = Resource::loadPixmap( "symlink" ); 142 QPixmap lnk = Resource::loadPixmap( "opie/symlink" );
143 QPainter painter( &pm ); 143 QPainter painter( &pm );
@@ -420,4 +420,4 @@ void OFileSelector::reparse()
420 if(fi->extension() == QString::fromLatin1("desktop") ){ 420 if(fi->extension() == QString::fromLatin1("desktop") ){
421 ++it; 421 ++it;
422 continue; 422 continue;
423 } 423 }
@@ -425,3 +425,3 @@ void OFileSelector::reparse()
425 if( !m_mimetypes.contains( type.id() ) ) 425 if( !m_mimetypes.contains( type.id() ) )
426 m_mimetypes.append( type.id() ); 426 m_mimetypes.append( type.id() );
427 427
@@ -469,22 +469,22 @@ void OFileSelector::reparse()
469 for(int i=0; i<=4; i++ ){ // prepend from dos 469 for(int i=0; i<=4; i++ ){ // prepend from dos
470 QFileInfo info( file ); 470 QFileInfo info( file );
471 if( !info.exists() ){ 471 if( !info.exists() ){
472 qWarning("does not exist" ); 472 qWarning("does not exist" );
473 addSymlink(currMime, fi, TRUE ); 473 addSymlink(currMime, fi, TRUE );
474 break; 474 break;
475 }else if( info.isDir() ){ 475 }else if( info.isDir() ){
476 qWarning("isDir" ); 476 qWarning("isDir" );
477 addDir(currMime, fi, TRUE ); 477 addDir(currMime, fi, TRUE );
478 break; 478 break;
479 }else if( info.isFile() ){ 479 }else if( info.isFile() ){
480 qWarning("isFile" ); 480 qWarning("isFile" );
481 addFile(currMime, fi, TRUE ); 481 addFile(currMime, fi, TRUE );
482 break; 482 break;
483 }else if( info.isSymLink() ){ 483 }else if( info.isSymLink() ){
484 file = info.dirPath(true)+ "/"+ info.readLink(); 484 file = info.dirPath(true)+ "/"+ info.readLink();
485 qWarning("isSymlink again %s", file.latin1() ); 485 qWarning("isSymlink again %s", file.latin1() );
486 }else if( i == 4 ){ // just insert it and have the symlink symbol 486 }else if( i == 4 ){ // just insert it and have the symlink symbol
487 addSymlink(currMime, fi ); 487 addSymlink(currMime, fi );
488 qWarning("level too deep" ); 488 qWarning("level too deep" );
489 } 489 }
490 } 490 }
@@ -538,5 +538,5 @@ void OFileSelector::initializeYes()
538 connect(m_ok, SIGNAL(clicked() ), 538 connect(m_ok, SIGNAL(clicked() ),
539 this, SLOT(slotOk() ) ); 539 this, SLOT(slotOk() ) );
540 connect(m_cancel, SIGNAL(clicked() ), 540 connect(m_cancel, SIGNAL(clicked() ),
541 this, SLOT(slotCancel() ) ); 541 this, SLOT(slotCancel() ) );
542 542
@@ -550,5 +550,6 @@ void OFileSelector::initializeChooser()
550 m_boxView->addWidget(m_viewCheck, 0 ); 550 m_boxView->addWidget(m_viewCheck, 0 );
551 m_boxView->insertSpacing(1, 8 ); 551 m_boxView->insertSpacing(2, 8 );
552 m_boxView->addWidget(m_mimeCheck, 0 ); 552 m_boxView->addWidget(m_mimeCheck, 0 );
553 m_lay->addLayout(m_boxView ); 553 m_lay->addLayout(m_boxView );
554 m_lay->insertSpacing( 4, 8);
554 555
@@ -558,14 +559,14 @@ void OFileSelector::initializeChooser()
558 559
559 if(!m_autoMime ) 560// if(!m_autoMime )
560 m_mimeCheck->insertItem(m_mimetypes.join("," ) ); 561// m_mimeCheck->insertItem(m_mimetypes.join("," ) );
561 else{ // check 562// else{ // check
562 updateMimes(); 563 updateMimes();
563 m_mimeCheck->insertStringList( m_mimetypes ); 564 m_mimeCheck->insertStringList( m_mimetypes );
564 } 565// }
565 566
566 connect( m_viewCheck, SIGNAL(activated(const QString &) ), 567 connect( m_viewCheck, SIGNAL(activated(const QString &) ),
567 this, SLOT(slotViewCheck(const QString & ) ) ); 568 this, SLOT(slotViewCheck(const QString & ) ) );
568 569
569 connect( m_mimeCheck, SIGNAL(activated(const QString &) ), 570 connect( m_mimeCheck, SIGNAL(activated(const QString &) ),
570 this, SLOT(slotMimeCheck(const QString & ) ) ); 571 this, SLOT(slotMimeCheck(const QString & ) ) );
571} 572}
@@ -575,3 +576,3 @@ void OFileSelector::slotMimeCheck(const QString &view ){
575 m_select = new FileSelector(view == "All" ? QString::null : view 576 m_select = new FileSelector(view == "All" ? QString::null : view
576 , m_stack, "fileselector", FALSE, FALSE ); 577 , m_stack, "fileselector", FALSE, FALSE );
577 m_stack->addWidget( m_select, NORMAL ); 578 m_stack->addWidget( m_select, NORMAL );
@@ -599,3 +600,3 @@ void OFileSelector::slotViewCheck(const QString &view ){
599 //if(m_pseudoLayout!=0 ) 600 //if(m_pseudoLayout!=0 )
600 //delete m_pseudoLayout; 601// delete m_pseudoLayout;
601 } 602 }
@@ -612,3 +613,3 @@ void OFileSelector::slotViewCheck(const QString &view ){
612 m_select = new FileSelector( currMime == "All" ? QString::null : currMime, 613 m_select = new FileSelector( currMime == "All" ? QString::null : currMime,
613 m_stack,"fileselector", FALSE, FALSE ); 614 m_stack,"fileselector", FALSE, FALSE );
614 m_stack->addWidget( m_select, NORMAL ); 615 m_stack->addWidget( m_select, NORMAL );
@@ -696,4 +697,3 @@ void OFileSelector::initializeListView()
696 m_up = new QPushButton(Resource::loadIconSet("up"),"", m_pseudo,"cdUpButton"); 697 m_up = new QPushButton(Resource::loadIconSet("up"),"", m_pseudo,"cdUpButton");
697 m_up->setMinimumSize( QSize( 20, 20 ) ); 698 m_up->setFixedSize( QSize( 20, 20 ) );
698 m_up->setMaximumSize( QSize( 20, 20 ) );
699 connect(m_up ,SIGNAL(clicked()),this,SLOT(cdUP() ) ); 699 connect(m_up ,SIGNAL(clicked()),this,SLOT(cdUP() ) );
@@ -702,4 +702,3 @@ void OFileSelector::initializeListView()
702 m_homeButton = new QPushButton(Resource::loadIconSet("home") , "", m_pseudo); 702 m_homeButton = new QPushButton(Resource::loadIconSet("home") , "", m_pseudo);
703 m_homeButton->setMinimumSize( QSize( 20, 20 ) ); 703 m_homeButton->setFixedSize( QSize( 20, 20 ) );
704 m_homeButton->setMaximumSize( QSize( 20, 20 ) );
705 connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotHome() ) ); 704 connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotHome() ) );
@@ -708,4 +707,3 @@ void OFileSelector::initializeListView()
708 m_docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"", m_pseudo,"docsButton"); 707 m_docButton = new QPushButton(Resource::loadIconSet("DocsIcon"),"", m_pseudo,"docsButton");
709 m_docButton->setMinimumSize( QSize( 20, 20 ) ); 708 m_docButton->setFixedSize( QSize( 20, 20 ) );
710 m_docButton->setMaximumSize( QSize( 20, 20 ) );
711 connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotDoc() ) ); 709 connect(m_homeButton,SIGNAL(clicked()),this,SLOT(slotDoc() ) );
@@ -741,6 +739,6 @@ void OFileSelector::initializeListView()
741 m_View->addColumn(" "); 739 m_View->addColumn(" ");
742 m_View->addColumn(tr("Name") ); 740 m_View->addColumn(tr("Name"),135 );
743 m_View->addColumn(tr("Size") ); 741 m_View->addColumn(tr("Size"),-1 );
744 m_View->addColumn(tr("Date"), 60 ); 742 m_View->addColumn(tr("Date"), 60 );
745 m_View->addColumn(tr("Mime Type") ); 743 m_View->addColumn(tr("Mime Type"),-1 );
746 QHeader *header = m_View->header(); 744 QHeader *header = m_View->header();
@@ -748,2 +746,3 @@ void OFileSelector::initializeListView()
748 m_View->setSorting(1 ); 746 m_View->setSorting(1 );
747 m_View->setAllColumnsShowFocus( TRUE);
749 // connect now 748 // connect now
@@ -752,5 +751,5 @@ void OFileSelector::initializeListView()
752 connect(m_View, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint &, int) ), 751 connect(m_View, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint &, int) ),
753 this, SLOT(slotClicked( int, QListViewItem *, const QPoint &, int) ) ); 752 this, SLOT(slotClicked( int, QListViewItem *, const QPoint &, int) ) );
754 connect(m_View, SIGNAL(mouseButtonPressed(int, QListViewItem *, const QPoint &, int )), 753 connect(m_View, SIGNAL(mouseButtonPressed(int, QListViewItem *, const QPoint &, int )),
755 this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) ); 754 this, SLOT(slotRightButton(int, QListViewItem *, const QPoint &, int ) ) );
756 755
@@ -793,4 +792,4 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink )
793 if( !info->isReadable() ){ 792 if( !info->isReadable() ){
794 locked = true; 793 locked = true;
795 pix = Resource::loadPixmap("locked" ); 794 pix = Resource::loadPixmap("locked" );
796 } 795 }
@@ -798,4 +797,4 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink )
798 if( !info->isWritable() ){ 797 if( !info->isWritable() ){
799 locked = true; 798 locked = true;
800 pix = Resource::loadPixmap("locked" ); 799 pix = Resource::loadPixmap("locked" );
801 } 800 }
@@ -804,5 +803,5 @@ void OFileSelector::addFile(const QString &mime, QFileInfo *info, bool symlink )
804 new OFileSelectorItem( m_View, pix, name, 803 new OFileSelectorItem( m_View, pix, name,
805 info->lastModified().toString(), 804 info->lastModified().toString(),
806 QString::number( info->size() ), 805 QString::number( info->size() ),
807 dir, locked ); 806 dir, locked );
808} 807}
@@ -820,5 +819,5 @@ void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink )
820 if( symlink ){ 819 if( symlink ){
821 pix = (*m_pixmaps)["symlinkedlocked"]; 820 pix = (*m_pixmaps)["symlinkedlocked"];
822 }else{ 821 }else{
823 pix = Resource::loadPixmap("lockedfolder" ); 822 pix = Resource::loadPixmap("lockedfolder" );
824 } 823 }
@@ -826,5 +825,5 @@ void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink )
826 if( symlink ){ 825 if( symlink ){
827 pix = (*m_pixmaps)["dirsymlink" ]; 826 pix = (*m_pixmaps)["dirsymlink" ];
828 }else{ 827 }else{
829 pix = Resource::loadPixmap("folder" ); 828 pix = Resource::loadPixmap("folder" );
830 } 829 }
@@ -840,4 +839,4 @@ void OFileSelector::addDir(const QString &mime, QFileInfo *info, bool symlink )
840 new OFileSelectorItem(m_View, pix, 839 new OFileSelectorItem(m_View, pix,
841 name, info->lastModified().toString(), 840 name, info->lastModified().toString(),
842 QString::number(info->size() ),info->dirPath(true), locked, true ); 841 QString::number(info->size() ),info->dirPath(true), locked, true );
843 842
@@ -880,4 +879,4 @@ void OFileSelector::slotCurrentChanged(QListViewItem *item )
880 if(m_shLne ){ 879 if(m_shLne ){
881 m_edit->setText(sel->text(1) ); 880 m_edit->setText(sel->text(1) );
882 qWarning("setTexy" ); 881 qWarning("setTexy" );
883 } 882 }
@@ -904,9 +903,9 @@ void OFileSelector::slotClicked( int button, QListViewItem *item, const QPoint &
904 if(sel->isDir() ){ 903 if(sel->isDir() ){
905 cd( sel->directory() + "/" + str[0] ); 904 cd( sel->directory() + "/" + str[0] );
906 }else{ 905 }else{
907 qWarning("file" ); 906 qWarning("file" );
908 if(m_shLne ) 907 if(m_shLne )
909 m_edit->setText(str[0] ); 908 m_edit->setText(str[0] );
910 emit fileSelected(str[0] ); 909 emit fileSelected(str[0] );
911 // emit DocLnk need to do it 910 // emit DocLnk need to do it
912 } 911 }
@@ -941,3 +940,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
941 connect(&up, SIGNAL(activated() ), 940 connect(&up, SIGNAL(activated() ),
942 this, SLOT(cdUP() ) ); 941 this, SLOT(cdUP() ) );
943 942
@@ -949,3 +948,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
949 connect(&act, SIGNAL(activated() ), 948 connect(&act, SIGNAL(activated() ),
950 this, SLOT(slotChangedDir() ) ); 949 this, SLOT(slotChangedDir() ) );
951 }else{ 950 }else{
@@ -954,3 +953,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
954 connect(&act, SIGNAL(activated() ), 953 connect(&act, SIGNAL(activated() ),
955 this, SLOT(slotOpen() ) ); 954 this, SLOT(slotOpen() ) );
956 } 955 }
@@ -960,3 +959,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
960 connect(&rescan, SIGNAL(activated() ), 959 connect(&rescan, SIGNAL(activated() ),
961 this, SLOT(slotRescan() ) ); 960 this, SLOT(slotRescan() ) );
962 961
@@ -966,3 +965,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
966 connect(&rename, SIGNAL(activated() ), 965 connect(&rename, SIGNAL(activated() ),
967 this, SLOT(slotRename() ) ); 966 this, SLOT(slotRename() ) );
968 967
@@ -973,3 +972,3 @@ void OFileSelector::slotContextMenu(QListViewItem *item)
973 connect(&delItem, SIGNAL(activated() ), 972 connect(&delItem, SIGNAL(activated() ),
974 this, SLOT(slotDelete() ) ); 973 this, SLOT(slotDelete() ) );
975 974