summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-30 00:57:42 (UTC)
committer zautrix <zautrix>2005-03-30 00:57:42 (UTC)
commit889d2102fcfe2fb0786b3f8f406dc32b42e38c7a (patch) (unidiff)
tree32b269c1140a5646a00b65c78ac71116adb91aa1
parent99324133d35ba588b688bc5b22788fd8fb9e752d (diff)
downloadkdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.zip
kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.gz
kdepimpi-889d2102fcfe2fb0786b3f8f406dc32b42e38c7a.tar.bz2
fixes
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp67
-rw-r--r--korganizer/mainwindow.h4
-rw-r--r--libkdepim/kcmconfigs/kdepimconfigwidget.cpp13
3 files changed, 71 insertions, 13 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 6ddced0..ae03a09 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -599,120 +599,132 @@ void MainWindow::initActions()
599 QIconSet icon; 599 QIconSet icon;
600 int pixWid = 22, pixHei = 22; 600 int pixWid = 22, pixHei = 22;
601 QString pathString = ""; 601 QString pathString = "";
602 if ( !p->mToolBarMiniIcons ) { 602 if ( !p->mToolBarMiniIcons ) {
603 if ( QApplication::desktop()->width() < 480 ) { 603 if ( QApplication::desktop()->width() < 480 ) {
604 pathString += "icons16/"; 604 pathString += "icons16/";
605 pixWid = 18; pixHei = 16; 605 pixWid = 18; pixHei = 16;
606 } 606 }
607 } else { 607 } else {
608 pathString += "iconsmini/"; 608 pathString += "iconsmini/";
609 pixWid = 18; pixHei = 16; 609 pixWid = 18; pixHei = 16;
610 } 610 }
611 if ( KOPrefs::instance()->mShowFullMenu ) { 611 if ( KOPrefs::instance()->mShowFullMenu ) {
612 QMenuBar *menuBar1; 612 QMenuBar *menuBar1;
613 menuBar1 = menuBar(); 613 menuBar1 = menuBar();
614 menuBar1->insertItem( i18n("File"), importMenu ); 614 menuBar1->insertItem( i18n("File"), importMenu );
615 menuBar1->insertItem( i18n("View"), viewMenu ); 615 menuBar1->insertItem( i18n("View"), viewMenu );
616 menuBar1->insertItem( i18n("Actions"), actionMenu ); 616 menuBar1->insertItem( i18n("Actions"), actionMenu );
617#ifdef DESKTOP_VERSION 617#ifdef DESKTOP_VERSION
618 menuBar1->insertItem( i18n("Synchronize"), syncMenu ); 618 menuBar1->insertItem( i18n("Synchronize"), syncMenu );
619 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 619 menuBar1->insertItem( i18n("AgendaSize"),configureAgendaMenu );
620#else 620#else
621 menuBar1->insertItem( i18n("Sync"), syncMenu ); 621 menuBar1->insertItem( i18n("Sync"), syncMenu );
622 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu ); 622 menuBar1->insertItem( i18n("Agenda"),configureAgendaMenu );
623#endif 623#endif
624 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu ); 624 //menuBar1->insertItem( i18n("Toolbar"),configureToolBarMenu );
625 menuBar1->insertItem( i18n("Filter"),selectFilterMenu ); 625 menuBar1->insertItem( i18n("Filter"),selectFilterMenu );
626 menuBar1->insertItem( i18n("Help"), helpMenu ); 626 menuBar1->insertItem( i18n("Help"), helpMenu );
627 } else { 627 } else {
628 QPEMenuBar *menuBar1; 628 QPEMenuBar *menuBar1;
629 menuBar1 = new QPEMenuBar( iconToolBar ); 629 menuBar1 = new QPEMenuBar( iconToolBar );
630 QPopupMenu *menuBar = new QPopupMenu( this ); 630 QPopupMenu *menuBar = new QPopupMenu( this );
631 icon = loadPixmap( pathString + "z_menu" ); 631 icon = loadPixmap( pathString + "z_menu" );
632 menuBar1->insertItem( icon.pixmap(), menuBar); 632 menuBar1->insertItem( icon.pixmap(), menuBar);
633 //menuBar1->insertItem( i18n("ME"), menuBar); 633 //menuBar1->insertItem( i18n("ME"), menuBar);
634 menuBar->insertItem( i18n("File"), importMenu ); 634 menuBar->insertItem( i18n("File"), importMenu );
635 menuBar->insertItem( i18n("View"), viewMenu ); 635 menuBar->insertItem( i18n("View"), viewMenu );
636 menuBar->insertItem( i18n("Actions"), actionMenu ); 636 menuBar->insertItem( i18n("Actions"), actionMenu );
637 menuBar->insertItem( i18n("Synchronize"), syncMenu ); 637 menuBar->insertItem( i18n("Synchronize"), syncMenu );
638 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu ); 638 menuBar->insertItem( i18n("AgendaSize"),configureAgendaMenu );
639 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu ); 639 menuBar->insertItem( i18n("Toolbar"),configureToolBarMenu );
640 menuBar->insertItem( i18n("Filter"),selectFilterMenu ); 640 menuBar->insertItem( i18n("Filter"),selectFilterMenu );
641 menuBar->insertItem( i18n("Help"), helpMenu ); 641 menuBar->insertItem( i18n("Help"), helpMenu );
642 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() ); 642 //menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
643 menuBar1->setMaximumSize( menuBar1->sizeHint( )); 643 menuBar1->setMaximumSize( menuBar1->sizeHint( ));
644 } 644 }
645 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) ); 645 connect ( selectFilterMenu, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
646 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) ); 646 connect ( selectFilterMenu, SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenu() ) );
647
648
647 mWeekBgColor = iconToolBar->backgroundColor(); 649 mWeekBgColor = iconToolBar->backgroundColor();
648 mWeekPixmap.resize( pixWid , pixHei ); 650 mWeekPixmap.resize( pixWid , pixHei );
649 mWeekPixmap.fill( mWeekBgColor ); 651 mWeekPixmap.fill( mWeekBgColor );
650 icon = mWeekPixmap; 652 icon = mWeekPixmap;
651 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); 653 mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this );
652 if ( p-> mShowIconWeekNum ) 654 if ( p-> mShowIconWeekNum )
653 mWeekAction->addTo( iconToolBar ); 655 mWeekAction->addTo( iconToolBar );
654 mWeekFont = font(); 656 mWeekFont = font();
655 657
656 int fontPoint = mWeekFont.pointSize(); 658 int fontPoint = mWeekFont.pointSize();
657 QFontMetrics f( mWeekFont ); 659 QFontMetrics f( mWeekFont );
658 int fontWid = f.width( "30" ); 660 int fontWid = f.width( "30" );
659 while ( fontWid > pixWid ) { 661 while ( fontWid > pixWid ) {
660 --fontPoint; 662 --fontPoint;
661 mWeekFont.setPointSize( fontPoint ); 663 mWeekFont.setPointSize( fontPoint );
662 QFontMetrics f( mWeekFont ); 664 QFontMetrics f( mWeekFont );
663 fontWid = f.width( "30" ); 665 fontWid = f.width( "30" );
664 //qDebug("dec-- "); 666 //qDebug("dec-- ");
665 } 667 }
666 668
667 connect( mWeekAction, SIGNAL( activated() ), 669 connect( mWeekAction, SIGNAL( activated() ),
668 this, SLOT( weekAction() ) ); 670 this, SLOT( weekAction() ) );
669 671
670 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) ); 672 connect( this, SIGNAL( selectWeek ( int ) ), mView->dateNavigator(), SLOT( selectWeek ( int ) ) );
673 if ( p->mShowIconFilterview ) {
674 icon = loadPixmap( pathString + "filter" );
675 actionFilterMenuTB = new QAction( i18n("Filter selector"), icon, i18n("Filter selector"), 0, this );
676 connect( actionFilterMenuTB, SIGNAL( activated() ),
677 this, SLOT( fillFilterMenuTB() ) );
678 actionFilterMenuTB->addTo( iconToolBar );
679 selectFilterMenuTB = new QPopupMenu( this );
680 selectFilterMenuTB->setCheckable( true );
681 connect ( selectFilterMenuTB, SIGNAL( activated ( int ) ), this, SLOT (selectFilter( int ) ) );
682 }
671 683
672 //#endif 684 //#endif
673 // ****************** 685 // ******************
674 QAction *action; 686 QAction *action;
675 // QPopupMenu *configureMenu= new QPopupMenu( menuBar ); 687 // QPopupMenu *configureMenu= new QPopupMenu( menuBar );
676 configureToolBarMenu->setCheckable( true ); 688 configureToolBarMenu->setCheckable( true );
677 689
678 690
679 configureAgendaMenu->setCheckable( true ); 691 configureAgendaMenu->setCheckable( true );
680 int iii ; 692 int iii ;
681 for ( iii = 1;iii<= 10 ;++iii ){ 693 for ( iii = 1;iii<= 10 ;++iii ){
682 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 ); 694 configureAgendaMenu->insertItem(i18n("Size %1").arg(iii), (iii+1)*2 );
683 } 695 }
684 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu ); 696 //configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
685 697
686 connect( configureAgendaMenu, SIGNAL( aboutToShow()), 698 connect( configureAgendaMenu, SIGNAL( aboutToShow()),
687 this, SLOT( showConfigureAgenda( ) ) ); 699 this, SLOT( showConfigureAgenda( ) ) );
688 700
689 icon = loadPixmap( pathString + "configure" ); 701 icon = loadPixmap( pathString + "configure" );
690 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this ); 702 action = new QAction( i18n("Configure"),icon, i18n("Configure..."), 0, this );
691 action->addTo( actionMenu ); 703 action->addTo( actionMenu );
692 connect( action, SIGNAL( activated() ), 704 connect( action, SIGNAL( activated() ),
693 mView, SLOT( edit_options() ) ); 705 mView, SLOT( edit_options() ) );
694 actionMenu->insertSeparator(); 706 actionMenu->insertSeparator();
695 707
696 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this ); 708 action = new QAction( i18n("Undo Delete"), i18n("Undo Delete..."), 0, this );
697 action->addTo( actionMenu ); 709 action->addTo( actionMenu );
698 connect( action, SIGNAL( activated() ), 710 connect( action, SIGNAL( activated() ),
699 mView, SLOT( undo_delete() ) ); 711 mView, SLOT( undo_delete() ) );
700 actionMenu->insertSeparator(); 712 actionMenu->insertSeparator();
701 713
702 icon = loadPixmap( pathString + "newevent" ); 714 icon = loadPixmap( pathString + "newevent" );
703 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); 715 configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
704 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 ); 716 configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
705 configureToolBarMenu->insertSeparator(); 717 configureToolBarMenu->insertSeparator();
706 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 ); 718 configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
707 configureToolBarMenu->insertSeparator(); 719 configureToolBarMenu->insertSeparator();
708 configureToolBarMenu->insertItem(i18n("Week Number"), 400); 720 configureToolBarMenu->insertItem(i18n("Week Number"), 400);
709 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); 721 configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
710 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); 722 QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
711 ne_action->addTo( actionMenu ); 723 ne_action->addTo( actionMenu );
712 connect( ne_action, SIGNAL( activated() ), 724 connect( ne_action, SIGNAL( activated() ),
713 mView, SLOT( newEvent() ) ); 725 mView, SLOT( newEvent() ) );
714 icon = loadPixmap( pathString + "newtodo" ); 726 icon = loadPixmap( pathString + "newtodo" );
715 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 ); 727 configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
716 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this ); 728 QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
717 nt_action->addTo( actionMenu ); 729 nt_action->addTo( actionMenu );
718 connect( nt_action, SIGNAL( activated() ), 730 connect( nt_action, SIGNAL( activated() ),
@@ -733,105 +745,97 @@ void MainWindow::initActions()
733 } 745 }
734 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 ); 746 configureToolBarMenu->insertItem(icon, i18n("Toggle Fullscreen"), 28 );
735 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this ); 747 QAction* FSaction = new QAction( i18n("Toggle Fullscreen"), icon, i18n("Toggle Fullscreen"), 0, this );
736 FSaction->addTo( viewMenu ); 748 FSaction->addTo( viewMenu );
737 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() )); 749 connect( FSaction, SIGNAL( activated() ), mView, SLOT( toggleExpand() ));
738 750
739 icon = loadPixmap( pathString + "navi" ); 751 icon = loadPixmap( pathString + "navi" );
740 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 ); 752 configureToolBarMenu->insertItem(icon, i18n("Toggle DateNavigator"), 22 );
741 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this ); 753 action = new QAction( i18n("Toggle DateNavigator"), icon, i18n("Toggle DateNavigator"), 0, this );
742 action->addTo( viewMenu ); 754 action->addTo( viewMenu );
743 connect( action, SIGNAL( activated() ), 755 connect( action, SIGNAL( activated() ),
744 mView, SLOT( toggleDateNavigatorWidget() ) ); 756 mView, SLOT( toggleDateNavigatorWidget() ) );
745 mToggleNav = action ; 757 mToggleNav = action ;
746 icon = loadPixmap( pathString + "filter" ); 758 icon = loadPixmap( pathString + "filter" );
747 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 ); 759 configureToolBarMenu->insertItem(icon, i18n("Filter menu icon"), 26 );
748 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this ); 760 action = new QAction( i18n("Toggle FilterView"), icon, i18n("Toggle FilterView"), 0, this );
749 action->addTo( viewMenu ); 761 action->addTo( viewMenu );
750 connect( action, SIGNAL( activated() ), 762 connect( action, SIGNAL( activated() ),
751 mView, SLOT( toggleFilter() ) ); 763 mView, SLOT( toggleFilter() ) );
752 mToggleFilter = action; 764 mToggleFilter = action;
753 icon = loadPixmap( pathString + "allday" ); 765 icon = loadPixmap( pathString + "allday" );
754 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 ); 766 configureToolBarMenu->insertItem(icon, i18n("Toggle Allday"), 24 );
755 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this ); 767 action = new QAction( i18n("Toggle Allday"), icon,i18n("Toggle Allday"), 0, this );
756 action->addTo( viewMenu ); 768 action->addTo( viewMenu );
757 connect( action, SIGNAL( activated() ), 769 connect( action, SIGNAL( activated() ),
758 mView, SLOT( toggleAllDaySize() ) ); 770 mView, SLOT( toggleAllDaySize() ) );
759 mToggleAllday = action; 771 mToggleAllday = action;
760 772
761 773
762 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 774 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
763 mToggleNav, SLOT( setEnabled ( bool ) ) ); 775 mToggleNav, SLOT( setEnabled ( bool ) ) );
764 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ), 776 connect( mView->viewManager(), SIGNAL( signalFullScreen( bool ) ),
765 mToggleFilter, SLOT( setEnabled ( bool ) ) ); 777 mToggleFilter, SLOT( setEnabled ( bool ) ) );
766 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ), 778 connect( mView->viewManager(), SIGNAL( signalAgendaView( bool ) ),
767 mToggleAllday, SLOT( setEnabled ( bool ) ) ); 779 mToggleAllday, SLOT( setEnabled ( bool ) ) );
768 780
769 viewMenu->insertSeparator(); 781 viewMenu->insertSeparator();
770 icon = loadPixmap( pathString + "picker" ); 782 icon = loadPixmap( pathString + "picker" );
771 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this ); 783 action = new QAction( i18n("Date Picker"), icon, i18n("Date Picker"), 0, this );
772 action->addTo( viewMenu ); 784 action->addTo( viewMenu );
773 connect( action, SIGNAL( activated() ), 785 connect( action, SIGNAL( activated() ),
774 mView, SLOT( showDatePicker() ) ); 786 mView, SLOT( showDatePicker() ) );
775 action->addTo( iconToolBar ); 787 action->addTo( iconToolBar );
776 viewMenu->insertSeparator(); 788 viewMenu->insertSeparator();
777 789
778 if ( p-> mShowIconToggleFull ) 790 if ( p-> mShowIconToggleFull )
779 FSaction->addTo( iconToolBar ); 791 FSaction->addTo( iconToolBar );
780 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar ); 792 if ( p->mShowIconNavigator ) mToggleNav ->addTo( iconToolBar );
781 if ( p->mShowIconFilterview ) { 793
782 icon = loadPixmap( pathString + "filter" );
783 QPEMenuBar *menuBar111 = new QPEMenuBar( iconToolBar );
784 menuBar111->insertItem( icon.pixmap(), selectFilterMenu);
785 int isi = 24;
786 if ( QApplication::desktop()->width() < 480 )
787 isi = 18;
788 menuBar111->setFixedSize( QSize( isi, isi )) ;
789 }
790 //******************** 794 //********************
791 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar ); 795 if ( p->mShowIconAllday ) mToggleAllday->addTo( iconToolBar );
792 796
793 797
794 icon = loadPixmap( pathString + "whatsnext" ); 798 icon = loadPixmap( pathString + "whatsnext" );
795 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 ); 799 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110 );
796 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 800 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
797 whatsnext_action->addTo( viewMenu ); 801 whatsnext_action->addTo( viewMenu );
798 connect( whatsnext_action, SIGNAL( activated() ), 802 connect( whatsnext_action, SIGNAL( activated() ),
799 mView->viewManager(), SLOT( showWhatsNextView() ) ); 803 mView->viewManager(), SLOT( showWhatsNextView() ) );
800 804
801 icon = loadPixmap( pathString + "xdays" ); 805 icon = loadPixmap( pathString + "xdays" );
802 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 ); 806 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100 );
803 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 807 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
804 xdays_action->addTo( viewMenu ); 808 xdays_action->addTo( viewMenu );
805 connect( xdays_action, SIGNAL( activated() ), 809 connect( xdays_action, SIGNAL( activated() ),
806 mView->viewManager(), SLOT( showNextXView() ) ); 810 mView->viewManager(), SLOT( showNextXView() ) );
807 811
808 812
809 icon = loadPixmap( pathString + "journal" ); 813 icon = loadPixmap( pathString + "journal" );
810 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 814 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
811 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 815 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
812 viewjournal_action->addTo( viewMenu ); 816 viewjournal_action->addTo( viewMenu );
813 connect( viewjournal_action, SIGNAL( activated() ), 817 connect( viewjournal_action, SIGNAL( activated() ),
814 mView->viewManager(), SLOT( showJournalView() ) ); 818 mView->viewManager(), SLOT( showJournalView() ) );
815 819
816 820
817 icon = loadPixmap( pathString + "day" ); 821 icon = loadPixmap( pathString + "day" );
818 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 ); 822 configureToolBarMenu->insertItem(icon, i18n("Day View"), 40 );
819 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this ); 823 QAction* day1_action = new QAction( i18n("Day View"), icon, i18n("Day View"), 0, this );
820 day1_action->addTo( viewMenu ); 824 day1_action->addTo( viewMenu );
821 // action->addTo( toolBar ); 825 // action->addTo( toolBar );
822 connect( day1_action, SIGNAL( activated() ), 826 connect( day1_action, SIGNAL( activated() ),
823 mView->viewManager(), SLOT( showDayView() ) ); 827 mView->viewManager(), SLOT( showDayView() ) );
824 828
825 icon = loadPixmap( pathString + "workweek" ); 829 icon = loadPixmap( pathString + "workweek" );
826 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 ); 830 configureToolBarMenu->insertItem(icon, i18n("Work Week"), 50 );
827 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this ); 831 QAction* day5_action = new QAction( i18n("Work Week"), icon, i18n("Work Week"), 0, this );
828 day5_action->addTo( viewMenu ); 832 day5_action->addTo( viewMenu );
829 connect( day5_action, SIGNAL( activated() ), 833 connect( day5_action, SIGNAL( activated() ),
830 mView->viewManager(), SLOT( showWorkWeekView() ) ); 834 mView->viewManager(), SLOT( showWorkWeekView() ) );
831 835
832 icon = loadPixmap( pathString + "week" ); 836 icon = loadPixmap( pathString + "week" );
833 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 ); 837 configureToolBarMenu->insertItem(icon, i18n("Week"), 60 );
834 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); 838 QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this );
835 day7_action->addTo( viewMenu ); 839 day7_action->addTo( viewMenu );
836 connect( day7_action, SIGNAL( activated() ), 840 connect( day7_action, SIGNAL( activated() ),
837 mView->viewManager(), SLOT( showWeekView() ) ); 841 mView->viewManager(), SLOT( showWeekView() ) );
@@ -1918,97 +1922,141 @@ void MainWindow::keyPressEvent ( QKeyEvent * e )
1918 mView->showNextAlarms(); 1922 mView->showNextAlarms();
1919 else 1923 else
1920 mView->toggleAllDaySize(); 1924 mView->toggleAllDaySize();
1921 break; 1925 break;
1922 case Qt::Key_T: 1926 case Qt::Key_T:
1923 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1927 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1924 mView->newTodo(); 1928 mView->newTodo();
1925 else { 1929 else {
1926 mView->goToday(); 1930 mView->goToday();
1927 showSelectedDates = true; 1931 showSelectedDates = true;
1928 } 1932 }
1929 break; 1933 break;
1930 case Qt::Key_J: 1934 case Qt::Key_J:
1931 mView->viewManager()->showJournalView(); 1935 mView->viewManager()->showJournalView();
1932 break; 1936 break;
1933 case Qt::Key_B: 1937 case Qt::Key_B:
1934 mView->editIncidenceDescription();; 1938 mView->editIncidenceDescription();;
1935 break; 1939 break;
1936 // case Qt::Key_Return: 1940 // case Qt::Key_Return:
1937 case Qt::Key_E: 1941 case Qt::Key_E:
1938 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton ) 1942 if ( e->state() == Qt::ControlButton|| e->state() == Qt::ShiftButton )
1939 mView->newEvent(); 1943 mView->newEvent();
1940 else 1944 else
1941 mView->editIncidence(); 1945 mView->editIncidence();
1942 break; 1946 break;
1943 case Qt::Key_Plus: 1947 case Qt::Key_Plus:
1944 size = p->mHourSize +2; 1948 size = p->mHourSize +2;
1945 if ( size <= 22 ) 1949 if ( size <= 22 )
1946 configureAgenda( size ); 1950 configureAgenda( size );
1947 break; 1951 break;
1948 case Qt::Key_Minus: 1952 case Qt::Key_Minus:
1949 size = p->mHourSize - 2; 1953 size = p->mHourSize - 2;
1950 if ( size >= 4 ) 1954 if ( size >= 4 )
1951 configureAgenda( size ); 1955 configureAgenda( size );
1952 break; 1956 break;
1953 1957
1954 1958
1955 default: 1959 default:
1956 e->ignore(); 1960 e->ignore();
1957 } 1961 }
1958 if ( pro > 0 ) { 1962 if ( pro > 0 ) {
1959 mView->selectFilter( pro-1 ); 1963 mView->selectFilter( pro-1 );
1960 } 1964 }
1961 if ( showSelectedDates ) { 1965 if ( showSelectedDates ) {
1962 ;// setCaptionToDates(); 1966 ;// setCaptionToDates();
1963 } 1967 }
1964 1968
1965} 1969}
1970void MainWindow::fillFilterMenuTB()
1971{
1972 selectFilterMenuTB->clear();
1973 selectFilterMenuTB->insertItem(i18n ( "Edit Filters" ), 0 );
1974 selectFilterMenuTB->insertSeparator();
1975 selectFilterMenuTB->insertItem(i18n ( "No Filter" ), 1 );
1976
1977 selectFilterMenuTB->insertSeparator();
1978 QPtrList<CalFilter> fili = mView->filters();
1979 CalFilter *curfilter = mView->filterView()->selectedFilter();
1980 CalFilter *filter = fili.first();
1981 int iii = 2;
1982 bool checkitem = mView->filterView()->filtersEnabled();
1983 while(filter) {
1984 selectFilterMenuTB->insertItem( filter->name(), iii );
1985 if ( filter == curfilter)
1986 selectFilterMenuTB->setItemChecked( iii, checkitem );
1987 filter = fili.next();
1988 ++iii;
1989 }
1990 if ( !checkitem )
1991 selectFilterMenuTB->setItemChecked( 1, true );
1966 1992
1993 int x = 0;
1994 int y = iconToolBar->height();
1995 int dX = 0;
1996 int dY = 0;
1997 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
1998 if ( iconToolBar->y() > height()/2 ) {
1999 dY = selectFilterMenuTB->sizeHint().height()+8;
2000 y = 0;
2001 }
2002 } else {
2003 if ( iconToolBar->x() > width()/2 ) { // right side
2004 x=0;
2005 dX= selectFilterMenuTB->sizeHint().width()+8;
2006 y = 0;
2007 } else {
2008 x= iconToolBar->width();
2009 y = 0;
2010 }
2011 }
2012 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2013 selectFilterMenuTB->popup(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)));
2014}
1967void MainWindow::fillFilterMenu() 2015void MainWindow::fillFilterMenu()
1968{ 2016{
1969 selectFilterMenu->clear(); 2017 selectFilterMenu->clear();
1970 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 ); 2018 selectFilterMenu->insertItem(i18n ( "Edit Filters" ), 0 );
1971 selectFilterMenu->insertSeparator(); 2019 selectFilterMenu->insertSeparator();
1972 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 ); 2020 selectFilterMenu->insertItem(i18n ( "No Filter" ), 1 );
1973 2021
1974 selectFilterMenu->insertSeparator(); 2022 selectFilterMenu->insertSeparator();
1975 QPtrList<CalFilter> fili = mView->filters(); 2023 QPtrList<CalFilter> fili = mView->filters();
1976 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2024 CalFilter *curfilter = mView->filterView()->selectedFilter();
1977 CalFilter *filter = fili.first(); 2025 CalFilter *filter = fili.first();
1978 int iii = 2; 2026 int iii = 2;
1979 bool checkitem = mView->filterView()->filtersEnabled(); 2027 bool checkitem = mView->filterView()->filtersEnabled();
1980 while(filter) { 2028 while(filter) {
1981 selectFilterMenu->insertItem( filter->name(), iii ); 2029 selectFilterMenu->insertItem( filter->name(), iii );
1982 if ( filter == curfilter) 2030 if ( filter == curfilter)
1983 selectFilterMenu->setItemChecked( iii, checkitem ); 2031 selectFilterMenu->setItemChecked( iii, checkitem );
1984 filter = fili.next(); 2032 filter = fili.next();
1985 ++iii; 2033 ++iii;
1986 } 2034 }
1987 if ( !checkitem ) 2035 if ( !checkitem )
1988 selectFilterMenu->setItemChecked( 1, true ); 2036 selectFilterMenu->setItemChecked( 1, true );
1989} 2037}
1990void MainWindow::fillFilterMenuPopup() 2038void MainWindow::fillFilterMenuPopup()
1991{ 2039{
1992 filterPopupMenu->clear(); 2040 filterPopupMenu->clear();
1993 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 ); 2041 filterPopupMenu->insertItem(i18n ( "No Filter" ), 0 );
1994 2042
1995 filterPopupMenu->insertSeparator(); 2043 filterPopupMenu->insertSeparator();
1996 QPtrList<CalFilter> fili = mView->filters(); 2044 QPtrList<CalFilter> fili = mView->filters();
1997 CalFilter *curfilter = mView->filterView()->selectedFilter(); 2045 CalFilter *curfilter = mView->filterView()->selectedFilter();
1998 CalFilter *filter = fili.first(); 2046 CalFilter *filter = fili.first();
1999 int iii = 1; 2047 int iii = 1;
2000 bool checkitem = mView->filterView()->filtersEnabled(); 2048 bool checkitem = mView->filterView()->filtersEnabled();
2001 while(filter) { 2049 while(filter) {
2002 filterPopupMenu->insertItem( filter->name(), iii ); 2050 filterPopupMenu->insertItem( filter->name(), iii );
2003 if ( filter == curfilter) 2051 if ( filter == curfilter)
2004 filterPopupMenu->setItemChecked( iii, checkitem ); 2052 filterPopupMenu->setItemChecked( iii, checkitem );
2005 filter = fili.next(); 2053 filter = fili.next();
2006 ++iii; 2054 ++iii;
2007 } 2055 }
2008 if ( !checkitem ) 2056 if ( !checkitem )
2009 filterPopupMenu->setItemChecked( 0, true ); 2057 filterPopupMenu->setItemChecked( 0, true );
2010} 2058}
2011void MainWindow::selectFilter( int fil ) 2059void MainWindow::selectFilter( int fil )
2012{ 2060{
2013 2061
2014 if ( fil == 0 ) { 2062 if ( fil == 0 ) {
@@ -2266,96 +2314,97 @@ void MainWindow::exportVCalendar()
2266 2314
2267} 2315}
2268QString MainWindow::sentSyncFile() 2316QString MainWindow::sentSyncFile()
2269{ 2317{
2270#ifdef DESKTOP_VERSION 2318#ifdef DESKTOP_VERSION
2271 return locateLocal( "tmp", "copysynccal.ics" ); 2319 return locateLocal( "tmp", "copysynccal.ics" );
2272#else 2320#else
2273 return QString( "/tmp/copysynccal.ics" ); 2321 return QString( "/tmp/copysynccal.ics" );
2274#endif 2322#endif
2275} 2323}
2276 2324
2277void MainWindow::syncFileRequest() 2325void MainWindow::syncFileRequest()
2278{ 2326{
2279 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2327 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2280 mSyncManager->slotSyncMenu( 999 ); 2328 mSyncManager->slotSyncMenu( 999 );
2281 } 2329 }
2282 2330
2283 setCaption(i18n("Saving Data to temp file ..." )); 2331 setCaption(i18n("Saving Data to temp file ..." ));
2284 mView->saveCalendar( sentSyncFile() ); 2332 mView->saveCalendar( sentSyncFile() );
2285 setCaption(i18n("Data saved to temp file!" )); 2333 setCaption(i18n("Data saved to temp file!" ));
2286 2334
2287} 2335}
2288void MainWindow::getFile( bool success ) 2336void MainWindow::getFile( bool success )
2289{ 2337{
2290 if ( ! success ) { 2338 if ( ! success ) {
2291 setCaption( i18n("Error receiving file. Nothing changed!") ); 2339 setCaption( i18n("Error receiving file. Nothing changed!") );
2292 return; 2340 return;
2293 } 2341 }
2294 mView->openCalendar( sentSyncFile() ); 2342 mView->openCalendar( sentSyncFile() );
2295 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) { 2343 if ( KOPrefs::instance()->mPassiveSyncWithDesktop ) {
2296 mSyncManager->slotSyncMenu( 999 ); 2344 mSyncManager->slotSyncMenu( 999 );
2297 } 2345 }
2298 setCaption( i18n("Pi-Sync successful!") ); 2346 setCaption( i18n("Pi-Sync successful!") );
2299} 2347}
2300 2348
2301void MainWindow::printSel( ) 2349void MainWindow::printSel( )
2302{ 2350{
2303 mView->viewManager()->agendaView()->agenda()->printSelection(); 2351 mView->viewManager()->agendaView()->agenda()->printSelection();
2304} 2352}
2305 2353
2306void MainWindow::printCal() 2354void MainWindow::printCal()
2307{ 2355{
2308 mView->print();//mCp->showDialog(); 2356 mView->print();//mCp->showDialog();
2309} 2357}
2310 2358
2311 2359
2312#include "libkdepim/kdatepicker.h" 2360#include "libkdepim/kdatepicker.h"
2313#include <kdatetbl.h> 2361#include <kdatetbl.h>
2362
2314void MainWindow::weekAction() 2363void MainWindow::weekAction()
2315{ 2364{
2316 int month; 2365 int month;
2317 KPopupFrame* popup = new KPopupFrame(this); 2366 KPopupFrame* popup = new KPopupFrame(this);
2318 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup); 2367 KDateInternalWeekPicker* picker = new KDateInternalWeekPicker(popup);
2319 // ----- 2368 // -----
2320 picker->resize(picker->sizeHint()); 2369 picker->resize(picker->sizeHint());
2321 popup->setMainWidget(picker); 2370 popup->setMainWidget(picker);
2322 picker->setFocus(); 2371 picker->setFocus();
2323 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int))); 2372 connect(picker, SIGNAL(closeMe(int)), popup, SLOT(close(int)));
2324 int x = 0; 2373 int x = 0;
2325 int y = iconToolBar->height(); 2374 int y = iconToolBar->height();
2326 int dX = 0; 2375 int dX = 0;
2327 int dY = 0; 2376 int dY = 0;
2328 if ( iconToolBar->orientation () == Qt:: Horizontal ) { 2377 if ( iconToolBar->orientation () == Qt:: Horizontal ) {
2329 if ( iconToolBar->y() > height()/2 ) { 2378 if ( iconToolBar->y() > height()/2 ) {
2330 dY = picker->sizeHint().height()+8; 2379 dY = picker->sizeHint().height()+8;
2331 y = 0; 2380 y = 0;
2332 } 2381 }
2333 } else { 2382 } else {
2334 if ( iconToolBar->x() > width()/2 ) { // right side 2383 if ( iconToolBar->x() > width()/2 ) { // right side
2335 x=0; 2384 x=0;
2336 dX= picker->sizeHint().width()+8; 2385 dX= picker->sizeHint().width()+8;
2337 y = 0; 2386 y = 0;
2338 } else { 2387 } else {
2339 x= iconToolBar->width(); 2388 x= iconToolBar->width();
2340 y = 0; 2389 y = 0;
2341 } 2390 }
2342 } 2391 }
2343 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() ); 2392 //qDebug("dax %d dy %d %d %d ", dX, dY, iconToolBar->x(), iconToolBar->y() );
2344 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY)))) 2393 if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
2345 { 2394 {
2346 month = picker->getResult(); 2395 month = picker->getResult();
2347 emit selectWeek ( month ); 2396 emit selectWeek ( month );
2348 //qDebug("weekSelected %d ", month); 2397 //qDebug("weekSelected %d ", month);
2349 } 2398 }
2350 delete popup; 2399 delete popup;
2351} 2400}
2352 2401
2353void MainWindow::hideEvent ( QHideEvent * ) 2402void MainWindow::hideEvent ( QHideEvent * )
2354{ 2403{
2355 QString message; 2404 QString message;
2356 QDateTime nextA = mCalendar->nextAlarmEventDateTime(); 2405 QDateTime nextA = mCalendar->nextAlarmEventDateTime();
2357 if ( nextA.isValid() ) { 2406 if ( nextA.isValid() ) {
2358 QString sum = mCalendar->nextSummary(); 2407 QString sum = mCalendar->nextSummary();
2359 2408
2360 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false)); 2409 message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
2361 setCaption( message ); 2410 setCaption( message );
diff --git a/korganizer/mainwindow.h b/korganizer/mainwindow.h
index 79fb305..7c16aeb 100644
--- a/korganizer/mainwindow.h
+++ b/korganizer/mainwindow.h
@@ -49,122 +49,124 @@ class MainWindow : public QMainWindow
49 bool beamReceiveEnabled(); 49 bool beamReceiveEnabled();
50 static QString defaultFileName(); 50 static QString defaultFileName();
51 static QString syncFileName(); 51 static QString syncFileName();
52 static QString resourcePath(); 52 static QString resourcePath();
53 public slots: 53 public slots:
54 void setCaption ( const QString & ); 54 void setCaption ( const QString & );
55 void updateWeekNum(const KCal::DateList &); 55 void updateWeekNum(const KCal::DateList &);
56 void updateWeek(QDate); 56 void updateWeek(QDate);
57 void updateFilterToolbar(); 57 void updateFilterToolbar();
58 virtual void showMaximized (); 58 virtual void showMaximized ();
59 void configureAgenda( int ); 59 void configureAgenda( int );
60 void recieve( const QCString& msg, const QByteArray& data ); 60 void recieve( const QCString& msg, const QByteArray& data );
61 protected slots: 61 protected slots:
62 void setCaptionToDates(); 62 void setCaptionToDates();
63 void weekAction(); 63 void weekAction();
64 void about(); 64 void about();
65 void licence(); 65 void licence();
66 void faq(); 66 void faq();
67 void usertrans(); 67 void usertrans();
68 void features(); 68 void features();
69 void synchowto(); 69 void synchowto();
70 void kdesynchowto(); 70 void kdesynchowto();
71 void multisynchowto(); 71 void multisynchowto();
72 void whatsNew(); 72 void whatsNew();
73 void keyBindings(); 73 void keyBindings();
74 void aboutAutoSaving();; 74 void aboutAutoSaving();;
75 void aboutKnownBugs(); 75 void aboutKnownBugs();
76 76
77 void processIncidenceSelection( Incidence * ); 77 void processIncidenceSelection( Incidence * );
78 78
79 void importQtopia(); 79 void importQtopia();
80 void importBday(); 80 void importBday();
81 void importOL(); 81 void importOL();
82 void importIcal(); 82 void importIcal();
83 void importFile( QString, bool ); 83 void importFile( QString, bool );
84 void quickImportIcal(); 84 void quickImportIcal();
85 85
86 void slotModifiedChanged( bool ); 86 void slotModifiedChanged( bool );
87 87
88 void save(); 88 void save();
89 void saveStopTimer(); 89 void saveStopTimer();
90 void configureToolBar( int ); 90 void configureToolBar( int );
91 void printSel(); 91 void printSel();
92 void printCal(); 92 void printCal();
93 void saveCalendar(); 93 void saveCalendar();
94 void loadCalendar(); 94 void loadCalendar();
95 void exportVCalendar(); 95 void exportVCalendar();
96 void fillFilterMenu(); 96 void fillFilterMenu();
97 void fillFilterMenuTB();
97 void selectFilter( int ); 98 void selectFilter( int );
98 void fillFilterMenuPopup(); 99 void fillFilterMenuPopup();
99 void selectFilterPopup( int ); 100 void selectFilterPopup( int );
100 void exportToPhone( int ); 101 void exportToPhone( int );
101 void toggleBeamReceive(); 102 void toggleBeamReceive();
102 void disableBR(bool); 103 void disableBR(bool);
103 signals: 104 signals:
104 void selectWeek ( int ); 105 void selectWeek ( int );
105 private slots: 106 private slots:
106 void showConfigureAgenda(); 107 void showConfigureAgenda();
107 void getFile( bool ); 108 void getFile( bool );
108 void syncFileRequest(); 109 void syncFileRequest();
109 110
110 protected: 111 protected:
111 void hideEvent ( QHideEvent * ); 112 void hideEvent ( QHideEvent * );
112 QString sentSyncFile(); 113 QString sentSyncFile();
113 void displayText( QString, QString); 114 void displayText( QString, QString);
114 void enableIncidenceActions( bool ); 115 void enableIncidenceActions( bool );
115 116
116 private: 117 private:
117 bool mBRdisabled; 118 bool mBRdisabled;
118#ifndef DESKTOP_VERSION 119#ifndef DESKTOP_VERSION
119 QCopChannel* infrared; 120 QCopChannel* infrared;
120#endif 121#endif
121 QAction* brAction; 122 QAction* brAction;
122 KSyncManager* mSyncManager; 123 KSyncManager* mSyncManager;
123 bool mClosed; 124 bool mClosed;
124 void saveOnClose(); 125 void saveOnClose();
125 bool mFlagKeyPressed; 126 bool mFlagKeyPressed;
126 bool mBlockAtStartup; 127 bool mBlockAtStartup;
127 QPEToolBar *iconToolBar; 128 QPEToolBar *iconToolBar;
128 QPEToolBar *viewToolBar; 129 QPEToolBar *viewToolBar;
129 QPEToolBar *navigatorToolBar; 130 QPEToolBar *navigatorToolBar;
130 QPEToolBar *filterToolBar; 131 QPEToolBar *filterToolBar;
131 QPEMenuBar *filterMenubar; 132 QPEMenuBar *filterMenubar;
132 QPopupMenu * filterPopupMenu; 133 QPopupMenu * filterPopupMenu;
133 void initActions(); 134 void initActions();
134 void setDefaultPreferences(); 135 void setDefaultPreferences();
135 void keyPressEvent ( QKeyEvent * ) ; 136 void keyPressEvent ( QKeyEvent * ) ;
136 void keyReleaseEvent ( QKeyEvent * ) ; 137 void keyReleaseEvent ( QKeyEvent * ) ;
137 QPopupMenu *configureToolBarMenu; 138 QPopupMenu *configureToolBarMenu;
138 QPopupMenu *selectFilterMenu; 139 QPopupMenu *selectFilterMenu;
140 QPopupMenu *selectFilterMenuTB;
139 QPopupMenu *configureAgendaMenu, *syncMenu; 141 QPopupMenu *configureAgendaMenu, *syncMenu;
140 CalendarLocal *mCalendar; 142 CalendarLocal *mCalendar;
141 CalendarView *mView; 143 CalendarView *mView;
142 QAction *mNewSubTodoAction; 144 QAction *mNewSubTodoAction;
143 QAction *mWeekAction; 145 QAction *mWeekAction;
144 QFont mWeekFont; 146 QFont mWeekFont;
145 QPixmap mWeekPixmap; 147 QPixmap mWeekPixmap;
146 QColor mWeekBgColor; 148 QColor mWeekBgColor;
147 149
148 QAction *mShowAction; 150 QAction *mShowAction;
149 QAction *mEditAction; 151 QAction *mEditAction;
150 QAction *mDeleteAction; 152 QAction *mDeleteAction;
151 QAction *mCloneAction; 153 QAction *mCloneAction;
152 QAction *mMoveAction; 154 QAction *mMoveAction;
153 QAction *mBeamAction; 155 QAction *mBeamAction;
154 QAction *mCancelAction; 156 QAction *mCancelAction;
155 157
156 QAction *mToggleNav; 158 QAction *mToggleNav;
157 QAction *mToggleFilter; 159 QAction *mToggleFilter;
158 QAction *mToggleAllday; 160 QAction *mToggleAllday;
159 161 QAction *actionFilterMenuTB;
160 162
161 void closeEvent( QCloseEvent* ce ); 163 void closeEvent( QCloseEvent* ce );
162 SimpleAlarmClient mAlarmClient; 164 SimpleAlarmClient mAlarmClient;
163 QTimer mSaveTimer; 165 QTimer mSaveTimer;
164 //bool mBlockSaveFlag; 166 //bool mBlockSaveFlag;
165 bool mCalendarModifiedFlag; 167 bool mCalendarModifiedFlag;
166 QPixmap loadPixmap( QString ); 168 QPixmap loadPixmap( QString );
167}; 169};
168 170
169 171
170#endif 172#endif
diff --git a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
index bbed38d..5cd845e 100644
--- a/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
+++ b/libkdepim/kcmconfigs/kdepimconfigwidget.cpp
@@ -98,100 +98,107 @@ KDEPIMConfigWidget::KDEPIMConfigWidget(KPimGlobalPrefs *prefs, QWidget *parent,
98 98
99 QVBoxLayout *topLayout = new QVBoxLayout( this, 0, 99 QVBoxLayout *topLayout = new QVBoxLayout( this, 0,
100 KDialog::spacingHint() ); 100 KDialog::spacingHint() );
101 101
102 tabWidget = new QTabWidget( this ); 102 tabWidget = new QTabWidget( this );
103 topLayout->addWidget( tabWidget ); 103 topLayout->addWidget( tabWidget );
104 104
105 105
106 setupLocaleTab(); 106 setupLocaleTab();
107 setupLocaleDateTab(); 107 setupLocaleDateTab();
108 setupTimeZoneTab(); 108 setupTimeZoneTab();
109 setupExternalAppTab(); 109 setupExternalAppTab();
110 setupStoreTab(); 110 setupStoreTab();
111 111
112} 112}
113void KDEPIMConfigWidget::showTimeZoneTab() 113void KDEPIMConfigWidget::showTimeZoneTab()
114{ 114{
115 tabWidget->setCurrentPage ( 3 ) ; 115 tabWidget->setCurrentPage ( 3 ) ;
116} 116}
117void KDEPIMConfigWidget::setupStoreTab() 117void KDEPIMConfigWidget::setupStoreTab()
118{ 118{
119 QVBox *storePage = new QVBox( this ); 119 QVBox *storePage = new QVBox( this );
120 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage ); 120 new QLabel( i18n("Your current storage dir is:\n%1\nYour mail is stored in:\n(storagedir)/apps/kopiemail/localmail").arg(KGlobal::dirs()->localkdedir()), storePage );
121 new QLabel( i18n("<b>New data storage dir:</b>"), storePage ); 121 new QLabel( i18n("<b>New data storage dir:</b>"), storePage );
122 mStoreUrl = new KURLRequester( storePage ); 122 mStoreUrl = new KURLRequester( storePage );
123 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() ); 123 mStoreUrl->setURL( KGlobal::dirs()->localkdedir() );
124 new QLabel( i18n("New dirs are created automatically"), storePage ); 124 new QLabel( i18n("New dirs are created automatically"), storePage );
125 QHBox *bb = new QHBox( storePage ); 125 QHBox *bb = new QHBox( storePage );
126 QPushButton * pb; 126 QPushButton * pb;
127 if ( QApplication::desktop()->width() < 640 ) 127 if ( QApplication::desktop()->width() < 640 )
128 pb = new QPushButton ( i18n("Save"), bb ); 128 pb = new QPushButton ( i18n("Save"), bb );
129 else 129 else
130 pb = new QPushButton ( i18n("Save settings"), bb ); 130 pb = new QPushButton ( i18n("Save settings"), bb );
131 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) ); 131 connect(pb, SIGNAL( clicked() ), this, SLOT ( saveStoreSettings() ) );
132 pb = new QPushButton ( i18n("Save standard"), bb ); 132 pb = new QPushButton ( i18n("Save standard"), bb );
133 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) ); 133 connect(pb, SIGNAL( clicked() ), this, SLOT ( setStandardStore() ) );
134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage ); 134 new QLabel( i18n("<b>New settings are used\nafter a restart</b>"), storePage );
135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage ); 135 new QLabel( i18n("Settings are stored in\n%1").arg(QDir::homeDirPath() + "/.microkdehome" ), storePage );
136 tabWidget->addTab( storePage, i18n( "Data storage path" ) ); 136 tabWidget->addTab( storePage, i18n( "Data storage path" ) );
137} 137}
138void KDEPIMConfigWidget::setStandardStore() 138void KDEPIMConfigWidget::setStandardStore()
139{ 139{
140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 140 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
141 saveStoreSettings(); 141 saveStoreSettings();
142} 142}
143void KDEPIMConfigWidget::saveStoreSettings() 143void KDEPIMConfigWidget::saveStoreSettings()
144{ 144{
145 if ( !mStoreUrl->url().isEmpty() ) { 145 if ( !mStoreUrl->url().isEmpty() ) {
146 KConfig cfg ( QDir::homeDirPath() + "/.microkdehome" ); 146 QString path = QDir::homeDirPath();
147 QString url = mStoreUrl->url();
148#ifdef DESKTOP_VERSION
149 if ( url.startsWith( "LOCAL:" ) ) {
150 path = qApp->applicationDirPath () ;
151 }
152#endif
153 KConfig cfg ( path + "/.microkdehome" );
147 cfg.setGroup("Global"); 154 cfg.setGroup("Global");
148 cfg.writeEntry( "MICROKDEHOME", mStoreUrl->url() ); 155 cfg.writeEntry( "MICROKDEHOME", url );
149 qDebug("cfg.writeEntry( MICROKDEHOME, mStoreUrl->url() ); "); 156 qDebug("cfg.writeEntry( MICROKDEHOME, %s ", url.latin1());
150 cfg.sync(); 157 cfg.sync();
151 } else { 158 } else {
152 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" ); 159 mStoreUrl->setURL( QDir::homeDirPath() + "/kdepim" );
153 saveStoreSettings(); 160 saveStoreSettings();
154 } 161 }
155} 162}
156void KDEPIMConfigWidget::setupExternalAppTab() 163void KDEPIMConfigWidget::setupExternalAppTab()
157{ 164{
158 QWidget *externalAppsPage = new QWidget( this ); 165 QWidget *externalAppsPage = new QWidget( this );
159 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(), 166 QVBoxLayout* layout = new QVBoxLayout( externalAppsPage, KDialog::marginHintSmall(),
160 KDialog::spacingHintSmall() ); 167 KDialog::spacingHintSmall() );
161 168
162 mExternalApps = new QComboBox( externalAppsPage ); 169 mExternalApps = new QComboBox( externalAppsPage );
163 170
164 QMap<ExternalAppHandler::Types, QString>::Iterator it; 171 QMap<ExternalAppHandler::Types, QString>::Iterator it;
165 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it ) 172 for( it = mExternalAppsMap.begin(); it != mExternalAppsMap.end(); ++it )
166 mExternalApps->insertItem( it.data(), it.key() ); 173 mExternalApps->insertItem( it.data(), it.key() );
167 174
168 layout->addWidget( mExternalApps ); 175 layout->addWidget( mExternalApps );
169 176
170 connect( mExternalApps, SIGNAL( activated( int ) ), 177 connect( mExternalApps, SIGNAL( activated( int ) ),
171 this, SLOT (externalapp_changed( int ) ) ); 178 this, SLOT (externalapp_changed( int ) ) );
172 179
173 180
174 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage ); 181 mExternalAppGroupBox = new QGroupBox( 0, Qt::Vertical, i18n( "Used Mail Client" ), externalAppsPage );
175 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" ); 182 QGridLayout *boxLayout = new QGridLayout( mExternalAppGroupBox->layout(), 4, 2, -1, "gridlayout" );
176 mExternalAppGroupBox->layout()->setMargin(5); 183 mExternalAppGroupBox->layout()->setMargin(5);
177 184
178 mClient = new QComboBox( mExternalAppGroupBox ); 185 mClient = new QComboBox( mExternalAppGroupBox );
179 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 ); 186 boxLayout->addMultiCellWidget( mClient, 0, 0, 0, 1 );
180 187
181 connect( mClient, SIGNAL( activated( int ) ), 188 connect( mClient, SIGNAL( activated( int ) ),
182 this, SLOT (client_changed( int ) ) ); 189 this, SLOT (client_changed( int ) ) );
183 190
184 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox); 191 QLabel* lab = new QLabel( i18n("Channel:"), mExternalAppGroupBox);
185 boxLayout->addWidget( lab, 1, 0 ); 192 boxLayout->addWidget( lab, 1, 0 );
186 mChannel = new QLineEdit(mExternalAppGroupBox); 193 mChannel = new QLineEdit(mExternalAppGroupBox);
187 mChannel->setReadOnly(true); 194 mChannel->setReadOnly(true);
188 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 ); 195 boxLayout->addMultiCellWidget( mChannel, 2 , 2, 0, 1 );
189 196
190 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox); 197 lab = new QLabel( i18n("Message:"), mExternalAppGroupBox);
191 boxLayout->addWidget( lab, 3, 0 ); 198 boxLayout->addWidget( lab, 3, 0 );
192 mMessage = new QLineEdit(mExternalAppGroupBox); 199 mMessage = new QLineEdit(mExternalAppGroupBox);
193 mMessage->setReadOnly(true); 200 mMessage->setReadOnly(true);
194 boxLayout->addWidget( mMessage , 4, 0); 201 boxLayout->addWidget( mMessage , 4, 0);
195 202
196 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox); 203 lab = new QLabel( i18n("Parameters:"), mExternalAppGroupBox);
197 boxLayout->addWidget( lab, 3, 1 ); 204 boxLayout->addWidget( lab, 3, 1 );