summaryrefslogtreecommitdiff
path: root/core/launcher/launcherview.cpp
authormickeyl <mickeyl>2004-08-25 13:50:57 (UTC)
committer mickeyl <mickeyl>2004-08-25 13:50:57 (UTC)
commite71d630b32fc3ecd2213bd27742c3b7a9a943867 (patch) (unidiff)
tree2312abbb7608db23b05861b71daed26ce1ba0073 /core/launcher/launcherview.cpp
parenta4c678976a3e3fd5afec1a9595a1a80ed621a5e2 (diff)
downloadopie-e71d630b32fc3ecd2213bd27742c3b7a9a943867.zip
opie-e71d630b32fc3ecd2213bd27742c3b7a9a943867.tar.gz
opie-e71d630b32fc3ecd2213bd27742c3b7a9a943867.tar.bz2
fix #1401 and upgrade ChangeLog
Diffstat (limited to 'core/launcher/launcherview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcherview.cpp2
1 files changed, 0 insertions, 2 deletions
diff --git a/core/launcher/launcherview.cpp b/core/launcher/launcherview.cpp
index e86f389..0d0f2cb 100644
--- a/core/launcher/launcherview.cpp
+++ b/core/launcher/launcherview.cpp
@@ -613,98 +613,96 @@ LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
613 icons->setFrameStyle( QFrame::NoFrame ); 613 icons->setFrameStyle( QFrame::NoFrame );
614 icons->setMargin( 0 ); 614 icons->setMargin( 0 );
615 icons->setSelectionMode( QIconView::NoSelection ); 615 icons->setSelectionMode( QIconView::NoSelection );
616 icons->setBackgroundMode( PaletteBase ); 616 icons->setBackgroundMode( PaletteBase );
617 icons->setResizeMode( QIconView::Fixed ); 617 icons->setResizeMode( QIconView::Fixed );
618 vmode = (ViewMode)-1; 618 vmode = (ViewMode)-1;
619 setViewMode( Icon ); 619 setViewMode( Icon );
620 620
621 connect( icons, SIGNAL(mouseButtonClicked(int,QIconViewItem*,const QPoint&)), 621 connect( icons, SIGNAL(mouseButtonClicked(int,QIconViewItem*,const QPoint&)),
622 SLOT(itemClicked(int,QIconViewItem*)) ); 622 SLOT(itemClicked(int,QIconViewItem*)) );
623 connect( icons, SIGNAL(selectionChanged()), 623 connect( icons, SIGNAL(selectionChanged()),
624 SLOT(selectionChanged()) ); 624 SLOT(selectionChanged()) );
625 connect( icons, SIGNAL(returnPressed(QIconViewItem*)), 625 connect( icons, SIGNAL(returnPressed(QIconViewItem*)),
626 SLOT(returnPressed(QIconViewItem*)) ); 626 SLOT(returnPressed(QIconViewItem*)) );
627 connect( icons, SIGNAL(mouseButtonPressed(int,QIconViewItem*,const QPoint&)), 627 connect( icons, SIGNAL(mouseButtonPressed(int,QIconViewItem*,const QPoint&)),
628 SLOT(itemPressed(int,QIconViewItem*)) ); 628 SLOT(itemPressed(int,QIconViewItem*)) );
629 629
630 tools = 0; 630 tools = 0;
631 setBackgroundType( Ruled, QString::null ); 631 setBackgroundType( Ruled, QString::null );
632} 632}
633 633
634LauncherView::~LauncherView() 634LauncherView::~LauncherView()
635{ 635{
636 if ( bgCache && bgCache->contains( bgName ) ) 636 if ( bgCache && bgCache->contains( bgName ) )
637 (*bgCache)[bgName]->ref--; 637 (*bgCache)[bgName]->ref--;
638} 638}
639 639
640void LauncherView::hideIcons() 640void LauncherView::hideIcons()
641{ 641{
642 icons->hide(); 642 icons->hide();
643} 643}
644 644
645void LauncherView::setToolsEnabled(bool y) 645void LauncherView::setToolsEnabled(bool y)
646{ 646{
647 if ( !y != !tools ) { 647 if ( !y != !tools ) {
648 if ( y ) { 648 if ( y ) {
649 tools = new QHBox(this); 649 tools = new QHBox(this);
650 650
651 // Type filter 651 // Type filter
652 typemb = new QComboBox(tools); 652 typemb = new QComboBox(tools);
653 QSizePolicy p = typemb->sizePolicy(); 653 QSizePolicy p = typemb->sizePolicy();
654 p.setHorData(QSizePolicy::Expanding); 654 p.setHorData(QSizePolicy::Expanding);
655 typemb->setSizePolicy(p); 655 typemb->setSizePolicy(p);
656 656
657 // Category filter 657 // Category filter
658 updateTools(); 658 updateTools();
659 tools->show(); 659 tools->show();
660 660
661 // Always show vscrollbar
662 icons->setVScrollBarMode( QScrollView::AlwaysOn );
663 } else { 661 } else {
664 delete tools; 662 delete tools;
665 tools = 0; 663 tools = 0;
666 } 664 }
667 } 665 }
668} 666}
669 667
670void LauncherView::updateTools() 668void LauncherView::updateTools()
671{ 669{
672 disconnect( typemb, SIGNAL(activated(int)), 670 disconnect( typemb, SIGNAL(activated(int)),
673 this, SLOT(showType(int)) ); 671 this, SLOT(showType(int)) );
674 if ( catmb ) disconnect( catmb, SIGNAL(signalSelected(int)), 672 if ( catmb ) disconnect( catmb, SIGNAL(signalSelected(int)),
675 this, SLOT(showCategory(int)) ); 673 this, SLOT(showCategory(int)) );
676 674
677 // ### I want to remove this 675 // ### I want to remove this
678 icons->updateCategoriesAndMimeTypes(); 676 icons->updateCategoriesAndMimeTypes();
679 677
680 QString prev; 678 QString prev;
681 679
682 // Type filter 680 // Type filter
683 QStringList types; 681 QStringList types;
684 typelist = icons->mimeTypes(); 682 typelist = icons->mimeTypes();
685 for (QStringList::ConstIterator it = typelist.begin(); it!=typelist.end(); ++it) { 683 for (QStringList::ConstIterator it = typelist.begin(); it!=typelist.end(); ++it) {
686 QString t = *it; 684 QString t = *it;
687 if ( t.left(12) == "application/" ) { 685 if ( t.left(12) == "application/" ) {
688 MimeType mt(t); 686 MimeType mt(t);
689 const AppLnk* app = mt.application(); 687 const AppLnk* app = mt.application();
690 if ( app ) 688 if ( app )
691 t = app->name(); 689 t = app->name();
692 else 690 else
693 t = t.mid(12); 691 t = t.mid(12);
694 } else { 692 } else {
695 t[0] = t[0].upper(); 693 t[0] = t[0].upper();
696 } 694 }
697 types += t; 695 types += t;
698 } 696 }
699 types << tr("All types"); 697 types << tr("All types");
700 prev = typemb->currentText(); 698 prev = typemb->currentText();
701 typemb->clear(); 699 typemb->clear();
702 typemb->insertStringList(types); 700 typemb->insertStringList(types);
703 for (int i=0; i<typemb->count(); i++) { 701 for (int i=0; i<typemb->count(); i++) {
704 if ( typemb->text(i) == prev ) { 702 if ( typemb->text(i) == prev ) {
705 typemb->setCurrentItem(i); 703 typemb->setCurrentItem(i);
706 break; 704 break;
707 } 705 }
708 } 706 }
709 if ( prev.isNull() ) 707 if ( prev.isNull() )
710 typemb->setCurrentItem(typemb->count()-1); 708 typemb->setCurrentItem(typemb->count()-1);