summaryrefslogtreecommitdiffabout
path: root/korganizer/koviewmanager.cpp
Unidiff
Diffstat (limited to 'korganizer/koviewmanager.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koviewmanager.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index a9f5a41..cc0ce9b 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -232,425 +232,428 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
232 raiseCurrentView( full, true ); 232 raiseCurrentView( full, true );
233 mMainView->adaptNavigationUnits(); 233 mMainView->adaptNavigationUnits();
234} 234}
235 235
236void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView ) 236void KOViewManager::raiseCurrentView( bool fullScreen, bool callUpdateView )
237{ 237{
238 mCurrentAgendaView = 0; 238 mCurrentAgendaView = 0;
239 if ( fullScreen ) { 239 if ( fullScreen ) {
240 mMainView->leftFrame()->hide(); 240 mMainView->leftFrame()->hide();
241 } else { 241 } else {
242 mMainView->leftFrame()->show(); 242 mMainView->leftFrame()->show();
243 } 243 }
244 emit signalFullScreen( !fullScreen ); 244 emit signalFullScreen( !fullScreen );
245 if ( callUpdateView ) 245 if ( callUpdateView )
246 mMainView->updateView(); 246 mMainView->updateView();
247 247
248 if ( globalFlagBlockAgenda == 5 ) { 248 if ( globalFlagBlockAgenda == 5 ) {
249 globalFlagBlockAgenda = 4; 249 globalFlagBlockAgenda = 4;
250 globalFlagBlockAgendaItemPaint = 1; 250 globalFlagBlockAgendaItemPaint = 1;
251 } 251 }
252 mMainView->viewStack()->raiseWidget(mCurrentView); 252 mMainView->viewStack()->raiseWidget(mCurrentView);
253 if ( globalFlagBlockAgenda == 4 ) { 253 if ( globalFlagBlockAgenda == 4 ) {
254 if ( mCurrentView == mAgendaView ) { 254 if ( mCurrentView == mAgendaView ) {
255 //globalFlagBlockAgenda =1 ; 255 //globalFlagBlockAgenda =1 ;
256 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 256 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
257 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 257 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
258 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 258 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
259 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 259 mAgendaView->setStartHour( QTime::currentTime ().hour() );
260 qApp->processEvents(); 260 qApp->processEvents();
261 //qDebug("qApp->processEvents() "); 261 //qDebug("qApp->processEvents() ");
262 globalFlagBlockAgenda = 0; 262 globalFlagBlockAgenda = 0;
263 mAgendaView->repaintAgenda(); 263 mAgendaView->repaintAgenda();
264 264
265 } 265 }
266 globalFlagBlockAgenda = 0; 266 globalFlagBlockAgenda = 0;
267 } 267 }
268 emit signalAgendaView( mCurrentView == mAgendaView ); 268 emit signalAgendaView( mCurrentView == mAgendaView );
269 //qDebug("raiseCurrentView ende "); 269 //qDebug("raiseCurrentView ende ");
270 270
271} 271}
272 272
273void KOViewManager::updateView() 273void KOViewManager::updateView()
274{ 274{
275 // qDebug("KOViewManager::updateView() "); 275 // qDebug("KOViewManager::updateView() ");
276 // if we are updating mTodoView, we get endless recursion 276 // if we are updating mTodoView, we get endless recursion
277 if ( mTodoView == mCurrentView ) 277 if ( mTodoView == mCurrentView )
278 return; 278 return;
279 if ( mCurrentView ) mCurrentView->updateView(); 279 if ( mCurrentView ) mCurrentView->updateView();
280 280
281} 281}
282 282
283void KOViewManager::updateView(const QDate &start, const QDate &end) 283void KOViewManager::updateView(const QDate &start, const QDate &end)
284{ 284{
285 // kdDebug() << "KOViewManager::updateView()" << endl; 285 // kdDebug() << "KOViewManager::updateView()" << endl;
286 286
287 if (mCurrentView) mCurrentView->showDates(start, end); 287 if (mCurrentView) mCurrentView->showDates(start, end);
288 288
289 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView(); 289 if (mTodoView && mTodoView == mCurrentView ) mTodoView->updateView();
290} 290}
291 291
292 292
293void KOViewManager::updateWNview() 293void KOViewManager::updateWNview()
294{ 294{
295 if ( mCurrentView == mWhatsNextView && mWhatsNextView ) 295 if ( mCurrentView == mWhatsNextView && mWhatsNextView )
296 mWhatsNextView->updateView(); 296 mWhatsNextView->updateView();
297 297
298} 298}
299void KOViewManager::showWhatsNextView() 299void KOViewManager::showWhatsNextView()
300{ 300{
301 if (!mWhatsNextView) { 301 if (!mWhatsNextView) {
302 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(), 302 mWhatsNextView = new KOWhatsNextView(mMainView->calendar(),mMainView->viewStack(),
303 "KOViewManager::WhatsNextView"); 303 "KOViewManager::WhatsNextView");
304 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog()); 304 mWhatsNextView->setEventViewer( mMainView->getEventViewerDialog());
305 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig())); 305 connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
306 addView(mWhatsNextView); 306 addView(mWhatsNextView);
307 connect(this, SIGNAL( printWNV() ), 307 connect(this, SIGNAL( printWNV() ),
308 mWhatsNextView, SLOT( printMe() ) ); 308 mWhatsNextView, SLOT( printMe() ) );
309 } 309 }
310 globalFlagBlockAgenda = 1; 310 globalFlagBlockAgenda = 1;
311 showView(mWhatsNextView, true ); 311 showView(mWhatsNextView, true );
312 //mWhatsNextView->updateView(); 312 //mWhatsNextView->updateView();
313 313
314} 314}
315 315
316void KOViewManager::showListView() 316void KOViewManager::showListView()
317{ 317{
318 if (!mListView) { 318 if (!mListView) {
319 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView"); 319 mListView = new KOListView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::ListView");
320 addView(mListView); 320 addView(mListView);
321 321
322 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)), 322 connect(mListView, SIGNAL(showIncidenceSignal(Incidence *)),
323 mMainView, SLOT(showIncidence(Incidence *))); 323 mMainView, SLOT(showIncidence(Incidence *)));
324 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)), 324 connect(mListView, SIGNAL(editIncidenceSignal(Incidence *)),
325 mMainView, SLOT(editIncidence(Incidence *))); 325 mMainView, SLOT(editIncidence(Incidence *)));
326 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)), 326 connect(mListView, SIGNAL(deleteIncidenceSignal(Incidence *)),
327 mMainView, SLOT(deleteIncidence(Incidence *))); 327 mMainView, SLOT(deleteIncidence(Incidence *)));
328 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ), 328 connect( mListView, SIGNAL( incidenceSelected( Incidence * ) ),
329 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 329 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
330 connect( mListView, SIGNAL( signalNewEvent() ), 330 connect( mListView, SIGNAL( signalNewEvent() ),
331 mMainView, SLOT( newEvent() ) ); 331 mMainView, SLOT( newEvent() ) );
332 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig())); 332 connect(mMainView, SIGNAL(configChanged()), mListView, SLOT(updateConfig()));
333 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 333 connect( mListView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
334 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 334 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
335 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 335 connect( mListView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
336 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 336 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
337 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 337 connect( mListView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
338 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 338 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
339 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 339 connect( mListView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
340 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 340 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
341 } 341 }
342 // bool temp = mFlagShowNextxDays; 342 // bool temp = mFlagShowNextxDays;
343 //globalFlagBlockPainting = true; 343 //globalFlagBlockPainting = true;
344 globalFlagBlockAgenda = 1; 344 globalFlagBlockAgenda = 1;
345 if ( KOPrefs::instance()->mListViewMonthTimespan ) { 345 if ( KOPrefs::instance()->mListViewMonthTimespan ) {
346 mMainView->setBlockShowDates( true ); 346 mMainView->setBlockShowDates( true );
347 mMainView->dateNavigator()->selectMonth(); 347 mMainView->dateNavigator()->selectMonth();
348 mMainView->setBlockShowDates( false ); 348 mMainView->setBlockShowDates( false );
349 } 349 }
350 showView(mListView, KOPrefs::instance()->mFullViewTodo); 350 showView(mListView, KOPrefs::instance()->mFullViewTodo);
351 //mFlagShowNextxDays = temp; 351 //mFlagShowNextxDays = temp;
352} 352}
353 353
354void KOViewManager::showAgendaView( bool fullScreen ) 354void KOViewManager::showAgendaView( bool fullScreen )
355{ 355{
356 356
357 mMainView->dialogManager()->hideSearchDialog(); 357 mMainView->dialogManager()->hideSearchDialog();
358 // qDebug("KOViewManager::showAgendaView "); 358 // qDebug("KOViewManager::showAgendaView ");
359 bool full; 359 bool full;
360 full = fullScreen; 360 full = fullScreen;
361 if (!mAgendaView) { 361 if (!mAgendaView) {
362 full = false; 362 full = false;
363 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView"); 363 mAgendaView = new KOAgendaView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::AgendaView");
364 addView(mAgendaView); 364 addView(mAgendaView);
365#ifndef DESKTOP_VERSION 365#ifndef DESKTOP_VERSION
366 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold ); 366 QPEApplication::setStylusOperation( mAgendaView, QPEApplication::RightOnHold );
367#endif 367#endif
368 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )), 368 connect( mAgendaView, SIGNAL( incidenceChanged(Incidence *, int )),
369 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) )); 369 mMainView, SLOT( changeIncidenceDisplay( Incidence *, int ) ));
370 370
371 // SIGNALS/SLOTS FOR DAY/WEEK VIEW 371 // SIGNALS/SLOTS FOR DAY/WEEK VIEW
372 372
373 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate ))); 373 connect(mAgendaView,SIGNAL(showDateView( int, QDate )),SLOT(showDateView( int, QDate )));
374 374
375 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)), 375 connect(mAgendaView,SIGNAL(newTodoSignal(QDateTime,bool)),
376 mMainView, SLOT(newTodoDateTime(QDateTime,bool))); 376 mMainView, SLOT(newTodoDateTime(QDateTime,bool)));
377 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)), 377 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime)),
378 mMainView, SLOT(newEvent(QDateTime))); 378 mMainView, SLOT(newEvent(QDateTime)));
379 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)), 379 connect(mAgendaView,SIGNAL(newEventSignal(QDateTime,QDateTime)),
380 mMainView, SLOT(newEvent(QDateTime,QDateTime))); 380 mMainView, SLOT(newEvent(QDateTime,QDateTime)));
381 connect(mAgendaView,SIGNAL(newEventSignal(QDate)), 381 connect(mAgendaView,SIGNAL(newEventSignal(QDate)),
382 mMainView, SLOT(newEvent(QDate))); 382 mMainView, SLOT(newEvent(QDate)));
383 383
384 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)), 384 connect(mAgendaView, SIGNAL(editIncidenceSignal(Incidence *)),
385 mMainView, SLOT(editIncidence(Incidence *))); 385 mMainView, SLOT(editIncidence(Incidence *)));
386 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)), 386 connect(mAgendaView, SIGNAL(showIncidenceSignal(Incidence *)),
387 mMainView, SLOT(showIncidence(Incidence *))); 387 mMainView, SLOT(showIncidence(Incidence *)));
388 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)), 388 connect(mAgendaView, SIGNAL(deleteIncidenceSignal(Incidence *)),
389 mMainView, SLOT(deleteIncidence(Incidence *))); 389 mMainView, SLOT(deleteIncidence(Incidence *)));
390 390
391 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ), 391 connect( mAgendaView, SIGNAL( incidenceSelected( Incidence * ) ),
392 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 392 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
393 393
394 connect(mAgendaView, SIGNAL( toggleExpand() ), 394 connect(mAgendaView, SIGNAL( toggleExpand() ),
395 mMainView, SLOT( toggleExpand() ) ); 395 mMainView, SLOT( toggleExpand() ) );
396 396
397 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ), 397 connect(mMainView, SIGNAL( calendarViewExpanded( bool ) ),
398 mAgendaView, SLOT( setExpandedButton( bool ) ) ); 398 mAgendaView, SLOT( setExpandedButton( bool ) ) );
399 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ), 399 connect( mAgendaView, SIGNAL( cloneIncidenceSignal(Incidence *) ),
400 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ; 400 mMainView, SLOT(cloneIncidence(Incidence *) ) ) ;
401 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ), 401 connect( mAgendaView, SIGNAL( cancelIncidenceSignal(Incidence *) ),
402 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ; 402 mMainView, SLOT(cancelIncidence(Incidence *) ) ) ;
403 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig())); 403 connect(mMainView, SIGNAL(configChanged()), mAgendaView, SLOT(updateConfig()));
404 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView, 404 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mAgendaView,
405 SLOT( updateTodo( Todo *, int ) ) ); 405 SLOT( updateTodo( Todo *, int ) ) );
406 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )), 406 connect( mAgendaView,SIGNAL( todoMoved( Todo *, int )),
407 mMainView, SIGNAL( todoModified( Todo *, int ))); 407 mMainView, SIGNAL( todoModified( Todo *, int )));
408 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 408 connect( mAgendaView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
409 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 409 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
410 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 410 connect( mAgendaView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
411 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 411 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
412 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ), 412 connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
413 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) ); 413 mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
414 mAgendaView->readSettings(); 414 mAgendaView->readSettings();
415 mAgendaView->updateConfig(); 415 mAgendaView->updateConfig();
416 } 416 }
417 417
418 showView( mAgendaView, full); 418 showView( mAgendaView, full);
419 419
420} 420}
421 421
422void KOViewManager::showDayView() 422void KOViewManager::showDayView()
423{ 423{
424 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
424 mFlagShowNextxDays = false; 425 mFlagShowNextxDays = false;
425 globalFlagBlockLabel = 1; 426 globalFlagBlockLabel = 1;
426 globalFlagBlockAgenda = 1; 427 globalFlagBlockAgenda = 1;
427 if ( mCurrentAgendaView != 1 ) 428 if ( mCurrentAgendaView != 1 )
428 mCurrentAgendaView = -1; 429 mCurrentAgendaView = -1;
429 showAgendaView(); 430 showAgendaView();
430 qApp->processEvents(); 431 qApp->processEvents();
431 globalFlagBlockAgenda = 2; 432 globalFlagBlockAgenda = 2;
432 globalFlagBlockLabel = 0; 433 globalFlagBlockLabel = 0;
433 mMainView->dateNavigator()->selectDates( 1 ); 434 mMainView->dateNavigator()->selectDates( 1 );
434 mCurrentAgendaView = 1 ; 435 mCurrentAgendaView = 1 ;
435 436
436} 437}
437 438
438void KOViewManager::showWorkWeekView() 439void KOViewManager::showWorkWeekView()
439{ 440{
441 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
440 mFlagShowNextxDays = false; 442 mFlagShowNextxDays = false;
441 globalFlagBlockAgenda = 1; 443 globalFlagBlockAgenda = 1;
442 globalFlagBlockLabel = 1; 444 globalFlagBlockLabel = 1;
443 if ( mCurrentAgendaView != 5 ) 445 if ( mCurrentAgendaView != 5 )
444 mCurrentAgendaView = -1; 446 mCurrentAgendaView = -1;
445 showAgendaView(); 447 showAgendaView();
446 qApp->processEvents(); 448 qApp->processEvents();
447 globalFlagBlockAgenda = 2; 449 globalFlagBlockAgenda = 2;
448 globalFlagBlockLabel = 0; 450 globalFlagBlockLabel = 0;
449 mMainView->dateNavigator()->selectWorkWeek(); 451 mMainView->dateNavigator()->selectWorkWeek();
450 mCurrentAgendaView = 5 ; 452 mCurrentAgendaView = 5 ;
451 453
452} 454}
453 455
454void KOViewManager::showWeekView() 456void KOViewManager::showWeekView()
455{ 457{
456 /* 458 /*
457 globalFlagBlockAgenda = 2; 459 globalFlagBlockAgenda = 2;
458 qDebug("4globalFlagBlockAgenda = 2; "); 460 qDebug("4globalFlagBlockAgenda = 2; ");
459 //globalFlagBlockPainting = true; 461 //globalFlagBlockPainting = true;
460 mMainView->dateNavigator()->selectWeek(); 462 mMainView->dateNavigator()->selectWeek();
461 showAgendaView(); 463 showAgendaView();
462 */ 464 */
463 465
464 466
467 mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
465 mFlagShowNextxDays = false; 468 mFlagShowNextxDays = false;
466 globalFlagBlockAgenda = 1; 469 globalFlagBlockAgenda = 1;
467 globalFlagBlockLabel = 1; 470 globalFlagBlockLabel = 1;
468 if ( mCurrentAgendaView != 7 ) 471 if ( mCurrentAgendaView != 7 )
469 mCurrentAgendaView = -1; 472 mCurrentAgendaView = -1;
470 showAgendaView(); 473 showAgendaView();
471 qApp->processEvents(); 474 qApp->processEvents();
472 globalFlagBlockAgenda = 2; 475 globalFlagBlockAgenda = 2;
473 globalFlagBlockLabel = 0; 476 globalFlagBlockLabel = 0;
474 mMainView->dateNavigator()->selectWeek(); 477 mMainView->dateNavigator()->selectWeek();
475 mCurrentAgendaView = 7 ; 478 mCurrentAgendaView = 7 ;
476} 479}
477 480
478void KOViewManager::showNextXView() 481void KOViewManager::showNextXView()
479{ 482{
480 483
481 globalFlagBlockAgenda = 1; 484 globalFlagBlockAgenda = 1;
482 if ( mCurrentAgendaView != 3 ) 485 if ( mCurrentAgendaView != 3 )
483 mCurrentAgendaView = -1; 486 mCurrentAgendaView = -1;
484 showAgendaView(KOPrefs::instance()->mFullViewMonth); 487 showAgendaView(KOPrefs::instance()->mFullViewMonth);
485 globalFlagBlockAgenda = 2; 488 globalFlagBlockAgenda = 2;
486 mMainView->dateNavigator()->selectDates( QDate::currentDate(), 489 mMainView->dateNavigator()->selectDates( QDate::currentDate(),
487 KOPrefs::instance()->mNextXDays ); 490 KOPrefs::instance()->mNextXDays );
488 mFlagShowNextxDays = true; 491 mFlagShowNextxDays = true;
489 mCurrentAgendaView = 3 ; 492 mCurrentAgendaView = 3 ;
490} 493}
491bool KOViewManager::showsNextDays() 494bool KOViewManager::showsNextDays()
492{ 495{
493 return mFlagShowNextxDays; 496 return mFlagShowNextxDays;
494} 497}
495void KOViewManager::createMonthView() 498void KOViewManager::createMonthView()
496{ 499{
497if (!mMonthView) { 500if (!mMonthView) {
498 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView"); 501 mMonthView = new KOMonthView(mMainView->calendar(), mMainView->viewStack(), "KOViewManager::MonthView");
499 502
500 addView(mMonthView); 503 addView(mMonthView);
501 // mMonthView->show(); 504 // mMonthView->show();
502 // SIGNALS/SLOTS FOR MONTH VIEW 505 // SIGNALS/SLOTS FOR MONTH VIEW
503 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)), 506 connect(mMonthView, SIGNAL(newEventSignal(QDateTime)),
504 mMainView, SLOT(newEvent(QDateTime))); 507 mMainView, SLOT(newEvent(QDateTime)));
505 508
506 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)), 509 connect(mMonthView, SIGNAL(showIncidenceSignal(Incidence *)),
507 mMainView, SLOT(showIncidence(Incidence *))); 510 mMainView, SLOT(showIncidence(Incidence *)));
508 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)), 511 connect(mMonthView, SIGNAL(editIncidenceSignal(Incidence *)),
509 mMainView, SLOT(editIncidence(Incidence *))); 512 mMainView, SLOT(editIncidence(Incidence *)));
510 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)), 513 connect(mMonthView, SIGNAL(deleteIncidenceSignal(Incidence *)),
511 mMainView, SLOT(deleteIncidence(Incidence *))); 514 mMainView, SLOT(deleteIncidence(Incidence *)));
512 515
513 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ), 516 connect( mMonthView, SIGNAL( incidenceSelected( Incidence * ) ),
514 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 517 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
515 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ), 518 connect( mMonthView, SIGNAL( cloneIncidenceSignal( Incidence * ) ),
516 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 519 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
517 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ), 520 connect( mMonthView, SIGNAL( cancelIncidenceSignal( Incidence * ) ),
518 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 521 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
519 522
520 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ), 523 connect( mMonthView, SIGNAL( moveIncidenceSignal( Incidence * ) ),
521 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 524 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
522 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ), 525 connect( mMonthView, SIGNAL( beamIncidenceSignal( Incidence * ) ),
523 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 526 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
524 connect( mMonthView, SIGNAL( selectWeekNum( int ) ), 527 connect( mMonthView, SIGNAL( selectWeekNum( int ) ),
525 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) ); 528 mMainView->dateNavigator(), SLOT ( selectWeekFromMonthView( int ) ) );
526 connect( mMonthView, SIGNAL( selectMonth() ), 529 connect( mMonthView, SIGNAL( selectMonth() ),
527 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) ); 530 mMainView->dateNavigator(), SLOT ( selectMonthFromMonthview() ) );
528 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ), 531 connect( mMonthView, SIGNAL( showDaySignal( QDate ) ),
529 mMainView, SLOT ( showDay( QDate ) ) ); 532 mMainView, SLOT ( showDay( QDate ) ) );
530 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig())); 533 connect(mMainView, SIGNAL(configChanged()), mMonthView, SLOT(updateConfig()));
531 connect( mMonthView, SIGNAL(nextMonth() ), 534 connect( mMonthView, SIGNAL(nextMonth() ),
532 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) ); 535 mMonthView->navigatorBar(), SIGNAL(goNextMonth() ) );
533 connect( mMonthView, SIGNAL(prevMonth() ), 536 connect( mMonthView, SIGNAL(prevMonth() ),
534 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) ); 537 mMonthView->navigatorBar(), SIGNAL(goPrevMonth() ) );
535 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ), 538 connect( mMonthView->navigatorBar(), SIGNAL( goPrevYear() ),
536 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) ); 539 mMainView->dateNavigator(), SLOT( selectPreviousYear() ) );
537 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ), 540 connect( mMonthView->navigatorBar(), SIGNAL( goNextYear() ),
538 mMainView->dateNavigator(), SLOT( selectNextYear() ) ); 541 mMainView->dateNavigator(), SLOT( selectNextYear() ) );
539 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ), 542 connect( mMonthView->navigatorBar(), SIGNAL( goPrevMonth() ),
540 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) ); 543 mMainView->dateNavigator(), SLOT( selectPreviousMonth() ) );
541 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ), 544 connect( mMonthView->navigatorBar(), SIGNAL( goNextMonth() ),
542 mMainView->dateNavigator(), SLOT( selectNextMonth() ) ); 545 mMainView->dateNavigator(), SLOT( selectNextMonth() ) );
543 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ), 546 connect( mMonthView->navigatorBar(), SIGNAL( goPrevWeek() ),
544 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) ); 547 mMainView->dateNavigator(), SLOT( selectPreviousWeek() ) );
545 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ), 548 connect( mMonthView->navigatorBar(), SIGNAL( goNextWeek() ),
546 mMainView->dateNavigator(), SLOT( selectNextWeek() ) ); 549 mMainView->dateNavigator(), SLOT( selectNextWeek() ) );
547 550
548 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ), 551 connect( mMainView->dateNavigator(), SIGNAL( datesSelected( const KCal::DateList & ) ),
549 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) ); 552 mMonthView->navigatorBar(), SLOT( selectDates( const KCal::DateList & ) ) );
550 553
551 554
552 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ), 555 connect( mMonthView->navigatorBar(), SIGNAL( monthSelected ( int ) ),
553 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) ); 556 mMainView->dateNavigator(), SLOT( slotMonthSelect( int ) ) );
554 557
555 } 558 }
556} 559}
557void KOViewManager::showMonthViewWeek() 560void KOViewManager::showMonthViewWeek()
558{ 561{
559 createMonthView(); 562 createMonthView();
560 globalFlagBlockAgenda = 1; 563 globalFlagBlockAgenda = 1;
561 bool full = true; 564 bool full = true;
562 if ( mCurrentView == mMonthView) 565 if ( mCurrentView == mMonthView)
563 full = mMainView->leftFrame()->isVisible(); 566 full = mMainView->leftFrame()->isVisible();
564 if ( !KOPrefs::instance()->mMonthViewWeek ) { 567 if ( !KOPrefs::instance()->mMonthViewWeek ) {
565 mMonthView->switchView(); 568 mMonthView->switchView();
566 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 569 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
567 full = false; 570 full = false;
568 else 571 else
569 full = true; 572 full = true;
570 } 573 }
571 mMainView->dateNavigator()->selectWeek(); 574 mMainView->dateNavigator()->selectWeek();
572 showView(mMonthView, full ); 575 showView(mMonthView, full );
573} 576}
574 577
575void KOViewManager::showMonthView() 578void KOViewManager::showMonthView()
576 { 579 {
577 580
578 createMonthView(); 581 createMonthView();
579 globalFlagBlockAgenda = 1; 582 globalFlagBlockAgenda = 1;
580 //mFlagShowNextxDays = false; 583 //mFlagShowNextxDays = false;
581 bool full = true; 584 bool full = true;
582 if ( mCurrentView == mMonthView) 585 if ( mCurrentView == mMonthView)
583 full = mMainView->leftFrame()->isVisible(); 586 full = mMainView->leftFrame()->isVisible();
584 // if(mMonthView == mCurrentView) return; 587 // if(mMonthView == mCurrentView) return;
585 if ( KOPrefs::instance()->mMonthViewWeek ) { 588 if ( KOPrefs::instance()->mMonthViewWeek ) {
586 mMonthView->switchView(); 589 mMonthView->switchView();
587 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() ) 590 if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
588 full = false; 591 full = false;
589 else 592 else
590 full = true; 593 full = true;
591 } 594 }
592 mMainView->dateNavigator()->selectMonth(); 595 mMainView->dateNavigator()->selectMonth();
593 596
594 showView(mMonthView, full ); 597 showView(mMonthView, full );
595 598
596} 599}
597 600
598void KOViewManager::showTodoView() 601void KOViewManager::showTodoView()
599{ 602{
600 //mFlagShowNextxDays = false; 603 //mFlagShowNextxDays = false;
601 if ( !mTodoView ) { 604 if ( !mTodoView ) {
602 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(), 605 mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
603 "KOViewManager::TodoView" ); 606 "KOViewManager::TodoView" );
604 607
605 addView( mTodoView ); 608 addView( mTodoView );
606 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold ); 609 // QPEApplication::setStylusOperation( mTodoView, QPEApplication::RightOnHold );
607 610
608 // SIGNALS/SLOTS FOR TODO VIEW 611 // SIGNALS/SLOTS FOR TODO VIEW
609 connect( mTodoView, SIGNAL( newTodoSignal() ), 612 connect( mTodoView, SIGNAL( newTodoSignal() ),
610 mMainView, SLOT( newTodo() ) ); 613 mMainView, SLOT( newTodo() ) );
611 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ), 614 connect( mTodoView, SIGNAL( newSubTodoSignal( Todo * ) ),
612 mMainView, SLOT( newSubTodo( Todo *) ) ); 615 mMainView, SLOT( newSubTodo( Todo *) ) );
613 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ), 616 connect( mTodoView, SIGNAL( showTodoSignal( Todo *) ),
614 mMainView, SLOT( showTodo( Todo * ) ) ); 617 mMainView, SLOT( showTodo( Todo * ) ) );
615 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ), 618 connect( mTodoView, SIGNAL( editTodoSignal( Todo * ) ),
616 mMainView, SLOT( editTodo( Todo * ) ) ); 619 mMainView, SLOT( editTodo( Todo * ) ) );
617 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ), 620 connect( mTodoView, SIGNAL( deleteTodoSignal( Todo * ) ),
618 mMainView, SLOT( deleteTodo( Todo * ) ) ); 621 mMainView, SLOT( deleteTodo( Todo * ) ) );
619 connect( mTodoView, SIGNAL( purgeCompletedSignal() ), 622 connect( mTodoView, SIGNAL( purgeCompletedSignal() ),
620 mMainView, SLOT( purgeCompleted() ) ); 623 mMainView, SLOT( purgeCompleted() ) );
621 624
622 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ), 625 connect( mTodoView, SIGNAL( incidenceSelected( Incidence * ) ),
623 mMainView, SLOT( processMainViewSelection( Incidence * ) ) ); 626 mMainView, SLOT( processMainViewSelection( Incidence * ) ) );
624 627
625 connect( mMainView, SIGNAL( configChanged() ), mTodoView, 628 connect( mMainView, SIGNAL( configChanged() ), mTodoView,
626 SLOT( updateConfig() ) ); 629 SLOT( updateConfig() ) );
627 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView, 630 connect( mMainView, SIGNAL( todoModified( Todo *, int )), mTodoView,
628 SLOT( updateTodo( Todo *, int ) ) ); 631 SLOT( updateTodo( Todo *, int ) ) );
629 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ), 632 connect( mTodoView, SIGNAL( todoModifiedSignal( Todo *, int ) ),
630 mMainView, SIGNAL ( todoModified( Todo *, int ) ) ); 633 mMainView, SIGNAL ( todoModified( Todo *, int ) ) );
631 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ), 634 connect( mTodoView, SIGNAL( cloneTodoSignal( Incidence * ) ),
632 mMainView, SLOT ( cloneIncidence( Incidence * ) ) ); 635 mMainView, SLOT ( cloneIncidence( Incidence * ) ) );
633 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ), 636 connect( mTodoView, SIGNAL( cancelTodoSignal( Incidence * ) ),
634 mMainView, SLOT ( cancelIncidence( Incidence * ) ) ); 637 mMainView, SLOT ( cancelIncidence( Incidence * ) ) );
635 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ), 638 connect( mTodoView, SIGNAL( unparentTodoSignal( Todo * ) ),
636 mMainView, SLOT ( todo_unsub( Todo * ) ) ); 639 mMainView, SLOT ( todo_unsub( Todo * ) ) );
637 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 640 connect( mTodoView, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
638 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) ); 641 mMainView, SLOT ( todo_resub( Todo *, Todo *) ) );
639 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ), 642 connect( mTodoView, SIGNAL( moveTodoSignal( Incidence * ) ),
640 mMainView, SLOT ( moveIncidence( Incidence * ) ) ); 643 mMainView, SLOT ( moveIncidence( Incidence * ) ) );
641 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ), 644 connect( mTodoView, SIGNAL( beamTodoSignal( Incidence * ) ),
642 mMainView, SLOT ( beamIncidence( Incidence * ) ) ); 645 mMainView, SLOT ( beamIncidence( Incidence * ) ) );
643 KConfig *config = KOGlobals::config(); 646 KConfig *config = KOGlobals::config();
644 mTodoView->restoreLayout(config,"Todo View"); 647 mTodoView->restoreLayout(config,"Todo View");
645 mTodoView->setNavigator( mMainView->dateNavigator() ); 648 mTodoView->setNavigator( mMainView->dateNavigator() );
646 } 649 }
647 650
648 globalFlagBlockAgenda = 1; 651 globalFlagBlockAgenda = 1;
649 showView( mTodoView, true ); 652 showView( mTodoView, true );
650 653
651} 654}
652 655
653void KOViewManager::showJournalView() 656void KOViewManager::showJournalView()
654{ 657{
655 //mFlagShowNextxDays = false; 658 //mFlagShowNextxDays = false;
656 if (!mJournalView) { 659 if (!mJournalView) {