-rw-r--r-- | korganizer/mainwindow.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 13e186d..f945383 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -589,412 +589,413 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
589 | 589 | ||
590 | showMaximized(); | 590 | showMaximized(); |
591 | raise(); | 591 | raise(); |
592 | } | 592 | } |
593 | 593 | ||
594 | QPixmap MainWindow::loadPixmap( QString name ) | 594 | QPixmap MainWindow::loadPixmap( QString name ) |
595 | { | 595 | { |
596 | return SmallIcon( name ); | 596 | return SmallIcon( name ); |
597 | 597 | ||
598 | } | 598 | } |
599 | void MainWindow::setUsesBigPixmaps ( bool b ) | 599 | void MainWindow::setUsesBigPixmaps ( bool b ) |
600 | { | 600 | { |
601 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 601 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
602 | if ( b ) | 602 | if ( b ) |
603 | qDebug("KO: BigPixmaps are not supported "); | 603 | qDebug("KO: BigPixmaps are not supported "); |
604 | } | 604 | } |
605 | void MainWindow::initActions() | 605 | void MainWindow::initActions() |
606 | { | 606 | { |
607 | //KOPrefs::instance()->mShowFullMenu | 607 | //KOPrefs::instance()->mShowFullMenu |
608 | iconToolBar->clear(); | 608 | iconToolBar->clear(); |
609 | KOPrefs *p = KOPrefs::instance(); | 609 | KOPrefs *p = KOPrefs::instance(); |
610 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 610 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
611 | 611 | ||
612 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 612 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
613 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 613 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
614 | QPopupMenu *importMenu = new QPopupMenu( this ); | 614 | QPopupMenu *importMenu = new QPopupMenu( this ); |
615 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 615 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
616 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 616 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
617 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 617 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
618 | selectFilterMenu = new QPopupMenu( this ); | 618 | selectFilterMenu = new QPopupMenu( this ); |
619 | selectFilterMenu->setCheckable( true ); | 619 | selectFilterMenu->setCheckable( true ); |
620 | syncMenu = new QPopupMenu( this ); | 620 | syncMenu = new QPopupMenu( this ); |
621 | configureAgendaMenu = new QPopupMenu( this ); | 621 | configureAgendaMenu = new QPopupMenu( this ); |
622 | configureToolBarMenu = new QPopupMenu( this ); | 622 | configureToolBarMenu = new QPopupMenu( this ); |
623 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 623 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
624 | QIconSet icon; | 624 | QIconSet icon; |
625 | int pixWid = 22, pixHei = 22; | 625 | int pixWid = 22, pixHei = 22; |
626 | QString pathString = ""; | 626 | QString pathString = ""; |
627 | if ( !p->mToolBarMiniIcons ) { | 627 | if ( !p->mToolBarMiniIcons ) { |
628 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 628 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
629 | pathString += "icons16/"; | 629 | pathString += "icons16/"; |
630 | pixWid = 18; pixHei = 16; | 630 | pixWid = 18; pixHei = 16; |
631 | } | 631 | } |
632 | } else { | 632 | } else { |
633 | pathString += "iconsmini/"; | 633 | pathString += "iconsmini/"; |
634 | pixWid = 18; pixHei = 16; | 634 | pixWid = 18; pixHei = 16; |
635 | } | 635 | } |
636 | if ( KOPrefs::instance()->mShowFullMenu ) { | 636 | if ( KOPrefs::instance()->mShowFullMenu ) { |
637 | QMenuBar *menuBar1; | 637 | QMenuBar *menuBar1; |
638 | menuBar1 = menuBar(); | 638 | menuBar1 = menuBar(); |
639 | menuBar1->insertItem( i18n("File"), importMenu ); | 639 | menuBar1->insertItem( i18n("File"), importMenu ); |
640 | menuBar1->insertItem( i18n("View"), viewMenu ); | 640 | menuBar1->insertItem( i18n("View"), viewMenu ); |
641 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 641 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
642 | #ifdef DESKTOP_VERSION | 642 | #ifdef DESKTOP_VERSION |
643 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 643 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
644 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 644 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
645 | #else | 645 | #else |
646 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 646 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
647 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 647 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
648 | #endif | 648 | #endif |
649 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 649 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
650 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 650 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
651 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 651 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
652 | } else { | 652 | } else { |
653 | QPEMenuBar *menuBar1; | 653 | QPEMenuBar *menuBar1; |
654 | menuBar1 = new QPEMenuBar( iconToolBar ); | 654 | menuBar1 = new QPEMenuBar( iconToolBar ); |
655 | QPopupMenu *menuBar = new QPopupMenu( this ); | 655 | QPopupMenu *menuBar = new QPopupMenu( this ); |
656 | icon = loadPixmap( pathString + "z_menu" ); | 656 | icon = loadPixmap( pathString + "z_menu" ); |
657 | menuBar1->insertItem( icon.pixmap(), menuBar); | 657 | menuBar1->insertItem( icon.pixmap(), menuBar); |
658 | //menuBar1->insertItem( i18n("ME"), menuBar); | 658 | //menuBar1->insertItem( i18n("ME"), menuBar); |
659 | menuBar->insertItem( i18n("File"), importMenu ); | 659 | menuBar->insertItem( i18n("File"), importMenu ); |
660 | menuBar->insertItem( i18n("View"), viewMenu ); | 660 | menuBar->insertItem( i18n("View"), viewMenu ); |
661 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 661 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
662 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 662 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
663 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 663 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
664 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 664 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
665 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 665 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
666 | menuBar->insertItem( i18n("Help"), helpMenu ); | 666 | menuBar->insertItem( i18n("Help"), helpMenu ); |
667 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 667 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
668 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 668 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
669 | } | 669 | } |
670 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 670 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
671 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 671 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
672 | 672 | ||
673 | 673 | ||
674 | mWeekBgColor = iconToolBar->backgroundColor(); | 674 | mWeekBgColor = iconToolBar->backgroundColor(); |
675 | mWeekPixmap.resize( pixWid , pixHei ); | 675 | mWeekPixmap.resize( pixWid , pixHei ); |
676 | mWeekPixmap.fill( mWeekBgColor ); | 676 | mWeekPixmap.fill( mWeekBgColor ); |
677 | icon = mWeekPixmap; | 677 | icon = mWeekPixmap; |
678 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 678 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
679 | if ( p-> mShowIconWeekNum ) | 679 | if ( p-> mShowIconWeekNum ) |
680 | mWeekAction->addTo( iconToolBar ); | 680 | mWeekAction->addTo( iconToolBar ); |
681 | mWeekFont = font(); | 681 | mWeekFont = font(); |
682 | 682 | ||
683 | int fontPoint = mWeekFont.pointSize(); | 683 | int fontPoint = mWeekFont.pointSize(); |
684 | QFontMetrics f( mWeekFont ); | 684 | QFontMetrics f( mWeekFont ); |
685 | int fontWid = f.width( "30" ); | 685 | int fontWid = f.width( "30" ); |
686 | while ( fontWid > pixWid ) { | 686 | while ( fontWid > pixWid ) { |
687 | --fontPoint; | 687 | --fontPoint; |
688 | mWeekFont.setPointSize( fontPoint ); | 688 | mWeekFont.setPointSize( fontPoint ); |
689 | QFontMetrics f( mWeekFont ); | 689 | QFontMetrics f( mWeekFont ); |
690 | fontWid = f.width( "30" ); | 690 | fontWid = f.width( "30" ); |
691 | //qDebug("dec-- "); | 691 | //qDebug("dec-- "); |
692 | } | 692 | } |
693 | 693 | ||
694 | connect( mWeekAction, SIGNAL( activated() ), | 694 | connect( mWeekAction, SIGNAL( activated() ), |
695 | this, SLOT( weekAction() ) ); | 695 | this, SLOT( weekAction() ) ); |
696 | 696 | ||
697 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 697 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
698 | if ( p->mShowIconFilterview ) { | 698 | if ( p->mShowIconFilterview ) { |
699 | icon = loadPixmap( pathString + "filter" ); | 699 | icon = loadPixmap( pathString + "filter" ); |
700 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 700 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
701 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 701 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
702 | this, SLOT( fillFilterMenuTB() ) ); | 702 | this, SLOT( fillFilterMenuTB() ) ); |
703 | actionFilterMenuTB->addTo( iconToolBar ); | 703 | actionFilterMenuTB->addTo( iconToolBar ); |
704 | selectFilterMenuTB = new QPopupMenu( this ); | 704 | selectFilterMenuTB = new QPopupMenu( this ); |
705 | selectFilterMenuTB->setCheckable( true ); | 705 | selectFilterMenuTB->setCheckable( true ); |
706 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 706 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
707 | } | 707 | } |
708 | 708 | ||
709 | //#endif | 709 | //#endif |
710 | // ****************** | 710 | // ****************** |
711 | QAction *action; | 711 | QAction *action; |
712 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 712 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
713 | configureToolBarMenu->setCheckable( true ); | 713 | configureToolBarMenu->setCheckable( true ); |
714 | 714 | ||
715 | 715 | ||
716 | configureAgendaMenu->setCheckable( true ); | 716 | configureAgendaMenu->setCheckable( true ); |
717 | int iii ; | 717 | int iii ; |
718 | for ( iii = 1;iii<= 10 ;++iii ){ | 718 | for ( iii = 1;iii<= 10 ;++iii ){ |
719 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 719 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
720 | } | 720 | } |
721 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 721 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
722 | 722 | ||
723 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 723 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
724 | this, SLOT( showConfigureAgenda( ) ) ); | 724 | this, SLOT( showConfigureAgenda( ) ) ); |
725 | 725 | ||
726 | icon = loadPixmap( pathString + "configure" ); | 726 | icon = loadPixmap( pathString + "configure" ); |
727 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | 727 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); |
728 | action->addTo( actionMenu ); | 728 | action->addTo( actionMenu ); |
729 | connect( action, SIGNAL( activated() ), | 729 | connect( action, SIGNAL( activated() ), |
730 | mView, SLOT( edit_options() ) ); | 730 | mView, SLOT( edit_options() ) ); |
731 | icon = loadPixmap( pathString + "configure" ); | 731 | icon = loadPixmap( pathString + "configure" ); |
732 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | 732 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); |
733 | action->addTo( actionMenu ); | 733 | action->addTo( actionMenu ); |
734 | connect( action, SIGNAL( activated() ), | 734 | connect( action, SIGNAL( activated() ), |
735 | mView, SLOT( edit_global_options() ) ); | 735 | mView, SLOT( edit_global_options() ) ); |
736 | actionMenu->insertSeparator(); | 736 | actionMenu->insertSeparator(); |
737 | 737 | ||
738 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 738 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
739 | action->addTo( actionMenu ); | 739 | action->addTo( actionMenu ); |
740 | connect( action, SIGNAL( activated() ), | 740 | connect( action, SIGNAL( activated() ), |
741 | mView, SLOT( undo_delete() ) ); | 741 | mView, SLOT( undo_delete() ) ); |
742 | actionMenu->insertSeparator(); | 742 | actionMenu->insertSeparator(); |
743 | 743 | ||
744 | icon = loadPixmap( pathString + "newevent" ); | 744 | icon = loadPixmap( pathString + "newevent" ); |
745 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 745 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
746 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 746 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
747 | configureToolBarMenu->insertSeparator(); | 747 | configureToolBarMenu->insertSeparator(); |
748 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 748 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
749 | configureToolBarMenu->insertSeparator(); | 749 | configureToolBarMenu->insertSeparator(); |
750 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 750 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
751 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 751 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
752 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 752 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
753 | ne_action->addTo( actionMenu ); | 753 | ne_action->addTo( actionMenu ); |
754 | connect( ne_action, SIGNAL( activated() ), | 754 | connect( ne_action, SIGNAL( activated() ), |
755 | mView, SLOT( newEvent() ) ); | 755 | mView, SLOT( newEvent() ) ); |
756 | icon = loadPixmap( pathString + "newtodo" ); | 756 | icon = loadPixmap( pathString + "newtodo" ); |
757 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 757 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
758 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 758 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
759 | nt_action->addTo( actionMenu ); | 759 | nt_action->addTo( actionMenu ); |
760 | connect( nt_action, SIGNAL( activated() ), | 760 | connect( nt_action, SIGNAL( activated() ), |
761 | mView, SLOT( newTodo() ) ); | 761 | mView, SLOT( newTodo() ) ); |
762 | 762 | ||
763 | icon = loadPixmap( pathString + "today" ); | 763 | icon = loadPixmap( pathString + "today" ); |
764 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 764 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
765 | today_action->addTo( viewMenu ); | 765 | today_action->addTo( viewMenu ); |
766 | connect( today_action, SIGNAL( activated() ), | 766 | connect( today_action, SIGNAL( activated() ), |
767 | mView, SLOT( goToday() ) ); | 767 | mView, SLOT( goToday() ) ); |
768 | viewMenu->insertSeparator(); | 768 | viewMenu->insertSeparator(); |
769 | 769 | ||
770 | // *********************** | 770 | // *********************** |
771 | if ( KOPrefs::instance()->mVerticalScreen ) { | 771 | if ( KOPrefs::instance()->mVerticalScreen ) { |
772 | icon = SmallIcon( "1updownarrow" ); | 772 | icon = SmallIcon( "1updownarrow" ); |
773 | } else { | 773 | } else { |
774 | icon = SmallIcon("1leftrightarrow" ); | 774 | icon = SmallIcon("1leftrightarrow" ); |
775 | } | 775 | } |
776 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 776 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
777 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 777 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
778 | FSaction->addTo( viewMenu ); | 778 | FSaction->addTo( viewMenu ); |
779 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 779 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
780 | 780 | ||
781 | icon = loadPixmap( pathString + "navi" ); | 781 | |
782 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | ||
783 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | ||
784 | action->addTo( viewMenu ); | ||
785 | connect( action, SIGNAL( activated() ), | ||
786 | mView, SLOT( toggleDateNavigatorWidget() ) ); | ||
787 | mToggleNav = action ; | ||
788 | icon = loadPixmap( pathString + "filter" ); | 782 | icon = loadPixmap( pathString + "filter" ); |
789 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 783 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
790 | icon = loadPixmap( pathString + "configure" ); | 784 | icon = loadPixmap( pathString + "configure" ); |
791 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 785 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
792 | action->addTo( viewMenu ); | 786 | action->addTo( viewMenu ); |
793 | connect( action, SIGNAL( activated() ), | 787 | connect( action, SIGNAL( activated() ), |
794 | mView, SLOT( toggleFilter() ) ); | 788 | mView, SLOT( toggleFilter() ) ); |
795 | mToggleFilter = action; | 789 | mToggleFilter = action; |
790 | icon = loadPixmap( pathString + "navi" ); | ||
791 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | ||
792 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | ||
793 | action->addTo( viewMenu ); | ||
794 | connect( action, SIGNAL( activated() ), | ||
795 | mView, SLOT( toggleDateNavigatorWidget() ) ); | ||
796 | mToggleNav = action ; | ||
796 | icon = loadPixmap( pathString + "allday" ); | 797 | icon = loadPixmap( pathString + "allday" ); |
797 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 798 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
798 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 799 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
799 | action->addTo( viewMenu ); | 800 | action->addTo( viewMenu ); |
800 | connect( action, SIGNAL( activated() ), | 801 | connect( action, SIGNAL( activated() ), |
801 | mView, SLOT( toggleAllDaySize() ) ); | 802 | mView, SLOT( toggleAllDaySize() ) ); |
802 | mToggleAllday = action; | 803 | mToggleAllday = action; |
803 | 804 | ||
804 | 805 | ||
805 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 806 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
806 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 807 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
807 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 808 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
808 | mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 809 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
809 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 810 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
810 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 811 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
811 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 812 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
812 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | 813 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); |
813 | 814 | ||
814 | viewMenu->insertSeparator(); | 815 | viewMenu->insertSeparator(); |
815 | icon = loadPixmap( pathString + "picker" ); | 816 | icon = loadPixmap( pathString + "picker" ); |
816 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | 817 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); |
817 | action->addTo( viewMenu ); | 818 | action->addTo( viewMenu ); |
818 | connect( action, SIGNAL( activated() ), | 819 | connect( action, SIGNAL( activated() ), |
819 | mView, SLOT( showDatePicker() ) ); | 820 | mView, SLOT( showDatePicker() ) ); |
820 | action->addTo( iconToolBar ); | 821 | action->addTo( iconToolBar ); |
821 | viewMenu->insertSeparator(); | 822 | viewMenu->insertSeparator(); |
822 | 823 | ||
823 | if ( p-> mShowIconToggleFull ) | 824 | if ( p-> mShowIconToggleFull ) |
824 | FSaction->addTo( iconToolBar ); | 825 | FSaction->addTo( iconToolBar ); |
825 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 826 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
826 | 827 | ||
827 | //******************** | 828 | //******************** |
828 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 829 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
829 | 830 | ||
830 | 831 | ||
831 | icon = loadPixmap( pathString + "whatsnext" ); | 832 | icon = loadPixmap( pathString + "whatsnext" ); |
832 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 833 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
833 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 834 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
834 | whatsnext_action->addTo( viewMenu ); | 835 | whatsnext_action->addTo( viewMenu ); |
835 | connect( whatsnext_action, SIGNAL( activated() ), | 836 | connect( whatsnext_action, SIGNAL( activated() ), |
836 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 837 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
837 | 838 | ||
838 | icon = loadPixmap( pathString + "xdays" ); | 839 | icon = loadPixmap( pathString + "xdays" ); |
839 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 840 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
840 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 841 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
841 | xdays_action->addTo( viewMenu ); | 842 | xdays_action->addTo( viewMenu ); |
842 | connect( xdays_action, SIGNAL( activated() ), | 843 | connect( xdays_action, SIGNAL( activated() ), |
843 | mView->viewManager(), SLOT( showNextXView() ) ); | 844 | mView->viewManager(), SLOT( showNextXView() ) ); |
844 | 845 | ||
845 | 846 | ||
846 | icon = loadPixmap( pathString + "journal" ); | 847 | icon = loadPixmap( pathString + "journal" ); |
847 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 848 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
848 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 849 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
849 | viewjournal_action->addTo( viewMenu ); | 850 | viewjournal_action->addTo( viewMenu ); |
850 | connect( viewjournal_action, SIGNAL( activated() ), | 851 | connect( viewjournal_action, SIGNAL( activated() ), |
851 | mView->viewManager(), SLOT( showJournalView() ) ); | 852 | mView->viewManager(), SLOT( showJournalView() ) ); |
852 | 853 | ||
853 | 854 | ||
854 | icon = loadPixmap( pathString + "day" ); | 855 | icon = loadPixmap( pathString + "day" ); |
855 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 856 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
856 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 857 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
857 | day1_action->addTo( viewMenu ); | 858 | day1_action->addTo( viewMenu ); |
858 | // action->addTo( toolBar ); | 859 | // action->addTo( toolBar ); |
859 | connect( day1_action, SIGNAL( activated() ), | 860 | connect( day1_action, SIGNAL( activated() ), |
860 | mView->viewManager(), SLOT( showDayView() ) ); | 861 | mView->viewManager(), SLOT( showDayView() ) ); |
861 | 862 | ||
862 | icon = loadPixmap( pathString + "workweek" ); | 863 | icon = loadPixmap( pathString + "workweek" ); |
863 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 864 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
864 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 865 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
865 | day5_action->addTo( viewMenu ); | 866 | day5_action->addTo( viewMenu ); |
866 | connect( day5_action, SIGNAL( activated() ), | 867 | connect( day5_action, SIGNAL( activated() ), |
867 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 868 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
868 | 869 | ||
869 | icon = loadPixmap( pathString + "week" ); | 870 | icon = loadPixmap( pathString + "week" ); |
870 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); | 871 | configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); |
871 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 872 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
872 | day7_action->addTo( viewMenu ); | 873 | day7_action->addTo( viewMenu ); |
873 | connect( day7_action, SIGNAL( activated() ), | 874 | connect( day7_action, SIGNAL( activated() ), |
874 | mView->viewManager(), SLOT( showWeekView() ) ); | 875 | mView->viewManager(), SLOT( showWeekView() ) ); |
875 | 876 | ||
876 | icon = loadPixmap( pathString + "workweek2" ); | 877 | icon = loadPixmap( pathString + "workweek2" ); |
877 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 878 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
878 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 879 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
879 | day6_action->addTo( viewMenu ); | 880 | day6_action->addTo( viewMenu ); |
880 | connect( day6_action, SIGNAL( activated() ), | 881 | connect( day6_action, SIGNAL( activated() ), |
881 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 882 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
882 | 883 | ||
883 | icon = loadPixmap( pathString + "month" ); | 884 | icon = loadPixmap( pathString + "month" ); |
884 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 885 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
885 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 886 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
886 | month_action->addTo( viewMenu ); | 887 | month_action->addTo( viewMenu ); |
887 | connect( month_action, SIGNAL( activated() ), | 888 | connect( month_action, SIGNAL( activated() ), |
888 | mView->viewManager(), SLOT( showMonthView() ) ); | 889 | mView->viewManager(), SLOT( showMonthView() ) ); |
889 | 890 | ||
890 | icon = loadPixmap( pathString + "list" ); | 891 | icon = loadPixmap( pathString + "list" ); |
891 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 892 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
892 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 893 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
893 | showlist_action->addTo( viewMenu ); | 894 | showlist_action->addTo( viewMenu ); |
894 | connect( showlist_action, SIGNAL( activated() ), | 895 | connect( showlist_action, SIGNAL( activated() ), |
895 | mView->viewManager(), SLOT( showListView() ) ); | 896 | mView->viewManager(), SLOT( showListView() ) ); |
896 | 897 | ||
897 | icon = loadPixmap( pathString + "todo" ); | 898 | icon = loadPixmap( pathString + "todo" ); |
898 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 899 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
899 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 900 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
900 | todoview_action->addTo( viewMenu ); | 901 | todoview_action->addTo( viewMenu ); |
901 | connect( todoview_action, SIGNAL( activated() ), | 902 | connect( todoview_action, SIGNAL( activated() ), |
902 | mView->viewManager(), SLOT( showTodoView() ) ); | 903 | mView->viewManager(), SLOT( showTodoView() ) ); |
903 | 904 | ||
904 | 905 | ||
905 | 906 | ||
906 | #if 0 | 907 | #if 0 |
907 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 908 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
908 | action->addTo( viewMenu ); | 909 | action->addTo( viewMenu ); |
909 | connect( action, SIGNAL( activated() ), | 910 | connect( action, SIGNAL( activated() ), |
910 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 911 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
911 | #endif | 912 | #endif |
912 | 913 | ||
913 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 914 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
914 | this ); | 915 | this ); |
915 | mNewSubTodoAction->addTo( actionMenu ); | 916 | mNewSubTodoAction->addTo( actionMenu ); |
916 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 917 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
917 | mView, SLOT( newSubTodo() ) ); | 918 | mView, SLOT( newSubTodo() ) ); |
918 | 919 | ||
919 | actionMenu->insertSeparator(); | 920 | actionMenu->insertSeparator(); |
920 | 921 | ||
921 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 922 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
922 | mShowAction->addTo( actionMenu ); | 923 | mShowAction->addTo( actionMenu ); |
923 | connect( mShowAction, SIGNAL( activated() ), | 924 | connect( mShowAction, SIGNAL( activated() ), |
924 | mView, SLOT( showIncidence() ) ); | 925 | mView, SLOT( showIncidence() ) ); |
925 | 926 | ||
926 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 927 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
927 | mEditAction->addTo( actionMenu ); | 928 | mEditAction->addTo( actionMenu ); |
928 | connect( mEditAction, SIGNAL( activated() ), | 929 | connect( mEditAction, SIGNAL( activated() ), |
929 | mView, SLOT( editIncidence() ) ); | 930 | mView, SLOT( editIncidence() ) ); |
930 | 931 | ||
931 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 932 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
932 | mDeleteAction->addTo( actionMenu ); | 933 | mDeleteAction->addTo( actionMenu ); |
933 | connect( mDeleteAction, SIGNAL( activated() ), | 934 | connect( mDeleteAction, SIGNAL( activated() ), |
934 | mView, SLOT( deleteIncidence() ) ); | 935 | mView, SLOT( deleteIncidence() ) ); |
935 | 936 | ||
936 | 937 | ||
937 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 938 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
938 | mCloneAction->addTo( actionMenu ); | 939 | mCloneAction->addTo( actionMenu ); |
939 | connect( mCloneAction, SIGNAL( activated() ), | 940 | connect( mCloneAction, SIGNAL( activated() ), |
940 | mView, SLOT( cloneIncidence() ) ); | 941 | mView, SLOT( cloneIncidence() ) ); |
941 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 942 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
942 | mMoveAction->addTo( actionMenu ); | 943 | mMoveAction->addTo( actionMenu ); |
943 | connect( mMoveAction, SIGNAL( activated() ), | 944 | connect( mMoveAction, SIGNAL( activated() ), |
944 | mView, SLOT( moveIncidence() ) ); | 945 | mView, SLOT( moveIncidence() ) ); |
945 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 946 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
946 | mBeamAction->addTo( actionMenu ); | 947 | mBeamAction->addTo( actionMenu ); |
947 | connect( mBeamAction, SIGNAL( activated() ), | 948 | connect( mBeamAction, SIGNAL( activated() ), |
948 | mView, SLOT( beamIncidence() ) ); | 949 | mView, SLOT( beamIncidence() ) ); |
949 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 950 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
950 | mCancelAction->addTo( actionMenu ); | 951 | mCancelAction->addTo( actionMenu ); |
951 | connect( mCancelAction, SIGNAL( activated() ), | 952 | connect( mCancelAction, SIGNAL( activated() ), |
952 | mView, SLOT( toggleCancelIncidence() ) ); | 953 | mView, SLOT( toggleCancelIncidence() ) ); |
953 | 954 | ||
954 | actionMenu->insertSeparator(); | 955 | actionMenu->insertSeparator(); |
955 | 956 | ||
956 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | 957 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, |
957 | this ); | 958 | this ); |
958 | action->addTo( actionMenu ); | 959 | action->addTo( actionMenu ); |
959 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 960 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
960 | 961 | ||
961 | icon = loadPixmap( pathString + "search" ); | 962 | icon = loadPixmap( pathString + "search" ); |
962 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 963 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
963 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 964 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
964 | search_action->addTo( actionMenu ); | 965 | search_action->addTo( actionMenu ); |
965 | connect( search_action, SIGNAL( activated() ), | 966 | connect( search_action, SIGNAL( activated() ), |
966 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 967 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
967 | 968 | ||
968 | 969 | ||
969 | 970 | ||
970 | if ( KOPrefs::instance()->mShowFullMenu ) { | 971 | if ( KOPrefs::instance()->mShowFullMenu ) { |
971 | actionMenu->insertSeparator(); | 972 | actionMenu->insertSeparator(); |
972 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 973 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
973 | 974 | ||
974 | } | 975 | } |
975 | // actionMenu->insertSeparator(); | 976 | // actionMenu->insertSeparator(); |
976 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 977 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
977 | this ); | 978 | this ); |
978 | action->addTo( importMenu_X ); | 979 | action->addTo( importMenu_X ); |
979 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 980 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
980 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 981 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
981 | this ); | 982 | this ); |
982 | action->addTo( importMenu_X ); | 983 | action->addTo( importMenu_X ); |
983 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 984 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
984 | importMenu_X->insertSeparator(); | 985 | importMenu_X->insertSeparator(); |
985 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 986 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
986 | this ); | 987 | this ); |
987 | action->addTo( importMenu_X ); | 988 | action->addTo( importMenu_X ); |
988 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 989 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
989 | //#ifndef DESKTOP_VERSION | 990 | //#ifndef DESKTOP_VERSION |
990 | importMenu_X->insertSeparator(); | 991 | importMenu_X->insertSeparator(); |
991 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 992 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
992 | this ); | 993 | this ); |
993 | action->addTo( importMenu_X ); | 994 | action->addTo( importMenu_X ); |
994 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 995 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
995 | //#else | 996 | //#else |
996 | #ifdef _OL_IMPORT_ | 997 | #ifdef _OL_IMPORT_ |
997 | importMenu_X->insertSeparator(); | 998 | importMenu_X->insertSeparator(); |
998 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 999 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
999 | this ); | 1000 | this ); |
1000 | action->addTo( importMenu_X ); | 1001 | action->addTo( importMenu_X ); |