summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-05 23:13:10 (UTC)
committer zautrix <zautrix>2005-01-05 23:13:10 (UTC)
commit0618fbee69bfde7f7f3c4a54b5cc45dac446abd3 (patch) (unidiff)
tree5fa2e93328b3429a22e0a712f45bdc91e3da1f07 /korganizer
parented3b1be69915eaff3bfad542fd50bb18624c323e (diff)
downloadkdepimpi-0618fbee69bfde7f7f3c4a54b5cc45dac446abd3.zip
kdepimpi-0618fbee69bfde7f7f3c4a54b5cc45dac446abd3.tar.gz
kdepimpi-0618fbee69bfde7f7f3c4a54b5cc45dac446abd3.tar.bz2
added wnv printing
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp2
-rw-r--r--korganizer/koviewmanager.h2
-rw-r--r--korganizer/kowhatsnextview.cpp19
-rw-r--r--korganizer/kowhatsnextview.h3
-rw-r--r--korganizer/mainwindow.cpp6
5 files changed, 30 insertions, 2 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index b2dd266..cf56fcf 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -49,384 +49,386 @@
49#include "koviewmanager.h" 49#include "koviewmanager.h"
50//extern bool externFlagMonthviewBlockPainting; 50//extern bool externFlagMonthviewBlockPainting;
51 51
52//bool globalFlagBlockPainting = false; 52//bool globalFlagBlockPainting = false;
53int globalFlagBlockAgenda = 0; 53int globalFlagBlockAgenda = 0;
54int globalFlagBlockLabel = 0; 54int globalFlagBlockLabel = 0;
55int globalFlagBlockAgendaItemPaint = 1; 55int globalFlagBlockAgendaItemPaint = 1;
56int globalFlagBlockAgendaItemUpdate = 1; 56int globalFlagBlockAgendaItemUpdate = 1;
57 57
58 58
59KOViewManager::KOViewManager( CalendarView *mainView ) : 59KOViewManager::KOViewManager( CalendarView *mainView ) :
60 QObject(), mMainView( mainView ) 60 QObject(), mMainView( mainView )
61{ 61{
62 mCurrentView = 0; 62 mCurrentView = 0;
63 63
64 mWhatsNextView = 0; 64 mWhatsNextView = 0;
65 mTodoView = 0; 65 mTodoView = 0;
66 mAgendaView = 0; 66 mAgendaView = 0;
67 mMonthView = 0; 67 mMonthView = 0;
68 mListView = 0; 68 mListView = 0;
69 mJournalView = 0; 69 mJournalView = 0;
70 mTimeSpanView = 0; 70 mTimeSpanView = 0;
71 mCurrentAgendaView = 0 ; 71 mCurrentAgendaView = 0 ;
72 mFlagShowNextxDays = false; 72 mFlagShowNextxDays = false;
73} 73}
74 74
75KOViewManager::~KOViewManager() 75KOViewManager::~KOViewManager()
76{ 76{
77} 77}
78 78
79 79
80KOrg::BaseView *KOViewManager::currentView() 80KOrg::BaseView *KOViewManager::currentView()
81{ 81{
82 return mCurrentView; 82 return mCurrentView;
83} 83}
84 84
85void KOViewManager::readSettings(KConfig *config) 85void KOViewManager::readSettings(KConfig *config)
86{ 86{
87 config->setGroup("General"); 87 config->setGroup("General");
88 QString view = config->readEntry("Current View"); 88 QString view = config->readEntry("Current View");
89 if (view == "WhatsNext") showWhatsNextView(); 89 if (view == "WhatsNext") showWhatsNextView();
90 else if (view == "Month") showMonthView(); 90 else if (view == "Month") showMonthView();
91 else if (view == "List") showListView(); 91 else if (view == "List") showListView();
92 else if (view == "Journal") showJournalView(); 92 else if (view == "Journal") showJournalView();
93 else if (view == "TimeSpan") showTimeSpanView(); 93 else if (view == "TimeSpan") showTimeSpanView();
94 else if (view == "Todo") showTodoView(); 94 else if (view == "Todo") showTodoView();
95 else { 95 else {
96 showAgendaView(); 96 showAgendaView();
97 } 97 }
98} 98}
99 99
100void KOViewManager::writeSettings(KConfig *config) 100void KOViewManager::writeSettings(KConfig *config)
101{ 101{
102 config->setGroup("General"); 102 config->setGroup("General");
103 103
104 QString view; 104 QString view;
105 if (mCurrentView == mWhatsNextView) view = "WhatsNext"; 105 if (mCurrentView == mWhatsNextView) view = "WhatsNext";
106 else if (mCurrentView == mMonthView) view = "Month"; 106 else if (mCurrentView == mMonthView) view = "Month";
107 else if (mCurrentView == mListView) view = "List"; 107 else if (mCurrentView == mListView) view = "List";
108 else if (mCurrentView == mJournalView) view = "Journal"; 108 else if (mCurrentView == mJournalView) view = "Journal";
109 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 109 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
110 else if (mCurrentView == mTodoView) view = "Todo"; 110 else if (mCurrentView == mTodoView) view = "Todo";
111 else view = "Agenda"; 111 else view = "Agenda";
112 112
113 config->writeEntry("Current View",view); 113 config->writeEntry("Current View",view);
114 114
115 if (mAgendaView) { 115 if (mAgendaView) {
116 mAgendaView->writeSettings(config); 116 mAgendaView->writeSettings(config);
117 } 117 }
118 if (mTimeSpanView) { 118 if (mTimeSpanView) {
119 mTimeSpanView->writeSettings(config); 119 mTimeSpanView->writeSettings(config);
120 } 120 }
121 if (mListView) { 121 if (mListView) {
122 mListView->writeSettings(config); 122 mListView->writeSettings(config);
123 } 123 }
124 if (mTodoView) { 124 if (mTodoView) {
125 mTodoView->saveLayout(config,"Todo View"); 125 mTodoView->saveLayout(config,"Todo View");
126 } 126 }
127} 127}
128 128
129void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 129void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
130{ 130{
131 131
132 //mFlagShowNextxDays = false; 132 //mFlagShowNextxDays = false;
133 //if(view == mCurrentView) return; 133 //if(view == mCurrentView) return;
134 if ( view == 0 ) { 134 if ( view == 0 ) {
135 view = mCurrentView; 135 view = mCurrentView;
136 if ( view == 0 ) 136 if ( view == 0 )
137 return; 137 return;
138 } 138 }
139 bool full = fullScreen; 139 bool full = fullScreen;
140 if(view == mCurrentView && view != mWhatsNextView ) { 140 if(view == mCurrentView && view != mWhatsNextView ) {
141 if ( mCurrentAgendaView < 0 ) 141 if ( mCurrentAgendaView < 0 )
142 return; 142 return;
143 full = mMainView->leftFrame()->isVisible(); 143 full = mMainView->leftFrame()->isVisible();
144 } else { 144 } else {
145 mCurrentView = view; 145 mCurrentView = view;
146 146
147 // bool full = fullScreen; 147 // bool full = fullScreen;
148 bool isFull = !mMainView->leftFrame()->isVisible(); 148 bool isFull = !mMainView->leftFrame()->isVisible();
149 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 149 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
150 full = true; 150 full = true;
151 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 151 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
152 full = false; 152 full = false;
153 } 153 }
154 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 154 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
155 raiseCurrentView( full ); 155 raiseCurrentView( full );
156 mMainView->processIncidenceSelection( 0 ); 156 mMainView->processIncidenceSelection( 0 );
157 mMainView->updateView(); 157 mMainView->updateView();
158 mMainView->adaptNavigationUnits(); 158 mMainView->adaptNavigationUnits();
159} 159}
160 160
161void KOViewManager::raiseCurrentView( bool fullScreen ) 161void KOViewManager::raiseCurrentView( bool fullScreen )
162{ 162{
163 //qDebug("raiseCurrentView "); 163 //qDebug("raiseCurrentView ");
164 mCurrentAgendaView = 0; 164 mCurrentAgendaView = 0;
165 int wid = mMainView->width() ; 165 int wid = mMainView->width() ;
166 int hei = mMainView->height(); 166 int hei = mMainView->height();
167 if ( mCurrentView == mMonthView ) { 167 if ( mCurrentView == mMonthView ) {
168 mMainView->navigatorBar()->show(); 168 mMainView->navigatorBar()->show();
169 hei -= mMainView->navigatorBar()->sizeHint().height(); 169 hei -= mMainView->navigatorBar()->sizeHint().height();
170 //mMainView->navigatorBar()->hide(); 170 //mMainView->navigatorBar()->hide();
171 } else { 171 } else {
172 mMainView->navigatorBar()->hide(); 172 mMainView->navigatorBar()->hide();
173 } 173 }
174 if ( fullScreen ) { 174 if ( fullScreen ) {
175 mMainView->leftFrame()->hide(); 175 mMainView->leftFrame()->hide();
176 } else { 176 } else {
177 mMainView->leftFrame()->show(); 177 mMainView->leftFrame()->show();
178 if ( KOPrefs::instance()->mVerticalScreen ) 178 if ( KOPrefs::instance()->mVerticalScreen )
179 hei -= mMainView->leftFrame()->height(); 179 hei -= mMainView->leftFrame()->height();
180 else 180 else
181 wid -= mMainView->leftFrame()->width(); 181 wid -= mMainView->leftFrame()->width();
182 } 182 }
183 183
184 if ( globalFlagBlockAgenda == 5 ) { 184 if ( globalFlagBlockAgenda == 5 ) {
185 globalFlagBlockAgenda = 4; 185 globalFlagBlockAgenda = 4;
186 globalFlagBlockAgendaItemPaint = 1; 186 globalFlagBlockAgendaItemPaint = 1;
187 } 187 }
188 mMainView->viewStack()->raiseWidget(mCurrentView); 188 mMainView->viewStack()->raiseWidget(mCurrentView);
189 if ( globalFlagBlockAgenda == 4 ) { 189 if ( globalFlagBlockAgenda == 4 ) {
190 if ( mCurrentView == mAgendaView ) { 190 if ( mCurrentView == mAgendaView ) {
191 //globalFlagBlockAgenda =1 ; 191 //globalFlagBlockAgenda =1 ;
192 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 192 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
193 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 193 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
194 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 194 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
195 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 195 mAgendaView->setStartHour( QTime::currentTime ().hour() );
196 qApp->processEvents(); 196 qApp->processEvents();
197 //qDebug("qApp->processEvents() "); 197 //qDebug("qApp->processEvents() ");
198 globalFlagBlockAgenda = 0; 198 globalFlagBlockAgenda = 0;
199 mAgendaView->repaintAgenda(); 199 mAgendaView->repaintAgenda();
200 200
201 } 201 }
202 globalFlagBlockAgenda = 0; 202 globalFlagBlockAgenda = 0;
203 } 203 }
204 //qDebug("raiseCurrentView ende "); 204 //qDebug("raiseCurrentView ende ");
205} 205}
206 206
207void KOViewManager::updateView() 207void KOViewManager::updateView()
208{ 208{
209 // qDebug("KOViewManager::updateView() "); 209 // qDebug("KOViewManager::updateView() ");
210 // if we are updating mTodoView, we get endless recursion 210 // if we are updating mTodoView, we get endless recursion
211 if ( mTodoView == mCurrentView ) 211 if ( mTodoView == mCurrentView )
212 return; 212 return;
213 if ( mCurrentView ) mCurrentView->updateView(); 213 if ( mCurrentView ) mCurrentView->updateView();
214 214
215} 215}
216 216
217void KOViewManager::updateView(const QDate &start, const QDate &end) 217void KOViewManager::updateView(const QDate &start, const QDate &end)
218{ 218{
219 // kdDebug() << "KOViewManager::updateView()" << endl; 219 // kdDebug() << "KOViewManager::updateView()" << endl;
220 220
221 if (mCurrentView) mCurrentView->showDates(start, end); 221 if (mCurrentView) mCurrentView->showDates(start, end);
222 222
223 if (mTodoView) mTodoView->updateView(); 223 if (mTodoView) mTodoView->updateView();
224} 224}
225 225
226 226
227void KOViewManager::updateWNview() 227void KOViewManager::updateWNview()
228{ 228{
229 if ( mCurrentView == mWhatsNextView && mWhatsNextView ) 229 if ( mCurrentView == mWhatsNextView && mWhatsNextView )
230 mWhatsNextView->updateView(); 230 mWhatsNextView->updateView();
231 231
232} 232}
233void KOViewManager::showWhatsNextView() 233void KOViewManager::showWhatsNextView()
234{ 234{
235 if (!mWhatsNextView) { 235 if (!mWhatsNextView) {
236 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), 236 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(),
237 "KOViewManager::WhatsNextView"); 237 "KOViewManager::WhatsNextView");
238 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); 238 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog());
239 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); 239 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
240 addView(mWhatsNextView); 240 addView(mWhatsNextView);
241 connect(this, SIGNAL( printWNV() ),
242 mWhatsNextView, SLOT( printMe() ) );
241 } 243 }
242 globalFlagBlockAgenda = 1; 244 globalFlagBlockAgenda = 1;
243 showView(mWhatsNextView, true ); 245 showView(mWhatsNextView, true );
244 //mWhatsNextView->updateView(); 246 //mWhatsNextView->updateView();
245 247
246} 248}
247 249
248void KOViewManager::showListView() 250void KOViewManager::showListView()
249{ 251{
250 if (!mListView) { 252 if (!mListView) {
251 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); 253 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
252 addView(mListView); 254 addView(mListView);
253 255
254 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), 256 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
255 mMainView, SLOT(showIncidence(Incidence *))); 257 mMainView, SLOT(showIncidence(Incidence *)));
256 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), 258 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
257 mMainView, SLOT(editIncidence(Incidence *))); 259 mMainView, SLOT(editIncidence(Incidence *)));
258 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), 260 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
259 mMainView, SLOT(deleteIncidence(Incidence *))); 261 mMainView, SLOT(deleteIncidence(Incidence *)));
260 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), 262 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
261 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 263 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
262 connect( mListView, SIGNAL( signalNewEvent() ), 264 connect( mListView, SIGNAL( signalNewEvent() ),
263 mMainView, SLOT( newEvent() ) ); 265 mMainView, SLOT( newEvent() ) );
264 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 266 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
265 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 267 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
266 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 268 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
267 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 269 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
268 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 270 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
269 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 271 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
270 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 272 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
271 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 273 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
272 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 274 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
273 } 275 }
274 // bool temp = mFlagShowNextxDays; 276 // bool temp = mFlagShowNextxDays;
275 //globalFlagBlockPainting = true; 277 //globalFlagBlockPainting = true;
276 globalFlagBlockAgenda = 1; 278 globalFlagBlockAgenda = 1;
277 if ( KOPrefs::instance()->mListViewMonthTimespan ) 279 if ( KOPrefs::instance()->mListViewMonthTimespan )
278 mMainView->dateNavigator()->selectMonth(); 280 mMainView->dateNavigator()->selectMonth();
279 showView(mListView, KOPrefs::instance()->mFullViewTodo); 281 showView(mListView, KOPrefs::instance()->mFullViewTodo);
280 //mFlagShowNextxDays = temp; 282 //mFlagShowNextxDays = temp;
281} 283}
282 284
283void KOViewManager::showAgendaView( bool fullScreen ) 285void KOViewManager::showAgendaView( bool fullScreen )
284{ 286{
285 287
286 mMainView->dialogManager()->hideSearchDialog(); 288 mMainView->dialogManager()->hideSearchDialog();
287 // qDebug("KOViewManager::showAgendaView "); 289 // qDebug("KOViewManager::showAgendaView ");
288 bool full; 290 bool full;
289 full = fullScreen; 291 full = fullScreen;
290 if (!mAgendaView) { 292 if (!mAgendaView) {
291 full = false; 293 full = false;
292 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 294 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
293 addView(mAgendaView); 295 addView(mAgendaView);
294#ifndef DESKTOP_VERSION 296#ifndef DESKTOP_VERSION
295 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); 297 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
296#endif 298#endif
297 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), 299 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
298 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); 300 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
299 301
300 // SIGNALS/SLOTS FOR DAY/WEEK VIEW 302 // SIGNALS/SLOTS FOR DAY/WEEK VIEW
301 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), 303 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
302 mMainView, SLOT(newEvent(QDateTime))); 304 mMainView, SLOT(newEvent(QDateTime)));
303 // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), 305 // connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
304 // mMainView, SLOT(newEvent(QDateTime,QDateTime))); 306 // mMainView, SLOT(newEvent(QDateTime,QDateTime)));
305 connect(mAgendaView,SIGNAL(newEventSignal(QDate)), 307 connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
306 mMainView, SLOT(newEvent(QDate))); 308 mMainView, SLOT(newEvent(QDate)));
307 309
308 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), 310 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
309 mMainView, SLOT(editIncidence(Incidence *))); 311 mMainView, SLOT(editIncidence(Incidence *)));
310 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), 312 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
311 mMainView, SLOT(showIncidence(Incidence *))); 313 mMainView, SLOT(showIncidence(Incidence *)));
312 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), 314 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
313 mMainView, SLOT(deleteIncidence(Incidence *))); 315 mMainView, SLOT(deleteIncidence(Incidence *)));
314 316
315 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), 317 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
316 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 318 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
317 319
318 connect(mAgendaView, SIGNAL( toggleExpand() ), 320 connect(mAgendaView, SIGNAL( toggleExpand() ),
319 mMainView, SLOT( toggleExpand() ) ); 321 mMainView, SLOT( toggleExpand() ) );
320 322
321 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), 323 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ),
322 mAgendaView, SLOT( setExpandedButton( bool ) ) ); 324 mAgendaView, SLOT( setExpandedButton( bool ) ) );
323 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), 325 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
324 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; 326 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
325 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), 327 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
326 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; 328 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
327 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); 329 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
328 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, 330 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
329 SLOT( updateTodo( Todo *, int ) ) ); 331 SLOT( updateTodo( Todo *, int ) ) );
330 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), 332 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
331 mMainView, SIGNAL( todoModified( Todo *, int ))); 333 mMainView, SIGNAL( todoModified( Todo *, int )));
332 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 334 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
333 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 335 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
334 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 336 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
335 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 337 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
336 mAgendaView->readSettings(); 338 mAgendaView->readSettings();
337 mAgendaView->updateConfig(); 339 mAgendaView->updateConfig();
338 } 340 }
339 341
340 showView( mAgendaView, full); 342 showView( mAgendaView, full);
341 343
342} 344}
343 345
344void KOViewManager::showDayView() 346void KOViewManager::showDayView()
345{ 347{
346 mFlagShowNextxDays = false; 348 mFlagShowNextxDays = false;
347 globalFlagBlockLabel = 1; 349 globalFlagBlockLabel = 1;
348 globalFlagBlockAgenda = 1; 350 globalFlagBlockAgenda = 1;
349 if ( mCurrentAgendaView != 1 ) 351 if ( mCurrentAgendaView != 1 )
350 mCurrentAgendaView = -1; 352 mCurrentAgendaView = -1;
351 showAgendaView(); 353 showAgendaView();
352 qApp->processEvents(); 354 qApp->processEvents();
353 globalFlagBlockAgenda = 2; 355 globalFlagBlockAgenda = 2;
354 globalFlagBlockLabel = 0; 356 globalFlagBlockLabel = 0;
355 mMainView->dateNavigator()->selectDates( 1 ); 357 mMainView->dateNavigator()->selectDates( 1 );
356 mCurrentAgendaView = 1 ; 358 mCurrentAgendaView = 1 ;
357 359
358} 360}
359 361
360void KOViewManager::showWorkWeekView() 362void KOViewManager::showWorkWeekView()
361{ 363{
362 mFlagShowNextxDays = false; 364 mFlagShowNextxDays = false;
363 globalFlagBlockAgenda = 1; 365 globalFlagBlockAgenda = 1;
364 globalFlagBlockLabel = 1; 366 globalFlagBlockLabel = 1;
365 if ( mCurrentAgendaView != 5 ) 367 if ( mCurrentAgendaView != 5 )
366 mCurrentAgendaView = -1; 368 mCurrentAgendaView = -1;
367 showAgendaView(); 369 showAgendaView();
368 qApp->processEvents(); 370 qApp->processEvents();
369 globalFlagBlockAgenda = 2; 371 globalFlagBlockAgenda = 2;
370 globalFlagBlockLabel = 0; 372 globalFlagBlockLabel = 0;
371 mMainView->dateNavigator()->selectWorkWeek(); 373 mMainView->dateNavigator()->selectWorkWeek();
372 mCurrentAgendaView = 5 ; 374 mCurrentAgendaView = 5 ;
373 375
374} 376}
375 377
376void KOViewManager::showWeekView() 378void KOViewManager::showWeekView()
377{ 379{
378 /* 380 /*
379 globalFlagBlockAgenda = 2; 381 globalFlagBlockAgenda = 2;
380 qDebug("4globalFlagBlockAgenda = 2; "); 382 qDebug("4globalFlagBlockAgenda = 2; ");
381 //globalFlagBlockPainting = true; 383 //globalFlagBlockPainting = true;
382 mMainView->dateNavigator()->selectWeek(); 384 mMainView->dateNavigator()->selectWeek();
383 showAgendaView(); 385 showAgendaView();
384 */ 386 */
385 387
386 388
387 mFlagShowNextxDays = false; 389 mFlagShowNextxDays = false;
388 globalFlagBlockAgenda = 1; 390 globalFlagBlockAgenda = 1;
389 globalFlagBlockLabel = 1; 391 globalFlagBlockLabel = 1;
390 if ( mCurrentAgendaView != 7 ) 392 if ( mCurrentAgendaView != 7 )
391 mCurrentAgendaView = -1; 393 mCurrentAgendaView = -1;
392 showAgendaView(); 394 showAgendaView();
393 qApp->processEvents(); 395 qApp->processEvents();
394 globalFlagBlockAgenda = 2; 396 globalFlagBlockAgenda = 2;
395 globalFlagBlockLabel = 0; 397 globalFlagBlockLabel = 0;
396 mMainView->dateNavigator()->selectWeek(); 398 mMainView->dateNavigator()->selectWeek();
397 mCurrentAgendaView = 7 ; 399 mCurrentAgendaView = 7 ;
398} 400}
399 401
400void KOViewManager::showNextXView() 402void KOViewManager::showNextXView()
401{ 403{
402 404
403 globalFlagBlockAgenda = 1; 405 globalFlagBlockAgenda = 1;
404 if ( mCurrentAgendaView != 3 ) 406 if ( mCurrentAgendaView != 3 )
405 mCurrentAgendaView = -1; 407 mCurrentAgendaView = -1;
406 showAgendaView(KOPrefs::instance()->mFullViewMonth); 408 showAgendaView(KOPrefs::instance()->mFullViewMonth);
407 globalFlagBlockAgenda = 2; 409 globalFlagBlockAgenda = 2;
408 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 410 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
409 KOPrefs::instance()->mNextXDays ); 411 KOPrefs::instance()->mNextXDays );
410 mFlagShowNextxDays = true; 412 mFlagShowNextxDays = true;
411 mCurrentAgendaView = 3 ; 413 mCurrentAgendaView = 3 ;
412} 414}
413bool KOViewManager::showsNextDays() 415bool KOViewManager::showsNextDays()
414{ 416{
415 return mFlagShowNextxDays; 417 return mFlagShowNextxDays;
416} 418}
417void KOViewManager::showMonthView() 419void KOViewManager::showMonthView()
418{ 420{
419 if (!mMonthView) { 421 if (!mMonthView) {
420 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 422 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
421 423
422 addView(mMonthView); 424 addView(mMonthView);
423 // mMonthView->show(); 425 // mMonthView->show();
424 // SIGNALS/SLOTS FOR MONTH VIEW 426 // SIGNALS/SLOTS FOR MONTH VIEW
425 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 427 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
426 mMainView, SLOT(newEvent(QDateTime))); 428 mMainView, SLOT(newEvent(QDateTime)));
427 429
428 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 430 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
429 mMainView, SLOT(showIncidence(Incidence *))); 431 mMainView, SLOT(showIncidence(Incidence *)));
430 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 432 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
431 mMainView, SLOT(editIncidence(Incidence *))); 433 mMainView, SLOT(editIncidence(Incidence *)));
432 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 434 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
diff --git a/korganizer/koviewmanager.h b/korganizer/koviewmanager.h
index 26b22be..6f76e2c 100644
--- a/korganizer/koviewmanager.h
+++ b/korganizer/koviewmanager.h
@@ -1,113 +1,115 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 3 Copyright (c) 2001
4 Cornelius Schumacher <schumacher@kde.org> 4 Cornelius Schumacher <schumacher@kde.org>
5 5
6 This program is free software; you can redistribute it and/or modify 6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by 7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or 8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version. 9 (at your option) any later version.
10 10
11 This program is distributed in the hope that it will be useful, 11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.See the
14 GNU General Public License for more details. 14 GNU General Public License for more details.
15 15
16 You should have received a copy of the GNU General Public License 16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software 17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 19
20 As a special exception, permission is given to link this program 20 As a special exception, permission is given to link this program
21 with any edition of Qt, and distribute the resulting executable, 21 with any edition of Qt, and distribute the resulting executable,
22 without including the source code for Qt in the source distribution. 22 without including the source code for Qt in the source distribution.
23*/ 23*/
24#ifndef KOVIEWMANAGER_H 24#ifndef KOVIEWMANAGER_H
25#define KOVIEWMANAGER_H 25#define KOVIEWMANAGER_H
26 26
27#include <qobject.h> 27#include <qobject.h>
28 28
29#include <korganizer/baseview.h> 29#include <korganizer/baseview.h>
30 30
31class CalendarView; 31class CalendarView;
32 32
33class KOListView; 33class KOListView;
34class KOAgendaView; 34class KOAgendaView;
35class KOMonthView; 35class KOMonthView;
36class KOTimeSpanView; 36class KOTimeSpanView;
37class KOTodoView; 37class KOTodoView;
38class KOWhatsNextView; 38class KOWhatsNextView;
39class KOJournalView; 39class KOJournalView;
40 40
41using namespace KCal; 41using namespace KCal;
42 42
43/** 43/**
44 This class manages the views of the calendar. It owns the objects and handles 44 This class manages the views of the calendar. It owns the objects and handles
45 creation and selection. 45 creation and selection.
46*/ 46*/
47class KOViewManager : public QObject 47class KOViewManager : public QObject
48{ 48{
49 Q_OBJECT 49 Q_OBJECT
50 public: 50 public:
51 KOViewManager( CalendarView * ); 51 KOViewManager( CalendarView * );
52 virtual ~KOViewManager(); 52 virtual ~KOViewManager();
53 53
54 /** changes the view to be the currently selected view */ 54 /** changes the view to be the currently selected view */
55 void showView(KOrg::BaseView *, bool fullScreen = false ); 55 void showView(KOrg::BaseView *, bool fullScreen = false );
56 void updateWNview(); 56 void updateWNview();
57 void readSettings(KConfig *config); 57 void readSettings(KConfig *config);
58 void writeSettings(KConfig *config); 58 void writeSettings(KConfig *config);
59 bool showsNextDays(); 59 bool showsNextDays();
60 /** Read which view was shown last from config file */ 60 /** Read which view was shown last from config file */
61 void readCurrentView(KConfig *); 61 void readCurrentView(KConfig *);
62 /** Write which view is currently shown to config file */ 62 /** Write which view is currently shown to config file */
63 void writeCurrentView(KConfig *); 63 void writeCurrentView(KConfig *);
64 64
65 KOrg::BaseView *currentView(); 65 KOrg::BaseView *currentView();
66 66
67 void setDocumentId( const QString & ); 67 void setDocumentId( const QString & );
68 68
69 void updateView(); 69 void updateView();
70 void updateView( const QDate &start, const QDate &end ); 70 void updateView( const QDate &start, const QDate &end );
71 71
72 void raiseCurrentView( bool fullScreen = false ); 72 void raiseCurrentView( bool fullScreen = false );
73 73
74 void addView(KOrg::BaseView *); 74 void addView(KOrg::BaseView *);
75 75
76 Incidence *currentSelection(); 76 Incidence *currentSelection();
77 QDate currentSelectionDate(); 77 QDate currentSelectionDate();
78 78
79 KOAgendaView *agendaView() const { return mAgendaView; } 79 KOAgendaView *agendaView() const { return mAgendaView; }
80 80
81 signals:
82 void printWNV();
81 public slots: 83 public slots:
82 void showWhatsNextView(); 84 void showWhatsNextView();
83 void showListView(); 85 void showListView();
84 void showAgendaView( bool fullScreen = false ); 86 void showAgendaView( bool fullScreen = false );
85 void showDayView(); 87 void showDayView();
86 void showWorkWeekView(); 88 void showWorkWeekView();
87 void showWeekView(); 89 void showWeekView();
88 void showNextXView(); 90 void showNextXView();
89 void showMonthView(); 91 void showMonthView();
90 void showTodoView(); 92 void showTodoView();
91 void showJournalView(); 93 void showJournalView();
92 void showTimeSpanView(); 94 void showTimeSpanView();
93 95
94 private: 96 private:
95 CalendarView *mMainView; 97 CalendarView *mMainView;
96 98
97 int mCurrentAgendaView; 99 int mCurrentAgendaView;
98 KOAgendaView *mAgendaView; 100 KOAgendaView *mAgendaView;
99 KOListView *mListView; 101 KOListView *mListView;
100 KOMonthView *mMonthView; 102 KOMonthView *mMonthView;
101 KOTodoView *mTodoView; 103 KOTodoView *mTodoView;
102 KOWhatsNextView *mWhatsNextView; 104 KOWhatsNextView *mWhatsNextView;
103 KOJournalView *mJournalView; 105 KOJournalView *mJournalView;
104 KOTimeSpanView *mTimeSpanView; 106 KOTimeSpanView *mTimeSpanView;
105 107
106 KOrg::BaseView *mCurrentView; // currently active event view 108 KOrg::BaseView *mCurrentView; // currently active event view
107 109
108 int mAgendaViewMode; 110 int mAgendaViewMode;
109 bool mFlagShowNextxDays; 111 bool mFlagShowNextxDays;
110 112
111}; 113};
112 114
113#endif 115#endif
diff --git a/korganizer/kowhatsnextview.cpp b/korganizer/kowhatsnextview.cpp
index 5f14bfa..219f7c3 100644
--- a/korganizer/kowhatsnextview.cpp
+++ b/korganizer/kowhatsnextview.cpp
@@ -1,306 +1,322 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19 19
20#include <qlayout.h> 20#include <qlayout.h>
21#include <qtextbrowser.h> 21#include <qtextbrowser.h>
22#include <qtextcodec.h> 22#include <qtextcodec.h>
23#include <qfileinfo.h> 23#include <qfileinfo.h>
24#include <qlabel.h> 24#include <qlabel.h>
25 25
26#include <qapplication.h> 26#include <qapplication.h>
27 27
28#include <kglobal.h> 28#include <kglobal.h>
29#include <klocale.h> 29#include <klocale.h>
30#include <kdebug.h> 30#include <kdebug.h>
31#include <kiconloader.h> 31#include <kiconloader.h>
32#include <kmessagebox.h> 32#include <kmessagebox.h>
33 33
34#include <libkcal/calendar.h> 34#include <libkcal/calendar.h>
35 35
36#ifndef KORG_NOPRINTER 36#ifndef KORG_NOPRINTER
37#include "calprinter.h" 37#include "calprinter.h"
38#endif 38#endif
39#include "koglobals.h" 39#include "koglobals.h"
40#include "koprefs.h" 40#include "koprefs.h"
41#include "koeventviewerdialog.h" 41#include "koeventviewerdialog.h"
42#include <qstylesheet.h> 42#include <qstylesheet.h>
43#include "kowhatsnextview.h" 43#include "kowhatsnextview.h"
44using namespace KOrg; 44using namespace KOrg;
45 45
46void WhatsNextTextBrowser::setSource(const QString& n) 46void WhatsNextTextBrowser::setSource(const QString& n)
47{ 47{
48 48
49 if (n.startsWith("event:")) { 49 if (n.startsWith("event:")) {
50 emit showIncidence(n); 50 emit showIncidence(n);
51 return; 51 return;
52 } else if (n.startsWith("todo:")) { 52 } else if (n.startsWith("todo:")) {
53 emit showIncidence(n); 53 emit showIncidence(n);
54 return; 54 return;
55 } else { 55 } else {
56 QTextBrowser::setSource(n); 56 QTextBrowser::setSource(n);
57 } 57 }
58} 58}
59 59
60KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent, 60KOWhatsNextView::KOWhatsNextView(Calendar *calendar, QWidget *parent,
61 const char *name) 61 const char *name)
62 : KOrg::BaseView(calendar, parent, name) 62 : KOrg::BaseView(calendar, parent, name)
63{ 63{
64 // mDateLabel = 64 // mDateLabel =
65 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this); 65 // new QLabel(KGlobal::locale()->formatDate(QDate::currentDate()),this);
66 // mDateLabel->setMargin(2); 66 // mDateLabel->setMargin(2);
67 // mDateLabel->setAlignment(AlignCenter); 67 // mDateLabel->setAlignment(AlignCenter);
68 setFont( KOPrefs::instance()->mWhatsNextFont ); 68 setFont( KOPrefs::instance()->mWhatsNextFont );
69 mView = new WhatsNextTextBrowser(this); 69 mView = new WhatsNextTextBrowser(this);
70 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &))); 70 connect(mView,SIGNAL(showIncidence(const QString &)),SLOT(showIncidence(const QString &)));
71 QStyleSheet* stsh = mView->styleSheet(); 71 QStyleSheet* stsh = mView->styleSheet();
72 QStyleSheetItem * style ; 72 QStyleSheetItem * style ;
73 style = stsh->item ("h2" ); 73 style = stsh->item ("h2" );
74 if ( style ) { 74 if ( style ) {
75 style->setMargin(QStyleSheetItem::MarginAll,0); 75 style->setMargin(QStyleSheetItem::MarginAll,0);
76 } 76 }
77 style = stsh->item ("h3" ); 77 style = stsh->item ("h3" );
78 if ( style ) { 78 if ( style ) {
79 style->setMargin(QStyleSheetItem::MarginAll,0); 79 style->setMargin(QStyleSheetItem::MarginAll,0);
80 } 80 }
81 mEventViewer = 0; 81 mEventViewer = 0;
82 82
83 QBoxLayout *topLayout = new QVBoxLayout(this); 83 QBoxLayout *topLayout = new QVBoxLayout(this);
84 // topLayout->addWidget(mDateLabel); 84 // topLayout->addWidget(mDateLabel);
85 topLayout->addWidget(mView); 85 topLayout->addWidget(mView);
86 mTimer = new QTimer( this ); 86 mTimer = new QTimer( this );
87 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView())); 87 connect(mTimer,SIGNAL( timeout() ),this, SLOT(updateView()));
88 88
89 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 89 connect(mView->horizontalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
90 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer())); 90 connect(mView->verticalScrollBar (),SIGNAL( sliderReleased () ),this, SLOT(restartTimer()));
91} 91}
92 92
93KOWhatsNextView::~KOWhatsNextView() 93KOWhatsNextView::~KOWhatsNextView()
94{ 94{
95} 95}
96 96
97int KOWhatsNextView::maxDatesHint() 97int KOWhatsNextView::maxDatesHint()
98{ 98{
99 return 0; 99 return 0;
100} 100}
101 101
102int KOWhatsNextView::currentDateCount() 102int KOWhatsNextView::currentDateCount()
103{ 103{
104 return 0; 104 return 0;
105} 105}
106 106
107QPtrList<Incidence> KOWhatsNextView::selectedIncidences() 107QPtrList<Incidence> KOWhatsNextView::selectedIncidences()
108{ 108{
109 QPtrList<Incidence> eventList; 109 QPtrList<Incidence> eventList;
110 110
111 return eventList; 111 return eventList;
112} 112}
113 113
114 114void KOWhatsNextView::printMe()
115{
116#ifdef DESKTOP_VERSION
117 QPrinter printer;
118 if (!printer.setup() )
119 return;
120 QTextBrowser tb;
121 tb.setFixedSize( 600, 4000 );
122 QPainter::redirect ( tb.viewport(), &printer );
123 updateView();
124 tb.setText( mText );
125 tb.show();
126 tb.repaint();
127 tb.hide();
128 KMessageBox::information( this, i18n("Printing What's Next View!\n\nPlease close after\nprinting is finished."));
129#endif
130}
115void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd, 131void KOWhatsNextView::printPreview(CalPrinter *calPrinter, const QDate &fd,
116 const QDate &td) 132 const QDate &td)
117{ 133{
118#ifndef KORG_NOPRINTER 134#ifndef KORG_NOPRINTER
119 calPrinter->preview(CalPrinter::Day, fd, td); 135 calPrinter->preview(CalPrinter::Day, fd, td);
120#endif 136#endif
121} 137}
122void KOWhatsNextView::updateConfig() 138void KOWhatsNextView::updateConfig()
123{ 139{
124 setFont( KOPrefs::instance()->mWhatsNextFont ); 140 setFont( KOPrefs::instance()->mWhatsNextFont );
125 updateView(); 141 updateView();
126 142
127} 143}
128void KOWhatsNextView::showEvent ( QShowEvent * e ) 144void KOWhatsNextView::showEvent ( QShowEvent * e )
129{ 145{
130 //qDebug("KOWhatsNextView::showEvent "); 146 //qDebug("KOWhatsNextView::showEvent ");
131 restartTimer(); 147 restartTimer();
132 QWidget::showEvent ( e ); 148 QWidget::showEvent ( e );
133} 149}
134void KOWhatsNextView::hideEvent ( QHideEvent * e) 150void KOWhatsNextView::hideEvent ( QHideEvent * e)
135{ 151{
136 //qDebug(" KOWhatsNextView::hideEvent"); 152 //qDebug(" KOWhatsNextView::hideEvent");
137 mTimer->stop(); 153 mTimer->stop();
138 QWidget::hideEvent ( e ); 154 QWidget::hideEvent ( e );
139} 155}
140void KOWhatsNextView::restartTimer() 156void KOWhatsNextView::restartTimer()
141{ 157{
142 //qDebug("KOWhatsNextView::restartTimer() "); 158 //qDebug("KOWhatsNextView::restartTimer() ");
143 mTimer->start( 300000 ); 159 mTimer->start( 300000 );
144 //mTimer->start( 5000 ); 160 //mTimer->start( 5000 );
145} 161}
146void KOWhatsNextView::updateView() 162void KOWhatsNextView::updateView()
147{ 163{
148 if ( mTimer->isActive() ) 164 if ( mTimer->isActive() )
149 restartTimer(); 165 restartTimer();
150 //qDebug("KOWhatsNextView::updateView() "); 166 //qDebug("KOWhatsNextView::updateView() ");
151 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate())); 167 // mDateLabel->setText(KGlobal::locale()->formatDate(QDate::currentDate()));
152 KIconLoader kil("korganizer"); 168 KIconLoader kil("korganizer");
153 QString ipath;// = new QString(); 169 QString ipath;// = new QString();
154 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath); 170 // kil.loadIcon("korganizer",KIcon::NoGroup,32,KIcon::DefaultState,&ipath);
155 //<big><big><strong>" + date + "</strong></big></big>\n"; 171 //<big><big><strong>" + date + "</strong></big></big>\n";
156 mText = "<table width=\"100%\">\n"; 172 mText = "<table width=\"100%\">\n";
157 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>"; 173 //mText += "<tr bgcolor=\"#3679AD\"><td><h2>";
158#ifdef DESKTOP_VERSION 174#ifdef DESKTOP_VERSION
159 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>"; 175 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h1>";
160#else 176#else
161 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>"; 177 mText += "<tr bgcolor=\"#5699CD\"><td align=\"center\"><h2>";
162#endif 178#endif
163 // mText += "<img src=\""; 179 // mText += "<img src=\"";
164 // mText += ipath; 180 // mText += ipath;
165 // mText += "\">"; 181 // mText += "\">";
166 mEventDate = QDate::currentDate(); 182 mEventDate = QDate::currentDate();
167#ifdef DESKTOP_VERSION 183#ifdef DESKTOP_VERSION
168 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>"; 184 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h1>";
169#else 185#else
170 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>"; 186 mText += "<font color=\"#FFFFFF\"> <em>" + KGlobal::locale()->formatDate( mEventDate , false )+"</em></font></h2>";
171#endif 187#endif
172 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>"; 188 mText += "</td></tr>\n<tr bgcolor=\"#EAF8FA\"><td>";
173 int iii; 189 int iii;
174 mTodos.clear(); 190 mTodos.clear();
175 QPtrList<Event> events; 191 QPtrList<Event> events;
176 QPtrList<Todo> todos = calendar()->todos(); 192 QPtrList<Todo> todos = calendar()->todos();
177 Todo * todo; 193 Todo * todo;
178 //mText += "<h2>" + i18n("Events: ") + "</h2>\n"; 194 //mText += "<h2>" + i18n("Events: ") + "</h2>\n";
179 int daysToShow = KOPrefs::instance()->mWhatsNextDays ; 195 int daysToShow = KOPrefs::instance()->mWhatsNextDays ;
180 bool itemAdded = false; 196 bool itemAdded = false;
181 for ( iii = 0; iii < daysToShow; ++iii ) { 197 for ( iii = 0; iii < daysToShow; ++iii ) {
182 QString date; 198 QString date;
183 itemAdded = false; 199 itemAdded = false;
184 events = calendar()->events( mEventDate, true ); 200 events = calendar()->events( mEventDate, true );
185 201
186 if ( iii == 0 ) { // today !!! 202 if ( iii == 0 ) { // today !!!
187 todo = todos.first(); 203 todo = todos.first();
188 while(todo) { 204 while(todo) {
189 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) { 205 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() < mEventDate ) {
190 if ( ! itemAdded ) { 206 if ( ! itemAdded ) {
191 appendDay ( iii, mEventDate ); 207 appendDay ( iii, mEventDate );
192 //itemAdded = true; 208 //itemAdded = true;
193 209
194 } //bool reply=false, bool notRed = true, bool appendTable = false); 210 } //bool reply=false, bool notRed = true, bool appendTable = false);
195 appendEvent(todo, false, false, !itemAdded ); 211 appendEvent(todo, false, false, !itemAdded );
196 itemAdded = true; 212 itemAdded = true;
197 } 213 }
198 todo = todos.next(); 214 todo = todos.next();
199 } 215 }
200 } 216 }
201 217
202 218
203 if (events.count() > 0) { 219 if (events.count() > 0) {
204 // mText += "<p></p>"; 220 // mText += "<p></p>";
205 // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 221 // kil.loadIcon("month",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
206 // mText += "<h2>"; 222 // mText += "<h2>";
207 //mText += " <img src=\""; 223 //mText += " <img src=\"";
208 //mText += ipath; 224 //mText += ipath;
209 //mText += "\">"; 225 //mText += "\">";
210 if ( ! itemAdded ) { 226 if ( ! itemAdded ) {
211 appendDay ( iii, mEventDate ); 227 appendDay ( iii, mEventDate );
212 228
213 } 229 }
214 // for first day (iii == 0) 230 // for first day (iii == 0)
215 // we may have syncevents, or events in the past, which maybe should not be diaplayed 231 // we may have syncevents, or events in the past, which maybe should not be diaplayed
216 // for that reason we cannot append <table> in appendDay () for iii == 0 232 // for that reason we cannot append <table> in appendDay () for iii == 0
217 // we must append it in the first successful call of appendEvent() 233 // we must append it in the first successful call of appendEvent()
218 Event *ev = events.first(); 234 Event *ev = events.first();
219 while(ev) { 235 while(ev) {
220 //qDebug("+++++event append %s", ev->summary().latin1()); 236 //qDebug("+++++event append %s", ev->summary().latin1());
221 if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) { 237 if ( true /*!ev->recurrence()->doesRecur() || ev->recursOn( mEventDate)*/) {
222 if ( appendEvent(ev, false , iii!= 0,!itemAdded ) ) 238 if ( appendEvent(ev, false , iii!= 0,!itemAdded ) )
223 itemAdded = true; 239 itemAdded = true;
224 } 240 }
225 ev = events.next(); 241 ev = events.next();
226 } 242 }
227 243
228 //mText += "</table>\n"; 244 //mText += "</table>\n";
229 } 245 }
230 246
231 todo = todos.first(); 247 todo = todos.first();
232 while(todo) { 248 while(todo) {
233 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) { 249 if ( !todo->isCompleted() &&todo->hasDueDate() && todo->dtDue().date() == mEventDate ) {
234 if ( ! itemAdded ) { 250 if ( ! itemAdded ) {
235 appendDay ( iii, mEventDate ); 251 appendDay ( iii, mEventDate );
236 //itemAdded = true; 252 //itemAdded = true;
237 } 253 }
238 appendEvent(todo, false , iii!= 0,!itemAdded); 254 appendEvent(todo, false , iii!= 0,!itemAdded);
239 itemAdded = true; 255 itemAdded = true;
240 } 256 }
241 todo = todos.next(); 257 todo = todos.next();
242 } 258 }
243 if ( !itemAdded && iii == 0 ) { 259 if ( !itemAdded && iii == 0 ) {
244 // appendDay ( iii, mEventDate ); 260 // appendDay ( iii, mEventDate );
245 //mText += "<table>"; 261 //mText += "<table>";
246 // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n"; 262 // mText += "<b><font color=\"#000080\"><em>"+i18n("No event, nothing to do.") +"</em></font></b>\n";
247 mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n"; 263 mText += "<h3 align=\"center\"><font color=\"#008000\"><em>"+i18n("No event, nothing to do.") +"</em></font></h3>\n";
248 //mText +="</table>"; 264 //mText +="</table>";
249 } 265 }
250 if ( itemAdded ) 266 if ( itemAdded )
251 mText += "</table>\n"; 267 mText += "</table>\n";
252 mEventDate = mEventDate.addDays( 1 ); 268 mEventDate = mEventDate.addDays( 1 );
253 } 269 }
254 270
255 int topmostPrios = KOPrefs::instance()->mWhatsNextPrios; 271 int topmostPrios = KOPrefs::instance()->mWhatsNextPrios;
256 if (todos.count() > 0 && topmostPrios > 0 ) { 272 if (todos.count() > 0 && topmostPrios > 0 ) {
257 // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 273 // kil.loadIcon("todo",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
258 // mText += "<h2>"; 274 // mText += "<h2>";
259 //<img src=\""; 275 //<img src=\"";
260 // mText += ipath; 276 // mText += ipath;
261 // mText += "\">"; 277 // mText += "\">";
262 // mText += i18n("Overdue To-Do:") + "</h2>\n"; 278 // mText += i18n("Overdue To-Do:") + "</h2>\n";
263 279
264 //mText += "<ul>\n"; 280 //mText += "<ul>\n";
265 bool gotone = false; 281 bool gotone = false;
266 int priority = 1; 282 int priority = 1;
267 int priosFound = 0; 283 int priosFound = 0;
268#ifdef DESKTOP_VERSION 284#ifdef DESKTOP_VERSION
269 mText +="<p></p>"; 285 mText +="<p></p>";
270#endif 286#endif
271 287
272 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n"; 288 mText +="<h2><em><font color=\"#000080\">" + i18n("Incomplete Todo:") + "</font></em></h2>\n";
273 mText += "<ul>\n"; 289 mText += "<ul>\n";
274 while (!gotone && priority<6) { 290 while (!gotone && priority<6) {
275 todo = todos.first(); 291 todo = todos.first();
276 while(todo) { 292 while(todo) {
277 if (!todo->isCompleted() && (todo->priority() == priority) ) { 293 if (!todo->isCompleted() && (todo->priority() == priority) ) {
278 if ( appendTodo(todo) ) 294 if ( appendTodo(todo) )
279 gotone = true; 295 gotone = true;
280 } 296 }
281 todo = todos.next(); 297 todo = todos.next();
282 } 298 }
283 if ( gotone ) { 299 if ( gotone ) {
284 gotone = false; 300 gotone = false;
285 ++priosFound; 301 ++priosFound;
286 if ( priosFound == topmostPrios ) 302 if ( priosFound == topmostPrios )
287 break; 303 break;
288 } 304 }
289 priority++; 305 priority++;
290 // kdDebug() << "adding the todos..." << endl; 306 // kdDebug() << "adding the todos..." << endl;
291 } 307 }
292 mText += "</ul>\n"; 308 mText += "</ul>\n";
293 } 309 }
294 310
295 int replys = 0; 311 int replys = 0;
296 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6)); 312 events = calendar()->events(QDate::currentDate(), QDate(2975,12,6));
297 if (events.count() > 0) { 313 if (events.count() > 0) {
298 Event *ev = events.first(); 314 Event *ev = events.first();
299 while(ev) { 315 while(ev) {
300 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email()); 316 Attendee *me = ev->attendeeByMails(KOPrefs::instance()->mAdditionalMails,KOPrefs::instance()->email());
301 if (me!=0) { 317 if (me!=0) {
302 if (me->status()==Attendee::NeedsAction && me->RSVP()) { 318 if (me->status()==Attendee::NeedsAction && me->RSVP()) {
303 if (replys == 0) { 319 if (replys == 0) {
304 mText += "<p></p>"; 320 mText += "<p></p>";
305 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath); 321 // kil.loadIcon("reply",KIcon::NoGroup,22,KIcon::DefaultState,&ipath);
306 //mText += "<h2>"; 322 //mText += "<h2>";
@@ -485,224 +501,225 @@ bool KOWhatsNextView::appendEvent(Incidence *ev, bool reply, bool notRed, bool a
485 if ( notRed ) 501 if ( notRed )
486 tempText += dateText; 502 tempText += dateText;
487 else { 503 else {
488 if ( end < cdt ) { 504 if ( end < cdt ) {
489 if ( !KOPrefs::instance()->mWNViewShowsPast ) 505 if ( !KOPrefs::instance()->mWNViewShowsPast )
490 return false; 506 return false;
491 tempText += "<font color=\"#F00000\">" + dateText + "</font>"; 507 tempText += "<font color=\"#F00000\">" + dateText + "</font>";
492 } 508 }
493 else if ( st < cdt ) 509 else if ( st < cdt )
494 tempText += "<font color=\"#008000\">" + dateText + "</font>"; 510 tempText += "<font color=\"#008000\">" + dateText + "</font>";
495 else 511 else
496 tempText += dateText; 512 tempText += dateText;
497 513
498 } 514 }
499 515
500 } else { 516 } else {
501 tempText += i18n("Allday:"); 517 tempText += i18n("Allday:");
502 518
503 } 519 }
504 } 520 }
505 } else { 521 } else {
506 mTodos.append( ev ); 522 mTodos.append( ev );
507 tempText += i18n("ToDo:"); 523 tempText += i18n("ToDo:");
508 if (reply) { 524 if (reply) {
509 tempText += " "; 525 tempText += " ";
510 if ( noc != cdt ) { 526 if ( noc != cdt ) {
511 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": "; 527 tempText += KGlobal::locale()->formatDate( noc.date() , KOPrefs::instance()->mShortDateInViewer) +": ";
512 } 528 }
513 } else { 529 } else {
514 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) { 530 if ( ((Todo*)ev)->dtDue().date() < QDate::currentDate() ) {
515 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>"; 531 // tempText +="<font color=\"#F00000\">" + i18n("O-due!") + "</font>";
516 QString dfs = KGlobal::locale()->dateFormatShort(); 532 QString dfs = KGlobal::locale()->dateFormatShort();
517 KGlobal::locale()->setDateFormatShort("%d.%b"); 533 KGlobal::locale()->setDateFormatShort("%d.%b");
518 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>"; 534 tempText +="<font color=\"#F00000\">" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "</font>";
519 KGlobal::locale()->setDateFormatShort(dfs); 535 KGlobal::locale()->setDateFormatShort(dfs);
520 } else { 536 } else {
521 if (!ev->doesFloat() ) 537 if (!ev->doesFloat() )
522 if( ( (Todo*)ev)->dtDue() < cdt ) { 538 if( ( (Todo*)ev)->dtDue() < cdt ) {
523 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>"; 539 tempText +="<font color=\"#F00000\">" + ((Todo*)ev)->dtDueTimeStr() + "</font>";
524 540
525 541
526 } else 542 } else
527 tempText +=((Todo*)ev)->dtDueTimeStr(); 543 tempText +=((Todo*)ev)->dtDueTimeStr();
528 mTodos.append( ev ); 544 mTodos.append( ev );
529 } 545 }
530 } 546 }
531 } 547 }
532 tempText += "</b></td><td>"; 548 tempText += "</b></td><td>";
533 bool needClose = false; 549 bool needClose = false;
534 if ( ev->cancelled() ) { 550 if ( ev->cancelled() ) {
535 tempText += "<font color=\"#F00000\">[c"; 551 tempText += "<font color=\"#F00000\">[c";
536 needClose =true; 552 needClose =true;
537 553
538 } 554 }
539 if ( ev->isAlarmEnabled() ) { 555 if ( ev->isAlarmEnabled() ) {
540 if ( !needClose) 556 if ( !needClose)
541 tempText +="["; 557 tempText +="[";
542 tempText += "a"; 558 tempText += "a";
543 needClose =true; 559 needClose =true;
544 560
545 } 561 }
546 if ( ev->description().length() > 0 ) { 562 if ( ev->description().length() > 0 ) {
547 if ( !needClose) 563 if ( !needClose)
548 tempText +="["; 564 tempText +="[";
549 tempText += "i"; 565 tempText += "i";
550 needClose =true; 566 needClose =true;
551 } 567 }
552 if ( ev->recurrence()->doesRecur() ) { 568 if ( ev->recurrence()->doesRecur() ) {
553 if ( !needClose) 569 if ( !needClose)
554 tempText +="["; 570 tempText +="[";
555 tempText += "r"; 571 tempText += "r";
556 needClose =true; 572 needClose =true;
557 } 573 }
558 if ( needClose ) { 574 if ( needClose ) {
559 tempText += "] "; 575 tempText += "] ";
560 } 576 }
561 if ( ev->cancelled() ) 577 if ( ev->cancelled() )
562 tempText += "</font>"; 578 tempText += "</font>";
563 tempText += "<a "; 579 tempText += "<a ";
564 if (ev->type()=="Event") tempText += "href=\"event:"; 580 if (ev->type()=="Event") tempText += "href=\"event:";
565 if (ev->type()=="Todo") tempText += "href=\"todo:"; 581 if (ev->type()=="Todo") tempText += "href=\"todo:";
566 tempText += ev->uid() + "\">"; 582 tempText += ev->uid() + "\">";
567 if ( ev->summary().length() > 0 ) 583 if ( ev->summary().length() > 0 )
568 tempText += ev->summary(); 584 tempText += ev->summary();
569 else 585 else
570 tempText += i18n("-no summary-"); 586 tempText += i18n("-no summary-");
571 tempText += "</a>"; 587 tempText += "</a>";
572 if ( KOPrefs::instance()->mWNViewShowLocation ) 588 if ( KOPrefs::instance()->mWNViewShowLocation )
573 if ( !ev->location().isEmpty() ) 589 if ( !ev->location().isEmpty() )
574 tempText += " ("+ev->location() +")"; 590 tempText += " ("+ev->location() +")";
575 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents) 591 if ( ev->relatedTo() && KOPrefs::instance()->mWNViewShowsParents)
576 tempText += " ["+ev->relatedTo()->summary() +"]"; 592 tempText += " ["+ev->relatedTo()->summary() +"]";
577 tempText += "</td></tr>\n"; 593 tempText += "</td></tr>\n";
578 mText += tempText; 594 mText += tempText;
579 return true; 595 return true;
580} 596}
581 597
582bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub ) 598bool KOWhatsNextView::appendTodo(Incidence *ev, QString ind , bool isSub )
583{ 599{
584 if ( mTodos.find( ev ) != mTodos.end() ) return false; 600 if ( mTodos.find( ev ) != mTodos.end() ) return false;
585 601
586 mTodos.append( ev ); 602 mTodos.append( ev );
587 if ( !isSub ) 603 if ( !isSub )
588 mText += "<p>"; 604 mText += "<p>";
589 else 605 else
590 mText += "<li>"; 606 mText += "<li>";
591 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] "; 607 mText += "[" +QString::number(ev->priority()) + "/" + QString::number(((Todo*)ev)->percentComplete())+"%] ";
592 608
593 609
594 mText += ind; 610 mText += ind;
595 bool needClose = false; 611 bool needClose = false;
596 if ( ev->cancelled() ) { 612 if ( ev->cancelled() ) {
597 mText += "<font color=\"#F00000\">[c"; 613 mText += "<font color=\"#F00000\">[c";
598 needClose =true; 614 needClose =true;
599 615
600 } 616 }
601 if ( ev->isAlarmEnabled() ) { 617 if ( ev->isAlarmEnabled() ) {
602 if ( !needClose) 618 if ( !needClose)
603 mText +="["; 619 mText +="[";
604 mText += "a"; 620 mText += "a";
605 needClose =true; 621 needClose =true;
606 622
607 } 623 }
608 624
609 if ( ev->description().length() > 0 ) { 625 if ( ev->description().length() > 0 ) {
610 if ( !needClose) 626 if ( !needClose)
611 mText +="["; 627 mText +="[";
612 mText += "i"; 628 mText += "i";
613 needClose =true; 629 needClose =true;
614 } 630 }
615 // if ( ev->recurrence()->doesRecur() ) { 631 // if ( ev->recurrence()->doesRecur() ) {
616 // if ( !needClose) 632 // if ( !needClose)
617 // mText +="("; 633 // mText +="(";
618 // mText += "r"; 634 // mText += "r";
619 // needClose =true; 635 // needClose =true;
620 // } 636 // }
621 if ( needClose ) 637 if ( needClose )
622 mText += "] "; 638 mText += "] ";
623 if ( ev->cancelled() ) 639 if ( ev->cancelled() )
624 mText += "</font>"; 640 mText += "</font>";
625 mText += "<a href=\"todo:" + ev->uid() + "\">"; 641 mText += "<a href=\"todo:" + ev->uid() + "\">";
626 mText += ev->summary(); 642 mText += ev->summary();
627 mText += "</a>"; 643 mText += "</a>";
628 if ( ((Todo*)ev)->hasDueDate () ) { 644 if ( ((Todo*)ev)->hasDueDate () ) {
629 QString year = ""; 645 QString year = "";
630 int ye = ((Todo*)ev)->dtDue().date().year(); 646 int ye = ((Todo*)ev)->dtDue().date().year();
631 if ( QDateTime::currentDateTime().date().year() != ye ) 647 if ( QDateTime::currentDateTime().date().year() != ye )
632 year = QString::number( ye ); 648 year = QString::number( ye );
633 QString dfs = KGlobal::locale()->dateFormatShort(); 649 QString dfs = KGlobal::locale()->dateFormatShort();
634 KGlobal::locale()->setDateFormatShort("%d.%b"); 650 KGlobal::locale()->setDateFormatShort("%d.%b");
635 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>"; 651 mText +="<font color=\"#00A000\"> [" + KGlobal::locale()->formatDate(((Todo*)ev)->dtDue().date(), true, KLocale::Userdefined) + "."+ year +"]</font>";
636 KGlobal::locale()->setDateFormatShort(dfs); 652 KGlobal::locale()->setDateFormatShort(dfs);
637 } 653 }
638 if ( KOPrefs::instance()->mWNViewShowLocation ) 654 if ( KOPrefs::instance()->mWNViewShowLocation )
639 if ( !ev->location().isEmpty() ) 655 if ( !ev->location().isEmpty() )
640 mText += " ("+ev->location() +")"; 656 mText += " ("+ev->location() +")";
641 if ( !isSub ) { 657 if ( !isSub ) {
642 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents) 658 if ( ((Todo*)ev)->relatedTo()&& KOPrefs::instance()->mWNViewShowsParents)
643 mText += " ["+ev->relatedTo()->summary() +"]"; 659 mText += " ["+ev->relatedTo()->summary() +"]";
644 mText += "</p>\n"; 660 mText += "</p>\n";
645 } 661 }
646 else { 662 else {
647 ind += "-"; 663 ind += "-";
648 mText += "</li>\n"; 664 mText += "</li>\n";
649 } 665 }
650 QPtrList<Incidence> Relations = ev->relations(); 666 QPtrList<Incidence> Relations = ev->relations();
651 Incidence *to; 667 Incidence *to;
652 for (to=Relations.first();to;to=Relations.next()) { 668 for (to=Relations.first();to;to=Relations.next()) {
653 if (!((Todo*)to)->isCompleted()) 669 if (!((Todo*)to)->isCompleted())
654 appendTodo( to, ind , true ); 670 appendTodo( to, ind , true );
655 } 671 }
656 672
657 return true; 673 return true;
658} 674}
659 675
660/* 676/*
661 void KOWhatsNextView::createEventViewer() 677 void KOWhatsNextView::createEventViewer()
662 { 678 {
663 if (!mEventViewer) { 679 if (!mEventViewer) {
664 680
665 mEventViewer = new KOEventViewerDialog(this); 681 mEventViewer = new KOEventViewerDialog(this);
666 } 682 }
667 } 683 }
668*/ 684*/
669void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v ) 685void KOWhatsNextView::setEventViewer(KOEventViewerDialog* v )
670{ 686{
671 mEventViewer = v; 687 mEventViewer = v;
672} 688}
673 689
674// TODO: Create this function in CalendarView and remove it from here 690// TODO: Create this function in CalendarView and remove it from here
675void KOWhatsNextView::showIncidence(const QString &uid) 691void KOWhatsNextView::showIncidence(const QString &uid)
676{ 692{
693
677 if ( !mEventViewer ) { 694 if ( !mEventViewer ) {
678 qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set "); 695 qDebug("KOWhatsNextView::showIncidence::sorry, no event viewer set ");
679 return; 696 return;
680 } 697 }
681 //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl; 698 //kdDebug() << "KOWhatsNextView::showIncidence(): " << uid << endl;
682 //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1()); 699 //qDebug("KOWhatsNextView::showIncidence %s ", uid.latin1());
683 if (uid.startsWith("event:")) { 700 if (uid.startsWith("event:")) {
684#ifdef DESKTOP_VERSION 701#ifdef DESKTOP_VERSION
685 Event *event = calendar()->event(uid.mid(8)); 702 Event *event = calendar()->event(uid.mid(8));
686#else 703#else
687 Event *event = calendar()->event(uid.mid(6)); 704 Event *event = calendar()->event(uid.mid(6));
688#endif 705#endif
689 //qDebug("event %d uid %s ", event, uid.mid(6).latin1()); 706 //qDebug("event %d uid %s ", event, uid.mid(6).latin1());
690 if (!event) return; 707 if (!event) return;
691 //createEventViewer(); 708 //createEventViewer();
692 mEventViewer->setEvent(event); 709 mEventViewer->setEvent(event);
693 } else if (uid.startsWith("todo:")) { 710 } else if (uid.startsWith("todo:")) {
694#ifdef DESKTOP_VERSION 711#ifdef DESKTOP_VERSION
695 Todo *todo = calendar()->todo(uid.mid(7)); 712 Todo *todo = calendar()->todo(uid.mid(7));
696#else 713#else
697 Todo *todo = calendar()->todo(uid.mid(5)); 714 Todo *todo = calendar()->todo(uid.mid(5));
698#endif 715#endif
699 if (!todo) return; 716 if (!todo) return;
700 //createEventViewer(); 717 //createEventViewer();
701 mEventViewer->setTodo(todo); 718 mEventViewer->setTodo(todo);
702 } else { 719 } else {
703 return; 720 return;
704 721
705 } 722 }
706 mEventViewer->showMe(); 723 mEventViewer->showMe();
707 mEventViewer->raise(); 724 mEventViewer->raise();
708} 725}
diff --git a/korganizer/kowhatsnextview.h b/korganizer/kowhatsnextview.h
index 9049268..0231cf2 100644
--- a/korganizer/kowhatsnextview.h
+++ b/korganizer/kowhatsnextview.h
@@ -1,96 +1,99 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18*/ 18*/
19#ifndef KOWHATSNEXTVIEW_H 19#ifndef KOWHATSNEXTVIEW_H
20#define KOWHATSNEXTVIEW_H 20#define KOWHATSNEXTVIEW_H
21 21
22#include <qtextbrowser.h> 22#include <qtextbrowser.h>
23#include <qtimer.h> 23#include <qtimer.h>
24 24
25#include <korganizer/baseview.h> 25#include <korganizer/baseview.h>
26 26
27class QListView; 27class QListView;
28class QLabel; 28class QLabel;
29 29
30class KOEventViewerDialog; 30class KOEventViewerDialog;
31 31
32#include <qpainter.h>
33#include <qwidget.h>
32class WhatsNextTextBrowser : public QTextBrowser { 34class WhatsNextTextBrowser : public QTextBrowser {
33 Q_OBJECT 35 Q_OBJECT
34 public: 36 public:
35 WhatsNextTextBrowser(QWidget *parent) : QTextBrowser(parent) {} 37 WhatsNextTextBrowser(QWidget *parent) : QTextBrowser(parent) {}
36 38
37 void setSource(const QString &); 39 void setSource(const QString &);
38 40
39 signals: 41 signals:
40 void showIncidence(const QString &uid); 42 void showIncidence(const QString &uid);
41}; 43};
42 44
43 45
44/** 46/**
45 This class provides a view of the next events and todos 47 This class provides a view of the next events and todos
46*/ 48*/
47class KOWhatsNextView : public KOrg::BaseView 49class KOWhatsNextView : public KOrg::BaseView
48{ 50{
49 Q_OBJECT 51 Q_OBJECT
50 public: 52 public:
51 KOWhatsNextView(Calendar *calendar, QWidget *parent = 0, 53 KOWhatsNextView(Calendar *calendar, QWidget *parent = 0,
52 const char *name = 0); 54 const char *name = 0);
53 ~KOWhatsNextView(); 55 ~KOWhatsNextView();
54 56
55 virtual int maxDatesHint(); 57 virtual int maxDatesHint();
56 virtual int currentDateCount(); 58 virtual int currentDateCount();
57 void setEventViewer(KOEventViewerDialog* v ); 59 void setEventViewer(KOEventViewerDialog* v );
58 virtual QPtrList<Incidence> selectedIncidences(); 60 virtual QPtrList<Incidence> selectedIncidences();
59 DateList selectedDates() 61 DateList selectedDates()
60 {DateList q; 62 {DateList q;
61 return q;} 63 return q;}
62 virtual void printPreview(CalPrinter *calPrinter, 64 virtual void printPreview(CalPrinter *calPrinter,
63 const QDate &, const QDate &); 65 const QDate &, const QDate &);
64 66
65 public slots: 67 public slots:
66 virtual void updateView(); 68 virtual void updateView();
69 void printMe();
67 virtual void showDates(const QDate &start, const QDate &end); 70 virtual void showDates(const QDate &start, const QDate &end);
68 virtual void showEvents(QPtrList<Event> eventList); 71 virtual void showEvents(QPtrList<Event> eventList);
69 void updateConfig(); 72 void updateConfig();
70 void changeEventDisplay(Event *, int); 73 void changeEventDisplay(Event *, int);
71 74
72 protected: 75 protected:
73 bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false); 76 bool appendEvent(Incidence *, bool reply=false, bool notRed = true, bool appendTable = false);
74 bool appendTodo(Incidence *, QString ind = "", bool isSub = false ); 77 bool appendTodo(Incidence *, QString ind = "", bool isSub = false );
75 void appendDay( int i, QDate date ); 78 void appendDay( int i, QDate date );
76 QDate mEventDate; 79 QDate mEventDate;
77 virtual void showEvent ( QShowEvent * ); 80 virtual void showEvent ( QShowEvent * );
78 virtual void hideEvent ( QHideEvent * ); 81 virtual void hideEvent ( QHideEvent * );
79 82
80 private slots: 83 private slots:
81 void showIncidence(const QString &); 84 void showIncidence(const QString &);
82 void restartTimer(); 85 void restartTimer();
83 86
84 87
85 private: 88 private:
86 //void createEventViewer(); 89 //void createEventViewer();
87 QTimer* mTimer; 90 QTimer* mTimer;
88 QTextBrowser *mView; 91 QTextBrowser *mView;
89 QString mText; 92 QString mText;
90 // QLabel *mDateLabel; 93 // QLabel *mDateLabel;
91 KOEventViewerDialog *mEventViewer; 94 KOEventViewerDialog *mEventViewer;
92 95
93 QValueList<Incidence *> mTodos; 96 QValueList<Incidence *> mTodos;
94}; 97};
95 98
96#endif 99#endif
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 6bc5b3a..def8431 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -656,385 +656,389 @@ void MainWindow::initActions()
656 mView->viewManager(), SLOT( showMonthView() ) ); 656 mView->viewManager(), SLOT( showMonthView() ) );
657 657
658 icon = loadPixmap( pathString + "todo" ); 658 icon = loadPixmap( pathString + "todo" );
659 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 ); 659 configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
660 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this ); 660 QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
661 todoview_action->addTo( viewMenu ); 661 todoview_action->addTo( viewMenu );
662 connect( todoview_action, SIGNAL( activated() ), 662 connect( todoview_action, SIGNAL( activated() ),
663 mView->viewManager(), SLOT( showTodoView() ) ); 663 mView->viewManager(), SLOT( showTodoView() ) );
664 664
665 icon = loadPixmap( pathString + "journal" ); 665 icon = loadPixmap( pathString + "journal" );
666 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 ); 666 configureToolBarMenu->insertItem(icon, i18n("Journal"), 90 );
667 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this ); 667 QAction* viewjournal_action = new QAction( i18n("Journal"), icon, i18n("Journal"), 0, this );
668 viewjournal_action->addTo( viewMenu ); 668 viewjournal_action->addTo( viewMenu );
669 connect( viewjournal_action, SIGNAL( activated() ), 669 connect( viewjournal_action, SIGNAL( activated() ),
670 mView->viewManager(), SLOT( showJournalView() ) ); 670 mView->viewManager(), SLOT( showJournalView() ) );
671 671
672 icon = loadPixmap( pathString + "xdays" ); 672 icon = loadPixmap( pathString + "xdays" );
673 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 ); 673 configureToolBarMenu->insertItem(icon, i18n("Next days"), 100,4 );
674 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this ); 674 QAction* xdays_action = new QAction( i18n("Next days"), icon, i18n("Next days"), 0, this );
675 xdays_action->addTo( viewMenu ); 675 xdays_action->addTo( viewMenu );
676 connect( xdays_action, SIGNAL( activated() ), 676 connect( xdays_action, SIGNAL( activated() ),
677 mView->viewManager(), SLOT( showNextXView() ) ); 677 mView->viewManager(), SLOT( showNextXView() ) );
678 678
679 icon = loadPixmap( pathString + "whatsnext" ); 679 icon = loadPixmap( pathString + "whatsnext" );
680 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 ); 680 configureToolBarMenu->insertItem(icon, i18n("What's Next"), 110, 4 );
681 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this ); 681 QAction* whatsnext_action = new QAction( i18n("What's Next"), icon, i18n("What's Next"), 0, this );
682 whatsnext_action->addTo( viewMenu ); 682 whatsnext_action->addTo( viewMenu );
683 connect( whatsnext_action, SIGNAL( activated() ), 683 connect( whatsnext_action, SIGNAL( activated() ),
684 mView->viewManager(), SLOT( showWhatsNextView() ) ); 684 mView->viewManager(), SLOT( showWhatsNextView() ) );
685 685
686#if 0 686#if 0
687 action = new QAction( "view_timespan", "Time Span", 0, this ); 687 action = new QAction( "view_timespan", "Time Span", 0, this );
688 action->addTo( viewMenu ); 688 action->addTo( viewMenu );
689 connect( action, SIGNAL( activated() ), 689 connect( action, SIGNAL( activated() ),
690 mView->viewManager(), SLOT( showTimeSpanView() ) ); 690 mView->viewManager(), SLOT( showTimeSpanView() ) );
691#endif 691#endif
692 692
693 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0, 693 mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
694 this ); 694 this );
695 mNewSubTodoAction->addTo( actionMenu ); 695 mNewSubTodoAction->addTo( actionMenu );
696 connect( mNewSubTodoAction, SIGNAL( activated() ), 696 connect( mNewSubTodoAction, SIGNAL( activated() ),
697 mView, SLOT( newSubTodo() ) ); 697 mView, SLOT( newSubTodo() ) );
698 698
699 actionMenu->insertSeparator(); 699 actionMenu->insertSeparator();
700 700
701 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this ); 701 mShowAction = new QAction( "show_incidence", i18n("Show..."), 0, this );
702 mShowAction->addTo( actionMenu ); 702 mShowAction->addTo( actionMenu );
703 connect( mShowAction, SIGNAL( activated() ), 703 connect( mShowAction, SIGNAL( activated() ),
704 mView, SLOT( showIncidence() ) ); 704 mView, SLOT( showIncidence() ) );
705 705
706 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this ); 706 mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
707 mEditAction->addTo( actionMenu ); 707 mEditAction->addTo( actionMenu );
708 connect( mEditAction, SIGNAL( activated() ), 708 connect( mEditAction, SIGNAL( activated() ),
709 mView, SLOT( editIncidence() ) ); 709 mView, SLOT( editIncidence() ) );
710 710
711 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this ); 711 mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
712 mDeleteAction->addTo( actionMenu ); 712 mDeleteAction->addTo( actionMenu );
713 connect( mDeleteAction, SIGNAL( activated() ), 713 connect( mDeleteAction, SIGNAL( activated() ),
714 mView, SLOT( deleteIncidence() ) ); 714 mView, SLOT( deleteIncidence() ) );
715 715
716 716
717 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this ); 717 mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
718 mCloneAction->addTo( actionMenu ); 718 mCloneAction->addTo( actionMenu );
719 connect( mCloneAction, SIGNAL( activated() ), 719 connect( mCloneAction, SIGNAL( activated() ),
720 mView, SLOT( cloneIncidence() ) ); 720 mView, SLOT( cloneIncidence() ) );
721 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this ); 721 mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
722 mMoveAction->addTo( actionMenu ); 722 mMoveAction->addTo( actionMenu );
723 connect( mMoveAction, SIGNAL( activated() ), 723 connect( mMoveAction, SIGNAL( activated() ),
724 mView, SLOT( moveIncidence() ) ); 724 mView, SLOT( moveIncidence() ) );
725 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this ); 725 mBeamAction = new QAction( "Beam_incidence", i18n("Beam..."), 0, this );
726 mBeamAction->addTo( actionMenu ); 726 mBeamAction->addTo( actionMenu );
727 connect( mBeamAction, SIGNAL( activated() ), 727 connect( mBeamAction, SIGNAL( activated() ),
728 mView, SLOT( beamIncidence() ) ); 728 mView, SLOT( beamIncidence() ) );
729 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this ); 729 mCancelAction = new QAction( "Cancel_incidence", i18n("Toggle Cancel"), 0, this );
730 mCancelAction->addTo( actionMenu ); 730 mCancelAction->addTo( actionMenu );
731 connect( mCancelAction, SIGNAL( activated() ), 731 connect( mCancelAction, SIGNAL( activated() ),
732 mView, SLOT( toggleCancelIncidence() ) ); 732 mView, SLOT( toggleCancelIncidence() ) );
733 733
734 actionMenu->insertSeparator(); 734 actionMenu->insertSeparator();
735 735
736 action = new QAction( "purge_completed", i18n("Purge Completed"), 0, 736 action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
737 this ); 737 this );
738 action->addTo( actionMenu ); 738 action->addTo( actionMenu );
739 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) ); 739 connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
740 740
741 icon = loadPixmap( pathString + "search" ); 741 icon = loadPixmap( pathString + "search" );
742 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this ); 742 QAction* search_action = new QAction( i18n("Search"), icon, i18n("Search..."), 0, this );
743 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4); 743 configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 4);
744 search_action->addTo( actionMenu ); 744 search_action->addTo( actionMenu );
745 connect( search_action, SIGNAL( activated() ), 745 connect( search_action, SIGNAL( activated() ),
746 mView->dialogManager(), SLOT( showSearchDialog() ) ); 746 mView->dialogManager(), SLOT( showSearchDialog() ) );
747 747
748 icon = loadPixmap( pathString + "today" ); 748 icon = loadPixmap( pathString + "today" );
749 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130); 749 configureToolBarMenu->insertItem(icon, i18n("Go to Today"), 130);
750 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this ); 750 QAction* today_action = new QAction( i18n("Go to Today"), icon, i18n("Go to Today"), 0, this );
751 today_action->addTo( actionMenu ); 751 today_action->addTo( actionMenu );
752 connect( today_action, SIGNAL( activated() ), 752 connect( today_action, SIGNAL( activated() ),
753 mView, SLOT( goToday() ) ); 753 mView, SLOT( goToday() ) );
754 754
755 if ( KOPrefs::instance()->mShowFullMenu ) { 755 if ( KOPrefs::instance()->mShowFullMenu ) {
756 actionMenu->insertSeparator(); 756 actionMenu->insertSeparator();
757 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu ); 757 actionMenu->insertItem( i18n("Configure Toolbar"),configureToolBarMenu );
758 758
759 } 759 }
760 // actionMenu->insertSeparator(); 760 // actionMenu->insertSeparator();
761 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0, 761 action = new QAction( "import_qtopia", i18n("Import (*.ics/*.vcs) file"), 0,
762 this ); 762 this );
763 action->addTo( importMenu ); 763 action->addTo( importMenu );
764 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) ); 764 connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
765 action = new QAction( "import_quick", i18n("Import last file"), 0, 765 action = new QAction( "import_quick", i18n("Import last file"), 0,
766 this ); 766 this );
767 action->addTo( importMenu ); 767 action->addTo( importMenu );
768 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) ); 768 connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
769 importMenu->insertSeparator(); 769 importMenu->insertSeparator();
770 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0, 770 action = new QAction( "import_bday", i18n("Import Birthdays (KA/Pi)"), 0,
771 this ); 771 this );
772 action->addTo( importMenu ); 772 action->addTo( importMenu );
773 connect( action, SIGNAL( activated() ), SLOT( importBday() ) ); 773 connect( action, SIGNAL( activated() ), SLOT( importBday() ) );
774#ifndef DESKTOP_VERSION 774#ifndef DESKTOP_VERSION
775 importMenu->insertSeparator(); 775 importMenu->insertSeparator();
776 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0, 776 action = new QAction( "import_qtopia", i18n("Import Opie/Qtopia Cal."), 0,
777 this ); 777 this );
778 action->addTo( importMenu ); 778 action->addTo( importMenu );
779 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) ); 779 connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
780#else 780#else
781#ifdef _WIN32_ 781#ifdef _WIN32_
782 importMenu->insertSeparator(); 782 importMenu->insertSeparator();
783 action = new QAction( "import_ol", i18n("Import from OL"), 0, 783 action = new QAction( "import_ol", i18n("Import from OL"), 0,
784 this ); 784 this );
785 action->addTo( importMenu ); 785 action->addTo( importMenu );
786 connect( action, SIGNAL( activated() ), SLOT( importOL() ) ); 786 connect( action, SIGNAL( activated() ), SLOT( importOL() ) );
787#endif 787#endif
788#endif 788#endif
789 789
790 importMenu->insertSeparator(); 790 importMenu->insertSeparator();
791 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0, 791 action = new QAction( "load_cal", i18n("Load Calendar Backup"), 0,
792 this ); 792 this );
793 action->addTo( importMenu ); 793 action->addTo( importMenu );
794 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) ); 794 connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
795 795
796 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0, 796 action = new QAction( "save_cal", i18n("Save Calendar Backup"), 0,
797 this ); 797 this );
798 action->addTo( importMenu ); 798 action->addTo( importMenu );
799 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) ); 799 connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
800 800
801 importMenu->insertSeparator(); 801 importMenu->insertSeparator();
802 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0, 802 action = new QAction( "import_qtopia", i18n("Export VCalendar"), 0,
803 this ); 803 this );
804 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) ); 804 action->addTo( importMenu ); connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
805 805
806 806
807 //LR 807 //LR
808 QPopupMenu *ex2phone = new QPopupMenu( this ); 808 QPopupMenu *ex2phone = new QPopupMenu( this );
809 ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 809 ex2phone->insertItem(i18n("Complete calendar..."), 1 );
810 ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 810 ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
811 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) ); 811 connect( ex2phone, SIGNAL( activated(int) ), this, SLOT( exportToPhone( int)) );
812 importMenu->insertItem( i18n("Export to phone"), ex2phone ); 812 importMenu->insertItem( i18n("Export to phone"), ex2phone );
813 813
814 importMenu->insertSeparator(); 814 importMenu->insertSeparator();
815 action = new QAction( "manage cat", i18n("Manage new categories..."), 0, 815 action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
816 this ); 816 this );
817 action->addTo( importMenu ); 817 action->addTo( importMenu );
818 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) ); 818 connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
819#ifndef DESKTOP_VERSION 819#ifndef DESKTOP_VERSION
820 importMenu->insertSeparator(); 820 importMenu->insertSeparator();
821 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0, 821 brAction = new QAction( "beam toggle", i18n("Beam receive enabled"), 0,
822 this ); 822 this );
823 brAction->addTo( importMenu ); 823 brAction->addTo( importMenu );
824 brAction->setToggleAction (true ) ; 824 brAction->setToggleAction (true ) ;
825 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) ); 825 connect( brAction, SIGNAL( activated() ), this, SLOT( toggleBeamReceive() ) );
826 826
827 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0, 827 action = new QAction( "beam all", i18n("Beam complete calendar..."), 0,
828 this ); 828 this );
829 action->addTo( importMenu ); 829 action->addTo( importMenu );
830 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) ); 830 connect( action, SIGNAL( activated() ), mView, SLOT( beamCalendar() ) );
831 831
832 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0, 832 action = new QAction( "beam all", i18n("Beam filtered calendar..."), 0,
833 this ); 833 this );
834 action->addTo( importMenu ); 834 action->addTo( importMenu );
835 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) ); 835 connect( action, SIGNAL( activated() ), mView, SLOT( beamFilteredCalendar()) );
836#else 836#else
837 importMenu->insertSeparator(); 837 importMenu->insertSeparator();
838 icon = loadPixmap( pathString + "print" ); 838 icon = loadPixmap( pathString + "print" );
839 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this ); 839 action = new QAction( i18n("Print calendar..."),icon,i18n("Print calendar..."), 0, this );
840 action->addTo( importMenu ); 840 action->addTo( importMenu );
841 connect( action, SIGNAL( activated() ), 841 connect( action, SIGNAL( activated() ),
842 this, SLOT( printCal() ) ); 842 this, SLOT( printCal() ) );
843 843
844 icon = loadPixmap( pathString + "print" ); 844 icon = loadPixmap( pathString + "print" );
845 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this ); 845 action = new QAction( i18n("Print agenda selection..."),icon,i18n("Print agenda selection..."), 0, this );
846 action->addTo( importMenu ); 846 action->addTo( importMenu );
847 connect( action, SIGNAL( activated() ), 847 connect( action, SIGNAL( activated() ),
848 this, SLOT( printSel() ) ); 848 this, SLOT( printSel() ) );
849 action = new QAction( i18n("Print What's Next View..."),icon,i18n("Print What's Next View..."), 0, this );
850 action->addTo( importMenu );
851 connect( action, SIGNAL( activated() ),
852 mView->viewManager(), SIGNAL( printWNV() ) );
849#endif 853#endif
850 importMenu->insertSeparator(); 854 importMenu->insertSeparator();
851 action = new QAction( "beam all", i18n("Save"), 0, 855 action = new QAction( "beam all", i18n("Save"), 0,
852 this ); 856 this );
853 action->addTo( importMenu ); 857 action->addTo( importMenu );
854 connect( action, SIGNAL( activated() ), this, SLOT( save() ) ); 858 connect( action, SIGNAL( activated() ), this, SLOT( save() ) );
855 action = new QAction( "beam all", i18n("Exit (+save)"), 0, 859 action = new QAction( "beam all", i18n("Exit (+save)"), 0,
856 this ); 860 this );
857 action->addTo( importMenu ); 861 action->addTo( importMenu );
858 connect( action, SIGNAL( activated() ), this, SLOT( close() ) ); 862 connect( action, SIGNAL( activated() ), this, SLOT( close() ) );
859 863
860 //menuBar->insertItem( "Configure",configureMenu ); 864 //menuBar->insertItem( "Configure",configureMenu );
861 //configureMenu->insertItem( "Toolbar",configureToolBarMenu ); 865 //configureMenu->insertItem( "Toolbar",configureToolBarMenu );
862 icon = loadPixmap( "korganizer/korganizer" ); 866 icon = loadPixmap( "korganizer/korganizer" );
863 867
864 action = new QAction( "Whats New", i18n("What's new?"), 0,this ); 868 action = new QAction( "Whats New", i18n("What's new?"), 0,this );
865 action->addTo( helpMenu ); 869 action->addTo( helpMenu );
866 connect( action, SIGNAL( activated() ), 870 connect( action, SIGNAL( activated() ),
867 SLOT( whatsNew() ) ); 871 SLOT( whatsNew() ) );
868 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this ); 872 action = new QAction( "featureHowto", i18n("Features + hints..."), 0,this );
869 action->addTo( helpMenu ); 873 action->addTo( helpMenu );
870 connect( action, SIGNAL( activated() ), 874 connect( action, SIGNAL( activated() ),
871 SLOT( features() ) ); 875 SLOT( features() ) );
872 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this ); 876 action = new QAction( "Keys + Colors", i18n("Keys + Colors..."), 0, this );
873 action->addTo( helpMenu ); 877 action->addTo( helpMenu );
874 connect( action, SIGNAL( activated() ), 878 connect( action, SIGNAL( activated() ),
875 SLOT( keyBindings() ) ); 879 SLOT( keyBindings() ) );
876 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this ); 880 action = new QAction( "Sync Howto", i18n("Sync HowTo..."), 0,this );
877 action->addTo( helpMenu ); 881 action->addTo( helpMenu );
878 connect( action, SIGNAL( activated() ), 882 connect( action, SIGNAL( activated() ),
879 SLOT( synchowto() ) ); 883 SLOT( synchowto() ) );
880 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this ); 884 action = new QAction( "KDE Sync Howto", i18n("KDE Sync HowTo..."), 0,this );
881 action->addTo( helpMenu ); 885 action->addTo( helpMenu );
882 connect( action, SIGNAL( activated() ), 886 connect( action, SIGNAL( activated() ),
883 SLOT( kdesynchowto() ) ); 887 SLOT( kdesynchowto() ) );
884 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this ); 888 action = new QAction( "Multi Sync Howto", i18n("Multi Sync HowTo..."), 0,this );
885 action->addTo( helpMenu ); 889 action->addTo( helpMenu );
886 connect( action, SIGNAL( activated() ), 890 connect( action, SIGNAL( activated() ),
887 SLOT( multisynchowto() ) ); 891 SLOT( multisynchowto() ) );
888 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this ); 892 action = new QAction( "Auto saving", i18n("Auto saving..."), 0, this );
889 action->addTo( helpMenu ); 893 action->addTo( helpMenu );
890 connect( action, SIGNAL( activated() ), 894 connect( action, SIGNAL( activated() ),
891 SLOT( aboutAutoSaving() ) ); 895 SLOT( aboutAutoSaving() ) );
892 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this ); 896 action = new QAction( "Problemd", i18n("Known Problems..."), 0,this );
893 action->addTo( helpMenu ); 897 action->addTo( helpMenu );
894 connect( action, SIGNAL( activated() ), 898 connect( action, SIGNAL( activated() ),
895 SLOT( aboutKnownBugs() ) ); 899 SLOT( aboutKnownBugs() ) );
896 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this ); 900 action = new QAction( "Translate Howto", i18n("User translation..."), 0,this );
897 action->addTo( helpMenu ); 901 action->addTo( helpMenu );
898 connect( action, SIGNAL( activated() ), 902 connect( action, SIGNAL( activated() ),
899 SLOT( usertrans() ) ); 903 SLOT( usertrans() ) );
900 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this ); 904 action = new QAction( "Frequently asked questions", i18n("FAQ..."), 0,this );
901 action->addTo( helpMenu ); 905 action->addTo( helpMenu );
902 connect( action, SIGNAL( activated() ), 906 connect( action, SIGNAL( activated() ),
903 SLOT( faq() ) ); 907 SLOT( faq() ) );
904 action = new QAction( "licence", i18n("Licence..."), 0, this ); 908 action = new QAction( "licence", i18n("Licence..."), 0, this );
905 action->addTo( helpMenu ); 909 action->addTo( helpMenu );
906 connect( action, SIGNAL( activated() ), 910 connect( action, SIGNAL( activated() ),
907 SLOT( licence() ) ); 911 SLOT( licence() ) );
908 action = new QAction( "about", i18n("About..."), 0, this ); 912 action = new QAction( "about", i18n("About..."), 0, this );
909 action->addTo( helpMenu ); 913 action->addTo( helpMenu );
910 connect( action, SIGNAL( activated() ), 914 connect( action, SIGNAL( activated() ),
911 SLOT( about() ) ); 915 SLOT( about() ) );
912 //menuBar->insertSeparator(); 916 //menuBar->insertSeparator();
913 917
914 // ****************************************************** 918 // ******************************************************
915 // menubar icons 919 // menubar icons
916 920
917 921
918 iconToolBar->setHorizontalStretchable (true ); 922 iconToolBar->setHorizontalStretchable (true );
919 //menuBar->insertItem( iconToolBar ); 923 //menuBar->insertItem( iconToolBar );
920 //xdays_action 924 //xdays_action
921 if (p-> mShowIconNewEvent) 925 if (p-> mShowIconNewEvent)
922 ne_action->addTo( iconToolBar ); 926 ne_action->addTo( iconToolBar );
923 if (p->mShowIconNewTodo ) 927 if (p->mShowIconNewTodo )
924 nt_action->addTo( iconToolBar ); 928 nt_action->addTo( iconToolBar );
925 if (p-> mShowIconSearch) 929 if (p-> mShowIconSearch)
926 search_action->addTo( iconToolBar ); 930 search_action->addTo( iconToolBar );
927 if (p-> mShowIconNext) 931 if (p-> mShowIconNext)
928 whatsnext_action->addTo( iconToolBar ); 932 whatsnext_action->addTo( iconToolBar );
929 if (p-> mShowIconNextDays) 933 if (p-> mShowIconNextDays)
930 xdays_action->addTo( iconToolBar ); 934 xdays_action->addTo( iconToolBar );
931 if (p-> mShowIconList) 935 if (p-> mShowIconList)
932 showlist_action->addTo( iconToolBar ); 936 showlist_action->addTo( iconToolBar );
933 if (p-> mShowIconDay1) 937 if (p-> mShowIconDay1)
934 day1_action->addTo( iconToolBar ); 938 day1_action->addTo( iconToolBar );
935 if (p-> mShowIconDay5) 939 if (p-> mShowIconDay5)
936 day5_action->addTo( iconToolBar ); 940 day5_action->addTo( iconToolBar );
937 if (p-> mShowIconDay7) 941 if (p-> mShowIconDay7)
938 day7_action->addTo( iconToolBar ); 942 day7_action->addTo( iconToolBar );
939 if (p-> mShowIconMonth) 943 if (p-> mShowIconMonth)
940 month_action->addTo( iconToolBar ); 944 month_action->addTo( iconToolBar );
941 if (p-> mShowIconTodoview) 945 if (p-> mShowIconTodoview)
942 todoview_action->addTo( iconToolBar ); 946 todoview_action->addTo( iconToolBar );
943 if (p-> mShowIconJournal) 947 if (p-> mShowIconJournal)
944 viewjournal_action->addTo( iconToolBar ); 948 viewjournal_action->addTo( iconToolBar );
945 icon = loadPixmap( pathString + "2leftarrowB" ); 949 icon = loadPixmap( pathString + "2leftarrowB" );
946 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14); 950 configureToolBarMenu->insertItem(icon, i18n("Prev. month"), 200, 14);
947 if (p-> mShowIconBackFast) { 951 if (p-> mShowIconBackFast) {
948 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this ); 952 action = new QAction( i18n("Prev. month"), icon, i18n("Prev. month"),0 , this );
949 connect( action, SIGNAL( activated() ), 953 connect( action, SIGNAL( activated() ),
950 mView, SLOT( goPreviousMonth() ) ); 954 mView, SLOT( goPreviousMonth() ) );
951 action->addTo( iconToolBar ); 955 action->addTo( iconToolBar );
952 } 956 }
953 icon = loadPixmap( pathString + "1leftarrowB" ); 957 icon = loadPixmap( pathString + "1leftarrowB" );
954 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15); 958 configureToolBarMenu->insertItem(icon, i18n("Go backward"), 210,15);
955 if (p-> mShowIconBack) { 959 if (p-> mShowIconBack) {
956 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this ); 960 action = new QAction( i18n("Go backward"), icon, i18n("Go backward"),0 , this );
957 connect( action, SIGNAL( activated() ), 961 connect( action, SIGNAL( activated() ),
958 mView, SLOT( goPrevious() ) ); 962 mView, SLOT( goPrevious() ) );
959 action->addTo( iconToolBar ); 963 action->addTo( iconToolBar );
960 } 964 }
961 if (p-> mShowIconToday) 965 if (p-> mShowIconToday)
962 today_action->addTo( iconToolBar ); 966 today_action->addTo( iconToolBar );
963 icon = loadPixmap( pathString + "1rightarrowB" ); 967 icon = loadPixmap( pathString + "1rightarrowB" );
964 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220); 968 configureToolBarMenu->insertItem(icon, i18n("Go forward"), 220);
965 if (p-> mShowIconForward) { 969 if (p-> mShowIconForward) {
966 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this ); 970 action = new QAction( i18n("Go forward"), icon, i18n("Go forward"),0 , this );
967 connect( action, SIGNAL( activated() ), 971 connect( action, SIGNAL( activated() ),
968 mView, SLOT( goNext() ) ); 972 mView, SLOT( goNext() ) );
969 action->addTo( iconToolBar ); 973 action->addTo( iconToolBar );
970 } 974 }
971 icon = loadPixmap( pathString + "2rightarrowB" ); 975 icon = loadPixmap( pathString + "2rightarrowB" );
972 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230); 976 configureToolBarMenu->insertItem(icon, i18n("Next month"), 230);
973 if (p-> mShowIconForwardFast) { 977 if (p-> mShowIconForwardFast) {
974 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this ); 978 action = new QAction( i18n("Next month"), icon, i18n("Next month"),0 , this );
975 connect( action, SIGNAL( activated() ), 979 connect( action, SIGNAL( activated() ),
976 mView, SLOT( goNextMonth() ) ); 980 mView, SLOT( goNextMonth() ) );
977 action->addTo( iconToolBar ); 981 action->addTo( iconToolBar );
978 } 982 }
979 983
980 984
981 configureToolBarMenu->insertItem(i18n("What's This?"), 300); 985 configureToolBarMenu->insertItem(i18n("What's This?"), 300);
982 986
983 if (p-> mShowIconNewEvent) 987 if (p-> mShowIconNewEvent)
984 configureToolBarMenu->setItemChecked( 10, true ); 988 configureToolBarMenu->setItemChecked( 10, true );
985 if (p->mShowIconNewTodo ) 989 if (p->mShowIconNewTodo )
986 configureToolBarMenu->setItemChecked( 20, true ); 990 configureToolBarMenu->setItemChecked( 20, true );
987 if (p-> mShowIconSearch) 991 if (p-> mShowIconSearch)
988 configureToolBarMenu->setItemChecked( 120, true ); 992 configureToolBarMenu->setItemChecked( 120, true );
989 if (p-> mShowIconList) 993 if (p-> mShowIconList)
990 configureToolBarMenu->setItemChecked( 30, true ); 994 configureToolBarMenu->setItemChecked( 30, true );
991 if (p-> mShowIconDay1) 995 if (p-> mShowIconDay1)
992 configureToolBarMenu->setItemChecked( 40, true ); 996 configureToolBarMenu->setItemChecked( 40, true );
993 if (p-> mShowIconDay5) 997 if (p-> mShowIconDay5)
994 configureToolBarMenu->setItemChecked( 50, true ); 998 configureToolBarMenu->setItemChecked( 50, true );
995 if (p-> mShowIconDay7) 999 if (p-> mShowIconDay7)
996 configureToolBarMenu->setItemChecked( 60, true ); 1000 configureToolBarMenu->setItemChecked( 60, true );
997 if (p-> mShowIconMonth) 1001 if (p-> mShowIconMonth)
998 configureToolBarMenu->setItemChecked( 70, true ); 1002 configureToolBarMenu->setItemChecked( 70, true );
999 if (p-> mShowIconTodoview) 1003 if (p-> mShowIconTodoview)
1000 configureToolBarMenu->setItemChecked( 80, true ); 1004 configureToolBarMenu->setItemChecked( 80, true );
1001 if (p-> mShowIconBackFast) 1005 if (p-> mShowIconBackFast)
1002 configureToolBarMenu->setItemChecked( 200, true ); 1006 configureToolBarMenu->setItemChecked( 200, true );
1003 if (p-> mShowIconBack) 1007 if (p-> mShowIconBack)
1004 configureToolBarMenu->setItemChecked( 210, true ); 1008 configureToolBarMenu->setItemChecked( 210, true );
1005 if (p-> mShowIconToday) 1009 if (p-> mShowIconToday)
1006 configureToolBarMenu->setItemChecked( 130, true ); 1010 configureToolBarMenu->setItemChecked( 130, true );
1007 if (p-> mShowIconForward) 1011 if (p-> mShowIconForward)
1008 configureToolBarMenu->setItemChecked( 220, true ); 1012 configureToolBarMenu->setItemChecked( 220, true );
1009 if (p-> mShowIconForwardFast) 1013 if (p-> mShowIconForwardFast)
1010 configureToolBarMenu->setItemChecked( 230, true ); 1014 configureToolBarMenu->setItemChecked( 230, true );
1011 if (p-> mShowIconNextDays) 1015 if (p-> mShowIconNextDays)
1012 configureToolBarMenu->setItemChecked( 100, true ); 1016 configureToolBarMenu->setItemChecked( 100, true );
1013 if (p-> mShowIconNext) 1017 if (p-> mShowIconNext)
1014 configureToolBarMenu->setItemChecked( 110, true ); 1018 configureToolBarMenu->setItemChecked( 110, true );
1015 if (p-> mShowIconJournal) 1019 if (p-> mShowIconJournal)
1016 configureToolBarMenu->setItemChecked( 90, true ); 1020 configureToolBarMenu->setItemChecked( 90, true );
1017 if (p-> mShowIconWhatsThis) 1021 if (p-> mShowIconWhatsThis)
1018 configureToolBarMenu->setItemChecked( 300, true ); 1022 configureToolBarMenu->setItemChecked( 300, true );
1019 1023
1020 QLabel* dummy = new QLabel( iconToolBar ); 1024 QLabel* dummy = new QLabel( iconToolBar );
1021 dummy->setBackgroundColor( iconToolBar->backgroundColor() ); 1025 dummy->setBackgroundColor( iconToolBar->backgroundColor() );
1022 if (!p-> mShowIconStretch) 1026 if (!p-> mShowIconStretch)
1023 iconToolBar->setStretchableWidget ( dummy ) ; 1027 iconToolBar->setStretchableWidget ( dummy ) ;
1024 else 1028 else
1025 configureToolBarMenu->setItemChecked( 5, true ); 1029 configureToolBarMenu->setItemChecked( 5, true );
1026 if (p-> mShowIconWhatsThis) 1030 if (p-> mShowIconWhatsThis)
1027 QWhatsThis::whatsThisButton ( iconToolBar ); 1031 QWhatsThis::whatsThisButton ( iconToolBar );
1028 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) ); 1032 connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
1029 configureAgenda( p->mHourSize ); 1033 configureAgenda( p->mHourSize );
1030 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) ); 1034 connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
1031} 1035}
1032 1036
1033void MainWindow::exportToPhone( int mode ) 1037void MainWindow::exportToPhone( int mode )
1034{ 1038{
1035 1039
1036 //ex2phone->insertItem(i18n("Complete calendar..."), 1 ); 1040 //ex2phone->insertItem(i18n("Complete calendar..."), 1 );
1037 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 ); 1041 //ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
1038 KOex2phonePrefs ex2phone; 1042 KOex2phonePrefs ex2phone;
1039 1043
1040 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection ); 1044 ex2phone.mPhoneConnection->setText( KPimGlobalPrefs::instance()->mEx2PhoneConnection );