summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-03-24 12:34:27 (UTC)
committer zautrix <zautrix>2005-03-24 12:34:27 (UTC)
commit685d04bc8f696697202f2fc0de18e61905cbb2fa (patch) (unidiff)
tree927d070c135d0025b236f6bd76143e0341ef2566
parenta9e8535fd6960f454ab7009cfa996973291502a2 (diff)
downloadkdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.zip
kdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.tar.gz
kdepimpi-685d04bc8f696697202f2fc0de18e61905cbb2fa.tar.bz2
layout fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/datenavigatorcontainer.cpp74
-rw-r--r--korganizer/datenavigatorcontainer.h8
-rw-r--r--korganizer/kdatenavigator.cpp2
-rw-r--r--korganizer/koagendaitem.cpp4
-rw-r--r--korganizer/koprefsdialog.cpp18
-rw-r--r--korganizer/mainwindow.cpp4
6 files changed, 65 insertions, 45 deletions
diff --git a/korganizer/datenavigatorcontainer.cpp b/korganizer/datenavigatorcontainer.cpp
index d1caff3..2290c53 100644
--- a/korganizer/datenavigatorcontainer.cpp
+++ b/korganizer/datenavigatorcontainer.cpp
@@ -1,387 +1,401 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2001,2002,2003 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com> 5 Copyright (C) 2003-2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25 25
26#include <kdebug.h> 26#include <kdebug.h>
27#include <klocale.h> 27#include <klocale.h>
28 28
29//#include "koglobals.h" 29//#include "koglobals.h"
30#include "navigatorbar.h" 30#include "navigatorbar.h"
31#include "kdatenavigator.h" 31#include "kdatenavigator.h"
32 32
33#include <kcalendarsystem.h> 33#include <kcalendarsystem.h>
34 34
35#include "datenavigatorcontainer.h" 35#include "datenavigatorcontainer.h"
36#include "koprefs.h" 36#include "koprefs.h"
37 37
38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent, 38DateNavigatorContainer::DateNavigatorContainer( QWidget *parent,
39 const char *name ) 39 const char *name )
40 : QWidget( parent, name ), mCalendar( 0 ), 40 : QWidget( parent, name ), mCalendar( 0 ),
41 mHorizontalCount( 1 ), mVerticalCount( 1 ) 41 mHorizontalCount( 1 ), mVerticalCount( 1 )
42{ 42{
43 mExtraViews.setAutoDelete( true ); 43 mExtraViews.setAutoDelete( true );
44 44
45 mNavigatorView = new KDateNavigator( this, name ); 45 mNavigatorView = new KDateNavigator( this, name );
46 46
47 connectNavigatorView( mNavigatorView ); 47 connectNavigatorView( mNavigatorView );
48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 48 //setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
49 mLastDisplayedDN = 0; 49 mLastDisplayedDN = 0;
50 mUpdateTimer; 50 mUpdateTimer;
51 mUpdateTimer = new QTimer( this ); 51 mUpdateTimer = new QTimer( this );
52 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() )); 52 connect (mUpdateTimer ,SIGNAL(timeout()), this, SLOT ( checkUpdateDayMatrixDates() ));
53 mFirstSelectedDate = QDate::currentDate(); 53 mFirstSelectedDate = QDate::currentDate();
54 mSelectedDateCount = 1; 54 mSelectedDateCount = 1;
55} 55}
56 56
57DateNavigatorContainer::~DateNavigatorContainer() 57DateNavigatorContainer::~DateNavigatorContainer()
58{ 58{
59} 59}
60 60
61void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v ) 61void DateNavigatorContainer::connectNavigatorView( KDateNavigator *v )
62{ 62{
63 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ), 63 connect( v, SIGNAL( datesSelected( const KCal::DateList & ) ),
64 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 64 SIGNAL( datesSelected( const KCal::DateList & ) ) );
65#if 0 65#if 0
66 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ), 66 connect( v, SIGNAL( incidenceDropped( Incidence *, const QDate & ) ),
67 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) ); 67 SIGNAL( incidenceDropped( Incidence *, const QDate & ) ) );
68 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ), 68 connect( v, SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ),
69 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) ); 69 SIGNAL( incidenceDroppedMove( Incidence *, const QDate & ) ) );
70#endif 70#endif
71 connect( v, SIGNAL( weekClicked( const QDate & ) ), 71 connect( v, SIGNAL( weekClicked( const QDate & ) ),
72 SIGNAL( weekClicked( const QDate & ) ) ); 72 SIGNAL( weekClicked( const QDate & ) ) );
73 73
74 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) ); 74 connect( v, SIGNAL( goPrevious() ), SIGNAL( goPrevious() ) );
75 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) ); 75 connect( v, SIGNAL( goNext() ), SIGNAL( goNext() ) );
76 76
77 connect( v, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); 77 connect( v, SIGNAL( goNextMonth() ), SLOT( slotgoNextMonth() ) );
78 connect( v, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); 78 connect( v, SIGNAL( goPrevMonth() ), SLOT( slotgoPrevMonth() ) );
79 connect( v, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); 79 connect( v, SIGNAL( goNextYear() ), SLOT( slotgoNextYear() ) );
80 connect( v, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); 80 connect( v, SIGNAL( goPrevYear() ), SLOT( slotgoPrevYear() ) );
81 81
82 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 82 connect( v, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
83} 83}
84void DateNavigatorContainer::slotgoNextYear()
85{
86 jumpMonth( 12 );
87 emit goNextYear();
88
89}
90void DateNavigatorContainer::slotgoPrevYear()
91{
92 jumpMonth( -12 );
93 emit goPrevYear();
94
95}
96void DateNavigatorContainer::slotgoPrevMonth()
97{
98 jumpMonth( -1 );
99 emit goPrevMonth();
100
101}
102void DateNavigatorContainer::slotgoNextMonth()
103{
104 jumpMonth( 1 );
105 emit goNextMonth();
106}
107void DateNavigatorContainer::jumpMonth( int month )
108{
84 109
110 QDate baseDate = mNavigatorView->baseDate();
111 computeMonthSelected( baseDate.month() + month, false );
112}
85void DateNavigatorContainer::slotMonthSelected( int month ) 113void DateNavigatorContainer::slotMonthSelected( int month )
86{ 114{
87 //qDebug("slotMonthSelected %d ", month); 115 computeMonthSelected( month, true );
116}
117void DateNavigatorContainer::computeMonthSelected( int month , bool forceEmit )
118{
119 //qDebug("slotMonthSelected %d ", month);
88 QDate baseDate = mNavigatorView->baseDate(); 120 QDate baseDate = mNavigatorView->baseDate();
89 if ( baseDate.month() == month ) 121 if ( baseDate.month() == month )
90 return; 122 return;
91 //qDebug("month %d %d ",baseDate.month(),month); 123 //qDebug("month %d %d ",baseDate.month(),month);
92 QDate date = QDate ( baseDate.year(), baseDate.month() , 15 ); 124 QDate date = QDate ( baseDate.year(), baseDate.month() , 15 );
93 date = date.addDays( -(baseDate.month()-month ) *30 ); 125 date = date.addDays( -(baseDate.month()-month ) *30 );
94 QDate newBase = QDate ( date.year(), date.month() , baseDate.day() ); 126 QDate newBase = QDate ( date.year(), date.month() , baseDate.day() );
95 127
96#if 0
97 mFirstSelectedDate = dateList.first() ;
98 mSelectedDateCount = dateList.count() ;
99
100 KDateNavigator *view = mExtraViews.at( 0 );
101 QDate date = view->baseDate();
102
103 QDate curEnd = date.addDays( (mLastDisplayedDN)*30 +7);
104 //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() );
105 if ( lDate < curEnd && date.addDays( -30 ) < fDate) {
106 mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate );
107 mNavigatorView->dayMatrix()->repaint( false );
108 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
109 KDateNavigator *n = mExtraViews.at( i );
110 if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) {
111 n->dayMatrix()->repaint( false );
112 }
113 }
114 return;
115 }
116#endif
117 //qDebug("NEW BASE %s", newBase.toString().latin1()); 128 //qDebug("NEW BASE %s", newBase.toString().latin1());
118 mNavigatorView->setBaseDate( newBase ); 129 mNavigatorView->setBaseDate( newBase );
119 QDate last = lastAvailableDate(); 130 QDate last = lastAvailableDate();
120 QDate first = firstAvailableDate(); 131 QDate first = firstAvailableDate();
121 132
122 QDate selFirst = mFirstSelectedDate; 133 QDate selFirst = mFirstSelectedDate;
123 QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); 134 QDate selLast = selFirst.addDays( mSelectedDateCount-1 );
124 if ( selFirst >= first && selLast <= last ) { 135 if ( selFirst >= first && selLast <= last ) {
125 setBaseDates(); 136 setBaseDates();
126 updateDayMatrixDates(); 137 if ( forceEmit )
138 updateDayMatrixDates();
127 } 139 }
128 else { 140 else {
129 setBaseDates(); 141 setBaseDates();
130 updateDayMatrixDates(); 142 if ( forceEmit )
131 emit monthSelected( month ); 143 updateDayMatrixDates();
144 if ( forceEmit )
145 emit monthSelected( month );
132 } 146 }
133} 147}
134void DateNavigatorContainer::setCalendar( Calendar *cal ) 148void DateNavigatorContainer::setCalendar( Calendar *cal )
135{ 149{
136 mCalendar = cal; 150 mCalendar = cal;
137 mNavigatorView->setCalendar( cal ); 151 mNavigatorView->setCalendar( cal );
138 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 152 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
139 KDateNavigator *n = mExtraViews.at( i ); 153 KDateNavigator *n = mExtraViews.at( i );
140 n->setCalendar( cal ); 154 n->setCalendar( cal );
141 } 155 }
142} 156}
143void DateNavigatorContainer::checkUpdateDayMatrixDates() 157void DateNavigatorContainer::checkUpdateDayMatrixDates()
144{ 158{
145 //qDebug("KODNC: wid %d hei %d ", width(), height()); 159 //qDebug("KODNC: wid %d hei %d ", width(), height());
146 mUpdateTimer->stop(); 160 mUpdateTimer->stop();
147 //return; 161 //return;
148 if ( width() < 3 || height() < 3 ) 162 if ( width() < 3 || height() < 3 )
149 return; 163 return;
150 static int lastWid = 0; 164 static int lastWid = 0;
151 static int lastHei = 0; 165 static int lastHei = 0;
152 if ( lastWid == width() && height() == lastHei ) { 166 if ( lastWid == width() && height() == lastHei ) {
153 qDebug("KODNC: No layout computing needed. "); 167 qDebug("KODNC: No layout computing needed. ");
154 } else { 168 } else {
155 lastWid = width(); 169 lastWid = width();
156 lastHei = height(); 170 lastHei = height();
157 171
158 QSize minSize = mNavigatorView->yourSizeHint(); 172 QSize minSize = mNavigatorView->yourSizeHint();
159 173
160 int verticalCount = size().height() / minSize.height(); 174 int verticalCount = size().height() / minSize.height();
161 int horizontalCount = size().width() / minSize.width(); 175 int horizontalCount = size().width() / minSize.width();
162 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() ); 176 //qDebug(" wattdatt %d new %d %d ", size().width() ,e->size().width() , minSize.width() );
163 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount ); 177 //qDebug("COUNT %d %d %d %d ", verticalCount, horizontalCount , mVerticalCount, mHorizontalCount );
164 bool fontchange = false; 178 bool fontchange = false;
165 if ( horizontalCount == 1) 179 if ( horizontalCount == 1)
166 horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width(); 180 horizontalCount = size().width() / mNavigatorView->yourFullSizeHint().width();
167 QFont fo; 181 QFont fo;
168 if ( horizontalCount != mHorizontalCount || 182 if ( horizontalCount != mHorizontalCount ||
169 verticalCount != mVerticalCount ) { 183 verticalCount != mVerticalCount ) {
170 uint count = horizontalCount * verticalCount; 184 uint count = horizontalCount * verticalCount;
171 if ( count == 0 ) { 185 if ( count == 0 ) {
172 bool ok; 186 bool ok;
173 fo = mNavigatorView->yourFontHint( size() , &ok ); 187 fo = mNavigatorView->yourFontHint( size() , &ok );
174 //mNavigatorView->resize( size() ); 188 //mNavigatorView->resize( size() );
175 //if ( ! ok ) 189 //if ( ! ok )
176 // return; 190 // return;
177 int butt = 2; 191 int butt = 2;
178 horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width(); 192 horizontalCount = size().width() / mNavigatorView->sizeHintTwoButtons( ).width();
179 if ( horizontalCount <= 1 ) 193 if ( horizontalCount <= 1 )
180 minSize = mNavigatorView->sizeHintTwoButtons( 4 ); 194 minSize = mNavigatorView->sizeHintTwoButtons( 4 );
181 else 195 else
182 minSize = mNavigatorView->sizeHintTwoButtons(); 196 minSize = mNavigatorView->sizeHintTwoButtons();
183 verticalCount = size().height() / minSize.height(); 197 verticalCount = size().height() / minSize.height();
184 horizontalCount = size().width() / minSize.width(); 198 horizontalCount = size().width() / minSize.width();
185 if ( horizontalCount == 0 ) 199 if ( horizontalCount == 0 )
186 horizontalCount = 1; 200 horizontalCount = 1;
187 if ( verticalCount == 0 ) 201 if ( verticalCount == 0 )
188 verticalCount = 1; 202 verticalCount = 1;
189 fontchange = true; 203 fontchange = true;
190 count = horizontalCount * verticalCount; 204 count = horizontalCount * verticalCount;
191 } else { 205 } else {
192 if ( mNavigatorView->fontChanged() ) { 206 if ( mNavigatorView->fontChanged() ) {
193 fontchange = true; 207 fontchange = true;
194 fo = KOPrefs::instance()->mDateNavigatorFont; 208 fo = KOPrefs::instance()->mDateNavigatorFont;
195 mNavigatorView->changeFont( fo ); 209 mNavigatorView->changeFont( fo );
196 mNavigatorView->unsetFontChanged(); 210 mNavigatorView->unsetFontChanged();
197 } 211 }
198 } 212 }
199 213
200 mLastDisplayedDN = horizontalCount*verticalCount-1; 214 mLastDisplayedDN = horizontalCount*verticalCount-1;
201 while ( count > ( mExtraViews.count() + 1 ) ) { 215 while ( count > ( mExtraViews.count() + 1 ) ) {
202 KDateNavigator *n = new KDateNavigator( this ); 216 KDateNavigator *n = new KDateNavigator( this );
203 n->setMonthSignalOffset ( mExtraViews.count()+1 ); 217 n->setMonthSignalOffset ( mExtraViews.count()+1 );
204 mExtraViews.append( n ); 218 mExtraViews.append( n );
205 n->setCalendar( mCalendar ); 219 n->setCalendar( mCalendar );
206 connectNavigatorView( n ); 220 connectNavigatorView( n );
207 n->show(); 221 n->show();
208 } 222 }
209 int iii = 0; 223 int iii = 0;
210 while ( iii < ( mExtraViews.count() ) ) { 224 while ( iii < ( mExtraViews.count() ) ) {
211 if ( iii < count-1 ) 225 if ( iii < count-1 )
212 mExtraViews.at( iii )->show(); 226 mExtraViews.at( iii )->show();
213 else 227 else
214 mExtraViews.at( iii )->hide(); 228 mExtraViews.at( iii )->hide();
215 ++iii; 229 ++iii;
216 } 230 }
217 231
218 setBaseDates(); 232 setBaseDates();
219 if ( fontchange ) { 233 if ( fontchange ) {
220 //mNavigatorView->changeFont( fo ); 234 //mNavigatorView->changeFont( fo );
221 uint i; 235 uint i;
222 for( i = 0; i < mExtraViews.count(); ++i ) { 236 for( i = 0; i < mExtraViews.count(); ++i ) {
223 KDateNavigator *view = mExtraViews.at( i ); 237 KDateNavigator *view = mExtraViews.at( i );
224 view->changeFont( fo ); 238 view->changeFont( fo );
225 } 239 }
226 } 240 }
227 mHorizontalCount = horizontalCount; 241 mHorizontalCount = horizontalCount;
228 mVerticalCount = verticalCount; 242 mVerticalCount = verticalCount;
229 243
230 } 244 }
231 245
232 int theight = height() / mVerticalCount; 246 int theight = height() / mVerticalCount;
233 int twidth = width() / mHorizontalCount; 247 int twidth = width() / mHorizontalCount;
234 248
235 NavigatorBar *bar = mNavigatorView->navigatorBar(); 249 NavigatorBar *bar = mNavigatorView->navigatorBar();
236 if ( mHorizontalCount > 1 ) bar->showButtons( true, false ); 250 if ( mHorizontalCount > 1 ) bar->showButtons( true, false );
237 else bar->showButtons( true, true ); 251 else bar->showButtons( true, true );
238 252
239 mNavigatorView->setGeometry(0, 253 mNavigatorView->setGeometry(0,
240 0, twidth, theight ); 254 0, twidth, theight );
241 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 255 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
242 int x = ( i + 1 ) % mHorizontalCount; 256 int x = ( i + 1 ) % mHorizontalCount;
243 int y = ( i + 1 ) / mHorizontalCount; 257 int y = ( i + 1 ) / mHorizontalCount;
244 258
245 KDateNavigator *view = mExtraViews.at( i ); 259 KDateNavigator *view = mExtraViews.at( i );
246 bar = view->navigatorBar(); 260 bar = view->navigatorBar();
247 if ( y > 0 ) bar->showButtons( false, false ); 261 if ( y > 0 ) bar->showButtons( false, false );
248 else { 262 else {
249 if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true ); 263 if ( x + 1 == mHorizontalCount ) bar->showButtons( false, true );
250 else bar->showButtons( false, false ); 264 else bar->showButtons( false, false );
251 } 265 }
252 view->setGeometry( x * twidth, 266 view->setGeometry( x * twidth,
253 y * theight, twidth, theight ); 267 y * theight, twidth, theight );
254 } 268 }
255 } 269 }
256 270
257 QDate last = lastAvailableDate(); 271 QDate last = lastAvailableDate();
258 QDate first = firstAvailableDate(); 272 QDate first = firstAvailableDate();
259 273
260 QDate selFirst = mFirstSelectedDate; 274 QDate selFirst = mFirstSelectedDate;
261 QDate selLast = selFirst.addDays( mSelectedDateCount-1 ); 275 QDate selLast = selFirst.addDays( mSelectedDateCount-1 );
262 if ( selFirst >= first && selLast <= last ) { 276 if ( selFirst >= first && selLast <= last ) {
263 updateDayMatrixDates(); 277 updateDayMatrixDates();
264 } 278 }
265 else { 279 else {
266 updateDayMatrixDates(); 280 updateDayMatrixDates();
267 emit monthSelected( mFirstSelectedDate.month() ); 281 emit monthSelected( mFirstSelectedDate.month() );
268 } 282 }
269} 283}
270void DateNavigatorContainer::updateDayMatrixDates() 284void DateNavigatorContainer::updateDayMatrixDates()
271{ 285{
272 QDate fDate = mFirstSelectedDate; 286 QDate fDate = mFirstSelectedDate;
273 QDate lDate = fDate.addDays( mSelectedDateCount - 1 ); 287 QDate lDate = fDate.addDays( mSelectedDateCount - 1 );
274 mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate ); 288 mNavigatorView->dayMatrix()->setSelectedDaysFrom( fDate , lDate );
275 mNavigatorView->dayMatrix()->repaint( false ); 289 mNavigatorView->dayMatrix()->repaint( false );
276 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 290 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
277 KDateNavigator *n = mExtraViews.at( i ); 291 KDateNavigator *n = mExtraViews.at( i );
278 if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) { 292 if ( n->dayMatrix()->setSelectedDaysFrom( fDate , lDate ) ) {
279 n->dayMatrix()->repaint( false ); 293 n->dayMatrix()->repaint( false );
280 } 294 }
281 } 295 }
282} 296}
283 297
284void DateNavigatorContainer::updateDayMatrix() 298void DateNavigatorContainer::updateDayMatrix()
285{ 299{
286 mNavigatorView->updateDayMatrix(); 300 mNavigatorView->updateDayMatrix();
287 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 301 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
288 KDateNavigator *n = mExtraViews.at( i ); 302 KDateNavigator *n = mExtraViews.at( i );
289 n->updateDayMatrix(); 303 n->updateDayMatrix();
290 } 304 }
291} 305}
292 306
293void DateNavigatorContainer::updateToday() 307void DateNavigatorContainer::updateToday()
294{ 308{
295 qDebug("DateNavigatorContainer::updateToday() NOT IMPL "); 309 qDebug("DateNavigatorContainer::updateToday() NOT IMPL ");
296#if 0 310#if 0
297 mNavigatorView->updateToday(); 311 mNavigatorView->updateToday();
298 KDateNavigator *n; 312 KDateNavigator *n;
299 for( n = mExtraViews.first(); n; n = mExtraViews.next() ) { 313 for( n = mExtraViews.first(); n; n = mExtraViews.next() ) {
300 n->updateToday(); 314 n->updateToday();
301 } 315 }
302#endif 316#endif
303} 317}
304 318
305void DateNavigatorContainer::updateView() 319void DateNavigatorContainer::updateView()
306{ 320{
307 mNavigatorView->updateView(); 321 mNavigatorView->updateView();
308 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 322 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
309 KDateNavigator *n = mExtraViews.at( i ); 323 KDateNavigator *n = mExtraViews.at( i );
310 n->updateView(); 324 n->updateView();
311 } 325 }
312} 326}
313 327
314void DateNavigatorContainer::updateConfig() 328void DateNavigatorContainer::updateConfig()
315{ 329{
316 mNavigatorView->updateConfig(); 330 mNavigatorView->updateConfig();
317 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 331 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
318 KDateNavigator *n = mExtraViews.at( i ); 332 KDateNavigator *n = mExtraViews.at( i );
319 n->updateConfig(); 333 n->updateConfig();
320 } 334 }
321} 335}
322QDate DateNavigatorContainer::lastAvailableDate() const 336QDate DateNavigatorContainer::lastAvailableDate() const
323{ 337{
324 QDate date = mNavigatorView->baseDate(); 338 QDate date = mNavigatorView->baseDate();
325 QDate last = QDate ( date.year(), date.month(), date.daysInMonth() ); 339 QDate last = QDate ( date.year(), date.month(), date.daysInMonth() );
326 int iii = mLastDisplayedDN; 340 int iii = mLastDisplayedDN;
327 if ( mLastDisplayedDN ) 341 if ( mLastDisplayedDN )
328 last = last.addDays( 1); 342 last = last.addDays( 1);
329 while ( iii ) { 343 while ( iii ) {
330 last = last.addDays( last.daysInMonth ()); 344 last = last.addDays( last.daysInMonth ());
331 //qDebug("DATE %s ", last.toString().latin1() ); 345 //qDebug("DATE %s ", last.toString().latin1() );
332 --iii; 346 --iii;
333 } 347 }
334 if ( mLastDisplayedDN ) 348 if ( mLastDisplayedDN )
335 last = last.addDays( -1); 349 last = last.addDays( -1);
336 return last; 350 return last;
337} 351}
338QDate DateNavigatorContainer::firstAvailableDate() const 352QDate DateNavigatorContainer::firstAvailableDate() const
339{ 353{
340 return QDate ( mNavigatorView->baseDate().year(), mNavigatorView->baseDate().month(), 1 ); 354 return QDate ( mNavigatorView->baseDate().year(), mNavigatorView->baseDate().month(), 1 );
341} 355}
342void DateNavigatorContainer::selectDates( const DateList &dateList ) 356void DateNavigatorContainer::selectDates( const DateList &dateList )
343{ 357{
344 mFirstSelectedDate = dateList.first() ; 358 mFirstSelectedDate = dateList.first() ;
345 mSelectedDateCount = dateList.count() ; 359 mSelectedDateCount = dateList.count() ;
346 if ( !mLastDisplayedDN ) { 360 if ( !mLastDisplayedDN ) {
347 mNavigatorView->selectDates( dateList ); 361 mNavigatorView->selectDates( dateList );
348 return; 362 return;
349 } 363 }
350 QDate fDate = dateList.first(); 364 QDate fDate = dateList.first();
351 QDate lDate = dateList.last(); 365 QDate lDate = dateList.last();
352 //qDebug("%s %s ", lastAvailableDate().toString().latin1(), firstAvailableDate().toString().latin1() ); 366 //qDebug("%s %s ", lastAvailableDate().toString().latin1(), firstAvailableDate().toString().latin1() );
353 //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() ); 367 //qDebug("End %s %s ",lDate.toString().latin1(),curEnd.toString().latin1() );
354 if ( lDate <= lastAvailableDate() && firstAvailableDate() <= fDate) { 368 if ( lDate <= lastAvailableDate() && firstAvailableDate() <= fDate) {
355 updateDayMatrixDates(); 369 updateDayMatrixDates();
356 return; 370 return;
357 } 371 }
358 mNavigatorView->selectDates( dateList ); 372 mNavigatorView->selectDates( dateList );
359 setBaseDates(); 373 setBaseDates();
360 if ( mLastDisplayedDN ) { 374 if ( mLastDisplayedDN ) {
361 KDateNavigator *view = mExtraViews.at( 0 ); 375 KDateNavigator *view = mExtraViews.at( 0 );
362 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); 376 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end()));
363 view->dayMatrix()->repaint( false ); 377 view->dayMatrix()->repaint( false );
364 if ( mLastDisplayedDN > 1 ) { 378 if ( mLastDisplayedDN > 1 ) {
365 KDateNavigator *view = mExtraViews.at( 1 ); 379 KDateNavigator *view = mExtraViews.at( 1 );
366 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end())); 380 view->dayMatrix()->setSelectedDaysFrom(*(dateList.begin()), *(--dateList.end()));
367 view->dayMatrix()->repaint( false ); 381 view->dayMatrix()->repaint( false );
368 } 382 }
369 } 383 }
370} 384}
371 385
372void DateNavigatorContainer::setBaseDates() 386void DateNavigatorContainer::setBaseDates()
373{ 387{
374 QDate baseDate = mNavigatorView->baseDate(); 388 QDate baseDate = mNavigatorView->baseDate();
375 bool doRepaint = true; 389 bool doRepaint = true;
376 for( uint i = 0; i < mLastDisplayedDN; ++i ) { 390 for( uint i = 0; i < mLastDisplayedDN; ++i ) {
377 KDateNavigator *n = mExtraViews.at( i ); 391 KDateNavigator *n = mExtraViews.at( i );
378 baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 ); 392 baseDate = baseDate.addDays( baseDate.daysInMonth () - baseDate.day() +1 );
379 n->setBaseDate( baseDate, doRepaint ); 393 n->setBaseDate( baseDate, doRepaint );
380 } 394 }
381} 395}
382 396
383void DateNavigatorContainer::resizeEvent( QResizeEvent * e ) 397void DateNavigatorContainer::resizeEvent( QResizeEvent * e )
384{ 398{
385 399
386 400
387 //qDebug("COUNT %d ", mExtraViews.count()); 401 //qDebug("COUNT %d ", mExtraViews.count());
diff --git a/korganizer/datenavigatorcontainer.h b/korganizer/datenavigatorcontainer.h
index 9a64720..d2f397d 100644
--- a/korganizer/datenavigatorcontainer.h
+++ b/korganizer/datenavigatorcontainer.h
@@ -1,100 +1,106 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org> 4 Copyright (c) 2004 Cornelius Schumacher <schumacher@kde.org>
5 Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com> 5 Copyright (C) 2004 Reinhold Kainhofer <reinhold@kainhofer.com>
6 6
7 This program is free software; you can redistribute it and/or modify 7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by 8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 2 of the License, or 9 the Free Software Foundation; either version 2 of the License, or
10 (at your option) any later version. 10 (at your option) any later version.
11 11
12 This program is distributed in the hope that it will be useful, 12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details. 15 GNU General Public License for more details.
16 16
17 You should have received a copy of the GNU General Public License 17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software 18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 20
21 As a special exception, permission is given to link this program 21 As a special exception, permission is given to link this program
22 with any edition of Qt, and distribute the resulting executable, 22 with any edition of Qt, and distribute the resulting executable,
23 without including the source code for Qt in the source distribution. 23 without including the source code for Qt in the source distribution.
24*/ 24*/
25#ifndef DATENAVIGATORCONTAINER_H 25#ifndef DATENAVIGATORCONTAINER_H
26#define DATENAVIGATORCONTAINER_H 26#define DATENAVIGATORCONTAINER_H
27 27
28class KDateNavigator; 28class KDateNavigator;
29 29
30#include <qwidget.h> 30#include <qwidget.h>
31#include <qtimer.h> 31#include <qtimer.h>
32#include <libkcal/calendar.h> 32#include <libkcal/calendar.h>
33using namespace KCal; 33using namespace KCal;
34 34
35class DateNavigatorContainer: public QWidget 35class DateNavigatorContainer: public QWidget
36{ 36{
37 Q_OBJECT 37 Q_OBJECT
38 public: 38 public:
39 DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 ); 39 DateNavigatorContainer( QWidget *parent = 0, const char *name = 0 );
40 ~DateNavigatorContainer(); 40 ~DateNavigatorContainer();
41 41
42 /** 42 /**
43 Associate date navigator with a calendar. It is used by KODayMatrix. 43 Associate date navigator with a calendar. It is used by KODayMatrix.
44 */ 44 */
45 void setCalendar( Calendar * ); 45 void setCalendar( Calendar * );
46 46
47 QSize minimumSizeHint() const; 47 QSize minimumSizeHint() const;
48 QSize sizeHint() const; 48 QSize sizeHint() const;
49 KDateNavigator * navigatorView() { return mNavigatorView;} 49 KDateNavigator * navigatorView() { return mNavigatorView;}
50 QDate lastAvailableDate() const ; 50 QDate lastAvailableDate() const ;
51 QDate firstAvailableDate() const ; 51 QDate firstAvailableDate() const ;
52 52
53 public slots: 53 public slots:
54 void selectDates( const KCal::DateList & ); 54 void selectDates( const KCal::DateList & );
55 void updateView(); 55 void updateView();
56 void updateConfig(); 56 void updateConfig();
57 void updateDayMatrix(); 57 void updateDayMatrix();
58 void updateDayMatrixDates(); 58 void updateDayMatrixDates();
59 void checkUpdateDayMatrixDates(); 59 void checkUpdateDayMatrixDates();
60 void updateToday(); 60 void updateToday();
61 void slotMonthSelected( int month ); 61 void slotMonthSelected( int month );
62 void slotgoNextMonth();
63 void slotgoPrevMonth();
64 void slotgoNextYear();
65 void slotgoPrevYear();
62 66
63 signals: 67 signals:
64 void datesSelected( const KCal::DateList & ); 68 void datesSelected( const KCal::DateList & );
65 void incidenceDropped( Incidence *, const QDate & ); 69 void incidenceDropped( Incidence *, const QDate & );
66 void incidenceDroppedMove( Incidence *, const QDate & ); 70 void incidenceDroppedMove( Incidence *, const QDate & );
67 void weekClicked( const QDate &); 71 void weekClicked( const QDate &);
68 72
69 void goPrevious(); 73 void goPrevious();
70 void goNext(); 74 void goNext();
71 75
72 void goNextMonth(); 76 void goNextMonth();
73 void goPrevMonth(); 77 void goPrevMonth();
74 void goNextYear(); 78 void goNextYear();
75 void goPrevYear(); 79 void goPrevYear();
76 80
77 void monthSelected( int month ); 81 void monthSelected( int month );
78 82
79 protected: 83 protected:
84 void computeMonthSelected( int month , bool forceEmit );
85 void jumpMonth( int month );
80 void resizeEvent( QResizeEvent * ); 86 void resizeEvent( QResizeEvent * );
81 87
82 void setBaseDates(); 88 void setBaseDates();
83 void connectNavigatorView( KDateNavigator *v ); 89 void connectNavigatorView( KDateNavigator *v );
84 90
85 private: 91 private:
86 QTimer* mUpdateTimer; 92 QTimer* mUpdateTimer;
87 int mLastDisplayedDN; 93 int mLastDisplayedDN;
88 QDate mFirstSelectedDate; 94 QDate mFirstSelectedDate;
89 int mSelectedDateCount; 95 int mSelectedDateCount;
90 KDateNavigator *mNavigatorView; 96 KDateNavigator *mNavigatorView;
91 97
92 KCal::Calendar *mCalendar; 98 KCal::Calendar *mCalendar;
93 99
94 QPtrList<KDateNavigator> mExtraViews; 100 QPtrList<KDateNavigator> mExtraViews;
95 101
96 int mHorizontalCount; 102 int mHorizontalCount;
97 int mVerticalCount; 103 int mVerticalCount;
98}; 104};
99 105
100#endif 106#endif
diff --git a/korganizer/kdatenavigator.cpp b/korganizer/kdatenavigator.cpp
index d62402f..6438c9a 100644
--- a/korganizer/kdatenavigator.cpp
+++ b/korganizer/kdatenavigator.cpp
@@ -1,378 +1,378 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001,2002 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001,2002 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 <qstring.h> 24#include <qstring.h>
25#include <qkeycode.h> 25#include <qkeycode.h>
26#include <qlayout.h> 26#include <qlayout.h>
27#include <qtimer.h> 27#include <qtimer.h>
28#include <qframe.h> 28#include <qframe.h>
29#include <qlabel.h> 29#include <qlabel.h>
30#include <qapplication.h> 30#include <qapplication.h>
31 31
32#include <kdebug.h> 32#include <kdebug.h>
33#include <klocale.h> 33#include <klocale.h>
34#include <kglobal.h> 34#include <kglobal.h>
35 35
36#include "koglobals.h" 36#include "koglobals.h"
37#include "koprefs.h" 37#include "koprefs.h"
38#ifndef KORG_NOPLUGINS 38#ifndef KORG_NOPLUGINS
39#include "kocore.h" 39#include "kocore.h"
40#endif 40#endif
41 41
42#include <kcalendarsystem.h> 42#include <kcalendarsystem.h>
43 43
44#include "navigatorbar.h" 44#include "navigatorbar.h"
45 45
46#include "kdatenavigator.h" 46#include "kdatenavigator.h"
47 47
48KDateNavigator::KDateNavigator( QWidget *parent, const char *name ) 48KDateNavigator::KDateNavigator( QWidget *parent, const char *name )
49 : QFrame(parent, name), 49 : QFrame(parent, name),
50 updateTimer(0L) 50 updateTimer(0L)
51{ 51{
52 setFrameStyle(QFrame::NoFrame); 52 setFrameStyle(QFrame::NoFrame);
53 QDate startDate = QDate::currentDate(); 53 QDate startDate = QDate::currentDate();
54 QGridLayout *topLayout = new QGridLayout(this,8,8); 54 QGridLayout *topLayout = new QGridLayout(this,8,8);
55 55
56 if (! startDate.isValid()) { 56 if (! startDate.isValid()) {
57 qDebug("KDateNavigator::invalid startdate "); 57 qDebug("KDateNavigator::invalid startdate ");
58 startDate = QDate::currentDate(); 58 startDate = QDate::currentDate();
59 } 59 }
60 mMonthSignalOffset = 0; 60 mMonthSignalOffset = 0;
61 mSelectedDates.append(startDate); 61 mSelectedDates.append(startDate);
62 m_MthYr = startDate; 62 m_MthYr = startDate;
63 m_bShowWeekNums = true; 63 m_bShowWeekNums = true;
64 64
65 setFont( KOPrefs::instance()->mDateNavigatorFont ); 65 setFont( KOPrefs::instance()->mDateNavigatorFont );
66 mNavigatorBar = new NavigatorBar( startDate, this ); 66 mNavigatorBar = new NavigatorBar( startDate, this );
67 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 ); 67 topLayout->addMultiCellWidget( mNavigatorBar, 0, 0, 0, 7 );
68 //mNavigatorBar->resize( 1,1); 68 //mNavigatorBar->resize( 1,1);
69 connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) ); 69 connect( mNavigatorBar, SIGNAL( goPrevYear() ), SIGNAL( goPrevYear() ) );
70 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) ); 70 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), SIGNAL( goPrevMonth() ) );
71 connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) ); 71 connect( mNavigatorBar, SIGNAL( goNextMonth() ), SIGNAL( goNextMonth() ) );
72 connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) ); 72 connect( mNavigatorBar, SIGNAL( goNextYear() ), SIGNAL( goNextYear() ) );
73 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) ); 73 connect( mNavigatorBar, SIGNAL( monthSelected( int ) ), SLOT( slotMonthSelected( int ) ) );
74 74
75 // get the day of the week on the first day 75 // get the day of the week on the first day
76 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1); 76 QDate dayone(m_MthYr.year(), m_MthYr.month(), 1);
77 m_fstDayOfWk = dayone.dayOfWeek(); 77 m_fstDayOfWk = dayone.dayOfWeek();
78 78
79 int i; 79 int i;
80 80
81 // Set up the heading fields. 81 // Set up the heading fields.
82 for( i = 0; i < 7; i++ ) { 82 for( i = 0; i < 7; i++ ) {
83 headings[i] = new QLabel("",this); 83 headings[i] = new QLabel("",this);
84 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold)); 84 //headings[i]->setFont(QFont("Arial", 10, QFont::Bold));
85 headings[i]->setAlignment(AlignCenter); 85 headings[i]->setAlignment(AlignCenter);
86 headings[i]->installEventFilter(this); 86 headings[i]->installEventFilter(this);
87 87
88 topLayout->addWidget(headings[i],1,i+1); 88 topLayout->addWidget(headings[i],1,i+1);
89 } 89 }
90 90
91 // Create the weeknumber labels 91 // Create the weeknumber labels
92 for( i = 0; i < 6; i++ ) { 92 for( i = 0; i < 6; i++ ) {
93 weeknos[i] = new QLabel(this); 93 weeknos[i] = new QLabel(this);
94 weeknos[i]->setAlignment(AlignCenter); 94 weeknos[i]->setAlignment(AlignCenter);
95 //weeknos[i]->setFont(QFont("Arial", 10)); 95 //weeknos[i]->setFont(QFont("Arial", 10));
96 if(!m_bShowWeekNums) { 96 if(!m_bShowWeekNums) {
97 weeknos[i]->hide(); 97 weeknos[i]->hide();
98 } 98 }
99 weeknos[i]->installEventFilter(this); 99 weeknos[i]->installEventFilter(this);
100 100
101 topLayout->addWidget(weeknos[i],i+2,0); 101 topLayout->addWidget(weeknos[i],i+2,0);
102 } 102 }
103 103
104 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix"); 104 daymatrix = new KODayMatrix( this, "KDateNavigator::DayMatrix");
105 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken); 105 daymatrix->setFrameStyle(QFrame::Panel|QFrame::Sunken);
106 daymatrix->setLineWidth(1); 106 daymatrix->setLineWidth(1);
107 107
108 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ), 108 connect( daymatrix, SIGNAL( selected( const KCal::DateList & ) ),
109 SIGNAL( datesSelected( const KCal::DateList & ) ) ); 109 SIGNAL( datesSelected( const KCal::DateList & ) ) );
110 110
111 connect( daymatrix, SIGNAL( eventDropped( Event * ) ), 111 connect( daymatrix, SIGNAL( eventDropped( Event * ) ),
112 SIGNAL( eventDropped( Event * ) ) ); 112 SIGNAL( eventDropped( Event * ) ) );
113 113
114 topLayout->addMultiCellWidget(daymatrix,2,7,1,7); 114 topLayout->addMultiCellWidget(daymatrix,2,7,1,7);
115 115
116 // read settings from configuration file. 116 // read settings from configuration file.
117 updateConfig(); 117 updateConfig();
118 enableRollover(FollowMonth); 118 enableRollover(FollowMonth);
119 mySizeHint = sizeHintTwoButtons(); 119 mySizeHint = sizeHintTwoButtons();
120 myFullSizeHint = sizeHintTwoButtons( 4 ); 120 myFullSizeHint = sizeHintTwoButtons( 4 );
121 mFontChanged = false; 121 mFontChanged = false;
122 resize ( mySizeHint ); 122 resize ( 0,0 );
123} 123}
124void KDateNavigator::changeFont ( QFont fo ) 124void KDateNavigator::changeFont ( QFont fo )
125{ 125{
126 setFont( fo ); 126 setFont( fo );
127 mNavigatorBar->resetFont( fo ); 127 mNavigatorBar->resetFont( fo );
128} 128}
129QFont KDateNavigator::yourFontHint( QSize si , bool *b) 129QFont KDateNavigator::yourFontHint( QSize si , bool *b)
130{ 130{
131 QFont fo = KOPrefs::instance()->mDateNavigatorFont; 131 QFont fo = KOPrefs::instance()->mDateNavigatorFont;
132 *b = false; 132 *b = false;
133 int fontPoint = fo.pointSize(); 133 int fontPoint = fo.pointSize();
134 while ( fontPoint > 5 ) { 134 while ( fontPoint > 5 ) {
135 --fontPoint; 135 --fontPoint;
136 fo.setPointSize( fontPoint ); 136 fo.setPointSize( fontPoint );
137 setFont( fo ); 137 setFont( fo );
138 mFontChanged = true; 138 mFontChanged = true;
139 mNavigatorBar->resetFont( fo ); 139 mNavigatorBar->resetFont( fo );
140 QSize sh = sizeHintTwoButtons( 2 ); 140 QSize sh = sizeHintTwoButtons( 2 );
141 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() ); 141 //qDebug("fp %d %d %d %d %d", fontPoint, si.width() , sh.width() , si.height() , sh.height() );
142 if ( si.width() > sh.width() && si.height() > sh.height()) { 142 if ( si.width() > sh.width() && si.height() > sh.height()) {
143 if ( si.width() / sh.width() == 1 ) { 143 if ( si.width() / sh.width() == 1 ) {
144 if ( si.width() < sizeHintTwoButtons( 4 ).width()) 144 if ( si.width() < sizeHintTwoButtons( 4 ).width())
145 continue; 145 continue;
146 } 146 }
147 *b = true; 147 *b = true;
148 //qDebug("fooooooooooooooooooooooouuuuund "); 148 //qDebug("fooooooooooooooooooooooouuuuund ");
149 break; 149 break;
150 } 150 }
151 } 151 }
152 //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() ); 152 //qDebug("returnnnnnnnnnnnnnnnnnnn %d", fo.pointSize() );
153 return fo; 153 return fo;
154} 154}
155QSize KDateNavigator::sizeHint() const 155QSize KDateNavigator::sizeHint() const
156{ 156{
157 QFontMetrics fm ( font() ); 157 QFontMetrics fm ( font() );
158 QSize day = daymatrix->sizeHint(); 158 QSize day = daymatrix->sizeHint();
159 QSize nav = mNavigatorBar->sizeHint(); 159 QSize nav = mNavigatorBar->sizeHint();
160 int wid = fm.width( "30") + day.width()+3; 160 int wid = fm.width( "30") + day.width()+3;
161 int hei = fm.height() +day.height()+nav.height()+2; 161 int hei = fm.height() +day.height()+nav.height()+2;
162 if ( wid < nav.width() ) 162 if ( wid < nav.width() )
163 wid = nav.width() ; 163 wid = nav.width() ;
164 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 164 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
165 return QSize ( wid, hei ); 165 return QSize ( wid, hei );
166} 166}
167QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const 167QSize KDateNavigator::sizeHintTwoButtons( int butnum ) const
168{ 168{
169 QFontMetrics fm ( font() ); 169 QFontMetrics fm ( font() );
170 QSize day = daymatrix->sizeHint(); 170 QSize day = daymatrix->sizeHint();
171 QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum ); 171 QSize nav = mNavigatorBar->sizeHintTwoButtons( butnum );
172 int wid = fm.width( "30") + day.width()+3; 172 int wid = fm.width( "30") + day.width()+3;
173 int hei = fm.height() +day.height()+nav.height()+2; 173 int hei = fm.height() +day.height()+nav.height()+2;
174 if ( wid < nav.width() ) 174 if ( wid < nav.width() )
175 wid = nav.width() ; 175 wid = nav.width() ;
176 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei); 176 //qDebug("KDateNavigator+++++++++++++ %d %d", wid , hei);
177 return QSize ( wid, hei ); 177 return QSize ( wid, hei );
178} 178}
179void KDateNavigator::slotMonthSelected( int m ) 179void KDateNavigator::slotMonthSelected( int m )
180{ 180{
181 if ( m_MthYr.month() <= mMonthSignalOffset) 181 if ( m_MthYr.month() <= mMonthSignalOffset)
182 m += 12; 182 m += 12;
183 //qDebug("%d mMonthSignalOffset %d emit %d", m, mMonthSignalOffset, m - mMonthSignalOffset); 183 //qDebug("%d mMonthSignalOffset %d emit %d", m, mMonthSignalOffset, m - mMonthSignalOffset);
184 emit monthSelected( m - mMonthSignalOffset ); 184 emit monthSelected( m - mMonthSignalOffset );
185 185
186} 186}
187void KDateNavigator::setCalendar( Calendar *cal ) 187void KDateNavigator::setCalendar( Calendar *cal )
188{ 188{
189 daymatrix->setCalendar( cal ); 189 daymatrix->setCalendar( cal );
190} 190}
191 191
192void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true 192void KDateNavigator::setBaseDate( const QDate &date , bool doRepaint ) // = true
193{ 193{
194 m_MthYr = date; 194 m_MthYr = date;
195 //qDebug("KDateNavigator::setBaseDate %s ", date.toString().latin1()); 195 //qDebug("KDateNavigator::setBaseDate %s ", date.toString().latin1());
196 196
197 updateDates(); 197 updateDates();
198 updateView(); 198 updateView();
199 199
200 KCal::DateList dates; 200 KCal::DateList dates;
201 dates.append( date ); 201 dates.append( date );
202 mNavigatorBar->selectDates( dates ); 202 mNavigatorBar->selectDates( dates );
203 203
204 daymatrix->clearSelection(); 204 daymatrix->clearSelection();
205 if ( doRepaint ) 205 if ( doRepaint )
206 daymatrix->repaint( false ); 206 daymatrix->repaint( false );
207} 207}
208 208
209void KDateNavigator::enableRollover(RolloverType r) 209void KDateNavigator::enableRollover(RolloverType r)
210{ 210{
211 switch(r) 211 switch(r)
212 { 212 {
213 case None : 213 case None :
214 if (updateTimer) 214 if (updateTimer)
215 { 215 {
216 updateTimer->stop(); 216 updateTimer->stop();
217 delete updateTimer; 217 delete updateTimer;
218 updateTimer=0L; 218 updateTimer=0L;
219 } 219 }
220 break; 220 break;
221 case FollowDay : 221 case FollowDay :
222 case FollowMonth : 222 case FollowMonth :
223 if (!updateTimer) 223 if (!updateTimer)
224 { 224 {
225 updateTimer = new QTimer(this); 225 updateTimer = new QTimer(this);
226 QObject::connect(updateTimer,SIGNAL(timeout()), 226 QObject::connect(updateTimer,SIGNAL(timeout()),
227 this,SLOT(possiblyPastMidnight())); 227 this,SLOT(possiblyPastMidnight()));
228 } 228 }
229 updateTimer->start(0,true); 229 updateTimer->start(0,true);
230 lastDayChecked = QDate::currentDate(); 230 lastDayChecked = QDate::currentDate();
231 } 231 }
232 updateRollover=r; 232 updateRollover=r;
233} 233}
234 234
235 235
236KDateNavigator::~KDateNavigator() 236KDateNavigator::~KDateNavigator()
237{ 237{
238} 238}
239 239
240 240
241void KDateNavigator::passedMidnight() 241void KDateNavigator::passedMidnight()
242{ 242{
243 QDate today = QDate::currentDate(); 243 QDate today = QDate::currentDate();
244 bool emitMonth = false; 244 bool emitMonth = false;
245 245
246 if (today.month() != lastDayChecked.month()) 246 if (today.month() != lastDayChecked.month())
247 { 247 {
248 if (updateRollover==FollowMonth && 248 if (updateRollover==FollowMonth &&
249 daymatrix->isEndOfMonth()) { 249 daymatrix->isEndOfMonth()) {
250 goNextMonth(); 250 goNextMonth();
251 emitMonth=true; 251 emitMonth=true;
252 } 252 }
253 } 253 }
254 daymatrix->recalculateToday(); 254 daymatrix->recalculateToday();
255 daymatrix->repaint( false ); 255 daymatrix->repaint( false );
256 emit dayPassed(today); 256 emit dayPassed(today);
257 if (emitMonth) { emit monthPassed(today); } 257 if (emitMonth) { emit monthPassed(today); }
258} 258}
259 259
260/* slot */ void KDateNavigator::possiblyPastMidnight() 260/* slot */ void KDateNavigator::possiblyPastMidnight()
261{ 261{
262 if (lastDayChecked!=QDate::currentDate()) 262 if (lastDayChecked!=QDate::currentDate())
263 { 263 {
264 passedMidnight(); 264 passedMidnight();
265 lastDayChecked=QDate::currentDate(); 265 lastDayChecked=QDate::currentDate();
266 } 266 }
267 // Set the timer to go off 1 second after midnight 267 // Set the timer to go off 1 second after midnight
268 // or after 8 minutes, whichever comes first. 268 // or after 8 minutes, whichever comes first.
269 if (updateTimer) 269 if (updateTimer)
270 { 270 {
271 QTime now = QTime::currentTime(); 271 QTime now = QTime::currentTime();
272 QTime midnight = QTime(23,59,59); 272 QTime midnight = QTime(23,59,59);
273 int msecsWait = QMIN(480000,now.msecsTo(midnight)+2000); 273 int msecsWait = QMIN(480000,now.msecsTo(midnight)+2000);
274 274
275 // qDebug(QString("Waiting %1 msec from %2 to %3.").arg(msecsWait)) 275 // qDebug(QString("Waiting %1 msec from %2 to %3.").arg(msecsWait))
276 //.arg(now.toString()).arg(midnight.toString())); 276 //.arg(now.toString()).arg(midnight.toString()));
277 277
278 updateTimer->stop(); 278 updateTimer->stop();
279 updateTimer->start(msecsWait,true); 279 updateTimer->start(msecsWait,true);
280 } 280 }
281} 281}
282 282
283void KDateNavigator::updateDates() 283void KDateNavigator::updateDates()
284{ 284{
285 // Find the first day of the week of the current month. 285 // Find the first day of the week of the current month.
286 //int d1 = KOGlobals::self()->calendarSystem()->day( m_MthYr ); 286 //int d1 = KOGlobals::self()->calendarSystem()->day( m_MthYr );
287 QDate dayone( m_MthYr.year(), m_MthYr.month(), m_MthYr.day() ); 287 QDate dayone( m_MthYr.year(), m_MthYr.month(), m_MthYr.day() );
288 int d2 = KOGlobals::self()->calendarSystem()->day( dayone ); 288 int d2 = KOGlobals::self()->calendarSystem()->day( dayone );
289 //int di = d1 - d2 + 1; 289 //int di = d1 - d2 + 1;
290 dayone = dayone.addDays( -d2 + 1 ); 290 dayone = dayone.addDays( -d2 + 1 );
291 291
292 int m_fstDayOfWkCalsys = KOGlobals::self()->calendarSystem()->dayOfWeek( dayone ); 292 int m_fstDayOfWkCalsys = KOGlobals::self()->calendarSystem()->dayOfWeek( dayone );
293 293
294 // If month begins on Monday and Monday is first day of week, 294 // If month begins on Monday and Monday is first day of week,
295 // month should begin on second line. Sunday doesn't have this problem. 295 // month should begin on second line. Sunday doesn't have this problem.
296 int nextLine = ( ( m_fstDayOfWkCalsys == 1) && 296 int nextLine = ( ( m_fstDayOfWkCalsys == 1) &&
297 ( KGlobal::locale()->weekStartsMonday() == 1 ) ) ? 7 : 0; 297 ( KGlobal::locale()->weekStartsMonday() == 1 ) ) ? 7 : 0;
298 298
299 // update the matrix dates 299 // update the matrix dates
300 int index = (KGlobal::locale()->weekStartsMonday() ? 1 : 0) - m_fstDayOfWkCalsys - nextLine; 300 int index = (KGlobal::locale()->weekStartsMonday() ? 1 : 0) - m_fstDayOfWkCalsys - nextLine;
301 301
302 302
303 daymatrix->updateView(dayone.addDays(index)); 303 daymatrix->updateView(dayone.addDays(index));
304//each updateDates is followed by an updateView -> repaint is issued there ! 304//each updateDates is followed by an updateView -> repaint is issued there !
305// daymatrix->repaint(); 305// daymatrix->repaint();
306} 306}
307 307
308void KDateNavigator::updateDayMatrix() 308void KDateNavigator::updateDayMatrix()
309{ 309{
310 daymatrix->updateView(); 310 daymatrix->updateView();
311 //daymatrix->repaint(); 311 //daymatrix->repaint();
312} 312}
313 313
314 314
315void KDateNavigator::updateView() 315void KDateNavigator::updateView()
316{ 316{
317 317
318 setUpdatesEnabled( false ); 318 setUpdatesEnabled( false );
319 319
320 int i; 320 int i;
321 321
322// kdDebug() << "updateView() -> daymatrix->updateView()" << endl; 322// kdDebug() << "updateView() -> daymatrix->updateView()" << endl;
323 daymatrix->updateView(); 323 daymatrix->updateView();
324 324
325 // set the week numbers. 325 // set the week numbers.
326 for(i = 0; i < 6; i++) { 326 for(i = 0; i < 6; i++) {
327 QString weeknum; 327 QString weeknum;
328 // remember, according to ISO 8601, the first week of the year is the 328 // remember, according to ISO 8601, the first week of the year is the
329 // first week that contains a thursday. Thus we must subtract off 4, 329 // first week that contains a thursday. Thus we must subtract off 4,
330 // not just 1. 330 // not just 1.
331 331
332 //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear(); 332 //ET int dayOfYear = buttons[(i + 1) * 7 - 4]->date().dayOfYear();
333 int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4))); 333 int dayOfYear = KOGlobals::self()->calendarSystem()->dayOfYear((daymatrix->getDate((i+1)*7-4)));
334 334
335 int add = 0; 335 int add = 0;
336 if ( ! KGlobal::locale()->weekStartsMonday() ) 336 if ( ! KGlobal::locale()->weekStartsMonday() )
337 ++add; 337 ++add;
338 if (dayOfYear % 7 != 0) 338 if (dayOfYear % 7 != 0)
339 weeknum.setNum(dayOfYear / 7 + 1+add); 339 weeknum.setNum(dayOfYear / 7 + 1+add);
340 else 340 else
341 weeknum.setNum(dayOfYear / 7 +add); 341 weeknum.setNum(dayOfYear / 7 +add);
342 weeknos[i]->setText(weeknum); 342 weeknos[i]->setText(weeknum);
343 } 343 }
344 344
345 setUpdatesEnabled( true ); 345 setUpdatesEnabled( true );
346// kdDebug() << "updateView() -> repaint()" << endl; 346// kdDebug() << "updateView() -> repaint()" << endl;
347 repaint(); 347 repaint();
348 // daymatrix->repaint(); 348 // daymatrix->repaint();
349} 349}
350 350
351void KDateNavigator::updateConfig() 351void KDateNavigator::updateConfig()
352{ 352{
353 int day; 353 int day;
354 for(int i=0; i<7; i++) { 354 for(int i=0; i<7; i++) {
355 // take the first letter of the day name to be the abbreviation 355 // take the first letter of the day name to be the abbreviation
356 if (KGlobal::locale()->weekStartsMonday()) { 356 if (KGlobal::locale()->weekStartsMonday()) {
357 day = i+1; 357 day = i+1;
358 } else { 358 } else {
359 if (i==0) day = 7; 359 if (i==0) day = 7;
360 else day = i; 360 else day = i;
361 } 361 }
362 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day, 362 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( day,
363 true ); 363 true );
364 if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 ); 364 if ( KOPrefs::instance()->mCompactDialogs ) dayName = dayName.left( 1 );
365 headings[i]->setText( dayName ); 365 headings[i]->setText( dayName );
366 } 366 }
367 updateDates(); 367 updateDates();
368 updateView(); 368 updateView();
369} 369}
370 370
371void KDateNavigator::setShowWeekNums(bool enabled) 371void KDateNavigator::setShowWeekNums(bool enabled)
372{ 372{
373 m_bShowWeekNums = enabled; 373 m_bShowWeekNums = enabled;
374 for(int i=0; i<6; i++) { 374 for(int i=0; i<6; i++) {
375 if(enabled) 375 if(enabled)
376 weeknos[i]->show(); 376 weeknos[i]->show();
377 else 377 else
378 weeknos[i]->hide(); 378 weeknos[i]->hide();
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 82d1eab..b30ad75 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -252,520 +252,520 @@ bool KOAgendaItem::updateIcons(QPainter * p, bool horLayout)
252 else 252 else
253 ++yOff; 253 ++yOff;
254 254
255 } 255 }
256 256
257 } 257 }
258 return ( yOff || xOff ); 258 return ( yOff || xOff );
259} 259}
260 260
261 261
262void KOAgendaItem::select(bool selected) 262void KOAgendaItem::select(bool selected)
263{ 263{
264 //qDebug("select %d %d",firstMultiItem(), nextMultiItem() ); 264 //qDebug("select %d %d",firstMultiItem(), nextMultiItem() );
265 if (mSelected == selected) return; 265 if (mSelected == selected) return;
266 mSelected = selected; 266 mSelected = selected;
267 if ( ! isVisible() ) 267 if ( ! isVisible() )
268 return; 268 return;
269 if ( firstMultiItem() ) 269 if ( firstMultiItem() )
270 firstMultiItem()->select( selected ); 270 firstMultiItem()->select( selected );
271 if ( !firstMultiItem() && nextMultiItem() ) { 271 if ( !firstMultiItem() && nextMultiItem() ) {
272 KOAgendaItem * placeItem = nextMultiItem(); 272 KOAgendaItem * placeItem = nextMultiItem();
273 while ( placeItem ) { 273 while ( placeItem ) {
274 placeItem->select( selected ); 274 placeItem->select( selected );
275 placeItem = placeItem->nextMultiItem(); 275 placeItem = placeItem->nextMultiItem();
276 } 276 }
277 } 277 }
278 globalFlagBlockAgendaItemUpdate = 0; 278 globalFlagBlockAgendaItemUpdate = 0;
279 paintMe( selected ); 279 paintMe( selected );
280 globalFlagBlockAgendaItemUpdate = 1; 280 globalFlagBlockAgendaItemUpdate = 1;
281 repaint( false ); 281 repaint( false );
282} 282}
283 283
284 284
285/* 285/*
286 The eventFilter has to filter the mouse events of the agenda item childs. The 286 The eventFilter has to filter the mouse events of the agenda item childs. The
287 events are fed into the event handling method of KOAgendaItem. This allows the 287 events are fed into the event handling method of KOAgendaItem. This allows the
288 KOAgenda to handle the KOAgendaItems by using an eventFilter. 288 KOAgenda to handle the KOAgendaItems by using an eventFilter.
289*/ 289*/
290bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e ) 290bool KOAgendaItem::eventFilter ( QObject *object, QEvent *e )
291{ 291{
292 if (e->type() == QEvent::MouseButtonPress || 292 if (e->type() == QEvent::MouseButtonPress ||
293 e->type() == QEvent::MouseButtonDblClick || 293 e->type() == QEvent::MouseButtonDblClick ||
294 e->type() == QEvent::MouseButtonRelease || 294 e->type() == QEvent::MouseButtonRelease ||
295 e->type() == QEvent::MouseMove) { 295 e->type() == QEvent::MouseMove) {
296 QMouseEvent *me = (QMouseEvent *)e; 296 QMouseEvent *me = (QMouseEvent *)e;
297 QPoint itemPos = this->mapFromGlobal(((QWidget *)object)-> 297 QPoint itemPos = this->mapFromGlobal(((QWidget *)object)->
298 mapToGlobal(me->pos())); 298 mapToGlobal(me->pos()));
299 QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state()); 299 QMouseEvent returnEvent (e->type(),itemPos,me->button(),me->state());
300 return event(&returnEvent); 300 return event(&returnEvent);
301 } else { 301 } else {
302 return false; 302 return false;
303 } 303 }
304} 304}
305void KOAgendaItem::repaintMe( ) 305void KOAgendaItem::repaintMe( )
306{ 306{
307 paintMe ( mSelected ); 307 paintMe ( mSelected );
308} 308}
309void KOAgendaItem::paintMe( bool selected, QPainter* paint ) 309void KOAgendaItem::paintMe( bool selected, QPainter* paint )
310{ 310{
311 if ( globalFlagBlockAgendaItemUpdate && ! selected) 311 if ( globalFlagBlockAgendaItemUpdate && ! selected)
312 return; 312 return;
313 QPainter pa; 313 QPainter pa;
314 314
315 if ( mSelected ) { 315 if ( mSelected ) {
316 pa.begin( paintPixSel() ); 316 pa.begin( paintPixSel() );
317 } else { 317 } else {
318 if ( mAllDay ) 318 if ( mAllDay )
319 pa.begin( paintPixAllday() ); 319 pa.begin( paintPixAllday() );
320 else 320 else
321 pa.begin( paintPix() ); 321 pa.begin( paintPix() );
322 } 322 }
323 int x, yy, w, h; 323 int x, yy, w, h;
324 float nfh = 7.0; 324 float nfh = 7.0;
325 x = pos().x(); w = width(); h = height (); 325 x = pos().x(); w = width(); h = height ();
326 if ( mAllDay ) 326 if ( mAllDay )
327 yy = y(); 327 yy = y();
328 else 328 else
329 yy = mCellYTop * ( height() / cellHeight() ); 329 yy = mCellYTop * ( height() / cellHeight() );
330 xPaintCoord= x; 330 xPaintCoord= x;
331 yPaintCoord = yy; 331 yPaintCoord = yy;
332 wPaintCoord = width(); 332 wPaintCoord = width();
333 hPaintCoord = height(); 333 hPaintCoord = height();
334 //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height()); 334 //qDebug("paintMe %s %d %d %d %d",incidence()->summary().latin1(), x, yy, width(), height());
335 if ( paint == 0 ) 335 if ( paint == 0 )
336 paint = &pa; 336 paint = &pa;
337 bool horLayout = ( w < h ); 337 bool horLayout = ( w < h );
338 int maxhei = mFontPixelSize+4; 338 int maxhei = mFontPixelSize+4;
339 if ( horLayout ) 339 if ( horLayout )
340 maxhei += AGENDA_ICON_SIZE -4; 340 maxhei += AGENDA_ICON_SIZE -4;
341 bool small = ( h < maxhei ); 341 bool small = ( h < maxhei );
342 if ( ! small ) 342 if ( ! small )
343 paint->setFont(KOPrefs::instance()->mAgendaViewFont); 343 paint->setFont(KOPrefs::instance()->mAgendaViewFont);
344 else { 344 else {
345 QFont f = KOPrefs::instance()->mAgendaViewFont; 345 QFont f = KOPrefs::instance()->mAgendaViewFont;
346 f.setBold( false ); 346 f.setBold( false );
347 int fh = f.pointSize(); 347 int fh = f.pointSize();
348 nfh = (((float)height())/(float)(mFontPixelSize+4))*fh; 348 nfh = (((float)height())/(float)(mFontPixelSize+4))*fh;
349 if ( nfh < 6 ) 349 if ( nfh < 6 )
350 nfh = 6; 350 nfh = 6;
351 f.setPointSize( nfh ); 351 f.setPointSize( nfh );
352 paint->setFont(f); 352 paint->setFont(f);
353 } 353 }
354 paint->fillRect ( x, yy, w, h, mBackgroundColor ); 354 paint->fillRect ( x, yy, w, h, mBackgroundColor );
355 static const QPixmap completedPxmp = SmallIcon("greenhook16"); 355 static const QPixmap completedPxmp = SmallIcon("greenhook16");
356 static const QPixmap overduePxmp = SmallIcon("redcross16"); 356 static const QPixmap overduePxmp = SmallIcon("redcross16");
357 if ( mIncidence->type() == "Todo" ) { 357 if ( mIncidence->type() == "Todo" ) {
358 Todo* tempTodo = static_cast<Todo*>(mIncidence); 358 Todo* tempTodo = static_cast<Todo*>(mIncidence);
359 int xx = pos().x()+(width()-completedPxmp.width()-3 ); 359 int xx = pos().x()+(width()-completedPxmp.width()-3 );
360 int yyy = yy+3; 360 int yyy = yy+3;
361 if ( tempTodo->isCompleted() ) 361 if ( tempTodo->isCompleted() )
362 paint->drawPixmap ( xx, yyy, completedPxmp ); 362 paint->drawPixmap ( xx, yyy, completedPxmp );
363 else { 363 else {
364 paint->drawPixmap ( xx, yyy, overduePxmp ); 364 paint->drawPixmap ( xx, yyy, overduePxmp );
365 365
366 } 366 }
367 } 367 }
368 bool addIcon = false; 368 bool addIcon = false;
369 if ( ! small || w > 3 * h || h > 3* w ) 369 if ( ! small || w > 3 * h || h > 3* w )
370 addIcon = updateIcons( paint, horLayout ); 370 addIcon = updateIcons( paint, horLayout );
371 371
372 qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0); 372 qDrawShadePanel (paint, x, yy, w, h, mColorGroup, selected , 2, 0);
373 //qDebug("draw rect %d %d %d %d ",x, yy, w, h ); 373 //qDebug("draw rect %d %d %d %d ",x, yy, w, h );
374 if ( ! small ) { 374 if ( ! small ) {
375 x += 3; yy += 3;w -= 6; h-= 5; 375 x += 3; yy += 3;w -= 6; h-= 5;
376 } else { 376 } else {
377 x += 2; yy += 1;w -= 4; h-= 4; 377 x += 2; yy += 1;w -= 4; h-= 4;
378 if ( nfh < 6.01 ) { 378 if ( nfh < 6.01 ) {
379 yy -= 2; 379 yy -= 2;
380 h += 4; 380 h += 4;
381 } 381 }
382 else 382 else
383 if ( nfh < h -2 ) 383 if ( nfh < h -2 )
384 ++yy; 384 ++yy;
385 } 385 }
386 int align; 386 int align;
387#ifndef DESKTOP_VERSION 387#ifndef DESKTOP_VERSION
388 align = ( AlignLeft|WordBreak|AlignTop); 388 align = ( AlignLeft|WordBreak|AlignTop);
389#else 389#else
390 align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop); 390 align = ( AlignLeft|BreakAnywhere|WordBreak|AlignTop);
391#endif 391#endif
392 if ( addIcon ) { 392 if ( addIcon ) {
393 if ( ! horLayout ) { 393 if ( ! horLayout ) {
394 x += AGENDA_ICON_SIZE+3; 394 x += AGENDA_ICON_SIZE+3;
395 w -= (AGENDA_ICON_SIZE+3); 395 w -= (AGENDA_ICON_SIZE+3);
396 } 396 }
397 else { 397 else {
398 yy+= AGENDA_ICON_SIZE+2; 398 yy+= AGENDA_ICON_SIZE+2;
399 h -=(AGENDA_ICON_SIZE+3); 399 h -=(AGENDA_ICON_SIZE+3);
400 } 400 }
401 } 401 }
402 int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue(); 402 int colsum = mBackgroundColor.red() + mBackgroundColor.green() + mBackgroundColor.blue();
403 if ( colsum < 250 ) 403 if ( colsum < 250 )
404 paint->setPen ( white); 404 paint->setPen ( white);
405 if ( x < 0 ) { 405 if ( x < 0 ) {
406 w = w+x-3; 406 w = w+x-3;
407 x = 3; 407 x = 3;
408 if ( w > parentWidget()->width() ){ 408 if ( w > parentWidget()->width() ){
409 w = parentWidget()->width() - 6; 409 w = parentWidget()->width() - 6;
410#ifndef DESKTOP_VERSION 410#ifndef DESKTOP_VERSION
411 align = ( AlignHCenter|WordBreak|AlignTop); 411 align = ( AlignHCenter|WordBreak|AlignTop);
412#else 412#else
413 align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop); 413 align = ( AlignHCenter|BreakAnywhere|WordBreak|AlignTop);
414#endif 414#endif
415 415
416 } 416 }
417 } 417 }
418 QRect dr; 418 QRect dr;
419 if ( w + x > parentWidget()->width() ) 419 if ( w + x > parentWidget()->width() )
420 w = parentWidget()->width()-x; 420 w = parentWidget()->width()-x;
421 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr ); 421 paint->drawText ( x, yy, w, h, align, mDisplayedText, -1, &dr );
422 //qDebug("%d %d %d %d ", x, yy, w, h ); 422 //qDebug("%d %d %d %d ", x, yy, w, h );
423 if ( mIncidence->cancelled() ){ 423 if ( mIncidence->cancelled() ){
424 if ( ! small ) { 424 if ( ! small ) {
425 QFontMetrics fm ( paint->font() ); 425 QFontMetrics fm ( paint->font() );
426 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2); 426 paint->drawLine(dr.left(), yy+fm.height()/2, dr.right()-2, yy+fm.height()/2);
427 } 427 }
428 428
429 } 429 }
430 pa.end(); 430 pa.end();
431 431
432} 432}
433void KOAgendaItem::resizePixmap( int w , int h ) 433void KOAgendaItem::resizePixmap( int w , int h )
434{ 434{
435 paintPix()->resize( w, h ); 435 paintPix()->resize( w, h );
436 paintPixSel()->resize( w, h ); 436 paintPixSel()->resize( w, h );
437 437
438} 438}
439QPixmap * KOAgendaItem::paintPix() 439QPixmap * KOAgendaItem::paintPix()
440{ 440{
441 static QPixmap* mPaintPix = 0; 441 static QPixmap* mPaintPix = 0;
442 if ( ! mPaintPix ) 442 if ( ! mPaintPix )
443 mPaintPix = new QPixmap(1,1); 443 mPaintPix = new QPixmap(1,1);
444 return mPaintPix ; 444 return mPaintPix ;
445} 445}
446QPixmap * KOAgendaItem::paintPixAllday() 446QPixmap * KOAgendaItem::paintPixAllday()
447{ 447{
448 static QPixmap* mPaintPixA = 0; 448 static QPixmap* mPaintPixA = 0;
449 if ( ! mPaintPixA ) 449 if ( ! mPaintPixA )
450 mPaintPixA = new QPixmap(1,1); 450 mPaintPixA = new QPixmap(1,1);
451 return mPaintPixA ; 451 return mPaintPixA ;
452} 452}
453QPixmap * KOAgendaItem::paintPixSel() 453QPixmap * KOAgendaItem::paintPixSel()
454{ 454{
455 static QPixmap* mPaintPixSel = 0; 455 static QPixmap* mPaintPixSel = 0;
456 if ( ! mPaintPixSel ) 456 if ( ! mPaintPixSel )
457 mPaintPixSel = new QPixmap(1,1); 457 mPaintPixSel = new QPixmap(1,1);
458 return mPaintPixSel ; 458 return mPaintPixSel ;
459} 459}
460void KOAgendaItem::paintEvent ( QPaintEvent *e ) 460void KOAgendaItem::paintEvent ( QPaintEvent *e )
461{ 461{
462 462
463 if ( globalFlagBlockAgendaItemPaint ) 463 if ( globalFlagBlockAgendaItemPaint )
464 return; 464 return;
465 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) 465 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 )
466 return; 466 return;
467 int yy; 467 int yy;
468 if ( mAllDay ) 468 if ( mAllDay )
469 yy = y(); 469 yy = y();
470 else 470 else
471 yy = mCellYTop * ( height() / cellHeight() ); 471 yy = mCellYTop * ( height() / cellHeight() );
472 int xx = x(); 472 int xx = x();
473 473
474 if ( xPaintCoord != xx || yPaintCoord != yy || 474 if ( xPaintCoord != xx || yPaintCoord != yy ||
475 wPaintCoord != width() || hPaintCoord != height()) { 475 wPaintCoord != width() || hPaintCoord != height()) {
476 xPaintCoord= xx; 476 xPaintCoord= xx;
477 yPaintCoord = yy; 477 yPaintCoord = yy;
478 wPaintCoord = width(); 478 wPaintCoord = width();
479 hPaintCoord = height(); 479 hPaintCoord = height();
480 globalFlagBlockAgendaItemUpdate = 0; 480 globalFlagBlockAgendaItemUpdate = 0;
481 paintMe( mSelected ); 481 paintMe( mSelected );
482 //qDebug("calling paintMe "); 482 //qDebug("calling paintMe ");
483 globalFlagBlockAgendaItemUpdate = 1; 483 globalFlagBlockAgendaItemUpdate = 1;
484 } 484 }
485 int rx, ry, rw, rh; 485 int rx, ry, rw, rh;
486 rx = e->rect().x(); 486 rx = e->rect().x();
487 ry = e->rect().y(); 487 ry = e->rect().y();
488 rw = e->rect().width(); 488 rw = e->rect().width();
489 rh = e->rect().height(); 489 rh = e->rect().height();
490 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height()); 490 //qDebug(" paintevent %s %d %d %d %d", mIncidence->summary().latin1(), x(), yy, width(), height());
491 491
492 QPixmap* paintFrom ; 492 QPixmap* paintFrom ;
493 if ( mSelected ) { 493 if ( mSelected ) {
494 paintFrom = paintPixSel(); 494 paintFrom = paintPixSel();
495 } else { 495 } else {
496 if ( mAllDay ) 496 if ( mAllDay )
497 paintFrom = paintPixAllday(); 497 paintFrom = paintPixAllday();
498 else 498 else
499 paintFrom = paintPix(); 499 paintFrom = paintPix();
500 } 500 }
501 xx += rx; 501 xx += rx;
502 502
503 if ( xx < 0 ) { 503 if ( xx < 0 ) {
504 rw = rw + xx; 504 rw = rw + xx;
505 rx -= xx; 505 rx -= xx;
506 xx = 0; 506 xx = 0;
507 if ( rw <= 1 ) { 507 if ( rw <= 1 ) {
508 qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1()); 508 //qDebug("KOAgendaItem::Width1 <= 1 (%d). Returning. %s",rw,mDisplayedText.latin1());
509 return; 509 return;
510 } 510 }
511 } 511 }
512 if ( paintFrom->width() < xx+rw ) { 512 if ( paintFrom->width() < xx+rw ) {
513 rw = paintFrom->width() - xx; 513 rw = paintFrom->width() - xx;
514 if ( rw <= 1 ) { 514 if ( rw <= 1 ) {
515 qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() ); 515 //qDebug("KOAgendaItem::Width2 <= 1 (%d). Returning.%s ",rw,mDisplayedText.latin1() );
516 return; 516 return;
517 } 517 }
518 } 518 }
519 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh); 519 //qDebug("%d %d %d %d %d %d %d",rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh);
520 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP); 520 bitBlt (this, rx, ry, paintFrom, xx ,yPaintCoord+ry, rw, rh ,CopyROP);
521} 521}
522void KOAgendaItem::computeText() 522void KOAgendaItem::computeText()
523{ 523{
524 524
525 mDisplayedText = mIncidence->summary(); 525 mDisplayedText = mIncidence->summary();
526 if ( (mIncidence->type() == "Todo") ) { 526 if ( (mIncidence->type() == "Todo") ) {
527 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) { 527 if ( static_cast<Todo*>(mIncidence)->hasDueDate() ) {
528 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() ) 528 if ( static_cast<Todo*>(mIncidence)->dtDue().date() < QDate::currentDate() )
529 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")"; 529 mDisplayedText += i18n(" (") +KGlobal::locale()->formatDate((static_cast<Todo*>(mIncidence))->dtDue().date(), true)+")";
530 else if ( !(mIncidence->doesFloat())) 530 else if ( !(mIncidence->doesFloat()))
531 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")"; 531 mDisplayedText += i18n(" (") +KGlobal::locale()->formatTime((static_cast<Todo*>(mIncidence))->dtDue().time())+")";
532 } 532 }
533 } else { 533 } else {
534 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda) 534 if ( !(mIncidence->doesFloat()) && KOPrefs::instance()->mShowTimeInAgenda)
535 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ; 535 mDisplayedText += ": " +KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtStart().time()) + "-" + KGlobal::locale()->formatTime((static_cast<Event*>(mIncidence))->dtEnd().time()) ;
536 536
537 if ( mAllDay ) { 537 if ( mAllDay ) {
538 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) { 538 if ( mIncidence->dtStart().date().addDays(3) < mIncidence->dtEnd().date() ) {
539 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ; 539 mDisplayedText += ": " +KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtStart().date(), true) + " - " + KGlobal::locale()->formatDate((static_cast<Event*>(mIncidence))->dtEnd().date(), true) ;
540 } 540 }
541 } 541 }
542 542
543 } 543 }
544 544
545 if ( !mIncidence->location().isEmpty() ) { 545 if ( !mIncidence->location().isEmpty() ) {
546 if ( mAllDay ) 546 if ( mAllDay )
547 mDisplayedText += " ("; 547 mDisplayedText += " (";
548 else 548 else
549 mDisplayedText += "\n("; 549 mDisplayedText += "\n(";
550 mDisplayedText += mIncidence->location() +")"; 550 mDisplayedText += mIncidence->location() +")";
551 } 551 }
552 552
553 QString tipText = mIncidence->summary(); 553 QString tipText = mIncidence->summary();
554 if ( !mIncidence->doesFloat() ) { 554 if ( !mIncidence->doesFloat() ) {
555 if ( mIncidence->type() == "Event" ) { 555 if ( mIncidence->type() == "Event" ) {
556 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) { 556 if ( (static_cast<Event*>(mIncidence))->isMultiDay() ) {
557 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr(); 557 tipText += "\n"+i18n("From: ")+mIncidence->dtStartStr();
558 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr(); 558 tipText += "\n"+i18n("To: ")+(static_cast<Event*>(mIncidence))->dtEndStr();
559 } 559 }
560 else { 560 else {
561 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr(); 561 tipText += "\n"+i18n("Time: ")+mIncidence->dtStartTimeStr();
562 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr(); 562 tipText += " - "+(static_cast<Event*>(mIncidence))->dtEndTimeStr();
563 } 563 }
564 } 564 }
565 else if ( mIncidence->type() == "Todo" ) { 565 else if ( mIncidence->type() == "Todo" ) {
566 if (mIncidence->hasStartDate()) 566 if (mIncidence->hasStartDate())
567 tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr(); 567 tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartStr();
568 if (((Todo*)mIncidence)->hasDueDate()) 568 if (((Todo*)mIncidence)->hasDueDate())
569 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr(); 569 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueStr();
570 } 570 }
571 } else if ( mIncidence->type() == "Todo" ) { 571 } else if ( mIncidence->type() == "Todo" ) {
572 if (mIncidence->hasStartDate()) 572 if (mIncidence->hasStartDate())
573 tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr(); 573 tipText += "\n"+i18n("Start: ")+ (static_cast<Todo*>(mIncidence))->dtStartDateStr();
574 if (((Todo*)mIncidence)->hasDueDate()) 574 if (((Todo*)mIncidence)->hasDueDate())
575 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr(); 575 tipText += "\n"+i18n("Due: ")+ (static_cast<Todo*>(mIncidence))->dtDueDateStr();
576 } 576 }
577 577
578 if (!mIncidence->location().isEmpty()) { 578 if (!mIncidence->location().isEmpty()) {
579 tipText += "\n"+i18n("Location: ")+mIncidence->location(); 579 tipText += "\n"+i18n("Location: ")+mIncidence->location();
580 } 580 }
581 QToolTip::add(this,tipText,toolTipGroup(),""); 581 QToolTip::add(this,tipText,toolTipGroup(),"");
582 582
583} 583}
584void KOAgendaItem::updateItem() 584void KOAgendaItem::updateItem()
585{ 585{
586 computeText(); 586 computeText();
587 587
588 //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y()); 588 //qDebug("KOAgendaItem:: updateItem() %s %d %d ",incidence()->summary().latin1(), x(), y());
589 paintMe( mSelected ); 589 paintMe( mSelected );
590 repaint( false); 590 repaint( false);
591} 591}
592 592
593void KOAgendaItem::resizeEvent ( QResizeEvent *ev ) 593void KOAgendaItem::resizeEvent ( QResizeEvent *ev )
594{ 594{
595 //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1()); 595 //qDebug("KOAgendaItem::resizeEvent %s ", mIncidence->summary().latin1());
596 paintMe( mSelected ); 596 paintMe( mSelected );
597 repaint( false ); 597 repaint( false );
598} 598}
599 599
600/* 600/*
601 Return height of item in units of agenda cells 601 Return height of item in units of agenda cells
602*/ 602*/
603int KOAgendaItem::cellHeight() 603int KOAgendaItem::cellHeight()
604{ 604{
605 int ret = mCellYBottom - mCellYTop + 1; 605 int ret = mCellYBottom - mCellYTop + 1;
606 if ( ret <= 0 ) { 606 if ( ret <= 0 ) {
607 ret = 1; 607 ret = 1;
608 mCellYBottom = 0; 608 mCellYBottom = 0;
609 mCellYTop = 0; 609 mCellYTop = 0;
610 } 610 }
611 return ret; 611 return ret;
612} 612}
613 613
614/* 614/*
615 Return height of item in units of agenda cells 615 Return height of item in units of agenda cells
616*/ 616*/
617int KOAgendaItem::cellWidth() 617int KOAgendaItem::cellWidth()
618{ 618{
619 return mCellXWidth - mCellX + 1; 619 return mCellXWidth - mCellX + 1;
620} 620}
621 621
622void KOAgendaItem::setItemDate(QDate qd) 622void KOAgendaItem::setItemDate(QDate qd)
623{ 623{
624 mDate = qd; 624 mDate = qd;
625} 625}
626 626
627void KOAgendaItem::setCellXY(int X, int YTop, int YBottom) 627void KOAgendaItem::setCellXY(int X, int YTop, int YBottom)
628{ 628{
629 mCellX = X; 629 mCellX = X;
630 mCellYTop = YTop; 630 mCellYTop = YTop;
631 mCellYBottom = YBottom; 631 mCellYBottom = YBottom;
632} 632}
633 633
634void KOAgendaItem::setCellXWidth(int xwidth) 634void KOAgendaItem::setCellXWidth(int xwidth)
635{ 635{
636 mCellXWidth = xwidth; 636 mCellXWidth = xwidth;
637} 637}
638 638
639void KOAgendaItem::setCellX(int XLeft, int XRight) 639void KOAgendaItem::setCellX(int XLeft, int XRight)
640{ 640{
641 mCellX = XLeft; 641 mCellX = XLeft;
642 mCellXWidth = XRight; 642 mCellXWidth = XRight;
643} 643}
644 644
645void KOAgendaItem::setCellY(int YTop, int YBottom) 645void KOAgendaItem::setCellY(int YTop, int YBottom)
646{ 646{
647 mCellYTop = YTop; 647 mCellYTop = YTop;
648 mCellYBottom = YBottom; 648 mCellYBottom = YBottom;
649} 649}
650 650
651void KOAgendaItem::setSubCell(int subCell) 651void KOAgendaItem::setSubCell(int subCell)
652{ 652{
653 mSubCell = subCell; 653 mSubCell = subCell;
654} 654}
655 655
656void KOAgendaItem::setSubCells(int subCells) 656void KOAgendaItem::setSubCells(int subCells)
657{ 657{
658 mSubCells = subCells; 658 mSubCells = subCells;
659} 659}
660 660
661void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next, 661void KOAgendaItem::setMultiItem(KOAgendaItem *first,KOAgendaItem *next,
662 KOAgendaItem *last) 662 KOAgendaItem *last)
663{ 663{
664 mFirstMultiItem = first; 664 mFirstMultiItem = first;
665 mNextMultiItem = next; 665 mNextMultiItem = next;
666 mLastMultiItem = last; 666 mLastMultiItem = last;
667} 667}
668 668
669void KOAgendaItem::startMove() 669void KOAgendaItem::startMove()
670{ 670{
671 mStartCellX = mCellX; 671 mStartCellX = mCellX;
672 mStartCellXWidth = mCellXWidth; 672 mStartCellXWidth = mCellXWidth;
673 mStartCellYTop = mCellYTop; 673 mStartCellYTop = mCellYTop;
674 mStartCellYBottom = mCellYBottom; 674 mStartCellYBottom = mCellYBottom;
675} 675}
676 676
677void KOAgendaItem::resetMove() 677void KOAgendaItem::resetMove()
678{ 678{
679 mCellX = mStartCellX; 679 mCellX = mStartCellX;
680 mCellXWidth = mStartCellXWidth; 680 mCellXWidth = mStartCellXWidth;
681 mCellYTop = mStartCellYTop; 681 mCellYTop = mStartCellYTop;
682 mCellYBottom = mStartCellYBottom; 682 mCellYBottom = mStartCellYBottom;
683} 683}
684 684
685void KOAgendaItem::moveRelative(int dx, int dy) 685void KOAgendaItem::moveRelative(int dx, int dy)
686{ 686{
687 int newX = cellX() + dx; 687 int newX = cellX() + dx;
688 int newXWidth = cellXWidth() + dx; 688 int newXWidth = cellXWidth() + dx;
689 int newYTop = cellYTop() + dy; 689 int newYTop = cellYTop() + dy;
690 int newYBottom = cellYBottom() + dy; 690 int newYBottom = cellYBottom() + dy;
691 setCellXY(newX,newYTop,newYBottom); 691 setCellXY(newX,newYTop,newYBottom);
692 setCellXWidth(newXWidth); 692 setCellXWidth(newXWidth);
693} 693}
694 694
695void KOAgendaItem::expandTop(int dy) 695void KOAgendaItem::expandTop(int dy)
696{ 696{
697 int newYTop = cellYTop() + dy; 697 int newYTop = cellYTop() + dy;
698 int newYBottom = cellYBottom(); 698 int newYBottom = cellYBottom();
699 if (newYTop > newYBottom) newYTop = newYBottom; 699 if (newYTop > newYBottom) newYTop = newYBottom;
700 setCellY(newYTop, newYBottom); 700 setCellY(newYTop, newYBottom);
701} 701}
702 702
703void KOAgendaItem::expandBottom(int dy) 703void KOAgendaItem::expandBottom(int dy)
704{ 704{
705 int newYTop = cellYTop(); 705 int newYTop = cellYTop();
706 int newYBottom = cellYBottom() + dy; 706 int newYBottom = cellYBottom() + dy;
707 if (newYBottom < newYTop) newYBottom = newYTop; 707 if (newYBottom < newYTop) newYBottom = newYTop;
708 setCellY(newYTop, newYBottom); 708 setCellY(newYTop, newYBottom);
709} 709}
710 710
711void KOAgendaItem::expandLeft(int dx) 711void KOAgendaItem::expandLeft(int dx)
712{ 712{
713 int newX = cellX() + dx; 713 int newX = cellX() + dx;
714 int newXWidth = cellXWidth(); 714 int newXWidth = cellXWidth();
715 if (newX > newXWidth) newX = newXWidth; 715 if (newX > newXWidth) newX = newXWidth;
716 setCellX(newX,newXWidth); 716 setCellX(newX,newXWidth);
717} 717}
718 718
719void KOAgendaItem::expandRight(int dx) 719void KOAgendaItem::expandRight(int dx)
720{ 720{
721 int newX = cellX(); 721 int newX = cellX();
722 int newXWidth = cellXWidth() + dx; 722 int newXWidth = cellXWidth() + dx;
723 if (newXWidth < newX) newXWidth = newX; 723 if (newXWidth < newX) newXWidth = newX;
724 setCellX(newX,newXWidth); 724 setCellX(newX,newXWidth);
725} 725}
726 726
727QToolTipGroup *KOAgendaItem::toolTipGroup() 727QToolTipGroup *KOAgendaItem::toolTipGroup()
728{ 728{
729 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0); 729 if (!mToolTipGroup) mToolTipGroup = new QToolTipGroup(0);
730 return mToolTipGroup; 730 return mToolTipGroup;
731} 731}
732 732
733void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e ) 733void KOAgendaItem::dragEnterEvent( QDragEnterEvent *e )
734{ 734{
735#ifndef KORG_NODND 735#ifndef KORG_NODND
736 if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) || 736 if ( ICalDrag::canDecode( e ) || VCalDrag::canDecode( e ) ||
737 !QTextDrag::canDecode( e ) ) { 737 !QTextDrag::canDecode( e ) ) {
738 e->ignore(); 738 e->ignore();
739 return; 739 return;
740 } 740 }
741 e->accept(); 741 e->accept();
742#endif 742#endif
743} 743}
744 744
745void KOAgendaItem::dropEvent( QDropEvent *e ) 745void KOAgendaItem::dropEvent( QDropEvent *e )
746{ 746{
747#ifndef KORG_NODND 747#ifndef KORG_NODND
748 QString text; 748 QString text;
749 if(QTextDrag::decode(e,text)) 749 if(QTextDrag::decode(e,text))
750 { 750 {
751 kdDebug() << "Dropped : " << text << endl; 751 kdDebug() << "Dropped : " << text << endl;
752 QStringList emails = QStringList::split(",",text); 752 QStringList emails = QStringList::split(",",text);
753 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) { 753 for(QStringList::ConstIterator it = emails.begin();it!=emails.end();++it) {
754 kdDebug() << " Email: " << (*it) << endl; 754 kdDebug() << " Email: " << (*it) << endl;
755 int pos = (*it).find("<"); 755 int pos = (*it).find("<");
756 QString name = (*it).left(pos); 756 QString name = (*it).left(pos);
757 QString email = (*it).mid(pos); 757 QString email = (*it).mid(pos);
758 if (!email.isEmpty()) { 758 if (!email.isEmpty()) {
759 mIncidence->addAttendee(new Attendee(name,email)); 759 mIncidence->addAttendee(new Attendee(name,email));
760 } 760 }
761 } 761 }
762 } 762 }
763#endif 763#endif
764} 764}
765 765
766 766
767QPtrList<KOAgendaItem> KOAgendaItem::conflictItems() 767QPtrList<KOAgendaItem> KOAgendaItem::conflictItems()
768{ 768{
769 return mConflictItems; 769 return mConflictItems;
770} 770}
771 771
diff --git a/korganizer/koprefsdialog.cpp b/korganizer/koprefsdialog.cpp
index 40e8a99..74037e6 100644
--- a/korganizer/koprefsdialog.cpp
+++ b/korganizer/koprefsdialog.cpp
@@ -337,583 +337,583 @@ void KOPrefsDialog::setupMainTab()
337 // DesktopIcon("identity",KIcon::SizeMedium)); 337 // DesktopIcon("identity",KIcon::SizeMedium));
338 338
339 QGridLayout *topLayout = new QGridLayout(topFrame,5,2); 339 QGridLayout *topLayout = new QGridLayout(topFrame,5,2);
340 topLayout->setSpacing(spacingHint()); 340 topLayout->setSpacing(spacingHint());
341 topLayout->setMargin(marginHint()); 341 topLayout->setMargin(marginHint());
342 342
343 // KPrefsDialogWidBool *emailControlCenter = 343 // KPrefsDialogWidBool *emailControlCenter =
344// addWidBool(i18n("&Use email settings from Control Center"), 344// addWidBool(i18n("&Use email settings from Control Center"),
345// &(KOPrefs::instance()->mEmailControlCenter),topFrame); 345// &(KOPrefs::instance()->mEmailControlCenter),topFrame);
346// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1); 346// topLayout->addMultiCellWidget(emailControlCenter->checkBox(),0,0,0,1);
347 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)), 347 // connect(emailControlCenter->checkBox(),SIGNAL(toggled(bool)),
348 // SLOT(toggleEmailSettings(bool))); 348 // SLOT(toggleEmailSettings(bool)));
349 349
350 mNameEdit = new QLineEdit(topFrame); 350 mNameEdit = new QLineEdit(topFrame);
351 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame); 351 mNameLabel = new QLabel(mNameEdit, i18n("Full &name:"), topFrame);
352 topLayout->addWidget(mNameLabel,0,0); 352 topLayout->addWidget(mNameLabel,0,0);
353 topLayout->addWidget(mNameEdit,0,1); 353 topLayout->addWidget(mNameEdit,0,1);
354 354
355 mEmailEdit = new QLineEdit(topFrame); 355 mEmailEdit = new QLineEdit(topFrame);
356 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame); 356 mEmailLabel = new QLabel(mEmailEdit, i18n("E&mail address:"),topFrame);
357 topLayout->addWidget(mEmailLabel,1,0); 357 topLayout->addWidget(mEmailLabel,1,0);
358 topLayout->addWidget(mEmailEdit,1,1); 358 topLayout->addWidget(mEmailEdit,1,1);
359 KPrefsDialogWidBool *wb; 359 KPrefsDialogWidBool *wb;
360 360
361 361
362 362
363 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"), 363 KPrefsDialogWidBool *widbool = addWidBool(i18n("Full menu bar(nr)"),
364 &(KOPrefs::instance()->mShowFullMenu),topFrame); 364 &(KOPrefs::instance()->mShowFullMenu),topFrame);
365 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1); 365 topLayout->addMultiCellWidget( widbool->checkBox(), 2,2,0,1);
366 366
367 367
368 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"), 368 widbool = addWidBool(i18n("Mini icons in toolbar(nr)"),
369 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame); 369 &(KOPrefs::instance()->mToolBarMiniIcons),topFrame);
370 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1); 370 topLayout->addMultiCellWidget( widbool->checkBox(), 3,3,0,1);
371 371
372 372
373 KPrefsDialogWidBool *verticalScreen = 373 KPrefsDialogWidBool *verticalScreen =
374 addWidBool(i18n("Show vertical screen (Needs restart)"), 374 addWidBool(i18n("Show vertical screen (Needs restart)"),
375 &(KOPrefs::instance()->mVerticalScreen),topFrame); 375 &(KOPrefs::instance()->mVerticalScreen),topFrame);
376 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0); 376 //topLayout->addWidget(verticalScreen->checkBox(),ii++,0);
377 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1); 377 topLayout->addMultiCellWidget(verticalScreen->checkBox(),4,4,0,1);
378 378
379 379
380 QHBox *dummy = new QHBox(topFrame); 380 QHBox *dummy = new QHBox(topFrame);
381 new QLabel(i18n("Days in Next-X-Days:"),dummy); 381 new QLabel(i18n("Days in Next-X-Days:"),dummy);
382 mNextXDaysSpin = new QSpinBox(2,14,1,dummy); 382 mNextXDaysSpin = new QSpinBox(2,14,1,dummy);
383 383
384 topLayout->addMultiCellWidget(dummy,5,5,0,1); 384 topLayout->addMultiCellWidget(dummy,5,5,0,1);
385 385
386 386
387 387
388 // KPrefsDialogWidBool *bcc = 388 // KPrefsDialogWidBool *bcc =
389// addWidBool(i18n("Send copy to owner when mailing events"), 389// addWidBool(i18n("Send copy to owner when mailing events"),
390// &(KOPrefs::instance()->mBcc),topFrame); 390// &(KOPrefs::instance()->mBcc),topFrame);
391// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1); 391// topLayout->addMultiCellWidget(bcc->checkBox(),4,4,0,1);
392 392
393 393
394 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame); 394 // QGroupBox *autoSaveGroup = new QGroupBox(1,Horizontal,i18n("Auto-Save"), topFrame);
395 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1); 395 //topLayout->addMultiCellWidget(autoSaveGroup,6,6,0,1);
396 396
397 // addWidBool(i18n("Enable automatic saving of calendar"), 397 // addWidBool(i18n("Enable automatic saving of calendar"),
398 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup); 398 // &(KOPrefs::instance()->mAutoSave),autoSaveGroup);
399 399
400 QHBox *intervalBox = new QHBox(topFrame); 400 QHBox *intervalBox = new QHBox(topFrame);
401 // intervalBox->setSpacing(spacingHint()); 401 // intervalBox->setSpacing(spacingHint());
402 topLayout->addMultiCellWidget(intervalBox,6,6,0,1); 402 topLayout->addMultiCellWidget(intervalBox,6,6,0,1);
403 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox); 403 QLabel *autoSaveIntervalLabel = new QLabel(i18n("Auto save delay in minutes:"),intervalBox);
404 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox); 404 mAutoSaveIntervalSpin = new QSpinBox(0,500,1,intervalBox);
405 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin); 405 autoSaveIntervalLabel->setBuddy(mAutoSaveIntervalSpin);
406 /* 406 /*
407 QHBox * agendasize = new QHBox ( topFrame ); 407 QHBox * agendasize = new QHBox ( topFrame );
408 408
409 new QLabel (i18n("AllDayAgenda Height:"), agendasize ); 409 new QLabel (i18n("AllDayAgenda Height:"), agendasize );
410 410
411 411
412 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize); 412 mHourSizeSlider = new QSlider(24,47,1,24,Horizontal,agendasize);
413 topLayout->addMultiCellWidget(agendasize,7,7,0,1); 413 topLayout->addMultiCellWidget(agendasize,7,7,0,1);
414 */ 414 */
415 415
416 416
417 KPrefsDialogWidBool *ask = 417 KPrefsDialogWidBool *ask =
418 addWidBool(i18n("Ask for quit when closing KO/Pi"), 418 addWidBool(i18n("Ask for quit when closing KO/Pi"),
419 &(KOPrefs::instance()->mAskForQuit),topFrame); 419 &(KOPrefs::instance()->mAskForQuit),topFrame);
420 topLayout->addMultiCellWidget(ask->checkBox(),7,7,0,1); 420 topLayout->addMultiCellWidget(ask->checkBox(),7,7,0,1);
421 421
422 422
423 /* 423 /*
424 KPrefsDialogWidBool *confirmCheck = 424 KPrefsDialogWidBool *confirmCheck =
425 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm), 425 addWidBool(i18n("Confirm &deletes"),&(KOPrefs::instance()->mConfirm),
426 topFrame); 426 topFrame);
427 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1); 427 topLayout->addMultiCellWidget(confirmCheck->checkBox(),7,7,0,1);
428 428
429 429
430 mEnableGroupScheduling = 430 mEnableGroupScheduling =
431 addWidBool(i18n("Enable group scheduling"), 431 addWidBool(i18n("Enable group scheduling"),
432 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame); 432 &(KOPrefs::instance()->mEnableGroupScheduling),topFrame);
433 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0); 433 topLayout->addWidget(mEnableGroupScheduling->checkBox(),8,0);
434 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()), 434 connect(mEnableGroupScheduling->checkBox(),SIGNAL(clicked()),
435 SLOT(warningGroupScheduling())); 435 SLOT(warningGroupScheduling()));
436 436
437 mEnableProjectView = 437 mEnableProjectView =
438 addWidBool(i18n("Enable project view"), 438 addWidBool(i18n("Enable project view"),
439 &(KOPrefs::instance()->mEnableProjectView),topFrame); 439 &(KOPrefs::instance()->mEnableProjectView),topFrame);
440 topLayout->addWidget(mEnableProjectView->checkBox(),9,0); 440 topLayout->addWidget(mEnableProjectView->checkBox(),9,0);
441 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()), 441 connect(mEnableProjectView->checkBox(),SIGNAL(clicked()),
442 SLOT(warningProjectView())); 442 SLOT(warningProjectView()));
443 443
444 // Can't be disabled anymore 444 // Can't be disabled anymore
445 mEnableGroupScheduling->checkBox()->hide(); 445 mEnableGroupScheduling->checkBox()->hide();
446 446
447 // Disable setting, because this feature now becomes stable 447 // Disable setting, because this feature now becomes stable
448 mEnableProjectView->checkBox()->hide(); 448 mEnableProjectView->checkBox()->hide();
449 449
450 KPrefsDialogWidRadios *defaultFormatGroup = 450 KPrefsDialogWidRadios *defaultFormatGroup =
451 addWidRadios(i18n("Default Calendar Format"), 451 addWidRadios(i18n("Default Calendar Format"),
452 &(KOPrefs::instance()->mDefaultFormat),topFrame); 452 &(KOPrefs::instance()->mDefaultFormat),topFrame);
453 defaultFormatGroup->addRadio(i18n("vCalendar")); 453 defaultFormatGroup->addRadio(i18n("vCalendar"));
454 defaultFormatGroup->addRadio(i18n("iCalendar")); 454 defaultFormatGroup->addRadio(i18n("iCalendar"));
455 455
456 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1); 456 topLayout->addMultiCellWidget(defaultFormatGroup->groupBox(),10,10,0,1);
457 457
458 // Default format unconditionally is iCalendar 458 // Default format unconditionally is iCalendar
459 defaultFormatGroup->groupBox()->hide(); 459 defaultFormatGroup->groupBox()->hide();
460 460
461 KPrefsDialogWidRadios *mailClientGroup = 461 KPrefsDialogWidRadios *mailClientGroup =
462 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient), 462 addWidRadios(i18n("Mail Client"),&(KOPrefs::instance()->mMailClient),
463 topFrame); 463 topFrame);
464 mailClientGroup->addRadio(i18n("KMail")); 464 mailClientGroup->addRadio(i18n("KMail"));
465 mailClientGroup->addRadio(i18n("Sendmail")); 465 mailClientGroup->addRadio(i18n("Sendmail"));
466 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1); 466 topLayout->addMultiCellWidget(mailClientGroup->groupBox(),11,11,0,1);
467 467
468 KPrefsDialogWidBool *htmlsave = 468 KPrefsDialogWidBool *htmlsave =
469 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave), 469 addWidBool(i18n("Export to HTML with every save"),&(KOPrefs::instance()->mHtmlWithSave),
470 topFrame); 470 topFrame);
471 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1); 471 topLayout->addMultiCellWidget(htmlsave->checkBox(),12,12,0,1);
472 472
473 KPrefsDialogWidRadios *destinationGroup = 473 KPrefsDialogWidRadios *destinationGroup =
474 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination), 474 addWidRadios(i18n("New Events/Todos should"),&(KOPrefs::instance()->mDestination),
475 topFrame); 475 topFrame);
476 destinationGroup->addRadio(i18n("be added to the standard resource")); 476 destinationGroup->addRadio(i18n("be added to the standard resource"));
477 destinationGroup->addRadio(i18n("be asked which resource to use")); 477 destinationGroup->addRadio(i18n("be asked which resource to use"));
478 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1); 478 topLayout->addMultiCellWidget(destinationGroup->groupBox(),13,13,0,1);
479 479
480 topLayout->setRowStretch(14,1); 480 topLayout->setRowStretch(14,1);
481 */ 481 */
482} 482}
483 483
484 484
485void KOPrefsDialog::setupTimeTab() 485void KOPrefsDialog::setupTimeTab()
486{ 486{
487 QFrame *topFrame = addPage(i18n("Time"),0,0); 487 QFrame *topFrame = addPage(i18n("Time"),0,0);
488 // DesktopIcon("clock",KIcon::SizeMedium)); 488 // DesktopIcon("clock",KIcon::SizeMedium));
489 489
490 QGridLayout *topLayout = new QGridLayout(topFrame,4,2); 490 QGridLayout *topLayout = new QGridLayout(topFrame,4,2);
491 topLayout->setSpacing(spacingHint()); 491 topLayout->setSpacing(spacingHint());
492 topLayout->setMargin(marginHint()); 492 topLayout->setMargin(marginHint());
493 493
494 QHBox *dummy = new QHBox(topFrame); 494 QHBox *dummy = new QHBox(topFrame);
495 KPrefsDialogWidTime *dayBegins = 495 KPrefsDialogWidTime *dayBegins =
496 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 496 addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
497 dummy); 497 dummy);
498 //topLayout->addWidget(dayBegins->label(),2,0); 498 //topLayout->addWidget(dayBegins->label(),2,0);
499 499
500 //topLayout->addWidget(dayBegins->spinBox(),2,1); 500 //topLayout->addWidget(dayBegins->spinBox(),2,1);
501 topLayout->addMultiCellWidget(dummy,0,0,0,1); 501 topLayout->addMultiCellWidget(dummy,0,0,0,1);
502 502
503 topLayout->addWidget(new QLabel(i18n("Default appointment time:"), 503 topLayout->addWidget(new QLabel(i18n("Default appointment time:"),
504 topFrame),1,0); 504 topFrame),1,0);
505 mStartTimeSpin = new QSpinBox(0,23,1,topFrame); 505 mStartTimeSpin = new QSpinBox(0,23,1,topFrame);
506 mStartTimeSpin->setSuffix(":00"); 506 mStartTimeSpin->setSuffix(":00");
507 topLayout->addWidget(mStartTimeSpin,1,1); 507 topLayout->addWidget(mStartTimeSpin,1,1);
508 508
509 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"), 509 topLayout->addWidget(new QLabel(i18n("Def. duration of new app.:"),
510 topFrame),2,0); 510 topFrame),2,0);
511 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame); 511 mDefaultDurationSpin = new QSpinBox(0,23,1,topFrame);
512 mDefaultDurationSpin->setSuffix(":00"); 512 mDefaultDurationSpin->setSuffix(":00");
513 topLayout->addWidget(mDefaultDurationSpin,2,1); 513 topLayout->addWidget(mDefaultDurationSpin,2,1);
514 514
515 QStringList alarmList; 515 QStringList alarmList;
516 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes") 516 alarmList << i18n("1 minute") << i18n("5 minutes") << i18n("10 minutes")
517 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ; 517 << i18n("15 minutes") << i18n("30 minutes")<< i18n("1 hour")<< i18n("3 hours") << i18n("24 hours") ;
518 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame), 518 topLayout->addWidget(new QLabel(i18n("Default alarm time:"),topFrame),
519 3,0); 519 3,0);
520 mAlarmTimeCombo = new QComboBox(topFrame); 520 mAlarmTimeCombo = new QComboBox(topFrame);
521 mAlarmTimeCombo->insertStringList(alarmList); 521 mAlarmTimeCombo->insertStringList(alarmList);
522 topLayout->addWidget(mAlarmTimeCombo,3,1); 522 topLayout->addWidget(mAlarmTimeCombo,3,1);
523 523
524 524
525 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal, 525 QGroupBox *workingHoursGroup = new QGroupBox(1,Horizontal,
526 i18n("Working Hours"), 526 i18n("Working Hours"),
527 topFrame); 527 topFrame);
528 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1); 528 topLayout->addMultiCellWidget(workingHoursGroup,4,4,0,1);
529 workingHoursGroup->layout()->setSpacing( 0 ); 529 workingHoursGroup->layout()->setSpacing( 0 );
530 workingHoursGroup->layout()->setMargin( 4 ); 530 workingHoursGroup->layout()->setMargin( 4 );
531 QHBox *workStartBox = new QHBox(workingHoursGroup); 531 QHBox *workStartBox = new QHBox(workingHoursGroup);
532 // workStartBox->setMargin( 0 ); 532 // workStartBox->setMargin( 0 );
533 addWidTime(i18n("Daily starting hour:"), 533 addWidTime(i18n("Daily starting hour:"),
534 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox); 534 &(KOPrefs::instance()->mWorkingHoursStart),workStartBox);
535 535
536 QHBox *workEndBox = new QHBox(workingHoursGroup); 536 QHBox *workEndBox = new QHBox(workingHoursGroup);
537 //workEndBox->setMargin( 0 ); 537 //workEndBox->setMargin( 0 );
538 addWidTime(i18n("Daily ending hour:"), 538 addWidTime(i18n("Daily ending hour:"),
539 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox); 539 &(KOPrefs::instance()->mWorkingHoursEnd),workEndBox);
540 QVBox *excludeBox = new QVBox(workingHoursGroup); 540 QVBox *excludeBox = new QVBox(workingHoursGroup);
541 //excludeBox->setMargin( 0 ); 541 //excludeBox->setMargin( 0 );
542 addWidBool(i18n("Exclude holidays"), 542 addWidBool(i18n("Exclude holidays"),
543 &(KOPrefs::instance()->mExcludeHolidays),excludeBox); 543 &(KOPrefs::instance()->mExcludeHolidays),excludeBox);
544 544
545 addWidBool(i18n("Exclude Saturdays"), 545 addWidBool(i18n("Exclude Saturdays"),
546 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox); 546 &(KOPrefs::instance()->mExcludeSaturdays),excludeBox);
547 547
548// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"), 548// KPrefsDialogWidBool *marcusBainsShowSeconds = addWidBool(i18n("Show seconds on Marcus Bains line"),
549 // &(KOPrefs::instance()->mMarcusBainsShowSeconds), 549 // &(KOPrefs::instance()->mMarcusBainsShowSeconds),
550 // topFrame); 550 // topFrame);
551// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0); 551// topLayout->addWidget(marcusBainsShowSeconds->checkBox(),5,0);
552 552
553 // topLayout->setRowStretch(6,1); 553 // topLayout->setRowStretch(6,1);
554} 554}
555 555
556 556
557void KOPrefsDialog::setupViewsTab() 557void KOPrefsDialog::setupViewsTab()
558{ 558{
559 559
560 QFrame *topFrame = addPage(i18n("Views"),0,0); 560 QFrame *topFrame = addPage(i18n("Views"),0,0);
561 // DesktopIcon("viewmag",KIcon::SizeMedium)); 561 // DesktopIcon("viewmag",KIcon::SizeMedium));
562 562
563 QGridLayout *topLayout = new QGridLayout(topFrame,6,1); 563 QGridLayout *topLayout = new QGridLayout(topFrame,6,1);
564 topLayout->setSpacing(spacingHint()); 564 topLayout->setSpacing(spacingHint());
565 topLayout->setMargin(marginHint()); 565 topLayout->setMargin(marginHint());
566 566
567// QBoxLayout *dayBeginsLayout = new QHBoxLayout; 567// QBoxLayout *dayBeginsLayout = new QHBoxLayout;
568// topLayout->addLayout(dayBeginsLayout,0,0); 568// topLayout->addLayout(dayBeginsLayout,0,0);
569 569
570// KPrefsDialogWidTime *dayBegins = 570// KPrefsDialogWidTime *dayBegins =
571// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins), 571// addWidTime(i18n("Day begins at:"),&(KOPrefs::instance()->mDayBegins),
572// topFrame); 572// topFrame);
573// dayBeginsLayout->addWidget(dayBegins->label()); 573// dayBeginsLayout->addWidget(dayBegins->label());
574// dayBeginsLayout->addStretch(1); 574// dayBeginsLayout->addStretch(1);
575// dayBeginsLayout->addWidget(dayBegins->spinBox()); 575// dayBeginsLayout->addWidget(dayBegins->spinBox());
576 576
577// QBoxLayout *nextDaysLayout = new QHBoxLayout; 577// QBoxLayout *nextDaysLayout = new QHBoxLayout;
578// topLayout->addLayout(nextDaysLayout,1,0); 578// topLayout->addLayout(nextDaysLayout,1,0);
579// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame)); 579// nextDaysLayout->addWidget(new QLabel(i18n("Days to show in Next-X-Days view:"),topFrame));
580// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame); 580// mNextXDaysSpin = new QSpinBox(2,14,1,topFrame);
581// nextDaysLayout->addStretch(1); 581// nextDaysLayout->addStretch(1);
582// nextDaysLayout->addWidget(mNextXDaysSpin); 582// nextDaysLayout->addWidget(mNextXDaysSpin);
583 583
584 584
585 int ii = 0; 585 int ii = 0;
586 KPrefsDialogWidBool *dummy = 586 KPrefsDialogWidBool *dummy =
587 addWidBool(i18n("Edit item on doubleclick (if not, show)"), 587 addWidBool(i18n("Edit item on doubleclick (if not, show)"),
588 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame); 588 &(KOPrefs::instance()->mEditOnDoubleClick),topFrame);
589 topLayout->addWidget(dummy->checkBox(),ii++,0); 589 topLayout->addWidget(dummy->checkBox(),ii++,0);
590 590
591 591
592 592
593 if ( QApplication::desktop()->width() > 640 ) { 593
594
595 KPrefsDialogWidBool *enableToolTips =
596 addWidBool(i18n("Enable tooltips displaying summary of ev."),
597 &(KOPrefs::instance()->mEnableToolTips),topFrame);
598 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
599
600 }
601
602 594
603 595
604 // topLayout->addWidget(hourSizeGroup,ii++,0); 596 // topLayout->addWidget(hourSizeGroup,ii++,0);
605 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0); 597 // topLayout->addMultiCellWidget(hourSizeGroup,ii,ii,0,0);
606 //topLayout->setRowStretch(11,1); 598 //topLayout->setRowStretch(11,1);
607 599
608 600
609 601
610 602
611#if 0 603#if 0
612 604
613 topFrame = addPage(i18n("ViewChange"),0,0); 605 topFrame = addPage(i18n("ViewChange"),0,0);
614 // DesktopIcon("viewmag",KIcon::SizeMedium)); 606 // DesktopIcon("viewmag",KIcon::SizeMedium));
615 607
616 topLayout = new QGridLayout(topFrame,6,1); 608 topLayout = new QGridLayout(topFrame,6,1);
617 topLayout->setSpacing(spacingHint()); 609 topLayout->setSpacing(spacingHint());
618 topLayout->setMargin(marginHint()); 610 topLayout->setMargin(marginHint());
619 ii = 0; 611 ii = 0;
620 612
621#endif 613#endif
622 614
623 dummy = 615 dummy =
624 addWidBool(i18n("Hold fullscreen on view change"), 616 addWidBool(i18n("Hold fullscreen on view change"),
625 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame); 617 &(KOPrefs::instance()->mViewChangeHoldFullscreen),topFrame);
626 topLayout->addWidget(dummy->checkBox(),ii++,0); 618 topLayout->addWidget(dummy->checkBox(),ii++,0);
627 619
628 dummy = 620 dummy =
629 addWidBool(i18n("Hold non-fullscreen on view change"), 621 addWidBool(i18n("Hold non-fullscreen on view change"),
630 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame); 622 &(KOPrefs::instance()->mViewChangeHoldNonFullscreen),topFrame);
631 topLayout->addWidget(dummy->checkBox(),ii++,0); 623 topLayout->addWidget(dummy->checkBox(),ii++,0);
632 624
633 625
634 626
635 KPrefsDialogWidBool *fullViewMonth = 627 KPrefsDialogWidBool *fullViewMonth =
636 addWidBool(i18n("Next days view uses full window"), 628 addWidBool(i18n("Next days view uses full window"),
637 &(KOPrefs::instance()->mFullViewMonth),topFrame); 629 &(KOPrefs::instance()->mFullViewMonth),topFrame);
638 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0); 630 topLayout->addWidget(fullViewMonth->checkBox(),ii++,0);
639 631
640 632
641 KPrefsDialogWidBool *fullViewTodo = 633 KPrefsDialogWidBool *fullViewTodo =
642 addWidBool(i18n("Event list view uses full window"), 634 addWidBool(i18n("Event list view uses full window"),
643 &(KOPrefs::instance()->mFullViewTodo),topFrame); 635 &(KOPrefs::instance()->mFullViewTodo),topFrame);
644 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0); 636 topLayout->addWidget(fullViewTodo->checkBox(),ii++,0);
645 dummy = 637 dummy =
646 addWidBool(i18n("Listview uses monthly timespan"), 638 addWidBool(i18n("Listview uses monthly timespan"),
647 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame); 639 &(KOPrefs::instance()->mListViewMonthTimespan),topFrame);
648 topLayout->addWidget(dummy->checkBox(),ii++,0); 640 topLayout->addWidget(dummy->checkBox(),ii++,0);
649 dummy = 641 dummy =
650 addWidBool(i18n("Highlight selection in Time Edit"), 642 addWidBool(i18n("Highlight selection in Time Edit"),
651 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame); 643 &(KOPrefs::instance()->mHightlightDateTimeEdit),topFrame);
652 topLayout->addWidget( dummy->checkBox(), ii++,0); 644 topLayout->addWidget( dummy->checkBox(), ii++,0);
653 645
654 KPrefsDialogWidBool *dailyRecur = 646 KPrefsDialogWidBool *dailyRecur =
655 addWidBool(i18n("Show events that recur daily in date nav."), 647 addWidBool(i18n("Show events that recur daily in date nav."),
656 &(KOPrefs::instance()->mDailyRecur),topFrame); 648 &(KOPrefs::instance()->mDailyRecur),topFrame);
657 topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 649 topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
658 650
659 KPrefsDialogWidBool *weeklyRecur = 651 KPrefsDialogWidBool *weeklyRecur =
660 addWidBool(i18n("Show ev. that recur weekly in date nav."), 652 addWidBool(i18n("Show ev. that recur weekly in date nav."),
661 &(KOPrefs::instance()->mWeeklyRecur),topFrame); 653 &(KOPrefs::instance()->mWeeklyRecur),topFrame);
662 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0); 654 topLayout->addWidget(weeklyRecur->checkBox(),ii++,0);
663 655
656
657 KPrefsDialogWidBool *enableToolTips =
658 addWidBool(i18n("Enable tooltips displaying summary of ev."),
659 &(KOPrefs::instance()->mEnableToolTips),topFrame);
660 topLayout->addWidget(enableToolTips->checkBox(),ii++,0);
661
662 // *********************************************************
663
664 topFrame = addPage(i18n("Agenda View"),0,0); 664 topFrame = addPage(i18n("Agenda View"),0,0);
665 // DesktopIcon("viewmag",KIcon::SizeMedium)); 665 // DesktopIcon("viewmag",KIcon::SizeMedium));
666 666
667 topLayout = new QGridLayout(topFrame,5,1); 667 topLayout = new QGridLayout(topFrame,5,1);
668 topLayout->setSpacing(spacingHint()); 668 topLayout->setSpacing(spacingHint());
669 topLayout->setMargin(marginHint()); 669 topLayout->setMargin(marginHint());
670 ii = 0; 670 ii = 0;
671 671
672 672
673 dummy = 673 dummy =
674 addWidBool(i18n("Show time in agenda items"), 674 addWidBool(i18n("Show time in agenda items"),
675 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame); 675 &(KOPrefs::instance()->mShowTimeInAgenda),topFrame);
676 topLayout->addWidget(dummy->checkBox(),ii++,0); 676 topLayout->addWidget(dummy->checkBox(),ii++,0);
677 677
678 dummy = 678 dummy =
679 addWidBool(i18n("Highlight current day in agenda"), 679 addWidBool(i18n("Highlight current day in agenda"),
680 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame); 680 &(KOPrefs::instance()->mHighlightCurrentDay),topFrame);
681 topLayout->addWidget(dummy->checkBox(),ii++,0); 681 topLayout->addWidget(dummy->checkBox(),ii++,0);
682 682
683 dummy = 683 dummy =
684 addWidBool(i18n("Use light color for highlight current day"), 684 addWidBool(i18n("Use light color for highlight current day"),
685 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame); 685 &(KOPrefs::instance()->mUseHighlightLightColor),topFrame);
686 topLayout->addWidget(dummy->checkBox(),ii++,0); 686 topLayout->addWidget(dummy->checkBox(),ii++,0);
687 687
688 688
689 KPrefsDialogWidBool *marcusBainsEnabled = 689 KPrefsDialogWidBool *marcusBainsEnabled =
690 addWidBool(i18n("Show current time"), 690 addWidBool(i18n("Show current time"),
691 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame); 691 &(KOPrefs::instance()->mMarcusBainsEnabled),topFrame);
692 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0); 692 topLayout->addWidget(marcusBainsEnabled->checkBox(),ii++,0);
693 693
694 694
695 dummy = 695 dummy =
696 addWidBool(i18n("Set agenda to DayBeginsAt on change"), 696 addWidBool(i18n("Set agenda to DayBeginsAt on change"),
697 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame); 697 &(KOPrefs::instance()->mSetTimeToDayStartAt),topFrame);
698 topLayout->addWidget(dummy->checkBox(),ii++,0); 698 topLayout->addWidget(dummy->checkBox(),ii++,0);
699 699
700 dummy = 700 dummy =
701 addWidBool(i18n("Set agenda to current time on change"), 701 addWidBool(i18n("Set agenda to current time on change"),
702 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame); 702 &(KOPrefs::instance()->mCenterOnCurrentTime),topFrame);
703 topLayout->addWidget(dummy->checkBox(),ii++,0); 703 topLayout->addWidget(dummy->checkBox(),ii++,0);
704 704
705 705
706 706
707 707
708 708
709 709
710 710
711 topFrame = addPage(i18n("Month View"),0,0); 711 topFrame = addPage(i18n("Month View"),0,0);
712 // DesktopIcon("viewmag",KIcon::SizeMedium)); 712 // DesktopIcon("viewmag",KIcon::SizeMedium));
713 713
714 topLayout = new QGridLayout(topFrame,5,1); 714 topLayout = new QGridLayout(topFrame,5,1);
715 topLayout->setSpacing(spacingHint()); 715 topLayout->setSpacing(spacingHint());
716 topLayout->setMargin(marginHint()); 716 topLayout->setMargin(marginHint());
717 ii = 0; 717 ii = 0;
718 QLabel *lab; 718 QLabel *lab;
719 QHBox *habo = new QHBox( topFrame ); 719 QHBox *habo = new QHBox( topFrame );
720 if ( QApplication::desktop()->width() <= 480 ) { 720 if ( QApplication::desktop()->width() <= 480 ) {
721 lab = new QLabel ( i18n("Show events that recur "), topFrame ); 721 lab = new QLabel ( i18n("Show events that recur "), topFrame );
722 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 722 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
723 ii++; 723 ii++;
724 } else { 724 } else {
725 new QLabel ( i18n("Show events that recur "), habo ); 725 new QLabel ( i18n("Show events that recur "), habo );
726 } 726 }
727 dailyRecur = 727 dailyRecur =
728 addWidBool(i18n("daily"), 728 addWidBool(i18n("daily"),
729 &(KOPrefs::instance()->mMonthDailyRecur),habo); 729 &(KOPrefs::instance()->mMonthDailyRecur),habo);
730 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0); 730 // topLayout->addWidget(dailyRecur->checkBox(),ii++,0);
731 731
732 weeklyRecur = 732 weeklyRecur =
733 addWidBool(i18n("weekly"), 733 addWidBool(i18n("weekly"),
734 &(KOPrefs::instance()->mMonthWeeklyRecur),habo); 734 &(KOPrefs::instance()->mMonthWeeklyRecur),habo);
735 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 735 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
736 ii++; 736 ii++;
737 737
738 738
739 habo = new QHBox( topFrame ); 739 habo = new QHBox( topFrame );
740 if ( QApplication::desktop()->width() <= 480 ) { 740 if ( QApplication::desktop()->width() <= 480 ) {
741 lab = new QLabel (i18n("Show in every cell ") , topFrame ); 741 lab = new QLabel (i18n("Show in every cell ") , topFrame );
742 topLayout->addMultiCellWidget(lab,ii, ii,0,1); 742 topLayout->addMultiCellWidget(lab,ii, ii,0,1);
743 ii++; 743 ii++;
744 744
745 } else { 745 } else {
746 new QLabel ( i18n("Show in every cell "), habo ); 746 new QLabel ( i18n("Show in every cell "), habo );
747 } 747 }
748 weeklyRecur = 748 weeklyRecur =
749 addWidBool(i18n("short month"), 749 addWidBool(i18n("short month"),
750 &(KOPrefs::instance()->mMonthShowShort),habo); 750 &(KOPrefs::instance()->mMonthShowShort),habo);
751 weeklyRecur = 751 weeklyRecur =
752 addWidBool(i18n("icons"), 752 addWidBool(i18n("icons"),
753 &(KOPrefs::instance()->mMonthShowIcons),habo); 753 &(KOPrefs::instance()->mMonthShowIcons),habo);
754 754
755 topLayout->addMultiCellWidget(habo,ii, ii,0,1); 755 topLayout->addMultiCellWidget(habo,ii, ii,0,1);
756 ii++; 756 ii++;
757#ifdef DESKTOP_VERSION 757#ifdef DESKTOP_VERSION
758 KPrefsDialogWidBool *enableMonthScroll = 758 KPrefsDialogWidBool *enableMonthScroll =
759 addWidBool(i18n("Enable scrollbars in month view cells"), 759 addWidBool(i18n("Enable scrollbars in month view cells"),
760 &(KOPrefs::instance()->mEnableMonthScroll),topFrame); 760 &(KOPrefs::instance()->mEnableMonthScroll),topFrame);
761 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0); 761 topLayout->addWidget(enableMonthScroll->checkBox(),ii++,0);
762#endif 762#endif
763 dummy = 763 dummy =
764 addWidBool(i18n("Week view mode uses bigger font"), 764 addWidBool(i18n("Week view mode uses bigger font"),
765 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame); 765 &(KOPrefs::instance()->mMonthViewUsesBigFont),topFrame);
766 topLayout->addWidget(dummy->checkBox(),ii++,0); 766 topLayout->addWidget(dummy->checkBox(),ii++,0);
767 dummy = 767 dummy =
768 addWidBool(i18n("Show Sat/Sun together"), 768 addWidBool(i18n("Show Sat/Sun together"),
769 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame); 769 &(KOPrefs::instance()->mMonthViewSatSunTog),topFrame);
770 topLayout->addWidget(dummy->checkBox(),ii++,0); 770 topLayout->addWidget(dummy->checkBox(),ii++,0);
771 771
772 KPrefsDialogWidBool *coloredCategoriesInMonthView = 772 KPrefsDialogWidBool *coloredCategoriesInMonthView =
773 addWidBool(i18n("Month view uses category colors"), 773 addWidBool(i18n("Month view uses category colors"),
774 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame); 774 &(KOPrefs::instance()->mMonthViewUsesCategoryColor),topFrame);
775 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 775 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
776 776
777 dummy = 777 dummy =
778 addWidBool(i18n("Categorie colors are applied to text"), 778 addWidBool(i18n("Categorie colors are applied to text"),
779 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame); 779 &(KOPrefs::instance()->mMonthViewUsesForegroundColor),topFrame);
780 topLayout->addWidget(dummy->checkBox(),ii++,0); 780 topLayout->addWidget(dummy->checkBox(),ii++,0);
781 coloredCategoriesInMonthView = 781 coloredCategoriesInMonthView =
782 addWidBool(i18n("Month view uses day colors"), 782 addWidBool(i18n("Month view uses day colors"),
783 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame); 783 &(KOPrefs::instance()->mMonthViewUsesDayColors),topFrame);
784 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0); 784 topLayout->addWidget(coloredCategoriesInMonthView->checkBox(),ii++,0);
785 785
786 KPrefsDialogWidColor *holidayColor = 786 KPrefsDialogWidColor *holidayColor =
787 addWidColor(i18n("Day color odd months"), 787 addWidColor(i18n("Day color odd months"),
788 &(KOPrefs::instance()->mMonthViewOddColor),topFrame); 788 &(KOPrefs::instance()->mMonthViewOddColor),topFrame);
789 topLayout->addWidget(holidayColor->label(),ii,0); 789 topLayout->addWidget(holidayColor->label(),ii,0);
790 topLayout->addWidget(holidayColor->button(),ii++,1); 790 topLayout->addWidget(holidayColor->button(),ii++,1);
791 791
792 holidayColor = 792 holidayColor =
793 addWidColor(i18n("Day color even months"), 793 addWidColor(i18n("Day color even months"),
794 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame); 794 &(KOPrefs::instance()->mMonthViewEvenColor),topFrame);
795 topLayout->addWidget(holidayColor->label(),ii,0); 795 topLayout->addWidget(holidayColor->label(),ii,0);
796 topLayout->addWidget(holidayColor->button(),ii++,1); 796 topLayout->addWidget(holidayColor->button(),ii++,1);
797 797
798 798
799 holidayColor = 799 holidayColor =
800 addWidColor(i18n("Color for Sundays + category \"Holiday\""), 800 addWidColor(i18n("Color for Sundays + category \"Holiday\""),
801 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame); 801 &(KOPrefs::instance()->mMonthViewHolidayColor),topFrame);
802 topLayout->addWidget(holidayColor->label(),ii,0); 802 topLayout->addWidget(holidayColor->label(),ii,0);
803 topLayout->addWidget(holidayColor->button(),ii++,1); 803 topLayout->addWidget(holidayColor->button(),ii++,1);
804 // *********************** What'sNext View 804 // *********************** What'sNext View
805 topFrame = addPage(i18n("What's Next View"),0,0); 805 topFrame = addPage(i18n("What's Next View"),0,0);
806 // DesktopIcon("viewmag",KIcon::SizeMedium)); 806 // DesktopIcon("viewmag",KIcon::SizeMedium));
807 807
808 topLayout = new QGridLayout(topFrame,4,1); 808 topLayout = new QGridLayout(topFrame,4,1);
809 topLayout->setSpacing(spacingHint()); 809 topLayout->setSpacing(spacingHint());
810 topLayout->setMargin(marginHint()); 810 topLayout->setMargin(marginHint());
811 ii = 0; 811 ii = 0;
812 812
813 813
814 QHBox* hdummy = new QHBox(topFrame); 814 QHBox* hdummy = new QHBox(topFrame);
815 new QLabel(i18n("Days in What's Next:"),hdummy); 815 new QLabel(i18n("Days in What's Next:"),hdummy);
816 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy); 816 mWhatsNextSpin = new QSpinBox(1,14,1,hdummy);
817 817
818 topLayout->addWidget(hdummy,ii++,0); 818 topLayout->addWidget(hdummy,ii++,0);
819 819
820 QHBox *prioBox = new QHBox(topFrame); 820 QHBox *prioBox = new QHBox(topFrame);
821 // intervalBox->setSpacing(spacingHint()); 821 // intervalBox->setSpacing(spacingHint());
822 topLayout->addWidget(prioBox,ii++,0); 822 topLayout->addWidget(prioBox,ii++,0);
823 QString messa = i18n("Show topmost todo prios in What's Next:"); 823 QString messa = i18n("Show topmost todo prios in What's Next:");
824 824
825 if ( QApplication::desktop()->width() < 300 ) 825 if ( QApplication::desktop()->width() < 300 )
826 messa = i18n("Show topmost todo prios in What's N.:"); 826 messa = i18n("Show topmost todo prios in What's N.:");
827 QLabel *prioLabel = new QLabel(messa, prioBox); 827 QLabel *prioLabel = new QLabel(messa, prioBox);
828 mPrioSpin = new QSpinBox(0,5,1,prioBox); 828 mPrioSpin = new QSpinBox(0,5,1,prioBox);
829 if ( QApplication::desktop()->width() < 300 ) 829 if ( QApplication::desktop()->width() < 300 )
830 mPrioSpin->setFixedWidth( 40 ); 830 mPrioSpin->setFixedWidth( 40 );
831 831
832 KPrefsDialogWidBool *passwdk = 832 KPrefsDialogWidBool *passwdk =
833 833
834 addWidBool(i18n("Show events, that are done in \nWhat's Next view"), 834 addWidBool(i18n("Show events, that are done in \nWhat's Next view"),
835 &(KOPrefs::instance()->mWNViewShowsPast),topFrame); 835 &(KOPrefs::instance()->mWNViewShowsPast),topFrame);
836 topLayout->addWidget(passwdk->checkBox(), ii++,0); 836 topLayout->addWidget(passwdk->checkBox(), ii++,0);
837 passwdk = 837 passwdk =
838 addWidBool(i18n("Show parent To-Do's in What's Next view"), 838 addWidBool(i18n("Show parent To-Do's in What's Next view"),
839 &(KOPrefs::instance()->mWNViewShowsParents),topFrame); 839 &(KOPrefs::instance()->mWNViewShowsParents),topFrame);
840 topLayout->addWidget(passwdk->checkBox(), ii++,0); 840 topLayout->addWidget(passwdk->checkBox(), ii++,0);
841 841
842 passwdk = 842 passwdk =
843 addWidBool(i18n("Show location in What's Next view"), 843 addWidBool(i18n("Show location in What's Next view"),
844 &(KOPrefs::instance()->mWNViewShowLocation),topFrame); 844 &(KOPrefs::instance()->mWNViewShowLocation),topFrame);
845 topLayout->addWidget(passwdk->checkBox(), ii++,0); 845 topLayout->addWidget(passwdk->checkBox(), ii++,0);
846 846
847 passwdk = 847 passwdk =
848 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"), 848 addWidBool(i18n("Show Sync Events in \nWhat's Next/Agenda view"),
849 &(KOPrefs::instance()->mShowSyncEvents),topFrame); 849 &(KOPrefs::instance()->mShowSyncEvents),topFrame);
850 topLayout->addWidget(passwdk->checkBox(), ii++,0); 850 topLayout->addWidget(passwdk->checkBox(), ii++,0);
851 passwdk = 851 passwdk =
852 addWidBool(i18n("Use short date in \nWhat's Next/Event view"), 852 addWidBool(i18n("Use short date in \nWhat's Next/Event view"),
853 &(KOPrefs::instance()->mShortDateInViewer),topFrame); 853 &(KOPrefs::instance()->mShortDateInViewer),topFrame);
854 topLayout->addWidget(passwdk->checkBox(), ii++,0); 854 topLayout->addWidget(passwdk->checkBox(), ii++,0);
855 855
856 856
857 857
858 858
859 // *********************** Todo View 859 // *********************** Todo View
860 860
861 topFrame = addPage(i18n("Todo View"),0,0); 861 topFrame = addPage(i18n("Todo View"),0,0);
862 // DesktopIcon("viewmag",KIcon::SizeMedium)); 862 // DesktopIcon("viewmag",KIcon::SizeMedium));
863 863
864 topLayout = new QGridLayout(topFrame,4,1); 864 topLayout = new QGridLayout(topFrame,4,1);
865 topLayout->setSpacing(spacingHint()); 865 topLayout->setSpacing(spacingHint());
866 topLayout->setMargin(marginHint()); 866 topLayout->setMargin(marginHint());
867 ii = 0; 867 ii = 0;
868dummy = 868dummy =
869 addWidBool(i18n("Hide not running Todos in To-do view"), 869 addWidBool(i18n("Hide not running Todos in To-do view"),
870 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame); 870 &(KOPrefs::instance()->mHideNonStartedTodos),topFrame);
871 topLayout->addWidget(dummy->checkBox(),ii++,0); 871 topLayout->addWidget(dummy->checkBox(),ii++,0);
872 872
873 873
874 KPrefsDialogWidBool *showCompletedTodo = 874 KPrefsDialogWidBool *showCompletedTodo =
875 addWidBool(i18n("To-do view shows completed Todos"), 875 addWidBool(i18n("To-do view shows completed Todos"),
876 &(KOPrefs::instance()->mShowCompletedTodo),topFrame); 876 &(KOPrefs::instance()->mShowCompletedTodo),topFrame);
877 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0); 877 topLayout->addWidget(showCompletedTodo->checkBox(),ii++,0);
878 dummy = 878 dummy =
879 addWidBool(i18n("To-do view shows complete as 'xx %'"), 879 addWidBool(i18n("To-do view shows complete as 'xx %'"),
880 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame); 880 &(KOPrefs::instance()->mTodoViewShowsPercentage),topFrame);
881 topLayout->addWidget(dummy->checkBox(),ii++,0); 881 topLayout->addWidget(dummy->checkBox(),ii++,0);
882 882
883 dummy = 883 dummy =
884 addWidBool(i18n("Small To-do view uses smaller font"), 884 addWidBool(i18n("Small To-do view uses smaller font"),
885 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame); 885 &(KOPrefs::instance()->mTodoViewUsesSmallFont),topFrame);
886 topLayout->addWidget(dummy->checkBox(),ii++,0); 886 topLayout->addWidget(dummy->checkBox(),ii++,0);
887 887
888 888
889 889
890 dummy = 890 dummy =
891 addWidBool(i18n("Todo view uses category colors"), 891 addWidBool(i18n("Todo view uses category colors"),
892 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame); 892 &(KOPrefs::instance()->mTodoViewUsesCatColors),topFrame);
893 topLayout->addWidget(dummy->checkBox(),ii++,0); 893 topLayout->addWidget(dummy->checkBox(),ii++,0);
894 894
895 895
896 QWidget* wid = new QWidget( topFrame ); 896 QWidget* wid = new QWidget( topFrame );
897 // Todo due today color 897 // Todo due today color
898 KPrefsDialogWidColor *todoDueTodayColor = 898 KPrefsDialogWidColor *todoDueTodayColor =
899 addWidColor(i18n("Todo due today color:"), 899 addWidColor(i18n("Todo due today color:"),
900 &(KOPrefs::instance()->mTodoDueTodayColor),wid); 900 &(KOPrefs::instance()->mTodoDueTodayColor),wid);
901 QHBoxLayout *widLayout = new QHBoxLayout(wid); 901 QHBoxLayout *widLayout = new QHBoxLayout(wid);
902 widLayout->addWidget( todoDueTodayColor->label() ); 902 widLayout->addWidget( todoDueTodayColor->label() );
903 widLayout->addWidget( todoDueTodayColor->button() ); 903 widLayout->addWidget( todoDueTodayColor->button() );
904 topLayout->addWidget(wid,ii++,0); 904 topLayout->addWidget(wid,ii++,0);
905 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1); 905 //topLayout->addWidget(todoDueTodayColor->button(),ii++,1);
906 906
907 // Todo overdue color 907 // Todo overdue color
908 wid = new QWidget( topFrame ); 908 wid = new QWidget( topFrame );
909 widLayout = new QHBoxLayout(wid); 909 widLayout = new QHBoxLayout(wid);
910 KPrefsDialogWidColor *todoOverdueColor = 910 KPrefsDialogWidColor *todoOverdueColor =
911 addWidColor(i18n("Todo overdue color:"), 911 addWidColor(i18n("Todo overdue color:"),
912 &(KOPrefs::instance()->mTodoOverdueColor),wid); 912 &(KOPrefs::instance()->mTodoOverdueColor),wid);
913 widLayout->addWidget(todoOverdueColor->label()); 913 widLayout->addWidget(todoOverdueColor->label());
914 widLayout->addWidget(todoOverdueColor->button()); 914 widLayout->addWidget(todoOverdueColor->button());
915 topLayout->addWidget(wid,ii++,0); 915 topLayout->addWidget(wid,ii++,0);
916 916
917 dummy = 917 dummy =
918 addWidBool(i18n("Colors are applied to text"), 918 addWidBool(i18n("Colors are applied to text"),
919 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame); 919 &(KOPrefs::instance()->mTodoViewUsesForegroundColor),topFrame);
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index bd9efc8..7faf675 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -747,620 +747,620 @@ void MainWindow::initActions()
747 xdays_action->addTo( viewMenu ); 747 xdays_action->addTo( viewMenu );
748 connect( xdays_action, SIGNAL( activated() ), 748 connect( xdays_action, SIGNAL( activated() ),
749 mView->viewManager(), SLOT( showNextXView() ) ); 749 mView->viewManager(), SLOT( showNextXView() ) );
750 750
751 icon = loadPixmap( pathString + "whatsnext" ); 751 icon = loadPixmap( pathString + "whatsnext" );
752 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); 752 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 );
753 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 753 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
754 whatsnext_action->addTo( viewMenu ); 754 whatsnext_action->addTo( viewMenu );
755 connect( whatsnext_action, SIGNAL( activated() ), 755 connect( whatsnext_action, SIGNAL( activated() ),
756 mView->viewManager(), SLOT( showWhatsNextView() ) ); 756 mView->viewManager(), SLOT( showWhatsNextView() ) );
757 757
758#if 0 758#if 0
759 action = new QAction( "view_timespan", "Time Span", 0, this ); 759 action = new QAction( "view_timespan", "Time Span", 0, this );
760 action->addTo( viewMenu ); 760 action->addTo( viewMenu );
761 connect( action, SIGNAL( activated() ), 761 connect( action, SIGNAL( activated() ),
762 mView->viewManager(), SLOT( showTimeSpanView() ) ); 762 mView->viewManager(), SLOT( showTimeSpanView() ) );
763#endif 763#endif
764 764
765 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 765 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
766 this ); 766 this );
767 mNewSubTodoAction->addTo( actionMenu ); 767 mNewSubTodoAction->addTo( actionMenu );
768 connect( mNewSubTodoAction, SIGNAL( activated() ), 768 connect( mNewSubTodoAction, SIGNAL( activated() ),
769 mView, SLOT( newSubTodo() ) ); 769 mView, SLOT( newSubTodo() ) );
770 770
771 actionMenu->insertSeparator(); 771 actionMenu->insertSeparator();
772 772
773 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 773 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
774 mShowAction->addTo( actionMenu ); 774 mShowAction->addTo( actionMenu );
775 connect( mShowAction, SIGNAL( activated() ), 775 connect( mShowAction, SIGNAL( activated() ),
776 mView, SLOT( showIncidence() ) ); 776 mView, SLOT( showIncidence() ) );
777 777
778 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 778 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
779 mEditAction->addTo( actionMenu ); 779 mEditAction->addTo( actionMenu );
780 connect( mEditAction, SIGNAL( activated() ), 780 connect( mEditAction, SIGNAL( activated() ),
781 mView, SLOT( editIncidence() ) ); 781 mView, SLOT( editIncidence() ) );
782 782
783 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 783 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
784 mDeleteAction->addTo( actionMenu ); 784 mDeleteAction->addTo( actionMenu );
785 connect( mDeleteAction, SIGNAL( activated() ), 785 connect( mDeleteAction, SIGNAL( activated() ),
786 mView, SLOT( deleteIncidence() ) ); 786 mView, SLOT( deleteIncidence() ) );
787 787
788 788
789 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 789 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
790 mCloneAction->addTo( actionMenu ); 790 mCloneAction->addTo( actionMenu );
791 connect( mCloneAction, SIGNAL( activated() ), 791 connect( mCloneAction, SIGNAL( activated() ),
792 mView, SLOT( cloneIncidence() ) ); 792 mView, SLOT( cloneIncidence() ) );
793 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 793 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
794 mMoveAction->addTo( actionMenu ); 794 mMoveAction->addTo( actionMenu );
795 connect( mMoveAction, SIGNAL( activated() ), 795 connect( mMoveAction, SIGNAL( activated() ),
796 mView, SLOT( moveIncidence() ) ); 796 mView, SLOT( moveIncidence() ) );
797 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 797 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
798 mBeamAction->addTo( actionMenu ); 798 mBeamAction->addTo( actionMenu );
799 connect( mBeamAction, SIGNAL( activated() ), 799 connect( mBeamAction, SIGNAL( activated() ),
800 mView, SLOT( beamIncidence() ) ); 800 mView, SLOT( beamIncidence() ) );
801 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 801 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
802 mCancelAction->addTo( actionMenu ); 802 mCancelAction->addTo( actionMenu );
803 connect( mCancelAction, SIGNAL( activated() ), 803 connect( mCancelAction, SIGNAL( activated() ),
804 mView, SLOT( toggleCancelIncidence() ) ); 804 mView, SLOT( toggleCancelIncidence() ) );
805 805
806 actionMenu->insertSeparator(); 806 actionMenu->insertSeparator();
807 807
808 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 808 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
809 this ); 809 this );
810 action->addTo( actionMenu ); 810 action->addTo( actionMenu );
811 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 811 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
812 812
813 icon = loadPixmap( pathString + "search" ); 813 icon = loadPixmap( pathString + "search" );
814 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 814 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
815 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); 815 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4);
816 search_action->addTo( actionMenu ); 816 search_action->addTo( actionMenu );
817 connect( search_action, SIGNAL( activated() ), 817 connect( search_action, SIGNAL( activated() ),
818 mView->dialogManager(), SLOT( showSearchDialog() ) ); 818 mView->dialogManager(), SLOT( showSearchDialog() ) );
819 819
820 820
821 821
822 if ( KOPrefs::instance()->mShowFullMenu ) { 822 if ( KOPrefs::instance()->mShowFullMenu ) {
823 actionMenu->insertSeparator(); 823 actionMenu->insertSeparator();
824 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 824 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
825 825
826 } 826 }
827 // actionMenu->insertSeparator(); 827 // actionMenu->insertSeparator();
828 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 828 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
829 this ); 829 this );
830 action->addTo( importMenu_X ); 830 action->addTo( importMenu_X );
831 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 831 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
832 action = new QAction( "import_quick", i18n("Import last file"), 0, 832 action = new QAction( "import_quick", i18n("Import last file"), 0,
833 this ); 833 this );
834 action->addTo( importMenu_X ); 834 action->addTo( importMenu_X );
835 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 835 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
836 importMenu_X->insertSeparator(); 836 importMenu_X->insertSeparator();
837 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 837 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
838 this ); 838 this );
839 action->addTo( importMenu_X ); 839 action->addTo( importMenu_X );
840 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 840 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
841 //#ifndef DESKTOP_VERSION 841 //#ifndef DESKTOP_VERSION
842 importMenu_X->insertSeparator(); 842 importMenu_X->insertSeparator();
843 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 843 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
844 this ); 844 this );
845 action->addTo( importMenu_X ); 845 action->addTo( importMenu_X );
846 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 846 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
847 //#else 847 //#else
848#ifdef _OL_IMPORT_ 848#ifdef _OL_IMPORT_
849 importMenu_X->insertSeparator(); 849 importMenu_X->insertSeparator();
850 action = new QAction( "import_ol", i18n("Import from OL"), 0, 850 action = new QAction( "import_ol", i18n("Import from OL"), 0,
851 this ); 851 this );
852 action->addTo( importMenu_X ); 852 action->addTo( importMenu_X );
853 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 853 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
854#endif 854#endif
855 //#endif 855 //#endif
856 856
857 //importMenu->insertSeparator(); 857 //importMenu->insertSeparator();
858 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 858 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
859 this ); 859 this );
860 action->addTo( importMenu ); 860 action->addTo( importMenu );
861 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 861 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
862 862
863 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 863 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
864 this ); 864 this );
865 action->addTo( importMenu ); 865 action->addTo( importMenu );
866 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 866 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
867 importMenu->insertSeparator(); 867 importMenu->insertSeparator();
868 importMenu->insertItem( i18n("Import"), importMenu_X ); 868 importMenu->insertItem( i18n("Import"), importMenu_X );
869 //importMenu->insertSeparator(); 869 //importMenu->insertSeparator();
870 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 870 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
871 this ); 871 this );
872 action->addTo( exportMenu_X ); 872 action->addTo( exportMenu_X );
873 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 873 connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
874 874
875 875
876 //LR 876 //LR
877 QPopupMenu *ex2phone = new QPopupMenu( this ); 877 QPopupMenu *ex2phone = new QPopupMenu( this );
878 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 878 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
879 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 879 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
880 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 880 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
881 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone ); 881 exportMenu_X->insertItem( i18n("Export to phone"), ex2phone );
882 882
883 importMenu->insertItem( i18n("Export"), exportMenu_X ); 883 importMenu->insertItem( i18n("Export"), exportMenu_X );
884#ifndef DESKTOP_VERSION 884#ifndef DESKTOP_VERSION
885 //importMenu->insertSeparator(); 885 //importMenu->insertSeparator();
886 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 886 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
887 this ); 887 this );
888 brAction->addTo( beamMenu_X ); 888 brAction->addTo( beamMenu_X );
889 brAction->setToggleAction (true ) ; 889 brAction->setToggleAction (true ) ;
890 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 890 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
891 891
892 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 892 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
893 this ); 893 this );
894 action->addTo( beamMenu_X ); 894 action->addTo( beamMenu_X );
895 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 895 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
896 896
897 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 897 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
898 this ); 898 this );
899 action->addTo( beamMenu_X ); 899 action->addTo( beamMenu_X );
900 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 900 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
901 importMenu->insertItem( i18n("Beam"), beamMenu_X ); 901 importMenu->insertItem( i18n("Beam"), beamMenu_X );
902#else 902#else
903 //importMenu->insertSeparator(); 903 //importMenu->insertSeparator();
904 icon = loadPixmap( pathString + "print" ); 904 icon = loadPixmap( pathString + "print" );
905 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 905 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
906 action->addTo( beamMenu_X ); 906 action->addTo( beamMenu_X );
907 connect( action, SIGNAL( activated() ), 907 connect( action, SIGNAL( activated() ),
908 this, SLOT( printCal() ) ); 908 this, SLOT( printCal() ) );
909 909
910 icon = loadPixmap( pathString + "print" ); 910 icon = loadPixmap( pathString + "print" );
911 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 911 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
912 action->addTo( beamMenu_X ); 912 action->addTo( beamMenu_X );
913 connect( action, SIGNAL( activated() ), 913 connect( action, SIGNAL( activated() ),
914 this, SLOT( printSel() ) ); 914 this, SLOT( printSel() ) );
915 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this ); 915 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
916 action->addTo( beamMenu_X ); 916 action->addTo( beamMenu_X );
917 connect( action, SIGNAL( activated() ), 917 connect( action, SIGNAL( activated() ),
918 mView->viewManager(), SIGNAL( printWNV() ) ); 918 mView->viewManager(), SIGNAL( printWNV() ) );
919 importMenu->insertItem( i18n("Print"), beamMenu_X ); 919 importMenu->insertItem( i18n("Print"), beamMenu_X );
920#endif 920#endif
921 importMenu->insertSeparator(); 921 importMenu->insertSeparator();
922 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 922 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
923 this ); 923 this );
924 action->addTo( importMenu ); 924 action->addTo( importMenu );
925 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 925 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
926 importMenu->insertSeparator(); 926 importMenu->insertSeparator();
927 action = new QAction( "beam all", i18n("Save"), 0, 927 action = new QAction( "beam all", i18n("Save"), 0,
928 this ); 928 this );
929 action->addTo( importMenu ); 929 action->addTo( importMenu );
930 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 930 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
931 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 931 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
932 this ); 932 this );
933 action->addTo( importMenu ); 933 action->addTo( importMenu );
934 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 934 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
935 935
936 //menuBar->insertItem( "Configure",configureMenu ); 936 //menuBar->insertItem( "Configure",configureMenu );
937 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 937 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
938 icon = loadPixmap( "korganizer/korganizer" ); 938 icon = loadPixmap( "korganizer/korganizer" );
939 939
940 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 940 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
941 action->addTo( helpMenu ); 941 action->addTo( helpMenu );
942 connect( action, SIGNAL( activated() ), 942 connect( action, SIGNAL( activated() ),
943 SLOT( whatsNew() ) ); 943 SLOT( whatsNew() ) );
944 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 944 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
945 action->addTo( helpMenu ); 945 action->addTo( helpMenu );
946 connect( action, SIGNAL( activated() ), 946 connect( action, SIGNAL( activated() ),
947 SLOT( features() ) ); 947 SLOT( features() ) );
948 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 948 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
949 action->addTo( helpMenu ); 949 action->addTo( helpMenu );
950 connect( action, SIGNAL( activated() ), 950 connect( action, SIGNAL( activated() ),
951 SLOT( keyBindings() ) ); 951 SLOT( keyBindings() ) );
952 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 952 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
953 action->addTo( helpMenu ); 953 action->addTo( helpMenu );
954 connect( action, SIGNAL( activated() ), 954 connect( action, SIGNAL( activated() ),
955 SLOT( synchowto() ) ); 955 SLOT( synchowto() ) );
956 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 956 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
957 action->addTo( helpMenu ); 957 action->addTo( helpMenu );
958 connect( action, SIGNAL( activated() ), 958 connect( action, SIGNAL( activated() ),
959 SLOT( kdesynchowto() ) ); 959 SLOT( kdesynchowto() ) );
960 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 960 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
961 action->addTo( helpMenu ); 961 action->addTo( helpMenu );
962 connect( action, SIGNAL( activated() ), 962 connect( action, SIGNAL( activated() ),
963 SLOT( multisynchowto() ) ); 963 SLOT( multisynchowto() ) );
964 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 964 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
965 action->addTo( helpMenu ); 965 action->addTo( helpMenu );
966 connect( action, SIGNAL( activated() ), 966 connect( action, SIGNAL( activated() ),
967 SLOT( aboutAutoSaving() ) ); 967 SLOT( aboutAutoSaving() ) );
968 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 968 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
969 action->addTo( helpMenu ); 969 action->addTo( helpMenu );
970 connect( action, SIGNAL( activated() ), 970 connect( action, SIGNAL( activated() ),
971 SLOT( aboutKnownBugs() ) ); 971 SLOT( aboutKnownBugs() ) );
972 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 972 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
973 action->addTo( helpMenu ); 973 action->addTo( helpMenu );
974 connect( action, SIGNAL( activated() ), 974 connect( action, SIGNAL( activated() ),
975 SLOT( usertrans() ) ); 975 SLOT( usertrans() ) );
976 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 976 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
977 action->addTo( helpMenu ); 977 action->addTo( helpMenu );
978 connect( action, SIGNAL( activated() ), 978 connect( action, SIGNAL( activated() ),
979 SLOT( faq() ) ); 979 SLOT( faq() ) );
980 action = new QAction( "licence", i18n("Licence..."), 0, this ); 980 action = new QAction( "licence", i18n("Licence..."), 0, this );
981 action->addTo( helpMenu ); 981 action->addTo( helpMenu );
982 connect( action, SIGNAL( activated() ), 982 connect( action, SIGNAL( activated() ),
983 SLOT( licence() ) ); 983 SLOT( licence() ) );
984 action = new QAction( "about", i18n("About..."), 0, this ); 984 action = new QAction( "about", i18n("About..."), 0, this );
985 action->addTo( helpMenu ); 985 action->addTo( helpMenu );
986 connect( action, SIGNAL( activated() ), 986 connect( action, SIGNAL( activated() ),
987 SLOT( about() ) ); 987 SLOT( about() ) );
988 //menuBar->insertSeparator(); 988 //menuBar->insertSeparator();
989 989
990 // ****************************************************** 990 // ******************************************************
991 // menubar icons 991 // menubar icons
992 992
993 993
994 iconToolBar->setHorizontalStretchable (true ); 994 iconToolBar->setHorizontalStretchable (true );
995 //menuBar->insertItem( iconToolBar ); 995 //menuBar->insertItem( iconToolBar );
996 //xdays_action 996 //xdays_action
997 if (p-> mShowIconNewEvent) 997 if (p-> mShowIconNewEvent)
998 ne_action->addTo( iconToolBar ); 998 ne_action->addTo( iconToolBar );
999 if (p->mShowIconNewTodo ) 999 if (p->mShowIconNewTodo )
1000 nt_action->addTo( iconToolBar ); 1000 nt_action->addTo( iconToolBar );
1001 if (p-> mShowIconSearch) 1001 if (p-> mShowIconSearch)
1002 search_action->addTo( iconToolBar ); 1002 search_action->addTo( iconToolBar );
1003 if (p-> mShowIconWhatsThis)
1004 QWhatsThis::whatsThisButton ( iconToolBar );
1003 if (p-> mShowIconNext) 1005 if (p-> mShowIconNext)
1004 whatsnext_action->addTo( iconToolBar ); 1006 whatsnext_action->addTo( iconToolBar );
1005 if (p-> mShowIconNextDays) 1007 if (p-> mShowIconNextDays)
1006 xdays_action->addTo( iconToolBar ); 1008 xdays_action->addTo( iconToolBar );
1007 if (p-> mShowIconList) 1009 if (p-> mShowIconList)
1008 showlist_action->addTo( iconToolBar ); 1010 showlist_action->addTo( iconToolBar );
1009 if (p-> mShowIconDay1) 1011 if (p-> mShowIconDay1)
1010 day1_action->addTo( iconToolBar ); 1012 day1_action->addTo( iconToolBar );
1011 if (p-> mShowIconDay5) 1013 if (p-> mShowIconDay5)
1012 day5_action->addTo( iconToolBar ); 1014 day5_action->addTo( iconToolBar );
1013 if (p-> mShowIconDay7) 1015 if (p-> mShowIconDay7)
1014 day7_action->addTo( iconToolBar ); 1016 day7_action->addTo( iconToolBar );
1015 if (p-> mShowIconDay6) 1017 if (p-> mShowIconDay6)
1016 day6_action->addTo( iconToolBar ); 1018 day6_action->addTo( iconToolBar );
1017 if (p-> mShowIconMonth) 1019 if (p-> mShowIconMonth)
1018 month_action->addTo( iconToolBar ); 1020 month_action->addTo( iconToolBar );
1019 if (p-> mShowIconTodoview) 1021 if (p-> mShowIconTodoview)
1020 todoview_action->addTo( iconToolBar ); 1022 todoview_action->addTo( iconToolBar );
1021 if (p-> mShowIconJournal) 1023 if (p-> mShowIconJournal)
1022 viewjournal_action->addTo( iconToolBar ); 1024 viewjournal_action->addTo( iconToolBar );
1023 icon = loadPixmap( pathString + "2leftarrowB" ); 1025 icon = loadPixmap( pathString + "2leftarrowB" );
1024 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 1026 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
1025 if (p-> mShowIconBackFast) { 1027 if (p-> mShowIconBackFast) {
1026 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 1028 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
1027 connect( action, SIGNAL( activated() ), 1029 connect( action, SIGNAL( activated() ),
1028 mView, SLOT( goPreviousMonth() ) ); 1030 mView, SLOT( goPreviousMonth() ) );
1029 action->addTo( iconToolBar ); 1031 action->addTo( iconToolBar );
1030 } 1032 }
1031 icon = loadPixmap( pathString + "1leftarrowB" ); 1033 icon = loadPixmap( pathString + "1leftarrowB" );
1032 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 1034 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
1033 if (p-> mShowIconBack) { 1035 if (p-> mShowIconBack) {
1034 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 1036 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
1035 connect( action, SIGNAL( activated() ), 1037 connect( action, SIGNAL( activated() ),
1036 mView, SLOT( goPrevious() ) ); 1038 mView, SLOT( goPrevious() ) );
1037 action->addTo( iconToolBar ); 1039 action->addTo( iconToolBar );
1038 } 1040 }
1039 icon = loadPixmap( pathString + "today" ); 1041 icon = loadPixmap( pathString + "today" );
1040 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 1042 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
1041 if (p-> mShowIconToday) 1043 if (p-> mShowIconToday)
1042 today_action->addTo( iconToolBar ); 1044 today_action->addTo( iconToolBar );
1043 icon = loadPixmap( pathString + "1rightarrowB" ); 1045 icon = loadPixmap( pathString + "1rightarrowB" );
1044 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 1046 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
1045 if (p-> mShowIconForward) { 1047 if (p-> mShowIconForward) {
1046 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 1048 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
1047 connect( action, SIGNAL( activated() ), 1049 connect( action, SIGNAL( activated() ),
1048 mView, SLOT( goNext() ) ); 1050 mView, SLOT( goNext() ) );
1049 action->addTo( iconToolBar ); 1051 action->addTo( iconToolBar );
1050 } 1052 }
1051 icon = loadPixmap( pathString + "2rightarrowB" ); 1053 icon = loadPixmap( pathString + "2rightarrowB" );
1052 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 1054 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
1053 if (p-> mShowIconForwardFast) { 1055 if (p-> mShowIconForwardFast) {
1054 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 1056 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
1055 connect( action, SIGNAL( activated() ), 1057 connect( action, SIGNAL( activated() ),
1056 mView, SLOT( goNextMonth() ) ); 1058 mView, SLOT( goNextMonth() ) );
1057 action->addTo( iconToolBar ); 1059 action->addTo( iconToolBar );
1058 } 1060 }
1059 1061
1060 1062
1061 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 1063 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
1062 1064
1063 if (p-> mShowIconNewEvent) 1065 if (p-> mShowIconNewEvent)
1064 configureToolBarMenu->setItemChecked( 10, true ); 1066 configureToolBarMenu->setItemChecked( 10, true );
1065 if (p->mShowIconNewTodo ) 1067 if (p->mShowIconNewTodo )
1066 configureToolBarMenu->setItemChecked( 20, true ); 1068 configureToolBarMenu->setItemChecked( 20, true );
1067 if (p-> mShowIconSearch) 1069 if (p-> mShowIconSearch)
1068 configureToolBarMenu->setItemChecked( 120, true ); 1070 configureToolBarMenu->setItemChecked( 120, true );
1069 if (p-> mShowIconList) 1071 if (p-> mShowIconList)
1070 configureToolBarMenu->setItemChecked( 30, true ); 1072 configureToolBarMenu->setItemChecked( 30, true );
1071 if (p-> mShowIconDay1) 1073 if (p-> mShowIconDay1)
1072 configureToolBarMenu->setItemChecked( 40, true ); 1074 configureToolBarMenu->setItemChecked( 40, true );
1073 if (p-> mShowIconDay5) 1075 if (p-> mShowIconDay5)
1074 configureToolBarMenu->setItemChecked( 50, true ); 1076 configureToolBarMenu->setItemChecked( 50, true );
1075 if (p-> mShowIconDay6) 1077 if (p-> mShowIconDay6)
1076 configureToolBarMenu->setItemChecked( 75, true ); 1078 configureToolBarMenu->setItemChecked( 75, true );
1077 if (p-> mShowIconDay7) 1079 if (p-> mShowIconDay7)
1078 configureToolBarMenu->setItemChecked( 60, true ); 1080 configureToolBarMenu->setItemChecked( 60, true );
1079 if (p-> mShowIconMonth) 1081 if (p-> mShowIconMonth)
1080 configureToolBarMenu->setItemChecked( 70, true ); 1082 configureToolBarMenu->setItemChecked( 70, true );
1081 if (p-> mShowIconTodoview) 1083 if (p-> mShowIconTodoview)
1082 configureToolBarMenu->setItemChecked( 80, true ); 1084 configureToolBarMenu->setItemChecked( 80, true );
1083 if (p-> mShowIconBackFast) 1085 if (p-> mShowIconBackFast)
1084 configureToolBarMenu->setItemChecked( 200, true ); 1086 configureToolBarMenu->setItemChecked( 200, true );
1085 if (p-> mShowIconBack) 1087 if (p-> mShowIconBack)
1086 configureToolBarMenu->setItemChecked( 210, true ); 1088 configureToolBarMenu->setItemChecked( 210, true );
1087 if (p-> mShowIconToday) 1089 if (p-> mShowIconToday)
1088 configureToolBarMenu->setItemChecked( 130, true ); 1090 configureToolBarMenu->setItemChecked( 130, true );
1089 if (p-> mShowIconForward) 1091 if (p-> mShowIconForward)
1090 configureToolBarMenu->setItemChecked( 220, true ); 1092 configureToolBarMenu->setItemChecked( 220, true );
1091 if (p-> mShowIconForwardFast) 1093 if (p-> mShowIconForwardFast)
1092 configureToolBarMenu->setItemChecked( 230, true ); 1094 configureToolBarMenu->setItemChecked( 230, true );
1093 if (p-> mShowIconNextDays) 1095 if (p-> mShowIconNextDays)
1094 configureToolBarMenu->setItemChecked( 100, true ); 1096 configureToolBarMenu->setItemChecked( 100, true );
1095 if (p-> mShowIconNext) 1097 if (p-> mShowIconNext)
1096 configureToolBarMenu->setItemChecked( 110, true ); 1098 configureToolBarMenu->setItemChecked( 110, true );
1097 if (p-> mShowIconJournal) 1099 if (p-> mShowIconJournal)
1098 configureToolBarMenu->setItemChecked( 90, true ); 1100 configureToolBarMenu->setItemChecked( 90, true );
1099 if (p-> mShowIconWhatsThis) 1101 if (p-> mShowIconWhatsThis)
1100 configureToolBarMenu->setItemChecked( 300, true ); 1102 configureToolBarMenu->setItemChecked( 300, true );
1101 if (p-> mShowIconWeekNum) 1103 if (p-> mShowIconWeekNum)
1102 configureToolBarMenu->setItemChecked( 400, true ); 1104 configureToolBarMenu->setItemChecked( 400, true );
1103 QLabel* dummy = new QLabel( iconToolBar ); 1105 QLabel* dummy = new QLabel( iconToolBar );
1104 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1106 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1105 if (!p-> mShowIconStretch) 1107 if (!p-> mShowIconStretch)
1106 iconToolBar->setStretchableWidget ( dummy ) ; 1108 iconToolBar->setStretchableWidget ( dummy ) ;
1107 else 1109 else
1108 configureToolBarMenu->setItemChecked( 5, true ); 1110 configureToolBarMenu->setItemChecked( 5, true );
1109 if (p-> mShowIconWhatsThis)
1110 QWhatsThis::whatsThisButton ( iconToolBar );
1111 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1111 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1112 configureAgenda( p->mHourSize ); 1112 configureAgenda( p->mHourSize );
1113 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1113 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1114} 1114}
1115 1115
1116void MainWindow::exportToPhone( int mode ) 1116void MainWindow::exportToPhone( int mode )
1117{ 1117{
1118 1118
1119 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1119 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1120 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1120 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1121 KOex2phonePrefs ex2phone; 1121 KOex2phonePrefs ex2phone;
1122 1122
1123 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1123 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );
1124 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice ); 1124 ex2phone.mPhoneDevice->setText( KPimGlobalPrefs::instance()->mEx2PhoneDevice );
1125 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1125 ex2phone.mPhoneModel->setText( KPimGlobalPrefs::instance()->mEx2PhoneModel );
1126 if ( mode == 1 ) 1126 if ( mode == 1 )
1127 ex2phone.setCaption(i18n("Export complete calendar")); 1127 ex2phone.setCaption(i18n("Export complete calendar"));
1128 if ( mode == 2 ) 1128 if ( mode == 2 )
1129 ex2phone.setCaption(i18n("Export filtered calendar")); 1129 ex2phone.setCaption(i18n("Export filtered calendar"));
1130 1130
1131 if ( !ex2phone.exec() ) { 1131 if ( !ex2phone.exec() ) {
1132 return; 1132 return;
1133 } 1133 }
1134 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text(); 1134 KPimGlobalPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
1135 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text(); 1135 KPimGlobalPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
1136 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text(); 1136 KPimGlobalPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
1137 1137
1138 int inFuture = 0; 1138 int inFuture = 0;
1139 if ( ex2phone.mWriteBackFuture->isChecked() ) 1139 if ( ex2phone.mWriteBackFuture->isChecked() )
1140 inFuture = ex2phone.mWriteBackFutureWeeks->value(); 1140 inFuture = ex2phone.mWriteBackFutureWeeks->value();
1141 QPtrList<Incidence> delSel; 1141 QPtrList<Incidence> delSel;
1142 if ( mode == 1 ) 1142 if ( mode == 1 )
1143 delSel = mCalendar->rawIncidences(); 1143 delSel = mCalendar->rawIncidences();
1144 if ( mode == 2 ) 1144 if ( mode == 2 )
1145 delSel = mCalendar->incidences(); 1145 delSel = mCalendar->incidences();
1146 CalendarLocal* cal = new CalendarLocal(); 1146 CalendarLocal* cal = new CalendarLocal();
1147 cal->setLocalTime(); 1147 cal->setLocalTime();
1148 Incidence *incidence = delSel.first(); 1148 Incidence *incidence = delSel.first();
1149 QDateTime cur = QDateTime::currentDateTime().addDays( -7 ); 1149 QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
1150 QDateTime end = cur.addDays( ( inFuture +1 ) *7 ); 1150 QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
1151 while ( incidence ) { 1151 while ( incidence ) {
1152 if ( incidence->type() != "Journal" ) { 1152 if ( incidence->type() != "Journal" ) {
1153 bool add = true; 1153 bool add = true;
1154 if ( inFuture ) { 1154 if ( inFuture ) {
1155 QDateTime dt; 1155 QDateTime dt;
1156 if ( incidence->type() == "Todo" ) { 1156 if ( incidence->type() == "Todo" ) {
1157 Todo * t = (Todo*)incidence; 1157 Todo * t = (Todo*)incidence;
1158 if ( t->hasDueDate() ) 1158 if ( t->hasDueDate() )
1159 dt = t->dtDue(); 1159 dt = t->dtDue();
1160 else 1160 else
1161 dt = cur.addSecs( 62 ); 1161 dt = cur.addSecs( 62 );
1162 } 1162 }
1163 else { 1163 else {
1164 bool ok; 1164 bool ok;
1165 dt = incidence->getNextOccurence( cur, &ok ); 1165 dt = incidence->getNextOccurence( cur, &ok );
1166 if ( !ok ) 1166 if ( !ok )
1167 dt = cur.addSecs( -62 ); 1167 dt = cur.addSecs( -62 );
1168 } 1168 }
1169 if ( dt < cur || dt > end ) { 1169 if ( dt < cur || dt > end ) {
1170 add = false; 1170 add = false;
1171 } 1171 }
1172 } 1172 }
1173 if ( add ) { 1173 if ( add ) {
1174 Incidence *in = incidence->clone(); 1174 Incidence *in = incidence->clone();
1175 cal->addIncidence( in ); 1175 cal->addIncidence( in );
1176 } 1176 }
1177 } 1177 }
1178 incidence = delSel.next(); 1178 incidence = delSel.next();
1179 } 1179 }
1180 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice, 1180 PhoneAccess::writeConfig( KPimGlobalPrefs::instance()->mEx2PhoneDevice,
1181 KPimGlobalPrefs::instance()->mEx2PhoneConnection, 1181 KPimGlobalPrefs::instance()->mEx2PhoneConnection,
1182 KPimGlobalPrefs::instance()->mEx2PhoneModel ); 1182 KPimGlobalPrefs::instance()->mEx2PhoneModel );
1183 1183
1184 setCaption( i18n("Writing to phone...")); 1184 setCaption( i18n("Writing to phone..."));
1185 if ( PhoneFormat::writeToPhone( cal ) ) 1185 if ( PhoneFormat::writeToPhone( cal ) )
1186 setCaption( i18n("Export to phone successful!")); 1186 setCaption( i18n("Export to phone successful!"));
1187 else 1187 else
1188 setCaption( i18n("Error exporting to phone!")); 1188 setCaption( i18n("Error exporting to phone!"));
1189 delete cal; 1189 delete cal;
1190} 1190}
1191 1191
1192 1192
1193void MainWindow::setDefaultPreferences() 1193void MainWindow::setDefaultPreferences()
1194{ 1194{
1195 KOPrefs *p = KOPrefs::instance(); 1195 KOPrefs *p = KOPrefs::instance();
1196 1196
1197 p->mCompactDialogs = true; 1197 p->mCompactDialogs = true;
1198 p->mConfirm = true; 1198 p->mConfirm = true;
1199 // p->mEnableQuickTodo = false; 1199 // p->mEnableQuickTodo = false;
1200 1200
1201} 1201}
1202 1202
1203QString MainWindow::resourcePath() 1203QString MainWindow::resourcePath()
1204{ 1204{
1205 return KGlobal::iconLoader()->iconPath(); 1205 return KGlobal::iconLoader()->iconPath();
1206} 1206}
1207 1207
1208void MainWindow::displayText( QString text ,QString cap ) 1208void MainWindow::displayText( QString text ,QString cap )
1209{ 1209{
1210 QDialog dia( this, "name", true ); ; 1210 QDialog dia( this, "name", true ); ;
1211 dia.setCaption( cap ); 1211 dia.setCaption( cap );
1212 QVBoxLayout* lay = new QVBoxLayout( &dia ); 1212 QVBoxLayout* lay = new QVBoxLayout( &dia );
1213 lay->setSpacing( 3 ); 1213 lay->setSpacing( 3 );
1214 lay->setMargin( 3 ); 1214 lay->setMargin( 3 );
1215 QTextBrowser tb ( &dia ); 1215 QTextBrowser tb ( &dia );
1216 lay->addWidget( &tb ); 1216 lay->addWidget( &tb );
1217 tb.setText( text ); 1217 tb.setText( text );
1218#ifdef DESKTOP_VERSION 1218#ifdef DESKTOP_VERSION
1219 dia.resize( 640, 480); 1219 dia.resize( 640, 480);
1220#else 1220#else
1221 dia.showMaximized(); 1221 dia.showMaximized();
1222#endif 1222#endif
1223 dia.exec(); 1223 dia.exec();
1224} 1224}
1225 1225
1226void MainWindow::features() 1226void MainWindow::features()
1227{ 1227{
1228 1228
1229 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" ); 1229 KApplication::showFile( i18n("KO/Pi Features and hints"), "kdepim/korganizer/featuresKOPI.txt" );
1230} 1230}
1231 1231
1232void MainWindow::usertrans() 1232void MainWindow::usertrans()
1233{ 1233{
1234 1234
1235 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" ); 1235 KApplication::showFile( i18n("KO/Pi User translation HowTo"), "kdepim/korganizer/usertranslationHOWTO.txt" );
1236} 1236}
1237 1237
1238void MainWindow::kdesynchowto() 1238void MainWindow::kdesynchowto()
1239{ 1239{
1240 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" ); 1240 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/Zaurus-KDE_syncHowTo.txt" );
1241} 1241}
1242void MainWindow::multisynchowto() 1242void MainWindow::multisynchowto()
1243{ 1243{
1244 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" ); 1244 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/MultiSyncHowTo.txt" );
1245} 1245}
1246void MainWindow::synchowto() 1246void MainWindow::synchowto()
1247{ 1247{
1248 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" ); 1248 KApplication::showFile( "KDE-Pim/Pi Synchronization HowTo", "kdepim/SyncHowto.txt" );
1249} 1249}
1250void MainWindow::faq() 1250void MainWindow::faq()
1251{ 1251{
1252 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" ); 1252 KApplication::showFile( i18n("KO/Pi FAQ"), "kdepim/korganizer/kopiFAQ.txt" );
1253 1253
1254} 1254}
1255void MainWindow::whatsNew() 1255void MainWindow::whatsNew()
1256{ 1256{
1257 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" ); 1257 KApplication::showFile( "KDE-Pim/Pi Version Info", "kdepim/WhatsNew.txt" );
1258 1258
1259} 1259}
1260void MainWindow::licence() 1260void MainWindow::licence()
1261{ 1261{
1262 KApplication::showLicence(); 1262 KApplication::showLicence();
1263 1263
1264} 1264}
1265void MainWindow::about() 1265void MainWindow::about()
1266{ 1266{
1267 QString version; 1267 QString version;
1268#include <../version> 1268#include <../version>
1269 QMessageBox::about( this, i18n("About KOrganizer/Pi"), 1269 QMessageBox::about( this, i18n("About KOrganizer/Pi"),
1270 i18n("KOrganizer/Platform-independent\n") + 1270 i18n("KOrganizer/Platform-independent\n") +
1271 "(KO/Pi) " + version + " - " + 1271 "(KO/Pi) " + version + " - " +
1272 1272
1273#ifdef DESKTOP_VERSION 1273#ifdef DESKTOP_VERSION
1274 i18n("Desktop Edition\n") + 1274 i18n("Desktop Edition\n") +
1275#else 1275#else
1276 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") + 1276 i18n("PDA-Edition\nfor: Zaurus 5x00/7x0/860/3000/6000\n") +
1277#endif 1277#endif
1278 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") ); 1278 i18n("(c)2004 Lutz Rogowski (rogowski@kde.org)\nKO/Pi is based on KOrganizer\n(c)2002,2003 Cornelius Schumacher\n(schumacher@kde.org) and the KDE team.\nKOrganizer/Pi is licensed under the GPL.\nKO/Pi can be compiled for\nLinux, Zaurus-PDA and Windows\nwww.pi-sync.info --- www.korganizer.org\nSpecial thanks to Michael and Ben\nfor intensive testing!") );
1279} 1279}
1280void MainWindow::keyBindings() 1280void MainWindow::keyBindings()
1281{ 1281{
1282 QString cap = i18n("KO/Pi Keys + Colors"); 1282 QString cap = i18n("KO/Pi Keys + Colors");
1283 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") + 1283 QString text = i18n("<p><h2>KO/Pi key shortcuts:</h2></p>\n") +
1284 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+ 1284 i18n("<p><b>H</b>: This help dialog | <b>S</b>: Search dialog</p>\n")+
1285 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") + 1285 i18n("<p><b>I</b>: Show info for selected event/todo</p>\n") +
1286 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+ 1286 i18n("<p><b>Space</b>: Toggle fullscreen | <b>P</b>: Date picker</p>\n")+
1287 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+ 1287 i18n("<p><b>F</b>: Toggle filterview |<b>F+ctrl</b>: Edit filter </p>\n")+
1288 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+ 1288 i18n("<p><b>O</b>: Filter On/Off | <b>J</b>: Journal view</p>\n")+
1289 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+ 1289 i18n("<p><b>1-0</b> (+<b>ctrl</b>): Select filter 1-10 (11-20)</p>\n")+
1290 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+ 1290 i18n("<p><b>N</b>: Next days view| <b>W</b>: What's next view\n ")+
1291 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+ 1291 i18n("<p><b>V</b>: Todo view | <b>L</b>: Event list view</p>\n")+
1292 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+ 1292 i18n("<p><b>Z,Y</b>: Work week view | <b>U</b>: Week view</p>\n")+
1293 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+ 1293 i18n("<p><b>D</b>: One day view | <b>M</b>: Month view</p>\n")+
1294 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+ 1294 i18n("<p><b>K</b>: Week view in Month view syle</p>\n")+
1295 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+ 1295 i18n("<p><b>E</b>: Edit selected item |<b> E+ctrl</b>: New Event</p>\n")+
1296 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+ 1296 i18n("<p><b>T</b>: Goto today | <b>T+ctrl</b>: New Todo</p>\n")+
1297 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+ 1297 i18n("<p><b>S+ctrl</b>: Add sub-todo | <b>X</b>: Toggle datenavigator</p>\n")+
1298 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+ 1298 i18n("<p><b>+,-</b> : Zoom in/out agenda | <b>A</b>: Toggle allday agenda height</p>\n")+
1299 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+ 1299 i18n("<p><b>C</b>: Show current time in agenda view</p>\n")+
1300 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+ 1300 i18n("<p><b>B</b>: Edit description (details) of selected item</p>\n")+
1301 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+ 1301 i18n("<p><b>right</b>: Next week | <b>right+ctrl</b>: Next month</p>\n")+
1302 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+ 1302 i18n("<p><b>left</b>: Prev. week | <b>left+ctrl</b>: Prev. month</p>\n")+
1303 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+ 1303 i18n("<p><b>del,backspace</b>: Delete selected item</p>\n")+
1304 i18n("<p><h3>In agenda view:</h3></p>\n") + 1304 i18n("<p><h3>In agenda view:</h3></p>\n") +
1305 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+ 1305 i18n("<p><b>up/down</b>: Scroll agenda view</p>\n")+
1306 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+ 1306 i18n("<p><b>ctrl+up/down</b>: Scroll small todo view</p>\n")+
1307 i18n("<p><h3>In todo view:</h3></p>\n") + 1307 i18n("<p><h3>In todo view:</h3></p>\n") +
1308 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+ 1308 i18n("<p><b>shift+U</b>: <b>U</b>nparent todo (make root todo)</p>\n")+
1309 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+ 1309 i18n("<p><b>shift+S</b>: Make <b>S</b>ubtodo (reparent todo)</p>\n")+
1310 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+ 1310 i18n("<p><b>shift+P</b>: Make new <b>P</b>arent for todo selected with shift+S</p>\n")+
1311 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+ 1311 i18n("<p><b>Q</b>: Toggle quick todo line edit.</p>\n")+
1312 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1312 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1313 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+ 1313 i18n("<p><b>return</b>: Mark item as completed+one step down.</p>\n")+
1314 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+ 1314 i18n("<p><b>return+shift</b>: Mark item as not completed+one step down</p>\n")+
1315 i18n("<p><h3>In list view:</h3></p>\n") + 1315 i18n("<p><h3>In list view:</h3></p>\n") +
1316 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+ 1316 i18n("<p><b>I</b>: Show info of current item+one step down.</p>\n")+
1317 i18n("<p><b>return</b>: Select item+one step down</p>\n")+ 1317 i18n("<p><b>return</b>: Select item+one step down</p>\n")+
1318 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+ 1318 i18n("<p><b>return+shift</b>: Deselect item+one step down</p>\n")+
1319 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+ 1319 i18n("<p><b>up/down</b>: Next/prev item</p>\n")+
1320 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+ 1320 i18n("<p><b>ctrl+up/down</b>: Goto up/down by 20% of items</p>\n")+
1321 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+ 1321 i18n("<p><b>shift+up/down</b>: Goto first/last item</p>\n")+
1322 i18n("<p><h3>In event/todo viewer:</h3></p>\n") + 1322 i18n("<p><h3>In event/todo viewer:</h3></p>\n") +
1323 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+ 1323 i18n("<p><b>I,C</b>: Close dialog.</p>\n")+
1324 i18n("<p><b>A</b>: Show agenda view.</p>\n")+ 1324 i18n("<p><b>A</b>: Show agenda view.</p>\n")+
1325 i18n("<p><b>E</b>: Edit item</p>\n") + 1325 i18n("<p><b>E</b>: Edit item</p>\n") +
1326 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") + 1326 i18n("<p><h2>KO/Pi icon colors:</h2></p>\n") +
1327 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") + 1327 i18n("<p><b>(for square icons in agenda and month view)</b></p>\n") +
1328 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+ 1328 i18n("<p><b>Cross</b>: Item cancelled.([c] in Whats'Next view)</p>\n")+
1329 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+ 1329 i18n("<p><b>Red</b>: Alarm set.([a] in Whats'Next view)</p>\n")+
1330 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+ 1330 i18n("<p><b>Blue</b>: Recurrent event.([r] in Whats'Next view)</p>\n")+
1331 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+ 1331 i18n("<p><b>Dark green</b>: Information(description) available.([i] in WN view)</p>\n")+
1332 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+ 1332 i18n("<p><b>Black</b>: Event/todo with attendees. You are the organizer!</p>\n")+
1333 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") + 1333 i18n("<p><b>Dark yellow</b>: Event/todo with attendees.</p>\n") +
1334 i18n("<p><b>White</b>: Item readonly</p>\n"); 1334 i18n("<p><b>White</b>: Item readonly</p>\n");
1335 displayText( text, cap); 1335 displayText( text, cap);
1336} 1336}
1337void MainWindow::aboutAutoSaving() 1337void MainWindow::aboutAutoSaving()
1338{ 1338{
1339 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n"); 1339 QString text = i18n("After changing something, the data is\nautomatically saved to the file\n~/kdepim/apps/korganizer/mycalendar.ics\nafter (configurable) three minutes.\nFor safety reasons there is one autosaving\nafter 10 minutes (of idle time) again. The \ndata is saved automatically when closing KO/Pi\nYou can create a backup file \nwith: File - Save Calendar Backup\n");
1340 1340
1341 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text); 1341 KApplication::showText( i18n("Auto Saving in KOrganizer/Pi"), text);
1342 1342
1343} 1343}
1344void MainWindow::aboutKnownBugs() 1344void MainWindow::aboutKnownBugs()
1345{ 1345{
1346 QMessageBox* msg; 1346 QMessageBox* msg;
1347 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"), 1347 msg = new QMessageBox( i18n("Known Problems in KOrganizer/Pi"),
1348 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+ 1348 i18n("1) Importing *.vcs or *.ics files from\nother applications may not work properly,\nif there are events with properties\nKO/Pi does not support.\n")+
1349 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+ 1349 i18n("2) Audio alarm daemon\nfor Zaurus is available!\nas an additional small application\n")+
1350 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") + 1350 i18n("\nPlease report unexpected behaviour to\nlutz@pi-sync.info\n") +
1351 i18n("\nor report them in the bugtracker on\n") + 1351 i18n("\nor report them in the bugtracker on\n") +
1352 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"), 1352 i18n("\nhttp://sourceforge.net/projects/kdepimpi\n"),
1353 QMessageBox::NoIcon, 1353 QMessageBox::NoIcon,
1354 QMessageBox::Ok, 1354 QMessageBox::Ok,
1355 QMessageBox::NoButton, 1355 QMessageBox::NoButton,
1356 QMessageBox::NoButton); 1356 QMessageBox::NoButton);
1357 msg->exec(); 1357 msg->exec();
1358 delete msg; 1358 delete msg;
1359 1359
1360} 1360}
1361 1361
1362QString MainWindow::defaultFileName() 1362QString MainWindow::defaultFileName()
1363{ 1363{
1364 return locateLocal( "data", "korganizer/mycalendar.ics" ); 1364 return locateLocal( "data", "korganizer/mycalendar.ics" );
1365} 1365}
1366QString MainWindow::syncFileName() 1366QString MainWindow::syncFileName()