summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp8
-rw-r--r--korganizer/koprefs.cpp2
2 files changed, 7 insertions, 3 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index b819eec..437debe 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1,182 +1,183 @@
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 19
20#include <qpopupmenu.h> 20#include <qpopupmenu.h>
21#include <qfont.h> 21#include <qfont.h>
22#include <qfontmetrics.h> 22#include <qfontmetrics.h>
23#include <qkeycode.h> 23#include <qkeycode.h>
24#include <qhbox.h> 24#include <qhbox.h>
25#include <qvbox.h> 25#include <qvbox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qtooltip.h> 27#include <qtooltip.h>
28#include <qpainter.h> 28#include <qpainter.h>
29#include <qwhatsthis.h> 29#include <qwhatsthis.h>
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#else 32#else
33#include <qapplication.h> 33#include <qapplication.h>
34#endif 34#endif
35 35
36#include <kdebug.h> 36#include <kdebug.h>
37#include <klocale.h> 37#include <klocale.h>
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <kiconloader.h> 40#include <kiconloader.h>
41 41
42#include <kcalendarsystem.h> 42#include <kcalendarsystem.h>
43 43
44#ifndef KORG_NOPRINTER 44#ifndef KORG_NOPRINTER
45#include "calprinter.h" 45#include "calprinter.h"
46#endif 46#endif
47#include "koprefs.h" 47#include "koprefs.h"
48#ifndef KORG_NOPLUGINS 48#ifndef KORG_NOPLUGINS
49#include "kocore.h" 49#include "kocore.h"
50#endif 50#endif
51#include "koglobals.h" 51#include "koglobals.h"
52#include <libkcal/kincidenceformatter.h> 52#include <libkcal/kincidenceformatter.h>
53 53
54#include "komonthview.h" 54#include "komonthview.h"
55 55
56#define PIXMAP_SIZE 5 56#define PIXMAP_SIZE 5
57#ifdef DESKTOP_VERSION 57#ifdef DESKTOP_VERSION
58 QToolTipGroup *MonthViewCell::mToolTipGroup = 0; 58 QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
59#endif 59#endif
60class KNOWhatsThis :public QWhatsThis 60class KNOWhatsThis :public QWhatsThis
61{ 61{
62public: 62public:
63 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; 63 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { };
64 //~KNOWhatsThis( ) {qDebug("~KNOWhatsThis( ) "); };
64 65
65protected: 66protected:
66 virtual QString text( const QPoint& p) 67 virtual QString text( const QPoint& p)
67 { 68 {
68 return _wid->getWhatsThisText(p) ; 69 return _wid->getWhatsThisText(p) ;
69 }; 70 };
70private: 71private:
71 KNoScrollListBox* _wid; 72 KNoScrollListBox* _wid;
72 73
73}; 74};
74 75
75 76
76KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 77KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
77 : QListBox(parent, name, WRepaintNoErase) 78 : QListBox(parent, name, WRepaintNoErase)
78{ 79{
79#ifndef DESKTOP_VERSION 80#ifndef DESKTOP_VERSION
80 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 81 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
81#endif 82#endif
82 mWT = new KNOWhatsThis(this); 83 mWT = new KNOWhatsThis(this);
83} 84}
84KNoScrollListBox::~KNoScrollListBox() 85KNoScrollListBox::~KNoScrollListBox()
85{ 86{
86 delete mWT; 87
87} 88}
88QString KNoScrollListBox::getWhatsThisText(QPoint p) 89QString KNoScrollListBox::getWhatsThisText(QPoint p)
89{ 90{
90 QListBoxItem* item = itemAt ( p ); 91 QListBoxItem* item = itemAt ( p );
91 if ( ! item ) { 92 if ( ! item ) {
92 return i18n("Click in the cell\nto add an event!"); 93 return i18n("Click in the cell\nto add an event!");
93 } 94 }
94 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence()); 95 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence());
95} 96}
96void KNoScrollListBox::keyPressEvent(QKeyEvent *e) 97void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
97{ 98{
98 99
99 switch(e->key()) { 100 switch(e->key()) {
100 case Key_Right: 101 case Key_Right:
101 // if ( e->state() == Qt::ControlButton ) 102 // if ( e->state() == Qt::ControlButton )
102 { 103 {
103 e->ignore(); 104 e->ignore();
104 return; 105 return;
105 } 106 }
106 scrollBy(4,0); 107 scrollBy(4,0);
107 break; 108 break;
108 case Key_Left: 109 case Key_Left:
109 // if ( e->state() == Qt::ControlButton ) 110 // if ( e->state() == Qt::ControlButton )
110 { 111 {
111 e->ignore(); 112 e->ignore();
112 return; 113 return;
113 } 114 }
114 scrollBy(-4,0); 115 scrollBy(-4,0);
115 break; 116 break;
116 case Key_Up: 117 case Key_Up:
117 if(!count()) break; 118 if(!count()) break;
118 setCurrentItem((currentItem()+count()-1)%count()); 119 setCurrentItem((currentItem()+count()-1)%count());
119 if(!itemVisible(currentItem())) { 120 if(!itemVisible(currentItem())) {
120 if((unsigned int) currentItem() == (count()-1)) { 121 if((unsigned int) currentItem() == (count()-1)) {
121 setTopItem(currentItem()-numItemsVisible()+1); 122 setTopItem(currentItem()-numItemsVisible()+1);
122 } else { 123 } else {
123 setTopItem(topItem()-1); 124 setTopItem(topItem()-1);
124 } 125 }
125 } 126 }
126 break; 127 break;
127 case Key_Down: 128 case Key_Down:
128 if(!count()) break; 129 if(!count()) break;
129 setCurrentItem((currentItem()+1)%count()); 130 setCurrentItem((currentItem()+1)%count());
130 if(!itemVisible(currentItem())) { 131 if(!itemVisible(currentItem())) {
131 if(currentItem() == 0) { 132 if(currentItem() == 0) {
132 setTopItem(0); 133 setTopItem(0);
133 } else { 134 } else {
134 setTopItem(topItem()+1); 135 setTopItem(topItem()+1);
135 } 136 }
136 } 137 }
137 break; 138 break;
138 case Key_Shift: 139 case Key_Shift:
139 emit shiftDown(); 140 emit shiftDown();
140 break; 141 break;
141 default: 142 default:
142 e->ignore(); 143 e->ignore();
143 break; 144 break;
144 } 145 }
145} 146}
146 147
147void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e) 148void KNoScrollListBox::keyReleaseEvent(QKeyEvent *e)
148{ 149{
149 switch(e->key()) { 150 switch(e->key()) {
150 case Key_Shift: 151 case Key_Shift:
151 emit shiftUp(); 152 emit shiftUp();
152 break; 153 break;
153 default: 154 default:
154 break; 155 break;
155 } 156 }
156} 157}
157 158
158void KNoScrollListBox::mousePressEvent(QMouseEvent *e) 159void KNoScrollListBox::mousePressEvent(QMouseEvent *e)
159{ 160{
160 QListBox::mousePressEvent(e); 161 QListBox::mousePressEvent(e);
161 162
162 if(e->button() == RightButton) { 163 if(e->button() == RightButton) {
163 emit rightClick(); 164 emit rightClick();
164 } 165 }
165} 166}
166 167
167MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s) 168MonthViewItem::MonthViewItem( Incidence *incidence, QDate qd, const QString & s)
168 : QListBoxItem() 169 : QListBoxItem()
169{ 170{
170 setText( s ); 171 setText( s );
171 172
172 mIncidence = incidence; 173 mIncidence = incidence;
173 mDate = qd; 174 mDate = qd;
174 // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence )); 175 // QWhatsThis::add(this,KIncidenceFormatter::instance()->getFormattedText( mIncidence ));
175 mRecur = false; 176 mRecur = false;
176 mAlarm = false; 177 mAlarm = false;
177 mReply = false; 178 mReply = false;
178 mInfo = false; 179 mInfo = false;
179} 180}
180 181
181void MonthViewItem::paint(QPainter *p) 182void MonthViewItem::paint(QPainter *p)
182{ 183{
@@ -566,271 +567,274 @@ void MonthViewCell::updateCell()
566 setMyPalette(); 567 setMyPalette();
567 QString text; 568 QString text;
568 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; 569 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
569 if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { 570 if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
570 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; 571 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
571 mLabel->resize( mLabelBigSize ); 572 mLabel->resize( mLabelBigSize );
572 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 573 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
573 } else { 574 } else {
574 mLabel->resize( mLabelSize ); 575 mLabel->resize( mLabelSize );
575 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 576 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
576 } 577 }
577 578
578 mLabel->setText( text ); 579 mLabel->setText( text );
579 resizeEvent( 0 ); 580 resizeEvent( 0 );
580 // if ( isVisible()) 581 // if ( isVisible())
581 //qApp->processEvents(); 582 //qApp->processEvents();
582} 583}
583 584
584void MonthViewCell::updateConfig() 585void MonthViewCell::updateConfig()
585{ 586{
586 587
587 setFont( KOPrefs::instance()->mMonthViewFont ); 588 setFont( KOPrefs::instance()->mMonthViewFont );
588 589
589 QFontMetrics fm( font() ); 590 QFontMetrics fm( font() );
590 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); 591 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
591 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); 592 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
592 mHolidayPalette = mStandardPalette; 593 mHolidayPalette = mStandardPalette;
593 mPrimaryPalette = mStandardPalette; 594 mPrimaryPalette = mStandardPalette;
594 mNonPrimaryPalette = mStandardPalette; 595 mNonPrimaryPalette = mStandardPalette;
595 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { 596 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
596 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); 597 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
597 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); 598 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
598 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); 599 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
599 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); 600 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
600 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); 601 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
601 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); 602 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
602 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); 603 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
603 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); 604 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
604 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); 605 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
605 } 606 }
606 updateCell(); 607 updateCell();
607} 608}
608 609
609void MonthViewCell::enableScrollBars( bool enabled ) 610void MonthViewCell::enableScrollBars( bool enabled )
610{ 611{
611 if ( enabled ) { 612 if ( enabled ) {
612 mItemList->setVScrollBarMode(QScrollView::Auto); 613 mItemList->setVScrollBarMode(QScrollView::Auto);
613 mItemList->setHScrollBarMode(QScrollView::Auto); 614 mItemList->setHScrollBarMode(QScrollView::Auto);
614 } else { 615 } else {
615 mItemList->setVScrollBarMode(QScrollView::AlwaysOff); 616 mItemList->setVScrollBarMode(QScrollView::AlwaysOff);
616 mItemList->setHScrollBarMode(QScrollView::AlwaysOff); 617 mItemList->setHScrollBarMode(QScrollView::AlwaysOff);
617 } 618 }
618} 619}
619 620
620Incidence *MonthViewCell::selectedIncidence() 621Incidence *MonthViewCell::selectedIncidence()
621{ 622{
622 int index = mItemList->currentItem(); 623 int index = mItemList->currentItem();
623 if ( index < 0 ) return 0; 624 if ( index < 0 ) return 0;
624 625
625 MonthViewItem *item = 626 MonthViewItem *item =
626 static_cast<MonthViewItem *>( mItemList->item( index ) ); 627 static_cast<MonthViewItem *>( mItemList->item( index ) );
627 628
628 if ( !item ) return 0; 629 if ( !item ) return 0;
629 630
630 return item->incidence(); 631 return item->incidence();
631} 632}
632 633
633QDate MonthViewCell::selectedIncidenceDate() 634QDate MonthViewCell::selectedIncidenceDate()
634{ 635{
635 QDate qd; 636 QDate qd;
636 int index = mItemList->currentItem(); 637 int index = mItemList->currentItem();
637 if ( index < 0 ) return qd; 638 if ( index < 0 ) return qd;
638 639
639 MonthViewItem *item = 640 MonthViewItem *item =
640 static_cast<MonthViewItem *>( mItemList->item( index ) ); 641 static_cast<MonthViewItem *>( mItemList->item( index ) );
641 642
642 if ( !item ) return qd; 643 if ( !item ) return qd;
643 644
644 return item->incidenceDate(); 645 return item->incidenceDate();
645} 646}
646 647
647void MonthViewCell::deselect() 648void MonthViewCell::deselect()
648{ 649{
649 mItemList->clearSelection(); 650 mItemList->clearSelection();
650 enableScrollBars( false ); 651 enableScrollBars( false );
651 // updateCell(); 652 // updateCell();
652} 653}
653void MonthViewCell::select() 654void MonthViewCell::select()
654{ 655{
655 ;// updateCell(); 656 ;// updateCell();
656} 657}
657 658
658void MonthViewCell::resizeEvent ( QResizeEvent * ) 659void MonthViewCell::resizeEvent ( QResizeEvent * )
659{ 660{
660 if ( !mMonthView->isUpdatePossible() ) 661 if ( !mMonthView->isUpdatePossible() )
661 return; 662 return;
663#ifndef DESKTOP_VERSION
662 if ( !isVisible() ){ 664 if ( !isVisible() ){
663 return; 665 return;
664 } 666 }
667#endif
665 int size = height() - mLabel->height(); 668 int size = height() - mLabel->height();
666 if ( size > 0 ) 669 if ( size > 0 )
667 mItemList->verticalScrollBar()->setMaximumHeight( size ); 670 mItemList->verticalScrollBar()->setMaximumHeight( size );
668 size = width() - mLabel->width(); 671 size = width() - mLabel->width();
669 if ( size > 0 ) 672 if ( size > 0 )
670 mItemList->horizontalScrollBar()->setMaximumWidth( size ); 673 mItemList->horizontalScrollBar()->setMaximumWidth( size );
671 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() ); 674 mLabel->move( width()-mItemList->lineWidth() - mLabel->width(), height()-mItemList->lineWidth() - mLabel->height() );
672 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 675 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
673} 676}
674 677
675void MonthViewCell::defaultAction( QListBoxItem *item ) 678void MonthViewCell::defaultAction( QListBoxItem *item )
676{ 679{
677 if ( !item ) return; 680 if ( !item ) return;
678 681
679 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 682 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
680 Incidence *incidence = eventItem->incidence(); 683 Incidence *incidence = eventItem->incidence();
681 if ( incidence ) mMonthView->defaultAction( incidence ); 684 if ( incidence ) mMonthView->defaultAction( incidence );
682} 685}
683void MonthViewCell::showDay() 686void MonthViewCell::showDay()
684{ 687{
685 emit showDaySignal( date() ); 688 emit showDaySignal( date() );
686} 689}
687void MonthViewCell::newEvent() 690void MonthViewCell::newEvent()
688{ 691{
689 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 692 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
690 emit newEventSignal( dt ); 693 emit newEventSignal( dt );
691} 694}
692void MonthViewCell::cellClicked( QListBoxItem *item ) 695void MonthViewCell::cellClicked( QListBoxItem *item )
693{ 696{
694 static QListBoxItem * lastClicked = 0; 697 static QListBoxItem * lastClicked = 0;
695 if ( item == 0 ) { 698 if ( item == 0 ) {
696 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) ); 699 QDateTime dt( date(), QTime( KOPrefs::instance()->mStartTime, 0 ) );
697 emit newEventSignal( dt ); 700 emit newEventSignal( dt );
698 return; 701 return;
699 } 702 }
700 /* 703 /*
701 if ( lastClicked ) 704 if ( lastClicked )
702 if ( ! item ) { 705 if ( ! item ) {
703 if ( lastClicked->listBox() != item->listBox() ) 706 if ( lastClicked->listBox() != item->listBox() )
704 lastClicked->listBox()->clearSelection(); 707 lastClicked->listBox()->clearSelection();
705 } 708 }
706 */ 709 */
707 710
708 mMonthView->setSelectedCell( this ); 711 mMonthView->setSelectedCell( this );
709 if( KOPrefs::instance()->mEnableMonthScroll ) enableScrollBars( true ); 712 if( KOPrefs::instance()->mEnableMonthScroll ) enableScrollBars( true );
710 select(); 713 select();
711} 714}
712 715
713void MonthViewCell::contextMenu( QListBoxItem *item ) 716void MonthViewCell::contextMenu( QListBoxItem *item )
714{ 717{
715 if ( !item ) return; 718 if ( !item ) return;
716 719
717 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item ); 720 MonthViewItem *eventItem = static_cast<MonthViewItem *>( item );
718 Incidence *incidence = eventItem->incidence(); 721 Incidence *incidence = eventItem->incidence();
719 if ( incidence ) mMonthView->showContextMenu( incidence ); 722 if ( incidence ) mMonthView->showContextMenu( incidence );
720} 723}
721 724
722void MonthViewCell::selection( QListBoxItem *item ) 725void MonthViewCell::selection( QListBoxItem *item )
723{ 726{
724 if ( !item ) return; 727 if ( !item ) return;
725 728
726 mMonthView->setSelectedCell( this ); 729 mMonthView->setSelectedCell( this );
727} 730}
728 731
729 732
730// ******************************************************************************* 733// *******************************************************************************
731// ******************************************************************************* 734// *******************************************************************************
732// ******************************************************************************* 735// *******************************************************************************
733 736
734 737
735KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name) 738KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
736 : KOEventView( calendar, parent, name ), 739 : KOEventView( calendar, parent, name ),
737 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ), 740 mDaysPerWeek( 7 ), mNumWeeks( 6 ), mNumCells( mDaysPerWeek * mNumWeeks ),
738 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 ) 741 mShortDayLabels( false ), mWidthLongDayLabel( 0 ), mSelectedCell( 0 )
739{ 742{
740 updatePossible = false; 743
744 updatePossible = false;
741 mCells.setAutoDelete( true ); 745 mCells.setAutoDelete( true );
742 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 746 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
743 // mDayLayout = new QGridLayout( this ); 747 // mDayLayout = new QGridLayout( this );
744 // create the day of the week labels (Sun, Mon, etc) and add them to 748 // create the day of the week labels (Sun, Mon, etc) and add them to
745 // the layout. 749 // the layout.
746 mDayLabels.resize( mDaysPerWeek ); 750 mDayLabels.resize( mDaysPerWeek );
747 QFont bfont = font(); 751 QFont bfont = font();
748 if ( QApplication::desktop()->width() < 650 ) { 752 if ( QApplication::desktop()->width() < 650 ) {
749 bfont.setPointSize( bfont.pointSize() - 2 ); 753 bfont.setPointSize( bfont.pointSize() - 2 );
750 } 754 }
751 bfont.setBold( true ); 755 bfont.setBold( true );
752 int i; 756 int i;
753 757
754 for( i = 0; i < mDaysPerWeek; i++ ) { 758 for( i = 0; i < mDaysPerWeek; i++ ) {
755 QLabel *label = new QLabel( this ); 759 QLabel *label = new QLabel( this );
756 label->setFont(bfont); 760 label->setFont(bfont);
757 label->setFrameStyle(QFrame::Panel|QFrame::Raised); 761 label->setFrameStyle(QFrame::Panel|QFrame::Raised);
758 label->setLineWidth(1); 762 label->setLineWidth(1);
759 label->setAlignment(AlignCenter); 763 label->setAlignment(AlignCenter);
760 mDayLabels.insert( i, label ); 764 mDayLabels.insert( i, label );
761 } 765 }
762 766
763 bfont.setBold( false ); 767 bfont.setBold( false );
764 mWeekLabels.resize( mNumWeeks+1 ); 768 mWeekLabels.resize( mNumWeeks+1 );
765 for( i = 0; i < mNumWeeks+1; i++ ) { 769 for( i = 0; i < mNumWeeks+1; i++ ) {
766 KOWeekButton *label = new KOWeekButton( this ); 770 KOWeekButton *label = new KOWeekButton( this );
767 label->setFont(bfont); 771 label->setFont(bfont);
768 connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) ); 772 connect( label, SIGNAL( selectWeekNum ( int )),this, SIGNAL( selectWeekNum ( int )) );
769 label->setFlat(true); 773 label->setFlat(true);
770 QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view")); 774 QWhatsThis::add(label,i18n("Click on the week number to\nshow week in agenda view"));
771 //label->setFrameStyle(QFrame::Panel|QFrame::Raised); 775 //label->setFrameStyle(QFrame::Panel|QFrame::Raised);
772 //label->setLineWidth(1); 776 //label->setLineWidth(1);
773 //label->setAlignment(AlignCenter); 777 //label->setAlignment(AlignCenter);
774 mWeekLabels.insert( i, label ); 778 mWeekLabels.insert( i, label );
775 } 779 }
776 mWeekLabels[mNumWeeks]->setText( i18n("W")); 780 mWeekLabels[mNumWeeks]->setText( i18n("W"));
777 int row, col; 781 int row, col;
778 mCells.resize( mNumCells ); 782 mCells.resize( mNumCells );
779 for( row = 0; row < mNumWeeks; ++row ) { 783 for( row = 0; row < mNumWeeks; ++row ) {
780 for( col = 0; col < mDaysPerWeek; ++col ) { 784 for( col = 0; col < mDaysPerWeek; ++col ) {
781 MonthViewCell *cell = new MonthViewCell( this ); 785 MonthViewCell *cell = new MonthViewCell( this );
782 mCells.insert( row * mDaysPerWeek + col, cell ); 786 mCells.insert( row * mDaysPerWeek + col, cell );
783 787
784 connect( cell, SIGNAL( defaultAction( Incidence * ) ), 788 connect( cell, SIGNAL( defaultAction( Incidence * ) ),
785 SLOT( defaultAction( Incidence * ) ) ); 789 SLOT( defaultAction( Incidence * ) ) );
786 connect( cell, SIGNAL( newEventSignal( QDateTime ) ), 790 connect( cell, SIGNAL( newEventSignal( QDateTime ) ),
787 SIGNAL( newEventSignal( QDateTime ) ) ); 791 SIGNAL( newEventSignal( QDateTime ) ) );
788 connect( cell, SIGNAL( showDaySignal( QDate ) ), 792 connect( cell, SIGNAL( showDaySignal( QDate ) ),
789 SIGNAL( showDaySignal( QDate ) ) ); 793 SIGNAL( showDaySignal( QDate ) ) );
790 } 794 }
791 } 795 }
792 796
793 mContextMenu = eventPopup(); 797 mContextMenu = eventPopup();
794 // updateConfig(); //useless here 798 // updateConfig(); //useless here
795 799
796 emit incidenceSelected( 0 ); 800 emit incidenceSelected( 0 );
797} 801}
798 802
799KOMonthView::~KOMonthView() 803KOMonthView::~KOMonthView()
800{ 804{
801 delete mContextMenu; 805 delete mContextMenu;
802} 806}
803 807
804int KOMonthView::maxDatesHint() 808int KOMonthView::maxDatesHint()
805{ 809{
806 return mNumCells; 810 return mNumCells;
807} 811}
808 812
809int KOMonthView::currentDateCount() 813int KOMonthView::currentDateCount()
810{ 814{
811 return mNumCells; 815 return mNumCells;
812} 816}
813 817
814QPtrList<Incidence> KOMonthView::selectedIncidences() 818QPtrList<Incidence> KOMonthView::selectedIncidences()
815{ 819{
816 QPtrList<Incidence> selected; 820 QPtrList<Incidence> selected;
817 821
818 if ( mSelectedCell ) { 822 if ( mSelectedCell ) {
819 Incidence *incidence = mSelectedCell->selectedIncidence(); 823 Incidence *incidence = mSelectedCell->selectedIncidence();
820 if ( incidence ) selected.append( incidence ); 824 if ( incidence ) selected.append( incidence );
821 } 825 }
822 826
823 return selected; 827 return selected;
824} 828}
825 829
826DateList KOMonthView::selectedDates() 830DateList KOMonthView::selectedDates()
827{ 831{
828 DateList selected; 832 DateList selected;
829 833
830 if ( mSelectedCell ) { 834 if ( mSelectedCell ) {
831 QDate qd = mSelectedCell->selectedIncidenceDate(); 835 QDate qd = mSelectedCell->selectedIncidenceDate();
832 if ( qd.isValid() ) selected.append( qd ); 836 if ( qd.isValid() ) selected.append( qd );
833 } 837 }
834 838
835 return selected; 839 return selected;
836} 840}
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp
index dbbe832..ddd9cf8 100644
--- a/korganizer/koprefs.cpp
+++ b/korganizer/koprefs.cpp
@@ -135,193 +135,193 @@ KOPrefs::KOPrefs() :
135 135
136 addItemInt("Mail Client",&mMailClient,MailClientKMail); 136 addItemInt("Mail Client",&mMailClient,MailClientKMail);
137 addItemBool("Use Control Center Email",&mEmailControlCenter,false); 137 addItemBool("Use Control Center Email",&mEmailControlCenter,false);
138 addItemBool("Bcc",&mBcc,false); 138 addItemBool("Bcc",&mBcc,false);
139 139
140 KPrefs::setCurrentGroup("Time & Date"); 140 KPrefs::setCurrentGroup("Time & Date");
141 141
142 142
143 addItemInt("Default Start Time",&mStartTime,10); 143 addItemInt("Default Start Time",&mStartTime,10);
144 addItemInt("Default Duration",&mDefaultDuration,2); 144 addItemInt("Default Duration",&mDefaultDuration,2);
145 addItemInt("Default Alarm Time",&mAlarmTime,3); 145 addItemInt("Default Alarm Time",&mAlarmTime,3);
146 KPrefs::setCurrentGroup("AlarmSettings"); 146 KPrefs::setCurrentGroup("AlarmSettings");
147 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20); 147 addItemInt("AlarmPlayBeeps",&mAlarmPlayBeeps,20);
148 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7); 148 addItemInt("AlarmSuspendTime",&mAlarmSuspendTime,7);
149 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5); 149 addItemInt("AlarmSuspendCount",&mAlarmSuspendCount,5);
150 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3); 150 addItemInt("AlarmBeepInterval",&mAlarmBeepInterval,3);
151 151
152 152
153 KPrefs::setCurrentGroup("Calendar"); 153 KPrefs::setCurrentGroup("Calendar");
154 154
155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar); 155 addItemInt("Default Calendar Format",&mDefaultFormat,FormatICalendar);
156 156
157 KPrefs::setCurrentGroup("Fonts"); 157 KPrefs::setCurrentGroup("Fonts");
158 // qDebug(" KPrefs::setCurrentGroup(Fonts); "); 158 // qDebug(" KPrefs::setCurrentGroup(Fonts); ");
159 addItemFont("TimeBar Font",&mTimeBarFont); 159 addItemFont("TimeBar Font",&mTimeBarFont);
160 addItemFont("MonthView Font",&mMonthViewFont); 160 addItemFont("MonthView Font",&mMonthViewFont);
161 addItemFont("AgendaView Font",&mAgendaViewFont); 161 addItemFont("AgendaView Font",&mAgendaViewFont);
162 addItemFont("MarcusBains Font",&mMarcusBainsFont); 162 addItemFont("MarcusBains Font",&mMarcusBainsFont);
163 addItemFont("TimeLabels Font",&mTimeLabelsFont); 163 addItemFont("TimeLabels Font",&mTimeLabelsFont);
164 addItemFont("TodoView Font",&mTodoViewFont); 164 addItemFont("TodoView Font",&mTodoViewFont);
165 addItemFont("ListView Font",&mListViewFont); 165 addItemFont("ListView Font",&mListViewFont);
166 addItemFont("DateNavigator Font",&mDateNavigatorFont); 166 addItemFont("DateNavigator Font",&mDateNavigatorFont);
167 addItemFont("EditBox Font",&mEditBoxFont); 167 addItemFont("EditBox Font",&mEditBoxFont);
168 addItemFont("JournalView Font",&mJornalViewFont); 168 addItemFont("JournalView Font",&mJornalViewFont);
169 addItemFont("WhatsNextView Font",&mWhatsNextFont); 169 addItemFont("WhatsNextView Font",&mWhatsNextFont);
170 addItemFont("EventView Font",&mEventViewFont); 170 addItemFont("EventView Font",&mEventViewFont);
171 171
172 KPrefs::setCurrentGroup("RemoteSyncing"); 172 KPrefs::setCurrentGroup("RemoteSyncing");
173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" ); 173 addItemString("ActiveSyncPort",&mActiveSyncPort,"9197" );
174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" ); 174 addItemString("ActiveSyncIP",&mActiveSyncIP,"192.168.0.40" );
175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false); 175 addItemBool("ShowSyncEvents",&mShowSyncEvents,false);
176 addItemInt("LastSyncTime",&mLastSyncTime,0); 176 addItemInt("LastSyncTime",&mLastSyncTime,0);
177 177
178#ifdef _WIN32_ 178#ifdef _WIN32_
179 QString hdp= locateLocal("data","korganizer")+"\\\\"; 179 QString hdp= locateLocal("data","korganizer")+"\\\\";
180#else 180#else
181 QString hdp= locateLocal("data","korganizer")+"/"; 181 QString hdp= locateLocal("data","korganizer")+"/";
182#endif 182#endif
183 183
184 KPrefs::setCurrentGroup("LoadSaveFileNames"); 184 KPrefs::setCurrentGroup("LoadSaveFileNames");
185 185
186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" ); 186 addItemString("LastImportFile", &mLastImportFile ,hdp +"import.ics" );
187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" ); 187 addItemString("LastVcalFile", &mLastVcalFile ,hdp +"export.vcs" );
188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" ); 188 addItemString("LastSaveFile", &mLastSaveFile ,hdp +"mybackup.ics" );
189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" ); 189 addItemString("LastLoadFile", &mLastLoadFile ,hdp +"mybackup.ics" );
190 190
191 191
192 KPrefs::setCurrentGroup("Locale"); 192 KPrefs::setCurrentGroup("Locale");
193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false); 193 addItemBool("ShortDateInViewer",&mShortDateInViewer,false);
194 194
195 195
196 KPrefs::setCurrentGroup("Colors"); 196 KPrefs::setCurrentGroup("Colors");
197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor); 197 addItemColor("Holiday Color",&mHolidayColor,defaultHolidayColor);
198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor); 198 addItemColor("Highlight Color",&mHighlightColor,defaultHighlightColor);
199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor); 199 addItemColor("Event Color",&mEventColor,mDefaultCategoryColor);
200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor); 200 addItemColor("Agenda Background Color",&mAgendaBgColor,defaultAgendaBgColor);
201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor); 201 addItemColor("WorkingHours Color",&mWorkingHoursColor,defaultWorkingHoursColor);
202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor); 202 addItemColor("Todo due today Color",&mTodoDueTodayColor,defaultTodoDueTodayColor);
203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor); 203 addItemColor("Todo overdue Color",&mTodoOverdueColor,defaultTodoOverdueColor);
204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 )); 204 addItemColor("MonthViewEvenColor",&mMonthViewEvenColor,QColor( 160,160,255 ));
205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 )); 205 addItemColor("MonthViewOddColor",&mMonthViewOddColor,QColor( 160,255,160 ));
206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 )); 206 addItemColor("MonthViewHolidayColor",&mMonthViewHolidayColor,QColor( 255,160,160 ));
207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true); 207 addItemBool("MonthViewUsesDayColors",&mMonthViewUsesDayColors,true);
208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true); 208 addItemBool("MonthViewSatSunTog",&mMonthViewSatSunTog,true);
209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false); 209 addItemBool("HightlightDateTimeEdit",&mHightlightDateTimeEdit,false);
210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 )); 210 addItemColor("AppColor1",&mAppColor1,QColor( 130,170,255 ));
211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 )); 211 addItemColor("AppColor2",&mAppColor2,QColor( 174,216,255 ));
212 addItemBool("UseAppColors",&mUseAppColors,false); 212 addItemBool("UseAppColors",&mUseAppColors,false);
213 213
214 214
215 215
216 KPrefs::setCurrentGroup("Views"); 216 KPrefs::setCurrentGroup("Views");
217 addItemBool("Show Date Navigator",&mShowDateNavigator,true); 217 addItemBool("Show Date Navigator",&mShowDateNavigator,true);
218 addItemInt("Hour Size",&mHourSize,8); 218 addItemInt("Hour Size",&mHourSize,8);
219 addItemBool("Show Daily Recurrences",&mDailyRecur,true); 219 addItemBool("Show Daily Recurrences",&mDailyRecur,true);
220 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true); 220 addItemBool("Show Weekly Recurrences",&mWeeklyRecur,true);
221 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true); 221 addItemBool("Show Month Daily Recurrences",&mMonthDailyRecur,true);
222 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true); 222 addItemBool("Show Month Weekly Recurrences",&mMonthWeeklyRecur,true);
223 addItemBool("ShowShortMonthName",&mMonthShowShort,false); 223 addItemBool("ShowShortMonthName",&mMonthShowShort,false);
224 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true); 224 addItemBool("ShowIconsInMonthCell",&mMonthShowIcons,true);
225 addItemBool("Enable ToolTips",&mEnableToolTips,false); 225 addItemBool("Enable ToolTips",&mEnableToolTips,false);
226 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false); 226 addItemBool("Enable MonthView ScrollBars",&mEnableMonthScroll,false);
227 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false); 227 addItemBool("Marcus Bains shows seconds",&mMarcusBainsShowSeconds,false);
228 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true); 228 addItemBool("Show Marcus Bains",&mMarcusBainsEnabled,true);
229 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true); 229 addItemBool("EditOnDoubleClick",&mEditOnDoubleClick,true);
230 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true); 230 addItemBool("ViewChangeHoldFullscreen",&mViewChangeHoldFullscreen,true);
231 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,true); 231 addItemBool("ViewChangeHoldNonFullscreen",&mViewChangeHoldNonFullscreen,false);
232 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false); 232 addItemBool("CenterOnCurrentTime",&mCenterOnCurrentTime,false);
233 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true); 233 addItemBool("SetTimeToDayStartAt",&mSetTimeToDayStartAt,true);
234 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true); 234 addItemBool("HighlightCurrentDay",&mHighlightCurrentDay,true);
235 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);; 235 addItemBool("WNViewShowsParents",&mWNViewShowsParents,true);;
236 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true); 236 addItemBool("WNViewShowsPast",&mWNViewShowsPast,true);
237 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false); 237 addItemBool("WNViewShowLocation",&mWNViewShowLocation,false);
238 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false); 238 addItemBool("UseHighlightLightColor",&mUseHighlightLightColor,false);
239 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true); 239 addItemBool("ListViewMonthTimespan",&mListViewMonthTimespan,true);
240 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false); 240 addItemBool("TodoViewUsesCatColors",&mTodoViewUsesCatColors,false);
241 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false); 241 addItemBool("TodoViewShowsPercentage",&mTodoViewShowsPercentage,false);
242 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false); 242 addItemBool("TodoViewUsesSmallFont",&mTodoViewUsesSmallFont,false);
243 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false); 243 addItemBool("TodoViewUsesForegroundColor",&mTodoViewUsesForegroundColor,false);
244 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false); 244 addItemBool("MonthViewUsesForegroundColor",&mMonthViewUsesForegroundColor,false);
245#ifdef DESKTOP_VERSION 245#ifdef DESKTOP_VERSION
246 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true); 246 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,true);
247#else 247#else
248 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false); 248 addItemBool("UseInternalAlarmNotification",&mUseInternalAlarmNotification,false);
249#endif 249#endif
250 addItemInt("Day Begins",&mDayBegins,7); 250 addItemInt("Day Begins",&mDayBegins,7);
251 addItemInt("Working Hours Start",&mWorkingHoursStart,8); 251 addItemInt("Working Hours Start",&mWorkingHoursStart,8);
252 addItemInt("Working Hours End",&mWorkingHoursEnd,17); 252 addItemInt("Working Hours End",&mWorkingHoursEnd,17);
253 addItemBool("Exclude Holidays",&mExcludeHolidays,true); 253 addItemBool("Exclude Holidays",&mExcludeHolidays,true);
254 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true); 254 addItemBool("Exclude Saturdays",&mExcludeSaturdays,true);
255 255
256 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false); 256 addItemBool("Month View Uses Category Color",&mMonthViewUsesCategoryColor,false);
257 addItemBool("Full View Month",&mFullViewMonth,true); 257 addItemBool("Full View Month",&mFullViewMonth,true);
258 addItemBool("Full View Todo",&mFullViewTodo,true); 258 addItemBool("Full View Todo",&mFullViewTodo,true);
259 addItemBool("Quick Todo",&mEnableQuickTodo,false); 259 addItemBool("Quick Todo",&mEnableQuickTodo,false);
260 260
261 addItemInt("Next X Days",&mNextXDays,3); 261 addItemInt("Next X Days",&mNextXDays,3);
262 262
263 KPrefs::setCurrentGroup("Printer"); 263 KPrefs::setCurrentGroup("Printer");
264 264
265 KPrefs::setCurrentGroup("Layout"); 265 KPrefs::setCurrentGroup("Layout");
266 266
267 addItemBool("CompactDialogs",&mCompactDialogs,false); 267 addItemBool("CompactDialogs",&mCompactDialogs,false);
268 addItemBool("VerticalScreen",&mVerticalScreen,true); 268 addItemBool("VerticalScreen",&mVerticalScreen,true);
269 269
270 KPrefs::setCurrentGroup("KOrganizer Plugins"); 270 KPrefs::setCurrentGroup("KOrganizer Plugins");
271 271
272 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays"); 272 addItemStringList("SelectedPlugins",&mSelectedPlugins,"holidays");
273 273
274 KPrefs::setCurrentGroup("Group Scheduling"); 274 KPrefs::setCurrentGroup("Group Scheduling");
275 275
276 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail); 276 addItemInt("IMIPScheduler",&mIMIPScheduler,IMIPKMail);
277 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend); 277 addItemInt("IMIPSend",&mIMIPSend,IMIPdirectsend);
278 addItemStringList("AdditionalMails",&mAdditionalMails,""); 278 addItemStringList("AdditionalMails",&mAdditionalMails,"");
279 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto); 279 addItemInt("IMIP auto refresh",&mIMIPAutoRefresh,neverAuto);
280 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto); 280 addItemInt("IMIP auto insert request",&mIMIPAutoInsertRequest,neverAuto);
281 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto); 281 addItemInt("IMIP auto insert reply",&mIMIPAutoInsertReply,neverAuto);
282 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto); 282 addItemInt("IMIP auto FreeBusy",&mIMIPAutoFreeBusy,neverAuto);
283 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto); 283 addItemInt("IMIP auto save FreeBusy",&mIMIPAutoFreeBusyReply,neverAuto);
284 284
285 KPrefs::setCurrentGroup( "Editors" ); 285 KPrefs::setCurrentGroup( "Editors" );
286 286
287 addItemStringList( "EventTemplates", &mEventTemplates ); 287 addItemStringList( "EventTemplates", &mEventTemplates );
288 addItemStringList( "TodoTemplates", &mTodoTemplates ); 288 addItemStringList( "TodoTemplates", &mTodoTemplates );
289 289
290 addItemInt("DestinationPolicy",&mDestination,standardDestination); 290 addItemInt("DestinationPolicy",&mDestination,standardDestination);
291 291
292 292
293 293
294} 294}
295 295
296 296
297KOPrefs::~KOPrefs() 297KOPrefs::~KOPrefs()
298{ 298{
299 if (mInstance == this) 299 if (mInstance == this)
300 mInstance = insd.setObject(0); 300 mInstance = insd.setObject(0);
301 301
302 //qDebug("KOPrefs::~KOPrefs() "); 302 //qDebug("KOPrefs::~KOPrefs() ");
303} 303}
304 304
305 305
306KOPrefs *KOPrefs::instance() 306KOPrefs *KOPrefs::instance()
307{ 307{
308 if (!mInstance) { 308 if (!mInstance) {
309 mInstance = insd.setObject(new KOPrefs()); 309 mInstance = insd.setObject(new KOPrefs());
310 mInstance->readConfig(); 310 mInstance->readConfig();
311 } 311 }
312 312
313 return mInstance; 313 return mInstance;
314} 314}
315 315
316void KOPrefs::usrSetDefaults() 316void KOPrefs::usrSetDefaults()
317{ 317{
318 318
319} 319}
320 320
321void KOPrefs::fillMailDefaults() 321void KOPrefs::fillMailDefaults()
322{ 322{
323 if (mName.isEmpty()) mName = i18n("Anonymous"); 323 if (mName.isEmpty()) mName = i18n("Anonymous");
324 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere"); 324 if (mEmail.isEmpty()) mEmail = i18n("nobody@nowhere");
325} 325}
326 326
327void KOPrefs::setTimeZoneIdDefault() 327void KOPrefs::setTimeZoneIdDefault()