summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp24
1 files changed, 17 insertions, 7 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 950d2ec..3feb4ab 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -502,50 +502,55 @@ QPixmap MainWindow::loadPixmap( QString name )
502 502
503} 503}
504void MainWindow::initActions() 504void MainWindow::initActions()
505{ 505{
506 //KOPrefs::instance()->mShowFullMenu 506 //KOPrefs::instance()->mShowFullMenu
507 iconToolBar->clear(); 507 iconToolBar->clear();
508 KOPrefs *p = KOPrefs::instance(); 508 KOPrefs *p = KOPrefs::instance();
509 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); 509 //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar );
510 510
511 QPopupMenu *viewMenu = new QPopupMenu( this ); 511 QPopupMenu *viewMenu = new QPopupMenu( this );
512 QPopupMenu *actionMenu = new QPopupMenu( this ); 512 QPopupMenu *actionMenu = new QPopupMenu( this );
513 QPopupMenu *importMenu = new QPopupMenu( this ); 513 QPopupMenu *importMenu = new QPopupMenu( this );
514 selectFilterMenu = new QPopupMenu( this ); 514 selectFilterMenu = new QPopupMenu( this );
515 selectFilterMenu->setCheckable( true ); 515 selectFilterMenu->setCheckable( true );
516 syncMenu = new QPopupMenu( this ); 516 syncMenu = new QPopupMenu( this );
517 configureAgendaMenu = new QPopupMenu( this ); 517 configureAgendaMenu = new QPopupMenu( this );
518 configureToolBarMenu = new QPopupMenu( this ); 518 configureToolBarMenu = new QPopupMenu( this );
519 QPopupMenu *helpMenu = new QPopupMenu( this ); 519 QPopupMenu *helpMenu = new QPopupMenu( this );
520 if ( KOPrefs::instance()->mShowFullMenu ) { 520 if ( KOPrefs::instance()->mShowFullMenu ) {
521 QMenuBar *menuBar1; 521 QMenuBar *menuBar1;
522 menuBar1 = menuBar(); 522 menuBar1 = menuBar();
523 menuBar1->insertItem( i18n("File"), importMenu ); 523 menuBar1->insertItem( i18n("File"), importMenu );
524 menuBar1->insertItem( i18n("View"), viewMenu ); 524 menuBar1->insertItem( i18n("View"), viewMenu );
525 menuBar1->insertItem( i18n("Actions"), actionMenu ); 525 menuBar1->insertItem( i18n("Actions"), actionMenu );
526#ifdef DESKTOP_VERSION
526 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 527 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
527 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 528 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
529#else
530 menuBar1->insertItem( i18n("Sync"), syncMenu );
531 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
532#endif
528 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 533 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
529 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 534 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
530 menuBar1->insertItem( i18n("Help"), helpMenu ); 535 menuBar1->insertItem( i18n("Help"), helpMenu );
531 } else { 536 } else {
532 QPEMenuBar *menuBar1; 537 QPEMenuBar *menuBar1;
533 menuBar1 = new QPEMenuBar( iconToolBar ); 538 menuBar1 = new QPEMenuBar( iconToolBar );
534 QPopupMenu *menuBar = new QPopupMenu( this ); 539 QPopupMenu *menuBar = new QPopupMenu( this );
535 menuBar1->insertItem( i18n("ME"), menuBar); 540 menuBar1->insertItem( i18n("ME"), menuBar);
536 menuBar->insertItem( i18n("File"), importMenu ); 541 menuBar->insertItem( i18n("File"), importMenu );
537 menuBar->insertItem( i18n("View"), viewMenu ); 542 menuBar->insertItem( i18n("View"), viewMenu );
538 menuBar->insertItem( i18n("Actions"), actionMenu ); 543 menuBar->insertItem( i18n("Actions"), actionMenu );
539 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 544 menuBar->insertItem( i18n("Synchronize"), syncMenu );
540 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 545 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
541 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 546 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
542 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 547 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
543 menuBar->insertItem( i18n("Help"), helpMenu ); 548 menuBar->insertItem( i18n("Help"), helpMenu );
544 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 549 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
545 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 550 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
546 } 551 }
547 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 552 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
548 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 553 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
549 554
550 // ****************** 555 // ******************
551 QAction *action; 556 QAction *action;
@@ -575,48 +580,56 @@ void MainWindow::initActions()
575 connect( action, SIGNAL( activated() ), 580 connect( action, SIGNAL( activated() ),
576 mView, SLOT( edit_options() ) ); 581 mView, SLOT( edit_options() ) );
577 actionMenu->insertSeparator(); 582 actionMenu->insertSeparator();
578 583
579 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 584 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
580 action->addTo( actionMenu ); 585 action->addTo( actionMenu );
581 connect( action, SIGNAL( activated() ), 586 connect( action, SIGNAL( activated() ),
582 mView, SLOT( undo_delete() ) ); 587 mView, SLOT( undo_delete() ) );
583 actionMenu->insertSeparator(); 588 actionMenu->insertSeparator();
584 589
585 icon = loadPixmap( pathString + "newevent" ); 590 icon = loadPixmap( pathString + "newevent" );
586 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 591 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
587 configureToolBarMenu->insertSeparator(); 592 configureToolBarMenu->insertSeparator();
588 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 593 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
589 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 594 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
590 ne_action->addTo( actionMenu ); 595 ne_action->addTo( actionMenu );
591 connect( ne_action, SIGNAL( activated() ), 596 connect( ne_action, SIGNAL( activated() ),
592 mView, SLOT( newEvent() ) ); 597 mView, SLOT( newEvent() ) );
593 icon = loadPixmap( pathString + "newtodo" ); 598 icon = loadPixmap( pathString + "newtodo" );
594 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 599 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
595 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 600 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
596 nt_action->addTo( actionMenu ); 601 nt_action->addTo( actionMenu );
597 connect( nt_action, SIGNAL( activated() ), 602 connect( nt_action, SIGNAL( activated() ),
598 mView, SLOT( newTodo() ) ); 603 mView, SLOT( newTodo() ) );
604
605 icon = loadPixmap( pathString + "today" );
606 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
607 today_action->addTo( viewMenu );
608 connect( today_action, SIGNAL( activated() ),
609 mView, SLOT( goToday() ) );
610 viewMenu->insertSeparator();
611
599 icon = loadPixmap( pathString + "navi" ); 612 icon = loadPixmap( pathString + "navi" );
600 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 613 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
601 action->addTo( viewMenu ); 614 action->addTo( viewMenu );
602 connect( action, SIGNAL( activated() ), 615 connect( action, SIGNAL( activated() ),
603 mView, SLOT( toggleDateNavigatorWidget() ) ); 616 mView, SLOT( toggleDateNavigatorWidget() ) );
604 mToggleNav = action ; 617 mToggleNav = action ;
605 icon = loadPixmap( pathString + "filter" ); 618 icon = loadPixmap( pathString + "filter" );
606 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 619 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
607 action->addTo( viewMenu ); 620 action->addTo( viewMenu );
608 connect( action, SIGNAL( activated() ), 621 connect( action, SIGNAL( activated() ),
609 mView, SLOT( toggleFilter() ) ); 622 mView, SLOT( toggleFilter() ) );
610 mToggleFilter = action; 623 mToggleFilter = action;
611 icon = loadPixmap( pathString + "allday" ); 624 icon = loadPixmap( pathString + "allday" );
612 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 625 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
613 action->addTo( viewMenu ); 626 action->addTo( viewMenu );
614 connect( action, SIGNAL( activated() ), 627 connect( action, SIGNAL( activated() ),
615 mView, SLOT( toggleAllDaySize() ) ); 628 mView, SLOT( toggleAllDaySize() ) );
616 mToggleAllday = action; 629 mToggleAllday = action;
617 630
618 631
619 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 632 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
620 mToggleNav, SLOT( setEnabled ( bool ) ) ); 633 mToggleNav, SLOT( setEnabled ( bool ) ) );
621 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 634 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
622 mToggleFilter, SLOT( setEnabled ( bool ) ) ); 635 mToggleFilter, SLOT( setEnabled ( bool ) ) );
@@ -737,54 +750,49 @@ void MainWindow::initActions()
737 mView, SLOT( moveIncidence() ) ); 750 mView, SLOT( moveIncidence() ) );
738 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 751 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
739 mBeamAction->addTo( actionMenu ); 752 mBeamAction->addTo( actionMenu );
740 connect( mBeamAction, SIGNAL( activated() ), 753 connect( mBeamAction, SIGNAL( activated() ),
741 mView, SLOT( beamIncidence() ) ); 754 mView, SLOT( beamIncidence() ) );
742 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 755 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
743 mCancelAction->addTo( actionMenu ); 756 mCancelAction->addTo( actionMenu );
744 connect( mCancelAction, SIGNAL( activated() ), 757 connect( mCancelAction, SIGNAL( activated() ),
745 mView, SLOT( toggleCancelIncidence() ) ); 758 mView, SLOT( toggleCancelIncidence() ) );
746 759
747 actionMenu->insertSeparator(); 760 actionMenu->insertSeparator();
748 761
749 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 762 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
750 this ); 763 this );
751 action->addTo( actionMenu ); 764 action->addTo( actionMenu );
752 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 765 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
753 766
754 icon = loadPixmap( pathString + "search" ); 767 icon = loadPixmap( pathString + "search" );
755 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 768 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
756 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); 769 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4);
757 search_action->addTo( actionMenu ); 770 search_action->addTo( actionMenu );
758 connect( search_action, SIGNAL( activated() ), 771 connect( search_action, SIGNAL( activated() ),
759 mView->dialogManager(), SLOT( showSearchDialog() ) ); 772 mView->dialogManager(), SLOT( showSearchDialog() ) );
760 773
761 icon = loadPixmap( pathString + "today" ); 774
762 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
763 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
764 today_action->addTo( actionMenu );
765 connect( today_action, SIGNAL( activated() ),
766 mView, SLOT( goToday() ) );
767 775
768 if ( KOPrefs::instance()->mShowFullMenu ) { 776 if ( KOPrefs::instance()->mShowFullMenu ) {
769 actionMenu->insertSeparator(); 777 actionMenu->insertSeparator();
770 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 778 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
771 779
772 } 780 }
773 // actionMenu->insertSeparator(); 781 // actionMenu->insertSeparator();
774 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 782 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
775 this ); 783 this );
776 action->addTo( importMenu ); 784 action->addTo( importMenu );
777 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 785 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
778 action = new QAction( "import_quick", i18n("Import last file"), 0, 786 action = new QAction( "import_quick", i18n("Import last file"), 0,
779 this ); 787 this );
780 action->addTo( importMenu ); 788 action->addTo( importMenu );
781 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 789 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
782 importMenu->insertSeparator(); 790 importMenu->insertSeparator();
783 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 791 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
784 this ); 792 this );
785 action->addTo( importMenu ); 793 action->addTo( importMenu );
786 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 794 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
787#ifndef DESKTOP_VERSION 795#ifndef DESKTOP_VERSION
788 importMenu->insertSeparator(); 796 importMenu->insertSeparator();
789 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 797 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
790 this ); 798 this );
@@ -953,49 +961,51 @@ void MainWindow::initActions()
953 day5_action->addTo( iconToolBar ); 961 day5_action->addTo( iconToolBar );
954 if (p-> mShowIconDay7) 962 if (p-> mShowIconDay7)
955 day7_action->addTo( iconToolBar ); 963 day7_action->addTo( iconToolBar );
956 if (p-> mShowIconMonth) 964 if (p-> mShowIconMonth)
957 month_action->addTo( iconToolBar ); 965 month_action->addTo( iconToolBar );
958 if (p-> mShowIconTodoview) 966 if (p-> mShowIconTodoview)
959 todoview_action->addTo( iconToolBar ); 967 todoview_action->addTo( iconToolBar );
960 if (p-> mShowIconJournal) 968 if (p-> mShowIconJournal)
961 viewjournal_action->addTo( iconToolBar ); 969 viewjournal_action->addTo( iconToolBar );
962 icon = loadPixmap( pathString + "2leftarrowB" ); 970 icon = loadPixmap( pathString + "2leftarrowB" );
963 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 971 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
964 if (p-> mShowIconBackFast) { 972 if (p-> mShowIconBackFast) {
965 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 973 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
966 connect( action, SIGNAL( activated() ), 974 connect( action, SIGNAL( activated() ),
967 mView, SLOT( goPreviousMonth() ) ); 975 mView, SLOT( goPreviousMonth() ) );
968 action->addTo( iconToolBar ); 976 action->addTo( iconToolBar );
969 } 977 }
970 icon = loadPixmap( pathString + "1leftarrowB" ); 978 icon = loadPixmap( pathString + "1leftarrowB" );
971 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 979 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
972 if (p-> mShowIconBack) { 980 if (p-> mShowIconBack) {
973 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 981 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
974 connect( action, SIGNAL( activated() ), 982 connect( action, SIGNAL( activated() ),
975 mView, SLOT( goPrevious() ) ); 983 mView, SLOT( goPrevious() ) );
976 action->addTo( iconToolBar ); 984 action->addTo( iconToolBar );
977 } 985 }
986 icon = loadPixmap( pathString + "today" );
987 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
978 if (p-> mShowIconToday) 988 if (p-> mShowIconToday)
979 today_action->addTo( iconToolBar ); 989 today_action->addTo( iconToolBar );
980 icon = loadPixmap( pathString + "1rightarrowB" ); 990 icon = loadPixmap( pathString + "1rightarrowB" );
981 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 991 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
982 if (p-> mShowIconForward) { 992 if (p-> mShowIconForward) {
983 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 993 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
984 connect( action, SIGNAL( activated() ), 994 connect( action, SIGNAL( activated() ),
985 mView, SLOT( goNext() ) ); 995 mView, SLOT( goNext() ) );
986 action->addTo( iconToolBar ); 996 action->addTo( iconToolBar );
987 } 997 }
988 icon = loadPixmap( pathString + "2rightarrowB" ); 998 icon = loadPixmap( pathString + "2rightarrowB" );
989 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 999 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
990 if (p-> mShowIconForwardFast) { 1000 if (p-> mShowIconForwardFast) {
991 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1001 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
992 connect( action, SIGNAL( activated() ), 1002 connect( action, SIGNAL( activated() ),
993 mView, SLOT( goNextMonth() ) ); 1003 mView, SLOT( goNextMonth() ) );
994 action->addTo( iconToolBar ); 1004 action->addTo( iconToolBar );
995 } 1005 }
996 1006
997 1007
998 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 1008 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
999 1009
1000 if (p-> mShowIconNewEvent) 1010 if (p-> mShowIconNewEvent)
1001 configureToolBarMenu->setItemChecked( 10, true ); 1011 configureToolBarMenu->setItemChecked( 10, true );