-rw-r--r-- | core/launcher/launcher.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 7887704..984a57d 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -559,223 +559,223 @@ void Launcher::toggleCapsLockState() | |||
559 | tb->toggleCapsLockState(); | 559 | tb->toggleCapsLockState(); |
560 | } | 560 | } |
561 | 561 | ||
562 | static bool isVisibleWindow(int wid) | 562 | static bool isVisibleWindow(int wid) |
563 | { | 563 | { |
564 | #ifdef Q_WS_QWS | 564 | #ifdef Q_WS_QWS |
565 | const QList<QWSWindow> &list = qwsServer->clientWindows(); | 565 | const QList<QWSWindow> &list = qwsServer->clientWindows(); |
566 | QWSWindow* w; | 566 | QWSWindow* w; |
567 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { | 567 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { |
568 | if ( w->winId() == wid ) | 568 | if ( w->winId() == wid ) |
569 | return !w->isFullyObscured(); | 569 | return !w->isFullyObscured(); |
570 | } | 570 | } |
571 | #endif | 571 | #endif |
572 | return FALSE; | 572 | return FALSE; |
573 | } | 573 | } |
574 | 574 | ||
575 | void Launcher::viewSelected(const QString& s) | 575 | void Launcher::viewSelected(const QString& s) |
576 | { | 576 | { |
577 | setCaption( s + tr(" - Launcher") ); | 577 | setCaption( s + tr(" - Launcher") ); |
578 | } | 578 | } |
579 | 579 | ||
580 | void Launcher::showTab(const QString& id) | 580 | void Launcher::showTab(const QString& id) |
581 | { | 581 | { |
582 | tabs->categoryBar->showTab(id); | 582 | tabs->categoryBar->showTab(id); |
583 | raise(); | 583 | raise(); |
584 | } | 584 | } |
585 | 585 | ||
586 | void Launcher::select( const AppLnk *appLnk ) | 586 | void Launcher::select( const AppLnk *appLnk ) |
587 | { | 587 | { |
588 | if ( appLnk->type() == "Folder" ) { // No tr | 588 | if ( appLnk->type() == "Folder" ) { // No tr |
589 | // Not supported: flat is simpler for the user | 589 | // Not supported: flat is simpler for the user |
590 | } else { | 590 | } else { |
591 | if ( appLnk->exec().isNull() ) { | 591 | if ( appLnk->exec().isNull() ) { |
592 | int i = QMessageBox::information(this,tr("No application"), | 592 | int i = QMessageBox::information(this,tr("No application"), |
593 | tr("<p>No application is defined for this document." | 593 | tr("<p>No application is defined for this document." |
594 | "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1); | 594 | "<p>Type is %1.").arg(appLnk->type()), tr("OK"), tr("View as text"), 0, 0, 1); |
595 | 595 | ||
596 | /* ### Fixme */ | 596 | /* ### Fixme */ |
597 | if ( i == 1 ) | 597 | if ( i == 1 ) |
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 | /* this will be called in applicationScanningProgress with value 100! */ | 646 | /* this will be called in applicationScanningProgress with value 100! */ |
647 | // tb->refreshStartMenu(); | 647 | // tb->refreshStartMenu(); |
648 | 648 | ||
649 | static bool first = TRUE; | 649 | static bool first = TRUE; |
650 | if ( first ) { | 650 | if ( first ) { |
651 | first = FALSE; | 651 | first = FALSE; |
652 | tabs->categoryBar->showTab(type); | 652 | tabs->categoryBar->showTab(type); |
653 | } | 653 | } |
654 | 654 | ||
655 | tabs->view( type )->setUpdatesEnabled( FALSE ); | 655 | tabs->view( type )->setUpdatesEnabled( FALSE ); |
656 | tabs->view( type )->setSortEnabled( FALSE ); | 656 | tabs->view( type )->setSortEnabled( FALSE ); |
657 | } | 657 | } |
658 | 658 | ||
659 | void Launcher::typeRemoved( const QString& type ) | 659 | void Launcher::typeRemoved( const QString& type ) |
660 | { | 660 | { |
661 | tabs->view( type )->removeAllItems(); | 661 | tabs->view( type )->removeAllItems(); |
662 | tabs->deleteView( type ); | 662 | tabs->deleteView( type ); |
663 | ids.remove( type ); | 663 | ids.remove( type ); |
664 | /* this will be called in applicationScanningProgress with value 100! */ | 664 | /* this will be called in applicationScanningProgress with value 100! */ |
665 | // tb->refreshStartMenu(); | 665 | // tb->refreshStartMenu(); |
666 | } | 666 | } |
667 | 667 | ||
668 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) | 668 | void Launcher::applicationAdded( const QString& type, const AppLnk& app ) |
669 | { | 669 | { |
670 | if ( app.type() == "Separator" ) // No tr | 670 | if ( app.type() == "Separator" ) // No tr |
671 | return; | 671 | return; |
672 | 672 | ||
673 | LauncherView *view = tabs->view( type ); | 673 | LauncherView *view = tabs->view( type ); |
674 | if ( view ) | 674 | if ( view ) |
675 | view->addItem( new AppLnk( app ), FALSE ); | 675 | view->addItem( new AppLnk( app ), FALSE ); |
676 | else | 676 | else |
677 | 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!", |
678 | type.latin1(),app.name().latin1() ); | 678 | type.latin1(),app.name().latin1() ); |
679 | 679 | ||
680 | MimeType::registerApp( app ); | 680 | MimeType::registerApp( app ); |
681 | } | 681 | } |
682 | 682 | ||
683 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) | 683 | void Launcher::applicationRemoved( const QString& type, const AppLnk& app ) |
684 | { | 684 | { |
685 | LauncherView *view = tabs->view( type ); | 685 | LauncherView *view = tabs->view( type ); |
686 | if ( view ) | 686 | if ( view ) |
687 | view->removeLink( app.linkFile() ); | 687 | view->removeLink( app.linkFile() ); |
688 | else | 688 | else |
689 | qWarning("removeAppLnk: No view for %s!", type.latin1() ); | 689 | qWarning("removeAppLnk: No view for %s!", type.latin1() ); |
690 | } | 690 | } |
691 | 691 | ||
692 | void Launcher::allApplicationsRemoved() | 692 | void Launcher::allApplicationsRemoved() |
693 | { | 693 | { |
694 | MimeType::clear(); | 694 | MimeType::clear(); |
695 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) | 695 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) |
696 | tabs->view( (*it) )->removeAllItems(); | 696 | tabs->view( (*it) )->removeAllItems(); |
697 | } | 697 | } |
698 | 698 | ||
699 | void Launcher::documentAdded( const DocLnk& doc ) | 699 | void Launcher::documentAdded( const DocLnk& doc ) |
700 | { | 700 | { |
701 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); | 701 | tabs->docView()->addItem( new DocLnk( doc ), FALSE ); |
702 | } | 702 | } |
703 | 703 | ||
704 | void Launcher::showLoadingDocs() | 704 | void Launcher::showLoadingDocs() |
705 | { | 705 | { |
706 | tabs->docView()->hide(); | 706 | tabs->docView()->hide(); |
707 | } | 707 | } |
708 | 708 | ||
709 | void Launcher::showDocTab() | 709 | void Launcher::showDocTab() |
710 | { | 710 | { |
711 | if ( tabs->categoryBar->currentView() == tabs->docView() ) | 711 | if ( tabs->categoryBar->currentView() == tabs->docView() ) |
712 | tabs->docView()->show(); | 712 | tabs->docView()->show(); |
713 | } | 713 | } |
714 | 714 | ||
715 | void Launcher::documentRemoved( const DocLnk& doc ) | 715 | void Launcher::documentRemoved( const DocLnk& doc ) |
716 | { | 716 | { |
717 | tabs->docView()->removeLink( doc.linkFile() ); | 717 | tabs->docView()->removeLink( doc.linkFile() ); |
718 | } | 718 | } |
719 | 719 | ||
720 | void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) | 720 | void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) |
721 | { | 721 | { |
722 | documentRemoved( oldDoc ); | 722 | documentRemoved( oldDoc ); |
723 | documentAdded( newDoc ); | 723 | documentAdded( newDoc ); |
724 | } | 724 | } |
725 | 725 | ||
726 | void Launcher::allDocumentsRemoved() | 726 | void Launcher::allDocumentsRemoved() |
727 | { | 727 | { |
728 | tabs->docView()->removeAllItems(); | 728 | tabs->docView()->removeAllItems(); |
729 | } | 729 | } |
730 | 730 | ||
731 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) | 731 | void Launcher::applicationStateChanged( const QString& name, ApplicationState state ) |
732 | { | 732 | { |
733 | tb->setApplicationState( name, state ); | 733 | tb->setApplicationState( name, state ); |
734 | } | 734 | } |
735 | 735 | ||
736 | void Launcher::applicationScanningProgress( int percent ) | 736 | void Launcher::applicationScanningProgress( int percent ) |
737 | { | 737 | { |
738 | switch ( percent ) { | 738 | switch ( percent ) { |
739 | case 0: { | 739 | case 0: { |
740 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 740 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
741 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); | 741 | tabs->view( (*it) )->setUpdatesEnabled( FALSE ); |
742 | tabs->view( (*it) )->setSortEnabled( FALSE ); | 742 | tabs->view( (*it) )->setSortEnabled( FALSE ); |
743 | } | 743 | } |
744 | break; | 744 | break; |
745 | } | 745 | } |
746 | case 100: { | 746 | case 100: { |
747 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { | 747 | for ( QStringList::ConstIterator it=ids.begin(); it!= ids.end(); ++it) { |
748 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); | 748 | tabs->view( (*it) )->setUpdatesEnabled( TRUE ); |
749 | tabs->view( (*it) )->setSortEnabled( TRUE ); | 749 | tabs->view( (*it) )->setSortEnabled( TRUE ); |
750 | } | 750 | } |
751 | tb->refreshStartMenu(); | ||
751 | break; | 752 | break; |
752 | } | 753 | } |
753 | default: | 754 | default: |
754 | break; | 755 | break; |
755 | } | 756 | } |
756 | } | 757 | } |
757 | 758 | ||
758 | void Launcher::documentScanningProgress( int percent ) | 759 | void Launcher::documentScanningProgress( int percent ) |
759 | { | 760 | { |
760 | switch ( percent ) { | 761 | switch ( percent ) { |
761 | case 0: { | 762 | case 0: { |
762 | tabs->setLoadingProgress( 0 ); | 763 | tabs->setLoadingProgress( 0 ); |
763 | tabs->setLoadingWidgetEnabled( TRUE ); | 764 | tabs->setLoadingWidgetEnabled( TRUE ); |
764 | tabs->docView()->setUpdatesEnabled( FALSE ); | 765 | tabs->docView()->setUpdatesEnabled( FALSE ); |
765 | tabs->docView()->setSortEnabled( FALSE ); | 766 | tabs->docView()->setSortEnabled( FALSE ); |
766 | break; | 767 | break; |
767 | } | 768 | } |
768 | case 100: { | 769 | case 100: { |
769 | tabs->docView()->updateTools(); | 770 | tabs->docView()->updateTools(); |
770 | tabs->docView()->setSortEnabled( TRUE ); | 771 | tabs->docView()->setSortEnabled( TRUE ); |
771 | tabs->docView()->setUpdatesEnabled( TRUE ); | 772 | tabs->docView()->setUpdatesEnabled( TRUE ); |
772 | tabs->setLoadingWidgetEnabled( FALSE ); | 773 | tabs->setLoadingWidgetEnabled( FALSE ); |
773 | tb->refreshStartMenu(); | ||
774 | break; | 774 | break; |
775 | } | 775 | } |
776 | default: | 776 | default: |
777 | tabs->setLoadingProgress( percent ); | 777 | tabs->setLoadingProgress( percent ); |
778 | break; | 778 | break; |
779 | } | 779 | } |
780 | } | 780 | } |
781 | 781 | ||