summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp73
-rw-r--r--korganizer/koprefs.cpp10
-rw-r--r--korganizer/koprefs.h9
-rw-r--r--korganizer/koprefsdialog.cpp52
-rw-r--r--korganizer/koprefsdialog.h2
5 files changed, 128 insertions, 18 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 26323b1..898da6c 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -2655,823 +2655,862 @@ void CalendarView::readSettings()
2655 2655
2656 } 2656 }
2657 list = config->readListEntry("EditTodoLayout"); 2657 list = config->readListEntry("EditTodoLayout");
2658 if ( ! list.isEmpty() ) { 2658 if ( ! list.isEmpty() ) {
2659 x = list[0].toInt(); 2659 x = list[0].toInt();
2660 y = list[1].toInt(); 2660 y = list[1].toInt();
2661 w = list[2].toInt(); 2661 w = list[2].toInt();
2662 h = list[3].toInt(); 2662 h = list[3].toInt();
2663 KApplication::testCoords( &x,&y,&w,&h ); 2663 KApplication::testCoords( &x,&y,&w,&h );
2664 mTodoEditor->setGeometry(x,y,w,h); 2664 mTodoEditor->setGeometry(x,y,w,h);
2665 2665
2666 } 2666 }
2667 list = config->readListEntry("ViewerLayout"); 2667 list = config->readListEntry("ViewerLayout");
2668 if ( ! list.isEmpty() ) { 2668 if ( ! list.isEmpty() ) {
2669 x = list[0].toInt(); 2669 x = list[0].toInt();
2670 y = list[1].toInt(); 2670 y = list[1].toInt();
2671 w = list[2].toInt(); 2671 w = list[2].toInt();
2672 h = list[3].toInt(); 2672 h = list[3].toInt();
2673 KApplication::testCoords( &x,&y,&w,&h ); 2673 KApplication::testCoords( &x,&y,&w,&h );
2674 getEventViewerDialog()->setGeometry(x,y,w,h); 2674 getEventViewerDialog()->setGeometry(x,y,w,h);
2675 } 2675 }
2676#endif 2676#endif
2677 config->setGroup( "Views" ); 2677 config->setGroup( "Views" );
2678 int dateCount = config->readNumEntry( "ShownDatesCount", 7 ); 2678 int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
2679 2679
2680 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame"); 2680 QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
2681 2681
2682 int resetval = 0; 2682 int resetval = 0;
2683 int maxVal = 0; 2683 int maxVal = 0;
2684 if (sizes.count() != 3) { 2684 if (sizes.count() != 3) {
2685 if ( KOPrefs::instance()->mVerticalScreen ) { 2685 if ( KOPrefs::instance()->mVerticalScreen ) {
2686 resetval = mDateNavigator->sizeHint().width()+2; 2686 resetval = mDateNavigator->sizeHint().width()+2;
2687 } else { 2687 } else {
2688 resetval = mDateNavigator->sizeHint().height()+2; 2688 resetval = mDateNavigator->sizeHint().height()+2;
2689 } 2689 }
2690 } 2690 }
2691 if ( resetval ) { 2691 if ( resetval ) {
2692 sizes.clear(); 2692 sizes.clear();
2693 if ( KOPrefs::instance()->mVerticalScreen ) { 2693 if ( KOPrefs::instance()->mVerticalScreen ) {
2694 maxVal = QApplication::desktop()->width() -10; 2694 maxVal = QApplication::desktop()->width() -10;
2695 } else { 2695 } else {
2696 maxVal = QApplication::desktop()->height()-10; 2696 maxVal = QApplication::desktop()->height()-10;
2697 } 2697 }
2698 sizes << resetval; 2698 sizes << resetval;
2699 if ( maxVal < resetval + resetval) 2699 if ( maxVal < resetval + resetval)
2700 resetval = maxVal - resetval; 2700 resetval = maxVal - resetval;
2701 sizes << resetval; 2701 sizes << resetval;
2702 sizes << 100; 2702 sizes << 100;
2703 } 2703 }
2704 mLeftFrame->setSizes(sizes); 2704 mLeftFrame->setSizes(sizes);
2705 sizes = config->readIntListEntry("Main Splitter Frame"); 2705 sizes = config->readIntListEntry("Main Splitter Frame");
2706 resetval = 0; 2706 resetval = 0;
2707 maxVal = 0; 2707 maxVal = 0;
2708 if (sizes.count() != 2) { 2708 if (sizes.count() != 2) {
2709 if ( !KOPrefs::instance()->mVerticalScreen ) { 2709 if ( !KOPrefs::instance()->mVerticalScreen ) {
2710 resetval = mDateNavigator->sizeHint().width()+2; 2710 resetval = mDateNavigator->sizeHint().width()+2;
2711 } else { 2711 } else {
2712 resetval = mDateNavigator->sizeHint().height()+2; 2712 resetval = mDateNavigator->sizeHint().height()+2;
2713 } 2713 }
2714 } 2714 }
2715 if ( resetval ) { 2715 if ( resetval ) {
2716 sizes.clear(); 2716 sizes.clear();
2717 if ( !KOPrefs::instance()->mVerticalScreen ) { 2717 if ( !KOPrefs::instance()->mVerticalScreen ) {
2718 maxVal = QApplication::desktop()->width() -10; 2718 maxVal = QApplication::desktop()->width() -10;
2719 } else { 2719 } else {
2720 maxVal = QApplication::desktop()->height()-10; 2720 maxVal = QApplication::desktop()->height()-10;
2721 } 2721 }
2722 sizes << resetval; 2722 sizes << resetval;
2723 if ( maxVal < resetval + resetval) 2723 if ( maxVal < resetval + resetval)
2724 resetval = maxVal - resetval; 2724 resetval = maxVal - resetval;
2725 sizes << resetval; 2725 sizes << resetval;
2726 } 2726 }
2727 mMainFrame->setSizes(sizes); 2727 mMainFrame->setSizes(sizes);
2728 if ( dateCount == 5 ) mNavigator->selectWorkWeek(); 2728 if ( dateCount == 5 ) mNavigator->selectWorkWeek();
2729 else if ( dateCount == 7 ) mNavigator->selectWeek(); 2729 else if ( dateCount == 7 ) mNavigator->selectWeek();
2730 else mNavigator->selectDates( dateCount ); 2730 else mNavigator->selectDates( dateCount );
2731 // mViewManager->readSettings( config ); 2731 // mViewManager->readSettings( config );
2732 updateConfig(); 2732 updateConfig();
2733 globalFlagBlockAgenda = 2; 2733 globalFlagBlockAgenda = 2;
2734 mViewManager->readSettings( config ); 2734 mViewManager->readSettings( config );
2735 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) ); 2735 QTimer::singleShot( 1, mDateNavigator, SLOT ( setResizeEnabled() ) );
2736} 2736}
2737 2737
2738void CalendarView::checkSuspendAlarm() 2738void CalendarView::checkSuspendAlarm()
2739{ 2739{
2740 if ( mSuspendTimer->isActive() ) { 2740 if ( mSuspendTimer->isActive() ) {
2741 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm")); 2741 KMessageBox::information( this, i18n("<b>WARNING:</b> There is a pending suspended alarm!"), i18n("Pending Suspend Alarm"));
2742 } 2742 }
2743} 2743}
2744void CalendarView::writeSettings() 2744void CalendarView::writeSettings()
2745{ 2745{
2746 // kdDebug() << "CalendarView::writeSettings" << endl; 2746 // kdDebug() << "CalendarView::writeSettings" << endl;
2747 2747
2748 KConfig *config = KOGlobals::config(); 2748 KConfig *config = KOGlobals::config();
2749 2749
2750 mViewManager->writeSettings( config ); 2750 mViewManager->writeSettings( config );
2751 mTodoList->saveLayout(config,QString("Todo Layout")); 2751 mTodoList->saveLayout(config,QString("Todo Layout"));
2752 mDialogManager->writeSettings( config ); 2752 mDialogManager->writeSettings( config );
2753 //KOPrefs::instance()->usrWriteConfig(); 2753 //KOPrefs::instance()->usrWriteConfig();
2754 KOPrefs::instance()->writeConfig(); 2754 KOPrefs::instance()->writeConfig();
2755 2755
2756 writeFilterSettings(config); 2756 writeFilterSettings(config);
2757 config->setGroup( "AppRun" ); 2757 config->setGroup( "AppRun" );
2758 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 2758 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
2759 int days = dt.daysTo( QDate::currentDate() ); 2759 int days = dt.daysTo( QDate::currentDate() );
2760 dt = dt.addDays( days ); 2760 dt = dt.addDays( days );
2761 int secs = dt.secsTo( QDateTime::currentDateTime() ); 2761 int secs = dt.secsTo( QDateTime::currentDateTime() );
2762 config->writeEntry( "LatestProgramStopDays", days ); 2762 config->writeEntry( "LatestProgramStopDays", days );
2763 config->writeEntry( "LatestProgramStopSecs", secs ); 2763 config->writeEntry( "LatestProgramStopSecs", secs );
2764 //qDebug("KO: Writing stop time: %d ", secs); 2764 //qDebug("KO: Writing stop time: %d ", secs);
2765 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() ); 2765 //qDebug("KO: Current Time %s ",QDateTime::currentDateTime().toString().latin1() );
2766 //QDateTime latest = dt.addSecs ( secs ); 2766 //QDateTime latest = dt.addSecs ( secs );
2767 //qDebug("KO: Termination on %s ", latest.toString().latin1()); 2767 //qDebug("KO: Termination on %s ", latest.toString().latin1());
2768 config->setGroup( "Views" ); 2768 config->setGroup( "Views" );
2769 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() ); 2769 config->writeEntry( "ShownDatesCount", mNavigator->selectedDates().count() );
2770 2770
2771#if 0 2771#if 0
2772 qDebug("********************* "); 2772 qDebug("********************* ");
2773 qDebug("Testcode secsto "); 2773 qDebug("Testcode secsto ");
2774 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) ); 2774 QDateTime dt_nodaylight ( QDate (2005,3,26), QTime( 0,0,0 ) );
2775 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) ); 2775 QDateTime dt_daylight ( QDate (2005,3,29), QTime( 0,0,0 ) );
2776 int secsto = dt_nodaylight.secsTo( dt_daylight ); 2776 int secsto = dt_nodaylight.secsTo( dt_daylight );
2777 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto ); 2777 QDateTime dt_daylight_wrong = dt_nodaylight.addSecs( secsto );
2778 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() ); 2778 qDebug("dt nodaylight %s ",dt_nodaylight.toString().latin1() );
2779 qDebug("dt daylight %s ",dt_daylight.toString().latin1() ); 2779 qDebug("dt daylight %s ",dt_daylight.toString().latin1() );
2780 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() ); 2780 qDebug("dt daylight_wrong %s ",dt_daylight_wrong.toString().latin1() );
2781 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600); 2781 qDebug("Computed secsTo %d . in minutes: %d . in hours: %d ", secsto, secsto/60, secsto/3600);
2782 qDebug("********************* testcode end"); 2782 qDebug("********************* testcode end");
2783 2783
2784#endif 2784#endif
2785 2785
2786 QValueList<int> listINT = mLeftFrame->sizes(); 2786 QValueList<int> listINT = mLeftFrame->sizes();
2787 config->writeEntry("Left Splitter Frame",listINT); 2787 config->writeEntry("Left Splitter Frame",listINT);
2788 QValueList<int> listINT2 = mMainFrame->sizes(); 2788 QValueList<int> listINT2 = mMainFrame->sizes();
2789 config->writeEntry("Main Splitter Frame",listINT2); 2789 config->writeEntry("Main Splitter Frame",listINT2);
2790#ifdef DESKTOP_VERSION 2790#ifdef DESKTOP_VERSION
2791 config->setGroup("WidgetLayout"); 2791 config->setGroup("WidgetLayout");
2792 QStringList list ;//= config->readListEntry("MainLayout"); 2792 QStringList list ;//= config->readListEntry("MainLayout");
2793 int x,y,w,h; 2793 int x,y,w,h;
2794 QWidget* wid; 2794 QWidget* wid;
2795 wid = topLevelWidget(); 2795 wid = topLevelWidget();
2796 x = wid->geometry().x(); 2796 x = wid->geometry().x();
2797 y = wid->geometry().y(); 2797 y = wid->geometry().y();
2798 w = wid->width(); 2798 w = wid->width();
2799 h = wid->height(); 2799 h = wid->height();
2800 list.clear(); 2800 list.clear();
2801 list << QString::number( x ); 2801 list << QString::number( x );
2802 list << QString::number( y ); 2802 list << QString::number( y );
2803 list << QString::number( w ); 2803 list << QString::number( w );
2804 list << QString::number( h ); 2804 list << QString::number( h );
2805 config->writeEntry("MainLayout",list ); 2805 config->writeEntry("MainLayout",list );
2806 2806
2807 wid = mEventEditor; 2807 wid = mEventEditor;
2808 x = wid->geometry().x(); 2808 x = wid->geometry().x();
2809 y = wid->geometry().y(); 2809 y = wid->geometry().y();
2810 w = wid->width(); 2810 w = wid->width();
2811 h = wid->height(); 2811 h = wid->height();
2812 list.clear(); 2812 list.clear();
2813 list << QString::number( x ); 2813 list << QString::number( x );
2814 list << QString::number( y ); 2814 list << QString::number( y );
2815 list << QString::number( w ); 2815 list << QString::number( w );
2816 list << QString::number( h ); 2816 list << QString::number( h );
2817 config->writeEntry("EditEventLayout",list ); 2817 config->writeEntry("EditEventLayout",list );
2818 2818
2819 wid = mTodoEditor; 2819 wid = mTodoEditor;
2820 x = wid->geometry().x(); 2820 x = wid->geometry().x();
2821 y = wid->geometry().y(); 2821 y = wid->geometry().y();
2822 w = wid->width(); 2822 w = wid->width();
2823 h = wid->height(); 2823 h = wid->height();
2824 list.clear(); 2824 list.clear();
2825 list << QString::number( x ); 2825 list << QString::number( x );
2826 list << QString::number( y ); 2826 list << QString::number( y );
2827 list << QString::number( w ); 2827 list << QString::number( w );
2828 list << QString::number( h ); 2828 list << QString::number( h );
2829 config->writeEntry("EditTodoLayout",list ); 2829 config->writeEntry("EditTodoLayout",list );
2830 wid = getEventViewerDialog(); 2830 wid = getEventViewerDialog();
2831 x = wid->geometry().x(); 2831 x = wid->geometry().x();
2832 y = wid->geometry().y(); 2832 y = wid->geometry().y();
2833 w = wid->width(); 2833 w = wid->width();
2834 h = wid->height(); 2834 h = wid->height();
2835 list.clear(); 2835 list.clear();
2836 list << QString::number( x ); 2836 list << QString::number( x );
2837 list << QString::number( y ); 2837 list << QString::number( y );
2838 list << QString::number( w ); 2838 list << QString::number( w );
2839 list << QString::number( h ); 2839 list << QString::number( h );
2840 config->writeEntry("ViewerLayout",list ); 2840 config->writeEntry("ViewerLayout",list );
2841 wid = mDialogManager->getSearchDialog(); 2841 wid = mDialogManager->getSearchDialog();
2842 if ( wid ) { 2842 if ( wid ) {
2843 x = wid->geometry().x(); 2843 x = wid->geometry().x();
2844 y = wid->geometry().y(); 2844 y = wid->geometry().y();
2845 w = wid->width(); 2845 w = wid->width();
2846 h = wid->height(); 2846 h = wid->height();
2847 list.clear(); 2847 list.clear();
2848 list << QString::number( x ); 2848 list << QString::number( x );
2849 list << QString::number( y ); 2849 list << QString::number( y );
2850 list << QString::number( w ); 2850 list << QString::number( w );
2851 list << QString::number( h ); 2851 list << QString::number( h );
2852 config->writeEntry("SearchLayout",list ); 2852 config->writeEntry("SearchLayout",list );
2853 } 2853 }
2854#endif 2854#endif
2855 2855
2856 2856
2857 config->sync(); 2857 config->sync();
2858} 2858}
2859 2859
2860void CalendarView::readFilterSettings(KConfig *config) 2860void CalendarView::readFilterSettings(KConfig *config)
2861{ 2861{
2862 // kdDebug() << "CalendarView::readFilterSettings()" << endl; 2862 // kdDebug() << "CalendarView::readFilterSettings()" << endl;
2863 2863
2864 mFilters.clear(); 2864 mFilters.clear();
2865 2865
2866 config->setGroup("General"); 2866 config->setGroup("General");
2867 QStringList filterList = config->readListEntry("CalendarFilters"); 2867 QStringList filterList = config->readListEntry("CalendarFilters");
2868 2868
2869 QStringList::ConstIterator it = filterList.begin(); 2869 QStringList::ConstIterator it = filterList.begin();
2870 QStringList::ConstIterator end = filterList.end(); 2870 QStringList::ConstIterator end = filterList.end();
2871 while(it != end) { 2871 while(it != end) {
2872 // kdDebug() << " filter: " << (*it) << endl; 2872 // kdDebug() << " filter: " << (*it) << endl;
2873 2873
2874 CalFilter *filter; 2874 CalFilter *filter;
2875 filter = new CalFilter(*it); 2875 filter = new CalFilter(*it);
2876 config->setGroup("Filter_" + (*it).utf8()); 2876 config->setGroup("Filter_" + (*it).utf8());
2877 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) ); 2877 //qDebug("readFilterSettings %d ",config->readNumEntry("Criteria",0) );
2878 filter->setCriteria(config->readNumEntry("Criteria",0)); 2878 filter->setCriteria(config->readNumEntry("Criteria",0));
2879 filter->setCategoryList(config->readListEntry("CategoryList")); 2879 filter->setCategoryList(config->readListEntry("CategoryList"));
2880 mFilters.append(filter); 2880 mFilters.append(filter);
2881 2881
2882 ++it; 2882 ++it;
2883 } 2883 }
2884 2884
2885 if (mFilters.count() == 0) { 2885 if (mFilters.count() == 0) {
2886 CalFilter *filter = new CalFilter(i18n("Default")); 2886 CalFilter *filter = new CalFilter(i18n("Default"));
2887 mFilters.append(filter); 2887 mFilters.append(filter);
2888 } 2888 }
2889 mFilterView->updateFilters(); 2889 mFilterView->updateFilters();
2890 config->setGroup("FilterView"); 2890 config->setGroup("FilterView");
2891 2891
2892 mFilterView->blockSignals(true); 2892 mFilterView->blockSignals(true);
2893 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled")); 2893 mFilterView->setFiltersEnabled(config->readBoolEntry("FilterEnabled"));
2894 mFilterView->setSelectedFilter(config->readEntry("Current Filter")); 2894 mFilterView->setSelectedFilter(config->readEntry("Current Filter"));
2895 mFilterView->blockSignals(false); 2895 mFilterView->blockSignals(false);
2896 // We do it manually to avoid it being done twice by the above calls 2896 // We do it manually to avoid it being done twice by the above calls
2897 updateFilter(); 2897 updateFilter();
2898} 2898}
2899 2899
2900void CalendarView::writeFilterSettings(KConfig *config) 2900void CalendarView::writeFilterSettings(KConfig *config)
2901{ 2901{
2902 // kdDebug() << "CalendarView::writeFilterSettings()" << endl; 2902 // kdDebug() << "CalendarView::writeFilterSettings()" << endl;
2903 2903
2904 QStringList filterList; 2904 QStringList filterList;
2905 2905
2906 CalFilter *filter = mFilters.first(); 2906 CalFilter *filter = mFilters.first();
2907 while(filter) { 2907 while(filter) {
2908 // kdDebug() << " fn: " << filter->name() << endl; 2908 // kdDebug() << " fn: " << filter->name() << endl;
2909 filterList << filter->name(); 2909 filterList << filter->name();
2910 config->setGroup("Filter_" + filter->name().utf8()); 2910 config->setGroup("Filter_" + filter->name().utf8());
2911 config->writeEntry("Criteria",filter->criteria()); 2911 config->writeEntry("Criteria",filter->criteria());
2912 config->writeEntry("CategoryList",filter->categoryList()); 2912 config->writeEntry("CategoryList",filter->categoryList());
2913 filter = mFilters.next(); 2913 filter = mFilters.next();
2914 } 2914 }
2915 config->setGroup("General"); 2915 config->setGroup("General");
2916 config->writeEntry("CalendarFilters",filterList); 2916 config->writeEntry("CalendarFilters",filterList);
2917 2917
2918 config->setGroup("FilterView"); 2918 config->setGroup("FilterView");
2919 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled()); 2919 config->writeEntry("FilterEnabled",mFilterView->filtersEnabled());
2920 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name()); 2920 config->writeEntry("Current Filter",mFilterView->selectedFilter()->name());
2921} 2921}
2922 2922
2923 2923
2924void CalendarView::goToday() 2924void CalendarView::goToday()
2925{ 2925{
2926 if ( mViewManager->currentView()->isMonthView() ) 2926 if ( mViewManager->currentView()->isMonthView() )
2927 mNavigator->selectTodayMonth(); 2927 mNavigator->selectTodayMonth();
2928 else 2928 else
2929 mNavigator->selectToday(); 2929 mNavigator->selectToday();
2930} 2930}
2931 2931
2932void CalendarView::goNext() 2932void CalendarView::goNext()
2933{ 2933{
2934 mNavigator->selectNext(); 2934 mNavigator->selectNext();
2935} 2935}
2936 2936
2937void CalendarView::goPrevious() 2937void CalendarView::goPrevious()
2938{ 2938{
2939 mNavigator->selectPrevious(); 2939 mNavigator->selectPrevious();
2940} 2940}
2941void CalendarView::goNextMonth() 2941void CalendarView::goNextMonth()
2942{ 2942{
2943 mNavigator->selectNextMonth(); 2943 mNavigator->selectNextMonth();
2944} 2944}
2945 2945
2946void CalendarView::goPreviousMonth() 2946void CalendarView::goPreviousMonth()
2947{ 2947{
2948 mNavigator->selectPreviousMonth(); 2948 mNavigator->selectPreviousMonth();
2949} 2949}
2950 2950
2951void CalendarView::updateConfig() 2951void CalendarView::updateConfig()
2952{ 2952{
2953 if ( KOPrefs::instance()->mUseAppColors ) 2953 if ( KOPrefs::instance()->mUseAppColors )
2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true ); 2954 QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
2955 emit configChanged(); 2955 emit configChanged();
2956 mTodoList->updateConfig(); 2956 mTodoList->updateConfig();
2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont); 2957 // mDateNavigator->setFont ( KOPrefs::instance()->mDateNavigatorFont);
2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 2958 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
2959 // To make the "fill window" configurations work 2959 // To make the "fill window" configurations work
2960 //mViewManager->raiseCurrentView(); 2960 //mViewManager->raiseCurrentView();
2961} 2961}
2962 2962
2963 2963
2964void CalendarView::eventChanged(Event *event) 2964void CalendarView::eventChanged(Event *event)
2965{ 2965{
2966 changeEventDisplay(event,KOGlobals::EVENTEDITED); 2966 changeEventDisplay(event,KOGlobals::EVENTEDITED);
2967 //updateUnmanagedViews(); 2967 //updateUnmanagedViews();
2968} 2968}
2969 2969
2970void CalendarView::eventAdded(Event *event) 2970void CalendarView::eventAdded(Event *event)
2971{ 2971{
2972 changeEventDisplay(event,KOGlobals::EVENTADDED); 2972 changeEventDisplay(event,KOGlobals::EVENTADDED);
2973} 2973}
2974 2974
2975void CalendarView::eventToBeDeleted(Event *) 2975void CalendarView::eventToBeDeleted(Event *)
2976{ 2976{
2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl; 2977 kdDebug() << "CalendarView::eventToBeDeleted(): to be implemented" << endl;
2978} 2978}
2979 2979
2980void CalendarView::eventDeleted() 2980void CalendarView::eventDeleted()
2981{ 2981{
2982 changeEventDisplay(0,KOGlobals::EVENTDELETED); 2982 changeEventDisplay(0,KOGlobals::EVENTDELETED);
2983} 2983}
2984void CalendarView::changeTodoDisplay(Todo *which, int action) 2984void CalendarView::changeTodoDisplay(Todo *which, int action)
2985{ 2985{
2986 changeIncidenceDisplay((Incidence *)which, action); 2986 changeIncidenceDisplay((Incidence *)which, action);
2987 mDateNavigator->updateView(); //LR 2987 mDateNavigator->updateView(); //LR
2988 //mDialogManager->updateSearchDialog(); 2988 //mDialogManager->updateSearchDialog();
2989 2989
2990 if (which) { 2990 if (which) {
2991 mViewManager->updateWNview(); 2991 mViewManager->updateWNview();
2992 //mTodoList->updateView(); 2992 //mTodoList->updateView();
2993 } 2993 }
2994 2994
2995} 2995}
2996 2996
2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action) 2997void CalendarView::changeIncidenceDisplay(Incidence *which, int action)
2998{ 2998{
2999 updateUnmanagedViews(); 2999 updateUnmanagedViews();
3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action ); 3000 //qDebug(" CalendarView::changeIncidenceDisplay++++++++++++++++++++++++++ %d %d ",which, action );
3001 if ( action == KOGlobals::EVENTDELETED ) { //delete 3001 if ( action == KOGlobals::EVENTDELETED ) { //delete
3002 mCalendar->checkAlarmForIncidence( 0, true ); 3002 mCalendar->checkAlarmForIncidence( 0, true );
3003 if ( mEventViewerDialog ) 3003 if ( mEventViewerDialog )
3004 mEventViewerDialog->hide(); 3004 mEventViewerDialog->hide();
3005 } 3005 }
3006 else 3006 else
3007 mCalendar->checkAlarmForIncidence( which , false ); 3007 mCalendar->checkAlarmForIncidence( which , false );
3008} 3008}
3009 3009
3010// most of the changeEventDisplays() right now just call the view's 3010// most of the changeEventDisplays() right now just call the view's
3011// total update mode, but they SHOULD be recoded to be more refresh-efficient. 3011// total update mode, but they SHOULD be recoded to be more refresh-efficient.
3012void CalendarView::changeEventDisplay(Event *which, int action) 3012void CalendarView::changeEventDisplay(Event *which, int action)
3013{ 3013{
3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl; 3014 // kdDebug() << "CalendarView::changeEventDisplay" << endl;
3015 changeIncidenceDisplay((Incidence *)which, action); 3015 changeIncidenceDisplay((Incidence *)which, action);
3016 static bool clearallviews = false; 3016 static bool clearallviews = false;
3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3017 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3018 if ( clearallviews ) { 3018 if ( clearallviews ) {
3019 clearAllViews(); 3019 clearAllViews();
3020 clearallviews = false; 3020 clearallviews = false;
3021 } 3021 }
3022 return; 3022 return;
3023 } 3023 }
3024 clearallviews = true; 3024 clearallviews = true;
3025 mDateNavigator->updateView(); 3025 mDateNavigator->updateView();
3026 //mDialogManager->updateSearchDialog(); 3026 //mDialogManager->updateSearchDialog();
3027 if (which) { 3027 if (which) {
3028 // If there is an event view visible update the display 3028 // If there is an event view visible update the display
3029 mViewManager->currentView()->changeEventDisplay(which,action); 3029 mViewManager->currentView()->changeEventDisplay(which,action);
3030 // TODO: check, if update needed 3030 // TODO: check, if update needed
3031 // if (which->getTodoStatus()) { 3031 // if (which->getTodoStatus()) {
3032 mTodoList->updateView(); 3032 mTodoList->updateView();
3033 if ( action != KOGlobals::EVENTDELETED ) { 3033 if ( action != KOGlobals::EVENTDELETED ) {
3034 mConflictingEvent = which ; 3034 mConflictingEvent = which ;
3035 int time = 1000; 3035 int time = 1000;
3036#ifdef DESKTOP_VERSION 3036#ifdef DESKTOP_VERSION
3037 time = 500; 3037 time = 500;
3038#endif 3038#endif
3039 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) ); 3039 bool checkC = false;
3040 if ( mConflictingEvent->doesFloat() ) {
3041 checkC = KOPrefs::instance()->mCheckConflictsAllDayAllDay
3042 || KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3043 } else {
3044 checkC = KOPrefs::instance()->mCheckConflictsNonADAllDay
3045 || KOPrefs::instance()->mCheckConflictsNonADNonAD;
3046 }
3047 if ( checkC )
3048 QTimer::singleShot( time, this, SLOT ( checkConflictForEvent() ) );
3040 } 3049 }
3041 // } 3050 // }
3042 } else { 3051 } else {
3043 mViewManager->currentView()->updateView(); 3052 mViewManager->currentView()->updateView();
3044 } 3053 }
3045} 3054}
3046void CalendarView::checkConflictForEvent() 3055void CalendarView::checkConflictForEvent()
3047{ 3056{
3048 3057
3049 if (!KOPrefs::instance()->mConfirm) 3058 if (!KOPrefs::instance()->mConfirm)
3050 return; 3059 return;
3051 if ( ! mConflictingEvent ) return; 3060 if ( ! mConflictingEvent ) return;
3052 Event * conflictingEvent = mConflictingEvent; 3061 Event * conflictingEvent = mConflictingEvent;
3053 mConflictingEvent = 0; 3062 mConflictingEvent = 0;
3054 QDateTime current = QDateTime::currentDateTime(); 3063 QDateTime current = QDateTime::currentDateTime();
3055 if ( ! conflictingEvent->matchTime( &current, 0 ) ) { 3064 if ( ! conflictingEvent->matchTime( &current, 0 ) ) {
3056 return; 3065 return;
3057 } 3066 }
3067 CalFilter *filterIN = 0;
3068 CalFilter *filterALL = 0;
3069 CalFilter *filter = mFilters.first();
3070 while(filter) {
3071 if ( filter->name() == KOPrefs::instance()->mFilterConflictEditItem)
3072 filterIN = filter;
3073 if ( filter->name() == KOPrefs::instance()->mFilterConflictAllItem )
3074 filterALL = filter;
3075 filter = mFilters.next();
3076 }
3077 if ( filterIN ) {
3078 if ( !filterIN->filterCalendarItem( conflictingEvent ) ) {
3079 return;
3080 }
3081 }
3058 QPtrList<Event> testlist = mCalendar->events(); 3082 QPtrList<Event> testlist = mCalendar->events();
3059 Event * test = testlist.first(); 3083 Event * test = testlist.first();
3060 QDateTime conflict; 3084 QDateTime conflict;
3061 QDateTime retVal; 3085 QDateTime retVal;
3062 bool found = false; 3086 bool found = false;
3063 Event * cE = 0; 3087 Event * cE = 0;
3088 bool chAD = KOPrefs::instance()->mCheckConflictsAllDayAllDay;
3089 bool chNad = KOPrefs::instance()->mCheckConflictsAllDayNonAD;
3090 if ( !conflictingEvent->doesFloat() ) {
3091 chAD = KOPrefs::instance()->mCheckConflictsNonADAllDay;
3092 chNad = KOPrefs::instance()->mCheckConflictsNonADNonAD;
3093 }
3064 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") ); 3094 topLevelWidget()->setCaption( i18n("Checking conflicts ... please wait") );
3065 while ( test ) { 3095 while ( test ) {
3066 qApp->processEvents(); 3096 qApp->processEvents();
3067 bool skip = false; 3097 bool skip = ( test->doesFloat() && !chAD ) || ( !test->doesFloat() && !chNad );
3068 if ( found ) 3098 if ( !skip ) {
3069 skip = !test->matchTime( &current, &conflict ); 3099 if ( filterALL ) {
3070 else 3100 if ( !filterALL->filterCalendarItem( test ) ) {
3071 skip = !test->matchTime( &current, 0 ); 3101 skip = true;
3072 if ( !skip && !test->doesFloat() ) { 3102 }
3073 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) { 3103 }
3074 if ( ! found ) { 3104 if ( !skip ) {
3075 conflict = retVal; 3105 if ( found )
3076 cE = test; 3106 skip = !test->matchTime( &current, &conflict );
3077 } else { 3107 else
3078 if ( retVal < conflict ) { 3108 skip = !test->matchTime( &current, 0 );
3079 conflict = retVal; 3109 if ( !skip ) {
3080 cE = test; 3110 if ( conflictingEvent->isOverlapping ( test, &retVal, &current ) ) {
3111 if ( ! found ) {
3112 conflict = retVal;
3113 cE = test;
3114 } else {
3115 if ( retVal < conflict ) {
3116 conflict = retVal;
3117 cE = test;
3118 }
3119 }
3120 found = true;
3081 } 3121 }
3082 } 3122 }
3083 found = true;
3084 } 3123 }
3085 } 3124 }
3086 test = testlist.next(); 3125 test = testlist.next();
3087 } 3126 }
3088 topLevelWidget()->setCaption( i18n("KO/Pi") ); 3127 topLevelWidget()->setCaption( i18n("KO/Pi") );
3089 if ( found ) { 3128 if ( found ) {
3090 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ; 3129 QString mess = i18n("The event\n%1\nconflicts with event\n%2\nat date\n%3.\n").arg(KGlobal::formatMessage ( conflictingEvent->summary(),0 ) ).arg( KGlobal::formatMessage ( cE->summary(),0 )).arg(KGlobal::locale()->formatDate(conflict.date()) ) ;
3091 qApp->processEvents(); 3130 qApp->processEvents();
3092 int km = KMessageBox::warningContinueCancel(this,mess, 3131 int km = KMessageBox::warningContinueCancel(this,mess,
3093 i18n("KO/Pi Conflict delected"),i18n("Show date"),i18n("No problem!")); 3132 i18n("KO/Pi Conflict detected"),i18n("Show date"),i18n("No problem!"));
3094 if ( km != KMessageBox::Continue ) { 3133 if ( km != KMessageBox::Continue ) {
3095 return; 3134 return;
3096 } 3135 }
3097 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 ) 3136 if ( mViewManager->currentView() != mViewManager->agendaView() || mNavigator->selectedDates().count() > 1 )
3098 mViewManager->showDayView(); 3137 mViewManager->showDayView();
3099 mNavigator->slotDaySelect( conflict.date() ); 3138 mNavigator->slotDaySelect( conflict.date() );
3100 int hour = conflict.time().hour(); 3139 int hour = conflict.time().hour();
3101 mViewManager->agendaView()->setStartHour( hour ); 3140 mViewManager->agendaView()->setStartHour( hour );
3102 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) ); 3141 topLevelWidget()->setCaption( i18n("Conflict %1 <-> %2"). arg( conflictingEvent->summary().left( 20 ) ).arg( cE->summary().left( 20 ) ) );
3103 } else 3142 } else
3104 topLevelWidget()->setCaption( i18n("No conflict found") ); 3143 topLevelWidget()->setCaption( i18n("No conflict found") );
3105 return; 3144 return;
3106 3145
3107} 3146}
3108 3147
3109void CalendarView::updateTodoViews() 3148void CalendarView::updateTodoViews()
3110{ 3149{
3111 mTodoList->updateView(); 3150 mTodoList->updateView();
3112 mViewManager->currentView()->updateView(); 3151 mViewManager->currentView()->updateView();
3113 3152
3114} 3153}
3115 3154
3116 3155
3117 3156
3118void CalendarView::clearAllViews() 3157void CalendarView::clearAllViews()
3119{ 3158{
3120 mTodoList->clearList(); 3159 mTodoList->clearList();
3121 mViewManager->clearAllViews(); 3160 mViewManager->clearAllViews();
3122 SearchDialog * sd = mDialogManager->getSearchDialog(); 3161 SearchDialog * sd = mDialogManager->getSearchDialog();
3123 if ( sd ) { 3162 if ( sd ) {
3124 KOListView* kol = sd->listview(); 3163 KOListView* kol = sd->listview();
3125 if ( kol ) 3164 if ( kol )
3126 kol->clearList(); 3165 kol->clearList();
3127 } 3166 }
3128} 3167}
3129void CalendarView::updateView() 3168void CalendarView::updateView()
3130{ 3169{
3131 static bool clearallviews = false; 3170 static bool clearallviews = false;
3132 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) { 3171 if ( KOPrefs::instance()->mGlobalUpdateDisabled ) {
3133 if ( clearallviews ) { 3172 if ( clearallviews ) {
3134 clearAllViews(); 3173 clearAllViews();
3135 clearallviews = false; 3174 clearallviews = false;
3136 } 3175 }
3137 return; 3176 return;
3138 } 3177 }
3139 clearallviews = true; 3178 clearallviews = true;
3140 DateList tmpList = mNavigator->selectedDates(); 3179 DateList tmpList = mNavigator->selectedDates();
3141 3180
3142 if ( KOPrefs::instance()->mHideNonStartedTodos ) 3181 if ( KOPrefs::instance()->mHideNonStartedTodos )
3143 mTodoList->updateView(); 3182 mTodoList->updateView();
3144 // We assume that the navigator only selects consecutive days. 3183 // We assume that the navigator only selects consecutive days.
3145 updateView( tmpList.first(), tmpList.last() ); 3184 updateView( tmpList.first(), tmpList.last() );
3146} 3185}
3147 3186
3148void CalendarView::updateUnmanagedViews() 3187void CalendarView::updateUnmanagedViews()
3149{ 3188{
3150 mDateNavigator->updateDayMatrix(); 3189 mDateNavigator->updateDayMatrix();
3151} 3190}
3152 3191
3153int CalendarView::msgItemDelete(const QString name) 3192int CalendarView::msgItemDelete(const QString name)
3154{ 3193{
3155 return KMessageBox::warningContinueCancel(this,name +"\n\n"+ 3194 return KMessageBox::warningContinueCancel(this,name +"\n\n"+
3156 i18n("This item will be\npermanently deleted."), 3195 i18n("This item will be\npermanently deleted."),
3157 i18n("KO/Pi Confirmation"),i18n("Delete")); 3196 i18n("KO/Pi Confirmation"),i18n("Delete"));
3158} 3197}
3159 3198
3160 3199
3161void CalendarView::edit_cut() 3200void CalendarView::edit_cut()
3162{ 3201{
3163 Event *anEvent=0; 3202 Event *anEvent=0;
3164 3203
3165 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3204 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3166 3205
3167 if (mViewManager->currentView()->isEventView()) { 3206 if (mViewManager->currentView()->isEventView()) {
3168 if ( incidence && incidence->typeID() == eventID ) { 3207 if ( incidence && incidence->typeID() == eventID ) {
3169 anEvent = static_cast<Event *>(incidence); 3208 anEvent = static_cast<Event *>(incidence);
3170 } 3209 }
3171 } 3210 }
3172 3211
3173 if (!anEvent) { 3212 if (!anEvent) {
3174 KNotifyClient::beep(); 3213 KNotifyClient::beep();
3175 return; 3214 return;
3176 } 3215 }
3177 DndFactory factory( mCalendar ); 3216 DndFactory factory( mCalendar );
3178 factory.cutIncidence(anEvent); 3217 factory.cutIncidence(anEvent);
3179 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED); 3218 changeEventDisplay(anEvent, KOGlobals::EVENTDELETED);
3180} 3219}
3181 3220
3182void CalendarView::edit_copy() 3221void CalendarView::edit_copy()
3183{ 3222{
3184 Event *anEvent=0; 3223 Event *anEvent=0;
3185 3224
3186 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first(); 3225 Incidence *incidence = mViewManager->currentView()->selectedIncidences().first();
3187 3226
3188 if (mViewManager->currentView()->isEventView()) { 3227 if (mViewManager->currentView()->isEventView()) {
3189 if ( incidence && incidence->typeID() == eventID ) { 3228 if ( incidence && incidence->typeID() == eventID ) {
3190 anEvent = static_cast<Event *>(incidence); 3229 anEvent = static_cast<Event *>(incidence);
3191 } 3230 }
3192 } 3231 }
3193 3232
3194 if (!anEvent) { 3233 if (!anEvent) {
3195 KNotifyClient::beep(); 3234 KNotifyClient::beep();
3196 return; 3235 return;
3197 } 3236 }
3198 DndFactory factory( mCalendar ); 3237 DndFactory factory( mCalendar );
3199 factory.copyIncidence(anEvent); 3238 factory.copyIncidence(anEvent);
3200} 3239}
3201 3240
3202void CalendarView::edit_paste() 3241void CalendarView::edit_paste()
3203{ 3242{
3204 QDate date = mNavigator->selectedDates().first(); 3243 QDate date = mNavigator->selectedDates().first();
3205 3244
3206 DndFactory factory( mCalendar ); 3245 DndFactory factory( mCalendar );
3207 Event *pastedEvent = (Event *)factory.pasteIncidence( date ); 3246 Event *pastedEvent = (Event *)factory.pasteIncidence( date );
3208 3247
3209 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED ); 3248 changeEventDisplay( pastedEvent, KOGlobals::EVENTADDED );
3210} 3249}
3211void CalendarView::edit_global_options() 3250void CalendarView::edit_global_options()
3212{ 3251{
3213 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId; 3252 QString tz = KPimGlobalPrefs::instance()->mTimeZoneId;
3214 emit save(); 3253 emit save();
3215 emit saveStopTimer(); 3254 emit saveStopTimer();
3216 mDialogManager->showGlobalOptionsDialog(); 3255 mDialogManager->showGlobalOptionsDialog();
3217 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) { 3256 if ( tz != KPimGlobalPrefs::instance()->mTimeZoneId) {
3218 emit saveStopTimer(); 3257 emit saveStopTimer();
3219 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"), 3258 if ( KMessageBox::Cancel == KMessageBox::warningContinueCancel(this, i18n("The timezone has changed!\nShould the calendar be reloaded\nto shift the time of the events?\nPlease read Menu: Help->FAQ:\n\"How do I change the timezone?\"\nas well!"),
3220 i18n("Timezone settings"),i18n("Reload"))) { 3259 i18n("Timezone settings"),i18n("Reload"))) {
3221 qDebug("KO: TZ reload cancelled "); 3260 qDebug("KO: TZ reload cancelled ");
3222 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 3261 mCalendar->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
3223 return; 3262 return;
3224 } 3263 }
3225 qDebug("KO: Timezone change "); 3264 qDebug("KO: Timezone change ");
3226 loadCalendars(); 3265 loadCalendars();
3227 setModified(true); 3266 setModified(true);
3228 } 3267 }
3229 else 3268 else
3230 qDebug("KO: No tz change "); 3269 qDebug("KO: No tz change ");
3231} 3270}
3232void CalendarView::edit_options() 3271void CalendarView::edit_options()
3233{ 3272{
3234 mDialogManager->showOptionsDialog(); 3273 mDialogManager->showOptionsDialog();
3235} 3274}
3236 3275
3237 3276
3238void CalendarView::slotSelectPickerDate( QDate d) 3277void CalendarView::slotSelectPickerDate( QDate d)
3239{ 3278{
3240 mDateFrame->hide(); 3279 mDateFrame->hide();
3241 if ( mDatePickerMode == 1 ) { 3280 if ( mDatePickerMode == 1 ) {
3242 mNavigator->slotDaySelect( d ); 3281 mNavigator->slotDaySelect( d );
3243 } else if ( mDatePickerMode == 2 ) { 3282 } else if ( mDatePickerMode == 2 ) {
3244 if ( mMoveIncidence->typeID() == todoID ) { 3283 if ( mMoveIncidence->typeID() == todoID ) {
3245 Todo * to = (Todo *) mMoveIncidence; 3284 Todo * to = (Todo *) mMoveIncidence;
3246 QTime tim; 3285 QTime tim;
3247 int len = 0; 3286 int len = 0;
3248 if ( to->hasStartDate() && to->hasDueDate() ) 3287 if ( to->hasStartDate() && to->hasDueDate() )
3249 len = to->dtStart().secsTo( to->dtDue()); 3288 len = to->dtStart().secsTo( to->dtDue());
3250 if ( to->hasDueDate() ) 3289 if ( to->hasDueDate() )
3251 tim = to->dtDue().time(); 3290 tim = to->dtDue().time();
3252 else { 3291 else {
3253 tim = QTime ( 0,0,0 ); 3292 tim = QTime ( 0,0,0 );
3254 to->setFloats( true ); 3293 to->setFloats( true );
3255 to->setHasDueDate( true ); 3294 to->setHasDueDate( true );
3256 } 3295 }
3257 QDateTime dt ( d,tim ); 3296 QDateTime dt ( d,tim );
3258 to->setDtDue( dt ); 3297 to->setDtDue( dt );
3259 3298
3260 if ( to->hasStartDate() ) { 3299 if ( to->hasStartDate() ) {
3261 if ( len>0 ) 3300 if ( len>0 )
3262 to->setDtStart(to->dtDue().addSecs( -len )); 3301 to->setDtStart(to->dtDue().addSecs( -len ));
3263 else 3302 else
3264 if (to->dtStart() > to->dtDue() ) 3303 if (to->dtStart() > to->dtDue() )
3265 to->setDtStart(to->dtDue().addDays( -3 )); 3304 to->setDtStart(to->dtDue().addDays( -3 ));
3266 } 3305 }
3267 3306
3268 todoChanged( to ); 3307 todoChanged( to );
3269 } else if ( mMoveIncidence->typeID() == eventID ) { 3308 } else if ( mMoveIncidence->typeID() == eventID ) {
3270 if ( mMoveIncidence->doesRecur() ) { 3309 if ( mMoveIncidence->doesRecur() ) {
3271#if 0 3310#if 0
3272 // PENDING implement this 3311 // PENDING implement this
3273 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate ); 3312 Incidence* newInc = mMoveIncidence->recreateCloneException( mMoveIncidenceOldDate );
3274 mCalendar()->addIncidence( newInc ); 3313 mCalendar()->addIncidence( newInc );
3275 if ( mMoveIncidence->typeID() == todoID ) 3314 if ( mMoveIncidence->typeID() == todoID )
3276 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED ); 3315 emit todoMoved((Todo*)mMoveIncidence, KOGlobals::EVENTEDITED );
3277 else 3316 else
3278 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED); 3317 emit incidenceChanged(mMoveIncidence, KOGlobals::EVENTEDITED);
3279 mMoveIncidence = newInc; 3318 mMoveIncidence = newInc;
3280 3319
3281#endif 3320#endif
3282 } 3321 }
3283 QTime tim = mMoveIncidence->dtStart().time(); 3322 QTime tim = mMoveIncidence->dtStart().time();
3284 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd()); 3323 int secs = mMoveIncidence->dtStart().secsTo( mMoveIncidence->dtEnd());
3285 QDateTime dt ( d,tim ); 3324 QDateTime dt ( d,tim );
3286 mMoveIncidence->setDtStart( dt ); 3325 mMoveIncidence->setDtStart( dt );
3287 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) ); 3326 ((Event*)mMoveIncidence)->setDtEnd( dt.addSecs( secs ) );
3288 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED); 3327 changeEventDisplay((Event*)mMoveIncidence, KOGlobals::EVENTEDITED);
3289 } else if ( mMoveIncidence->typeID() == journalID ) { 3328 } else if ( mMoveIncidence->typeID() == journalID ) {
3290 QTime tim = mMoveIncidence->dtStart().time(); 3329 QTime tim = mMoveIncidence->dtStart().time();
3291 QDateTime dt ( d,tim ); 3330 QDateTime dt ( d,tim );
3292 mMoveIncidence->setDtStart( dt ); 3331 mMoveIncidence->setDtStart( dt );
3293 updateView(); 3332 updateView();
3294 } 3333 }
3295 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 ); 3334 mMoveIncidence->setRevision( mMoveIncidence->revision()+1 );
3296 } 3335 }
3297} 3336}
3298 3337
3299void CalendarView::removeCategories() 3338void CalendarView::removeCategories()
3300{ 3339{
3301 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3340 QPtrList<Incidence> incList = mCalendar->rawIncidences();
3302 QStringList catList = KOPrefs::instance()->mCustomCategories; 3341 QStringList catList = KOPrefs::instance()->mCustomCategories;
3303 QStringList catIncList; 3342 QStringList catIncList;
3304 QStringList newCatList; 3343 QStringList newCatList;
3305 Incidence* inc = incList.first(); 3344 Incidence* inc = incList.first();
3306 uint i; 3345 uint i;
3307 while ( inc ) { 3346 while ( inc ) {
3308 newCatList.clear(); 3347 newCatList.clear();
3309 catIncList = inc->categories() ; 3348 catIncList = inc->categories() ;
3310 for( i = 0; i< catIncList.count(); ++i ) { 3349 for( i = 0; i< catIncList.count(); ++i ) {
3311 if ( catList.contains (catIncList[i])) 3350 if ( catList.contains (catIncList[i]))
3312 newCatList.append( catIncList[i] ); 3351 newCatList.append( catIncList[i] );
3313 } 3352 }
3314 newCatList.sort(); 3353 newCatList.sort();
3315 inc->setCategories( newCatList.join(",") ); 3354 inc->setCategories( newCatList.join(",") );
3316 inc = incList.next(); 3355 inc = incList.next();
3317 } 3356 }
3318} 3357}
3319 3358
3320int CalendarView::addCategories() 3359int CalendarView::addCategories()
3321{ 3360{
3322 QPtrList<Incidence> incList = mCalendar->rawIncidences(); 3361 QPtrList<Incidence> incList = mCalendar->rawIncidences();
3323 QStringList catList = KOPrefs::instance()->mCustomCategories; 3362 QStringList catList = KOPrefs::instance()->mCustomCategories;
3324 QStringList catIncList; 3363 QStringList catIncList;
3325 Incidence* inc = incList.first(); 3364 Incidence* inc = incList.first();
3326 uint i; 3365 uint i;
3327 int count = 0; 3366 int count = 0;
3328 while ( inc ) { 3367 while ( inc ) {
3329 catIncList = inc->categories() ; 3368 catIncList = inc->categories() ;
3330 for( i = 0; i< catIncList.count(); ++i ) { 3369 for( i = 0; i< catIncList.count(); ++i ) {
3331 if ( !catList.contains (catIncList[i])) { 3370 if ( !catList.contains (catIncList[i])) {
3332 catList.append( catIncList[i] ); 3371 catList.append( catIncList[i] );
3333 //qDebug("add cat %s ", catIncList[i].latin1()); 3372 //qDebug("add cat %s ", catIncList[i].latin1());
3334 ++count; 3373 ++count;
3335 } 3374 }
3336 } 3375 }
3337 inc = incList.next(); 3376 inc = incList.next();
3338 } 3377 }
3339 catList.sort(); 3378 catList.sort();
3340 KOPrefs::instance()->mCustomCategories = catList; 3379 KOPrefs::instance()->mCustomCategories = catList;
3341 return count; 3380 return count;
3342} 3381}
3343 3382
3344void CalendarView::editCategories() 3383void CalendarView::editCategories()
3345{ 3384{
3346 qDebug("CalendarView::editCategories() "); 3385 qDebug("CalendarView::editCategories() ");
3347 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this ); 3386 KPIM::CategoryEditDialog ced (KOPrefs::instance(),this );
3348 ced.exec(); 3387 ced.exec();
3349} 3388}
3350void CalendarView::manageCategories() 3389void CalendarView::manageCategories()
3351{ 3390{
3352 KOCatPrefs* cp = new KOCatPrefs(); 3391 KOCatPrefs* cp = new KOCatPrefs();
3353 cp->show(); 3392 cp->show();
3354 int w =cp->sizeHint().width() ; 3393 int w =cp->sizeHint().width() ;
3355 int h = cp->sizeHint().height() ; 3394 int h = cp->sizeHint().height() ;
3356 int dw = QApplication::desktop()->width(); 3395 int dw = QApplication::desktop()->width();
3357 int dh = QApplication::desktop()->height(); 3396 int dh = QApplication::desktop()->height();
3358 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h ); 3397 cp->setGeometry( (dw-w)/2, (dh - h )/2 ,w,h );
3359 if ( !cp->exec() ) { 3398 if ( !cp->exec() ) {
3360 delete cp; 3399 delete cp;
3361 return; 3400 return;
3362 } 3401 }
3363 int count = 0; 3402 int count = 0;
3364 if ( cp->addCat() ) { 3403 if ( cp->addCat() ) {
3365 count = addCategories(); 3404 count = addCategories();
3366 if ( count ) { 3405 if ( count ) {
3367 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! ")); 3406 topLevelWidget()->setCaption(QString::number( count )+ i18n(" Categories added to list! "));
3368 writeSettings(); 3407 writeSettings();
3369 } else 3408 } else
3370 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! ")); 3409 topLevelWidget()->setCaption(QString::number( 0 )+ i18n(" Categories added to list! "));
3371 } else { 3410 } else {
3372 removeCategories(); 3411 removeCategories();
3373 updateView(); 3412 updateView();
3374 } 3413 }
3375 delete cp; 3414 delete cp;
3376} 3415}
3377 3416
3378void CalendarView::beamIncidence(Incidence * Inc) 3417void CalendarView::beamIncidence(Incidence * Inc)
3379{ 3418{
3380 QPtrList<Incidence> delSel ; 3419 QPtrList<Incidence> delSel ;
3381 delSel.append(Inc); 3420 delSel.append(Inc);
3382 beamIncidenceList( delSel ); 3421 beamIncidenceList( delSel );
3383} 3422}
3384void CalendarView::beamCalendar() 3423void CalendarView::beamCalendar()
3385{ 3424{
3386 QPtrList<Incidence> delSel = mCalendar->rawIncidences(); 3425 QPtrList<Incidence> delSel = mCalendar->rawIncidences();
3387 //qDebug("beamCalendar() "); 3426 //qDebug("beamCalendar() ");
3388 beamIncidenceList( delSel ); 3427 beamIncidenceList( delSel );
3389} 3428}
3390void CalendarView::beamFilteredCalendar() 3429void CalendarView::beamFilteredCalendar()
3391{ 3430{
3392 QPtrList<Incidence> delSel = mCalendar->incidences(); 3431 QPtrList<Incidence> delSel = mCalendar->incidences();
3393 //qDebug("beamFilteredCalendar() "); 3432 //qDebug("beamFilteredCalendar() ");
3394 beamIncidenceList( delSel ); 3433 beamIncidenceList( delSel );
3395} 3434}
3396void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel ) 3435void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
3397{ 3436{
3398 3437
3399 KOBeamPrefs beamDialog; 3438 KOBeamPrefs beamDialog;
3400 if ( beamDialog.exec () == QDialog::Rejected ) 3439 if ( beamDialog.exec () == QDialog::Rejected )
3401 return; 3440 return;
3402#ifdef DESKTOP_VERSION 3441#ifdef DESKTOP_VERSION
3403 QString fn = locateLocal( "tmp", "kopibeamfile" ); 3442 QString fn = locateLocal( "tmp", "kopibeamfile" );
3404#else 3443#else
3405 QString fn = "/tmp/kopibeamfile"; 3444 QString fn = "/tmp/kopibeamfile";
3406#endif 3445#endif
3407 QString mes; 3446 QString mes;
3408 bool createbup = true; 3447 bool createbup = true;
3409 if ( createbup ) { 3448 if ( createbup ) {
3410 QString description = "\n"; 3449 QString description = "\n";
3411 CalendarLocal* cal = new CalendarLocal(); 3450 CalendarLocal* cal = new CalendarLocal();
3412 if ( beamDialog.beamLocal() ) 3451 if ( beamDialog.beamLocal() )
3413 cal->setLocalTime(); 3452 cal->setLocalTime();
3414 else 3453 else
3415 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId); 3454 cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
3416 Incidence *incidence = delSel.first(); 3455 Incidence *incidence = delSel.first();
3417 bool addText = false; 3456 bool addText = false;
3418 if ( delSel.count() < 10 ) 3457 if ( delSel.count() < 10 )
3419 addText = true; 3458 addText = true;
3420 else { 3459 else {
3421 description.sprintf(i18n(" %d items?"),delSel.count() ); 3460 description.sprintf(i18n(" %d items?"),delSel.count() );
3422 } 3461 }
3423 while ( incidence ) { 3462 while ( incidence ) {
3424 Incidence *in = incidence->clone(); 3463 Incidence *in = incidence->clone();
3425 if ( ! in->summary().isEmpty() ) { 3464 if ( ! in->summary().isEmpty() ) {
3426 in->setDescription(""); 3465 in->setDescription("");
3427 } else { 3466 } else {
3428 in->setSummary( in->description().left(20)); 3467 in->setSummary( in->description().left(20));
3429 in->setDescription(""); 3468 in->setDescription("");
3430 } 3469 }
3431 if ( addText ) 3470 if ( addText )
3432 description += in->summary() + "\n"; 3471 description += in->summary() + "\n";
3433 cal->addIncidence( in ); 3472 cal->addIncidence( in );
3434 incidence = delSel.next(); 3473 incidence = delSel.next();
3435 } 3474 }
3436 if ( beamDialog.beamVcal() ) { 3475 if ( beamDialog.beamVcal() ) {
3437 fn += ".vcs"; 3476 fn += ".vcs";
3438 FileStorage storage( cal, fn, new VCalFormat ); 3477 FileStorage storage( cal, fn, new VCalFormat );
3439 storage.save(); 3478 storage.save();
3440 } else { 3479 } else {
3441 fn += ".ics"; 3480 fn += ".ics";
3442 FileStorage storage( cal, fn, new ICalFormat( ) ); 3481 FileStorage storage( cal, fn, new ICalFormat( ) );
3443 storage.save(); 3482 storage.save();
3444 } 3483 }
3445 delete cal; 3484 delete cal;
3446 mes = i18n("KO/Pi: Ready for beaming"); 3485 mes = i18n("KO/Pi: Ready for beaming");
3447 topLevelWidget()->setCaption(mes); 3486 topLevelWidget()->setCaption(mes);
3448 KApplication::convert2latin1( fn ); 3487 KApplication::convert2latin1( fn );
3449#ifndef DESKTOP_VERSION 3488#ifndef DESKTOP_VERSION
3450 Ir *ir = new Ir( this ); 3489 Ir *ir = new Ir( this );
3451 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) ); 3490 connect( ir, SIGNAL( done( Ir * ) ), this, SLOT( beamDone( Ir * ) ) );
3452 ir->send( fn, description, "text/x-vCalendar" ); 3491 ir->send( fn, description, "text/x-vCalendar" );
3453#endif 3492#endif
3454 } 3493 }
3455} 3494}
3456 3495
3457#ifndef DESKTOP_VERSION 3496#ifndef DESKTOP_VERSION
3458void CalendarView::beamDone( Ir *ir ) 3497void CalendarView::beamDone( Ir *ir )
3459{ 3498{
3460 delete ir; 3499 delete ir;
3461 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") ); 3500 topLevelWidget()->setCaption( i18n("KO/Pi: Beaming done.") );
3462 topLevelWidget()->raise(); 3501 topLevelWidget()->raise();
3463} 3502}
3464#else 3503#else
3465void CalendarView::beamDone( Ir *){;} 3504void CalendarView::beamDone( Ir *){;}
3466#endif 3505#endif
3467void CalendarView::moveIncidence(Incidence * inc ) 3506void CalendarView::moveIncidence(Incidence * inc )
3468{ 3507{
3469 if ( !inc ) return; 3508 if ( !inc ) return;
3470 showDatePickerPopup(); 3509 showDatePickerPopup();
3471 mDatePickerMode = 2; 3510 mDatePickerMode = 2;
3472 mMoveIncidence = inc ; 3511 mMoveIncidence = inc ;
3473 QDate da; 3512 QDate da;
3474 if ( mMoveIncidence->typeID() == todoID ) { 3513 if ( mMoveIncidence->typeID() == todoID ) {
3475 Todo * to = (Todo *) mMoveIncidence; 3514 Todo * to = (Todo *) mMoveIncidence;
3476 if ( to->hasDueDate() ) 3515 if ( to->hasDueDate() )
3477 da = to->dtDue().date(); 3516 da = to->dtDue().date();
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index 77f572c..571ca11 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -1,617 +1,625 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <time.h> 24#include <time.h>
25#ifndef _WIN32_ 25#ifndef _WIN32_
26#include <unistd.h> 26#include <unistd.h>
27#endif 27#endif
28#include <qdir.h> 28#include <qdir.h>
29#include <qtextstream.h> 29#include <qtextstream.h>
30#include <qtextcodec.h> 30#include <qtextcodec.h>
31#include <qstring.h> 31#include <qstring.h>
32#include <qregexp.h> 32#include <qregexp.h>
33#include <qfont.h> 33#include <qfont.h>
34#include <qcolor.h> 34#include <qcolor.h>
35#include <qstringlist.h> 35#include <qstringlist.h>
36#include <stdlib.h> 36#include <stdlib.h>
37 37
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kglobalsettings.h> 39#include <kglobalsettings.h>
40#include <kconfig.h> 40#include <kconfig.h>
41#include <klocale.h> 41#include <klocale.h>
42#include <kdebug.h> 42#include <kdebug.h>
43#include <kemailsettings.h> 43#include <kemailsettings.h>
44#include <kstaticdeleter.h> 44#include <kstaticdeleter.h>
45#include <libkdepim/kpimglobalprefs.h> 45#include <libkdepim/kpimglobalprefs.h>
46 46
47#include "koprefs.h" 47#include "koprefs.h"
48#include "mainwindow.h" 48#include "mainwindow.h"
49 49
50KOPrefs *KOPrefs::mInstance = 0; 50KOPrefs *KOPrefs::mInstance = 0;
51static KStaticDeleter<KOPrefs> insd; 51static KStaticDeleter<KOPrefs> insd;
52 52
53KOPrefs::KOPrefs() : 53KOPrefs::KOPrefs() :
54 KPimPrefs("korganizerrc") 54 KPimPrefs("korganizerrc")
55{ 55{
56 mGlobalUpdateDisabled = false; 56 mGlobalUpdateDisabled = false;
57 mCategoryColors.setAutoDelete(true); 57 mCategoryColors.setAutoDelete(true);
58 fillMailDefaults(); 58 fillMailDefaults();
59 mDefaultCategoryColor = QColor(175,210,255);//196,196,196); 59 mDefaultCategoryColor = QColor(175,210,255);//196,196,196);
60 QColor defaultHolidayColor = QColor(255,0,0); 60 QColor defaultHolidayColor = QColor(255,0,0);
61 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255); 61 QColor defaultHighlightColor = QColor(129,112,255);//64,64,255);
62 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128); 62 QColor defaultAgendaBgColor = QColor(239,241,169);//128,128,128);
63 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160); 63 QColor defaultWorkingHoursColor = QColor(170,223,150);//160,160,160);
64 QColor defaultTodoDueTodayColor = QColor(255,220,100); 64 QColor defaultTodoDueTodayColor = QColor(255,220,100);
65 QColor defaultTodoOverdueColor = QColor(255,153,125); 65 QColor defaultTodoOverdueColor = QColor(255,153,125);
66 QColor defaultTodoRunColor = QColor(99,194,30); 66 QColor defaultTodoRunColor = QColor(99,194,30);
67 KPrefs::setCurrentGroup("General"); 67 KPrefs::setCurrentGroup("General");
68 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 68 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
69 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true); 69 addItemBool("ShowIconNewTodo",&mShowIconNewTodo,true);
70 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true); 70 addItemBool("ShowIconNewEvent",&mShowIconNewEvent,true);
71 addItemBool("ShowIconSearch",&mShowIconSearch,true); 71 addItemBool("ShowIconSearch",&mShowIconSearch,true);
72 addItemBool("ShowIconList",&mShowIconList,true); 72 addItemBool("ShowIconList",&mShowIconList,true);
73 addItemBool("ShowIconDay1",&mShowIconDay1,true); 73 addItemBool("ShowIconDay1",&mShowIconDay1,true);
74 addItemBool("ShowIconDay5",&mShowIconDay5,true); 74 addItemBool("ShowIconDay5",&mShowIconDay5,true);
75 addItemBool("ShowIconDay6",&mShowIconDay6,true); 75 addItemBool("ShowIconDay6",&mShowIconDay6,true);
76 addItemBool("ShowIconDay7",&mShowIconDay7,true); 76 addItemBool("ShowIconDay7",&mShowIconDay7,true);
77 addItemBool("ShowIconMonth",&mShowIconMonth,true); 77 addItemBool("ShowIconMonth",&mShowIconMonth,true);
78 addItemBool("ShowIconTodoview",&mShowIconTodoview,true); 78 addItemBool("ShowIconTodoview",&mShowIconTodoview,true);
79 addItemBool("ShowIconBackFast",&mShowIconBackFast,true); 79 addItemBool("ShowIconBackFast",&mShowIconBackFast,true);
80 addItemBool("ShowIconBack",&mShowIconBack,true); 80 addItemBool("ShowIconBack",&mShowIconBack,true);
81 addItemBool("ShowIconToday",&mShowIconToday,true); 81 addItemBool("ShowIconToday",&mShowIconToday,true);
82 addItemBool("ShowIconForward",&mShowIconForward,true); 82 addItemBool("ShowIconForward",&mShowIconForward,true);
83 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); 83 addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true);
84 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); 84 addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true);
85 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); 85 addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true);
86 addItemBool("ShowIconNextDays",&mShowIconNextDays,true); 86 addItemBool("ShowIconNextDays",&mShowIconNextDays,true);
87 addItemBool("ShowIconNext",&mShowIconNext,true); 87 addItemBool("ShowIconNext",&mShowIconNext,true);
88 addItemBool("ShowIconJournal",&mShowIconJournal,true); 88 addItemBool("ShowIconJournal",&mShowIconJournal,true);
89 addItemBool("ShowIconStretch",&mShowIconStretch,true); 89 addItemBool("ShowIconStretch",&mShowIconStretch,true);
90 addItemBool("ShowIconFilter",&mShowIconFilter,false); 90 addItemBool("ShowIconFilter",&mShowIconFilter,false);
91 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true); 91 addItemBool("ShowIconOnetoolbar",&mShowIconOnetoolbar,true);
92 92
93 bool addIcons = false; 93 bool addIcons = false;
94#ifdef DESKTOP_VERSION 94#ifdef DESKTOP_VERSION
95 addIcons = true; 95 addIcons = true;
96#endif 96#endif
97 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons); 97 addItemBool("ShowIconNavigator",&mShowIconNavigator,addIcons);
98 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons); 98 addItemBool("ShowIconAllday",&mShowIconAllday,addIcons);
99 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons); 99 addItemBool("ShowIconFilterview",&mShowIconFilterview,addIcons);
100 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons); 100 addItemBool("ShowIconToggleFull",&mShowIconToggleFull,addIcons);
101 101
102 addItemInt("LastLoadedLanguage",&mOldLanguage,0); 102 addItemInt("LastLoadedLanguage",&mOldLanguage,0);
103 103
104 addItemBool("AskForQuit",&mAskForQuit,false); 104 addItemBool("AskForQuit",&mAskForQuit,false);
105 105
106#ifndef DESKTOP_VERSION 106#ifndef DESKTOP_VERSION
107 addItemBool("ShowFullMenu",&mShowFullMenu,false); 107 addItemBool("ShowFullMenu",&mShowFullMenu,false);
108#else 108#else
109 addItemBool("ShowFullMenu",&mShowFullMenu,true); 109 addItemBool("ShowFullMenu",&mShowFullMenu,true);
110#endif 110#endif
111 addItemBool("ToolBarHor",&mToolBarHor, true ); 111 addItemBool("ToolBarHor",&mToolBarHor, true );
112 addItemBool("ToolBarUp",&mToolBarUp, false ); 112 addItemBool("ToolBarUp",&mToolBarUp, false );
113 addItemBool("ToolBarHorV",&mToolBarHorV, true ); 113 addItemBool("ToolBarHorV",&mToolBarHorV, true );
114 addItemBool("ToolBarUpV",&mToolBarUpV, false ); 114 addItemBool("ToolBarUpV",&mToolBarUpV, false );
115 addItemBool("ToolBarHorN",&mToolBarHorN, true ); 115 addItemBool("ToolBarHorN",&mToolBarHorN, true );
116 addItemBool("ToolBarUpN",&mToolBarUpN, false ); 116 addItemBool("ToolBarUpN",&mToolBarUpN, false );
117 addItemBool("ToolBarHorF",&mToolBarHorF, true ); 117 addItemBool("ToolBarHorF",&mToolBarHorF, true );
118 addItemBool("ToolBarUpF",&mToolBarUpF, false ); 118 addItemBool("ToolBarUpF",&mToolBarUpF, false );
119 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false ); 119 addItemBool("ToolBarMiniIcons",&mToolBarMiniIcons, false );
120 addItemBool("WhatsNextTime2Lines",&mWhatsNextTime2Lines, false ); 120 addItemBool("WhatsNextTime2Lines",&mWhatsNextTime2Lines, false );
121 addItemInt("Whats Next Days",&mWhatsNextDays,3); 121 addItemInt("Whats Next Days",&mWhatsNextDays,3);
122 addItemInt("Whats Next Prios",&mWhatsNextPrios,1); 122 addItemInt("Whats Next Prios",&mWhatsNextPrios,1);
123 123
124 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true); 124 addItemBool("ShowTodoInAgenda",&mShowTodoInAgenda,true);
125 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true); 125 addItemBool("ShowCompletedTodoInAgenda",&mShowCompletedTodoInAgenda,true);
126 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true); 126 addItemBool("ShowTimeInAgenda",&mShowTimeInAgenda,true);
127 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false); 127 addItemBool("HideNonStartedTodos",&mHideNonStartedTodos,false);
128 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true); 128 addItemBool("ShowCompletedTodo",&mShowCompletedTodo,true);
129 addItemInt("AllDay Size",&mAllDaySize,28); 129 addItemInt("AllDay Size",&mAllDaySize,28);
130 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav"; 130 QString defAlarm = KGlobal::iconLoader()->iconPath()+"koalarm.wav";
131 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm ); 131 addItemString("DefaultAlarmFile",&mDefaultAlarmFile,defAlarm );
132 132
133 addItemStringList("LocationDefaults",&mLocationDefaults ); 133 addItemStringList("LocationDefaults",&mLocationDefaults );
134 addItemStringList("EventSummary User",&mEventSummaryUser); 134 addItemStringList("EventSummary User",&mEventSummaryUser);
135 addItemStringList("TodoSummary User",&mTodoSummaryUser); 135 addItemStringList("TodoSummary User",&mTodoSummaryUser);
136 addItemStringList("JournalSummary User",&mJournalSummaryUser); 136 addItemStringList("JournalSummary User",&mJournalSummaryUser);
137 137
138 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false); 138 addItemBool("Enable Group Scheduling",&mEnableGroupScheduling,false);
139 addItemBool("Enable Project View",&mEnableProjectView,false); 139 addItemBool("Enable Project View",&mEnableProjectView,false);
140 addItemBool("Auto Save",&mAutoSave,false); 140 addItemBool("Auto Save",&mAutoSave,false);
141 addItemInt("Auto Save Interval",&mAutoSaveInterval,3); 141 addItemInt("Auto Save Interval",&mAutoSaveInterval,3);
142 addItemBool("Confirm Deletes",&mConfirm,true); 142 addItemBool("Confirm Deletes",&mConfirm,true);
143 addItemString("Archive File",&mArchiveFile); 143 addItemString("Archive File",&mArchiveFile);
144 addItemString("Html Export File",&mHtmlExportFile, 144 addItemString("Html Export File",&mHtmlExportFile,
145 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html")); 145 QDir::homeDirPath() + "/" + i18n("Default export file", "calendar.html"));
146 addItemBool("Html With Save",&mHtmlWithSave,false); 146 addItemBool("Html With Save",&mHtmlWithSave,false);
147 147
148 KPrefs::setCurrentGroup("Personal Settings"); 148 KPrefs::setCurrentGroup("Personal Settings");
149 149
150 addItemInt("Mail Client",&mMailClient,MailClientKMail); 150 addItemInt("Mail Client",&mMailClient,MailClientKMail);
151 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 151 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
152 addItemBool("Bcc",&mBcc,false); 152 addItemBool("Bcc",&mBcc,false);
153 153
154 KPrefs::setCurrentGroup("Time & Date"); 154 KPrefs::setCurrentGroup("Time & Date");
155 155
156 156
157 addItemInt("Default Start Time",&mStartTime,10); 157 addItemInt("Default Start Time",&mStartTime,10);
158 addItemInt("Default Duration",&mDefaultDuration,2); 158 addItemInt("Default Duration",&mDefaultDuration,2);
159 addItemInt("Default Alarm Time",&mAlarmTime,3); 159 addItemInt("Default Alarm Time",&mAlarmTime,3);
160 KPrefs::setCurrentGroup("AlarmSettings"); 160 KPrefs::setCurrentGroup("AlarmSettings");
161 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 161 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
162 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 162 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
163 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 163 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
164 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 164 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
165 165
166 166
167 KPrefs::setCurrentGroup("Calendar"); 167 KPrefs::setCurrentGroup("Calendar");
168 168
169 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 169 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
170 170
171 KPrefs::setCurrentGroup("Fonts"); 171 KPrefs::setCurrentGroup("Fonts");
172 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 172 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
173 QFont fon = KGlobalSettings::generalFont(); 173 QFont fon = KGlobalSettings::generalFont();
174 addItemFont("TimeBar Font",&mTimeBarFont,fon ); 174 addItemFont("TimeBar Font",&mTimeBarFont,fon );
175 addItemFont("MonthView Font",&mMonthViewFont,fon); 175 addItemFont("MonthView Font",&mMonthViewFont,fon);
176 addItemFont("AgendaView Font",&mAgendaViewFont,fon); 176 addItemFont("AgendaView Font",&mAgendaViewFont,fon);
177 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon); 177 addItemFont("MarcusBains Font",&mMarcusBainsFont,fon);
178 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon); 178 addItemFont("TimeLabels Font",&mTimeLabelsFont,fon);
179 addItemFont("TodoView Font",&mTodoViewFont,fon); 179 addItemFont("TodoView Font",&mTodoViewFont,fon);
180 addItemFont("ListView Font",&mListViewFont,fon); 180 addItemFont("ListView Font",&mListViewFont,fon);
181 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon); 181 addItemFont("DateNavigator Font",&mDateNavigatorFont,fon);
182 addItemFont("EditBox Font",&mEditBoxFont,fon); 182 addItemFont("EditBox Font",&mEditBoxFont,fon);
183 addItemFont("JournalView Font",&mJornalViewFont,fon); 183 addItemFont("JournalView Font",&mJornalViewFont,fon);
184 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon); 184 addItemFont("WhatsNextView Font",&mWhatsNextFont,fon);
185 addItemFont("EventView Font",&mEventViewFont,fon); 185 addItemFont("EventView Font",&mEventViewFont,fon);
186 186
187 KPrefs::setCurrentGroup("RemoteSyncing"); 187 KPrefs::setCurrentGroup("RemoteSyncing");
188 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 188 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
189 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 189 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
190 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 190 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
191 addItemInt("LastSyncTime",&mLastSyncTime,0); 191 addItemInt("LastSyncTime",&mLastSyncTime,0);
192 192
193#ifdef _WIN32_ 193#ifdef _WIN32_
194 QString hdp= locateLocal("data","korganizer")+"\\\\"; 194 QString hdp= locateLocal("data","korganizer")+"\\\\";
195#else 195#else
196 QString hdp= locateLocal("data","korganizer")+"/"; 196 QString hdp= locateLocal("data","korganizer")+"/";
197#endif 197#endif
198 198
199 KPrefs::setCurrentGroup("LoadSaveFileNames"); 199 KPrefs::setCurrentGroup("LoadSaveFileNames");
200 200
201 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 201 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
202 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 202 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
203 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 203 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
204 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 204 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
205 205
206 206
207 KPrefs::setCurrentGroup("Locale"); 207 KPrefs::setCurrentGroup("Locale");
208 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 208 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
209 209
210 210
211 KPrefs::setCurrentGroup("Colors"); 211 KPrefs::setCurrentGroup("Colors");
212 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 212 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
213 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 213 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
214 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 214 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
215 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) ); 215 addItemColor("Todo done Color",&mTodoDoneColor,QColor(111,255,115) );
216 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 216 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
217 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 217 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
218 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 218 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
219 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 219 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
220 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor); 220 addItemColor("Todo running Color",&mTodoRunColor,defaultTodoRunColor);
221 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 221 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
222 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 222 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
223 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 223 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
224 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 224 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
225 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 225 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
226 addItemBool("MonthViewWeek",&mMonthViewWeek,false); 226 addItemBool("MonthViewWeek",&mMonthViewWeek,false);
227 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 227 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
228 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 228 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
229 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 229 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
230 addItemBool("UseAppColors",&mUseAppColors,false); 230 addItemBool("UseAppColors",&mUseAppColors,false);
231 231
232 232
233 233 KPrefs::setCurrentGroup("Conflicts");
234 addItemBool("EnableAutoDetect",&mDetectConflicts,true);
235 addItemBool("CheckConflictsAllDayAllDay",&mCheckConflictsAllDayAllDay,false);
236 addItemBool("CheckConflictsAllDayNonAD",&mCheckConflictsAllDayNonAD,false);
237 addItemBool("CheckConflictsNonADAllDay",&mCheckConflictsNonADAllDay,false);
238 addItemBool("CheckConflictsNonADNonAD",&mCheckConflictsNonADNonAD,true);
239 addItemString("FilterConflictEditItem", &mFilterConflictEditItem ,"nofilter" );
240 addItemString("FilterConflictAllItem", &mFilterConflictAllItem ,"nofilter" );
241
234 KPrefs::setCurrentGroup("Views"); 242 KPrefs::setCurrentGroup("Views");
235 addItemBool("Block Popup Menu",&mBlockPopupMenu,false); 243 addItemBool("Block Popup Menu",&mBlockPopupMenu,false);
236 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 244 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
237 addItemInt("Hour Size",&mHourSize,8); 245 addItemInt("Hour Size",&mHourSize,8);
238 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 246 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
239 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 247 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
240 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 248 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
241 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 249 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
242 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 250 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
243 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 251 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
244 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true); 252 addItemBool("ShowTimesInMonthCell",&mMonthShowTimes,true);
245#ifdef DESKTOP_VERION 253#ifdef DESKTOP_VERION
246 addItemBool("Enable ToolTips",&mEnableToolTips,true); 254 addItemBool("Enable ToolTips",&mEnableToolTips,true);
247#else 255#else
248 addItemBool("Enable ToolTips",&mEnableToolTips,false); 256 addItemBool("Enable ToolTips",&mEnableToolTips,false);
249#endif 257#endif
250 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 258 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
251 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 259 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
252 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 260 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
253 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 261 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
254 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 262 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
255 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false); 263 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
256 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 264 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
257 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 265 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
258 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 266 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
259 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 267 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
260 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 268 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
261 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 269 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
262 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 270 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
263 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 271 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
264 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 272 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
265 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 273 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
266 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true); 274 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,true);
267 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true); 275 addItemBool("MonthViewUsesBigFont",&mMonthViewUsesBigFont,true);
268 addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false); 276 addItemBool("MonthViewWeekRowlayout",&mMonthViewWeekRowlayout,false);
269 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 277 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
270 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 278 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
271#ifdef DESKTOP_VERSION 279#ifdef DESKTOP_VERSION
272 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 280 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
273#else 281#else
274 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 282 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
275#endif 283#endif
276 addItemInt("Day Begins",&mDayBegins,7); 284 addItemInt("Day Begins",&mDayBegins,7);
277 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 285 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
278 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 286 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
279 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 287 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
280 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 288 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
281 289
282 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 290 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
283 addItemBool("Full View Month",&mFullViewMonth,true); 291 addItemBool("Full View Month",&mFullViewMonth,true);
284 addItemBool("Full View Todo",&mFullViewTodo,true); 292 addItemBool("Full View Todo",&mFullViewTodo,true);
285 addItemBool("Quick Todo",&mEnableQuickTodo,false); 293 addItemBool("Quick Todo",&mEnableQuickTodo,false);
286 294
287 addItemInt("Next X Days",&mNextXDays,3); 295 addItemInt("Next X Days",&mNextXDays,3);
288 296
289 KPrefs::setCurrentGroup("Printer"); 297 KPrefs::setCurrentGroup("Printer");
290 298
291 KPrefs::setCurrentGroup("Layout"); 299 KPrefs::setCurrentGroup("Layout");
292 300
293 addItemBool("CompactDialogs",&mCompactDialogs,false); 301 addItemBool("CompactDialogs",&mCompactDialogs,false);
294 addItemBool("VerticalScreen",&mVerticalScreen,true); 302 addItemBool("VerticalScreen",&mVerticalScreen,true);
295 303
296 KPrefs::setCurrentGroup("KOrganizer Plugins"); 304 KPrefs::setCurrentGroup("KOrganizer Plugins");
297 305
298 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 306 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
299 307
300 KPrefs::setCurrentGroup("Group Scheduling"); 308 KPrefs::setCurrentGroup("Group Scheduling");
301 309
302 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 310 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
303 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 311 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
304 addItemStringList("AdditionalMails",&mAdditionalMails,""); 312 addItemStringList("AdditionalMails",&mAdditionalMails,"");
305 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 313 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
306 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 314 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
307 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 315 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
308 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 316 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
309 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 317 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
310 318
311 KPrefs::setCurrentGroup( "Editors" ); 319 KPrefs::setCurrentGroup( "Editors" );
312 320
313 addItemStringList( "EventTemplates", &mEventTemplates ); 321 addItemStringList( "EventTemplates", &mEventTemplates );
314 addItemStringList( "TodoTemplates", &mTodoTemplates ); 322 addItemStringList( "TodoTemplates", &mTodoTemplates );
315 323
316 addItemInt("DestinationPolicy",&mDestination,standardDestination); 324 addItemInt("DestinationPolicy",&mDestination,standardDestination);
317 325
318 KPrefs::setCurrentGroup( "ViewOptions" ); 326 KPrefs::setCurrentGroup( "ViewOptions" );
319 addItemBool("EVshowDetails",&mEVshowDetails,true); 327 addItemBool("EVshowDetails",&mEVshowDetails,true);
320 addItemBool("EVshowCreated",&mEVshowCreated,true); 328 addItemBool("EVshowCreated",&mEVshowCreated,true);
321 addItemBool("EVshowChanged",&mEVshowChanged,true); 329 addItemBool("EVshowChanged",&mEVshowChanged,true);
322 addItemBool("WTshowDetails",&mWTshowDetails,false); 330 addItemBool("WTshowDetails",&mWTshowDetails,false);
323 addItemBool("WTshowCreated",&mWTshowCreated,false); 331 addItemBool("WTshowCreated",&mWTshowCreated,false);
324 addItemBool("WTshowChanged",&mWTshowChanged,false); 332 addItemBool("WTshowChanged",&mWTshowChanged,false);
325 mCalendars.setAutoDelete( true ); 333 mCalendars.setAutoDelete( true );
326} 334}
327 335
328 336
329KOPrefs::~KOPrefs() 337KOPrefs::~KOPrefs()
330{ 338{
331 if (mInstance == this) 339 if (mInstance == this)
332 mInstance = insd.setObject(0); 340 mInstance = insd.setObject(0);
333 mCalendars.setAutoDelete( true ); 341 mCalendars.setAutoDelete( true );
334 mCalendars.clear(); 342 mCalendars.clear();
335 //qDebug("KOPrefs::~KOPrefs() "); 343 //qDebug("KOPrefs::~KOPrefs() ");
336} 344}
337 345
338 346
339KOPrefs *KOPrefs::instance() 347KOPrefs *KOPrefs::instance()
340{ 348{
341 if (!mInstance) { 349 if (!mInstance) {
342 mInstance = insd.setObject(new KOPrefs()); 350 mInstance = insd.setObject(new KOPrefs());
343 mInstance->readConfig(); 351 mInstance->readConfig();
344 } 352 }
345 353
346 return mInstance; 354 return mInstance;
347} 355}
348 356
349void KOPrefs::usrSetDefaults() 357void KOPrefs::usrSetDefaults()
350{ 358{
351 359
352} 360}
353 361
354void KOPrefs::fillMailDefaults() 362void KOPrefs::fillMailDefaults()
355{ 363{
356 if (mName.isEmpty()) mName = i18n("Anonymous"); 364 if (mName.isEmpty()) mName = i18n("Anonymous");
357 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 365 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
358} 366}
359 367
360void KOPrefs::setTimeZoneIdDefault() 368void KOPrefs::setTimeZoneIdDefault()
361{ 369{
362 ; 370 ;
363} 371}
364 372
365void KOPrefs::setAllDefaults() 373void KOPrefs::setAllDefaults()
366{ 374{
367 setCategoryDefaults(); 375 setCategoryDefaults();
368 mEventSummaryUser = getDefaultList() ; 376 mEventSummaryUser = getDefaultList() ;
369 mTodoSummaryUser = getDefaultList() ; 377 mTodoSummaryUser = getDefaultList() ;
370 mJournalSummaryUser = getDefaultList() ; 378 mJournalSummaryUser = getDefaultList() ;
371 mLocationDefaults = getLocationDefaultList(); 379 mLocationDefaults = getLocationDefaultList();
372} 380}
373 381
374void KOPrefs::setCategoryDefaults() 382void KOPrefs::setCategoryDefaults()
375{ 383{
376 mCustomCategories.clear(); 384 mCustomCategories.clear();
377 mCustomCategories = getDefaultList(); 385 mCustomCategories = getDefaultList();
378 386
379 QStringList::Iterator it; 387 QStringList::Iterator it;
380 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 388 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
381 setCategoryColor(*it,mDefaultCategoryColor); 389 setCategoryColor(*it,mDefaultCategoryColor);
382 } 390 }
383} 391}
384QStringList KOPrefs::getLocationDefaultList() 392QStringList KOPrefs::getLocationDefaultList()
385{ 393{
386 QStringList retval ; 394 QStringList retval ;
387 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach") 395 retval << i18n("Home") << i18n("Office") << i18n("Library") << i18n("School") << i18n("Doctor") << i18n("Beach")
388 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room") 396 << i18n("University") << i18n("Restaurant") << i18n("Bar") << i18n("Conference room")
389 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten") 397 << i18n("Cinema") << i18n("Lake") << i18n("Kindergarten")
390 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ; 398 << i18n("Germany") << i18n("Sweden") << i18n("Forest") << i18n("Desert") << i18n("Kitchen") ;
391 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") 399 // << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("") << i18n("")
392 400
393 retval.sort(); 401 retval.sort();
394 return retval; 402 return retval;
395} 403}
396QStringList KOPrefs::getDefaultList() 404QStringList KOPrefs::getDefaultList()
397{ 405{
398 QStringList retval ; 406 QStringList retval ;
399 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer") 407 retval << i18n("Anniversary") << i18n("Appointment") << i18n("Birthday") << i18n("Business") << i18n("Customer")
400 << i18n("Break") 408 << i18n("Break")
401 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts") 409 << i18n("Family") << i18n("Favorites") << i18n("Fishing") << i18n("Gifts")
402 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts") 410 << i18n("Holiday") << i18n("Holiday Cards")<< i18n("Hot Contacts")
403 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal") 411 << i18n("Meeting") << i18n("Miscellaneous") << i18n("Partner") << i18n("Personal")
404 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping") 412 << i18n("PHB") << i18n("Phone Calls") << i18n("Shopping")
405 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV") 413 << i18n("Sports") << i18n("Talk") << i18n("Travel") << i18n("TV")
406 << i18n("Vacation") ; 414 << i18n("Vacation") ;
407 retval.sort(); 415 retval.sort();
408 //qDebug("cat %s ", retval.join("-").latin1()); 416 //qDebug("cat %s ", retval.join("-").latin1());
409 return retval; 417 return retval;
410} 418}
411// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema") 419// << i18n("Business Travel") << i18n("Education") << i18n("Hiking") << i18n("Hunting") << i18n("Recurring") << i18n("Personal Travel") << i18n("Speach") << i18n("Festival") << i18n("Competition")<< i18n("Party")<< i18n("Projects")<< i18n("Kids") << i18n("Special Occasion")<< i18n("Breakfast")<< i18n("Dinner") << i18n("Lunch")<< i18n("University")<< i18n("School")<< i18n("Flight")<< i18n("Key Customer") << i18n("VIP") << i18n("SyncEvent") << i18n("Cinema")
412void KOPrefs::usrReadConfig() 420void KOPrefs::usrReadConfig()
413{ 421{
414 config()->setGroup("General"); 422 config()->setGroup("General");
415 423
416 //qDebug("KOPrefs::usrReadConfig() "); 424 //qDebug("KOPrefs::usrReadConfig() ");
417 mCustomCategories = config()->readListEntry("Custom Categories"); 425 mCustomCategories = config()->readListEntry("Custom Categories");
418 mOldLoadedLanguage = mOldLanguage ; 426 mOldLoadedLanguage = mOldLanguage ;
419 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage; 427 mOldLanguage = KPimGlobalPrefs::instance()->mPreferredLanguage;
420 if (mLocationDefaults.isEmpty()) { 428 if (mLocationDefaults.isEmpty()) {
421 mLocationDefaults = getLocationDefaultList(); 429 mLocationDefaults = getLocationDefaultList();
422 } 430 }
423 431
424 if (mEventSummaryUser.isEmpty()) { 432 if (mEventSummaryUser.isEmpty()) {
425 mEventSummaryUser = getDefaultList() ; 433 mEventSummaryUser = getDefaultList() ;
426 } 434 }
427 if (mTodoSummaryUser.isEmpty()) { 435 if (mTodoSummaryUser.isEmpty()) {
428 mTodoSummaryUser = getDefaultList() ; 436 mTodoSummaryUser = getDefaultList() ;
429 } 437 }
430 438
431 if (mCustomCategories.isEmpty()) setCategoryDefaults(); 439 if (mCustomCategories.isEmpty()) setCategoryDefaults();
432 440
433 config()->setGroup("Personal Settings"); 441 config()->setGroup("Personal Settings");
434 mName = config()->readEntry("user_name",""); 442 mName = config()->readEntry("user_name","");
435 mEmail = config()->readEntry("user_email",""); 443 mEmail = config()->readEntry("user_email","");
436 fillMailDefaults(); 444 fillMailDefaults();
437 445
438 config()->setGroup("Category Colors"); 446 config()->setGroup("Category Colors");
439 QStringList::Iterator it; 447 QStringList::Iterator it;
440 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) { 448 for (it = mCustomCategories.begin();it != mCustomCategories.end();++it ) {
441 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor)); 449 setCategoryColor(*it,config()->readColorEntry(*it,&mDefaultCategoryColor));
442 450
443 } 451 }
444 KConfig fc (locateLocal("config","kopicalendarrc")); 452 KConfig fc (locateLocal("config","kopicalendarrc"));
445 fc.setGroup("CC"); 453 fc.setGroup("CC");
446 int numCals = fc.readNumEntry("NumberCalendars",0 ); 454 int numCals = fc.readNumEntry("NumberCalendars",0 );
447 mNextAvailableCalendar = 1; 455 mNextAvailableCalendar = 1;
448 if ( numCals == 0 ) { 456 if ( numCals == 0 ) {
449 KopiCalendarFile *kkf = getNewCalendar(); 457 KopiCalendarFile *kkf = getNewCalendar();
450 kkf->isStandard = true; 458 kkf->isStandard = true;
451 kkf->mName = i18n("Standard"); 459 kkf->mName = i18n("Standard");
452 kkf->mFileName = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) ); 460 kkf->mFileName = QDir::convertSeparators( locateLocal( "data", "korganizer/mycalendar.ics" ) );
453 } 461 }
454 while ( mNextAvailableCalendar <= numCals ) { 462 while ( mNextAvailableCalendar <= numCals ) {
455 //qDebug("Read cal #%d ", mNextAvailableCalendar ); 463 //qDebug("Read cal #%d ", mNextAvailableCalendar );
456 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar ); 464 QString prefix = "Cal_" +QString::number( mNextAvailableCalendar );
457 KopiCalendarFile *kkf = getNewCalendar(); 465 KopiCalendarFile *kkf = getNewCalendar();
458 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false ); 466 kkf->isStandard = fc.readBoolEntry( prefix+"_isStandard", false );
459 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true); 467 kkf->isEnabled = fc.readBoolEntry( prefix+"_isEnabled", true);
460 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false ); 468 kkf->isRelative = fc.readBoolEntry( prefix+"_isRelative", false );
461 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true); 469 kkf->isAlarmEnabled = fc.readBoolEntry( prefix+"_isAlarmEnabled", true);
462 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false); 470 kkf->isReadOnly = fc.readBoolEntry( prefix+"_isReadOnly", false);
463 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar"); 471 kkf->mName = fc.readEntry( prefix+"_Name", "Calendar");
464 kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) ); 472 kkf->mFileName = QDir::convertSeparators( fc.readEntry( prefix+"_FileName", kkf->mFileName) );
465 kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) ); 473 kkf->mSavedFileName = QDir::convertSeparators( fc.readEntry( prefix+"_SavedFileName", kkf->mFileName) );
466 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor); 474 kkf->mDefaultColor = fc.readColorEntry( prefix+"_Color",&mEventColor);
467 if ( kkf->mCalNumber == 1 ) { 475 if ( kkf->mCalNumber == 1 ) {
468 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" ); 476 kkf->mFileName = locateLocal( "data", "korganizer/mycalendar.ics" );
469 } 477 }
470 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() ); 478 //qDebug("NAME %s %s", kkf->mName.latin1(), i18n("Birthdays").latin1() );
471 if ( kkf->mName == i18n("Birthdays") ) { 479 if ( kkf->mName == i18n("Birthdays") ) {
472 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" ); 480 kkf->mFileName = locateLocal( "data", "korganizer/birthdays.ics" );
473 } 481 }
474 if ( kkf->isRelative ) 482 if ( kkf->isRelative )
475 kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName ); 483 kkf->mFileName = QDir::convertSeparators( KGlobalSettings::calendarDir() + kkf->mSavedFileName );
476 } 484 }
477 485
478 KPimPrefs::usrReadConfig(); 486 KPimPrefs::usrReadConfig();
479} 487}
480 488
481KopiCalendarFile * KOPrefs::getCalendar( int num ) 489KopiCalendarFile * KOPrefs::getCalendar( int num )
482{ 490{
483 return mDefCalColors[num-1]; 491 return mDefCalColors[num-1];
484} 492}
485 493
486KopiCalendarFile * KOPrefs::getNewCalendar() 494KopiCalendarFile * KOPrefs::getNewCalendar()
487{ 495{
488 KopiCalendarFile * kkf = new KopiCalendarFile(); 496 KopiCalendarFile * kkf = new KopiCalendarFile();
489 kkf->mCalNumber = mNextAvailableCalendar; 497 kkf->mCalNumber = mNextAvailableCalendar;
490 mDefCalColors.resize( mNextAvailableCalendar ); 498 mDefCalColors.resize( mNextAvailableCalendar );
491 mDefCalColors[mNextAvailableCalendar-1] = kkf; 499 mDefCalColors[mNextAvailableCalendar-1] = kkf;
492 ++mNextAvailableCalendar; 500 ++mNextAvailableCalendar;
493 kkf->mDefaultColor = mEventColor; 501 kkf->mDefaultColor = mEventColor;
494 kkf->mName = i18n("New Calendar"); 502 kkf->mName = i18n("New Calendar");
495 mCalendars.append( kkf ); 503 mCalendars.append( kkf );
496 return kkf; 504 return kkf;
497} 505}
498void KOPrefs::deleteCalendar( int num ) 506void KOPrefs::deleteCalendar( int num )
499{ 507{
500 KopiCalendarFile * kkf = mCalendars.first(); 508 KopiCalendarFile * kkf = mCalendars.first();
501 while ( kkf ) { 509 while ( kkf ) {
502 if ( kkf->mCalNumber == num ) { 510 if ( kkf->mCalNumber == num ) {
503 qDebug("KOPrefs::deleteCalendar %d ", num ); 511 qDebug("KOPrefs::deleteCalendar %d ", num );
504 mCalendars.remove( kkf ); 512 mCalendars.remove( kkf );
505 delete kkf; 513 delete kkf;
506 return; 514 return;
507 } 515 }
508 kkf = mCalendars.next(); 516 kkf = mCalendars.next();
509 } 517 }
510} 518}
511int KOPrefs::getCalendarID( const QString & name ) 519int KOPrefs::getCalendarID( const QString & name )
512{ 520{
513 KopiCalendarFile * kkf = mCalendars.first(); 521 KopiCalendarFile * kkf = mCalendars.first();
514 while ( kkf ) { 522 while ( kkf ) {
515 if ( name == kkf->mName) 523 if ( name == kkf->mName)
516 return kkf->mCalNumber; 524 return kkf->mCalNumber;
517 kkf = mCalendars.next(); 525 kkf = mCalendars.next();
518 } 526 }
519 return 1; 527 return 1;
520} 528}
521QString KOPrefs::calName( int calNum) const 529QString KOPrefs::calName( int calNum) const
522{ 530{
523 return (mDefCalColors[calNum-1])->mName; 531 return (mDefCalColors[calNum-1])->mName;
524} 532}
525QColor KOPrefs::defaultColor( int calNum ) const 533QColor KOPrefs::defaultColor( int calNum ) const
526{ 534{
527 if ( calNum == 1 ) return mEventColor; 535 if ( calNum == 1 ) return mEventColor;
528 return (mDefCalColors[calNum-1])->mDefaultColor; 536 return (mDefCalColors[calNum-1])->mDefaultColor;
529} 537}
530void KOPrefs::usrWriteConfig() 538void KOPrefs::usrWriteConfig()
531{ 539{
532 config()->setGroup("General"); 540 config()->setGroup("General");
533 config()->writeEntry("Custom Categories",mCustomCategories); 541 config()->writeEntry("Custom Categories",mCustomCategories);
534 542
535 config()->setGroup("Personal Settings"); 543 config()->setGroup("Personal Settings");
536 config()->writeEntry("user_name",mName); 544 config()->writeEntry("user_name",mName);
537 config()->writeEntry("user_email",mEmail); 545 config()->writeEntry("user_email",mEmail);
538 546
539 config()->setGroup("Category Colors"); 547 config()->setGroup("Category Colors");
540 QDictIterator<QColor> it(mCategoryColors); 548 QDictIterator<QColor> it(mCategoryColors);
541 while (it.current()) { 549 while (it.current()) {
542 config()->writeEntry(it.currentKey(),*(it.current())); 550 config()->writeEntry(it.currentKey(),*(it.current()));
543 ++it; 551 ++it;
544 } 552 }
545 KConfig fc (locateLocal("config","kopicalendarrc")); 553 KConfig fc (locateLocal("config","kopicalendarrc"));
546 fc.setGroup("CC"); 554 fc.setGroup("CC");
547 fc.deleteGroup( "CC"); 555 fc.deleteGroup( "CC");
548 fc.setGroup("CC"); 556 fc.setGroup("CC");
549 fc.writeEntry("NumberCalendars",mCalendars.count()); 557 fc.writeEntry("NumberCalendars",mCalendars.count());
550 int numCal = 1; 558 int numCal = 1;
551 int writeCal = 0; 559 int writeCal = 0;
552 while ( numCal < mNextAvailableCalendar ) { 560 while ( numCal < mNextAvailableCalendar ) {
553 KopiCalendarFile * kkf = mCalendars.first(); 561 KopiCalendarFile * kkf = mCalendars.first();
554 while ( kkf ) { 562 while ( kkf ) {
555 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal); 563 //qDebug("cal num %d %d ", kkf->mCalNumber, numCal);
556 if ( kkf->mCalNumber == numCal ) { 564 if ( kkf->mCalNumber == numCal ) {
557 ++writeCal; 565 ++writeCal;
558 //qDebug("Write calendar %d %d ", numCal , writeCal); 566 //qDebug("Write calendar %d %d ", numCal , writeCal);
559 QString prefix = "Cal_" + QString::number( writeCal ); 567 QString prefix = "Cal_" + QString::number( writeCal );
560 fc.writeEntry( prefix+"_isStandard", kkf->isStandard ); 568 fc.writeEntry( prefix+"_isStandard", kkf->isStandard );
561 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled ); 569 fc.writeEntry( prefix+"_isEnabled", kkf->isEnabled );
562 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled ); 570 fc.writeEntry( prefix+"_isAlarmEnabled", kkf->isAlarmEnabled );
563 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly ); 571 fc.writeEntry( prefix+"_isReadOnly", kkf->isReadOnly );
564 fc.writeEntry( prefix+"_isRelative", kkf->isRelative ); 572 fc.writeEntry( prefix+"_isRelative", kkf->isRelative );
565 fc.writeEntry( prefix+"_Name", kkf->mName); 573 fc.writeEntry( prefix+"_Name", kkf->mName);
566 fc.writeEntry( prefix+"_FileName", kkf->mFileName); 574 fc.writeEntry( prefix+"_FileName", kkf->mFileName);
567 fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName); 575 fc.writeEntry( prefix+"_SavedFileName", kkf->mSavedFileName);
568 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor); 576 fc.writeEntry( prefix+"_Color",kkf->mDefaultColor);
569 } 577 }
570 kkf = mCalendars.next(); 578 kkf = mCalendars.next();
571 } 579 }
572 ++numCal; 580 ++numCal;
573 } 581 }
574 fc.sync(); 582 fc.sync();
575 KPimPrefs::usrWriteConfig(); 583 KPimPrefs::usrWriteConfig();
576} 584}
577 585
578void KOPrefs::setCategoryColor(QString cat,const QColor & color) 586void KOPrefs::setCategoryColor(QString cat,const QColor & color)
579{ 587{
580 mCategoryColors.replace(cat,new QColor(color)); 588 mCategoryColors.replace(cat,new QColor(color));
581} 589}
582 590
583QColor *KOPrefs::categoryColor(QString cat) 591QColor *KOPrefs::categoryColor(QString cat)
584{ 592{
585 QColor *color = 0; 593 QColor *color = 0;
586 594
587 if (!cat.isEmpty()) color = mCategoryColors[cat]; 595 if (!cat.isEmpty()) color = mCategoryColors[cat];
588 596
589 if (color) return color; 597 if (color) return color;
590 else return &mDefaultCategoryColor; 598 else return &mDefaultCategoryColor;
591} 599}
592 600
593void KOPrefs::setFullName(const QString &name) 601void KOPrefs::setFullName(const QString &name)
594{ 602{
595 mName = name; 603 mName = name;
596} 604}
597 605
598void KOPrefs::setEmail(const QString &email) 606void KOPrefs::setEmail(const QString &email)
599{ 607{
600 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() ); 608 //qDebug(" KOPrefs::setEmai*********** %s",email.latin1() );
601 mEmail = email; 609 mEmail = email;
602} 610}
603 611
604QString KOPrefs::fullName() 612QString KOPrefs::fullName()
605{ 613{
606 if (mEmailControlCenter) { 614 if (mEmailControlCenter) {
607 KEMailSettings settings; 615 KEMailSettings settings;
608 return settings.getSetting(KEMailSettings::RealName); 616 return settings.getSetting(KEMailSettings::RealName);
609 } else { 617 } else {
610 return mName; 618 return mName;
611 } 619 }
612} 620}
613 621
614QString KOPrefs::email() 622QString KOPrefs::email()
615{ 623{
616 if (mEmailControlCenter) { 624 if (mEmailControlCenter) {
617 KEMailSettings settings; 625 KEMailSettings settings;
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 9749ba3..576edf9 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -1,365 +1,374 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOPREFS_H 23#ifndef KOPREFS_H
24#define KOPREFS_H 24#define KOPREFS_H
25 25
26 26
27#include <libkdepim/kpimprefs.h> 27#include <libkdepim/kpimprefs.h>
28#include <qdict.h> 28#include <qdict.h>
29#include <qdir.h> 29#include <qdir.h>
30#include <qobject.h> 30#include <qobject.h>
31 31
32class KConfig; 32class KConfig;
33class QFont; 33class QFont;
34class QColor; 34class QColor;
35class QStringList; 35class QStringList;
36 36
37#define VIEW_WN_VIEW 1 37#define VIEW_WN_VIEW 1
38#define VIEW_NX_VIEW 2 38#define VIEW_NX_VIEW 2
39#define VIEW_J_VIEW 3 39#define VIEW_J_VIEW 3
40#define VIEW_A_VIEW 4 40#define VIEW_A_VIEW 4
41#define VIEW_ML_VIEW 5 41#define VIEW_ML_VIEW 5
42#define VIEW_M_VIEW 6 42#define VIEW_M_VIEW 6
43#define VIEW_L_VIEW 7 43#define VIEW_L_VIEW 7
44#define VIEW_T_VIEW 8 44#define VIEW_T_VIEW 8
45 45
46class KopiCalendarFile : public QObject 46class KopiCalendarFile : public QObject
47{ 47{
48 public: 48 public:
49 KopiCalendarFile( ) : QObject( ) 49 KopiCalendarFile( ) : QObject( )
50 { 50 {
51 isStandard = false; 51 isStandard = false;
52 isEnabled = true; 52 isEnabled = true;
53 isAlarmEnabled = true; 53 isAlarmEnabled = true;
54 isReadOnly = false; 54 isReadOnly = false;
55 mName = "Calendar"; 55 mName = "Calendar";
56 mFileName = QDir::homeDirPath() + "/icalfile.ics"; 56 mFileName = QDir::homeDirPath() + "/icalfile.ics";
57 mSavedFileName = "icalfile.ics"; 57 mSavedFileName = "icalfile.ics";
58 mCalNumber = 0; 58 mCalNumber = 0;
59 mDefaultColor = Qt::red; 59 mDefaultColor = Qt::red;
60 mErrorOnLoad = false; 60 mErrorOnLoad = false;
61 isRelative = false; 61 isRelative = false;
62 } 62 }
63 bool isStandard; 63 bool isStandard;
64 bool isEnabled; 64 bool isEnabled;
65 bool isAlarmEnabled; 65 bool isAlarmEnabled;
66 bool isReadOnly; 66 bool isReadOnly;
67 bool mErrorOnLoad; 67 bool mErrorOnLoad;
68 QString mName; 68 QString mName;
69 QString mFileName; 69 QString mFileName;
70 QString mSavedFileName; 70 QString mSavedFileName;
71 bool isRelative; 71 bool isRelative;
72 int mCalNumber; 72 int mCalNumber;
73 QColor mDefaultColor; 73 QColor mDefaultColor;
74 QDateTime mLoadDt; 74 QDateTime mLoadDt;
75}; 75};
76class KOPrefs : public KPimPrefs 76class KOPrefs : public KPimPrefs
77{ 77{
78 public: 78 public:
79 enum { FormatVCalendar, FormatICalendar }; 79 enum { FormatVCalendar, FormatICalendar };
80 enum { MailClientKMail, MailClientSendmail }; 80 enum { MailClientKMail, MailClientSendmail };
81 enum { IMIPDummy, IMIPKMail }; 81 enum { IMIPDummy, IMIPKMail };
82 enum { IMIPOutbox, IMIPdirectsend }; 82 enum { IMIPOutbox, IMIPdirectsend };
83 enum { neverAuto, addressbookAuto, selectedAuto }; 83 enum { neverAuto, addressbookAuto, selectedAuto };
84 enum { standardDestination, askDestination }; 84 enum { standardDestination, askDestination };
85 85
86 virtual ~KOPrefs(); 86 virtual ~KOPrefs();
87 87
88 /** Get instance of KOPrefs. It is made sure that there is only one 88 /** Get instance of KOPrefs. It is made sure that there is only one
89 instance. */ 89 instance. */
90 static KOPrefs *instance(); 90 static KOPrefs *instance();
91 91
92 /** Set preferences to default values */ 92 /** Set preferences to default values */
93 void usrSetDefaults(); 93 void usrSetDefaults();
94 94
95 /** Read preferences from config file */ 95 /** Read preferences from config file */
96 void usrReadConfig(); 96 void usrReadConfig();
97 97
98 /** Write preferences to config file */ 98 /** Write preferences to config file */
99 void usrWriteConfig(); 99 void usrWriteConfig();
100 void setCategoryDefaults(); 100 void setCategoryDefaults();
101 void setAllDefaults(); 101 void setAllDefaults();
102 KopiCalendarFile * getNewCalendar(); 102 KopiCalendarFile * getNewCalendar();
103 KopiCalendarFile * getCalendar( int ); 103 KopiCalendarFile * getCalendar( int );
104 void deleteCalendar( int ); 104 void deleteCalendar( int );
105 QColor defaultColor( int ) const; 105 QColor defaultColor( int ) const;
106 QString calName( int ) const; 106 QString calName( int ) const;
107 int getCalendarID( const QString & name ); 107 int getCalendarID( const QString & name );
108 protected: 108 protected:
109 void setTimeZoneIdDefault(); 109 void setTimeZoneIdDefault();
110 110
111 /** Fill empty mail fields with default values. */ 111 /** Fill empty mail fields with default values. */
112 void fillMailDefaults(); 112 void fillMailDefaults();
113 113
114 private: 114 private:
115 /** Constructor disabled for public. Use instance() to create a KOPrefs 115 /** Constructor disabled for public. Use instance() to create a KOPrefs
116 object. */ 116 object. */
117 KOPrefs(); 117 KOPrefs();
118 118
119 static KOPrefs *mInstance; 119 static KOPrefs *mInstance;
120 QStringList getDefaultList(); 120 QStringList getDefaultList();
121 QStringList getLocationDefaultList(); 121 QStringList getLocationDefaultList();
122 public: 122 public:
123 // preferences data 123 // preferences data
124 KConfig* getConfig(); 124 KConfig* getConfig();
125 void setFullName(const QString &); 125 void setFullName(const QString &);
126 QString fullName(); 126 QString fullName();
127 void setEmail(const QString &); 127 void setEmail(const QString &);
128 QString email(); 128 QString email();
129 129
130 QString mAdditional; 130 QString mAdditional;
131 131
132 bool mEmailControlCenter; 132 bool mEmailControlCenter;
133 133
134 bool mBcc; 134 bool mBcc;
135 bool mAutoSave; 135 bool mAutoSave;
136 int mAutoSaveInterval; 136 int mAutoSaveInterval;
137 bool mConfirm; 137 bool mConfirm;
138 138
139 bool mEnableGroupScheduling; 139 bool mEnableGroupScheduling;
140 bool mEnableProjectView; 140 bool mEnableProjectView;
141 141
142 int mDefaultFormat; 142 int mDefaultFormat;
143 int mMailClient; 143 int mMailClient;
144 144
145 int mStartTime; 145 int mStartTime;
146 int mDefaultDuration; 146 int mDefaultDuration;
147 int mAlarmTime; 147 int mAlarmTime;
148 148
149 int mWorkingHoursStart; 149 int mWorkingHoursStart;
150 int mWorkingHoursEnd; 150 int mWorkingHoursEnd;
151 bool mExcludeHolidays; 151 bool mExcludeHolidays;
152 bool mExcludeSaturdays; 152 bool mExcludeSaturdays;
153 bool mMarcusBainsShowSeconds; 153 bool mMarcusBainsShowSeconds;
154 154
155 QFont mTimeBarFont; 155 QFont mTimeBarFont;
156 QFont mMonthViewFont; 156 QFont mMonthViewFont;
157 QFont mAgendaViewFont; 157 QFont mAgendaViewFont;
158 QFont mMarcusBainsFont; 158 QFont mMarcusBainsFont;
159 QFont mTimeLabelsFont; 159 QFont mTimeLabelsFont;
160 QFont mTodoViewFont; 160 QFont mTodoViewFont;
161 QFont mListViewFont; 161 QFont mListViewFont;
162 QFont mDateNavigatorFont; 162 QFont mDateNavigatorFont;
163 QFont mEditBoxFont; 163 QFont mEditBoxFont;
164 QFont mJornalViewFont; 164 QFont mJornalViewFont;
165 QFont mWhatsNextFont; 165 QFont mWhatsNextFont;
166 QFont mEventViewFont; 166 QFont mEventViewFont;
167 167
168 168
169 169
170 170
171 QColor mHolidayColor; 171 QColor mHolidayColor;
172 QColor mHighlightColor; 172 QColor mHighlightColor;
173 QColor mEventColor; 173 QColor mEventColor;
174 QColor mTodoDoneColor; 174 QColor mTodoDoneColor;
175 QColor mAgendaBgColor; 175 QColor mAgendaBgColor;
176 QColor mWorkingHoursColor; 176 QColor mWorkingHoursColor;
177 QColor mTodoDueTodayColor; 177 QColor mTodoDueTodayColor;
178 QColor mTodoOverdueColor; 178 QColor mTodoOverdueColor;
179 QColor mTodoRunColor; 179 QColor mTodoRunColor;
180 QColor mMonthViewEvenColor; 180 QColor mMonthViewEvenColor;
181 QColor mMonthViewOddColor; 181 QColor mMonthViewOddColor;
182 QColor mMonthViewHolidayColor; 182 QColor mMonthViewHolidayColor;
183 bool mMonthViewUsesDayColors; 183 bool mMonthViewUsesDayColors;
184 bool mMonthViewSatSunTog; 184 bool mMonthViewSatSunTog;
185 bool mMonthViewWeek; 185 bool mMonthViewWeek;
186 bool mMonthViewWeekRowlayout; 186 bool mMonthViewWeekRowlayout;
187 QColor mAppColor1; 187 QColor mAppColor1;
188 QColor mAppColor2; 188 QColor mAppColor2;
189 bool mUseAppColors; 189 bool mUseAppColors;
190 190
191 int mDayBegins; 191 int mDayBegins;
192 int mHourSize; 192 int mHourSize;
193 int mAllDaySize; 193 int mAllDaySize;
194 bool mShowFullMenu; 194 bool mShowFullMenu;
195 bool mDailyRecur; 195 bool mDailyRecur;
196 bool mWeeklyRecur; 196 bool mWeeklyRecur;
197 bool mMonthDailyRecur; 197 bool mMonthDailyRecur;
198 bool mMonthWeeklyRecur; 198 bool mMonthWeeklyRecur;
199 bool mMonthShowIcons; 199 bool mMonthShowIcons;
200 bool mMonthShowTimes; 200 bool mMonthShowTimes;
201 bool mMonthShowShort; 201 bool mMonthShowShort;
202 bool mEnableToolTips; 202 bool mEnableToolTips;
203 bool mEnableMonthScroll; 203 bool mEnableMonthScroll;
204 bool mFullViewMonth; 204 bool mFullViewMonth;
205 bool mMonthViewUsesCategoryColor; 205 bool mMonthViewUsesCategoryColor;
206 bool mFullViewTodo; 206 bool mFullViewTodo;
207 bool mShowCompletedTodo; 207 bool mShowCompletedTodo;
208 bool mMarcusBainsEnabled; 208 bool mMarcusBainsEnabled;
209 int mNextXDays; 209 int mNextXDays;
210 int mWhatsNextDays; 210 int mWhatsNextDays;
211 bool mWhatsNextTime2Lines; 211 bool mWhatsNextTime2Lines;
212 int mWhatsNextPrios; 212 int mWhatsNextPrios;
213 bool mEnableQuickTodo; 213 bool mEnableQuickTodo;
214 214
215 bool mCompactDialogs; 215 bool mCompactDialogs;
216 bool mVerticalScreen; 216 bool mVerticalScreen;
217 217
218 bool mShowIconNewTodo; 218 bool mShowIconNewTodo;
219 bool mShowIconNewEvent; 219 bool mShowIconNewEvent;
220 bool mShowIconSearch; 220 bool mShowIconSearch;
221 bool mShowIconList; 221 bool mShowIconList;
222 bool mShowIconDay1; 222 bool mShowIconDay1;
223 bool mShowIconDay5; 223 bool mShowIconDay5;
224 bool mShowIconDay6; 224 bool mShowIconDay6;
225 bool mShowIconDay7; 225 bool mShowIconDay7;
226 bool mShowIconMonth; 226 bool mShowIconMonth;
227 bool mShowIconTodoview; 227 bool mShowIconTodoview;
228 bool mShowIconBackFast; 228 bool mShowIconBackFast;
229 bool mShowIconBack; 229 bool mShowIconBack;
230 bool mShowIconToday; 230 bool mShowIconToday;
231 bool mShowIconForward; 231 bool mShowIconForward;
232 bool mShowIconForwardFast; 232 bool mShowIconForwardFast;
233 bool mShowIconWhatsThis; 233 bool mShowIconWhatsThis;
234 bool mShowIconWeekNum; 234 bool mShowIconWeekNum;
235 bool mShowIconNextDays; 235 bool mShowIconNextDays;
236 bool mShowIconNext; 236 bool mShowIconNext;
237 bool mShowIconJournal; 237 bool mShowIconJournal;
238 bool mShowIconFilter; 238 bool mShowIconFilter;
239 bool mShowIconOnetoolbar; 239 bool mShowIconOnetoolbar;
240 bool mShowIconNavigator; 240 bool mShowIconNavigator;
241 bool mShowIconAllday; 241 bool mShowIconAllday;
242 bool mShowIconFilterview; 242 bool mShowIconFilterview;
243 bool mShowIconToggleFull; 243 bool mShowIconToggleFull;
244 244
245 bool mShowIconStretch; 245 bool mShowIconStretch;
246 246
247 bool mToolBarHor; 247 bool mToolBarHor;
248 bool mToolBarUp; 248 bool mToolBarUp;
249 bool mToolBarHorV; 249 bool mToolBarHorV;
250 bool mToolBarUpV; 250 bool mToolBarUpV;
251 bool mToolBarHorN; 251 bool mToolBarHorN;
252 bool mToolBarUpN; 252 bool mToolBarUpN;
253 bool mToolBarHorF; 253 bool mToolBarHorF;
254 bool mToolBarUpF; 254 bool mToolBarUpF;
255 bool mToolBarMiniIcons; 255 bool mToolBarMiniIcons;
256 256
257 bool mAskForQuit; 257 bool mAskForQuit;
258 bool mUsePassWd; 258 bool mUsePassWd;
259 bool mShowSyncEvents; 259 bool mShowSyncEvents;
260 bool mShowTodoInAgenda; 260 bool mShowTodoInAgenda;
261 bool mShowCompletedTodoInAgenda; 261 bool mShowCompletedTodoInAgenda;
262 bool mShowTimeInAgenda; 262 bool mShowTimeInAgenda;
263 bool mHideNonStartedTodos; 263 bool mHideNonStartedTodos;
264 264
265 bool mBlockPopupMenu; 265 bool mBlockPopupMenu;
266 266
267 int mLastSyncTime; 267 int mLastSyncTime;
268 void setCategoryColor(QString cat,const QColor & color); 268 void setCategoryColor(QString cat,const QColor & color);
269 QColor *categoryColor(QString cat); 269 QColor *categoryColor(QString cat);
270 270
271 QString mArchiveFile; 271 QString mArchiveFile;
272 QString mHtmlExportFile; 272 QString mHtmlExportFile;
273 bool mHtmlWithSave; 273 bool mHtmlWithSave;
274 274
275 QStringList mSelectedPlugins; 275 QStringList mSelectedPlugins;
276 276
277 QString mLastImportFile; 277 QString mLastImportFile;
278 QString mLastVcalFile; 278 QString mLastVcalFile;
279 QString mLastSaveFile; 279 QString mLastSaveFile;
280 QString mLastLoadFile; 280 QString mLastLoadFile;
281 281
282 282
283 QString mDefaultAlarmFile; 283 QString mDefaultAlarmFile;
284 int mIMIPScheduler; 284 int mIMIPScheduler;
285 int mIMIPSend; 285 int mIMIPSend;
286 QStringList mAdditionalMails; 286 QStringList mAdditionalMails;
287 int mIMIPAutoRefresh; 287 int mIMIPAutoRefresh;
288 int mIMIPAutoInsertReply; 288 int mIMIPAutoInsertReply;
289 int mIMIPAutoInsertRequest; 289 int mIMIPAutoInsertRequest;
290 int mIMIPAutoFreeBusy; 290 int mIMIPAutoFreeBusy;
291 int mIMIPAutoFreeBusyReply; 291 int mIMIPAutoFreeBusyReply;
292 292
293 QStringList mTodoTemplates; 293 QStringList mTodoTemplates;
294 QStringList mEventTemplates; 294 QStringList mEventTemplates;
295 295
296 int mDestination; 296 int mDestination;
297 297
298 298
299 bool mEditOnDoubleClick; 299 bool mEditOnDoubleClick;
300 bool mViewChangeHoldFullscreen; 300 bool mViewChangeHoldFullscreen;
301 bool mViewChangeHoldNonFullscreen; 301 bool mViewChangeHoldNonFullscreen;
302 bool mCenterOnCurrentTime; 302 bool mCenterOnCurrentTime;
303 bool mSetTimeToDayStartAt; 303 bool mSetTimeToDayStartAt;
304 bool mHighlightCurrentDay; 304 bool mHighlightCurrentDay;
305 bool mUseHighlightLightColor; 305 bool mUseHighlightLightColor;
306 bool mListViewMonthTimespan; 306 bool mListViewMonthTimespan;
307 bool mWNViewShowsParents; 307 bool mWNViewShowsParents;
308 bool mWNViewShowsPast; 308 bool mWNViewShowsPast;
309 bool mWNViewShowLocation; 309 bool mWNViewShowLocation;
310 bool mTodoViewShowsPercentage; 310 bool mTodoViewShowsPercentage;
311 bool mTodoViewUsesCatColors; 311 bool mTodoViewUsesCatColors;
312 bool mMonthViewUsesBigFont; 312 bool mMonthViewUsesBigFont;
313 bool mTodoViewUsesSmallFont; 313 bool mTodoViewUsesSmallFont;
314 bool mTodoViewUsesForegroundColor; 314 bool mTodoViewUsesForegroundColor;
315 bool mMonthViewUsesForegroundColor; 315 bool mMonthViewUsesForegroundColor;
316 316
317 bool mHightlightDateTimeEdit; 317 bool mHightlightDateTimeEdit;
318 bool mShortDateInViewer; 318 bool mShortDateInViewer;
319 319
320 bool mShowDateNavigator; 320 bool mShowDateNavigator;
321 321
322 QStringList mLocationDefaults; 322 QStringList mLocationDefaults;
323 QStringList mEventSummaryUser; 323 QStringList mEventSummaryUser;
324 QStringList mTodoSummaryUser; 324 QStringList mTodoSummaryUser;
325 QStringList mJournalSummaryUser; 325 QStringList mJournalSummaryUser;
326 326
327 bool mUseInternalAlarmNotification; 327 bool mUseInternalAlarmNotification;
328 int mAlarmPlayBeeps; 328 int mAlarmPlayBeeps;
329 int mAlarmSuspendTime; 329 int mAlarmSuspendTime;
330 int mAlarmSuspendCount; 330 int mAlarmSuspendCount;
331 int mAlarmBeepInterval; 331 int mAlarmBeepInterval;
332 int mOldLanguage; 332 int mOldLanguage;
333 int mOldLoadedLanguage; 333 int mOldLoadedLanguage;
334 334
335 335
336 QString mActiveSyncPort; 336 QString mActiveSyncPort;
337 QString mActiveSyncIP; 337 QString mActiveSyncIP;
338 338
339 // settings for eventviewer 339 // settings for eventviewer
340 bool mEVshowDetails; 340 bool mEVshowDetails;
341 bool mEVshowCreated; 341 bool mEVshowCreated;
342 bool mEVshowChanged; 342 bool mEVshowChanged;
343 bool mWTshowDetails; 343 bool mWTshowDetails;
344 bool mWTshowCreated; 344 bool mWTshowCreated;
345 bool mWTshowChanged; 345 bool mWTshowChanged;
346 346
347 int mCurrentDisplayedView; 347 int mCurrentDisplayedView;
348 QPtrList<KopiCalendarFile> mCalendars; 348 QPtrList<KopiCalendarFile> mCalendars;
349 int mNextAvailableCalendar; 349 int mNextAvailableCalendar;
350 bool mGlobalUpdateDisabled; 350 bool mGlobalUpdateDisabled;
351 351
352
353 bool mDetectConflicts;
354 bool mCheckConflictsAllDayAllDay;
355 bool mCheckConflictsAllDayNonAD;
356 bool mCheckConflictsNonADAllDay;
357 bool mCheckConflictsNonADNonAD;
358 QString mFilterConflictEditItem;
359 QString mFilterConflictAllItem;
360
352 private: 361 private:
353 QDict<QColor> mCategoryColors; 362 QDict<QColor> mCategoryColors;
354 QArray<KopiCalendarFile*> mDefCalColors; 363 QArray<KopiCalendarFile*> mDefCalColors;
355 QColor mDefaultCategoryColor; 364 QColor mDefaultCategoryColor;
356 365
357 QFont mDefaultTimeBarFont; 366 QFont mDefaultTimeBarFont;
358 QFont mDefaultViewFont; 367 QFont mDefaultViewFont;
359 QFont mDefaultMonthViewFont; 368 QFont mDefaultMonthViewFont;
360 369
361 QString mName; 370 QString mName;
362 QString mEmail; 371 QString mEmail;
363}; 372};
364 373
365#endif 374#endif
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 9e2378a..bbdf508 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -541,1012 +541,1064 @@ void KOPrefsDialog::setupViewsTab()
541 addWidBool(i18n("Hold fullscreen on view change"), 541 addWidBool(i18n("Hold fullscreen on view change"),
542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 542 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
543 topLayout->addWidget(dummy->checkBox(),ii++,0); 543 topLayout->addWidget(dummy->checkBox(),ii++,0);
544 544
545 dummy = 545 dummy =
546 addWidBool(i18n("Hold non-fullscreen on view change"), 546 addWidBool(i18n("Hold non-fullscreen on view change"),
547 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 547 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
548 topLayout->addWidget(dummy->checkBox(),ii++,0); 548 topLayout->addWidget(dummy->checkBox(),ii++,0);
549 549
550 550
551 551
552 KPrefsDialogWidBool *fullViewMonth = 552 KPrefsDialogWidBool *fullViewMonth =
553 addWidBool(i18n("Next days view uses full window"), 553 addWidBool(i18n("Next days view uses full window"),
554 &(KOPrefs::instance()->mFullViewMonth),topFrame); 554 &(KOPrefs::instance()->mFullViewMonth),topFrame);
555 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 555 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
556 556
557 557
558 KPrefsDialogWidBool *fullViewTodo = 558 KPrefsDialogWidBool *fullViewTodo =
559 addWidBool(i18n("Event list view uses full window"), 559 addWidBool(i18n("Event list view uses full window"),
560 &(KOPrefs::instance()->mFullViewTodo),topFrame); 560 &(KOPrefs::instance()->mFullViewTodo),topFrame);
561 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 561 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
562 dummy = 562 dummy =
563 addWidBool(i18n("Listview uses monthly timespan"), 563 addWidBool(i18n("Listview uses monthly timespan"),
564 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 564 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
565 topLayout->addWidget(dummy->checkBox(),ii++,0); 565 topLayout->addWidget(dummy->checkBox(),ii++,0);
566 dummy = 566 dummy =
567 addWidBool(i18n("Highlight selection in Time Edit"), 567 addWidBool(i18n("Highlight selection in Time Edit"),
568 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 568 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
569 topLayout->addWidget( dummy->checkBox(), ii++,0); 569 topLayout->addWidget( dummy->checkBox(), ii++,0);
570 570
571 KPrefsDialogWidBool *dailyRecur = 571 KPrefsDialogWidBool *dailyRecur =
572 addWidBool(i18n("Show events that recur daily in date nav."), 572 addWidBool(i18n("Show events that recur daily in date nav."),
573 &(KOPrefs::instance()->mDailyRecur),topFrame); 573 &(KOPrefs::instance()->mDailyRecur),topFrame);
574 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 574 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
575 575
576 KPrefsDialogWidBool *weeklyRecur = 576 KPrefsDialogWidBool *weeklyRecur =
577 addWidBool(i18n("Show ev. that recur weekly in date nav."), 577 addWidBool(i18n("Show ev. that recur weekly in date nav."),
578 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 578 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
579 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 579 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
580 580
581#ifdef DESKTOP_VERSION 581#ifdef DESKTOP_VERSION
582 KPrefsDialogWidBool *enableToolTips = 582 KPrefsDialogWidBool *enableToolTips =
583 addWidBool(i18n("Enable tooltips displaying summary of ev."), 583 addWidBool(i18n("Enable tooltips displaying summary of ev."),
584 &(KOPrefs::instance()->mEnableToolTips),topFrame); 584 &(KOPrefs::instance()->mEnableToolTips),topFrame);
585 topLayout->addWidget(enableToolTips->checkBox(),ii++,0); 585 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
586#endif 586#endif
587 // ********************************************************* 587 // *********************************************************
588 588
589 topFrame = addPage(i18n("Agenda View"),0,0); 589 topFrame = addPage(i18n("Agenda View"),0,0);
590 // DesktopIcon("viewmag",KIcon::SizeMedium)); 590 // DesktopIcon("viewmag",KIcon::SizeMedium));
591 591
592 topLayout = new QGridLayout(topFrame,5,1); 592 topLayout = new QGridLayout(topFrame,5,1);
593 topLayout->setSpacing(mSpacingHint); 593 topLayout->setSpacing(mSpacingHint);
594 topLayout->setMargin(mMarginHint); 594 topLayout->setMargin(mMarginHint);
595 ii = 0; 595 ii = 0;
596 596
597 597
598 dummy = 598 dummy =
599 addWidBool(i18n("Show time in agenda items"), 599 addWidBool(i18n("Show time in agenda items"),
600 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 600 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
601 topLayout->addWidget(dummy->checkBox(),ii++,0); 601 topLayout->addWidget(dummy->checkBox(),ii++,0);
602 602
603 dummy = 603 dummy =
604 addWidBool(i18n("Highlight current day in agenda"), 604 addWidBool(i18n("Highlight current day in agenda"),
605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 605 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
606 topLayout->addWidget(dummy->checkBox(),ii++,0); 606 topLayout->addWidget(dummy->checkBox(),ii++,0);
607 607
608 dummy = 608 dummy =
609 addWidBool(i18n("Use light color for highlight current day"), 609 addWidBool(i18n("Use light color for highlight current day"),
610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 610 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
611 topLayout->addWidget(dummy->checkBox(),ii++,0); 611 topLayout->addWidget(dummy->checkBox(),ii++,0);
612 612
613 613
614 KPrefsDialogWidBool *marcusBainsEnabled = 614 KPrefsDialogWidBool *marcusBainsEnabled =
615 addWidBool(i18n("Show current time"), 615 addWidBool(i18n("Show current time"),
616 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 616 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
617 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 617 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
618 618
619 619
620 dummy = 620 dummy =
621 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 621 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
622 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 622 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
623 topLayout->addWidget(dummy->checkBox(),ii++,0); 623 topLayout->addWidget(dummy->checkBox(),ii++,0);
624 624
625 dummy = 625 dummy =
626 addWidBool(i18n("Set agenda to current time on change"), 626 addWidBool(i18n("Set agenda to current time on change"),
627 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 627 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
628 topLayout->addWidget(dummy->checkBox(),ii++,0); 628 topLayout->addWidget(dummy->checkBox(),ii++,0);
629 629
630 630
631 dummy = 631 dummy =
632 addWidBool(i18n("Allday Agenda view shows todos"), 632 addWidBool(i18n("Allday Agenda view shows todos"),
633 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame); 633 &(KOPrefs::instance()->mShowTodoInAgenda),topFrame);
634 topLayout->addWidget(dummy->checkBox(),ii++,0); 634 topLayout->addWidget(dummy->checkBox(),ii++,0);
635 635
636 636
637 637
638 dummy = 638 dummy =
639 addWidBool(i18n("Agenda view shows completed todos"), 639 addWidBool(i18n("Agenda view shows completed todos"),
640 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame); 640 &(KOPrefs::instance()->mShowCompletedTodoInAgenda),topFrame);
641 topLayout->addWidget(dummy->checkBox(),ii++,0); 641 topLayout->addWidget(dummy->checkBox(),ii++,0);
642 642
643 643
644 644
645 645
646 646
647 topFrame = addPage(i18n("Month View"),0,0); 647 topFrame = addPage(i18n("Month View"),0,0);
648 // DesktopIcon("viewmag",KIcon::SizeMedium)); 648 // DesktopIcon("viewmag",KIcon::SizeMedium));
649 649
650 topLayout = new QGridLayout(topFrame,5,1); 650 topLayout = new QGridLayout(topFrame,5,1);
651 topLayout->setSpacing(mSpacingHint); 651 topLayout->setSpacing(mSpacingHint);
652 topLayout->setMargin(mMarginHint); 652 topLayout->setMargin(mMarginHint);
653 ii = 0; 653 ii = 0;
654 QLabel *lab; 654 QLabel *lab;
655 QHBox *habo = new QHBox( topFrame ); 655 QHBox *habo = new QHBox( topFrame );
656 if ( QApplication::desktop()->width() <= 480 ) { 656 if ( QApplication::desktop()->width() <= 480 ) {
657 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 657 lab = new QLabel ( i18n("Show events that recur "), topFrame );
658 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 658 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
659 ii++; 659 ii++;
660 } else { 660 } else {
661 new QLabel ( i18n("Show events that recur "), habo ); 661 new QLabel ( i18n("Show events that recur "), habo );
662 } 662 }
663 dailyRecur = 663 dailyRecur =
664 addWidBool(i18n("daily"), 664 addWidBool(i18n("daily"),
665 &(KOPrefs::instance()->mMonthDailyRecur),habo); 665 &(KOPrefs::instance()->mMonthDailyRecur),habo);
666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 666 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
667 667
668 weeklyRecur = 668 weeklyRecur =
669 addWidBool(i18n("weekly"), 669 addWidBool(i18n("weekly"),
670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 670 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
671 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 671 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
672 ii++; 672 ii++;
673 673
674 674
675 habo = new QHBox( topFrame ); 675 habo = new QHBox( topFrame );
676 if ( QApplication::desktop()->width() <= 480 ) { 676 if ( QApplication::desktop()->width() <= 480 ) {
677 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 677 lab = new QLabel (i18n("Show in every cell ") , topFrame );
678 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 678 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
679 ii++; 679 ii++;
680 680
681 } else { 681 } else {
682 new QLabel ( i18n("Show in every cell "), habo ); 682 new QLabel ( i18n("Show in every cell "), habo );
683 } 683 }
684 weeklyRecur = 684 weeklyRecur =
685 addWidBool(i18n("short month"), 685 addWidBool(i18n("short month"),
686 &(KOPrefs::instance()->mMonthShowShort),habo); 686 &(KOPrefs::instance()->mMonthShowShort),habo);
687 weeklyRecur = 687 weeklyRecur =
688 addWidBool(i18n("icons"), 688 addWidBool(i18n("icons"),
689 &(KOPrefs::instance()->mMonthShowIcons),habo); 689 &(KOPrefs::instance()->mMonthShowIcons),habo);
690 weeklyRecur = 690 weeklyRecur =
691 addWidBool(i18n("times"), 691 addWidBool(i18n("times"),
692 &(KOPrefs::instance()->mMonthShowTimes),habo); 692 &(KOPrefs::instance()->mMonthShowTimes),habo);
693 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 693 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
694 ii++; 694 ii++;
695#ifdef DESKTOP_VERSION 695#ifdef DESKTOP_VERSION
696 KPrefsDialogWidBool *enableMonthScroll = 696 KPrefsDialogWidBool *enableMonthScroll =
697 addWidBool(i18n("Enable scrollbars in month view cells"), 697 addWidBool(i18n("Enable scrollbars in month view cells"),
698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 698 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 699 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
700#endif 700#endif
701 dummy = 701 dummy =
702 addWidBool(i18n("Week view mode uses bigger font"), 702 addWidBool(i18n("Week view mode uses bigger font"),
703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); 703 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame);
704 topLayout->addWidget(dummy->checkBox(),ii++,0); 704 topLayout->addWidget(dummy->checkBox(),ii++,0);
705 dummy = 705 dummy =
706 addWidBool(i18n("Week view mode uses row layout"), 706 addWidBool(i18n("Week view mode uses row layout"),
707 &(KOPrefs::instance()->mMonthViewWeekRowlayout),topFrame); 707 &(KOPrefs::instance()->mMonthViewWeekRowlayout),topFrame);
708 topLayout->addWidget(dummy->checkBox(),ii++,0); 708 topLayout->addWidget(dummy->checkBox(),ii++,0);
709 dummy = 709 dummy =
710 addWidBool(i18n("Show Sat/Sun together"), 710 addWidBool(i18n("Show Sat/Sun together"),
711 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 711 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
712 topLayout->addWidget(dummy->checkBox(),ii++,0); 712 topLayout->addWidget(dummy->checkBox(),ii++,0);
713 713
714 KPrefsDialogWidBool *coloredCategoriesInMonthView = 714 KPrefsDialogWidBool *coloredCategoriesInMonthView =
715 addWidBool(i18n("Month view uses category colors"), 715 addWidBool(i18n("Month view uses category colors"),
716 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 716 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
717 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 717 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
718 718
719 dummy = 719 dummy =
720 addWidBool(i18n("Category colors are applied to text"), 720 addWidBool(i18n("Category colors are applied to text"),
721 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 721 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
722 topLayout->addWidget(dummy->checkBox(),ii++,0); 722 topLayout->addWidget(dummy->checkBox(),ii++,0);
723 723
724 724
725 725
726 if ( QApplication::desktop()->height() <= 240 ) { 726 if ( QApplication::desktop()->height() <= 240 ) {
727 topFrame = addPage(i18n("Month View") +" 2",0,0); 727 topFrame = addPage(i18n("Month View") +" 2",0,0);
728 topLayout = new QGridLayout(topFrame,4,1); 728 topLayout = new QGridLayout(topFrame,4,1);
729 topLayout->setSpacing(2); 729 topLayout->setSpacing(2);
730 topLayout->setMargin(1); 730 topLayout->setMargin(1);
731 ii = 0; 731 ii = 0;
732 } 732 }
733 733
734 734
735 coloredCategoriesInMonthView = 735 coloredCategoriesInMonthView =
736 addWidBool(i18n("Month view uses day colors"), 736 addWidBool(i18n("Month view uses day colors"),
737 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 737 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
738 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 738 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
739 739
740 KPrefsDialogWidColor *holidayColor = 740 KPrefsDialogWidColor *holidayColor =
741 addWidColor(i18n("Day color odd months"), 741 addWidColor(i18n("Day color odd months"),
742 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 742 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
743 topLayout->addWidget(holidayColor->label(),ii,0); 743 topLayout->addWidget(holidayColor->label(),ii,0);
744 topLayout->addWidget(holidayColor->button(),ii++,1); 744 topLayout->addWidget(holidayColor->button(),ii++,1);
745 745
746 holidayColor = 746 holidayColor =
747 addWidColor(i18n("Day color even months"), 747 addWidColor(i18n("Day color even months"),
748 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 748 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
749 topLayout->addWidget(holidayColor->label(),ii,0); 749 topLayout->addWidget(holidayColor->label(),ii,0);
750 topLayout->addWidget(holidayColor->button(),ii++,1); 750 topLayout->addWidget(holidayColor->button(),ii++,1);
751 751
752 752
753 holidayColor = 753 holidayColor =
754 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 754 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
755 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 755 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
756 topLayout->addWidget(holidayColor->label(),ii,0); 756 topLayout->addWidget(holidayColor->label(),ii,0);
757 topLayout->addWidget(holidayColor->button(),ii++,1); 757 topLayout->addWidget(holidayColor->button(),ii++,1);
758 // *********************** What'sNext View 758 // *********************** What'sNext View
759 topFrame = addPage(i18n("What's Next View"),0,0); 759 topFrame = addPage(i18n("What's Next View"),0,0);
760 // DesktopIcon("viewmag",KIcon::SizeMedium)); 760 // DesktopIcon("viewmag",KIcon::SizeMedium));
761 761
762 topLayout = new QGridLayout(topFrame,4,1); 762 topLayout = new QGridLayout(topFrame,4,1);
763 topLayout->setSpacing(mSpacingHint); 763 topLayout->setSpacing(mSpacingHint);
764 topLayout->setMargin(mMarginHint); 764 topLayout->setMargin(mMarginHint);
765 ii = 0; 765 ii = 0;
766 766
767 767
768 QHBox* hdummy = new QHBox(topFrame); 768 QHBox* hdummy = new QHBox(topFrame);
769 new QLabel(i18n("Days in What's Next:"),hdummy); 769 new QLabel(i18n("Days in What's Next:"),hdummy);
770 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); 770 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
771 771
772 topLayout->addWidget(hdummy,ii++,0); 772 topLayout->addWidget(hdummy,ii++,0);
773 773
774 QHBox *prioBox = new QHBox(topFrame); 774 QHBox *prioBox = new QHBox(topFrame);
775 // intervalBox->setSpacing(mSpacingHint); 775 // intervalBox->setSpacing(mSpacingHint);
776 topLayout->addWidget(prioBox,ii++,0); 776 topLayout->addWidget(prioBox,ii++,0);
777 777
778 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox); 778 QLabel *prioLabel = new QLabel(i18n("Number of max.displayed todo prios:"), prioBox);
779 mPrioSpin = new QSpinBox(0,5,1,prioBox); 779 mPrioSpin = new QSpinBox(0,5,1,prioBox);
780 if ( QApplication::desktop()->width() < 300 ) 780 if ( QApplication::desktop()->width() < 300 )
781 mPrioSpin->setFixedWidth( 40 ); 781 mPrioSpin->setFixedWidth( 40 );
782 KPrefsDialogWidBool *passwdk = 782 KPrefsDialogWidBool *passwdk =
783 783
784 addWidBool(i18n("Show times on two lines"), 784 addWidBool(i18n("Show times on two lines"),
785 &(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame); 785 &(KOPrefs::instance()->mWhatsNextTime2Lines),topFrame);
786 topLayout->addWidget(passwdk->checkBox(), ii++,0); 786 topLayout->addWidget(passwdk->checkBox(), ii++,0);
787 passwdk = 787 passwdk =
788 788
789 addWidBool(i18n("Show events that are done"), 789 addWidBool(i18n("Show events that are done"),
790 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 790 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
791 topLayout->addWidget(passwdk->checkBox(), ii++,0); 791 topLayout->addWidget(passwdk->checkBox(), ii++,0);
792 passwdk = 792 passwdk =
793 addWidBool(i18n("Show parent To-Do's"), 793 addWidBool(i18n("Show parent To-Do's"),
794 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 794 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
795 topLayout->addWidget(passwdk->checkBox(), ii++,0); 795 topLayout->addWidget(passwdk->checkBox(), ii++,0);
796 796
797 passwdk = 797 passwdk =
798 addWidBool(i18n("Show location"), 798 addWidBool(i18n("Show location"),
799 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 799 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
800 topLayout->addWidget(passwdk->checkBox(), ii++,0); 800 topLayout->addWidget(passwdk->checkBox(), ii++,0);
801 801
802 802
803 passwdk = 803 passwdk =
804 addWidBool(i18n("Use short date in WN+Event view"), 804 addWidBool(i18n("Use short date in WN+Event view"),
805 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 805 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
806 topLayout->addWidget(passwdk->checkBox(), ii++,0); 806 topLayout->addWidget(passwdk->checkBox(), ii++,0);
807 807
808 808
809 809
810 810
811 // *********************** Todo View 811 // *********************** Todo View
812 812
813 topFrame = addPage(i18n("Todo View"),0,0); 813 topFrame = addPage(i18n("Todo View"),0,0);
814 // DesktopIcon("viewmag",KIcon::SizeMedium)); 814 // DesktopIcon("viewmag",KIcon::SizeMedium));
815 815
816 topLayout = new QGridLayout(topFrame,4,1); 816 topLayout = new QGridLayout(topFrame,4,1);
817 topLayout->setSpacing(mSpacingHint); 817 topLayout->setSpacing(mSpacingHint);
818 topLayout->setMargin(mMarginHint); 818 topLayout->setMargin(mMarginHint);
819 ii = 0; 819 ii = 0;
820dummy = 820dummy =
821 addWidBool(i18n("Hide not running Todos in To-do view"), 821 addWidBool(i18n("Hide not running Todos in To-do view"),
822 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 822 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
823 topLayout->addWidget(dummy->checkBox(),ii++,0); 823 topLayout->addWidget(dummy->checkBox(),ii++,0);
824 824
825 825
826 KPrefsDialogWidBool *showCompletedTodo = 826 KPrefsDialogWidBool *showCompletedTodo =
827 addWidBool(i18n("To-do view shows completed Todos"), 827 addWidBool(i18n("To-do view shows completed Todos"),
828 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 828 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
829 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 829 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
830 dummy = 830 dummy =
831 addWidBool(i18n("To-do view shows complete as 'xx %'"), 831 addWidBool(i18n("To-do view shows complete as 'xx %'"),
832 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 832 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
833 topLayout->addWidget(dummy->checkBox(),ii++,0); 833 topLayout->addWidget(dummy->checkBox(),ii++,0);
834 834
835 dummy = 835 dummy =
836 addWidBool(i18n("Small To-do view uses smaller font"), 836 addWidBool(i18n("Small To-do view uses smaller font"),
837 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 837 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
838 topLayout->addWidget(dummy->checkBox(),ii++,0); 838 topLayout->addWidget(dummy->checkBox(),ii++,0);
839 839
840 840
841 841
842 dummy = 842 dummy =
843 addWidBool(i18n("Todo view uses category colors"), 843 addWidBool(i18n("Todo view uses category colors"),
844 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 844 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
845 topLayout->addWidget(dummy->checkBox(),ii++,0); 845 topLayout->addWidget(dummy->checkBox(),ii++,0);
846 846
847 847
848 QWidget* wid = new QWidget( topFrame ); 848 QWidget* wid = new QWidget( topFrame );
849 // Todo run today color 849 // Todo run today color
850 KPrefsDialogWidColor *todoRunColor = 850 KPrefsDialogWidColor *todoRunColor =
851 addWidColor(i18n("Color for running todos:"), 851 addWidColor(i18n("Color for running todos:"),
852 &(KOPrefs::instance()->mTodoRunColor),wid); 852 &(KOPrefs::instance()->mTodoRunColor),wid);
853 QHBoxLayout *widLayout = new QHBoxLayout(wid); 853 QHBoxLayout *widLayout = new QHBoxLayout(wid);
854 widLayout->addWidget( todoRunColor->label() ); 854 widLayout->addWidget( todoRunColor->label() );
855 widLayout->addWidget( todoRunColor->button() ); 855 widLayout->addWidget( todoRunColor->button() );
856 topLayout->addWidget(wid,ii++,0); 856 topLayout->addWidget(wid,ii++,0);
857 857
858 wid = new QWidget( topFrame ); 858 wid = new QWidget( topFrame );
859 // Todo due today color 859 // Todo due today color
860 KPrefsDialogWidColor *todoDueTodayColor = 860 KPrefsDialogWidColor *todoDueTodayColor =
861 addWidColor(i18n("Todo due today color:"), 861 addWidColor(i18n("Todo due today color:"),
862 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 862 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
863 widLayout = new QHBoxLayout(wid); 863 widLayout = new QHBoxLayout(wid);
864 widLayout->addWidget( todoDueTodayColor->label() ); 864 widLayout->addWidget( todoDueTodayColor->label() );
865 widLayout->addWidget( todoDueTodayColor->button() ); 865 widLayout->addWidget( todoDueTodayColor->button() );
866 topLayout->addWidget(wid,ii++,0); 866 topLayout->addWidget(wid,ii++,0);
867 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 867 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
868 868
869 // Todo overdue color 869 // Todo overdue color
870 wid = new QWidget( topFrame ); 870 wid = new QWidget( topFrame );
871 widLayout = new QHBoxLayout(wid); 871 widLayout = new QHBoxLayout(wid);
872 KPrefsDialogWidColor *todoOverdueColor = 872 KPrefsDialogWidColor *todoOverdueColor =
873 addWidColor(i18n("Todo overdue color:"), 873 addWidColor(i18n("Todo overdue color:"),
874 &(KOPrefs::instance()->mTodoOverdueColor),wid); 874 &(KOPrefs::instance()->mTodoOverdueColor),wid);
875 widLayout->addWidget(todoOverdueColor->label()); 875 widLayout->addWidget(todoOverdueColor->label());
876 widLayout->addWidget(todoOverdueColor->button()); 876 widLayout->addWidget(todoOverdueColor->button());
877 topLayout->addWidget(wid,ii++,0); 877 topLayout->addWidget(wid,ii++,0);
878 878
879 dummy = 879 dummy =
880 addWidBool(i18n("Colors are applied to text"), 880 addWidBool(i18n("Colors are applied to text"),
881 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 881 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
882 topLayout->addWidget(dummy->checkBox(),ii++,0); 882 topLayout->addWidget(dummy->checkBox(),ii++,0);
883 883
884 884
885 885
886 topFrame = addPage(i18n("View Options"),0,0); 886 topFrame = addPage(i18n("View Options"),0,0);
887 887
888 topLayout = new QGridLayout(topFrame,4,1); 888 topLayout = new QGridLayout(topFrame,4,1);
889 topLayout->setSpacing(mSpacingHint); 889 topLayout->setSpacing(mSpacingHint);
890 topLayout->setMargin(mMarginHint); 890 topLayout->setMargin(mMarginHint);
891 ii = 0; 891 ii = 0;
892 892
893 dummy = 893 dummy =
894 addWidBool(i18n("Show Sync Events"), 894 addWidBool(i18n("Show Sync Events"),
895 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 895 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
896 topLayout->addWidget(dummy->checkBox(), ii++,0); 896 topLayout->addWidget(dummy->checkBox(), ii++,0);
897 897
898 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame); 898 lab = new QLabel( i18n("Show in todo/event viewer:"), topFrame);
899 topLayout->addWidget(lab ,ii++,0); 899 topLayout->addWidget(lab ,ii++,0);
900 900
901 dummy = addWidBool(i18n("Details"), 901 dummy = addWidBool(i18n("Details"),
902 &(KOPrefs::instance()->mEVshowDetails),topFrame); 902 &(KOPrefs::instance()->mEVshowDetails),topFrame);
903 topLayout->addWidget(dummy->checkBox(),ii++,0); 903 topLayout->addWidget(dummy->checkBox(),ii++,0);
904 dummy = addWidBool(i18n("Created time"), 904 dummy = addWidBool(i18n("Created time"),
905 &(KOPrefs::instance()->mEVshowCreated),topFrame); 905 &(KOPrefs::instance()->mEVshowCreated),topFrame);
906 topLayout->addWidget(dummy->checkBox(),ii++,0); 906 topLayout->addWidget(dummy->checkBox(),ii++,0);
907 dummy = addWidBool(i18n("Last modified time"), 907 dummy = addWidBool(i18n("Last modified time"),
908 &(KOPrefs::instance()->mEVshowChanged),topFrame); 908 &(KOPrefs::instance()->mEVshowChanged),topFrame);
909 topLayout->addWidget(dummy->checkBox(),ii++,0); 909 topLayout->addWidget(dummy->checkBox(),ii++,0);
910 910
911 911
912 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame); 912 lab = new QLabel( i18n("Show in What'sThis quick overview:"), topFrame);
913 topLayout->addWidget(lab ,ii++,0); 913 topLayout->addWidget(lab ,ii++,0);
914 914
915 dummy = addWidBool(i18n("Details"), 915 dummy = addWidBool(i18n("Details"),
916 &(KOPrefs::instance()->mWTshowDetails),topFrame); 916 &(KOPrefs::instance()->mWTshowDetails),topFrame);
917 topLayout->addWidget(dummy->checkBox(),ii++,0); 917 topLayout->addWidget(dummy->checkBox(),ii++,0);
918 dummy = addWidBool(i18n("Created time"), 918 dummy = addWidBool(i18n("Created time"),
919 &(KOPrefs::instance()->mWTshowCreated),topFrame); 919 &(KOPrefs::instance()->mWTshowCreated),topFrame);
920 topLayout->addWidget(dummy->checkBox(),ii++,0); 920 topLayout->addWidget(dummy->checkBox(),ii++,0);
921 dummy = addWidBool(i18n("Last modified time"), 921 dummy = addWidBool(i18n("Last modified time"),
922 &(KOPrefs::instance()->mWTshowChanged),topFrame); 922 &(KOPrefs::instance()->mWTshowChanged),topFrame);
923 topLayout->addWidget(dummy->checkBox(),ii++,0); 923 topLayout->addWidget(dummy->checkBox(),ii++,0);
924 924
925 topFrame = addPage(i18n("Conflict detection"),0,0);
926
927 topLayout = new QGridLayout(topFrame,2,1);
928 topLayout->setSpacing(mSpacingHint);
929 topLayout->setMargin(mMarginHint);
930 ii = 0;
931 dummy = addWidBool(i18n("Enable conflict detection"),
932 &(KOPrefs::instance()->mDetectConflicts),topFrame);
933 topLayout->addWidget(dummy->checkBox(), ii++,0);
934 topFrame = new QFrame( topFrame );
935 topLayout->addWidget(topFrame ,ii++,0);
936 topLayout = new QGridLayout(topFrame,4,1);
937 connect ( dummy->checkBox(), SIGNAL( toggled( bool ) ), topFrame, SLOT ( setEnabled( bool ) ) );
938 topLayout->addWidget( new QLabel ( i18n("Conflict detection checks an <b>edited event</b> with other <b>existing events</b> for overlapping. You can define which events are checked:"), topFrame ) , ii++,0);
939 topLayout->addWidget( new QLabel ( i18n("Filter for the edited event"), topFrame ) , ii++,0);
940 mFilterEditItem = new QComboBox( topFrame );
941 topLayout->addWidget(mFilterEditItem,ii++,0);
942 topLayout->addWidget( new QLabel ( i18n("Filter for other existing events"), topFrame ) , ii++,0);
943 mFilterAllItem = new QComboBox( topFrame );
944 topLayout->addWidget(mFilterAllItem,ii++,0);
945 dummy = addWidBool(i18n("Check Allday with Allday"),
946 &(KOPrefs::instance()->mCheckConflictsAllDayAllDay),topFrame);
947 topLayout->addWidget(dummy->checkBox(), ii++,0);
948 dummy = addWidBool(i18n("Check Allday with NonAllday"),
949 &(KOPrefs::instance()->mCheckConflictsAllDayNonAD),topFrame);
950 topLayout->addWidget(dummy->checkBox(), ii++,0);
951 dummy = addWidBool(i18n("Check NonAllday with Allday"),
952 &(KOPrefs::instance()->mCheckConflictsNonADAllDay),topFrame);
953 topLayout->addWidget(dummy->checkBox(), ii++,0);
954 dummy = addWidBool(i18n("Check NonAllday with NonAllday"),
955 &(KOPrefs::instance()->mCheckConflictsNonADNonAD),topFrame);
956 topLayout->addWidget(dummy->checkBox(), ii++,0);
957
958
959
925 960
926 topFrame = addPage(i18n("Alarm"),0,0); 961 topFrame = addPage(i18n("Alarm"),0,0);
927 // DesktopIcon("viewmag",KIcon::SizeMedium)); 962 // DesktopIcon("viewmag",KIcon::SizeMedium));
928 963
929 topLayout = new QGridLayout(topFrame,2,1); 964 topLayout = new QGridLayout(topFrame,2,1);
930 topLayout->setSpacing(mSpacingHint); 965 topLayout->setSpacing(mSpacingHint);
931 topLayout->setMargin(mMarginHint); 966 topLayout->setMargin(mMarginHint);
932 int iii = 0; 967 int iii = 0;
933 968
934 dummy = 969 dummy =
935 addWidBool(i18n("Use internal alarm notification"), 970 addWidBool(i18n("Use internal alarm notification"),
936 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame); 971 &(KOPrefs::instance()->mUseInternalAlarmNotification),topFrame);
937 topLayout->addWidget(dummy->checkBox(),iii++,0); 972 topLayout->addWidget(dummy->checkBox(),iii++,0);
938 973
939 if ( QApplication::desktop()->height() > 240 ) { 974 if ( QApplication::desktop()->height() > 240 ) {
940 975
941 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame); 976 lab = new QLabel( i18n("Note: KO/Pi must be running to notify you about an alarm. Recommended for use on Zaurus: Disable this option and install KO/Pi alarm applet.\n"), topFrame);
942 977
943 topLayout->addWidget(lab ,iii++,0); 978 topLayout->addWidget(lab ,iii++,0);
944 } 979 }
945#ifndef DESKTOP_VERSION 980#ifndef DESKTOP_VERSION
946 lab->setAlignment( AlignLeft|WordBreak|AlignTop); 981 lab->setAlignment( AlignLeft|WordBreak|AlignTop);
947#else 982#else
948 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 983 lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
949 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 984 lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
950#endif 985#endif
951 986
952 QHBox* dummyBox = new QHBox(topFrame); 987 QHBox* dummyBox = new QHBox(topFrame);
953 new QLabel(i18n("Play beeps count:"),dummyBox); 988 new QLabel(i18n("Play beeps count:"),dummyBox);
954 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox); 989 mAlarmPlayBeeps = new QSpinBox(0,500,1,dummyBox);
955 topLayout->addWidget(dummyBox,iii++,0); 990 topLayout->addWidget(dummyBox,iii++,0);
956 991
957 dummyBox = new QHBox(topFrame); 992 dummyBox = new QHBox(topFrame);
958 new QLabel(i18n("Beeps interval in sec:"),dummyBox); 993 new QLabel(i18n("Beeps interval in sec:"),dummyBox);
959 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox); 994 mAlarmBeepInterval = new QSpinBox(1,600,1,dummyBox);
960 topLayout->addWidget(dummyBox,iii++,0); 995 topLayout->addWidget(dummyBox,iii++,0);
961 996
962 dummyBox = new QHBox(topFrame); 997 dummyBox = new QHBox(topFrame);
963 new QLabel(i18n("Default suspend time in min:"),dummyBox); 998 new QLabel(i18n("Default suspend time in min:"),dummyBox);
964 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox); 999 mAlarmSuspendTime = new QSpinBox(1,600,1,dummyBox);
965 topLayout->addWidget(dummyBox,iii++,0); 1000 topLayout->addWidget(dummyBox,iii++,0);
966 1001
967 dummyBox = new QHBox(topFrame); 1002 dummyBox = new QHBox(topFrame);
968 new QLabel(i18n("Auto suspend count:"),dummyBox); 1003 new QLabel(i18n("Auto suspend count:"),dummyBox);
969 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox); 1004 mAlarmSuspendCount = new QSpinBox(0,60,1,dummyBox);
970 topLayout->addWidget(dummyBox,iii++,0); 1005 topLayout->addWidget(dummyBox,iii++,0);
971 1006
972 1007
973 1008
974 QHBox* hbo = new QHBox ( topFrame ); 1009 QHBox* hbo = new QHBox ( topFrame );
975 mDefaultAlarmFile = new QLineEdit(hbo); 1010 mDefaultAlarmFile = new QLineEdit(hbo);
976 QPushButton * loadTemplate = new QPushButton(hbo); 1011 QPushButton * loadTemplate = new QPushButton(hbo);
977 QPixmap icon; 1012 QPixmap icon;
978 if ( QApplication::desktop()->width() < 321 ) 1013 if ( QApplication::desktop()->width() < 321 )
979 icon = SmallIcon("fileimport16"); 1014 icon = SmallIcon("fileimport16");
980 else 1015 else
981 icon = SmallIcon("fileimport"); 1016 icon = SmallIcon("fileimport");
982 loadTemplate->setIconSet (icon ) ; 1017 loadTemplate->setIconSet (icon ) ;
983 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) ); 1018 connect( loadTemplate, SIGNAL( clicked() ), this , SLOT( selectSoundFile() ) );
984 int size = loadTemplate->sizeHint().height(); 1019 int size = loadTemplate->sizeHint().height();
985 loadTemplate->setFixedSize( size, size ); 1020 loadTemplate->setFixedSize( size, size );
986 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame); 1021 //lab = new QLabel( i18n("This setting is useless for 5500 user!"), topFrame);
987 // topLayout->addWidget(lab ,iii++,0); 1022 // topLayout->addWidget(lab ,iii++,0);
988 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame); 1023 lab = new QLabel( i18n("Alarm *.wav file for newly created alarm:"), topFrame);
989 topLayout->addWidget(lab ,iii++,0); 1024 topLayout->addWidget(lab ,iii++,0);
990 topLayout->addWidget(hbo,iii++,0); 1025 topLayout->addWidget(hbo,iii++,0);
991 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame); 1026 // lab = new QLabel( i18n("Note: This does not mean, that for every alarm this file is replayed. This file here is associated with a newly created alarm."), topFrame);
992 1027
993// topLayout->addWidget(lab ,iii++,0); 1028// topLayout->addWidget(lab ,iii++,0);
994// #ifndef DESKTOP_VERSION 1029// #ifndef DESKTOP_VERSION
995// lab->setAlignment( AlignLeft|WordBreak|AlignTop); 1030// lab->setAlignment( AlignLeft|WordBreak|AlignTop);
996// #else 1031// #else
997// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 1032// lab->setAlignment( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
998// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) ); 1033// lab->setSizePolicy( QSizePolicy( QSizePolicy::Ignored , QSizePolicy::Ignored,true) );
999// #endif 1034// #endif
1000 1035
1001 1036
1002} 1037}
1003 1038
1004void KOPrefsDialog::selectSoundFile() 1039void KOPrefsDialog::selectSoundFile()
1005{ 1040{
1006 QString fileName = mDefaultAlarmFile->text(); 1041 QString fileName = mDefaultAlarmFile->text();
1007 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this ); 1042 fileName = KFileDialog::getSaveFileName( mDefaultAlarmFile->text() , "Choose default alarm file", this );
1008 if ( fileName.length() > 0 ) 1043 if ( fileName.length() > 0 )
1009 mDefaultAlarmFile->setText( fileName ); 1044 mDefaultAlarmFile->setText( fileName );
1010} 1045}
1011void KOPrefsDialog::setupFontsTab() 1046void KOPrefsDialog::setupFontsTab()
1012{ 1047{
1013 1048
1014 QFrame *topFrame = addPage(i18n("Fonts"),0,0); 1049 QFrame *topFrame = addPage(i18n("Fonts"),0,0);
1015 // DesktopIcon("fonts",KIcon::SizeMedium)); 1050 // DesktopIcon("fonts",KIcon::SizeMedium));
1016 1051
1017 QGridLayout *topLayout = new QGridLayout(topFrame,7,3); 1052 QGridLayout *topLayout = new QGridLayout(topFrame,7,3);
1018 topLayout->setSpacing(1); 1053 topLayout->setSpacing(1);
1019 topLayout->setMargin(3); 1054 topLayout->setMargin(3);
1020 KPrefsDialogWidFont * tVFont; 1055 KPrefsDialogWidFont * tVFont;
1021 int i = 0; 1056 int i = 0;
1022 KPrefsDialogWidFont *timeLabelsFont = 1057 KPrefsDialogWidFont *timeLabelsFont =
1023 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"), 1058 addWidFont(i18n("23"),i18n("DateNavigator:(nr)"),
1024 &(KOPrefs::instance()->mDateNavigatorFont),topFrame); 1059 &(KOPrefs::instance()->mDateNavigatorFont),topFrame);
1025 topLayout->addWidget(timeLabelsFont->label(),i,0); 1060 topLayout->addWidget(timeLabelsFont->label(),i,0);
1026 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1061 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1027 topLayout->addWidget(timeLabelsFont->button(),i,2); 1062 topLayout->addWidget(timeLabelsFont->button(),i,2);
1028 ++i; 1063 ++i;
1029 1064
1030 1065
1031 timeLabelsFont = 1066 timeLabelsFont =
1032 addWidFont(i18n("Mon 15"),i18n("Date Labels:"), 1067 addWidFont(i18n("Mon 15"),i18n("Date Labels:"),
1033 &(KOPrefs::instance()->mTimeLabelsFont),topFrame); 1068 &(KOPrefs::instance()->mTimeLabelsFont),topFrame);
1034 topLayout->addWidget(timeLabelsFont->label(),i,0); 1069 topLayout->addWidget(timeLabelsFont->label(),i,0);
1035 topLayout->addWidget(timeLabelsFont->preview(),i,1); 1070 topLayout->addWidget(timeLabelsFont->preview(),i,1);
1036 topLayout->addWidget(timeLabelsFont->button(),i,2); 1071 topLayout->addWidget(timeLabelsFont->button(),i,2);
1037 ++i; 1072 ++i;
1038 1073
1039 KPrefsDialogWidFont *timeBarFont = 1074 KPrefsDialogWidFont *timeBarFont =
1040 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"), 1075 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)),i18n("Time bar:"),
1041 &(KOPrefs::instance()->mTimeBarFont),topFrame); 1076 &(KOPrefs::instance()->mTimeBarFont),topFrame);
1042 topLayout->addWidget(timeBarFont->label(),i,0); 1077 topLayout->addWidget(timeBarFont->label(),i,0);
1043 topLayout->addWidget(timeBarFont->preview(),i,1); 1078 topLayout->addWidget(timeBarFont->preview(),i,1);
1044 topLayout->addWidget(timeBarFont->button(),i,2); 1079 topLayout->addWidget(timeBarFont->button(),i,2);
1045 ++i; 1080 ++i;
1046 1081
1047 1082
1048 KPrefsDialogWidFont *marcusBainsFont = 1083 KPrefsDialogWidFont *marcusBainsFont =
1049 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"), 1084 addWidFont(KGlobal::locale()->formatTime(QTime(12,34,23)),i18n("M. Bains line:"),
1050 &(KOPrefs::instance()->mMarcusBainsFont),topFrame); 1085 &(KOPrefs::instance()->mMarcusBainsFont),topFrame);
1051 topLayout->addWidget(marcusBainsFont->label(),i,0); 1086 topLayout->addWidget(marcusBainsFont->label(),i,0);
1052 topLayout->addWidget(marcusBainsFont->preview(),i,1); 1087 topLayout->addWidget(marcusBainsFont->preview(),i,1);
1053 topLayout->addWidget(marcusBainsFont->button(),i,2); 1088 topLayout->addWidget(marcusBainsFont->button(),i,2);
1054 ++i; 1089 ++i;
1055 1090
1056 tVFont = 1091 tVFont =
1057 addWidFont(i18n("Summary"),i18n("Event Viewer:"), 1092 addWidFont(i18n("Summary"),i18n("Event Viewer:"),
1058 &(KOPrefs::instance()->mEventViewFont),topFrame); 1093 &(KOPrefs::instance()->mEventViewFont),topFrame);
1059 topLayout->addWidget(tVFont->label(),i,0); 1094 topLayout->addWidget(tVFont->label(),i,0);
1060 topLayout->addWidget(tVFont->preview(),i,1); 1095 topLayout->addWidget(tVFont->preview(),i,1);
1061 topLayout->addWidget(tVFont->button(),i,2); 1096 topLayout->addWidget(tVFont->button(),i,2);
1062 ++i; 1097 ++i;
1063 1098
1064 1099
1065 1100
1066 tVFont = 1101 tVFont =
1067 addWidFont(i18n("Details"),i18n("EditorBox:"), 1102 addWidFont(i18n("Details"),i18n("EditorBox:"),
1068 &(KOPrefs::instance()->mEditBoxFont),topFrame); 1103 &(KOPrefs::instance()->mEditBoxFont),topFrame);
1069 topLayout->addWidget(tVFont->label(),i,0); 1104 topLayout->addWidget(tVFont->label(),i,0);
1070 topLayout->addWidget(tVFont->preview(),i,1); 1105 topLayout->addWidget(tVFont->preview(),i,1);
1071 topLayout->addWidget(tVFont->button(),i,2); 1106 topLayout->addWidget(tVFont->button(),i,2);
1072 ++i; 1107 ++i;
1073 1108
1074 1109
1075 1110
1076 topLayout->setColStretch(1,1); 1111 topLayout->setColStretch(1,1);
1077 topLayout->setRowStretch(4,1); 1112 topLayout->setRowStretch(4,1);
1078 1113
1079 1114
1080 i = 0; 1115 i = 0;
1081 topFrame = addPage(i18n("View Fonts"),0, 1116 topFrame = addPage(i18n("View Fonts"),0,
1082 DesktopIcon("fonts",KIcon::SizeMedium)); 1117 DesktopIcon("fonts",KIcon::SizeMedium));
1083 1118
1084 topLayout = new QGridLayout(topFrame,7,3); 1119 topLayout = new QGridLayout(topFrame,7,3);
1085 topLayout->setSpacing(1); 1120 topLayout->setSpacing(1);
1086 topLayout->setMargin(3); 1121 topLayout->setMargin(3);
1087 1122
1088 tVFont = 1123 tVFont =
1089 addWidFont(i18n("Configure KO"),i18n("What's Next View:"), 1124 addWidFont(i18n("Configure KO"),i18n("What's Next View:"),
1090 &(KOPrefs::instance()->mWhatsNextFont),topFrame); 1125 &(KOPrefs::instance()->mWhatsNextFont),topFrame);
1091 topLayout->addWidget(tVFont->label(),i,0); 1126 topLayout->addWidget(tVFont->label(),i,0);
1092 topLayout->addWidget(tVFont->preview(),i,1); 1127 topLayout->addWidget(tVFont->preview(),i,1);
1093 topLayout->addWidget(tVFont->button(),i,2); 1128 topLayout->addWidget(tVFont->button(),i,2);
1094 ++i; 1129 ++i;
1095 KPrefsDialogWidFont *agendaViewFont = 1130 KPrefsDialogWidFont *agendaViewFont =
1096 addWidFont(i18n("Event text"),i18n("Agenda view:"), 1131 addWidFont(i18n("Event text"),i18n("Agenda view:"),
1097 &(KOPrefs::instance()->mAgendaViewFont),topFrame); 1132 &(KOPrefs::instance()->mAgendaViewFont),topFrame);
1098 topLayout->addWidget(agendaViewFont->label(),i,0); 1133 topLayout->addWidget(agendaViewFont->label(),i,0);
1099 topLayout->addWidget(agendaViewFont->preview(),i,1); 1134 topLayout->addWidget(agendaViewFont->preview(),i,1);
1100 topLayout->addWidget(agendaViewFont->button(),i,2); 1135 topLayout->addWidget(agendaViewFont->button(),i,2);
1101 ++i; 1136 ++i;
1102 1137
1103 1138
1104 KPrefsDialogWidFont *monthViewFont = 1139 KPrefsDialogWidFont *monthViewFont =
1105 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"), 1140 addWidFont(KGlobal::locale()->formatTime(QTime(12,34)) + " " + i18n("Event"),
1106 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame); 1141 i18n("Month view:"),&(KOPrefs::instance()->mMonthViewFont),topFrame);
1107 topLayout->addWidget(monthViewFont->label(),i,0); 1142 topLayout->addWidget(monthViewFont->label(),i,0);
1108 topLayout->addWidget(monthViewFont->preview(),i,1); 1143 topLayout->addWidget(monthViewFont->preview(),i,1);
1109 topLayout->addWidget(monthViewFont->button(),i,2); 1144 topLayout->addWidget(monthViewFont->button(),i,2);
1110 ++i; 1145 ++i;
1111 1146
1112 1147
1113 KPrefsDialogWidFont *lVFont = 1148 KPrefsDialogWidFont *lVFont =
1114 addWidFont(i18n("Event"),i18n("List View:"), 1149 addWidFont(i18n("Event"),i18n("List View:"),
1115 &(KOPrefs::instance()->mListViewFont),topFrame); 1150 &(KOPrefs::instance()->mListViewFont),topFrame);
1116 topLayout->addWidget(lVFont->label(),i,0); 1151 topLayout->addWidget(lVFont->label(),i,0);
1117 topLayout->addWidget(lVFont->preview(),i,1); 1152 topLayout->addWidget(lVFont->preview(),i,1);
1118 topLayout->addWidget(lVFont->button(),i,2); 1153 topLayout->addWidget(lVFont->button(),i,2);
1119 ++i; 1154 ++i;
1120 1155
1121 1156
1122 tVFont = 1157 tVFont =
1123 addWidFont(i18n("ToDo"),i18n("ToDoView:"), 1158 addWidFont(i18n("ToDo"),i18n("ToDoView:"),
1124 &(KOPrefs::instance()->mTodoViewFont),topFrame); 1159 &(KOPrefs::instance()->mTodoViewFont),topFrame);
1125 topLayout->addWidget(tVFont->label(),i,0); 1160 topLayout->addWidget(tVFont->label(),i,0);
1126 topLayout->addWidget(tVFont->preview(),i,1); 1161 topLayout->addWidget(tVFont->preview(),i,1);
1127 topLayout->addWidget(tVFont->button(),i,2); 1162 topLayout->addWidget(tVFont->button(),i,2);
1128 ++i; 1163 ++i;
1129 1164
1130 1165
1131 tVFont = 1166 tVFont =
1132 addWidFont(i18n("Today"),i18n("JournalView:"), 1167 addWidFont(i18n("Today"),i18n("JournalView:"),
1133 &(KOPrefs::instance()->mJornalViewFont),topFrame); 1168 &(KOPrefs::instance()->mJornalViewFont),topFrame);
1134 topLayout->addWidget(tVFont->label(),i,0); 1169 topLayout->addWidget(tVFont->label(),i,0);
1135 topLayout->addWidget(tVFont->preview(),i,1); 1170 topLayout->addWidget(tVFont->preview(),i,1);
1136 topLayout->addWidget(tVFont->button(),i,2); 1171 topLayout->addWidget(tVFont->button(),i,2);
1137 ++i; 1172 ++i;
1138 1173
1139 1174
1140 1175
1141 1176
1142 topLayout->setColStretch(1,1); 1177 topLayout->setColStretch(1,1);
1143 topLayout->setRowStretch(4,1); 1178 topLayout->setRowStretch(4,1);
1144 1179
1145 1180
1146 1181
1147 1182
1148} 1183}
1149 1184
1150void KOPrefsDialog::setupColorsTab() 1185void KOPrefsDialog::setupColorsTab()
1151{ 1186{
1152 QFrame *topFrame = addPage(i18n("Colors"),0,0); 1187 QFrame *topFrame = addPage(i18n("Colors"),0,0);
1153 // DesktopIcon("colorize",KIcon::SizeMedium)); 1188 // DesktopIcon("colorize",KIcon::SizeMedium));
1154 1189
1155 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 1190 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
1156 // topLayout->setSpacing(mSpacingHint); 1191 // topLayout->setSpacing(mSpacingHint);
1157 // topLayout->setMargin(mMarginHint); 1192 // topLayout->setMargin(mMarginHint);
1158 1193
1159 topLayout->setSpacing(2); 1194 topLayout->setSpacing(2);
1160 topLayout->setMargin(3); 1195 topLayout->setMargin(3);
1161 1196
1162 int ii = 1; 1197 int ii = 1;
1163 QGroupBox *categoryGroup ; 1198 QGroupBox *categoryGroup ;
1164 1199
1165 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"), 1200 categoryGroup = new QGroupBox(1,Vertical,i18n("Categories"),
1166 topFrame); 1201 topFrame);
1167 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1); 1202 topLayout->addMultiCellWidget(categoryGroup,0,0,0,1);
1168 1203
1169 mCategoryCombo = new QComboBox(categoryGroup); 1204 mCategoryCombo = new QComboBox(categoryGroup);
1170 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1205 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1171 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor())); 1206 connect(mCategoryCombo,SIGNAL(activated(int)),SLOT(updateCategoryColor()));
1172 1207
1173 mCategoryButton = new KColorButton(categoryGroup); 1208 mCategoryButton = new KColorButton(categoryGroup);
1174 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor())); 1209 connect(mCategoryButton,SIGNAL(changed(const QColor &)),SLOT(setCategoryColor()));
1175 updateCategoryColor(); 1210 updateCategoryColor();
1176 1211
1177 1212
1178 // Holiday Color 1213 // Holiday Color
1179 1214
1180 KPrefsDialogWidColor *holidayColor = 1215 KPrefsDialogWidColor *holidayColor =
1181 addWidColor(i18n("Holiday color:"), 1216 addWidColor(i18n("Holiday color:"),
1182 &(KOPrefs::instance()->mHolidayColor),topFrame); 1217 &(KOPrefs::instance()->mHolidayColor),topFrame);
1183 topLayout->addWidget(holidayColor->label(),ii,0); 1218 topLayout->addWidget(holidayColor->label(),ii,0);
1184 topLayout->addWidget(holidayColor->button(),ii++,1); 1219 topLayout->addWidget(holidayColor->button(),ii++,1);
1185 1220
1186 // Highlight Color 1221 // Highlight Color
1187 KPrefsDialogWidColor *highlightColor = 1222 KPrefsDialogWidColor *highlightColor =
1188 addWidColor(i18n("Highlight color:"), 1223 addWidColor(i18n("Highlight color:"),
1189 &(KOPrefs::instance()->mHighlightColor),topFrame); 1224 &(KOPrefs::instance()->mHighlightColor),topFrame);
1190 topLayout->addWidget(highlightColor->label(),ii,0); 1225 topLayout->addWidget(highlightColor->label(),ii,0);
1191 topLayout->addWidget(highlightColor->button(),ii++,1); 1226 topLayout->addWidget(highlightColor->button(),ii++,1);
1192 1227
1193 // Event color 1228 // Event color
1194 KPrefsDialogWidColor *eventColor = 1229 KPrefsDialogWidColor *eventColor =
1195 addWidColor(i18n("Default event color:"), 1230 addWidColor(i18n("Default event color:"),
1196 &(KOPrefs::instance()->mEventColor),topFrame); 1231 &(KOPrefs::instance()->mEventColor),topFrame);
1197 topLayout->addWidget(eventColor->label(),ii,0); 1232 topLayout->addWidget(eventColor->label(),ii,0);
1198 topLayout->addWidget(eventColor->button(),ii++,1); 1233 topLayout->addWidget(eventColor->button(),ii++,1);
1199 eventColor = 1234 eventColor =
1200 addWidColor(i18n("Default todo done color:"), 1235 addWidColor(i18n("Default todo done color:"),
1201 &(KOPrefs::instance()->mTodoDoneColor),topFrame); 1236 &(KOPrefs::instance()->mTodoDoneColor),topFrame);
1202 topLayout->addWidget(eventColor->label(),ii,0); 1237 topLayout->addWidget(eventColor->label(),ii,0);
1203 topLayout->addWidget(eventColor->button(),ii++,1); 1238 topLayout->addWidget(eventColor->button(),ii++,1);
1204 1239
1205 if ( QApplication::desktop()->height() <= 240 ) { 1240 if ( QApplication::desktop()->height() <= 240 ) {
1206 topFrame = addPage(i18n("Colors") +" 2",0,0); 1241 topFrame = addPage(i18n("Colors") +" 2",0,0);
1207 // DesktopIcon("colorize",KIcon::SizeMedium)); 1242 // DesktopIcon("colorize",KIcon::SizeMedium));
1208 1243
1209 topLayout = new QGridLayout(topFrame,5,2); 1244 topLayout = new QGridLayout(topFrame,5,2);
1210 // topLayout->setSpacing(mSpacingHint); 1245 // topLayout->setSpacing(mSpacingHint);
1211 // topLayout->setMargin(mMarginHint); 1246 // topLayout->setMargin(mMarginHint);
1212 1247
1213 topLayout->setSpacing(2); 1248 topLayout->setSpacing(2);
1214 topLayout->setMargin(3); 1249 topLayout->setMargin(3);
1215 } 1250 }
1216 1251
1217 1252
1218 // agenda view background color 1253 // agenda view background color
1219 KPrefsDialogWidColor *agendaBgColor = 1254 KPrefsDialogWidColor *agendaBgColor =
1220 addWidColor(i18n("Agenda view background color:"), 1255 addWidColor(i18n("Agenda view background color:"),
1221 &(KOPrefs::instance()->mAgendaBgColor),topFrame); 1256 &(KOPrefs::instance()->mAgendaBgColor),topFrame);
1222 topLayout->addWidget(agendaBgColor->label(),ii,0); 1257 topLayout->addWidget(agendaBgColor->label(),ii,0);
1223 topLayout->addWidget(agendaBgColor->button(),ii++,1); 1258 topLayout->addWidget(agendaBgColor->button(),ii++,1);
1224 1259
1225 // working hours color 1260 // working hours color
1226 KPrefsDialogWidColor *workingHoursColor = 1261 KPrefsDialogWidColor *workingHoursColor =
1227 addWidColor(i18n("Working hours color:"), 1262 addWidColor(i18n("Working hours color:"),
1228 &(KOPrefs::instance()->mWorkingHoursColor),topFrame); 1263 &(KOPrefs::instance()->mWorkingHoursColor),topFrame);
1229 topLayout->addWidget(workingHoursColor->label(),ii,0); 1264 topLayout->addWidget(workingHoursColor->label(),ii,0);
1230 topLayout->addWidget(workingHoursColor->button(),ii++,1); 1265 topLayout->addWidget(workingHoursColor->button(),ii++,1);
1231 1266
1232 KPrefsDialogWidBool *sb = 1267 KPrefsDialogWidBool *sb =
1233 addWidBool(i18n("Use colors for application:"), 1268 addWidBool(i18n("Use colors for application:"),
1234 &(KOPrefs::instance()->mUseAppColors),topFrame); 1269 &(KOPrefs::instance()->mUseAppColors),topFrame);
1235 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 ); 1270 topLayout->addMultiCellWidget(sb->checkBox(), ii, ii, 0,1 );
1236 1271
1237 ii++; 1272 ii++;
1238 KPrefsDialogWidColor * workingHoursColor1 = 1273 KPrefsDialogWidColor * workingHoursColor1 =
1239 addWidColor(i18n("Buttons, menus, etc.:"), 1274 addWidColor(i18n("Buttons, menus, etc.:"),
1240 &(KOPrefs::instance()->mAppColor1),topFrame); 1275 &(KOPrefs::instance()->mAppColor1),topFrame);
1241 topLayout->addWidget(workingHoursColor1->label(),ii,0); 1276 topLayout->addWidget(workingHoursColor1->label(),ii,0);
1242 topLayout->addWidget(workingHoursColor1->button(),ii++,1); 1277 topLayout->addWidget(workingHoursColor1->button(),ii++,1);
1243 1278
1244 KPrefsDialogWidColor * workingHoursColor2 = 1279 KPrefsDialogWidColor * workingHoursColor2 =
1245 addWidColor(i18n("Frames, labels, etc.:"), 1280 addWidColor(i18n("Frames, labels, etc.:"),
1246 &(KOPrefs::instance()->mAppColor2),topFrame); 1281 &(KOPrefs::instance()->mAppColor2),topFrame);
1247 topLayout->addWidget(workingHoursColor2->label(),ii,0); 1282 topLayout->addWidget(workingHoursColor2->label(),ii,0);
1248 topLayout->addWidget(workingHoursColor2->button(),ii++,1); 1283 topLayout->addWidget(workingHoursColor2->button(),ii++,1);
1249 1284
1250 1285
1251 1286
1252} 1287}
1253 1288
1254void KOPrefsDialog::setCategoryColor() 1289void KOPrefsDialog::setCategoryColor()
1255{ 1290{
1256 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color())); 1291 mCategoryDict.replace(mCategoryCombo->currentText(), new QColor(mCategoryButton->color()));
1257} 1292}
1258 1293
1259void KOPrefsDialog::updateCategoryColor() 1294void KOPrefsDialog::updateCategoryColor()
1260{ 1295{
1261 QString cat = mCategoryCombo->currentText(); 1296 QString cat = mCategoryCombo->currentText();
1262 QColor *color = mCategoryDict.find(cat); 1297 QColor *color = mCategoryDict.find(cat);
1263 if (!color) { 1298 if (!color) {
1264 color = KOPrefs::instance()->categoryColor(cat); 1299 color = KOPrefs::instance()->categoryColor(cat);
1265 } 1300 }
1266 if (color) { 1301 if (color) {
1267 mCategoryButton->setColor(*color); 1302 mCategoryButton->setColor(*color);
1268 } 1303 }
1269} 1304}
1270 1305
1271void KOPrefsDialog::setupPrinterTab() 1306void KOPrefsDialog::setupPrinterTab()
1272{ 1307{
1273 mPrinterTab = addPage(i18n("Printing"),0, 1308 mPrinterTab = addPage(i18n("Printing"),0,
1274 DesktopIcon("fileprint",KIcon::SizeMedium)); 1309 DesktopIcon("fileprint",KIcon::SizeMedium));
1275 1310
1276 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2); 1311 QGridLayout *topLayout = new QGridLayout(mPrinterTab,5,2);
1277 topLayout->setSpacing(mSpacingHint); 1312 topLayout->setSpacing(mSpacingHint);
1278 topLayout->setMargin(mMarginHint); 1313 topLayout->setMargin(mMarginHint);
1279 1314
1280 topLayout->setRowStretch(4,1); 1315 topLayout->setRowStretch(4,1);
1281} 1316}
1282 1317
1283void KOPrefsDialog::setupGroupSchedulingTab() 1318void KOPrefsDialog::setupGroupSchedulingTab()
1284{ 1319{
1285#if 0 1320#if 0
1286 QFrame *topFrame = addPage(i18n("Group Scheduling"),0, 1321 QFrame *topFrame = addPage(i18n("Group Scheduling"),0,
1287 DesktopIcon("personal",KIcon::SizeMedium)); 1322 DesktopIcon("personal",KIcon::SizeMedium));
1288 1323
1289 QGridLayout *topLayout = new QGridLayout(topFrame,6,2); 1324 QGridLayout *topLayout = new QGridLayout(topFrame,6,2);
1290 topLayout->setSpacing(mSpacingHint); 1325 topLayout->setSpacing(mSpacingHint);
1291 topLayout->setMargin(mMarginHint); 1326 topLayout->setMargin(mMarginHint);
1292 1327
1293#if 0 1328#if 0
1294 KPrefsDialogWidRadios *schedulerGroup = 1329 KPrefsDialogWidRadios *schedulerGroup =
1295 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler), 1330 addWidRadios(i18n("Scheduler Mail Client"),&(KOPrefs::instance()->mIMIPScheduler),
1296 topFrame); 1331 topFrame);
1297 schedulerGroup->addRadio("Dummy"); // Only for debugging 1332 schedulerGroup->addRadio("Dummy"); // Only for debugging
1298 schedulerGroup->addRadio(i18n("Mail client")); 1333 schedulerGroup->addRadio(i18n("Mail client"));
1299 1334
1300 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1); 1335 topLayout->addMultiCellWidget(schedulerGroup->groupBox(),0,0,0,1);
1301#endif 1336#endif
1302 1337
1303 KPrefsDialogWidRadios *sendGroup = 1338 KPrefsDialogWidRadios *sendGroup =
1304 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend), 1339 addWidRadios(i18n("Scheduler Mails Should Be"),&(KOPrefs::instance()->mIMIPSend),
1305 topFrame); 1340 topFrame);
1306 sendGroup->addRadio(i18n("Send to outbox")); 1341 sendGroup->addRadio(i18n("Send to outbox"));
1307 sendGroup->addRadio(i18n("Send directly")); 1342 sendGroup->addRadio(i18n("Send directly"));
1308 1343
1309 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1); 1344 topLayout->addMultiCellWidget(sendGroup->groupBox(),1,1,0,1);
1310 1345
1311 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1); 1346 topLayout->addMultiCellWidget(new QLabel(i18n("Additional email addresses:"),topFrame),2,2,0,1);
1312 mAMails = new QListView(topFrame); 1347 mAMails = new QListView(topFrame);
1313 mAMails->addColumn(i18n("Email"),300); 1348 mAMails->addColumn(i18n("Email"),300);
1314 topLayout->addMultiCellWidget(mAMails,3,3,0,1); 1349 topLayout->addMultiCellWidget(mAMails,3,3,0,1);
1315 1350
1316 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0); 1351 topLayout->addWidget(new QLabel(i18n("Additional email address:"),topFrame),4,0);
1317 aEmailsEdit = new QLineEdit(topFrame); 1352 aEmailsEdit = new QLineEdit(topFrame);
1318 aEmailsEdit->setEnabled(false); 1353 aEmailsEdit->setEnabled(false);
1319 topLayout->addWidget(aEmailsEdit,4,1); 1354 topLayout->addWidget(aEmailsEdit,4,1);
1320 1355
1321 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new"); 1356 QPushButton *add = new QPushButton(i18n("New"),topFrame,"new");
1322 topLayout->addWidget(add,5,0); 1357 topLayout->addWidget(add,5,0);
1323 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove"); 1358 QPushButton *del = new QPushButton(i18n("Remove"),topFrame,"remove");
1324 topLayout->addWidget(del,5,1); 1359 topLayout->addWidget(del,5,1);
1325 1360
1326 //topLayout->setRowStretch(2,1); 1361 //topLayout->setRowStretch(2,1);
1327 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) ); 1362 connect(add, SIGNAL( clicked() ), this, SLOT(addItem()) );
1328 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) ); 1363 connect(del, SIGNAL( clicked() ), this, SLOT(removeItem()) );
1329 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem())); 1364 connect(aEmailsEdit,SIGNAL( textChanged(const QString&) ), this,SLOT(updateItem()));
1330 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput())); 1365 connect(mAMails,SIGNAL(selectionChanged(QListViewItem *)),SLOT(updateInput()));
1331#endif 1366#endif
1332} 1367}
1333 1368
1334void KOPrefsDialog::setupGroupAutomationTab() 1369void KOPrefsDialog::setupGroupAutomationTab()
1335{ 1370{
1336 return; 1371 return;
1337 QFrame *topFrame = addPage(i18n("Group Automation"),0, 1372 QFrame *topFrame = addPage(i18n("Group Automation"),0,
1338 DesktopIcon("personal",KIcon::SizeMedium)); 1373 DesktopIcon("personal",KIcon::SizeMedium));
1339 1374
1340 QGridLayout *topLayout = new QGridLayout(topFrame,5,1); 1375 QGridLayout *topLayout = new QGridLayout(topFrame,5,1);
1341 topLayout->setSpacing(mSpacingHint); 1376 topLayout->setSpacing(mSpacingHint);
1342 topLayout->setMargin(mMarginHint); 1377 topLayout->setMargin(mMarginHint);
1343 1378
1344 KPrefsDialogWidRadios *autoRefreshGroup = 1379 KPrefsDialogWidRadios *autoRefreshGroup =
1345 addWidRadios(i18n("Auto Send Refresh"), 1380 addWidRadios(i18n("Auto Send Refresh"),
1346 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame); 1381 &(KOPrefs::instance()->mIMIPAutoRefresh),topFrame);
1347 autoRefreshGroup->addRadio(i18n("Never")); 1382 autoRefreshGroup->addRadio(i18n("Never"));
1348 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook")); 1383 autoRefreshGroup->addRadio(i18n("If attendee is in addressbook"));
1349 //autoRefreshGroup->addRadio(i18n("selected emails")); 1384 //autoRefreshGroup->addRadio(i18n("selected emails"));
1350 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0); 1385 topLayout->addMultiCellWidget(autoRefreshGroup->groupBox(),0,0,0,0);
1351 1386
1352 KPrefsDialogWidRadios *autoInsertGroup = 1387 KPrefsDialogWidRadios *autoInsertGroup =
1353 addWidRadios(i18n("Auto Insert IMIP Replies"), 1388 addWidRadios(i18n("Auto Insert IMIP Replies"),
1354 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame); 1389 &(KOPrefs::instance()->mIMIPAutoInsertReply),topFrame);
1355 autoInsertGroup->addRadio(i18n("Never")); 1390 autoInsertGroup->addRadio(i18n("Never"));
1356 autoInsertGroup->addRadio(i18n("If attendee is in addressbook")); 1391 autoInsertGroup->addRadio(i18n("If attendee is in addressbook"));
1357 //autoInsertGroup->addRadio(i18n("selected emails")); 1392 //autoInsertGroup->addRadio(i18n("selected emails"));
1358 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0); 1393 topLayout->addMultiCellWidget(autoInsertGroup->groupBox(),1,1,0,0);
1359 1394
1360 KPrefsDialogWidRadios *autoRequestGroup = 1395 KPrefsDialogWidRadios *autoRequestGroup =
1361 addWidRadios(i18n("Auto Insert IMIP Requests"), 1396 addWidRadios(i18n("Auto Insert IMIP Requests"),
1362 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame); 1397 &(KOPrefs::instance()->mIMIPAutoInsertRequest),topFrame);
1363 autoRequestGroup->addRadio(i18n("Never")); 1398 autoRequestGroup->addRadio(i18n("Never"));
1364 autoRequestGroup->addRadio(i18n("If organizer is in addressbook")); 1399 autoRequestGroup->addRadio(i18n("If organizer is in addressbook"));
1365 //autoInsertGroup->addRadio(i18n("selected emails")); 1400 //autoInsertGroup->addRadio(i18n("selected emails"));
1366 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0); 1401 topLayout->addMultiCellWidget(autoRequestGroup->groupBox(),2,2,0,0);
1367 1402
1368 KPrefsDialogWidRadios *autoFreeBusyGroup = 1403 KPrefsDialogWidRadios *autoFreeBusyGroup =
1369 addWidRadios(i18n("Auto Send FreeBusy Information"), 1404 addWidRadios(i18n("Auto Send FreeBusy Information"),
1370 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame); 1405 &(KOPrefs::instance()->mIMIPAutoFreeBusy),topFrame);
1371 autoFreeBusyGroup->addRadio(i18n("Never")); 1406 autoFreeBusyGroup->addRadio(i18n("Never"));
1372 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook")); 1407 autoFreeBusyGroup->addRadio(i18n("If requested from an email in addressbook"));
1373 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1408 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1374 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0); 1409 topLayout->addMultiCellWidget(autoFreeBusyGroup->groupBox(),3,3,0,0);
1375 1410
1376 KPrefsDialogWidRadios *autoFreeBusyReplyGroup = 1411 KPrefsDialogWidRadios *autoFreeBusyReplyGroup =
1377 addWidRadios(i18n("Auto Save FreeBusy Replies"), 1412 addWidRadios(i18n("Auto Save FreeBusy Replies"),
1378 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame); 1413 &(KOPrefs::instance()->mIMIPAutoFreeBusyReply),topFrame);
1379 autoFreeBusyReplyGroup->addRadio(i18n("Never")); 1414 autoFreeBusyReplyGroup->addRadio(i18n("Never"));
1380 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook")); 1415 autoFreeBusyReplyGroup->addRadio(i18n("If attendee is in addressbook"));
1381 //autoFreeBusyGroup->addRadio(i18n("selected emails")); 1416 //autoFreeBusyGroup->addRadio(i18n("selected emails"));
1382 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0); 1417 topLayout->addMultiCellWidget(autoFreeBusyReplyGroup->groupBox(),4,4,0,0);
1383} 1418}
1384 1419
1385void KOPrefsDialog::showPrinterTab() 1420void KOPrefsDialog::showPrinterTab()
1386{ 1421{
1387 showPage(pageIndex(mPrinterTab)); 1422 showPage(pageIndex(mPrinterTab));
1388} 1423}
1389 1424
1390 1425
1391void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text, 1426void KOPrefsDialog::setCombo(QComboBox *combo, const QString & text,
1392 const QStringList *tags) 1427 const QStringList *tags)
1393{ 1428{
1394 if (tags) { 1429 if (tags) {
1395 int i = tags->findIndex(text); 1430 int i = tags->findIndex(text);
1396 if (i > 0) combo->setCurrentItem(i); 1431 if (i > 0) combo->setCurrentItem(i);
1397 } else { 1432 } else {
1398 for(int i=0;i<combo->count();++i) { 1433 for(int i=0;i<combo->count();++i) {
1399 if (combo->text(i) == text) { 1434 if (combo->text(i) == text) {
1400 combo->setCurrentItem(i); 1435 combo->setCurrentItem(i);
1401 break; 1436 break;
1402 } 1437 }
1403 } 1438 }
1404 } 1439 }
1405} 1440}
1406 1441
1407void KOPrefsDialog::usrReadConfig() 1442void KOPrefsDialog::usrReadConfig()
1408{ 1443{
1409 1444
1410 mNameEdit->setText(KOPrefs::instance()->fullName()); 1445 mNameEdit->setText(KOPrefs::instance()->fullName());
1411 mEmailEdit->setText(KOPrefs::instance()->email()); 1446 mEmailEdit->setText(KOPrefs::instance()->email());
1412 1447
1413 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval); 1448 mAutoSaveIntervalSpin->setValue(KOPrefs::instance()->mAutoSaveInterval);
1414 1449
1415 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime); 1450 mStartTimeSpin->setValue(KOPrefs::instance()->mStartTime);
1416 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration); 1451 mDefaultDurationSpin->setValue(KOPrefs::instance()->mDefaultDuration);
1417 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime); 1452 mAlarmTimeCombo->setCurrentItem(KOPrefs::instance()->mAlarmTime);
1418 1453
1419 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays); 1454 mNextXDaysSpin->setValue(KOPrefs::instance()->mNextXDays);
1420 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays); 1455 mWhatsNextSpin->setValue(KOPrefs::instance()->mWhatsNextDays);
1421 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios); 1456 mPrioSpin->setValue(KOPrefs::instance()->mWhatsNextPrios);
1422 // mAMails->clear(); 1457 // mAMails->clear();
1423 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin(); 1458 // for ( QStringList::Iterator it = KOPrefs::instance()->mAdditionalMails.begin();
1424// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) { 1459// it != KOPrefs::instance()->mAdditionalMails.end(); ++it ) {
1425// QListViewItem *item = new QListViewItem(mAMails); 1460// QListViewItem *item = new QListViewItem(mAMails);
1426// item->setText(0,*it); 1461// item->setText(0,*it);
1427// mAMails->insertItem(item); 1462// mAMails->insertItem(item);
1428// } 1463// }
1429 1464
1430 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile); 1465 //that soundmLocalTempFile->setText(KOPrefs::instance()->mLocalTempFile);
1431 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile); 1466 mDefaultAlarmFile->setText(KOPrefs::instance()->mDefaultAlarmFile);
1432 updateCategories(); 1467 updateCategories();
1433 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps ); 1468 mAlarmPlayBeeps->setValue(KOPrefs::instance()->mAlarmPlayBeeps );
1434 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime ); 1469 mAlarmSuspendTime->setValue(KOPrefs::instance()->mAlarmSuspendTime );
1435 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount ); 1470 mAlarmSuspendCount->setValue(KOPrefs::instance()->mAlarmSuspendCount );
1436 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval ); 1471 mAlarmBeepInterval->setValue(KOPrefs::instance()->mAlarmBeepInterval );
1437 mCatDefaultColor = KOPrefs::instance()->mEventColor; 1472 mCatDefaultColor = KOPrefs::instance()->mEventColor;
1473
1474
1475 KConfig cfgko(locateLocal("config","korganizerrc"));
1476 cfgko.setGroup("General");
1477 QStringList temp = cfgko.readListEntry("CalendarFilters");
1478 temp.prepend(i18n("No Filter") );
1479 mFilterEditItem->insertStringList( temp );
1480 mFilterAllItem->insertStringList( temp );
1481 int index = temp.findIndex( KOPrefs::instance()->mFilterConflictEditItem );
1482 if ( index >= 0 )
1483 mFilterEditItem->setCurrentItem( index );
1484 index = temp.findIndex( KOPrefs::instance()->mFilterConflictAllItem );
1485 if ( index >= 0 )
1486 mFilterAllItem->setCurrentItem( index );
1438} 1487}
1439 1488
1440 1489
1441void KOPrefsDialog::usrWriteConfig() 1490void KOPrefsDialog::usrWriteConfig()
1442{ 1491{
1443 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text(); 1492 KOPrefs::instance()->mDefaultAlarmFile =mDefaultAlarmFile->text();
1444 KOPrefs::instance()->setFullName(mNameEdit->text()); 1493 KOPrefs::instance()->setFullName(mNameEdit->text());
1445 KOPrefs::instance()->setEmail(mEmailEdit->text()); 1494 KOPrefs::instance()->setEmail(mEmailEdit->text());
1446 1495
1447 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value(); 1496 KOPrefs::instance()->mAutoSaveInterval = mAutoSaveIntervalSpin->value();
1448 KOPrefs::instance()->mStartTime = mStartTimeSpin->value(); 1497 KOPrefs::instance()->mStartTime = mStartTimeSpin->value();
1449 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value(); 1498 KOPrefs::instance()->mDefaultDuration = mDefaultDurationSpin->value();
1450 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem(); 1499 KOPrefs::instance()->mAlarmTime = mAlarmTimeCombo->currentItem();
1451 if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) { 1500 if ( mCatDefaultColor != KOPrefs::instance()->mEventColor ) {
1452 QStringList cat = KOPrefs::instance()->mCustomCategories; 1501 QStringList cat = KOPrefs::instance()->mCustomCategories;
1453 int iii = 0; 1502 int iii = 0;
1454 while ( iii < cat.count() ) { 1503 while ( iii < cat.count() ) {
1455 if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor ) 1504 if ( *KOPrefs::instance()->categoryColor( cat[ iii ] ) == mCatDefaultColor )
1456 KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor ); 1505 KOPrefs::instance()->setCategoryColor( cat[ iii ], KOPrefs::instance()->mEventColor );
1457 ++iii; 1506 ++iii;
1458 } 1507 }
1459 } 1508 }
1460 QDictIterator<QColor> it(mCategoryDict); 1509 QDictIterator<QColor> it(mCategoryDict);
1461 while (it.current()) { 1510 while (it.current()) {
1462 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current()); 1511 KOPrefs::instance()->setCategoryColor(it.currentKey(),*it.current());
1463 ++it; 1512 ++it;
1464 } 1513 }
1465 1514
1466 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value(); 1515 KOPrefs::instance()->mNextXDays = mNextXDaysSpin->value();
1467 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value(); 1516 KOPrefs::instance()->mWhatsNextDays = mWhatsNextSpin->value();
1468 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value(); 1517 KOPrefs::instance()->mWhatsNextPrios = mPrioSpin->value();
1469 1518
1470 KOPrefs::instance()->mAdditionalMails.clear(); 1519 KOPrefs::instance()->mAdditionalMails.clear();
1471 // QListViewItem *item; 1520 // QListViewItem *item;
1472 // item = mAMails->firstChild(); 1521 // item = mAMails->firstChild();
1473 // while (item) 1522 // while (item)
1474 // { 1523 // {
1475 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) ); 1524 // KOPrefs::instance()->mAdditionalMails.append( item->text(0) );
1476 // item = item->nextSibling(); 1525 // item = item->nextSibling();
1477 // } 1526 // }
1478 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value(); 1527 KOPrefs::instance()->mAlarmPlayBeeps = mAlarmPlayBeeps->value();
1479 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ; 1528 KOPrefs::instance()->mAlarmSuspendTime = mAlarmSuspendTime->value() ;
1480 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ; 1529 KOPrefs::instance()->mAlarmSuspendCount= mAlarmSuspendCount->value() ;
1481 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ; 1530 KOPrefs::instance()->mAlarmBeepInterval= mAlarmBeepInterval->value() ;
1531
1532 KOPrefs::instance()->mFilterConflictEditItem = mFilterEditItem->currentText();
1533 KOPrefs::instance()->mFilterConflictAllItem = mFilterAllItem->currentText();
1482} 1534}
1483 1535
1484void KOPrefsDialog::updateCategories() 1536void KOPrefsDialog::updateCategories()
1485{ 1537{
1486 mCategoryCombo->clear(); 1538 mCategoryCombo->clear();
1487 mCategoryDict.clear(); 1539 mCategoryDict.clear();
1488 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories); 1540 mCategoryCombo->insertStringList(KOPrefs::instance()->mCustomCategories);
1489 updateCategoryColor(); 1541 updateCategoryColor();
1490} 1542}
1491 1543
1492void KOPrefsDialog::toggleEmailSettings(bool on) 1544void KOPrefsDialog::toggleEmailSettings(bool on)
1493{ 1545{
1494 if (on) { 1546 if (on) {
1495 mEmailEdit->setEnabled(false); 1547 mEmailEdit->setEnabled(false);
1496 mNameEdit->setEnabled(false); 1548 mNameEdit->setEnabled(false);
1497 mEmailLabel->setEnabled(false); 1549 mEmailLabel->setEnabled(false);
1498 mNameLabel->setEnabled(false); 1550 mNameLabel->setEnabled(false);
1499 1551
1500 KEMailSettings settings; 1552 KEMailSettings settings;
1501 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName)); 1553 mNameEdit->setText(settings.getSetting(KEMailSettings::RealName));
1502 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress)); 1554 mEmailEdit->setText(settings.getSetting(KEMailSettings::EmailAddress));
1503 } else { 1555 } else {
1504 mEmailEdit->setEnabled(true); 1556 mEmailEdit->setEnabled(true);
1505 mNameEdit->setEnabled(true); 1557 mNameEdit->setEnabled(true);
1506 mEmailLabel->setEnabled(true); 1558 mEmailLabel->setEnabled(true);
1507 mNameLabel->setEnabled(true); 1559 mNameLabel->setEnabled(true);
1508 } 1560 }
1509} 1561}
1510 1562
1511void KOPrefsDialog::addItem() 1563void KOPrefsDialog::addItem()
1512{ 1564{
1513 // aEmailsEdit->setEnabled(true); 1565 // aEmailsEdit->setEnabled(true);
1514// QListViewItem *item = new QListViewItem(mAMails); 1566// QListViewItem *item = new QListViewItem(mAMails);
1515// mAMails->insertItem(item); 1567// mAMails->insertItem(item);
1516// mAMails->setSelected(item,true); 1568// mAMails->setSelected(item,true);
1517// aEmailsEdit->setText(i18n("(EmptyEmail)")); 1569// aEmailsEdit->setText(i18n("(EmptyEmail)"));
1518} 1570}
1519 1571
1520void KOPrefsDialog::removeItem() 1572void KOPrefsDialog::removeItem()
1521{ 1573{
1522// QListViewItem *item; 1574// QListViewItem *item;
1523// item = mAMails->selectedItem(); 1575// item = mAMails->selectedItem();
1524// if (!item) return; 1576// if (!item) return;
1525// mAMails->takeItem(item); 1577// mAMails->takeItem(item);
1526// item = mAMails->selectedItem(); 1578// item = mAMails->selectedItem();
1527// if (!item) { 1579// if (!item) {
1528// aEmailsEdit->setText(""); 1580// aEmailsEdit->setText("");
1529// aEmailsEdit->setEnabled(false); 1581// aEmailsEdit->setEnabled(false);
1530// } 1582// }
1531// if (mAMails->childCount() == 0) { 1583// if (mAMails->childCount() == 0) {
1532// aEmailsEdit->setEnabled(false); 1584// aEmailsEdit->setEnabled(false);
1533// } 1585// }
1534} 1586}
1535 1587
1536void KOPrefsDialog::updateItem() 1588void KOPrefsDialog::updateItem()
1537{ 1589{
1538 // QListViewItem *item; 1590 // QListViewItem *item;
1539// item = mAMails->selectedItem(); 1591// item = mAMails->selectedItem();
1540// if (!item) return; 1592// if (!item) return;
1541// item->setText(0,aEmailsEdit->text()); 1593// item->setText(0,aEmailsEdit->text());
1542} 1594}
1543 1595
1544void KOPrefsDialog::updateInput() 1596void KOPrefsDialog::updateInput()
1545{ 1597{
1546// QListViewItem *item; 1598// QListViewItem *item;
1547// item = mAMails->selectedItem(); 1599// item = mAMails->selectedItem();
1548// if (!item) return; 1600// if (!item) return;
1549// aEmailsEdit->setEnabled(true); 1601// aEmailsEdit->setEnabled(true);
1550// aEmailsEdit->setText(item->text(0)); 1602// aEmailsEdit->setText(item->text(0));
1551} 1603}
1552 1604
diff --git a/korganizer/koprefsdialog.h b/korganizer/koprefsdialog.h
index baa6cf9..ee7a7aa 100644
--- a/korganizer/koprefsdialog.h
+++ b/korganizer/koprefsdialog.h
@@ -1,155 +1,157 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2000,2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef _KOPREFSDIALOG_H 23#ifndef _KOPREFSDIALOG_H
24#define _KOPREFSDIALOG_H 24#define _KOPREFSDIALOG_H
25 25
26#include <qframe.h> 26#include <qframe.h>
27#include <qdict.h> 27#include <qdict.h>
28#include <qcolor.h> 28#include <qcolor.h>
29#include <qlistview.h> 29#include <qlistview.h>
30 30
31#include <kdialogbase.h> 31#include <kdialogbase.h>
32 32
33#include <libkdepim/kprefsdialog.h> 33#include <libkdepim/kprefsdialog.h>
34#include <libkdepim/kdateedit.h> 34#include <libkdepim/kdateedit.h>
35#include <kcmconfigs/kdepimconfigwidget.h> 35#include <kcmconfigs/kdepimconfigwidget.h>
36 36
37class KColorButton; 37class KColorButton;
38class QSpinBox; 38class QSpinBox;
39class QSlider; 39class QSlider;
40class KURLRequester; 40class KURLRequester;
41class QComboBox; 41class QComboBox;
42class QLineEdit; 42class QLineEdit;
43class QStringList; 43class QStringList;
44 44
45/** Dialog to change the korganizer configuration. 45/** Dialog to change the korganizer configuration.
46 */ 46 */
47class KOPrefsDialog : public KPrefsDialog 47class KOPrefsDialog : public KPrefsDialog
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 /** Initialize dialog and pages */ 51 /** Initialize dialog and pages */
52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false); 52 KOPrefsDialog(QWidget *parent=0,char *name=0,bool modal=false);
53 ~KOPrefsDialog(); 53 ~KOPrefsDialog();
54 54
55 public slots: 55 public slots:
56 void showPrinterTab(); 56 void showPrinterTab();
57 57
58 /** Update controls for categories */ 58 /** Update controls for categories */
59 void updateCategories(); 59 void updateCategories();
60 protected slots: 60 protected slots:
61 void selectSoundFile(); 61 void selectSoundFile();
62 void setCategoryColor(); 62 void setCategoryColor();
63 void updateCategoryColor(); 63 void updateCategoryColor();
64 void toggleEmailSettings(bool); 64 void toggleEmailSettings(bool);
65 65
66 //additional emails 66 //additional emails
67 void addItem(); 67 void addItem();
68 void removeItem(); 68 void removeItem();
69 void updateItem(); 69 void updateItem();
70 void updateInput(); 70 void updateInput();
71 71
72 protected: 72 protected:
73 void usrReadConfig(); 73 void usrReadConfig();
74 void usrWriteConfig(); 74 void usrWriteConfig();
75 void setupGlobalTab(); 75 void setupGlobalTab();
76 76
77 void setupMainTab(); 77 void setupMainTab();
78 void setupTimeTab(); 78 void setupTimeTab();
79 void setupLocaleTab(); 79 void setupLocaleTab();
80 void setupLocaleDateTab(); 80 void setupLocaleDateTab();
81 void setupFontsTab(); 81 void setupFontsTab();
82 void setupColorsTab(); 82 void setupColorsTab();
83 void setupViewsTab(); 83 void setupViewsTab();
84 void setupDisplayTab(); 84 void setupDisplayTab();
85 void setupPrinterTab(); 85 void setupPrinterTab();
86 void setupGroupSchedulingTab(); 86 void setupGroupSchedulingTab();
87 void setupGroupAutomationTab(); 87 void setupGroupAutomationTab();
88 88
89 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0); 89 void setCombo(QComboBox *combo,const QString & text, const QStringList *tags = 0);
90 90
91 91
92 private: 92 private:
93 QColor mCatDefaultColor; 93 QColor mCatDefaultColor;
94 KPrefsDialogWidBool *mEnableGroupScheduling; 94 KPrefsDialogWidBool *mEnableGroupScheduling;
95 KPrefsDialogWidBool *mEnableProjectView; 95 KPrefsDialogWidBool *mEnableProjectView;
96 96
97 QFrame *mPrinterTab; 97 QFrame *mPrinterTab;
98 98
99 QLineEdit *nameEdit; 99 QLineEdit *nameEdit;
100 QLineEdit *emailEdit; 100 QLineEdit *emailEdit;
101 101
102 QComboBox *timeCombo; 102 QComboBox *timeCombo;
103 QComboBox *tzCombo; 103 QComboBox *tzCombo;
104 104
105 // widgets holding preferences data 105 // widgets holding preferences data
106 QLineEdit *mNameEdit; 106 QLineEdit *mNameEdit;
107 QLineEdit *mEmailEdit; 107 QLineEdit *mEmailEdit;
108 QLabel *mNameLabel; 108 QLabel *mNameLabel;
109 QLabel *mEmailLabel; 109 QLabel *mEmailLabel;
110 QLineEdit *mAdditionalEdit; 110 QLineEdit *mAdditionalEdit;
111 QSpinBox *mAutoSaveIntervalSpin; 111 QSpinBox *mAutoSaveIntervalSpin;
112 QSpinBox *mPrioSpin; 112 QSpinBox *mPrioSpin;
113 // QListView *mAMails; 113 // QListView *mAMails;
114 QLineEdit *aEmailsEdit; 114 QLineEdit *aEmailsEdit;
115 115
116 QComboBox *mTimeZoneCombo; 116 QComboBox *mTimeZoneCombo;
117 QStringList tzonenames; 117 QStringList tzonenames;
118 QSpinBox *mStartTimeSpin; 118 QSpinBox *mStartTimeSpin;
119 QSpinBox *mDefaultDurationSpin; 119 QSpinBox *mDefaultDurationSpin;
120 QComboBox *mAlarmTimeCombo; 120 QComboBox *mAlarmTimeCombo;
121 121
122 QComboBox *mCategoryCombo; 122 QComboBox *mCategoryCombo;
123 KColorButton *mCategoryButton; 123 KColorButton *mCategoryButton;
124 QDict<QColor> mCategoryDict; 124 QDict<QColor> mCategoryDict;
125 125
126 QSlider *mHourSizeSlider; 126 QSlider *mHourSizeSlider;
127 127
128 QSpinBox *mNextXDaysSpin; 128 QSpinBox *mNextXDaysSpin;
129 QSpinBox *mWhatsNextSpin; 129 QSpinBox *mWhatsNextSpin;
130 130
131 QLineEdit * mRemoteIPEdit; 131 QLineEdit * mRemoteIPEdit;
132 QLineEdit * mRemoteUser; 132 QLineEdit * mRemoteUser;
133 QLineEdit * mRemotePassWd; 133 QLineEdit * mRemotePassWd;
134 QLineEdit * mRemoteFile; 134 QLineEdit * mRemoteFile;
135 QLineEdit * mLocalTempFile; 135 QLineEdit * mLocalTempFile;
136 QWidget* mSetupSyncAlgTab; 136 QWidget* mSetupSyncAlgTab;
137 QLineEdit * mUserDateFormatLong; 137 QLineEdit * mUserDateFormatLong;
138 QLineEdit * mUserDateFormatShort; 138 QLineEdit * mUserDateFormatShort;
139 139
140 QSpinBox *mTimezoneOffsetSpin; 140 QSpinBox *mTimezoneOffsetSpin;
141 QSpinBox *mDaylightsavingStart; 141 QSpinBox *mDaylightsavingStart;
142 QSpinBox *mDaylightsavingEnd; 142 QSpinBox *mDaylightsavingEnd;
143 KDateEdit* mStartDateSavingEdit; 143 KDateEdit* mStartDateSavingEdit;
144 KDateEdit* mEndDateSavingEdit; 144 KDateEdit* mEndDateSavingEdit;
145 QSpinBox * mAlarmPlayBeeps; 145 QSpinBox * mAlarmPlayBeeps;
146 QSpinBox * mAlarmSuspendTime; 146 QSpinBox * mAlarmSuspendTime;
147 QSpinBox * mAlarmSuspendCount; 147 QSpinBox * mAlarmSuspendCount;
148 QSpinBox * mAlarmBeepInterval; 148 QSpinBox * mAlarmBeepInterval;
149 149
150 QComboBox * mFilterEditItem, *mFilterAllItem;
151
150 QLineEdit * mDefaultAlarmFile; 152 QLineEdit * mDefaultAlarmFile;
151 int mSpacingHint; 153 int mSpacingHint;
152 int mMarginHint; 154 int mMarginHint;
153}; 155};
154 156
155#endif 157#endif