-rw-r--r-- | korganizer/mainwindow.cpp | 17 |
1 files changed, 7 insertions, 10 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index f68f032..7a5f3e5 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp | |||
@@ -582,313 +582,315 @@ void MainWindow::recieve( const QCString& cmsg, const QByteArray& data ) | |||
582 | else if ( msg == "-ringSync" ) { | 582 | else if ( msg == "-ringSync" ) { |
583 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); | 583 | QTimer::singleShot( 0, this, SLOT (startMultiSync())); |
584 | } | 584 | } |
585 | else if ( msg == "-showWeek" ) { | 585 | else if ( msg == "-showWeek" ) { |
586 | mView->viewManager()->showWeekView(); | 586 | mView->viewManager()->showWeekView(); |
587 | } | 587 | } |
588 | else if ( msg == "-showTodo" ) { | 588 | else if ( msg == "-showTodo" ) { |
589 | mView->viewManager()->showTodoView(); | 589 | mView->viewManager()->showTodoView(); |
590 | } | 590 | } |
591 | else if ( msg == "-showJournal" ) { | 591 | else if ( msg == "-showJournal" ) { |
592 | mView->dateNavigator()->selectDates( 1 ); | 592 | mView->dateNavigator()->selectDates( 1 ); |
593 | mView->dateNavigator()->selectToday(); | 593 | mView->dateNavigator()->selectToday(); |
594 | mView->viewManager()->showJournalView(); | 594 | mView->viewManager()->showJournalView(); |
595 | } | 595 | } |
596 | else if ( msg == "-showKO" ) { | 596 | else if ( msg == "-showKO" ) { |
597 | mView->viewManager()->showNextXView(); | 597 | mView->viewManager()->showNextXView(); |
598 | } | 598 | } |
599 | else if ( msg == "-showWNext" ) { | 599 | else if ( msg == "-showWNext" ) { |
600 | mView->viewManager()->showWhatsNextView(); | 600 | mView->viewManager()->showWhatsNextView(); |
601 | } | 601 | } |
602 | else if ( msg == "nextView()" ) { | 602 | else if ( msg == "nextView()" ) { |
603 | mView->viewManager()->showNextView(); | 603 | mView->viewManager()->showNextView(); |
604 | } | 604 | } |
605 | else if ( msg == "-showNextXView" ) { | 605 | else if ( msg == "-showNextXView" ) { |
606 | mView->viewManager()->showNextXView(); | 606 | mView->viewManager()->showNextXView(); |
607 | } | 607 | } |
608 | 608 | ||
609 | 609 | ||
610 | } | 610 | } |
611 | 611 | ||
612 | showMaximized(); | 612 | showMaximized(); |
613 | raise(); | 613 | raise(); |
614 | } | 614 | } |
615 | void MainWindow::startMultiSync() | 615 | void MainWindow::startMultiSync() |
616 | { | 616 | { |
617 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); | 617 | QString question = i18n("Do you really want\nto multiple sync\nwith all checked profiles?\nSyncing takes some\ntime - all profiles\nare synced twice!"); |
618 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), | 618 | if ( QMessageBox::information( this, i18n("KDE-Pim Sync"), |
619 | question, | 619 | question, |
620 | i18n("Yes"), i18n("No"), | 620 | i18n("Yes"), i18n("No"), |
621 | 0, 0 ) != 0 ) { | 621 | 0, 0 ) != 0 ) { |
622 | setCaption(i18n("Aborted! Nothing synced!")); | 622 | setCaption(i18n("Aborted! Nothing synced!")); |
623 | return; | 623 | return; |
624 | } | 624 | } |
625 | mSyncManager->multiSync( false ); | 625 | mSyncManager->multiSync( false ); |
626 | #ifndef DESKTOP_VERSION | 626 | #ifndef DESKTOP_VERSION |
627 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); | 627 | QCopEnvelope e("QPE/Application/kapi", "doRingSync"); |
628 | #endif | 628 | #endif |
629 | } | 629 | } |
630 | QPixmap MainWindow::loadPixmap( QString name ) | 630 | QPixmap MainWindow::loadPixmap( QString name ) |
631 | { | 631 | { |
632 | return SmallIcon( name ); | 632 | return SmallIcon( name ); |
633 | 633 | ||
634 | } | 634 | } |
635 | void MainWindow::setUsesBigPixmaps ( bool b ) | 635 | void MainWindow::setUsesBigPixmaps ( bool b ) |
636 | { | 636 | { |
637 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); | 637 | qDebug("KO: MainWindow::setUsesBigPixmaps %d called", b); |
638 | if ( b ) | 638 | if ( b ) |
639 | qDebug("KO: BigPixmaps are not supported "); | 639 | qDebug("KO: BigPixmaps are not supported "); |
640 | } | 640 | } |
641 | void MainWindow::initActions() | 641 | void MainWindow::initActions() |
642 | { | 642 | { |
643 | //KOPrefs::instance()->mShowFullMenu | 643 | //KOPrefs::instance()->mShowFullMenu |
644 | iconToolBar->clear(); | 644 | iconToolBar->clear(); |
645 | KOPrefs *p = KOPrefs::instance(); | 645 | KOPrefs *p = KOPrefs::instance(); |
646 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); | 646 | //QPEMenuBar *menuBar1;// = new QPEMenuBar( iconToolBar ); |
647 | 647 | ||
648 | QPopupMenu *viewMenu = new QPopupMenu( this ); | 648 | QPopupMenu *viewMenu = new QPopupMenu( this ); |
649 | QPopupMenu *actionMenu = new QPopupMenu( this ); | 649 | QPopupMenu *actionMenu = new QPopupMenu( this ); |
650 | mCurrentItemMenu = new QPopupMenu ( this ); | 650 | mCurrentItemMenu = new QPopupMenu ( this ); |
651 | QPopupMenu *importMenu = new QPopupMenu( this ); | 651 | QPopupMenu *importMenu = new QPopupMenu( this ); |
652 | QPopupMenu *importMenu_X = new QPopupMenu( this ); | 652 | QPopupMenu *importMenu_X = new QPopupMenu( this ); |
653 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); | 653 | QPopupMenu *exportMenu_X = new QPopupMenu( this ); |
654 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); | 654 | QPopupMenu *beamMenu_X = new QPopupMenu( this ); |
655 | selectFilterMenu = new QPopupMenu( this ); | 655 | selectFilterMenu = new QPopupMenu( this ); |
656 | selectFilterMenu->setCheckable( true ); | 656 | selectFilterMenu->setCheckable( true ); |
657 | syncMenu = new QPopupMenu( this ); | 657 | syncMenu = new QPopupMenu( this ); |
658 | configureAgendaMenu = new QPopupMenu( this ); | 658 | configureAgendaMenu = new QPopupMenu( this ); |
659 | configureToolBarMenu = new QPopupMenu( this ); | 659 | configureToolBarMenu = new QPopupMenu( this ); |
660 | QPopupMenu *helpMenu = new QPopupMenu( this ); | 660 | QPopupMenu *helpMenu = new QPopupMenu( this ); |
661 | QIconSet icon; | 661 | QIconSet icon; |
662 | int pixWid = 22, pixHei = 22; | 662 | int pixWid = 22, pixHei = 22; |
663 | QString pathString = ""; | 663 | QString pathString = ""; |
664 | if ( !p->mToolBarMiniIcons ) { | 664 | if ( !p->mToolBarMiniIcons ) { |
665 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { | 665 | if ( QApplication::desktop()->width() < 480 /*|| QApplication::desktop()->height() < 320*/) { |
666 | pathString += "icons16/"; | 666 | pathString += "icons16/"; |
667 | pixWid = 18; pixHei = 16; | 667 | pixWid = 18; pixHei = 16; |
668 | } | 668 | } |
669 | } else { | 669 | } else { |
670 | pathString += "iconsmini/"; | 670 | pathString += "iconsmini/"; |
671 | pixWid = 18; pixHei = 16; | 671 | pixWid = 18; pixHei = 16; |
672 | } | 672 | } |
673 | if ( KOPrefs::instance()->mShowFullMenu ) { | 673 | if ( KOPrefs::instance()->mShowFullMenu ) { |
674 | QMenuBar *menuBar1; | 674 | QMenuBar *menuBar1; |
675 | menuBar1 = menuBar(); | 675 | menuBar1 = menuBar(); |
676 | menuBar1->insertItem( i18n("File"), importMenu ); | 676 | menuBar1->insertItem( i18n("File"), importMenu ); |
677 | menuBar1->insertItem( i18n("View"), viewMenu ); | 677 | menuBar1->insertItem( i18n("View"), viewMenu ); |
678 | menuBar1->insertItem( i18n("Actions"), actionMenu ); | 678 | menuBar1->insertItem( i18n("Edit"), mCurrentItemMenu ); |
679 | menuBar1->insertItem( i18n("Action"), actionMenu ); | ||
679 | #ifdef DESKTOP_VERSION | 680 | #ifdef DESKTOP_VERSION |
680 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); | 681 | menuBar1->insertItem( i18n("Synchronize"), syncMenu ); |
681 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 682 | menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
682 | #else | 683 | #else |
683 | menuBar1->insertItem( i18n("Sync"), syncMenu ); | 684 | menuBar1->insertItem( i18n("Sync"), syncMenu ); |
684 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); | 685 | menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); |
685 | #endif | 686 | #endif |
686 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 687 | //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
687 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); | 688 | menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); |
688 | menuBar1->insertItem( i18n("Help"), helpMenu ); | 689 | menuBar1->insertItem( i18n("Help"), helpMenu ); |
689 | } else { | 690 | } else { |
690 | QPEMenuBar *menuBar1; | 691 | QPEMenuBar *menuBar1; |
691 | menuBar1 = new QPEMenuBar( iconToolBar ); | 692 | menuBar1 = new QPEMenuBar( iconToolBar ); |
692 | QPopupMenu *menuBar = new QPopupMenu( this ); | 693 | QPopupMenu *menuBar = new QPopupMenu( this ); |
693 | icon = loadPixmap( pathString + "z_menu" ); | 694 | icon = loadPixmap( pathString + "z_menu" ); |
694 | menuBar1->insertItem( icon.pixmap(), menuBar); | 695 | menuBar1->insertItem( icon.pixmap(), menuBar); |
695 | //menuBar1->insertItem( i18n("ME"), menuBar); | 696 | //menuBar1->insertItem( i18n("ME"), menuBar); |
696 | menuBar->insertItem( i18n("File"), importMenu ); | 697 | menuBar->insertItem( i18n("File"), importMenu ); |
697 | menuBar->insertItem( i18n("View"), viewMenu ); | 698 | menuBar->insertItem( i18n("View"), viewMenu ); |
698 | menuBar->insertItem( i18n("Actions"), actionMenu ); | 699 | menuBar->insertItem( i18n("Edit"), mCurrentItemMenu ); |
700 | menuBar->insertItem( i18n("Action"), actionMenu ); | ||
699 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); | 701 | menuBar->insertItem( i18n("Synchronize"), syncMenu ); |
700 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); | 702 | menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); |
701 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); | 703 | menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); |
702 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); | 704 | menuBar->insertItem( i18n("Filter"),selectFilterMenu ); |
703 | menuBar->insertItem( i18n("Help"), helpMenu ); | 705 | menuBar->insertItem( i18n("Help"), helpMenu ); |
704 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); | 706 | //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); |
705 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); | 707 | menuBar1->setMaximumSize( menuBar1->sizeHint( )); |
706 | } | 708 | } |
707 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 709 | connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
708 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); | 710 | connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); |
709 | 711 | ||
710 | 712 | ||
711 | mWeekBgColor = iconToolBar->backgroundColor(); | 713 | mWeekBgColor = iconToolBar->backgroundColor(); |
712 | mWeekPixmap.resize( pixWid , pixHei ); | 714 | mWeekPixmap.resize( pixWid , pixHei ); |
713 | mWeekPixmap.fill( mWeekBgColor ); | 715 | mWeekPixmap.fill( mWeekBgColor ); |
714 | icon = mWeekPixmap; | 716 | icon = mWeekPixmap; |
715 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); | 717 | mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); |
716 | if ( p-> mShowIconWeekNum ) | 718 | if ( p-> mShowIconWeekNum ) |
717 | mWeekAction->addTo( iconToolBar ); | 719 | mWeekAction->addTo( iconToolBar ); |
718 | mWeekFont = font(); | 720 | mWeekFont = font(); |
719 | 721 | ||
720 | int fontPoint = mWeekFont.pointSize(); | 722 | int fontPoint = mWeekFont.pointSize(); |
721 | QFontMetrics f( mWeekFont ); | 723 | QFontMetrics f( mWeekFont ); |
722 | int fontWid = f.width( "30" ); | 724 | int fontWid = f.width( "30" ); |
723 | while ( fontWid > pixWid ) { | 725 | while ( fontWid > pixWid ) { |
724 | --fontPoint; | 726 | --fontPoint; |
725 | mWeekFont.setPointSize( fontPoint ); | 727 | mWeekFont.setPointSize( fontPoint ); |
726 | QFontMetrics f( mWeekFont ); | 728 | QFontMetrics f( mWeekFont ); |
727 | fontWid = f.width( "30" ); | 729 | fontWid = f.width( "30" ); |
728 | //qDebug("dec-- "); | 730 | //qDebug("dec-- "); |
729 | } | 731 | } |
730 | 732 | ||
731 | connect( mWeekAction, SIGNAL( activated() ), | 733 | connect( mWeekAction, SIGNAL( activated() ), |
732 | this, SLOT( weekAction() ) ); | 734 | this, SLOT( weekAction() ) ); |
733 | 735 | ||
734 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); | 736 | connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); |
735 | if ( p->mShowIconFilterview ) { | 737 | if ( p->mShowIconFilterview ) { |
736 | icon = loadPixmap( pathString + "filter" ); | 738 | icon = loadPixmap( pathString + "filter" ); |
737 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); | 739 | actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this ); |
738 | connect( actionFilterMenuTB, SIGNAL( activated() ), | 740 | connect( actionFilterMenuTB, SIGNAL( activated() ), |
739 | this, SLOT( fillFilterMenuTB() ) ); | 741 | this, SLOT( fillFilterMenuTB() ) ); |
740 | actionFilterMenuTB->addTo( iconToolBar ); | 742 | actionFilterMenuTB->addTo( iconToolBar ); |
741 | selectFilterMenuTB = new QPopupMenu( this ); | 743 | selectFilterMenuTB = new QPopupMenu( this ); |
742 | selectFilterMenuTB->setCheckable( true ); | 744 | selectFilterMenuTB->setCheckable( true ); |
743 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); | 745 | connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); |
744 | } | 746 | } |
745 | 747 | ||
746 | //#endif | 748 | //#endif |
747 | // ****************** | 749 | // ****************** |
748 | QAction *action; | 750 | QAction *action; |
749 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); | 751 | // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); |
750 | configureToolBarMenu->setCheckable( true ); | 752 | configureToolBarMenu->setCheckable( true ); |
751 | 753 | ||
752 | 754 | ||
753 | configureAgendaMenu->setCheckable( true ); | 755 | configureAgendaMenu->setCheckable( true ); |
754 | int iii ; | 756 | int iii ; |
755 | for ( iii = 1;iii<= 10 ;++iii ){ | 757 | for ( iii = 1;iii<= 10 ;++iii ){ |
756 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); | 758 | configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); |
757 | } | 759 | } |
758 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); | 760 | //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); |
759 | 761 | ||
760 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), | 762 | connect( configureAgendaMenu, SIGNAL( aboutToShow()), |
761 | this, SLOT( showConfigureAgenda( ) ) ); | 763 | this, SLOT( showConfigureAgenda( ) ) ); |
762 | icon = loadPixmap( pathString + "today" ); | 764 | icon = loadPixmap( pathString + "today" ); |
763 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); | 765 | QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); |
764 | today_action->addTo( actionMenu ); | 766 | today_action->addTo( actionMenu ); |
765 | connect( today_action, SIGNAL( activated() ), | 767 | connect( today_action, SIGNAL( activated() ), |
766 | mView, SLOT( goToday() ) ); | 768 | mView, SLOT( goToday() ) ); |
767 | 769 | ||
768 | icon = loadPixmap( pathString + "picker" ); | 770 | icon = loadPixmap( pathString + "picker" ); |
769 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); | 771 | QAction* dPickerAction = new QAction( i18n("Select Date..."), icon, i18n("Select Date..."), 0, this ); |
770 | dPickerAction->addTo( actionMenu ); | 772 | dPickerAction->addTo( actionMenu ); |
771 | connect( dPickerAction, SIGNAL( activated() ), | 773 | connect( dPickerAction, SIGNAL( activated() ), |
772 | mView, SLOT( showDatePicker() ) ); | 774 | mView, SLOT( showDatePicker() ) ); |
773 | 775 | ||
774 | icon = loadPixmap( pathString + "search" ); | 776 | icon = loadPixmap( pathString + "search" ); |
775 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); | 777 | QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); |
776 | search_action->addTo( actionMenu ); | 778 | search_action->addTo( actionMenu ); |
777 | connect( search_action, SIGNAL( activated() ), | 779 | connect( search_action, SIGNAL( activated() ), |
778 | mView->dialogManager(), SLOT( showSearchDialog() ) ); | 780 | mView->dialogManager(), SLOT( showSearchDialog() ) ); |
779 | 781 | ||
780 | actionMenu->insertSeparator(); | 782 | actionMenu->insertSeparator(); |
781 | 783 | ||
782 | 784 | ||
783 | 785 | ||
784 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); | 786 | action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); |
785 | action->addTo( actionMenu ); | 787 | action->addTo( mCurrentItemMenu ); |
786 | connect( action, SIGNAL( activated() ), | 788 | connect( action, SIGNAL( activated() ), |
787 | mView, SLOT( undo_delete() ) ); | 789 | mView, SLOT( undo_delete() ) ); |
788 | 790 | mCurrentItemMenu->insertSeparator(); | |
789 | icon = loadPixmap( pathString + "newevent" ); | 791 | icon = loadPixmap( pathString + "newevent" ); |
790 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); | 792 | configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); |
791 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); | 793 | configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); |
792 | configureToolBarMenu->insertSeparator(); | 794 | configureToolBarMenu->insertSeparator(); |
793 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); | 795 | configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); |
794 | configureToolBarMenu->insertSeparator(); | 796 | configureToolBarMenu->insertSeparator(); |
795 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); | 797 | configureToolBarMenu->insertItem(i18n("Week Number"), 400); |
796 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); | 798 | configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); |
797 | 799 | ||
798 | actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); | 800 | //actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu); |
799 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); | 801 | mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); |
800 | mShowAction->addTo( mCurrentItemMenu ); | 802 | mShowAction->addTo( mCurrentItemMenu ); |
801 | connect( mShowAction, SIGNAL( activated() ), | 803 | connect( mShowAction, SIGNAL( activated() ), |
802 | mView, SLOT( showIncidence() ) ); | 804 | mView, SLOT( showIncidence() ) ); |
803 | 805 | ||
804 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); | 806 | mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); |
805 | mEditAction->addTo( mCurrentItemMenu ); | 807 | mEditAction->addTo( mCurrentItemMenu ); |
806 | connect( mEditAction, SIGNAL( activated() ), | 808 | connect( mEditAction, SIGNAL( activated() ), |
807 | mView, SLOT( editIncidence() ) ); | 809 | mView, SLOT( editIncidence() ) ); |
808 | 810 | ||
809 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); | 811 | mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); |
810 | mDeleteAction->addTo( mCurrentItemMenu ); | 812 | mDeleteAction->addTo( mCurrentItemMenu ); |
811 | connect( mDeleteAction, SIGNAL( activated() ), | 813 | connect( mDeleteAction, SIGNAL( activated() ), |
812 | mView, SLOT( deleteIncidence() ) ); | 814 | mView, SLOT( deleteIncidence() ) ); |
813 | 815 | ||
814 | 816 | ||
815 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); | 817 | mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); |
816 | mCloneAction->addTo( mCurrentItemMenu ); | 818 | mCloneAction->addTo( mCurrentItemMenu ); |
817 | connect( mCloneAction, SIGNAL( activated() ), | 819 | connect( mCloneAction, SIGNAL( activated() ), |
818 | mView, SLOT( cloneIncidence() ) ); | 820 | mView, SLOT( cloneIncidence() ) ); |
819 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); | 821 | mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); |
820 | mMoveAction->addTo( mCurrentItemMenu ); | 822 | mMoveAction->addTo( mCurrentItemMenu ); |
821 | connect( mMoveAction, SIGNAL( activated() ), | 823 | connect( mMoveAction, SIGNAL( activated() ), |
822 | mView, SLOT( moveIncidence() ) ); | 824 | mView, SLOT( moveIncidence() ) ); |
823 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); | 825 | mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); |
824 | mBeamAction->addTo(mCurrentItemMenu ); | 826 | mBeamAction->addTo(mCurrentItemMenu ); |
825 | connect( mBeamAction, SIGNAL( activated() ), | 827 | connect( mBeamAction, SIGNAL( activated() ), |
826 | mView, SLOT( beamIncidence() ) ); | 828 | mView, SLOT( beamIncidence() ) ); |
827 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); | 829 | mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); |
828 | mCancelAction->addTo( mCurrentItemMenu ); | 830 | mCancelAction->addTo( mCurrentItemMenu ); |
829 | connect( mCancelAction, SIGNAL( activated() ), | 831 | connect( mCancelAction, SIGNAL( activated() ), |
830 | mView, SLOT( toggleCancelIncidence() ) ); | 832 | mView, SLOT( toggleCancelIncidence() ) ); |
831 | #ifdef DESKTOP_VERSION | 833 | #ifdef DESKTOP_VERSION |
832 | actionMenu->insertSeparator(); | 834 | actionMenu->insertSeparator(); |
833 | #endif | 835 | #endif |
834 | 836 | ||
835 | 837 | ||
836 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); | 838 | QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); |
837 | ne_action->addTo( actionMenu ); | 839 | ne_action->addTo( actionMenu ); |
838 | connect( ne_action, SIGNAL( activated() ), | 840 | connect( ne_action, SIGNAL( activated() ), |
839 | mView, SLOT( newEvent() ) ); | 841 | mView, SLOT( newEvent() ) ); |
840 | icon = loadPixmap( pathString + "newtodo" ); | 842 | icon = loadPixmap( pathString + "newtodo" ); |
841 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); | 843 | configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); |
842 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); | 844 | QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); |
843 | nt_action->addTo( actionMenu ); | 845 | nt_action->addTo( actionMenu ); |
844 | connect( nt_action, SIGNAL( activated() ), | 846 | connect( nt_action, SIGNAL( activated() ), |
845 | mView, SLOT( newTodo() ) ); | 847 | mView, SLOT( newTodo() ) ); |
846 | 848 | ||
847 | 849 | ||
848 | 850 | ||
849 | // *********************** | 851 | // *********************** |
850 | if ( KOPrefs::instance()->mVerticalScreen ) { | 852 | if ( KOPrefs::instance()->mVerticalScreen ) { |
851 | icon = SmallIcon( "1updownarrow" ); | 853 | icon = SmallIcon( "1updownarrow" ); |
852 | } else { | 854 | } else { |
853 | icon = SmallIcon("1leftrightarrow" ); | 855 | icon = SmallIcon("1leftrightarrow" ); |
854 | } | 856 | } |
855 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); | 857 | configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); |
856 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); | 858 | QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); |
857 | FSaction->addTo( viewMenu ); | 859 | FSaction->addTo( viewMenu ); |
858 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); | 860 | connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); |
859 | 861 | ||
860 | 862 | ||
861 | icon = loadPixmap( pathString + "filter" ); | 863 | icon = loadPixmap( pathString + "filter" ); |
862 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); | 864 | configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); |
863 | icon = loadPixmap( pathString + "configure" ); | 865 | icon = loadPixmap( pathString + "configure" ); |
864 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); | 866 | action = new QAction( i18n("Toggle Resource View"), icon, i18n("Toggle Resource View"), 0, this ); |
865 | action->addTo( viewMenu ); | 867 | action->addTo( viewMenu ); |
866 | connect( action, SIGNAL( activated() ), | 868 | connect( action, SIGNAL( activated() ), |
867 | mView, SLOT( toggleFilter() ) ); | 869 | mView, SLOT( toggleFilter() ) ); |
868 | mToggleFilter = action; | 870 | mToggleFilter = action; |
869 | icon = loadPixmap( pathString + "navi" ); | 871 | icon = loadPixmap( pathString + "navi" ); |
870 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); | 872 | configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); |
871 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); | 873 | action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); |
872 | action->addTo( viewMenu ); | 874 | action->addTo( viewMenu ); |
873 | connect( action, SIGNAL( activated() ), | 875 | connect( action, SIGNAL( activated() ), |
874 | mView, SLOT( toggleDateNavigatorWidget() ) ); | 876 | mView, SLOT( toggleDateNavigatorWidget() ) ); |
875 | mToggleNav = action ; | 877 | mToggleNav = action ; |
876 | icon = loadPixmap( pathString + "allday" ); | 878 | icon = loadPixmap( pathString + "allday" ); |
877 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); | 879 | configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); |
878 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); | 880 | action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); |
879 | action->addTo( viewMenu ); | 881 | action->addTo( viewMenu ); |
880 | connect( action, SIGNAL( activated() ), | 882 | connect( action, SIGNAL( activated() ), |
881 | mView, SLOT( toggleAllDaySize() ) ); | 883 | mView, SLOT( toggleAllDaySize() ) ); |
882 | mToggleAllday = action; | 884 | mToggleAllday = action; |
883 | 885 | ||
884 | 886 | ||
885 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 887 | connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
886 | mToggleNav, SLOT( setEnabled ( bool ) ) ); | 888 | mToggleNav, SLOT( setEnabled ( bool ) ) ); |
887 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), | 889 | //connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), |
888 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); | 890 | // mToggleFilter, SLOT( setEnabled ( bool ) ) ); |
889 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 891 | connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
890 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); | 892 | mToggleAllday, SLOT( setEnabled ( bool ) ) ); |
891 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), | 893 | // connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), |
892 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); | 894 | // configureAgendaMenu, SLOT( setEnabled ( bool ) ) ); |
893 | 895 | ||
894 | 896 | ||
@@ -1629,205 +1631,200 @@ QString MainWindow::syncFileName() | |||
1629 | return QString( "/tmp/synccalendar.ics" ); | 1631 | return QString( "/tmp/synccalendar.ics" ); |
1630 | #endif | 1632 | #endif |
1631 | } | 1633 | } |
1632 | #include "koglobals.h" | 1634 | #include "koglobals.h" |
1633 | #include <kcalendarsystem.h> | 1635 | #include <kcalendarsystem.h> |
1634 | void MainWindow::updateWeek(QDate seda) | 1636 | void MainWindow::updateWeek(QDate seda) |
1635 | { | 1637 | { |
1636 | int weekNum = KGlobal::locale()->weekNum ( seda ); | 1638 | int weekNum = KGlobal::locale()->weekNum ( seda ); |
1637 | mWeekPixmap.fill( mWeekBgColor ); | 1639 | mWeekPixmap.fill( mWeekBgColor ); |
1638 | QPainter p ( &mWeekPixmap ); | 1640 | QPainter p ( &mWeekPixmap ); |
1639 | p.setFont( mWeekFont ); | 1641 | p.setFont( mWeekFont ); |
1640 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); | 1642 | p.drawText( 0,0,mWeekPixmap.width(), mWeekPixmap.height(),AlignCenter, QString::number( weekNum) ); |
1641 | p.end(); | 1643 | p.end(); |
1642 | QIconSet icon3 ( mWeekPixmap ); | 1644 | QIconSet icon3 ( mWeekPixmap ); |
1643 | mWeekAction->setIconSet ( icon3 ); | 1645 | mWeekAction->setIconSet ( icon3 ); |
1644 | 1646 | ||
1645 | } | 1647 | } |
1646 | void MainWindow::updateWeekNum(const DateList &selectedDates) | 1648 | void MainWindow::updateWeekNum(const DateList &selectedDates) |
1647 | { | 1649 | { |
1648 | updateWeek( selectedDates.first() ); | 1650 | updateWeek( selectedDates.first() ); |
1649 | } | 1651 | } |
1650 | void MainWindow::processIncidenceSelection( Incidence *incidence ) | 1652 | void MainWindow::processIncidenceSelection( Incidence *incidence ) |
1651 | { | 1653 | { |
1652 | 1654 | ||
1653 | if ( !incidence ) { | 1655 | if ( !incidence ) { |
1654 | enableIncidenceActions( false ); | 1656 | enableIncidenceActions( false ); |
1655 | 1657 | ||
1656 | mNewSubTodoAction->setEnabled( false ); | 1658 | mNewSubTodoAction->setEnabled( false ); |
1657 | setCaptionToDates(); | 1659 | setCaptionToDates(); |
1658 | return; | 1660 | return; |
1659 | 1661 | ||
1660 | } | 1662 | } |
1661 | 1663 | ||
1662 | //KGlobal::locale()->formatDateTime(nextA, true); | 1664 | //KGlobal::locale()->formatDateTime(nextA, true); |
1663 | QString startString = ""; | 1665 | QString startString = ""; |
1664 | if ( incidence->typeID() != todoID ) { | 1666 | if ( incidence->typeID() != todoID ) { |
1665 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { | 1667 | if ( incidence->dtStart().date() < incidence->dtEnd().date() ) { |
1666 | if ( incidence->doesFloat() ) { | 1668 | if ( incidence->doesFloat() ) { |
1667 | startString += ": "+incidence->dtStartDateStr( true ); | 1669 | startString += ": "+incidence->dtStartDateStr( true ); |
1668 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); | 1670 | startString += " --- "+((Event*)incidence)->dtEndDateStr( true ); |
1669 | 1671 | ||
1670 | } else { | 1672 | } else { |
1671 | startString = ": "+incidence->dtStartStr(true); | 1673 | startString = ": "+incidence->dtStartStr(true); |
1672 | startString += " --- "+((Event*)incidence)->dtEndStr(true); | 1674 | startString += " --- "+((Event*)incidence)->dtEndStr(true); |
1673 | 1675 | ||
1674 | } | 1676 | } |
1675 | 1677 | ||
1676 | } else { | 1678 | } else { |
1677 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) | 1679 | if ( incidence->dtStart().time() != incidence->dtEnd().time() ) |
1678 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ | 1680 | startString = ": "+KGlobal::locale()->formatTime(incidence->dtStart().time())+ |
1679 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); | 1681 | "-"+KGlobal::locale()->formatTime(incidence->dtEnd().time()); |
1680 | 1682 | ||
1681 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { | 1683 | if ( incidence->isBirthday() || incidence->isAnniversary() ) { |
1682 | bool ok; | 1684 | bool ok; |
1683 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); | 1685 | QDateTime noc = incidence->getNextOccurence( mView->startDate().addDays(-1), &ok ); |
1684 | if ( ok ) { | 1686 | if ( ok ) { |
1685 | int years = noc.date().year() - incidence->dtStart().date().year(); | 1687 | int years = noc.date().year() - incidence->dtStart().date().year(); |
1686 | startString += i18n(" (%1 y.)"). arg( years ); | 1688 | startString += i18n(" (%1 y.)"). arg( years ); |
1687 | } | 1689 | } |
1688 | } | 1690 | } |
1689 | else | 1691 | else |
1690 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); | 1692 | startString +=" "+KGlobal::locale()->formatDate( incidence->dtStart().date(), true); |
1691 | } | 1693 | } |
1692 | 1694 | ||
1693 | } | 1695 | } |
1694 | else | 1696 | else |
1695 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); | 1697 | startString = i18n(": (Prio ") +QString::number( (( KCal::Todo*)incidence)->priority() ) +") "+QString::number( (( KCal::Todo*)incidence)->percentComplete() ) +i18n("\% completed"); |
1696 | if ( !incidence->location().isEmpty() ) | 1698 | if ( !incidence->location().isEmpty() ) |
1697 | startString += " (" +incidence->location()+")"; | 1699 | startString += " (" +incidence->location()+")"; |
1698 | setCaption( incidence->summary()+startString); | 1700 | setCaption( incidence->summary()+startString); |
1699 | 1701 | ||
1700 | enableIncidenceActions( true ); | 1702 | enableIncidenceActions( true ); |
1701 | 1703 | ||
1702 | if ( incidence->typeID() == eventID ) { | 1704 | if ( incidence->typeID() == eventID ) { |
1703 | mShowAction->setText( i18n("Show Event...") ); | 1705 | mShowAction->setText( i18n("Show Event...") ); |
1704 | mEditAction->setText( i18n("Edit Event...") ); | 1706 | mEditAction->setText( i18n("Edit Event...") ); |
1705 | mDeleteAction->setText( i18n("Delete Event...") ); | 1707 | mDeleteAction->setText( i18n("Delete Event...") ); |
1706 | 1708 | ||
1707 | mNewSubTodoAction->setEnabled( false ); | 1709 | mNewSubTodoAction->setEnabled( false ); |
1708 | } else if ( incidence->typeID() == todoID ) { | 1710 | } else if ( incidence->typeID() == todoID ) { |
1709 | mShowAction->setText( i18n("Show Todo...") ); | 1711 | mShowAction->setText( i18n("Show Todo...") ); |
1710 | mEditAction->setText( i18n("Edit Todo...") ); | 1712 | mEditAction->setText( i18n("Edit Todo...") ); |
1711 | mDeleteAction->setText( i18n("Delete Todo...") ); | 1713 | mDeleteAction->setText( i18n("Delete Todo...") ); |
1712 | 1714 | ||
1713 | mNewSubTodoAction->setEnabled( true ); | 1715 | mNewSubTodoAction->setEnabled( true ); |
1714 | } else { | 1716 | } else { |
1715 | mShowAction->setText( i18n("Show...") ); | 1717 | mShowAction->setText( i18n("Show...") ); |
1716 | mShowAction->setText( i18n("Edit...") ); | 1718 | mShowAction->setText( i18n("Edit...") ); |
1717 | mShowAction->setText( i18n("Delete...") ); | 1719 | mShowAction->setText( i18n("Delete...") ); |
1718 | 1720 | ||
1719 | mNewSubTodoAction->setEnabled( false ); | 1721 | mNewSubTodoAction->setEnabled( false ); |
1720 | } | 1722 | } |
1721 | } | 1723 | } |
1722 | 1724 | ||
1723 | void MainWindow::enableIncidenceActions( bool enabled ) | 1725 | void MainWindow::enableIncidenceActions( bool enabled ) |
1724 | { | 1726 | { |
1725 | |||
1726 | #ifndef DESKTOP_VERSION | ||
1727 | mCurrentItemMenu->setEnabled( enabled ); | ||
1728 | #else | ||
1729 | mShowAction->setEnabled( enabled ); | 1727 | mShowAction->setEnabled( enabled ); |
1730 | mEditAction->setEnabled( enabled ); | 1728 | mEditAction->setEnabled( enabled ); |
1731 | mDeleteAction->setEnabled( enabled ); | 1729 | mDeleteAction->setEnabled( enabled ); |
1732 | 1730 | ||
1733 | mCloneAction->setEnabled( enabled ); | 1731 | mCloneAction->setEnabled( enabled ); |
1734 | mMoveAction->setEnabled( enabled ); | 1732 | mMoveAction->setEnabled( enabled ); |
1735 | mBeamAction->setEnabled( enabled ); | 1733 | mBeamAction->setEnabled( enabled ); |
1736 | mCancelAction->setEnabled( enabled ); | 1734 | mCancelAction->setEnabled( enabled ); |
1737 | #endif | ||
1738 | } | 1735 | } |
1739 | 1736 | ||
1740 | void MainWindow::importOL() | 1737 | void MainWindow::importOL() |
1741 | { | 1738 | { |
1742 | #ifdef _OL_IMPORT_ | 1739 | #ifdef _OL_IMPORT_ |
1743 | mView->clearAllViews(); | 1740 | mView->clearAllViews(); |
1744 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); | 1741 | KOImportOLdialog *id = new KOImportOLdialog("Import from OL - select folder!" , mView->calendar(),this ); |
1745 | id->exec(); | 1742 | id->exec(); |
1746 | delete id; | 1743 | delete id; |
1747 | mView->calendar()->checkAlarmForIncidence( 0, true ); | 1744 | mView->calendar()->checkAlarmForIncidence( 0, true ); |
1748 | mView->updateView(); | 1745 | mView->updateView(); |
1749 | #endif | 1746 | #endif |
1750 | } | 1747 | } |
1751 | void MainWindow::importBday() | 1748 | void MainWindow::importBday() |
1752 | { | 1749 | { |
1753 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), | 1750 | int result = QMessageBox::warning( this, i18n("KO/Pi import information!"), |
1754 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), | 1751 | i18n("When importing birthdays twice\nduplicated events will be ignored,\nif the event has not been\nchanged in KO/Pi!\n"), |
1755 | i18n("Import!"), i18n("Cancel"), 0, | 1752 | i18n("Import!"), i18n("Cancel"), 0, |
1756 | 0, 1 ); | 1753 | 0, 1 ); |
1757 | if ( result == 0 ) { | 1754 | if ( result == 0 ) { |
1758 | mView->importBday(); | 1755 | mView->importBday(); |
1759 | 1756 | ||
1760 | } | 1757 | } |
1761 | 1758 | ||
1762 | 1759 | ||
1763 | } | 1760 | } |
1764 | void MainWindow::importQtopia() | 1761 | void MainWindow::importQtopia() |
1765 | { | 1762 | { |
1766 | //#ifndef DESKTOP_VERSION | 1763 | //#ifndef DESKTOP_VERSION |
1767 | 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"); | 1764 | 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"); |
1768 | #ifdef DESKTOP_VERSION | 1765 | #ifdef DESKTOP_VERSION |
1769 | 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"); | 1766 | 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"); |
1770 | #endif | 1767 | #endif |
1771 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, | 1768 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"),mess, |
1772 | i18n("Import!"), i18n("Cancel"), 0, | 1769 | i18n("Import!"), i18n("Cancel"), 0, |
1773 | 0, 1 ); | 1770 | 0, 1 ); |
1774 | if ( result == 0 ) { | 1771 | if ( result == 0 ) { |
1775 | #ifndef DESKTOP_VERSION | 1772 | #ifndef DESKTOP_VERSION |
1776 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); | 1773 | QString datebook = Global::applicationFileName( "datebook", "datebook.xml"); |
1777 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); | 1774 | QString todolist = Global::applicationFileName( "todolist", "todolist.xml"); |
1778 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; | 1775 | QString categories = QString( getenv( "HOME" ) ) + "/Settings/Categories.xml"; |
1779 | #else | 1776 | #else |
1780 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; | 1777 | QString datebook = QDir::homeDirPath()+ "/Applications/datebook/datebook.xml"; |
1781 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; | 1778 | QString todolist = QDir::homeDirPath()+ "/Applications/todolist/todolist.xml"; |
1782 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; | 1779 | QString categories = QDir::homeDirPath()+ "/Settings/Categories.xml"; |
1783 | #endif | 1780 | #endif |
1784 | mView->importQtopia( categories, datebook, todolist ); | 1781 | mView->importQtopia( categories, datebook, todolist ); |
1785 | } | 1782 | } |
1786 | mView->calendar()->reInitAlarmSettings(); | 1783 | mView->calendar()->reInitAlarmSettings(); |
1787 | #if 0 | 1784 | #if 0 |
1788 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), | 1785 | int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), |
1789 | i18n("Not supported \non desktop!\n"), | 1786 | i18n("Not supported \non desktop!\n"), |
1790 | i18n("Ok"), i18n("Cancel"), 0, | 1787 | i18n("Ok"), i18n("Cancel"), 0, |
1791 | 0, 1 ); | 1788 | 0, 1 ); |
1792 | 1789 | ||
1793 | #endif | 1790 | #endif |
1794 | } | 1791 | } |
1795 | 1792 | ||
1796 | void MainWindow::saveOnClose() | 1793 | void MainWindow::saveOnClose() |
1797 | { | 1794 | { |
1798 | KOPrefs *p = KOPrefs::instance(); | 1795 | KOPrefs *p = KOPrefs::instance(); |
1799 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); | 1796 | p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal ); |
1800 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); | 1797 | p->mToolBarHorV = ( viewToolBar->orientation () == Qt:: Horizontal ); |
1801 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); | 1798 | p->mToolBarHorN = ( navigatorToolBar->orientation () == Qt:: Horizontal ); |
1802 | if ( filterToolBar ) { | 1799 | if ( filterToolBar ) { |
1803 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); | 1800 | p->mToolBarHorF = ( filterToolBar->orientation () == Qt:: Horizontal ); |
1804 | } | 1801 | } |
1805 | #ifdef DESKTOP_VERSION | 1802 | #ifdef DESKTOP_VERSION |
1806 | 1803 | ||
1807 | QPoint myP; | 1804 | QPoint myP; |
1808 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1805 | myP = mapFromGlobal( iconToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1809 | if ( p->mToolBarHor ) | 1806 | if ( p->mToolBarHor ) |
1810 | p->mToolBarUp = myP.y() > height()/2; | 1807 | p->mToolBarUp = myP.y() > height()/2; |
1811 | else | 1808 | else |
1812 | p->mToolBarUp = myP.x() > width()/2; | 1809 | p->mToolBarUp = myP.x() > width()/2; |
1813 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1810 | myP = mapFromGlobal( viewToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1814 | if ( p->mToolBarHorV ) | 1811 | if ( p->mToolBarHorV ) |
1815 | p->mToolBarUpV = myP.y() > height()/2; | 1812 | p->mToolBarUpV = myP.y() > height()/2; |
1816 | else | 1813 | else |
1817 | p->mToolBarUpV = myP.x() > width()/2 ; | 1814 | p->mToolBarUpV = myP.x() > width()/2 ; |
1818 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1815 | myP = mapFromGlobal( navigatorToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1819 | if ( p->mToolBarHorN ) | 1816 | if ( p->mToolBarHorN ) |
1820 | p->mToolBarUpN = myP.y() > height()/2; | 1817 | p->mToolBarUpN = myP.y() > height()/2; |
1821 | else | 1818 | else |
1822 | p->mToolBarUpN = myP.x() > width()/2 ; | 1819 | p->mToolBarUpN = myP.x() > width()/2 ; |
1823 | if ( filterToolBar ) { | 1820 | if ( filterToolBar ) { |
1824 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); | 1821 | myP = mapFromGlobal( filterToolBar->mapToGlobal( QPoint( 0,0) ) ); |
1825 | if ( p->mToolBarHorF ) | 1822 | if ( p->mToolBarHorF ) |
1826 | p->mToolBarUpF = myP.y() > height()/2; | 1823 | p->mToolBarUpF = myP.y() > height()/2; |
1827 | else | 1824 | else |
1828 | p->mToolBarUpF = myP.x() > width()/2 ; | 1825 | p->mToolBarUpF = myP.x() > width()/2 ; |
1829 | } | 1826 | } |
1830 | #else | 1827 | #else |
1831 | if ( p->mToolBarHor ) | 1828 | if ( p->mToolBarHor ) |
1832 | p->mToolBarUp = iconToolBar->y() > height()/2; | 1829 | p->mToolBarUp = iconToolBar->y() > height()/2; |
1833 | else | 1830 | else |