author | zautrix <zautrix> | 2005-07-01 11:19:13 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-07-01 11:19:13 (UTC) |
commit | 5d603fd22bc8126c6a9a6f377701669d3cee18f2 (patch) (unidiff) | |
tree | 9fdef25d24a3a57e3ecf5ae2e4b1cc3d3fb0e0bf /korganizer/mainwindow.cpp | |
parent | 409f5296344084e22833b35c03923b89d7be653b (diff) | |
download | kdepimpi-5d603fd22bc8126c6a9a6f377701669d3cee18f2.zip kdepimpi-5d603fd22bc8126c6a9a6f377701669d3cee18f2.tar.gz kdepimpi-5d603fd22bc8126c6a9a6f377701669d3cee18f2.tar.bz2 |
many menu fixes
-rw-r--r-- | korganizer/mainwindow.cpp | 171 |
1 files changed, 99 insertions, 72 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index 23537a6..a5d8824 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -609,96 +609,101 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
609 | else if ( msg == "nextView()" ) { | 609 | else if ( msg == "nextView()" ) { |
610 | mView->viewManager()->showNextView(); | 610 | mView->viewManager()->showNextView(); |
611 | } | 611 | } |
612 | else if ( msg == "-showNextXView" ) { | 612 | else if ( msg == "-showNextXView" ) { |
613 | mView->viewManager()->showNextXView(); | 613 | mView->viewManager()->showNextXView(); |
614 | } | 614 | } |
615 | 615 | ||
616 | 616 | ||
617 | } | 617 | } |
618 | 618 | ||
619 | showMaximized(); | 619 | showMaximized(); |
620 | raise(); | 620 | raise(); |
621 | } | 621 | } |
622 | void MainWindow::startMultiSync() | 622 | void MainWindow::startMultiSync() |
623 | { | 623 | { |
624 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 624 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
625 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), | 625 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), |
626 | question, | 626 | question, |
627 | i18n("Yes"), i18n("No"), | 627 | i18n("Yes"), i18n("No"), |
628 | 0, 0 ) != 0 ) { | 628 | 0, 0 ) != 0 ) { |
629 | setCaption(i18n("Aborted! Nothing synced!")); | 629 | setCaption(i18n("Aborted! Nothing synced!")); |
630 | return; | 630 | return; |
631 | } | 631 | } |
632 | mSyncManager->multiSync( false ); | 632 | mSyncManager->multiSync( false ); |
633 | #ifndef DESKTOP_VERSION | 633 | #ifndef DESKTOP_VERSION |
634 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | 634 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); |
635 | #endif | 635 | #endif |
636 | } | 636 | } |
637 | QPixmap MainWindow::loadPixmap( QString name ) | 637 | QPixmap MainWindow::loadPixmap( QString name ) |
638 | { | 638 | { |
639 | return SmallIcon( name ); | 639 | return SmallIcon( name ); |
640 | 640 | ||
641 | } | 641 | } |
642 | void MainWindow::setUsesBigPixmaps ( bool b ) | 642 | void MainWindow::setUsesBigPixmaps ( bool b ) |
643 | { | 643 | { |
644 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 644 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
645 | if ( b ) | 645 | if ( b ) |
646 | qDebug("KO: BigPixmaps are not supported "); | 646 | qDebug("KO: BigPixmaps are not supported "); |
647 | } | 647 | } |
648 | void MainWindow::initActions() | 648 | void MainWindow::initActions() |
649 | { | 649 | { |
650 | //KOPrefs::instance()->mShowFullMenu | 650 | //KOPrefs::instance()->mShowFullMenu |
651 | iconToolBar->clear(); | 651 | iconToolBar->clear(); |
652 | KOPrefs *p = KOPrefs::instance(); | 652 | KOPrefs *p = KOPrefs::instance(); |
653 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 653 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
654 | 654 | ||
655 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 655 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
656 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 656 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
657 | #ifdef DESKTOP_VERSION | ||
658 | mCurrentItemMenu = actionMenu; | ||
659 | #else | ||
660 | mCurrentItemMenu = new QPopupMenu ( this ); | ||
661 | #endif | ||
657 | QPopupMenu *importMenu = new QPopupMenu( this ); | 662 | QPopupMenu *importMenu = new QPopupMenu( this ); |
658 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 663 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
659 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 664 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
660 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 665 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
661 | selectFilterMenu = new QPopupMenu( this ); | 666 | selectFilterMenu = new QPopupMenu( this ); |
662 | selectFilterMenu->setCheckable( true ); | 667 | selectFilterMenu->setCheckable( true ); |
663 | syncMenu = new QPopupMenu( this ); | 668 | syncMenu = new QPopupMenu( this ); |
664 | configureAgendaMenu = new QPopupMenu( this ); | 669 | configureAgendaMenu = new QPopupMenu( this ); |
665 | configureToolBarMenu = new QPopupMenu( this ); | 670 | configureToolBarMenu = new QPopupMenu( this ); |
666 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 671 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
667 | QIconSet icon; | 672 | QIconSet icon; |
668 | int pixWid = 22, pixHei = 22; | 673 | int pixWid = 22, pixHei = 22; |
669 | QString pathString = ""; | 674 | QString pathString = ""; |
670 | if ( !p->mToolBarMiniIcons ) { | 675 | if ( !p->mToolBarMiniIcons ) { |
671 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 676 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
672 | pathString += "icons16/"; | 677 | pathString += "icons16/"; |
673 | pixWid = 18; pixHei = 16; | 678 | pixWid = 18; pixHei = 16; |
674 | } | 679 | } |
675 | } else { | 680 | } else { |
676 | pathString += "iconsmini/"; | 681 | pathString += "iconsmini/"; |
677 | pixWid = 18; pixHei = 16; | 682 | pixWid = 18; pixHei = 16; |
678 | } | 683 | } |
679 | if ( KOPrefs::instance()->mShowFullMenu ) { | 684 | if ( KOPrefs::instance()->mShowFullMenu ) { |
680 | QMenuBar *menuBar1; | 685 | QMenuBar *menuBar1; |
681 | menuBar1 = menuBar(); | 686 | menuBar1 = menuBar(); |
682 | menuBar1->insertItem( i18n("File"), importMenu ); | 687 | menuBar1->insertItem( i18n("File"), importMenu ); |
683 | menuBar1->insertItem( i18n("View"), viewMenu ); | 688 | menuBar1->insertItem( i18n("View"), viewMenu ); |
684 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 689 | menuBar1->insertItem( i18n("Actions"), actionMenu ); |
685 | #ifdef DESKTOP_VERSION | 690 | #ifdef DESKTOP_VERSION |
686 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 691 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
687 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 692 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
688 | #else | 693 | #else |
689 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 694 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
690 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 695 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
691 | #endif | 696 | #endif |
692 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 697 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
693 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 698 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
694 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 699 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
695 | } else { | 700 | } else { |
696 | QPEMenuBar *menuBar1; | 701 | QPEMenuBar *menuBar1; |
697 | menuBar1 = new QPEMenuBar( iconToolBar ); | 702 | menuBar1 = new QPEMenuBar( iconToolBar ); |
698 | QPopupMenu *menuBar = new QPopupMenu( this ); | 703 | QPopupMenu *menuBar = new QPopupMenu( this ); |
699 | icon = loadPixmap( pathString + "z_menu" ); | 704 | icon = loadPixmap( pathString + "z_menu" ); |
700 | menuBar1->insertItem( icon.pixmap(), menuBar); | 705 | menuBar1->insertItem( icon.pixmap(), menuBar); |
701 | //menuBar1->insertItem( i18n("ME"), menuBar); | 706 | //menuBar1->insertItem( i18n("ME"), menuBar); |
702 | menuBar->insertItem( i18n("File"), importMenu ); | 707 | menuBar->insertItem( i18n("File"), importMenu ); |
703 | menuBar->insertItem( i18n("View"), viewMenu ); | 708 | menuBar->insertItem( i18n("View"), viewMenu ); |
704 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 709 | menuBar->insertItem( i18n("Actions"), actionMenu ); |
@@ -720,193 +725,232 @@ void MainWindow::initActions() | |||
720 | icon = mWeekPixmap; | 725 | icon = mWeekPixmap; |
721 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 726 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
722 | if ( p-> mShowIconWeekNum ) | 727 | if ( p-> mShowIconWeekNum ) |
723 | mWeekAction->addTo( iconToolBar ); | 728 | mWeekAction->addTo( iconToolBar ); |
724 | mWeekFont = font(); | 729 | mWeekFont = font(); |
725 | 730 | ||
726 | int fontPoint = mWeekFont.pointSize(); | 731 | int fontPoint = mWeekFont.pointSize(); |
727 | QFontMetrics f( mWeekFont ); | 732 | QFontMetrics f( mWeekFont ); |
728 | int fontWid = f.width( "30" ); | 733 | int fontWid = f.width( "30" ); |
729 | while ( fontWid > pixWid ) { | 734 | while ( fontWid > pixWid ) { |
730 | --fontPoint; | 735 | --fontPoint; |
731 | mWeekFont.setPointSize( fontPoint ); | 736 | mWeekFont.setPointSize( fontPoint ); |
732 | QFontMetrics f( mWeekFont ); | 737 | QFontMetrics f( mWeekFont ); |
733 | fontWid = f.width( "30" ); | 738 | fontWid = f.width( "30" ); |
734 | //qDebug("dec-- "); | 739 | //qDebug("dec-- "); |
735 | } | 740 | } |
736 | 741 | ||
737 | connect( mWeekAction, SIGNAL( activated() ), | 742 | connect( mWeekAction, SIGNAL( activated() ), |
738 | this, SLOT( weekAction() ) ); | 743 | this, SLOT( weekAction() ) ); |
739 | 744 | ||
740 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 745 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
741 | if ( p->mShowIconFilterview ) { | 746 | if ( p->mShowIconFilterview ) { |
742 | icon = loadPixmap( pathString + "filter" ); | 747 | icon = loadPixmap( pathString + "filter" ); |
743 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 748 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
744 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 749 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
745 | this, SLOT( fillFilterMenuTB() ) ); | 750 | this, SLOT( fillFilterMenuTB() ) ); |
746 | actionFilterMenuTB->addTo( iconToolBar ); | 751 | actionFilterMenuTB->addTo( iconToolBar ); |
747 | selectFilterMenuTB = new QPopupMenu( this ); | 752 | selectFilterMenuTB = new QPopupMenu( this ); |
748 | selectFilterMenuTB->setCheckable( true ); | 753 | selectFilterMenuTB->setCheckable( true ); |
749 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 754 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
750 | } | 755 | } |
751 | 756 | ||
752 | //#endif | 757 | //#endif |
753 | // ****************** | 758 | // ****************** |
754 | QAction *action; | 759 | QAction *action; |
755 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 760 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
756 | configureToolBarMenu->setCheckable( true ); | 761 | configureToolBarMenu->setCheckable( true ); |
757 | 762 | ||
758 | 763 | ||
759 | configureAgendaMenu->setCheckable( true ); | 764 | configureAgendaMenu->setCheckable( true ); |
760 | int iii ; | 765 | int iii ; |
761 | for ( iii = 1;iii<= 10 ;++iii ){ | 766 | for ( iii = 1;iii<= 10 ;++iii ){ |
762 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 767 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
763 | } | 768 | } |
764 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 769 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
765 | 770 | ||
766 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 771 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
767 | this, SLOT( showConfigureAgenda( ) ) ); | 772 | this, SLOT( showConfigureAgenda( ) ) ); |
773 | icon = loadPixmap( pathString + "today" ); | ||
774 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | ||
775 | today_action->addTo( actionMenu ); | ||
776 | connect( today_action, SIGNAL( activated() ), | ||
777 | mView, SLOT( goToday() ) ); | ||
778 | |||
779 | icon = loadPixmap( pathString + "picker" ); | ||
780 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); | ||
781 | dPickerAction->addTo( actionMenu ); | ||
782 | connect( dPickerAction, SIGNAL( activated() ), | ||
783 | mView, SLOT( showDatePicker() ) ); | ||
784 | |||
785 | icon = loadPixmap( pathString + "search" ); | ||
786 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | ||
787 | search_action->addTo( actionMenu ); | ||
788 | connect( search_action, SIGNAL( activated() ), | ||
789 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | ||
768 | 790 | ||
769 | icon = loadPixmap( pathString + "configure" ); | ||
770 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | ||
771 | action->addTo( actionMenu ); | ||
772 | connect( action, SIGNAL( activated() ), | ||
773 | mView, SLOT( edit_options() ) ); | ||
774 | icon = loadPixmap( pathString + "configure" ); | ||
775 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | ||
776 | action->addTo( actionMenu ); | ||
777 | connect( action, SIGNAL( activated() ), | ||
778 | mView, SLOT( edit_global_options() ) ); | ||
779 | actionMenu->insertSeparator(); | 791 | actionMenu->insertSeparator(); |
792 | |||
793 | |||
780 | 794 | ||
781 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 795 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
782 | action->addTo( actionMenu ); | 796 | action->addTo( actionMenu ); |
783 | connect( action, SIGNAL( activated() ), | 797 | connect( action, SIGNAL( activated() ), |
784 | mView, SLOT( undo_delete() ) ); | 798 | mView, SLOT( undo_delete() ) ); |
785 | actionMenu->insertSeparator(); | ||
786 | 799 | ||
787 | icon = loadPixmap( pathString + "newevent" ); | 800 | icon = loadPixmap( pathString + "newevent" ); |
788 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 801 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
789 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 802 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
790 | configureToolBarMenu->insertSeparator(); | 803 | configureToolBarMenu->insertSeparator(); |
791 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 804 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
792 | configureToolBarMenu->insertSeparator(); | 805 | configureToolBarMenu->insertSeparator(); |
793 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 806 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
794 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 807 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
808 | |||
809 | #ifndef DESKTOP_VERSION | ||
810 | actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | ||
811 | #endif | ||
812 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | ||
813 | mShowAction->addTo( mCurrentItemMenu ); | ||
814 | connect( mShowAction, SIGNAL( activated() ), | ||
815 | mView, SLOT( showIncidence() ) ); | ||
816 | |||
817 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | ||
818 | mEditAction->addTo( mCurrentItemMenu ); | ||
819 | connect( mEditAction, SIGNAL( activated() ), | ||
820 | mView, SLOT( editIncidence() ) ); | ||
821 | |||
822 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | ||
823 | mDeleteAction->addTo( mCurrentItemMenu ); | ||
824 | connect( mDeleteAction, SIGNAL( activated() ), | ||
825 | mView, SLOT( deleteIncidence() ) ); | ||
826 | |||
827 | |||
828 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | ||
829 | mCloneAction->addTo( mCurrentItemMenu ); | ||
830 | connect( mCloneAction, SIGNAL( activated() ), | ||
831 | mView, SLOT( cloneIncidence() ) ); | ||
832 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | ||
833 | mMoveAction->addTo( mCurrentItemMenu ); | ||
834 | connect( mMoveAction, SIGNAL( activated() ), | ||
835 | mView, SLOT( moveIncidence() ) ); | ||
836 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | ||
837 | mBeamAction->addTo(mCurrentItemMenu ); | ||
838 | connect( mBeamAction, SIGNAL( activated() ), | ||
839 | mView, SLOT( beamIncidence() ) ); | ||
840 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | ||
841 | mCancelAction->addTo( mCurrentItemMenu ); | ||
842 | connect( mCancelAction, SIGNAL( activated() ), | ||
843 | mView, SLOT( toggleCancelIncidence() ) ); | ||
844 | #ifdef DESKTOP_VERSION | ||
845 | actionMenu->insertSeparator(); | ||
846 | #endif | ||
847 | |||
848 | |||
795 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 849 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
796 | ne_action->addTo( actionMenu ); | 850 | ne_action->addTo( actionMenu ); |
797 | connect( ne_action, SIGNAL( activated() ), | 851 | connect( ne_action, SIGNAL( activated() ), |
798 | mView, SLOT( newEvent() ) ); | 852 | mView, SLOT( newEvent() ) ); |
799 | icon = loadPixmap( pathString + "newtodo" ); | 853 | icon = loadPixmap( pathString + "newtodo" ); |
800 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 854 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
801 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 855 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
802 | nt_action->addTo( actionMenu ); | 856 | nt_action->addTo( actionMenu ); |
803 | connect( nt_action, SIGNAL( activated() ), | 857 | connect( nt_action, SIGNAL( activated() ), |
804 | mView, SLOT( newTodo() ) ); | 858 | mView, SLOT( newTodo() ) ); |
805 | 859 | ||
806 | icon = loadPixmap( pathString + "today" ); | 860 | |
807 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | ||
808 | today_action->addTo( viewMenu ); | ||
809 | connect( today_action, SIGNAL( activated() ), | ||
810 | mView, SLOT( goToday() ) ); | ||
811 | viewMenu->insertSeparator(); | ||
812 | 861 | ||
813 | // *********************** | 862 | // *********************** |
814 | if ( KOPrefs::instance()->mVerticalScreen ) { | 863 | if ( KOPrefs::instance()->mVerticalScreen ) { |
815 | icon = SmallIcon( "1updownarrow" ); | 864 | icon = SmallIcon( "1updownarrow" ); |
816 | } else { | 865 | } else { |
817 | icon = SmallIcon("1leftrightarrow" ); | 866 | icon = SmallIcon("1leftrightarrow" ); |
818 | } | 867 | } |
819 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 868 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
820 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 869 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
821 | FSaction->addTo( viewMenu ); | 870 | FSaction->addTo( viewMenu ); |
822 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 871 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
823 | 872 | ||
824 | 873 | ||
825 | icon = loadPixmap( pathString + "filter" ); | 874 | icon = loadPixmap( pathString + "filter" ); |
826 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 875 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
827 | icon = loadPixmap( pathString + "configure" ); | 876 | icon = loadPixmap( pathString + "configure" ); |
828 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 877 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
829 | action->addTo( viewMenu ); | 878 | action->addTo( viewMenu ); |
830 | connect( action, SIGNAL( activated() ), | 879 | connect( action, SIGNAL( activated() ), |
831 | mView, SLOT( toggleFilter() ) ); | 880 | mView, SLOT( toggleFilter() ) ); |
832 | mToggleFilter = action; | 881 | mToggleFilter = action; |
833 | icon = loadPixmap( pathString + "navi" ); | 882 | icon = loadPixmap( pathString + "navi" ); |
834 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 883 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
835 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 884 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
836 | action->addTo( viewMenu ); | 885 | action->addTo( viewMenu ); |
837 | connect( action, SIGNAL( activated() ), | 886 | connect( action, SIGNAL( activated() ), |
838 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 887 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
839 | mToggleNav = action ; | 888 | mToggleNav = action ; |
840 | icon = loadPixmap( pathString + "allday" ); | 889 | icon = loadPixmap( pathString + "allday" ); |
841 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 890 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
842 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 891 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
843 | action->addTo( viewMenu ); | 892 | action->addTo( viewMenu ); |
844 | connect( action, SIGNAL( activated() ), | 893 | connect( action, SIGNAL( activated() ), |
845 | mView, SLOT( toggleAllDaySize() ) ); | 894 | mView, SLOT( toggleAllDaySize() ) ); |
846 | mToggleAllday = action; | 895 | mToggleAllday = action; |
847 | 896 | ||
848 | 897 | ||
849 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 898 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
850 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 899 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
851 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 900 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
852 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 901 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
853 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 902 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
854 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 903 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
855 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 904 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
856 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | 905 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); |
857 | 906 | ||
858 | viewMenu->insertSeparator(); | 907 | |
859 | icon = loadPixmap( pathString + "picker" ); | 908 | dPickerAction->addTo( iconToolBar ); |
860 | action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); | ||
861 | action->addTo( viewMenu ); | ||
862 | connect( action, SIGNAL( activated() ), | ||
863 | mView, SLOT( showDatePicker() ) ); | ||
864 | action->addTo( iconToolBar ); | ||
865 | viewMenu->insertSeparator(); | 909 | viewMenu->insertSeparator(); |
866 | 910 | ||
867 | if ( p-> mShowIconToggleFull ) | 911 | if ( p-> mShowIconToggleFull ) |
868 | FSaction->addTo( iconToolBar ); | 912 | FSaction->addTo( iconToolBar ); |
869 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); | 913 | if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); |
870 | 914 | ||
871 | //******************** | 915 | //******************** |
872 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); | 916 | if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); |
873 | 917 | ||
874 | 918 | ||
875 | icon = loadPixmap( pathString + "whatsnext" ); | 919 | icon = loadPixmap( pathString + "whatsnext" ); |
876 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); | 920 | configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); |
877 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); | 921 | QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); |
878 | whatsnext_action->addTo( viewMenu ); | 922 | whatsnext_action->addTo( viewMenu ); |
879 | connect( whatsnext_action, SIGNAL( activated() ), | 923 | connect( whatsnext_action, SIGNAL( activated() ), |
880 | mView->viewManager(), SLOT( showWhatsNextView() ) ); | 924 | mView->viewManager(), SLOT( showWhatsNextView() ) ); |
881 | 925 | ||
882 | icon = loadPixmap( pathString + "xdays" ); | 926 | icon = loadPixmap( pathString + "xdays" ); |
883 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); | 927 | configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); |
884 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); | 928 | QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); |
885 | xdays_action->addTo( viewMenu ); | 929 | xdays_action->addTo( viewMenu ); |
886 | connect( xdays_action, SIGNAL( activated() ), | 930 | connect( xdays_action, SIGNAL( activated() ), |
887 | mView->viewManager(), SLOT( showNextXView() ) ); | 931 | mView->viewManager(), SLOT( showNextXView() ) ); |
888 | 932 | ||
889 | 933 | ||
890 | icon = loadPixmap( pathString + "journal" ); | 934 | icon = loadPixmap( pathString + "journal" ); |
891 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); | 935 | configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); |
892 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); | 936 | QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); |
893 | viewjournal_action->addTo( viewMenu ); | 937 | viewjournal_action->addTo( viewMenu ); |
894 | connect( viewjournal_action, SIGNAL( activated() ), | 938 | connect( viewjournal_action, SIGNAL( activated() ), |
895 | mView->viewManager(), SLOT( showJournalView() ) ); | 939 | mView->viewManager(), SLOT( showJournalView() ) ); |
896 | 940 | ||
897 | 941 | ||
898 | icon = loadPixmap( pathString + "day" ); | 942 | icon = loadPixmap( pathString + "day" ); |
899 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); | 943 | configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); |
900 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); | 944 | QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); |
901 | day1_action->addTo( viewMenu ); | 945 | day1_action->addTo( viewMenu ); |
902 | // action->addTo( toolBar ); | 946 | // action->addTo( toolBar ); |
903 | connect( day1_action, SIGNAL( activated() ), | 947 | connect( day1_action, SIGNAL( activated() ), |
904 | mView->viewManager(), SLOT( showDayView() ) ); | 948 | mView->viewManager(), SLOT( showDayView() ) ); |
905 | 949 | ||
906 | icon = loadPixmap( pathString + "workweek" ); | 950 | icon = loadPixmap( pathString + "workweek" ); |
907 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); | 951 | configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); |
908 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); | 952 | QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); |
909 | day5_action->addTo( viewMenu ); | 953 | day5_action->addTo( viewMenu ); |
910 | connect( day5_action, SIGNAL( activated() ), | 954 | connect( day5_action, SIGNAL( activated() ), |
911 | mView->viewManager(), SLOT( showWorkWeekView() ) ); | 955 | mView->viewManager(), SLOT( showWorkWeekView() ) ); |
912 | 956 | ||
@@ -915,149 +959,130 @@ void MainWindow::initActions() | |||
915 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); | 959 | QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); |
916 | day7_action->addTo( viewMenu ); | 960 | day7_action->addTo( viewMenu ); |
917 | connect( day7_action, SIGNAL( activated() ), | 961 | connect( day7_action, SIGNAL( activated() ), |
918 | mView->viewManager(), SLOT( showWeekView() ) ); | 962 | mView->viewManager(), SLOT( showWeekView() ) ); |
919 | 963 | ||
920 | icon = loadPixmap( pathString + "workweek2" ); | 964 | icon = loadPixmap( pathString + "workweek2" ); |
921 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); | 965 | configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); |
922 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); | 966 | QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); |
923 | day6_action->addTo( viewMenu ); | 967 | day6_action->addTo( viewMenu ); |
924 | connect( day6_action, SIGNAL( activated() ), | 968 | connect( day6_action, SIGNAL( activated() ), |
925 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); | 969 | mView->viewManager(), SLOT( showMonthViewWeek() ) ); |
926 | 970 | ||
927 | icon = loadPixmap( pathString + "month" ); | 971 | icon = loadPixmap( pathString + "month" ); |
928 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); | 972 | configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); |
929 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); | 973 | QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); |
930 | month_action->addTo( viewMenu ); | 974 | month_action->addTo( viewMenu ); |
931 | connect( month_action, SIGNAL( activated() ), | 975 | connect( month_action, SIGNAL( activated() ), |
932 | mView->viewManager(), SLOT( showMonthView() ) ); | 976 | mView->viewManager(), SLOT( showMonthView() ) ); |
933 | 977 | ||
934 | icon = loadPixmap( pathString + "list" ); | 978 | icon = loadPixmap( pathString + "list" ); |
935 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); | 979 | configureToolBarMenu->insertItem(icon, i18n("List View"), 30 ); |
936 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); | 980 | QAction* showlist_action = new QAction( i18n("List View"), icon, i18n("List View"), 0, this ); |
937 | showlist_action->addTo( viewMenu ); | 981 | showlist_action->addTo( viewMenu ); |
938 | connect( showlist_action, SIGNAL( activated() ), | 982 | connect( showlist_action, SIGNAL( activated() ), |
939 | mView->viewManager(), SLOT( showListView() ) ); | 983 | mView->viewManager(), SLOT( showListView() ) ); |
940 | 984 | ||
941 | icon = loadPixmap( pathString + "todo" ); | 985 | icon = loadPixmap( pathString + "todo" ); |
942 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); | 986 | configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); |
943 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); | 987 | QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); |
944 | todoview_action->addTo( viewMenu ); | 988 | todoview_action->addTo( viewMenu ); |
945 | connect( todoview_action, SIGNAL( activated() ), | 989 | connect( todoview_action, SIGNAL( activated() ), |
946 | mView->viewManager(), SLOT( showTodoView() ) ); | 990 | mView->viewManager(), SLOT( showTodoView() ) ); |
947 | 991 | ||
948 | 992 | ||
949 | 993 | ||
950 | #if 0 | 994 | #if 0 |
951 | action = new QAction( "view_timespan", "Time Span", 0, this ); | 995 | action = new QAction( "view_timespan", "Time Span", 0, this ); |
952 | action->addTo( viewMenu ); | 996 | action->addTo( viewMenu ); |
953 | connect( action, SIGNAL( activated() ), | 997 | connect( action, SIGNAL( activated() ), |
954 | mView->viewManager(), SLOT( showTimeSpanView() ) ); | 998 | mView->viewManager(), SLOT( showTimeSpanView() ) ); |
955 | #endif | 999 | #endif |
956 | 1000 | ||
957 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, | 1001 | mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, |
958 | this ); | 1002 | this ); |
959 | mNewSubTodoAction->addTo( actionMenu ); | 1003 | mNewSubTodoAction->addTo( actionMenu ); |
960 | connect( mNewSubTodoAction, SIGNAL( activated() ), | 1004 | connect( mNewSubTodoAction, SIGNAL( activated() ), |
961 | mView, SLOT( newSubTodo() ) ); | 1005 | mView, SLOT( newSubTodo() ) ); |
962 | 1006 | ||
963 | actionMenu->insertSeparator(); | 1007 | action = new QAction( "purge_completed", i18n("Purge Completed..."), 0, |
964 | 1008 | this ); | |
965 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 1009 | action->addTo( actionMenu ); |
966 | mShowAction->addTo( actionMenu ); | 1010 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); |
967 | connect( mShowAction, SIGNAL( activated() ), | ||
968 | mView, SLOT( showIncidence() ) ); | ||
969 | 1011 | ||
970 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 1012 | |
971 | mEditAction->addTo( actionMenu ); | 1013 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); |
972 | connect( mEditAction, SIGNAL( activated() ), | ||
973 | mView, SLOT( editIncidence() ) ); | ||
974 | 1014 | ||
975 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | ||
976 | mDeleteAction->addTo( actionMenu ); | ||
977 | connect( mDeleteAction, SIGNAL( activated() ), | ||
978 | mView, SLOT( deleteIncidence() ) ); | ||
979 | 1015 | ||
980 | 1016 | ||
981 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | ||
982 | mCloneAction->addTo( actionMenu ); | ||
983 | connect( mCloneAction, SIGNAL( activated() ), | ||
984 | mView, SLOT( cloneIncidence() ) ); | ||
985 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | ||
986 | mMoveAction->addTo( actionMenu ); | ||
987 | connect( mMoveAction, SIGNAL( activated() ), | ||
988 | mView, SLOT( moveIncidence() ) ); | ||
989 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | ||
990 | mBeamAction->addTo( actionMenu ); | ||
991 | connect( mBeamAction, SIGNAL( activated() ), | ||
992 | mView, SLOT( beamIncidence() ) ); | ||
993 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | ||
994 | mCancelAction->addTo( actionMenu ); | ||
995 | connect( mCancelAction, SIGNAL( activated() ), | ||
996 | mView, SLOT( toggleCancelIncidence() ) ); | ||
997 | |||
998 | actionMenu->insertSeparator(); | 1017 | actionMenu->insertSeparator(); |
999 | 1018 | action = new QAction( "manage cat", i18n("Edit category list..."), 0, | |
1000 | action = new QAction( "purge_completed", i18n("Purge Completed"), 0, | ||
1001 | this ); | 1019 | this ); |
1002 | action->addTo( actionMenu ); | 1020 | action->addTo( actionMenu ); |
1003 | connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); | 1021 | connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) ); |
1004 | 1022 | ||
1005 | icon = loadPixmap( pathString + "search" ); | 1023 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, |
1006 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 1024 | this ); |
1007 | configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5); | 1025 | action->addTo( actionMenu ); |
1008 | search_action->addTo( actionMenu ); | 1026 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); |
1009 | connect( search_action, SIGNAL( activated() ), | ||
1010 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | ||
1011 | 1027 | ||
1012 | |||
1013 | 1028 | ||
1029 | actionMenu->insertSeparator(); | ||
1030 | icon = loadPixmap( pathString + "configure" ); | ||
1031 | action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this ); | ||
1032 | action->addTo( actionMenu ); | ||
1033 | connect( action, SIGNAL( activated() ), | ||
1034 | mView, SLOT( edit_options() ) ); | ||
1035 | icon = loadPixmap( pathString + "configure" ); | ||
1036 | action = new QAction( i18n("Configure"),icon, i18n("Global Settings..."), 0, this ); | ||
1037 | action->addTo( actionMenu ); | ||
1038 | connect( action, SIGNAL( activated() ), | ||
1039 | mView, SLOT( edit_global_options() ) ); | ||
1014 | if ( KOPrefs::instance()->mShowFullMenu ) { | 1040 | if ( KOPrefs::instance()->mShowFullMenu ) { |
1015 | actionMenu->insertSeparator(); | ||
1016 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); | 1041 | actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); |
1017 | 1042 | ||
1018 | } | 1043 | } |
1019 | // actionMenu->insertSeparator(); | 1044 | // actionMenu->insertSeparator(); |
1020 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, | 1045 | action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, |
1021 | this ); | 1046 | this ); |
1022 | action->addTo( importMenu_X ); | 1047 | action->addTo( importMenu_X ); |
1023 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); | 1048 | connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); |
1024 | action = new QAction( "import_quick", i18n("Import last file"), 0, | 1049 | action = new QAction( "import_quick", i18n("Import last file"), 0, |
1025 | this ); | 1050 | this ); |
1026 | action->addTo( importMenu_X ); | 1051 | action->addTo( importMenu_X ); |
1027 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); | 1052 | connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); |
1028 | importMenu_X->insertSeparator(); | 1053 | importMenu_X->insertSeparator(); |
1029 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, | 1054 | action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, |
1030 | this ); | 1055 | this ); |
1031 | action->addTo( importMenu_X ); | 1056 | action->addTo( importMenu_X ); |
1032 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); | 1057 | connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); |
1033 | //#ifndef DESKTOP_VERSION | 1058 | //#ifndef DESKTOP_VERSION |
1034 | importMenu_X->insertSeparator(); | 1059 | importMenu_X->insertSeparator(); |
1035 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, | 1060 | action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, |
1036 | this ); | 1061 | this ); |
1037 | action->addTo( importMenu_X ); | 1062 | action->addTo( importMenu_X ); |
1038 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); | 1063 | connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); |
1039 | //#else | 1064 | //#else |
1040 | #ifdef _OL_IMPORT_ | 1065 | #ifdef _OL_IMPORT_ |
1041 | importMenu_X->insertSeparator(); | 1066 | importMenu_X->insertSeparator(); |
1042 | action = new QAction( "import_ol", i18n("Import from OL"), 0, | 1067 | action = new QAction( "import_ol", i18n("Import from OL"), 0, |
1043 | this ); | 1068 | this ); |
1044 | action->addTo( importMenu_X ); | 1069 | action->addTo( importMenu_X ); |
1045 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); | 1070 | connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); |
1046 | #endif | 1071 | #endif |
1047 | //#endif | 1072 | //#endif |
1048 | 1073 | ||
1049 | //importMenu->insertSeparator(); | 1074 | //importMenu->insertSeparator(); |
1050 | #if 0 | 1075 | #if 0 |
1051 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, | 1076 | action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, |
1052 | this ); | 1077 | this ); |
1053 | action->addTo( importMenu ); | 1078 | action->addTo( importMenu ); |
1054 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); | 1079 | connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); |
1055 | #endif | 1080 | #endif |
1056 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, | 1081 | action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, |
1057 | this ); | 1082 | this ); |
1058 | action->addTo( importMenu ); | 1083 | action->addTo( importMenu ); |
1059 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); | 1084 | connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); |
1060 | importMenu->insertSeparator(); | 1085 | importMenu->insertSeparator(); |
1061 | importMenu->insertItem( i18n("Import"), importMenu_X ); | 1086 | importMenu->insertItem( i18n("Import"), importMenu_X ); |
1062 | //importMenu->insertSeparator(); | 1087 | //importMenu->insertSeparator(); |
1063 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, | 1088 | action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, |
@@ -1079,101 +1104,97 @@ void MainWindow::initActions() | |||
1079 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, | 1104 | brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, |
1080 | this ); | 1105 | this ); |
1081 | brAction->addTo( beamMenu_X ); | 1106 | brAction->addTo( beamMenu_X ); |
1082 | brAction->setToggleAction (true ) ; | 1107 | brAction->setToggleAction (true ) ; |
1083 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); | 1108 | connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); |
1084 | 1109 | ||
1085 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, | 1110 | action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, |
1086 | this ); | 1111 | this ); |
1087 | action->addTo( beamMenu_X ); | 1112 | action->addTo( beamMenu_X ); |
1088 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); | 1113 | connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); |
1089 | 1114 | ||
1090 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, | 1115 | action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, |
1091 | this ); | 1116 | this ); |
1092 | action->addTo( beamMenu_X ); | 1117 | action->addTo( beamMenu_X ); |
1093 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); | 1118 | connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); |
1094 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); | 1119 | importMenu->insertItem( i18n("Beam"), beamMenu_X ); |
1095 | #else | 1120 | #else |
1096 | //importMenu->insertSeparator(); | 1121 | //importMenu->insertSeparator(); |
1097 | icon = loadPixmap( pathString + "print" ); | 1122 | icon = loadPixmap( pathString + "print" ); |
1098 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); | 1123 | action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); |
1099 | action->addTo( beamMenu_X ); | 1124 | action->addTo( beamMenu_X ); |
1100 | connect( action, SIGNAL( activated() ), | 1125 | connect( action, SIGNAL( activated() ), |
1101 | this, SLOT( printCal() ) ); | 1126 | this, SLOT( printCal() ) ); |
1102 | 1127 | ||
1103 | icon = loadPixmap( pathString + "print" ); | 1128 | icon = loadPixmap( pathString + "print" ); |
1104 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); | 1129 | action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); |
1105 | action->addTo( beamMenu_X ); | 1130 | action->addTo( beamMenu_X ); |
1106 | connect( action, SIGNAL( activated() ), | 1131 | connect( action, SIGNAL( activated() ), |
1107 | this, SLOT( printSel() ) ); | 1132 | this, SLOT( printSel() ) ); |
1108 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); | 1133 | action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); |
1109 | action->addTo( beamMenu_X ); | 1134 | action->addTo( beamMenu_X ); |
1110 | connect( action, SIGNAL( activated() ), | 1135 | connect( action, SIGNAL( activated() ), |
1111 | mView->viewManager(), SLOT( slotprintWNV() ) ); | 1136 | mView->viewManager(), SLOT( slotprintWNV() ) ); |
1112 | 1137 | ||
1113 | 1138 | ||
1114 | icon = loadPixmap( pathString + "print" ); | 1139 | icon = loadPixmap( pathString + "print" ); |
1115 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); | 1140 | action = new QAction( i18n("Print List View..."),icon,i18n("Print List View..."), 0, this ); |
1116 | action->addTo( beamMenu_X ); | 1141 | action->addTo( beamMenu_X ); |
1117 | connect( action, SIGNAL( activated() ), | 1142 | connect( action, SIGNAL( activated() ), |
1118 | this, SLOT( printListView() ) ); | 1143 | this, SLOT( printListView() ) ); |
1119 | 1144 | ||
1120 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); | 1145 | action = new QAction( i18n("Print selected event / todo..."),icon,i18n("Print selected event / todo..."), 0, this ); |
1121 | action->addTo( beamMenu_X ); | 1146 | action->addTo( beamMenu_X ); |
1122 | connect( action, SIGNAL( activated() ), | 1147 | connect( action, SIGNAL( activated() ), |
1123 | mView, SLOT( slotprintSelInc() ) ); | 1148 | mView, SLOT( slotprintSelInc() ) ); |
1124 | 1149 | ||
1125 | importMenu->insertItem( i18n("Print"), beamMenu_X ); | 1150 | importMenu->insertItem( i18n("Print"), beamMenu_X ); |
1126 | #endif | 1151 | #endif |
1127 | importMenu->insertSeparator(); | 1152 | |
1128 | action = new QAction( "manage cat", i18n("Manage new categories..."), 0, | ||
1129 | this ); | ||
1130 | action->addTo( importMenu ); | ||
1131 | connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); | ||
1132 | importMenu->insertSeparator(); | 1153 | importMenu->insertSeparator(); |
1133 | action = new QAction( "beam all", i18n("Save"), 0, | 1154 | action = new QAction( "beam all", i18n("Save"), 0, |
1134 | this ); | 1155 | this ); |
1135 | action->addTo( importMenu ); | 1156 | action->addTo( importMenu ); |
1136 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); | 1157 | connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); |
1137 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, | 1158 | action = new QAction( "beam all", i18n("Exit (+save)"), 0, |
1138 | this ); | 1159 | this ); |
1139 | action->addTo( importMenu ); | 1160 | action->addTo( importMenu ); |
1140 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); | 1161 | connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); |
1141 | 1162 | ||
1142 | //menuBar->insertItem( "Configure",configureMenu ); | 1163 | //menuBar->insertItem( "Configure",configureMenu ); |
1143 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); | 1164 | //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); |
1144 | icon = loadPixmap( "korganizer/korganizer" ); | 1165 | icon = loadPixmap( "korganizer/korganizer" ); |
1145 | 1166 | ||
1146 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); | 1167 | action = new QAction( "Whats New", i18n("What's new?"), 0,this ); |
1147 | action->addTo( helpMenu ); | 1168 | action->addTo( helpMenu ); |
1148 | connect( action, SIGNAL( activated() ), | 1169 | connect( action, SIGNAL( activated() ), |
1149 | SLOT( whatsNew() ) ); | 1170 | SLOT( whatsNew() ) ); |
1150 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); | 1171 | action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); |
1151 | action->addTo( helpMenu ); | 1172 | action->addTo( helpMenu ); |
1152 | connect( action, SIGNAL( activated() ), | 1173 | connect( action, SIGNAL( activated() ), |
1153 | SLOT( features() ) ); | 1174 | SLOT( features() ) ); |
1154 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); | 1175 | action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); |
1155 | action->addTo( helpMenu ); | 1176 | action->addTo( helpMenu ); |
1156 | connect( action, SIGNAL( activated() ), | 1177 | connect( action, SIGNAL( activated() ), |
1157 | SLOT( keyBindings() ) ); | 1178 | SLOT( keyBindings() ) ); |
1158 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); | 1179 | action = new QAction( "Storage Howto", i18n("Storage HowTo..."), 0,this ); |
1159 | action->addTo( helpMenu ); | 1180 | action->addTo( helpMenu ); |
1160 | connect( action, SIGNAL( activated() ), | 1181 | connect( action, SIGNAL( activated() ), |
1161 | SLOT( storagehowto() ) ); | 1182 | SLOT( storagehowto() ) ); |
1162 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); | 1183 | action = new QAction( "Timetracking Howto", i18n("Timetracking HowTo..."), 0,this ); |
1163 | action->addTo( helpMenu ); | 1184 | action->addTo( helpMenu ); |
1164 | connect( action, SIGNAL( activated() ), | 1185 | connect( action, SIGNAL( activated() ), |
1165 | SLOT( timetrackinghowto() ) ); | 1186 | SLOT( timetrackinghowto() ) ); |
1166 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); | 1187 | action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); |
1167 | action->addTo( helpMenu ); | 1188 | action->addTo( helpMenu ); |
1168 | connect( action, SIGNAL( activated() ), | 1189 | connect( action, SIGNAL( activated() ), |
1169 | SLOT( synchowto() ) ); | 1190 | SLOT( synchowto() ) ); |
1170 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); | 1191 | action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); |
1171 | action->addTo( helpMenu ); | 1192 | action->addTo( helpMenu ); |
1172 | connect( action, SIGNAL( activated() ), | 1193 | connect( action, SIGNAL( activated() ), |
1173 | SLOT( kdesynchowto() ) ); | 1194 | SLOT( kdesynchowto() ) ); |
1174 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); | 1195 | action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); |
1175 | action->addTo( helpMenu ); | 1196 | action->addTo( helpMenu ); |
1176 | connect( action, SIGNAL( activated() ), | 1197 | connect( action, SIGNAL( activated() ), |
1177 | SLOT( multisynchowto() ) ); | 1198 | SLOT( multisynchowto() ) ); |
1178 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); | 1199 | action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); |
1179 | action->addTo( helpMenu ); | 1200 | action->addTo( helpMenu ); |
@@ -1669,104 +1690,109 @@ void MainWindow::processIncidenceSelection( Incidence *incidence ) | |||
1669 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1690 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1670 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1691 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1671 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1692 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1672 | 1693 | ||
1673 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1694 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1674 | bool ok; | 1695 | bool ok; |
1675 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1696 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1676 | if ( ok ) { | 1697 | if ( ok ) { |
1677 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1698 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1678 | startString += i18n(" (%1 y.)"). arg( years ); | 1699 | startString += i18n(" (%1 y.)"). arg( years ); |
1679 | } | 1700 | } |
1680 | } | 1701 | } |
1681 | else | 1702 | else |
1682 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1703 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1683 | } | 1704 | } |
1684 | 1705 | ||
1685 | } | 1706 | } |
1686 | else | 1707 | else |
1687 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1708 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1688 | if ( !incidence->location().isEmpty() ) | 1709 | if ( !incidence->location().isEmpty() ) |
1689 | startString += " (" +incidence->location()+")"; | 1710 | startString += " (" +incidence->location()+")"; |
1690 | setCaption( incidence->summary()+startString); | 1711 | setCaption( incidence->summary()+startString); |
1691 | 1712 | ||
1692 | enableIncidenceActions( true ); | 1713 | enableIncidenceActions( true ); |
1693 | 1714 | ||
1694 | if ( incidence->typeID() == eventID ) { | 1715 | if ( incidence->typeID() == eventID ) { |
1695 | mShowAction->setText( i18n("Show Event...") ); | 1716 | mShowAction->setText( i18n("Show Event...") ); |
1696 | mEditAction->setText( i18n("Edit Event...") ); | 1717 | mEditAction->setText( i18n("Edit Event...") ); |
1697 | mDeleteAction->setText( i18n("Delete Event...") ); | 1718 | mDeleteAction->setText( i18n("Delete Event...") ); |
1698 | 1719 | ||
1699 | mNewSubTodoAction->setEnabled( false ); | 1720 | mNewSubTodoAction->setEnabled( false ); |
1700 | } else if ( incidence->typeID() == todoID ) { | 1721 | } else if ( incidence->typeID() == todoID ) { |
1701 | mShowAction->setText( i18n("Show Todo...") ); | 1722 | mShowAction->setText( i18n("Show Todo...") ); |
1702 | mEditAction->setText( i18n("Edit Todo...") ); | 1723 | mEditAction->setText( i18n("Edit Todo...") ); |
1703 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1724 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1704 | 1725 | ||
1705 | mNewSubTodoAction->setEnabled( true ); | 1726 | mNewSubTodoAction->setEnabled( true ); |
1706 | } else { | 1727 | } else { |
1707 | mShowAction->setText( i18n("Show...") ); | 1728 | mShowAction->setText( i18n("Show...") ); |
1708 | mShowAction->setText( i18n("Edit...") ); | 1729 | mShowAction->setText( i18n("Edit...") ); |
1709 | mShowAction->setText( i18n("Delete...") ); | 1730 | mShowAction->setText( i18n("Delete...") ); |
1710 | 1731 | ||
1711 | mNewSubTodoAction->setEnabled( false ); | 1732 | mNewSubTodoAction->setEnabled( false ); |
1712 | } | 1733 | } |
1713 | } | 1734 | } |
1714 | 1735 | ||
1715 | void MainWindow::enableIncidenceActions( bool enabled ) | 1736 | void MainWindow::enableIncidenceActions( bool enabled ) |
1716 | { | 1737 | { |
1738 | |||
1739 | #ifndef DESKTOP_VERSION | ||
1740 | mCurrentItemMenu->setEnabled( enabled ); | ||
1741 | #else | ||
1717 | mShowAction->setEnabled( enabled ); | 1742 | mShowAction->setEnabled( enabled ); |
1718 | mEditAction->setEnabled( enabled ); | 1743 | mEditAction->setEnabled( enabled ); |
1719 | mDeleteAction->setEnabled( enabled ); | 1744 | mDeleteAction->setEnabled( enabled ); |
1720 | 1745 | ||
1721 | mCloneAction->setEnabled( enabled ); | 1746 | mCloneAction->setEnabled( enabled ); |
1722 | mMoveAction->setEnabled( enabled ); | 1747 | mMoveAction->setEnabled( enabled ); |
1723 | mBeamAction->setEnabled( enabled ); | 1748 | mBeamAction->setEnabled( enabled ); |
1724 | mCancelAction->setEnabled( enabled ); | 1749 | mCancelAction->setEnabled( enabled ); |
1750 | #endif | ||
1725 | } | 1751 | } |
1726 | 1752 | ||
1727 | void MainWindow::importOL() | 1753 | void MainWindow::importOL() |
1728 | { | 1754 | { |
1729 | #ifdef _OL_IMPORT_ | 1755 | #ifdef _OL_IMPORT_ |
1730 | mView->clearAllViews(); | 1756 | mView->clearAllViews(); |
1731 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1757 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1732 | id->exec(); | 1758 | id->exec(); |
1733 | delete id; | 1759 | delete id; |
1734 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1760 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1735 | mView->updateView(); | 1761 | mView->updateView(); |
1736 | #endif | 1762 | #endif |
1737 | } | 1763 | } |
1738 | void MainWindow::importBday() | 1764 | void MainWindow::importBday() |
1739 | { | 1765 | { |
1740 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), | 1766 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1741 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1767 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1742 | i18n("Import!"), i18n("Cancel"), 0, | 1768 | i18n("Import!"), i18n("Cancel"), 0, |
1743 | 0, 1 ); | 1769 | 0, 1 ); |
1744 | if ( result == 0 ) { | 1770 | if ( result == 0 ) { |
1745 | mView->importBday(); | 1771 | mView->importBday(); |
1746 | 1772 | ||
1747 | } | 1773 | } |
1748 | 1774 | ||
1749 | 1775 | ||
1750 | } | 1776 | } |
1751 | void MainWindow::importQtopia() | 1777 | void MainWindow::importQtopia() |
1752 | { | 1778 | { |
1753 | //#ifndef DESKTOP_VERSION | 1779 | //#ifndef DESKTOP_VERSION |
1754 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); | 1780 | QString mess = i18n("When importing a calendar twice\nduplicated events will be ignored!\nYou can create a backup file with\nFile - Save Calendar Backup\nto revert importing"); |
1755 | #ifdef DESKTOP_VERSION | 1781 | #ifdef DESKTOP_VERSION |
1756 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); | 1782 | mess += i18n("The content of the following files will be\nimported (located in your home directory (hd)):\n(hd)/Applications/datebook/datebook.xml\n(hd)/Applications/todolist/todolist.xml\nThe following category file will be used:\n(hd)/Settings/Categories.xml"); |
1757 | #endif | 1783 | #endif |
1758 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1784 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1759 | i18n("Import!"), i18n("Cancel"), 0, | 1785 | i18n("Import!"), i18n("Cancel"), 0, |
1760 | 0, 1 ); | 1786 | 0, 1 ); |
1761 | if ( result == 0 ) { | 1787 | if ( result == 0 ) { |
1762 | #ifndef DESKTOP_VERSION | 1788 | #ifndef DESKTOP_VERSION |
1763 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1789 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1764 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1790 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1765 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1791 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1766 | #else | 1792 | #else |
1767 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1793 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1768 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1794 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1769 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1795 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1770 | #endif | 1796 | #endif |
1771 | mView->importQtopia( categories, datebook, todolist ); | 1797 | mView->importQtopia( categories, datebook, todolist ); |
1772 | } | 1798 | } |
@@ -2229,96 +2255,97 @@ void MainWindow::updateFilterToolbar() | |||
2229 | if ( !mView->filterView()->filtersEnabled() ) { | 2255 | if ( !mView->filterView()->filtersEnabled() ) { |
2230 | filterMenubar->changeItem( 0, i18n("No Filter") ); | 2256 | filterMenubar->changeItem( 0, i18n("No Filter") ); |
2231 | } else { | 2257 | } else { |
2232 | CalFilter *curfilter = mView->filterView()->selectedFilter(); | 2258 | CalFilter *curfilter = mView->filterView()->selectedFilter(); |
2233 | if ( curfilter ) { | 2259 | if ( curfilter ) { |
2234 | filterMenubar->changeItem( 0, curfilter->name() ); | 2260 | filterMenubar->changeItem( 0, curfilter->name() ); |
2235 | } | 2261 | } |
2236 | } | 2262 | } |
2237 | } | 2263 | } |
2238 | } | 2264 | } |
2239 | void MainWindow::selectFilterPopup( int fil ) | 2265 | void MainWindow::selectFilterPopup( int fil ) |
2240 | { | 2266 | { |
2241 | selectFilter( fil + 1 ); | 2267 | selectFilter( fil + 1 ); |
2242 | 2268 | ||
2243 | } | 2269 | } |
2244 | void MainWindow::configureToolBar( int item ) | 2270 | void MainWindow::configureToolBar( int item ) |
2245 | { | 2271 | { |
2246 | 2272 | ||
2247 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); | 2273 | configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) ); |
2248 | KOPrefs *p = KOPrefs::instance(); | 2274 | KOPrefs *p = KOPrefs::instance(); |
2249 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); | 2275 | p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 ); |
2250 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); | 2276 | p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 ); |
2251 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); | 2277 | p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 ); |
2252 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); | 2278 | p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 ); |
2253 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); | 2279 | p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 ); |
2254 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); | 2280 | p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 ); |
2255 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); | 2281 | p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 ); |
2256 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); | 2282 | p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 ); |
2257 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); | 2283 | p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 ); |
2258 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); | 2284 | p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 ); |
2259 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); | 2285 | p-> mShowIconList= configureToolBarMenu->isItemChecked( 30 ); |
2260 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); | 2286 | p-> mShowIconDay1= configureToolBarMenu->isItemChecked( 40 ); |
2261 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); | 2287 | p-> mShowIconDay5= configureToolBarMenu->isItemChecked( 50 ); |
2262 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); | 2288 | p-> mShowIconDay6= configureToolBarMenu->isItemChecked( 75 ); |
2263 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); | 2289 | p-> mShowIconDay7= configureToolBarMenu->isItemChecked( 60 ); |
2264 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); | 2290 | p-> mShowIconMonth= configureToolBarMenu->isItemChecked( 70 ); |
2265 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); | 2291 | p-> mShowIconTodoview= configureToolBarMenu->isItemChecked( 80 ); |
2266 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); | 2292 | p-> mShowIconBackFast= configureToolBarMenu->isItemChecked( 200 ); |
2267 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); | 2293 | p-> mShowIconBack = configureToolBarMenu->isItemChecked( 210 ); |
2268 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); | 2294 | p-> mShowIconToday= configureToolBarMenu->isItemChecked( 130 ); |
2269 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); | 2295 | p-> mShowIconForward= configureToolBarMenu->isItemChecked( 220 ); |
2270 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); | 2296 | p-> mShowIconForwardFast= configureToolBarMenu->isItemChecked( 230 ); |
2271 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); | 2297 | p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); |
2272 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); | 2298 | p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); |
2273 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); | 2299 | p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); |
2274 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); | 2300 | p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); |
2275 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); | 2301 | p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); |
2276 | // initActions(); | 2302 | // initActions(); |
2303 | setCaption ( i18n("Toolbar changes needs a restart!") ); | ||
2277 | } | 2304 | } |
2278 | void MainWindow::setCaption ( const QString & c ) | 2305 | void MainWindow::setCaption ( const QString & c ) |
2279 | { | 2306 | { |
2280 | QString cap = c; | 2307 | QString cap = c; |
2281 | cap.replace( QRegExp("\n"), " " ); | 2308 | cap.replace( QRegExp("\n"), " " ); |
2282 | cap = cap.stripWhiteSpace(); | 2309 | cap = cap.stripWhiteSpace(); |
2283 | if ( cap.isEmpty() ) | 2310 | if ( cap.isEmpty() ) |
2284 | cap = "KO/Pi"; | 2311 | cap = "KO/Pi"; |
2285 | QWidget::setCaption( cap ); | 2312 | QWidget::setCaption( cap ); |
2286 | } | 2313 | } |
2287 | void MainWindow::setCaptionToDates() | 2314 | void MainWindow::setCaptionToDates() |
2288 | { | 2315 | { |
2289 | QString selDates; | 2316 | QString selDates; |
2290 | QDate date = mView->startDate(); | 2317 | QDate date = mView->startDate(); |
2291 | if ( ! date.isValid() ) { | 2318 | if ( ! date.isValid() ) { |
2292 | setCaption(""); | 2319 | setCaption(""); |
2293 | return; | 2320 | return; |
2294 | } | 2321 | } |
2295 | selDates = KGlobal::locale()->formatDate( date, true); | 2322 | selDates = KGlobal::locale()->formatDate( date, true); |
2296 | if (mView->startDate() < mView->endDate() ) | 2323 | if (mView->startDate() < mView->endDate() ) |
2297 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); | 2324 | selDates += " - " + KGlobal::locale()->formatDate(mView->endDate(), true); |
2298 | else { | 2325 | else { |
2299 | QString addString; | 2326 | QString addString; |
2300 | if ( date == QDateTime::currentDateTime().date() ) | 2327 | if ( date == QDateTime::currentDateTime().date() ) |
2301 | addString = i18n("Today"); | 2328 | addString = i18n("Today"); |
2302 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) | 2329 | else if ( date == QDateTime::currentDateTime().date().addDays(1) ) |
2303 | addString = i18n("Tomorrow"); | 2330 | addString = i18n("Tomorrow"); |
2304 | if ( !addString.isEmpty() ) | 2331 | if ( !addString.isEmpty() ) |
2305 | selDates = addString+", "+selDates ; | 2332 | selDates = addString+", "+selDates ; |
2306 | } | 2333 | } |
2307 | setCaption( i18n("Dates: ") + selDates ); | 2334 | setCaption( i18n("Dates: ") + selDates ); |
2308 | 2335 | ||
2309 | } | 2336 | } |
2310 | void MainWindow::showConfigureAgenda( ) | 2337 | void MainWindow::showConfigureAgenda( ) |
2311 | { | 2338 | { |
2312 | int iii; | 2339 | int iii; |
2313 | for ( iii = 1;iii<= 10 ;++iii ){ | 2340 | for ( iii = 1;iii<= 10 ;++iii ){ |
2314 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); | 2341 | configureAgendaMenu->setItemChecked( (iii+1)*2, false ); |
2315 | } | 2342 | } |
2316 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); | 2343 | configureAgendaMenu->setItemChecked( (KOPrefs::instance()->mHourSize/2)*2, true ); |
2317 | } | 2344 | } |
2318 | void MainWindow::configureAgenda( int item ) | 2345 | void MainWindow::configureAgenda( int item ) |
2319 | { | 2346 | { |
2320 | if ( KOPrefs::instance()->mHourSize == item ) | 2347 | if ( KOPrefs::instance()->mHourSize == item ) |
2321 | return; | 2348 | return; |
2322 | KOPrefs::instance()->mHourSize=item; | 2349 | KOPrefs::instance()->mHourSize=item; |
2323 | mView->viewManager()->agendaView()->updateConfig(); | 2350 | mView->viewManager()->agendaView()->updateConfig(); |
2324 | } | 2351 | } |