-rw-r--r-- | core/launcher/launcher.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 98e7481..7887704 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -598,114 +598,116 @@ void Launcher::select( const AppLnk *appLnk ) | |||
598 | Global::execute("textedit",appLnk->file()); | 598 | Global::execute("textedit",appLnk->file()); |
599 | 599 | ||
600 | return; | 600 | return; |
601 | } | 601 | } |
602 | tabs->setBusy(TRUE); | 602 | tabs->setBusy(TRUE); |
603 | emit executing( appLnk ); | 603 | emit executing( appLnk ); |
604 | appLnk->execute(); | 604 | appLnk->execute(); |
605 | } | 605 | } |
606 | } | 606 | } |
607 | 607 | ||
608 | void Launcher::properties( AppLnk *appLnk ) | 608 | void Launcher::properties( AppLnk *appLnk ) |
609 | { | 609 | { |
610 | if ( appLnk->type() == "Folder" ) { // No tr | 610 | if ( appLnk->type() == "Folder" ) { // No tr |
611 | // Not supported: flat is simpler for the user | 611 | // Not supported: flat is simpler for the user |
612 | } else { | 612 | } else { |
613 | /* ### libqtopia FIXME also moving docLnks... */ | 613 | /* ### libqtopia FIXME also moving docLnks... */ |
614 | LnkProperties prop(appLnk,0 ); | 614 | LnkProperties prop(appLnk,0 ); |
615 | 615 | ||
616 | QPEApplication::execDialog( &prop ); | 616 | QPEApplication::execDialog( &prop ); |
617 | } | 617 | } |
618 | } | 618 | } |
619 | 619 | ||
620 | void Launcher::storageChanged( const QList<FileSystem> &fs ) | 620 | void Launcher::storageChanged( const QList<FileSystem> &fs ) |
621 | { | 621 | { |
622 | // ### update combo boxes if we had a combo box for the storage type | 622 | // ### update combo boxes if we had a combo box for the storage type |
623 | } | 623 | } |
624 | 624 | ||
625 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | 625 | void Launcher::systemMessage( const QCString &msg, const QByteArray &data) |
626 | { | 626 | { |
627 | QDataStream stream( data, IO_ReadOnly ); | 627 | QDataStream stream( data, IO_ReadOnly ); |
628 | if ( msg == "busy()" ) { | 628 | if ( msg == "busy()" ) { |
629 | tb->startWait(); | 629 | tb->startWait(); |
630 | } else if ( msg == "notBusy(QString)" ) { | 630 | } else if ( msg == "notBusy(QString)" ) { |
631 | QString app; | 631 | QString app; |
632 | stream >> app; | 632 | stream >> app; |
633 | tabs->setBusy(FALSE); | 633 | tabs->setBusy(FALSE); |
634 | tb->stopWait(app); | 634 | tb->stopWait(app); |
635 | } else if (msg == "applyStyle()") { | 635 | } else if (msg == "applyStyle()") { |
636 | tabs->currentView()->relayout(); | 636 | tabs->currentView()->relayout(); |
637 | } | 637 | } |
638 | } | 638 | } |
639 | 639 | ||
640 | // These are the update functions from the server | 640 | // These are the update functions from the server |
641 | void Launcher::typeAdded( const QString& type, const QString& name, | 641 | void Launcher::typeAdded( const QString& type, const QString& name, |
642 | const QPixmap& pixmap, const QPixmap& ) | 642 | const QPixmap& pixmap, const QPixmap& ) |
643 | { | 643 | { |
644 | tabs->newView( type, pixmap, name ); | 644 | tabs->newView( type, pixmap, name ); |
645 | ids.append( type ); | 645 | ids.append( type ); |
646 | tb->refreshStartMenu(); | 646 | /* this will be called in applicationScanningProgress with value 100! */ |
647 | // tb->refreshStartMenu(); | ||
647 | 648 | ||
648 | static bool first = TRUE; | 649 | static bool first = TRUE; |
649 | if ( first ) { | 650 | if ( first ) { |
650 | first = FALSE; | 651 | first = FALSE; |
651 | tabs->categoryBar->showTab(type); | 652 | tabs->categoryBar->showTab(type); |
652 | } | 653 | } |
653 | 654 | ||
654 | tabs->view( type )->setUpdatesEnabled( FALSE ); | 655 | tabs->view( type )->setUpdatesEnabled( FALSE ); |
655 | tabs->view( type )->setSortEnabled( FALSE ); | 656 | tabs->view( type )->setSortEnabled( FALSE ); |
656 | } | 657 | } |
657 | 658 | ||
658 | void Launcher::typeRemoved( const QString& type ) | 659 | void Launcher::typeRemoved( const QString& type ) |
659 | { | 660 | { |
660 | tabs->view( type )->removeAllItems(); | 661 | tabs->view( type )->removeAllItems(); |
661 | tabs->deleteView( type ); | 662 | tabs->deleteView( type ); |
662 | ids.remove( type ); | 663 | ids.remove( type ); |
663 | tb->refreshStartMenu(); | 664 | /* this will be called in applicationScanningProgress with value 100! */ |
665 | // tb->refreshStartMenu(); | ||
664 | } | 666 | } |
665 | 667 | ||
666 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) | 668 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) |
667 | { | 669 | { |
668 | if ( app.type() == "Separator" ) // No tr | 670 | if ( app.type() == "Separator" ) // No tr |
669 | return; | 671 | return; |
670 | 672 | ||
671 | LauncherView *view = tabs->view( type ); | 673 | LauncherView *view = tabs->view( type ); |
672 | if ( view ) | 674 | if ( view ) |
673 | view->addItem( new AppLnk( app ), FALSE ); | 675 | view->addItem( new AppLnk( app ), FALSE ); |
674 | else | 676 | else |
675 | qWarning("addAppLnk: No view for type %s. Can't add app %s!", | 677 | qWarning("addAppLnk: No view for type %s. Can't add app %s!", |
676 | type.latin1(),app.name().latin1() ); | 678 | type.latin1(),app.name().latin1() ); |
677 | 679 | ||
678 | MimeType::registerApp( app ); | 680 | MimeType::registerApp( app ); |
679 | } | 681 | } |
680 | 682 | ||
681 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) | 683 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) |
682 | { | 684 | { |
683 | LauncherView *view = tabs->view( type ); | 685 | LauncherView *view = tabs->view( type ); |
684 | if ( view ) | 686 | if ( view ) |
685 | view->removeLink( app.linkFile() ); | 687 | view->removeLink( app.linkFile() ); |
686 | else | 688 | else |
687 | qWarning("removeAppLnk: No view for %s!", type.latin1() ); | 689 | qWarning("removeAppLnk: No view for %s!", type.latin1() ); |
688 | } | 690 | } |
689 | 691 | ||
690 | void Launcher::allApplicationsRemoved() | 692 | void Launcher::allApplicationsRemoved() |
691 | { | 693 | { |
692 | MimeType::clear(); | 694 | MimeType::clear(); |
693 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) | 695 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) |
694 | tabs->view( (*it) )->removeAllItems(); | 696 | tabs->view( (*it) )->removeAllItems(); |
695 | } | 697 | } |
696 | 698 | ||
697 | void Launcher::documentAdded( const DocLnk& doc ) | 699 | void Launcher::documentAdded( const DocLnk& doc ) |
698 | { | 700 | { |
699 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); | 701 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); |
700 | } | 702 | } |
701 | 703 | ||
702 | void Launcher::showLoadingDocs() | 704 | void Launcher::showLoadingDocs() |
703 | { | 705 | { |
704 | tabs->docView()->hide(); | 706 | tabs->docView()->hide(); |
705 | } | 707 | } |
706 | 708 | ||
707 | void Launcher::showDocTab() | 709 | void Launcher::showDocTab() |
708 | { | 710 | { |
709 | if ( tabs->categoryBar->currentView() == tabs->docView() ) | 711 | if ( tabs->categoryBar->currentView() == tabs->docView() ) |
710 | tabs->docView()->show(); | 712 | tabs->docView()->show(); |
711 | } | 713 | } |
@@ -723,56 +725,57 @@ void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) | |||
723 | 725 | ||
724 | void Launcher::allDocumentsRemoved() | 726 | void Launcher::allDocumentsRemoved() |
725 | { | 727 | { |
726 | tabs->docView()->removeAllItems(); | 728 | tabs->docView()->removeAllItems(); |
727 | } | 729 | } |
728 | 730 | ||
729 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) | 731 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) |
730 | { | 732 | { |
731 | tb->setApplicationState( name, state ); | 733 | tb->setApplicationState( name, state ); |
732 | } | 734 | } |
733 | 735 | ||
734 | void Launcher::applicationScanningProgress( int percent ) | 736 | void Launcher::applicationScanningProgress( int percent ) |
735 | { | 737 | { |
736 | switch ( percent ) { | 738 | switch ( percent ) { |
737 | case 0: { | 739 | case 0: { |
738 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 740 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
739 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); | 741 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); |
740 | tabs->view( (*it) )->setSortEnabled( FALSE ); | 742 | tabs->view( (*it) )->setSortEnabled( FALSE ); |
741 | } | 743 | } |
742 | break; | 744 | break; |
743 | } | 745 | } |
744 | case 100: { | 746 | case 100: { |
745 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 747 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
746 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); | 748 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); |
747 | tabs->view( (*it) )->setSortEnabled( TRUE ); | 749 | tabs->view( (*it) )->setSortEnabled( TRUE ); |
748 | } | 750 | } |
749 | break; | 751 | break; |
750 | } | 752 | } |
751 | default: | 753 | default: |
752 | break; | 754 | break; |
753 | } | 755 | } |
754 | } | 756 | } |
755 | 757 | ||
756 | void Launcher::documentScanningProgress( int percent ) | 758 | void Launcher::documentScanningProgress( int percent ) |
757 | { | 759 | { |
758 | switch ( percent ) { | 760 | switch ( percent ) { |
759 | case 0: { | 761 | case 0: { |
760 | tabs->setLoadingProgress( 0 ); | 762 | tabs->setLoadingProgress( 0 ); |
761 | tabs->setLoadingWidgetEnabled( TRUE ); | 763 | tabs->setLoadingWidgetEnabled( TRUE ); |
762 | tabs->docView()->setUpdatesEnabled( FALSE ); | 764 | tabs->docView()->setUpdatesEnabled( FALSE ); |
763 | tabs->docView()->setSortEnabled( FALSE ); | 765 | tabs->docView()->setSortEnabled( FALSE ); |
764 | break; | 766 | break; |
765 | } | 767 | } |
766 | case 100: { | 768 | case 100: { |
767 | tabs->docView()->updateTools(); | 769 | tabs->docView()->updateTools(); |
768 | tabs->docView()->setSortEnabled( TRUE ); | 770 | tabs->docView()->setSortEnabled( TRUE ); |
769 | tabs->docView()->setUpdatesEnabled( TRUE ); | 771 | tabs->docView()->setUpdatesEnabled( TRUE ); |
770 | tabs->setLoadingWidgetEnabled( FALSE ); | 772 | tabs->setLoadingWidgetEnabled( FALSE ); |
773 | tb->refreshStartMenu(); | ||
771 | break; | 774 | break; |
772 | } | 775 | } |
773 | default: | 776 | default: |
774 | tabs->setLoadingProgress( percent ); | 777 | tabs->setLoadingProgress( percent ); |
775 | break; | 778 | break; |
776 | } | 779 | } |
777 | } | 780 | } |
778 | 781 | ||