summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 0956c78..bf98ad4 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1,895 +1,896 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 3
4 Requires the Qt and KDE widget libraries, available at no cost at 4 Requires the Qt and KDE widget libraries, available at no cost at
5 http://www.troll.no and http://www.kde.org respectively 5 http://www.troll.no and http://www.kde.org respectively
6 6
7 Copyright (c) 1997, 1998, 1999 7 Copyright (c) 1997, 1998, 1999
8 Preston Brown (preston.brown@yale.edu) 8 Preston Brown (preston.brown@yale.edu)
9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl) 9 Fester Zigterman (F.J.F.ZigtermanRustenburg@student.utwente.nl)
10 Ian Dawes (iadawes@globalserve.net) 10 Ian Dawes (iadawes@globalserve.net)
11 Laszlo Boloni (boloni@cs.purdue.edu) 11 Laszlo Boloni (boloni@cs.purdue.edu)
12 12
13 Copyright (c) 2000, 2001, 2002 13 Copyright (c) 2000, 2001, 2002
14 Cornelius Schumacher <schumacher@kde.org> 14 Cornelius Schumacher <schumacher@kde.org>
15 15
16 This program is free software; you can redistribute it and/or modify 16 This program is free software; you can redistribute it and/or modify
17 it under the terms of the GNU General Public License as published by 17 it under the terms of the GNU General Public License as published by
18 the Free Software Foundation; either version 2 of the License, or 18 the Free Software Foundation; either version 2 of the License, or
19 (at your option) any later version. 19 (at your option) any later version.
20 20
21 This program is distributed in the hope that it will be useful, 21 This program is distributed in the hope that it will be useful,
22 but WITHOUT ANY WARRANTY; without even the implied warranty of 22 but WITHOUT ANY WARRANTY; without even the implied warranty of
23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 23 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
24 GNU General Public License for more details. 24 GNU General Public License for more details.
25 25
26 You should have received a copy of the GNU General Public License 26 You should have received a copy of the GNU General Public License
27 along with this program; if not, write to the Free Software 27 along with this program; if not, write to the Free Software
28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 28 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29*/ 29*/
30 30
31#include <stdlib.h> 31#include <stdlib.h>
32 32
33#include <qapplication.h> 33#include <qapplication.h>
34#include <qradiobutton.h> 34#include <qradiobutton.h>
35#include <qbuttongroup.h> 35#include <qbuttongroup.h>
36#include <qlayout.h> 36#include <qlayout.h>
37#include <qclipboard.h> 37#include <qclipboard.h>
38#include <qcursor.h> 38#include <qcursor.h>
39#include <qmessagebox.h> 39#include <qmessagebox.h>
40#include <qprogressbar.h> 40#include <qprogressbar.h>
41#include <qmultilineedit.h> 41#include <qmultilineedit.h>
42#include <qtimer.h> 42#include <qtimer.h>
43#include <qwidgetstack.h> 43#include <qwidgetstack.h>
44#include <qptrlist.h> 44#include <qptrlist.h>
45#include <qregexp.h> 45#include <qregexp.h>
46#include <qgroupbox.h> 46#include <qgroupbox.h>
47#include <qfile.h> 47#include <qfile.h>
48#include <qdir.h> 48#include <qdir.h>
49#ifndef KORG_NOSPLITTER 49#ifndef KORG_NOSPLITTER
50#include <qsplitter.h> 50#include <qsplitter.h>
51#endif 51#endif
52 52
53#include <kglobal.h> 53#include <kglobal.h>
54#include <kdebug.h> 54#include <kdebug.h>
55#include <kstandarddirs.h> 55#include <kstandarddirs.h>
56#include <kfiledialog.h> 56#include <kfiledialog.h>
57#include <kmessagebox.h> 57#include <kmessagebox.h>
58#include <knotifyclient.h> 58#include <knotifyclient.h>
59#include <kconfig.h> 59#include <kconfig.h>
60 60
61#include "kosyncprefsdialog.h" 61#include "kosyncprefsdialog.h"
62#include <krun.h> 62#include <krun.h>
63#include <kdirwatch.h> 63#include <kdirwatch.h>
64#include <libkdepim/kdatepicker.h> 64#include <libkdepim/kdatepicker.h>
65#include <libkdepim/ksyncprofile.h> 65#include <libkdepim/ksyncprofile.h>
66 66
67#include <libkcal/vcaldrag.h> 67#include <libkcal/vcaldrag.h>
68#include <libkcal/icaldrag.h> 68#include <libkcal/icaldrag.h>
69#include <libkcal/icalformat.h> 69#include <libkcal/icalformat.h>
70#include <libkcal/vcalformat.h> 70#include <libkcal/vcalformat.h>
71#include <libkcal/scheduler.h> 71#include <libkcal/scheduler.h>
72#include <libkcal/calendarlocal.h> 72#include <libkcal/calendarlocal.h>
73#include <libkcal/journal.h> 73#include <libkcal/journal.h>
74#include <libkcal/calfilter.h> 74#include <libkcal/calfilter.h>
75#include <libkcal/attendee.h> 75#include <libkcal/attendee.h>
76#include <libkcal/dndfactory.h> 76#include <libkcal/dndfactory.h>
77#include <libkcal/freebusy.h> 77#include <libkcal/freebusy.h>
78#include <libkcal/filestorage.h> 78#include <libkcal/filestorage.h>
79#include <libkcal/calendarresources.h> 79#include <libkcal/calendarresources.h>
80#include <libkcal/qtopiaformat.h> 80#include <libkcal/qtopiaformat.h>
81#include "../kalarmd/alarmdialog.h" 81#include "../kalarmd/alarmdialog.h"
82 82
83#ifndef DESKTOP_VERSION 83#ifndef DESKTOP_VERSION
84#include <libkcal/sharpformat.h> 84#include <libkcal/sharpformat.h>
85#endif 85#endif
86#ifndef KORG_NOMAIL 86#ifndef KORG_NOMAIL
87#include "komailclient.h" 87#include "komailclient.h"
88#endif 88#endif
89#ifndef KORG_NOPRINTER 89#ifndef KORG_NOPRINTER
90#include "calprinter.h" 90#include "calprinter.h"
91#endif 91#endif
92#ifndef KORG_NOPLUGINS 92#ifndef KORG_NOPLUGINS
93#include "kocore.h" 93#include "kocore.h"
94#endif 94#endif
95#include "koeventeditor.h" 95#include "koeventeditor.h"
96#include "kotodoeditor.h" 96#include "kotodoeditor.h"
97#include "koprefs.h" 97#include "koprefs.h"
98#include "koeventviewerdialog.h" 98#include "koeventviewerdialog.h"
99#include "publishdialog.h" 99#include "publishdialog.h"
100#include "kofilterview.h" 100#include "kofilterview.h"
101#include "koglobals.h" 101#include "koglobals.h"
102#include "koviewmanager.h" 102#include "koviewmanager.h"
103#include "koagendaview.h" 103#include "koagendaview.h"
104#include "kodialogmanager.h" 104#include "kodialogmanager.h"
105#include "outgoingdialog.h" 105#include "outgoingdialog.h"
106#include "incomingdialog.h" 106#include "incomingdialog.h"
107#include "statusdialog.h" 107#include "statusdialog.h"
108#include "kdatenavigator.h" 108#include "kdatenavigator.h"
109#include "kotodoview.h" 109#include "kotodoview.h"
110#include "datenavigator.h" 110#include "datenavigator.h"
111#include "resourceview.h" 111#include "resourceview.h"
112#include "navigatorbar.h" 112#include "navigatorbar.h"
113#include "searchdialog.h" 113#include "searchdialog.h"
114#include "mainwindow.h" 114#include "mainwindow.h"
115 115
116#include "calendarview.h" 116#include "calendarview.h"
117#ifndef DESKTOP_VERSION 117#ifndef DESKTOP_VERSION
118#include <qtopia/alarmserver.h> 118#include <qtopia/alarmserver.h>
119#endif 119#endif
120#ifndef _WIN32_ 120#ifndef _WIN32_
121#include <stdlib.h> 121#include <stdlib.h>
122#include <stdio.h> 122#include <stdio.h>
123#include <unistd.h> 123#include <unistd.h>
124#else 124#else
125#include <qprocess.h> 125#include <qprocess.h>
126#endif 126#endif
127using namespace KOrg; 127using namespace KOrg;
128using namespace KCal;
128extern int globalFlagBlockAgenda; 129extern int globalFlagBlockAgenda;
129extern int globalFlagBlockStartup; 130extern int globalFlagBlockStartup;
130 131
131#define SYNC_MODE_NORMAL 0 132#define SYNC_MODE_NORMAL 0
132#define SYNC_MODE_SHARP 1 133#define SYNC_MODE_SHARP 1
133#define SYNC_MODE_QTOPIA 2 134#define SYNC_MODE_QTOPIA 2
134 135
135class KOBeamPrefs : public QDialog 136class KOBeamPrefs : public QDialog
136{ 137{
137 public: 138 public:
138 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) : 139 KOBeamPrefs( QWidget *parent=0, const char *name=0 ) :
139 QDialog( parent, name, true ) 140 QDialog( parent, name, true )
140 { 141 {
141 setCaption( i18n("Beam Options") ); 142 setCaption( i18n("Beam Options") );
142 QVBoxLayout* lay = new QVBoxLayout( this ); 143 QVBoxLayout* lay = new QVBoxLayout( this );
143 lay->setSpacing( 3 ); 144 lay->setSpacing( 3 );
144 lay->setMargin( 3 ); 145 lay->setMargin( 3 );
145 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this ); 146 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("File format"), this );
146 lay->addWidget( format ); 147 lay->addWidget( format );
147 format->setExclusive ( true ) ; 148 format->setExclusive ( true ) ;
148 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 149 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
149 lay->addWidget( time ); time->setExclusive ( true ) ; 150 lay->addWidget( time ); time->setExclusive ( true ) ;
150 vcal = new QRadioButton(" vCalendar ", format ); 151 vcal = new QRadioButton(" vCalendar ", format );
151 ical = new QRadioButton(" iCalendar ", format ); 152 ical = new QRadioButton(" iCalendar ", format );
152 vcal->setChecked( true ); 153 vcal->setChecked( true );
153 tz = new QRadioButton(i18n(" With timezone "), time ); 154 tz = new QRadioButton(i18n(" With timezone "), time );
154 local = new QRadioButton(i18n(" Local time "), time ); 155 local = new QRadioButton(i18n(" Local time "), time );
155 tz->setChecked( true ); 156 tz->setChecked( true );
156 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 157 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
157 lay->addWidget( ok ); 158 lay->addWidget( ok );
158 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 159 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
159 lay->addWidget( cancel ); 160 lay->addWidget( cancel );
160 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 161 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
161 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 162 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
162 resize( 200, 200 ); 163 resize( 200, 200 );
163 } 164 }
164 165
165 bool beamVcal() { return vcal->isChecked(); } 166 bool beamVcal() { return vcal->isChecked(); }
166 bool beamLocal() { return local->isChecked(); } 167 bool beamLocal() { return local->isChecked(); }
167private: 168private:
168 QRadioButton* vcal, *ical, *local, *tz; 169 QRadioButton* vcal, *ical, *local, *tz;
169}; 170};
170class KOCatPrefs : public QDialog 171class KOCatPrefs : public QDialog
171{ 172{
172 public: 173 public:
173 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 174 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
174 QDialog( parent, name, true ) 175 QDialog( parent, name, true )
175 { 176 {
176 setCaption( i18n("Manage new Categories") ); 177 setCaption( i18n("Manage new Categories") );
177 QVBoxLayout* lay = new QVBoxLayout( this ); 178 QVBoxLayout* lay = new QVBoxLayout( this );
178 lay->setSpacing( 3 ); 179 lay->setSpacing( 3 );
179 lay->setMargin( 3 ); 180 lay->setMargin( 3 );
180 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 181 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
181 lay->addWidget( lab ); 182 lay->addWidget( lab );
182 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 183 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
183 lay->addWidget( format ); 184 lay->addWidget( format );
184 format->setExclusive ( true ) ; 185 format->setExclusive ( true ) ;
185 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 186 addCatBut = new QRadioButton(i18n("Add to category list"), format );
186 new QRadioButton(i18n("Remove from Events/Todos"), format ); 187 new QRadioButton(i18n("Remove from Events/Todos"), format );
187 addCatBut->setChecked( true ); 188 addCatBut->setChecked( true );
188 QPushButton * ok = new QPushButton( i18n("OK"), this ); 189 QPushButton * ok = new QPushButton( i18n("OK"), this );
189 lay->addWidget( ok ); 190 lay->addWidget( ok );
190 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 191 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
191 lay->addWidget( cancel ); 192 lay->addWidget( cancel );
192 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 193 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
193 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 194 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
194 resize( 200, 200 ); 195 resize( 200, 200 );
195 } 196 }
196 197
197 bool addCat() { return addCatBut->isChecked(); } 198 bool addCat() { return addCatBut->isChecked(); }
198private: 199private:
199 QRadioButton* addCatBut; 200 QRadioButton* addCatBut;
200}; 201};
201 202
202 203
203 204
204CalendarView::CalendarView( CalendarResources *calendar, 205CalendarView::CalendarView( CalendarResources *calendar,
205 QWidget *parent, const char *name ) 206 QWidget *parent, const char *name )
206 : CalendarViewBase( parent, name ), 207 : CalendarViewBase( parent, name ),
207 mCalendar( calendar ), 208 mCalendar( calendar ),
208 mResourceManager( calendar->resourceManager() ) 209 mResourceManager( calendar->resourceManager() )
209{ 210{
210 211
211 mEventEditor = 0; 212 mEventEditor = 0;
212 mTodoEditor = 0; 213 mTodoEditor = 0;
213 214
214 init(); 215 init();
215} 216}
216 217
217CalendarView::CalendarView( Calendar *calendar, 218CalendarView::CalendarView( Calendar *calendar,
218 QWidget *parent, const char *name ) 219 QWidget *parent, const char *name )
219 : CalendarViewBase( parent, name ), 220 : CalendarViewBase( parent, name ),
220 mCalendar( calendar ), 221 mCalendar( calendar ),
221 mResourceManager( 0 ) 222 mResourceManager( 0 )
222{ 223{
223 224
224 mEventEditor = 0; 225 mEventEditor = 0;
225 mTodoEditor = 0; 226 mTodoEditor = 0;
226 init();} 227 init();}
227 228
228void CalendarView::init() 229void CalendarView::init()
229{ 230{
230 beamDialog = new KOBeamPrefs(); 231 beamDialog = new KOBeamPrefs();
231 mDatePickerMode = 0; 232 mDatePickerMode = 0;
232 mCurrentSyncDevice = ""; 233 mCurrentSyncDevice = "";
233 writeLocale(); 234 writeLocale();
234 mViewManager = new KOViewManager( this ); 235 mViewManager = new KOViewManager( this );
235 mDialogManager = new KODialogManager( this ); 236 mDialogManager = new KODialogManager( this );
236 mEventViewerDialog = 0; 237 mEventViewerDialog = 0;
237 mModified = false; 238 mModified = false;
238 mReadOnly = false; 239 mReadOnly = false;
239 mSelectedIncidence = 0; 240 mSelectedIncidence = 0;
240 mSyncProfiles.setAutoDelete(true); 241 mSyncProfiles.setAutoDelete(true);
241 mCalPrinter = 0; 242 mCalPrinter = 0;
242 mFilters.setAutoDelete(true); 243 mFilters.setAutoDelete(true);
243 244
244 mCalendar->registerObserver( this ); 245 mCalendar->registerObserver( this );
245 // TODO: Make sure that view is updated, when calendar is changed. 246 // TODO: Make sure that view is updated, when calendar is changed.
246 247
247 mStorage = new FileStorage( mCalendar ); 248 mStorage = new FileStorage( mCalendar );
248 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 249 mNavigator = new DateNavigator( this, "datevav", mViewManager );
249 250
250 QBoxLayout *topLayout = (QBoxLayout*)layout(); 251 QBoxLayout *topLayout = (QBoxLayout*)layout();
251#ifndef KORG_NOSPLITTER 252#ifndef KORG_NOSPLITTER
252 // create the main layout frames. 253 // create the main layout frames.
253 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 254 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
254 topLayout->addWidget(mPanner); 255 topLayout->addWidget(mPanner);
255 256
256 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 257 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
257 "CalendarView::LeftFrame"); 258 "CalendarView::LeftFrame");
258 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 259 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
259 260
260 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, 261 mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE,
261 "CalendarView::DateNavigator", QDate::currentDate() ); 262 "CalendarView::DateNavigator", QDate::currentDate() );
262 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 263 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
263 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 264 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
264 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 265 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
265 266
266#ifdef KORG_NORESOURCEVIEW 267#ifdef KORG_NORESOURCEVIEW
267 mResourceView = 0; 268 mResourceView = 0;
268#else 269#else
269 if ( mResourceManager ) { 270 if ( mResourceManager ) {
270 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 271 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
271 mResourceView->updateView(); 272 mResourceView->updateView();
272 connect( mResourceView, SIGNAL( resourcesChanged() ), 273 connect( mResourceView, SIGNAL( resourcesChanged() ),
273 SLOT( updateView() ) ); 274 SLOT( updateView() ) );
274 } else { 275 } else {
275 mResourceView = 0; 276 mResourceView = 0;
276 } 277 }
277#endif 278#endif
278 QWidget *rightBox = new QWidget( mPanner ); 279 QWidget *rightBox = new QWidget( mPanner );
279 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 280 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
280 281
281 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 282 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
282 rightLayout->addWidget( mNavigatorBar ); 283 rightLayout->addWidget( mNavigatorBar );
283 284
284 mRightFrame = new QWidgetStack( rightBox ); 285 mRightFrame = new QWidgetStack( rightBox );
285 rightLayout->addWidget( mRightFrame, 1 ); 286 rightLayout->addWidget( mRightFrame, 1 );
286 287
287 mLeftFrame = mLeftSplitter; 288 mLeftFrame = mLeftSplitter;
288#else 289#else
289 QWidget *mainBox = new QWidget( this ); 290 QWidget *mainBox = new QWidget( this );
290 QWidget *leftFrame = new QWidget( mainBox ); 291 QWidget *leftFrame = new QWidget( mainBox );
291 292
292 QBoxLayout * mainBoxLayout; 293 QBoxLayout * mainBoxLayout;
293 QBoxLayout * leftFrameLayout; 294 QBoxLayout * leftFrameLayout;
294 if ( KOPrefs::instance()->mVerticalScreen ) { 295 if ( KOPrefs::instance()->mVerticalScreen ) {
295 mainBoxLayout = new QVBoxLayout(mainBox); 296 mainBoxLayout = new QVBoxLayout(mainBox);
296 leftFrameLayout = new QHBoxLayout(leftFrame ); 297 leftFrameLayout = new QHBoxLayout(leftFrame );
297 } else { 298 } else {
298 mainBoxLayout = new QHBoxLayout(mainBox); 299 mainBoxLayout = new QHBoxLayout(mainBox);
299 leftFrameLayout = new QVBoxLayout(leftFrame ); 300 leftFrameLayout = new QVBoxLayout(leftFrame );
300 } 301 }
301 topLayout->addWidget( mainBox ); 302 topLayout->addWidget( mainBox );
302 mainBoxLayout->addWidget (leftFrame); 303 mainBoxLayout->addWidget (leftFrame);
303 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, 304 mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE,
304 "CalendarView::DateNavigator", QDate::currentDate()); 305 "CalendarView::DateNavigator", QDate::currentDate());
305 // mDateNavigator->blockSignals( true ); 306 // mDateNavigator->blockSignals( true );
306 leftFrameLayout->addWidget( mDateNavigator ); 307 leftFrameLayout->addWidget( mDateNavigator );
307 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); 308 mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView");
308 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolist"); 309 mTodoList = new KOTodoView(mCalendar, leftFrame, "todolist");
309 310
310 if ( QApplication::desktop()->width() < 480 ) { 311 if ( QApplication::desktop()->width() < 480 ) {
311 leftFrameLayout->addWidget(mFilterView); 312 leftFrameLayout->addWidget(mFilterView);
312 leftFrameLayout->addWidget(mTodoList, 2 ); 313 leftFrameLayout->addWidget(mTodoList, 2 );
313 314
314 } else { 315 } else {
315 leftFrameLayout->addWidget(mTodoList,2 ); 316 leftFrameLayout->addWidget(mTodoList,2 );
316 leftFrameLayout->addWidget(mFilterView ); 317 leftFrameLayout->addWidget(mFilterView );
317 } 318 }
318 mFilterView->hide(); 319 mFilterView->hide();
319 QWidget *rightBox = new QWidget( mainBox ); 320 QWidget *rightBox = new QWidget( mainBox );
320 mainBoxLayout->addWidget ( rightBox, 10 ); 321 mainBoxLayout->addWidget ( rightBox, 10 );
321 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 322 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
322 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); 323 mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" );
323 mRightFrame = new QWidgetStack( rightBox ); 324 mRightFrame = new QWidgetStack( rightBox );
324 rightLayout->addWidget( mNavigatorBar ); 325 rightLayout->addWidget( mNavigatorBar );
325 rightLayout->addWidget( mRightFrame, 10 ); 326 rightLayout->addWidget( mRightFrame, 10 );
326 327
327 mLeftFrame = leftFrame; 328 mLeftFrame = leftFrame;
328 if ( KOPrefs::instance()->mVerticalScreen ) { 329 if ( KOPrefs::instance()->mVerticalScreen ) {
329 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 330 mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
330 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 331 leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
331 } else { 332 } else {
332 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 333 mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
333 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 334 leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
334 } 335 }
335 336
336 //qDebug("Calendarview Size %d %d ", width(), height()); 337 //qDebug("Calendarview Size %d %d ", width(), height());
337#endif 338#endif
338 339
339 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 340 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
340 SLOT( showDates( const KCal::DateList & ) ) ); 341 SLOT( showDates( const KCal::DateList & ) ) );
341 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 342 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
342 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 343 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
343 344
344 connect( mNavigatorBar, SIGNAL( goPrevYear() ), 345 connect( mNavigatorBar, SIGNAL( goPrevYear() ),
345 mNavigator, SLOT( selectPreviousYear() ) ); 346 mNavigator, SLOT( selectPreviousYear() ) );
346 connect( mNavigatorBar, SIGNAL( goNextYear() ), 347 connect( mNavigatorBar, SIGNAL( goNextYear() ),
347 mNavigator, SLOT( selectNextYear() ) ); 348 mNavigator, SLOT( selectNextYear() ) );
348 connect( mNavigatorBar, SIGNAL( goPrevMonth() ), 349 connect( mNavigatorBar, SIGNAL( goPrevMonth() ),
349 mNavigator, SLOT( selectPreviousMonth() ) ); 350 mNavigator, SLOT( selectPreviousMonth() ) );
350 connect( mNavigatorBar, SIGNAL( goNextMonth() ), 351 connect( mNavigatorBar, SIGNAL( goNextMonth() ),
351 mNavigator, SLOT( selectNextMonth() ) ); 352 mNavigator, SLOT( selectNextMonth() ) );
352 353
353 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 354 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
354 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); 355 mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) );
355 356
356 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 357 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
357 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 358 mNavigator, SLOT( selectWeek( const QDate & ) ) );
358 359
359 connect( mDateNavigator, SIGNAL( goPrevYear() ), 360 connect( mDateNavigator, SIGNAL( goPrevYear() ),
360 mNavigator, SLOT( selectPreviousYear() ) ); 361 mNavigator, SLOT( selectPreviousYear() ) );
361 connect( mDateNavigator, SIGNAL( goNextYear() ), 362 connect( mDateNavigator, SIGNAL( goNextYear() ),
362 mNavigator, SLOT( selectNextYear() ) ); 363 mNavigator, SLOT( selectNextYear() ) );
363 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 364 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
364 mNavigator, SLOT( selectPreviousMonth() ) ); 365 mNavigator, SLOT( selectPreviousMonth() ) );
365 connect( mDateNavigator, SIGNAL( goNextMonth() ), 366 connect( mDateNavigator, SIGNAL( goNextMonth() ),
366 mNavigator, SLOT( selectNextMonth() ) ); 367 mNavigator, SLOT( selectNextMonth() ) );
367 368
368 connect( mDateNavigator, SIGNAL( goPrevious() ), 369 connect( mDateNavigator, SIGNAL( goPrevious() ),
369 mNavigator, SLOT( selectPrevious() ) ); 370 mNavigator, SLOT( selectPrevious() ) );
370 connect( mDateNavigator, SIGNAL( goNext() ), 371 connect( mDateNavigator, SIGNAL( goNext() ),
371 mNavigator, SLOT( selectNext() ) ); 372 mNavigator, SLOT( selectNext() ) );
372 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 373 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
373 mNavigator, SLOT( slotMonthSelect( int ) ) ); 374 mNavigator, SLOT( slotMonthSelect( int ) ) );
374 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), 375 connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ),
375 mNavigator, SLOT( slotMonthSelect( int ) ) ); 376 mNavigator, SLOT( slotMonthSelect( int ) ) );
376 377
377 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 378 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
378 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 379 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
379 380
380 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), 381 connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ),
381 SLOT( eventAdded( Event *) ) ); 382 SLOT( eventAdded( Event *) ) );
382 383
383 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 384 connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
384 385
385 connect( this, SIGNAL( configChanged() ), 386 connect( this, SIGNAL( configChanged() ),
386 mDateNavigator, SLOT( updateConfig() ) ); 387 mDateNavigator, SLOT( updateConfig() ) );
387 388
388 connect( mTodoList, SIGNAL( newTodoSignal() ), 389 connect( mTodoList, SIGNAL( newTodoSignal() ),
389 SLOT( newTodo() ) ); 390 SLOT( newTodo() ) );
390 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 391 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
391 SLOT( newSubTodo( Todo * ) ) ); 392 SLOT( newSubTodo( Todo * ) ) );
392 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 393 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
393 SLOT( editTodo( Todo * ) ) ); 394 SLOT( editTodo( Todo * ) ) );
394 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 395 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
395 SLOT( showTodo( Todo *) ) ); 396 SLOT( showTodo( Todo *) ) );
396 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 397 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
397 SLOT( deleteTodo( Todo *) ) ); 398 SLOT( deleteTodo( Todo *) ) );
398 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 399 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
399 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 400 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
400 SLOT( purgeCompleted() ) ); 401 SLOT( purgeCompleted() ) );
401 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 402 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
402 SIGNAL( todoModified( Todo *, int ) ) ); 403 SIGNAL( todoModified( Todo *, int ) ) );
403 404
404 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 405 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
405 this, SLOT ( cloneIncidence( Incidence * ) ) ); 406 this, SLOT ( cloneIncidence( Incidence * ) ) );
406 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 407 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
407 this, SLOT (cancelIncidence( Incidence * ) ) ); 408 this, SLOT (cancelIncidence( Incidence * ) ) );
408 409
409 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 410 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
410 this, SLOT ( moveIncidence( Incidence * ) ) ); 411 this, SLOT ( moveIncidence( Incidence * ) ) );
411 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 412 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
412 this, SLOT ( beamIncidence( Incidence * ) ) ); 413 this, SLOT ( beamIncidence( Incidence * ) ) );
413 414
414 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 415 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
415 this, SLOT ( todo_unsub( Todo * ) ) ); 416 this, SLOT ( todo_unsub( Todo * ) ) );
416 417
417 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 418 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
418 SLOT( updateTodo( Todo *, int ) ) ); 419 SLOT( updateTodo( Todo *, int ) ) );
419 connect( this, SIGNAL( todoModified( Todo *, int )), this, 420 connect( this, SIGNAL( todoModified( Todo *, int )), this,
420 SLOT( changeTodoDisplay( Todo *, int ) ) ); 421 SLOT( changeTodoDisplay( Todo *, int ) ) );
421 422
422 423
423 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 424 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
424 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 425 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
425 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 426 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
426 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 427 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
427 428
428 429
429 430
430 431
431 432
432 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 433 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
433 SLOT(checkClipboard())); 434 SLOT(checkClipboard()));
434 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 435 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
435 SLOT( processTodoListSelection( Incidence * ) ) ); 436 SLOT( processTodoListSelection( Incidence * ) ) );
436 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 437 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
437 438
438 // kdDebug() << "CalendarView::CalendarView() done" << endl; 439 // kdDebug() << "CalendarView::CalendarView() done" << endl;
439 440
440 mDateFrame = new QVBox(0,0,WType_Popup); 441 mDateFrame = new QVBox(0,0,WType_Popup);
441 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 442 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
442 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 443 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
443 mDateFrame->setLineWidth(3); 444 mDateFrame->setLineWidth(3);
444 mDateFrame->hide(); 445 mDateFrame->hide();
445 mDateFrame->setCaption( i18n( "Pick a date to display")); 446 mDateFrame->setCaption( i18n( "Pick a date to display"));
446 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 447 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
447 448
448 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 449 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
449 450
450 mEventEditor = mDialogManager->getEventEditor(); 451 mEventEditor = mDialogManager->getEventEditor();
451 mTodoEditor = mDialogManager->getTodoEditor(); 452 mTodoEditor = mDialogManager->getTodoEditor();
452 453
453 mFlagEditDescription = false; 454 mFlagEditDescription = false;
454 455
455 mSuspendTimer = new QTimer( this ); 456 mSuspendTimer = new QTimer( this );
456 mAlarmTimer = new QTimer( this ); 457 mAlarmTimer = new QTimer( this );
457 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 458 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
458 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 459 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
459 mAlarmDialog = new AlarmDialog( this ); 460 mAlarmDialog = new AlarmDialog( this );
460 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 461 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
461 mAlarmDialog->setServerNotification( false ); 462 mAlarmDialog->setServerNotification( false );
462 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 463 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
463} 464}
464 465
465 466
466CalendarView::~CalendarView() 467CalendarView::~CalendarView()
467{ 468{
468 // kdDebug() << "~CalendarView()" << endl; 469 // kdDebug() << "~CalendarView()" << endl;
469 //qDebug("CalendarView::~CalendarView() "); 470 //qDebug("CalendarView::~CalendarView() ");
470 delete mDialogManager; 471 delete mDialogManager;
471 delete mViewManager; 472 delete mViewManager;
472 delete mStorage; 473 delete mStorage;
473 delete mDateFrame ; 474 delete mDateFrame ;
474 delete beamDialog; 475 delete beamDialog;
475 //kdDebug() << "~CalendarView() done" << endl; 476 //kdDebug() << "~CalendarView() done" << endl;
476} 477}
477void CalendarView::timerAlarm() 478void CalendarView::timerAlarm()
478{ 479{
479 //qDebug("CalendarView::timerAlarm() "); 480 //qDebug("CalendarView::timerAlarm() ");
480 computeAlarm(mAlarmNotification ); 481 computeAlarm(mAlarmNotification );
481} 482}
482 483
483void CalendarView::suspendAlarm() 484void CalendarView::suspendAlarm()
484{ 485{
485 //qDebug(" CalendarView::suspendAlarm() "); 486 //qDebug(" CalendarView::suspendAlarm() ");
486 computeAlarm(mSuspendAlarmNotification ); 487 computeAlarm(mSuspendAlarmNotification );
487 488
488} 489}
489 490
490void CalendarView::startAlarm( QString mess , QString filename) 491void CalendarView::startAlarm( QString mess , QString filename)
491{ 492{
492 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 493 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
493 494
494} 495}
495 496
496 497
497void CalendarView::computeAlarm( QString msg ) 498void CalendarView::computeAlarm( QString msg )
498{ 499{
499 500
500 QString mess = msg; 501 QString mess = msg;
501 QString mAlarmMessage = mess.mid( 9 ); 502 QString mAlarmMessage = mess.mid( 9 );
502 QString filename = MainWindow::resourcePath(); 503 QString filename = MainWindow::resourcePath();
503 filename += "koalarm.wav"; 504 filename += "koalarm.wav";
504 QString tempfilename; 505 QString tempfilename;
505 if ( mess.left( 13 ) == "suspend_alarm") { 506 if ( mess.left( 13 ) == "suspend_alarm") {
506 bool error = false; 507 bool error = false;
507 int len = mess.mid( 13 ).find("+++"); 508 int len = mess.mid( 13 ).find("+++");
508 if ( len < 2 ) 509 if ( len < 2 )
509 error = true; 510 error = true;
510 else { 511 else {
511 tempfilename = mess.mid( 13, len ); 512 tempfilename = mess.mid( 13, len );
512 if ( !QFile::exists( tempfilename ) ) 513 if ( !QFile::exists( tempfilename ) )
513 error = true; 514 error = true;
514 } 515 }
515 if ( ! error ) { 516 if ( ! error ) {
516 filename = tempfilename; 517 filename = tempfilename;
517 } 518 }
518 mAlarmMessage = mess.mid( 13+len+3 ); 519 mAlarmMessage = mess.mid( 13+len+3 );
519 //qDebug("suspend file %s ",tempfilename.latin1() ); 520 //qDebug("suspend file %s ",tempfilename.latin1() );
520 startAlarm( mAlarmMessage, filename); 521 startAlarm( mAlarmMessage, filename);
521 return; 522 return;
522 } 523 }
523 if ( mess.left( 11 ) == "timer_alarm") { 524 if ( mess.left( 11 ) == "timer_alarm") {
524 //mTimerTime = 0; 525 //mTimerTime = 0;
525 startAlarm( mess.mid( 11 ), filename ); 526 startAlarm( mess.mid( 11 ), filename );
526 return; 527 return;
527 } 528 }
528 if ( mess.left( 10 ) == "proc_alarm") { 529 if ( mess.left( 10 ) == "proc_alarm") {
529 bool error = false; 530 bool error = false;
530 int len = mess.mid( 10 ).find("+++"); 531 int len = mess.mid( 10 ).find("+++");
531 if ( len < 2 ) 532 if ( len < 2 )
532 error = true; 533 error = true;
533 else { 534 else {
534 tempfilename = mess.mid( 10, len ); 535 tempfilename = mess.mid( 10, len );
535 if ( !QFile::exists( tempfilename ) ) 536 if ( !QFile::exists( tempfilename ) )
536 error = true; 537 error = true;
537 } 538 }
538 if ( error ) { 539 if ( error ) {
539 mAlarmMessage = "Procedure Alarm\nError - File not found\n"; 540 mAlarmMessage = "Procedure Alarm\nError - File not found\n";
540 mAlarmMessage += mess.mid( 10+len+3+9 ); 541 mAlarmMessage += mess.mid( 10+len+3+9 );
541 } else { 542 } else {
542 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent"); 543 //QCopEnvelope e("QPE/Application/kopi", "-writeFileSilent");
543 //qDebug("-----system command %s ",tempfilename.latin1() ); 544 //qDebug("-----system command %s ",tempfilename.latin1() );
544#ifndef _WIN32_ 545#ifndef _WIN32_
545 if ( vfork () == 0 ) { 546 if ( vfork () == 0 ) {
546 execl ( tempfilename.latin1(), 0 ); 547 execl ( tempfilename.latin1(), 0 );
547 return; 548 return;
548 } 549 }
549#else 550#else
550 QProcess* p = new QProcess(); 551 QProcess* p = new QProcess();
551 p->addArgument( tempfilename.latin1() ); 552 p->addArgument( tempfilename.latin1() );
552 p->start(); 553 p->start();
553 return; 554 return;
554#endif 555#endif
555 556
556 return; 557 return;
557 } 558 }
558 559
559 //qDebug("+++++++system command %s ",tempfilename.latin1() ); 560 //qDebug("+++++++system command %s ",tempfilename.latin1() );
560 } 561 }
561 if ( mess.left( 11 ) == "audio_alarm") { 562 if ( mess.left( 11 ) == "audio_alarm") {
562 bool error = false; 563 bool error = false;
563 int len = mess.mid( 11 ).find("+++"); 564 int len = mess.mid( 11 ).find("+++");
564 if ( len < 2 ) 565 if ( len < 2 )
565 error = true; 566 error = true;
566 else { 567 else {
567 tempfilename = mess.mid( 11, len ); 568 tempfilename = mess.mid( 11, len );
568 if ( !QFile::exists( tempfilename ) ) 569 if ( !QFile::exists( tempfilename ) )
569 error = true; 570 error = true;
570 } 571 }
571 if ( ! error ) { 572 if ( ! error ) {
572 filename = tempfilename; 573 filename = tempfilename;
573 } 574 }
574 mAlarmMessage = mess.mid( 11+len+3+9 ); 575 mAlarmMessage = mess.mid( 11+len+3+9 );
575 //qDebug("audio file command %s ",tempfilename.latin1() ); 576 //qDebug("audio file command %s ",tempfilename.latin1() );
576 } 577 }
577 if ( mess.left( 9 ) == "cal_alarm") { 578 if ( mess.left( 9 ) == "cal_alarm") {
578 mAlarmMessage = mess.mid( 9 ) ; 579 mAlarmMessage = mess.mid( 9 ) ;
579 } 580 }
580 581
581 startAlarm( mAlarmMessage, filename ); 582 startAlarm( mAlarmMessage, filename );
582 583
583 584
584} 585}
585 586
586void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti ) 587void CalendarView::addSuspendAlarm(const QDateTime &qdt, const QString &noti )
587{ 588{
588 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 589 //qDebug("+++++addSUSPENDAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
589 590
590 mSuspendAlarmNotification = noti; 591 mSuspendAlarmNotification = noti;
591 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 592 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
592 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000); 593 //qDebug("Suspend Alarm timer started with secs: %d ", ms/1000);
593 mSuspendTimer->start( ms , true ); 594 mSuspendTimer->start( ms , true );
594 595
595} 596}
596 597
597void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti ) 598void CalendarView::addAlarm(const QDateTime &qdt, const QString &noti )
598{ 599{
599 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 600 //qDebug("+++++addAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
600 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 601 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
601#ifndef DESKTOP_VERSION 602#ifndef DESKTOP_VERSION
602 AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() ); 603 AlarmServer::addAlarm ( qdt,"koalarm", noti.latin1() );
603#endif 604#endif
604 return; 605 return;
605 } 606 }
606 mAlarmNotification = noti; 607 mAlarmNotification = noti;
607 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000; 608 int ms = QDateTime::currentDateTime().secsTo( qdt )*1000;
608 //qDebug("Alarm timer started with secs: %d ", ms/1000); 609 //qDebug("Alarm timer started with secs: %d ", ms/1000);
609 mAlarmTimer->start( ms , true ); 610 mAlarmTimer->start( ms , true );
610 611
611} 612}
612void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti ) 613void CalendarView::removeAlarm(const QDateTime &qdt, const QString &noti )
613{ 614{
614 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() ); 615 //qDebug("-----removeAlarm %s %s ", qdt.toString().latin1() , noti.latin1() );
615 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) { 616 if ( ! KOPrefs::instance()->mUseInternalAlarmNotification ) {
616#ifndef DESKTOP_VERSION 617#ifndef DESKTOP_VERSION
617 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() ); 618 AlarmServer::deleteAlarm (qdt ,"koalarm" ,noti.latin1() );
618#endif 619#endif
619 return; 620 return;
620 } 621 }
621 mAlarmTimer->stop(); 622 mAlarmTimer->stop();
622} 623}
623void CalendarView::selectWeekNum ( int num ) 624void CalendarView::selectWeekNum ( int num )
624{ 625{
625 dateNavigator()->selectWeek( num ); 626 dateNavigator()->selectWeek( num );
626 mViewManager->showWeekView(); 627 mViewManager->showWeekView();
627} 628}
628KOViewManager *CalendarView::viewManager() 629KOViewManager *CalendarView::viewManager()
629{ 630{
630 return mViewManager; 631 return mViewManager;
631} 632}
632 633
633KODialogManager *CalendarView::dialogManager() 634KODialogManager *CalendarView::dialogManager()
634{ 635{
635 return mDialogManager; 636 return mDialogManager;
636} 637}
637 638
638QDate CalendarView::startDate() 639QDate CalendarView::startDate()
639{ 640{
640 DateList dates = mNavigator->selectedDates(); 641 DateList dates = mNavigator->selectedDates();
641 642
642 return dates.first(); 643 return dates.first();
643} 644}
644 645
645QDate CalendarView::endDate() 646QDate CalendarView::endDate()
646{ 647{
647 DateList dates = mNavigator->selectedDates(); 648 DateList dates = mNavigator->selectedDates();
648 649
649 return dates.last(); 650 return dates.last();
650} 651}
651 652
652 653
653void CalendarView::createPrinter() 654void CalendarView::createPrinter()
654{ 655{
655#ifndef KORG_NOPRINTER 656#ifndef KORG_NOPRINTER
656 if (!mCalPrinter) { 657 if (!mCalPrinter) {
657 mCalPrinter = new CalPrinter(this, mCalendar); 658 mCalPrinter = new CalPrinter(this, mCalendar);
658 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig())); 659 connect(this, SIGNAL(configChanged()), mCalPrinter, SLOT(updateConfig()));
659 } 660 }
660#endif 661#endif
661} 662}
662 663
663void CalendarView::confSync() 664void CalendarView::confSync()
664{ 665{
665 static KOSyncPrefsDialog* sp = 0; 666 static KOSyncPrefsDialog* sp = 0;
666 if ( ! sp ) { 667 if ( ! sp ) {
667 sp = new KOSyncPrefsDialog( this, "syncprefs", true ); 668 sp = new KOSyncPrefsDialog( this, "syncprefs", true );
668 } 669 }
669 sp->usrReadConfig(); 670 sp->usrReadConfig();
670#ifndef DESKTOP_VERSION 671#ifndef DESKTOP_VERSION
671 sp->showMaximized(); 672 sp->showMaximized();
672#else 673#else
673 sp->show(); 674 sp->show();
674#endif 675#endif
675 sp->exec(); 676 sp->exec();
676 677
677} 678}
678 679
679 680
680//KOPrefs::instance()->mWriteBackFile 681//KOPrefs::instance()->mWriteBackFile
681//KOPrefs::instance()->mWriteBackExistingOnly 682//KOPrefs::instance()->mWriteBackExistingOnly
682 683
683// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict")); 684// 0 syncPrefsGroup->addRadio(i18n("Take local entry on conflict"));
684// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict")); 685// 1 syncPrefsGroup->addRadio(i18n("Take remote entry on conflict"));
685// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict")); 686// 2 syncPrefsGroup->addRadio(i18n("Take newest entry on conflict"));
686// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict")); 687// 3 syncPrefsGroup->addRadio(i18n("Ask for every entry on conflict"));
687// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always")); 688// 4 syncPrefsGroup->addRadio(i18n("Force take local entry always"));
688// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always")); 689// 5 syncPrefsGroup->addRadio(i18n("Force take remote entry always"));
689 690
690int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full ) 691int CalendarView::takeEvent( Incidence* local, Incidence* remote, int mode , bool full )
691{ 692{
692 693
693 //void setZaurusId(int id); 694 //void setZaurusId(int id);
694 // int zaurusId() const; 695 // int zaurusId() const;
695 // void setZaurusUid(int id); 696 // void setZaurusUid(int id);
696 // int zaurusUid() const; 697 // int zaurusUid() const;
697 // void setZaurusStat(int id); 698 // void setZaurusStat(int id);
698 // int zaurusStat() const; 699 // int zaurusStat() const;
699 // 0 equal 700 // 0 equal
700 // 1 take local 701 // 1 take local
701 // 2 take remote 702 // 2 take remote
702 // 3 cancel 703 // 3 cancel
703 QDateTime lastSync = mLastCalendarSync; 704 QDateTime lastSync = mLastCalendarSync;
704 if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { 705 if ( mGlobalSyncMode == SYNC_MODE_SHARP ) {
705 bool remCh, locCh; 706 bool remCh, locCh;
706 remCh = ( remote->zaurusUid() != local->zaurusUid() ); 707 remCh = ( remote->zaurusUid() != local->zaurusUid() );
707 locCh = ( local->zaurusStat() != local->revision() ); 708 locCh = ( local->zaurusStat() != local->revision() );
708 //qDebug("locCh %d remCh %d locuid %d remuid %d", locCh, remCh,local->zaurusUid(), remote->zaurusUid() ); 709 //qDebug("locCh %d remCh %d locuid %d remuid %d", locCh, remCh,local->zaurusUid(), remote->zaurusUid() );
709 if ( !remCh && ! locCh ) { 710 if ( !remCh && ! locCh ) {
710 //qDebug("both not changed "); 711 //qDebug("both not changed ");
711 lastSync = local->lastModified().addDays(1); 712 lastSync = local->lastModified().addDays(1);
712 } else { 713 } else {
713 if ( locCh ) { 714 if ( locCh ) {
714 //qDebug("loc changed %d %d", local->zaurusStat(), local->revision() ); 715 //qDebug("loc changed %d %d", local->zaurusStat(), local->revision() );
715 lastSync = local->lastModified().addDays( -1 ); 716 lastSync = local->lastModified().addDays( -1 );
716 if ( !remCh ) 717 if ( !remCh )
717 remote->setLastModified( lastSync.addDays( -1 ) ); 718 remote->setLastModified( lastSync.addDays( -1 ) );
718 } else { 719 } else {
719 //qDebug(" not loc changed "); 720 //qDebug(" not loc changed ");
720 lastSync = local->lastModified().addDays( 1 ); 721 lastSync = local->lastModified().addDays( 1 );
721 if ( remCh ) 722 if ( remCh )
722 remote->setLastModified( lastSync.addDays( 1 ) ); 723 remote->setLastModified( lastSync.addDays( 1 ) );
723 724
724 } 725 }
725 } 726 }
726 full = true; 727 full = true;
727 if ( mode < 3 ) 728 if ( mode < 3 )
728 mode = 3; 729 mode = 3;
729 } else { 730 } else {
730 if ( local->lastModified() == remote->lastModified() ) 731 if ( local->lastModified() == remote->lastModified() )
731 if ( local->revision() == remote->revision() ) 732 if ( local->revision() == remote->revision() )
732 return 0; 733 return 0;
733 734
734 } 735 }
735 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() ); 736 // qDebug(" %d %d conflict on %s %s ", mode, full, local->summary().latin1(), remote->summary().latin1() );
736 737
737 //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , local->revision(), remote->lastModified().toString().latin1(), remote->revision()); 738 //qDebug("%s %d %s %d", local->lastModified().toString().latin1() , local->revision(), remote->lastModified().toString().latin1(), remote->revision());
738 //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() ); 739 //qDebug("%d %d %d %d ", local->lastModified().time().second(), local->lastModified().time().msec(), remote->lastModified().time().second(), remote->lastModified().time().msec() );
739 //full = true; //debug only 740 //full = true; //debug only
740 if ( full ) { 741 if ( full ) {
741 bool equ = false; 742 bool equ = false;
742 if ( local->type() == "Event" ) { 743 if ( local->type() == "Event" ) {
743 equ = (*((Event*) local) == *((Event*) remote)); 744 equ = (*((Event*) local) == *((Event*) remote));
744 } 745 }
745 else if ( local->type() =="Todo" ) 746 else if ( local->type() =="Todo" )
746 equ = (*((Todo*) local) == (*(Todo*) remote)); 747 equ = (*((Todo*) local) == (*(Todo*) remote));
747 else if ( local->type() =="Journal" ) 748 else if ( local->type() =="Journal" )
748 equ = (*((Journal*) local) == *((Journal*) remote)); 749 equ = (*((Journal*) local) == *((Journal*) remote));
749 if ( equ ) { 750 if ( equ ) {
750 //qDebug("equal "); 751 //qDebug("equal ");
751 if ( mGlobalSyncMode == SYNC_MODE_SHARP ) { 752 if ( mGlobalSyncMode == SYNC_MODE_SHARP ) {
752 local->setZaurusUid( remote->zaurusUid() ); 753 local->setZaurusUid( remote->zaurusUid() );
753 } 754 }
754 if ( mode < 4 ) 755 if ( mode < 4 )
755 return 0; 756 return 0;
756 757
757 }//else //debug only 758 }//else //debug only
758 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1()); 759 //qDebug("not equal %s %s ", local->summary().latin1(), remote->summary().latin1());
759 } 760 }
760 int result; 761 int result;
761 bool localIsNew; 762 bool localIsNew;
762 if ( full && mode < 2 ) 763 if ( full && mode < 2 )
763 mode = 3; 764 mode = 3;
764 765
765 switch( mode ) { 766 switch( mode ) {
766 case 0: 767 case 0:
767 if ( lastSync > remote->lastModified() ) 768 if ( lastSync > remote->lastModified() )
768 return 1; 769 return 1;
769 if ( lastSync > local->lastModified() ) 770 if ( lastSync > local->lastModified() )
770 return 2; 771 return 2;
771 return 1; 772 return 1;
772 break; 773 break;
773 case 1: 774 case 1:
774 if ( lastSync > remote->lastModified() ) 775 if ( lastSync > remote->lastModified() )
775 return 1; 776 return 1;
776 if ( lastSync > local->lastModified() ) 777 if ( lastSync > local->lastModified() )
777 return 2; 778 return 2;
778 return 2; 779 return 2;
779 break; 780 break;
780 case 2: 781 case 2:
781 if ( local->lastModified() > remote->lastModified() ) 782 if ( local->lastModified() > remote->lastModified() )
782 return 1; 783 return 1;
783 else 784 else
784 return 2; 785 return 2;
785 break; 786 break;
786 case 3: 787 case 3:
787 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), local->lastModified().toString().latin1(), remote->lastModified().toString().latin1() ); 788 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), local->lastModified().toString().latin1(), remote->lastModified().toString().latin1() );
788 if ( lastSync > remote->lastModified() ) 789 if ( lastSync > remote->lastModified() )
789 return 1; 790 return 1;
790 if ( lastSync > local->lastModified() ) 791 if ( lastSync > local->lastModified() )
791 return 2; 792 return 2;
792 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), local->lastModified().toString().latin1(), remote->lastModified().toString().latin1() ); 793 //qDebug("lsy %s --- lo %s --- re %s ", lastSync.toString().latin1(), local->lastModified().toString().latin1(), remote->lastModified().toString().latin1() );
793 localIsNew = local->lastModified() > remote->lastModified(); 794 localIsNew = local->lastModified() > remote->lastModified();
794 if ( localIsNew ) 795 if ( localIsNew )
795 getEventViewerDialog()->setColorMode( 1 ); 796 getEventViewerDialog()->setColorMode( 1 );
796 else 797 else
797 getEventViewerDialog()->setColorMode( 2 ); 798 getEventViewerDialog()->setColorMode( 2 );
798 getEventViewerDialog()->setIncidence(local); 799 getEventViewerDialog()->setIncidence(local);
799 if ( localIsNew ) 800 if ( localIsNew )
800 getEventViewerDialog()->setColorMode( 2 ); 801 getEventViewerDialog()->setColorMode( 2 );
801 else 802 else
802 getEventViewerDialog()->setColorMode( 1 ); 803 getEventViewerDialog()->setColorMode( 1 );
803 getEventViewerDialog()->addIncidence(remote); 804 getEventViewerDialog()->addIncidence(remote);
804 getEventViewerDialog()->setColorMode( 0 ); 805 getEventViewerDialog()->setColorMode( 0 );
805 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() ); 806 //qDebug("local %d remote %d ",local->relatedTo(),remote->relatedTo() );
806 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!")); 807 getEventViewerDialog()->setCaption( mCurrentSyncDevice +i18n(" : Conflict! Please choose entry!"));
807 getEventViewerDialog()->showMe(); 808 getEventViewerDialog()->showMe();
808 result = getEventViewerDialog()->executeS( localIsNew ); 809 result = getEventViewerDialog()->executeS( localIsNew );
809 return result; 810 return result;
810 811
811 break; 812 break;
812 case 4: 813 case 4:
813 return 1; 814 return 1;
814 break; 815 break;
815 case 5: 816 case 5:
816 return 2; 817 return 2;
817 break; 818 break;
818 819
819 default: 820 default:
820 break; 821 break;
821 } 822 }
822 return 0; 823 return 0;
823} 824}
824Event* CalendarView::getLastSyncEvent() 825Event* CalendarView::getLastSyncEvent()
825{ 826{
826 Event* lse; 827 Event* lse;
827 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() ); 828 //qDebug("CurrentSyncDevice %s ",mCurrentSyncDevice .latin1() );
828 lse = mCalendar->event( "last-syncEvent-device-"+mCurrentSyncDevice ); 829 lse = mCalendar->event( "last-syncEvent-device-"+mCurrentSyncDevice );
829 if (!lse) { 830 if (!lse) {
830 lse = new Event(); 831 lse = new Event();
831 lse->setUid( "last-syncEvent-device-"+mCurrentSyncDevice ); 832 lse->setUid( "last-syncEvent-device-"+mCurrentSyncDevice );
832 lse->setSummary(mCurrentSyncDevice + i18n(" - sync event")); 833 lse->setSummary(mCurrentSyncDevice + i18n(" - sync event"));
833 lse->setDtStart( mLastCalendarSync ); 834 lse->setDtStart( mLastCalendarSync );
834 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 835 lse->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
835 lse->setCategories( i18n("SyncEvent") ); 836 lse->setCategories( i18n("SyncEvent") );
836 lse->setReadOnly( true ); 837 lse->setReadOnly( true );
837 mCalendar->addEvent( lse ); 838 mCalendar->addEvent( lse );
838 } 839 }
839 840
840 return lse; 841 return lse;
841 842
842} 843}
843void CalendarView::checkSharpEvent( Event* lastSync, Incidence* toDelete ) 844void CalendarView::checkSharpEvent( Event* lastSync, Incidence* toDelete )
844{ 845{
845 if ( ! lastSync ) 846 if ( ! lastSync )
846 return; 847 return;
847 if ( toDelete->zaurusId() < 0 ) 848 if ( toDelete->zaurusId() < 0 )
848 return; 849 return;
849 if ( toDelete->type() == "Journal" ) 850 if ( toDelete->type() == "Journal" )
850 return; 851 return;
851 QString des = lastSync->description(); 852 QString des = lastSync->description();
852 QString pref = "e"; 853 QString pref = "e";
853 if ( toDelete->type() == "Todo" ) 854 if ( toDelete->type() == "Todo" )
854 pref = "t"; 855 pref = "t";
855 des += pref+ QString::number ( toDelete->zaurusId() ) + ","; 856 des += pref+ QString::number ( toDelete->zaurusId() ) + ",";
856 lastSync->setReadOnly( false ); 857 lastSync->setReadOnly( false );
857 lastSync->setDescription( des ); 858 lastSync->setDescription( des );
858 lastSync->setReadOnly( true ); 859 lastSync->setReadOnly( true );
859 860
860} 861}
861bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode ) 862bool CalendarView::synchronizeCalendar( Calendar* local, Calendar* remote, int mode )
862{ 863{
863 bool syncOK = true; 864 bool syncOK = true;
864 int addedEvent = 0; 865 int addedEvent = 0;
865 int addedEventR = 0; 866 int addedEventR = 0;
866 int deletedEventR = 0; 867 int deletedEventR = 0;
867 int deletedEventL = 0; 868 int deletedEventL = 0;
868 int changedLocal = 0; 869 int changedLocal = 0;
869 int changedRemote = 0; 870 int changedRemote = 0;
870 //QPtrList<Event> el = local->rawEvents(); 871 //QPtrList<Event> el = local->rawEvents();
871 Event* eventR; 872 Event* eventR;
872 QString uid; 873 QString uid;
873 int take; 874 int take;
874 Event* eventL; 875 Event* eventL;
875 Event* eventRSync; 876 Event* eventRSync;
876 Event* eventLSync; 877 Event* eventLSync;
877 Event* eventRSyncSharp = remote->event( "last-syncEvent-device-Sharp-DTM"); 878 Event* eventRSyncSharp = remote->event( "last-syncEvent-device-Sharp-DTM");
878 Event* eventLSyncSharp = local->event( "last-syncEvent-device-Sharp-DTM"); 879 Event* eventLSyncSharp = local->event( "last-syncEvent-device-Sharp-DTM");
879 bool fullDateRange = false; 880 bool fullDateRange = false;
880 mLastCalendarSync = QDateTime::currentDateTime(); 881 mLastCalendarSync = QDateTime::currentDateTime();
881 QDateTime modifiedCalendar = mLastCalendarSync;; 882 QDateTime modifiedCalendar = mLastCalendarSync;;
882 eventR = remote->event("last-syncEvent-device-"+mCurrentSyncName ); 883 eventR = remote->event("last-syncEvent-device-"+mCurrentSyncName );
883 if ( eventR ) { 884 if ( eventR ) {
884 eventRSync = (Event*) eventR->clone(); 885 eventRSync = (Event*) eventR->clone();
885 remote->deleteEvent(eventR ); 886 remote->deleteEvent(eventR );
886 887
887 } else { 888 } else {
888 fullDateRange = true; 889 fullDateRange = true;
889 eventRSync = new Event(); 890 eventRSync = new Event();
890 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event")); 891 eventRSync->setSummary(mCurrentSyncName + i18n(" - sync event"));
891 eventRSync->setUid("last-syncEvent-device-"+mCurrentSyncName ); 892 eventRSync->setUid("last-syncEvent-device-"+mCurrentSyncName );
892 eventRSync->setDtStart( mLastCalendarSync ); 893 eventRSync->setDtStart( mLastCalendarSync );
893 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) ); 894 eventRSync->setDtEnd( mLastCalendarSync.addSecs( 7200 ) );
894 eventRSync->setCategories( i18n("SyncEvent") ); 895 eventRSync->setCategories( i18n("SyncEvent") );
895 } 896 }