summaryrefslogtreecommitdiff
authormickeyl <mickeyl>2004-08-25 13:50:57 (UTC)
committer mickeyl <mickeyl>2004-08-25 13:50:57 (UTC)
commite71d630b32fc3ecd2213bd27742c3b7a9a943867 (patch) (unidiff)
tree2312abbb7608db23b05861b71daed26ce1ba0073
parenta4c678976a3e3fd5afec1a9595a1a80ed621a5e2 (diff)
downloadopie-e71d630b32fc3ecd2213bd27742c3b7a9a943867.zip
opie-e71d630b32fc3ecd2213bd27742c3b7a9a943867.tar.gz
opie-e71d630b32fc3ecd2213bd27742c3b7a9a943867.tar.bz2
fix #1401 and upgrade ChangeLog
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--ChangeLog3
-rw-r--r--core/launcher/launcherview.cpp2
2 files changed, 3 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index b5d27c3..7228691 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,85 +1,88 @@
1 2004-??-??The Opie Team <opie@handhelds.org> 1 2004-??-??The Opie Team <opie@handhelds.org>
2 2
3 New Features 3 New Features
4 ------------ 4 ------------
5 * Fifteen gained configurable number of items (zecke) 5 * Fifteen gained configurable number of items (zecke)
6 * Fifteen can have custom background images (zecke) 6 * Fifteen can have custom background images (zecke)
7 * Added daemonizing capabilities to QWS Server [via Qt/Embedded] (mickeyl) 7 * Added daemonizing capabilities to QWS Server [via Qt/Embedded] (mickeyl)
8 * Integrated the new security framework into libopie2 (zecke,clem) 8 * Integrated the new security framework into libopie2 (zecke,clem)
9 * Converted the launcher to use the new security framework (zecke) 9 * Converted the launcher to use the new security framework (zecke)
10 * Backup can now handle custom locations for backup and restore (ar) 10 * Backup can now handle custom locations for backup and restore (ar)
11 * Implemented right-on-hold feedback (wimpie,zecke)
12 * Lots of new features in opie-reader (tim,pohly)
11 13
12 Fixed Bugs 14 Fixed Bugs
13 -------- 15 --------
14 * #1225 - Fixed repeated light flashing on Zaurus with keyz (mickeyl) 16 * #1225 - Fixed repeated light flashing on Zaurus with keyz (mickeyl)
15 * #1361 - Fixed auto upercase in Opie-Addressbook (eilers) 17 * #1361 - Fixed auto upercase in Opie-Addressbook (eilers)
16 * #1370 - Pimconverter now reacts on cancel key (eilers) 18 * #1370 - Pimconverter now reacts on cancel key (eilers)
19 * #1401 - Scrollbar is now only visible if necessary in DocTab (mickeyl)
17 20
18 2004-07-06The Opie Team <opie@handhelds.org> 21 2004-07-06The Opie Team <opie@handhelds.org>
19 22
20 * Tagged as Version 1.1.4 (devel) 23 * Tagged as Version 1.1.4 (devel)
21 24
22 New Features 25 New Features
23 ------------ 26 ------------
24 * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle) 27 * Added four themes courtesy Robert Griebl (http://www.softforge.de/zstyle)
25 * Added Conversion tool for pim-data (eilers) 28 * Added Conversion tool for pim-data (eilers)
26 * Introduced new OPimAccessFactory and OBackendFactory which simplyfies database access (eilers) 29 * Introduced new OPimAccessFactory and OBackendFactory which simplyfies database access (eilers)
27 * Modified the PIM API for providing generic use of OPimRecords (eilers) 30 * Modified the PIM API for providing generic use of OPimRecords (eilers)
28 * Clicking on the application symbol now iterates over the application's top level widgets if already raised (zecke) 31 * Clicking on the application symbol now iterates over the application's top level widgets if already raised (zecke)
29 32
30 Fixed Bugs 33 Fixed Bugs
31 -------- 34 --------
32 * #1068 - Country Drop Down Box Off Screen 35 * #1068 - Country Drop Down Box Off Screen
33 * #1291 - Opie tinykate does not open .desktop files (ar) 36 * #1291 - Opie tinykate does not open .desktop files (ar)
34 * #1291 - Opie sheet not saving correctly (ar) 37 * #1291 - Opie sheet not saving correctly (ar)
35 * #1294 - Opie does not know about British Summer Time 38 * #1294 - Opie does not know about British Summer Time
36 * #1314 - Drawpad initialization (mickeyl) 39 * #1314 - Drawpad initialization (mickeyl)
37 * #1317 - Packagemanager crashes on hold-down or install (chicken) 40 * #1317 - Packagemanager crashes on hold-down or install (chicken)
38 * #1321 - Batteryapplet graphic glitch (harlekin) 41 * #1321 - Batteryapplet graphic glitch (harlekin)
39 * #1324 - ZSafe not starting up (mickeyl) 42 * #1324 - ZSafe not starting up (mickeyl)
40 * #1328 - Personal Home Address fields is trimmed to 1char (eilers) 43 * #1328 - Personal Home Address fields is trimmed to 1char (eilers)
41 * #1327 - Opie-mail ipk does not depend on libopiedb2 (chicken) 44 * #1327 - Opie-mail ipk does not depend on libopiedb2 (chicken)
42 * #1345 - Networksettingsplugin wlan plugin dependency on libpcap0 (mickeyl) 45 * #1345 - Networksettingsplugin wlan plugin dependency on libpcap0 (mickeyl)
43 * #1348 - Datebook dependency on libopiedb2 (chicken) 46 * #1348 - Datebook dependency on libopiedb2 (chicken)
44 * #1328 - Switched SQLDatabase and VCards char encoding from latin1 to unicode (eilers) 47 * #1328 - Switched SQLDatabase and VCards char encoding from latin1 to unicode (eilers)
45 48
46 2004-04-25The Opie Team <opie@handhelds.org> 49 2004-04-25The Opie Team <opie@handhelds.org>
47 50
48 * Released as Version 1.1.3 (devel) 51 * Released as Version 1.1.3 (devel)
49 * Introduced first implementation of SQL-Support using SQLite (eilers) 52 * Introduced first implementation of SQL-Support using SQLite (eilers)
50 * Added a new Gutenberg Project reader app - opie-gutenbrowser (ljp) 53 * Added a new Gutenberg Project reader app - opie-gutenbrowser (ljp)
51 * Added a real system graffiti character set (brad) 54 * Added a real system graffiti character set (brad)
52 * Added Generic Keyconfig Widget (zecke) 55 * Added Generic Keyconfig Widget (zecke)
53 * Improved Screenshotapplet and Drawpad integration. You can now open a screenshot in drawpad and take notes (zecke) 56 * Improved Screenshotapplet and Drawpad integration. You can now open a screenshot in drawpad and take notes (zecke)
54 * Added new Bible reader app - opie-dagger (drw) 57 * Added new Bible reader app - opie-dagger (drw)
55 * Added a new Image Viewer. Work is ongoing (zecke,alwin) 58 * Added a new Image Viewer. Work is ongoing (zecke,alwin)
56 * Added namespace usage in libopie2 and everywhere (zecke,alwin) 59 * Added namespace usage in libopie2 and everywhere (zecke,alwin)
57 * Enabled the possibility to pass command line arguments to applications (mickeyl) 60 * Enabled the possibility to pass command line arguments to applications (mickeyl)
58 * Added an about applet showing some credits and information about Opie (mickeyl) 61 * Added an about applet showing some credits and information about Opie (mickeyl)
59 * Added benchmarking functionality to sysinfo (mickeyl) 62 * Added benchmarking functionality to sysinfo (mickeyl)
60 * Added applet and configuration application for switching hardware keyboard layouts (alwin) 63 * Added applet and configuration application for switching hardware keyboard layouts (alwin)
61 * Ported applications from libopie1 to libopie2* (drw,ar,alwin) 64 * Ported applications from libopie1 to libopie2* (drw,ar,alwin)
62 * Imported fullscreen and font improvements from the Qkonsole fork to embeddedkonsole (waspe) 65 * Imported fullscreen and font improvements from the Qkonsole fork to embeddedkonsole (waspe)
63 * Clean-up of package information in control files (drw) 66 * Clean-up of package information in control files (drw)
64 * Repaired mediummount which was broken since integrating the quicklauncher (alwin) 67 * Repaired mediummount which was broken since integrating the quicklauncher (alwin)
65 * Improved big-screen support (zecke,ar) 68 * Improved big-screen support (zecke,ar)
66 * Improved multikeyboard support, added keyboard layout switching applet (mouse) 69 * Improved multikeyboard support, added keyboard layout switching applet (mouse)
67 * Added a new mail client based on libetpan (harlekin,alwin,jgf) 70 * Added a new mail client based on libetpan (harlekin,alwin,jgf)
68 * Added new package manager - opie-packagemanager (drw) 71 * Added new package manager - opie-packagemanager (drw)
69 * Improved light-n-power for C7x0 (mickeyl) 72 * Improved light-n-power for C7x0 (mickeyl)
70 * Added automatic rotation support for C7x0 (treke) 73 * Added automatic rotation support for C7x0 (treke)
71 * Split libopie1 up into a set of smaller - functionally grouped - libraries (mickeyl) 74 * Split libopie1 up into a set of smaller - functionally grouped - libraries (mickeyl)
72 * Added scanning the wireless network neighbourhood to networksettings (mickeyl) 75 * Added scanning the wireless network neighbourhood to networksettings (mickeyl)
73 76
74 2003-11-29The Opie Team <opie@handhelds.org> 77 2003-11-29The Opie Team <opie@handhelds.org>
75 78
76 * Released as Version 1.0.3 79 * Released as Version 1.0.3
77 * Improved i18n (various contributors) 80 * Improved i18n (various contributors)
78 * Reduced application startup time by integrating the TT quicklauncher (zecke,harlekin) 81 * Reduced application startup time by integrating the TT quicklauncher (zecke,harlekin)
79 * Made the Documents Tab optional (mickeyl) 82 * Made the Documents Tab optional (mickeyl)
80 * Integrated basic support for HP iPAQ 54xx and the Jornada 5xx (chicken) 83 * Integrated basic support for HP iPAQ 54xx and the Jornada 5xx (chicken)
81 84
82 2003-08-04The Opie Team <opie@handhelds.org> 85 2003-08-04The Opie Team <opie@handhelds.org>
83 86
84 * Released as Version 1.0.0 87 * Released as Version 1.0.0
85 * Including a PPP module for easy dial up (tille,harlekin,zecke) 88 * Including a PPP module for easy dial up (tille,harlekin,zecke)
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
@@ -469,386 +469,384 @@ void LauncherItem::animateIcon()
469 rgb = img.colorTable(); 469 rgb = img.colorTable();
470 count = img.numColors(); 470 count = img.numColors();
471 } 471 }
472 for ( int r = 0; r < count; r++, rgb++ ) { 472 for ( int r = 0; r < count; r++, rgb++ ) {
473#if defined(BRIGHTEN_BUSY_ICON) 473#if defined(BRIGHTEN_BUSY_ICON)
474 QColor c(*rgb); 474 QColor c(*rgb);
475 int h, s, v; 475 int h, s, v;
476 c.hsv(&h,&s,&v); 476 c.hsv(&h,&s,&v);
477 c.setHsv(h,QMAX(s-24,0),QMIN(v+48,255)); 477 c.setHsv(h,QMAX(s-24,0),QMIN(v+48,255));
478 *rgb = qRgba(c.red(),c.green(),c.blue(),qAlpha(*rgb)); 478 *rgb = qRgba(c.red(),c.green(),c.blue(),qAlpha(*rgb));
479#elif defined(ALPHA_FADE_BUSY_ICON) 479#elif defined(ALPHA_FADE_BUSY_ICON)
480 *rgb = qRgba(qRed(*rgb),qGreen(*rgb),qBlue(*rgb),qAlpha(*rgb)/2); 480 *rgb = qRgba(qRed(*rgb),qGreen(*rgb),qBlue(*rgb),qAlpha(*rgb)/2);
481#endif 481#endif
482 } 482 }
483 src.convertFromImage( img ); 483 src.convertFromImage( img );
484 setPixmap( src ); 484 setPixmap( src );
485 } 485 }
486 486
487 iteration++; 487 iteration++;
488 488
489 // Paint animation overlay 489 // Paint animation overlay
490 QPainter p( liv->viewport() ); 490 QPainter p( liv->viewport() );
491 paintAnimatedIcon( &p ); 491 paintAnimatedIcon( &p );
492} 492}
493 493
494void LauncherItem::resetIcon() 494void LauncherItem::resetIcon()
495{ 495{
496 iteration = 0; 496 iteration = 0;
497 setPixmap( isBigIcon ? app->bigPixmap() : app->pixmap() ); 497 setPixmap( isBigIcon ? app->bigPixmap() : app->pixmap() );
498} 498}
499 499
500//=========================================================================== 500//===========================================================================
501 501
502QStringList LauncherIconView::mimeTypes() const 502QStringList LauncherIconView::mimeTypes() const
503{ 503{
504 QStringList r; 504 QStringList r;
505 QDictIterator<void> it(mimes); 505 QDictIterator<void> it(mimes);
506 while (it.current()) { 506 while (it.current()) {
507 r.append(it.currentKey()); 507 r.append(it.currentKey());
508 ++it; 508 ++it;
509 } 509 }
510 r.sort(); 510 r.sort();
511 return r; 511 return r;
512} 512}
513 513
514void LauncherIconView::addItem(AppLnk* app, bool resort) 514void LauncherIconView::addItem(AppLnk* app, bool resort)
515{ 515{
516 addCatsAndMimes(app); 516 addCatsAndMimes(app);
517 517
518 if ( (tf.isEmpty() || tf.match(app->type()) >= 0) 518 if ( (tf.isEmpty() || tf.match(app->type()) >= 0)
519 && (cf == 0 || app->categories().contains(cf) 519 && (cf == 0 || app->categories().contains(cf)
520 || cf == -1 && app->categories().count() == 0 ) ) 520 || cf == -1 && app->categories().count() == 0 ) )
521 (void) new LauncherItem( this, app, bigIcns ); 521 (void) new LauncherItem( this, app, bigIcns );
522 else 522 else
523 hidden.append(app); 523 hidden.append(app);
524 if ( resort ) 524 if ( resort )
525 sort(); 525 sort();
526} 526}
527 527
528void LauncherIconView::updateCategoriesAndMimeTypes() 528void LauncherIconView::updateCategoriesAndMimeTypes()
529{ 529{
530 mimes.clear(); 530 mimes.clear();
531 cats.clear(); 531 cats.clear();
532 LauncherItem* item = (LauncherItem*)firstItem(); 532 LauncherItem* item = (LauncherItem*)firstItem();
533 while (item) { 533 while (item) {
534 addCatsAndMimes(item->appLnk()); 534 addCatsAndMimes(item->appLnk());
535 item = (LauncherItem*)item->nextItem(); 535 item = (LauncherItem*)item->nextItem();
536 } 536 }
537 QListIterator<AppLnk> it(hidden); 537 QListIterator<AppLnk> it(hidden);
538 AppLnk* l; 538 AppLnk* l;
539 while ((l=it.current())) { 539 while ((l=it.current())) {
540 addCatsAndMimes(l); 540 addCatsAndMimes(l);
541 ++it; 541 ++it;
542 } 542 }
543} 543}
544 544
545void LauncherIconView::hideOrShowItems(bool resort) 545void LauncherIconView::hideOrShowItems(bool resort)
546{ 546{
547 viewport()->setUpdatesEnabled( FALSE ); 547 viewport()->setUpdatesEnabled( FALSE );
548 hidden.setAutoDelete(FALSE); 548 hidden.setAutoDelete(FALSE);
549 QList<AppLnk> links=hidden; 549 QList<AppLnk> links=hidden;
550 hidden.clear(); 550 hidden.clear();
551 hidden.setAutoDelete(TRUE); 551 hidden.setAutoDelete(TRUE);
552 LauncherItem* item = (LauncherItem*)firstItem(); 552 LauncherItem* item = (LauncherItem*)firstItem();
553 while (item) { 553 while (item) {
554 links.append(item->takeAppLnk()); 554 links.append(item->takeAppLnk());
555 item = (LauncherItem*)item->nextItem(); 555 item = (LauncherItem*)item->nextItem();
556 } 556 }
557 clear(); 557 clear();
558 QListIterator<AppLnk> it(links); 558 QListIterator<AppLnk> it(links);
559 AppLnk* l; 559 AppLnk* l;
560 while ((l=it.current())) { 560 while ((l=it.current())) {
561 addItem(l,FALSE); 561 addItem(l,FALSE);
562 ++it; 562 ++it;
563 } 563 }
564 if ( resort && !autoArrange() ) 564 if ( resort && !autoArrange() )
565 sort(); 565 sort();
566 viewport()->setUpdatesEnabled( TRUE ); 566 viewport()->setUpdatesEnabled( TRUE );
567} 567}
568 568
569bool LauncherIconView::removeLink(const QString& linkfile) 569bool LauncherIconView::removeLink(const QString& linkfile)
570{ 570{
571 LauncherItem* item = (LauncherItem*)firstItem(); 571 LauncherItem* item = (LauncherItem*)firstItem();
572 AppLnk* l; 572 AppLnk* l;
573 bool did = FALSE; 573 bool did = FALSE;
574 DocLnk dl(linkfile); 574 DocLnk dl(linkfile);
575 while (item) { 575 while (item) {
576 l = item->appLnk(); 576 l = item->appLnk();
577 LauncherItem *nextItem = (LauncherItem *)item->nextItem(); 577 LauncherItem *nextItem = (LauncherItem *)item->nextItem();
578 if ( l->linkFileKnown() && l->linkFile() == linkfile 578 if ( l->linkFileKnown() && l->linkFile() == linkfile
579 || l->fileKnown() && ( 579 || l->fileKnown() && (
580 l->file() == linkfile 580 l->file() == linkfile
581 || dl.isValid() && dl.file() == l->file() ) ) { 581 || dl.isValid() && dl.file() == l->file() ) ) {
582 delete item; 582 delete item;
583 did = TRUE; 583 did = TRUE;
584 } 584 }
585 item = nextItem; 585 item = nextItem;
586 } 586 }
587 QListIterator<AppLnk> it(hidden); 587 QListIterator<AppLnk> it(hidden);
588 while ((l=it.current())) { 588 while ((l=it.current())) {
589 ++it; 589 ++it;
590 if ( l->linkFileKnown() && l->linkFile() == linkfile 590 if ( l->linkFileKnown() && l->linkFile() == linkfile
591 || l->file() == linkfile 591 || l->file() == linkfile
592 || dl.isValid() && dl.file() == l->file() ) { 592 || dl.isValid() && dl.file() == l->file() ) {
593 hidden.removeRef(l); 593 hidden.removeRef(l);
594 did = TRUE; 594 did = TRUE;
595 } 595 }
596 } 596 }
597 return did; 597 return did;
598} 598}
599 599
600//=========================================================================== 600//===========================================================================
601 601
602LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl ) 602LauncherView::LauncherView( QWidget* parent, const char* name, WFlags fl )
603 : QVBox( parent, name, fl ) 603 : QVBox( parent, name, fl )
604{ 604{
605 catmb = 0; 605 catmb = 0;
606 icons = new LauncherIconView( this ); 606 icons = new LauncherIconView( this );
607 setFocusProxy(icons); 607 setFocusProxy(icons);
608 QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold ); 608 QPEApplication::setStylusOperation( icons->viewport(), QPEApplication::RightOnHold );
609 609
610 icons->setItemsMovable( FALSE ); 610 icons->setItemsMovable( FALSE );
611 icons->setAutoArrange( TRUE ); 611 icons->setAutoArrange( TRUE );
612 icons->setSorting( TRUE ); 612 icons->setSorting( TRUE );
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);
711 709
712 int pcat = catmb ? catmb->currentCategory() : -2; 710 int pcat = catmb ? catmb->currentCategory() : -2;
713 if ( !catmb ) 711 if ( !catmb )
714 catmb = new CategorySelect(tools); 712 catmb = new CategorySelect(tools);
715 Categories cats( 0 ); 713 Categories cats( 0 );
716 cats.load( categoryFileName() ); 714 cats.load( categoryFileName() );
717 QArray<int> vl( 0 ); 715 QArray<int> vl( 0 );
718 catmb->setCategories( vl, "Document View", // No tr 716 catmb->setCategories( vl, "Document View", // No tr
719 tr("Document View") ); 717 tr("Document View") );
720 catmb->setRemoveCategoryEdit( TRUE ); 718 catmb->setRemoveCategoryEdit( TRUE );
721 catmb->setAllCategories( TRUE ); 719 catmb->setAllCategories( TRUE );
722 catmb->setCurrentCategory(pcat); 720 catmb->setCurrentCategory(pcat);
723 721
724 // if type has changed we need to redisplay 722 // if type has changed we need to redisplay
725 if ( typemb->currentText() != prev ) 723 if ( typemb->currentText() != prev )
726 showType( typemb->currentItem() ); 724 showType( typemb->currentItem() );
727 725
728 connect(typemb, SIGNAL(activated(int)), this, SLOT(showType(int))); 726 connect(typemb, SIGNAL(activated(int)), this, SLOT(showType(int)));
729 connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int))); 727 connect(catmb, SIGNAL(signalSelected(int)), this, SLOT(showCategory(int)));
730} 728}
731 729
732void LauncherView::sortBy(int s) 730void LauncherView::sortBy(int s)
733{ 731{
734 icons->setSortMethod((LauncherIconView::SortMethod)s); 732 icons->setSortMethod((LauncherIconView::SortMethod)s);
735} 733}
736 734
737void LauncherView::showType(int t) 735void LauncherView::showType(int t)
738{ 736{
739 if ( t >= (int)typelist.count() ) { 737 if ( t >= (int)typelist.count() ) {
740 icons->setTypeFilter("",TRUE); 738 icons->setTypeFilter("",TRUE);
741 } else { 739 } else {
742 QString ty = typelist[t]; 740 QString ty = typelist[t];
743 if ( !ty.contains('/') ) 741 if ( !ty.contains('/') )
744 ty += "/*"; 742 ty += "/*";
745 icons->setTypeFilter(ty,TRUE); 743 icons->setTypeFilter(ty,TRUE);
746 } 744 }
747} 745}
748 746
749void LauncherView::showCategory( int c ) 747void LauncherView::showCategory( int c )
750{ 748{
751 icons->setCategoryFilter( c, TRUE ); 749 icons->setCategoryFilter( c, TRUE );
752} 750}
753 751
754void LauncherView::setViewMode( ViewMode m ) 752void LauncherView::setViewMode( ViewMode m )
755{ 753{
756 if ( vmode != m ) { 754 if ( vmode != m ) {
757 bool bigIcons = m == Icon; 755 bool bigIcons = m == Icon;
758 icons->viewport()->setUpdatesEnabled( FALSE ); 756 icons->viewport()->setUpdatesEnabled( FALSE );
759 icons->setBigIcons( bigIcons ); 757 icons->setBigIcons( bigIcons );
760 switch ( m ) { 758 switch ( m ) {
761 case List: 759 case List:
762 icons->setItemTextPos( QIconView::Right ); 760 icons->setItemTextPos( QIconView::Right );
763 break; 761 break;
764 case Icon: 762 case Icon:
765 icons->setItemTextPos( QIconView::Bottom ); 763 icons->setItemTextPos( QIconView::Bottom );
766 break; 764 break;
767 } 765 }
768 icons->hideOrShowItems( FALSE ); 766 icons->hideOrShowItems( FALSE );
769 icons->viewport()->setUpdatesEnabled( TRUE ); 767 icons->viewport()->setUpdatesEnabled( TRUE );
770 vmode = m; 768 vmode = m;
771 } 769 }
772} 770}
773 771
774// 772//
775// User images may require scaling. 773// User images may require scaling.
776// 774//
777QImage LauncherView::loadBackgroundImage(QString &bgName) 775QImage LauncherView::loadBackgroundImage(QString &bgName)
778{ 776{
779 QImageIO imgio; 777 QImageIO imgio;
780 QSize ds = qApp->desktop()->size(); // should be launcher, not desktop 778 QSize ds = qApp->desktop()->size(); // should be launcher, not desktop
781 bool further_scaling = TRUE; 779 bool further_scaling = TRUE;
782 780
783 imgio.setFileName( bgName ); 781 imgio.setFileName( bgName );
784 imgio.setParameters("GetHeaderInformation"); 782 imgio.setParameters("GetHeaderInformation");
785 783
786 if (imgio.read() == FALSE) { 784 if (imgio.read() == FALSE) {
787 return imgio.image(); 785 return imgio.image();
788 } 786 }
789 787
790 if (imgio.image().width() < ds.width() && 788 if (imgio.image().width() < ds.width() &&
791 imgio.image().height() < ds.height()) { 789 imgio.image().height() < ds.height()) {
792 further_scaling = FALSE; 790 further_scaling = FALSE;
793 } 791 }
794 792
795 if (!imgio.image().bits()) { 793 if (!imgio.image().bits()) {
796 // 794 //
797 // Scale and load. Note we don't scale up. 795 // Scale and load. Note we don't scale up.
798 // 796 //
799 QString param( "Scale( %1, %2, ScaleMin )" ); // No tr 797 QString param( "Scale( %1, %2, ScaleMin )" ); // No tr
800 imgio.setParameters(further_scaling ? 798 imgio.setParameters(further_scaling ?
801 param.arg(ds.width()).arg(ds.height()).latin1() : 799 param.arg(ds.width()).arg(ds.height()).latin1() :
802 ""); 800 "");
803 imgio.read(); 801 imgio.read();
804 } else { 802 } else {
805 if (further_scaling) { 803 if (further_scaling) {
806 intt1 = imgio.image().width() * ds.height(); 804 intt1 = imgio.image().width() * ds.height();
807 int t2 = imgio.image().height() * ds.width(); 805 int t2 = imgio.image().height() * ds.width();
808 int dsth = ds.height(); 806 int dsth = ds.height();
809 int dstw = ds.width(); 807 int dstw = ds.width();
810 808
811 if (t1 > t2) { 809 if (t1 > t2) {
812 dsth = t2 / imgio.image().width(); 810 dsth = t2 / imgio.image().width();
813 } else { 811 } else {
814 dstw = t1 / imgio.image().height(); 812 dstw = t1 / imgio.image().height();
815 } 813 }
816 814
817 // 815 //
818 // Loader didn't scale for us. Do it manually. 816 // Loader didn't scale for us. Do it manually.
819 // 817 //
820 return imgio.image().smoothScale(dstw, dsth); 818 return imgio.image().smoothScale(dstw, dsth);
821 } 819 }
822 } 820 }
823 821
824 return imgio.image(); 822 return imgio.image();
825} 823}
826 824
827void LauncherView::setBackgroundType( BackgroundType t, const QString &val ) 825void LauncherView::setBackgroundType( BackgroundType t, const QString &val )
828{ 826{
829 if ( !bgCache ) { 827 if ( !bgCache ) {
830 bgCache = new QMap<QString,BgPixmap*>; 828 bgCache = new QMap<QString,BgPixmap*>;
831 qAddPostRoutine( cleanup_cache ); 829 qAddPostRoutine( cleanup_cache );
832 } 830 }
833 831
834 if ( bgCache->contains( bgName ) ) 832 if ( bgCache->contains( bgName ) )
835 (*bgCache)[bgName]->ref--; 833 (*bgCache)[bgName]->ref--;
836 bgName = ""; 834 bgName = "";
837 835
838 QPixmap bg; 836 QPixmap bg;
839 837
840 switch ( t ) { 838 switch ( t ) {
841 case Ruled: { 839 case Ruled: {
842 bgName = QString("Ruled_%1").arg(colorGroup().background().name()); // No tr 840 bgName = QString("Ruled_%1").arg(colorGroup().background().name()); // No tr
843 if ( bgCache->contains( bgName ) ) { 841 if ( bgCache->contains( bgName ) ) {
844 (*bgCache)[bgName]->ref++; 842 (*bgCache)[bgName]->ref++;
845 bg = (*bgCache)[bgName]->pm; 843 bg = (*bgCache)[bgName]->pm;
846 } else { 844 } else {
847 bg.resize( width(), 9 ); 845 bg.resize( width(), 9 );
848 QPainter painter( &bg ); 846 QPainter painter( &bg );
849 for ( int i = 0; i < 3; i++ ) { 847 for ( int i = 0; i < 3; i++ ) {
850 painter.setPen( white ); 848 painter.setPen( white );
851 painter.drawLine( 0, i*3, width()-1, i*3 ); 849 painter.drawLine( 0, i*3, width()-1, i*3 );
852 painter.drawLine( 0, i*3+1, width()-1, i*3+1 ); 850 painter.drawLine( 0, i*3+1, width()-1, i*3+1 );
853 painter.setPen( colorGroup().background().light(105) ); 851 painter.setPen( colorGroup().background().light(105) );
854 painter.drawLine( 0, i*3+2, width()-1, i*3+2 ); 852 painter.drawLine( 0, i*3+2, width()-1, i*3+2 );