summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/komonthview.cpp26
-rw-r--r--korganizer/komonthview.h1
-rw-r--r--korganizer/koviewmanager.cpp3
4 files changed, 23 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f9af769..8f05276 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -456,98 +456,98 @@ void CalendarView::init()
456 mDateFrame->setCaption( i18n( "Pick a date to display")); 456 mDateFrame->setCaption( i18n( "Pick a date to display"));
457 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 457 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
458 458
459 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 459 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
460 460
461 mEventEditor = mDialogManager->getEventEditor(); 461 mEventEditor = mDialogManager->getEventEditor();
462 mTodoEditor = mDialogManager->getTodoEditor(); 462 mTodoEditor = mDialogManager->getTodoEditor();
463 463
464 mFlagEditDescription = false; 464 mFlagEditDescription = false;
465 465
466 mSuspendTimer = new QTimer( this ); 466 mSuspendTimer = new QTimer( this );
467 mAlarmTimer = new QTimer( this ); 467 mAlarmTimer = new QTimer( this );
468 mRecheckAlarmTimer = new QTimer( this ); 468 mRecheckAlarmTimer = new QTimer( this );
469 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 469 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
470 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 470 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
471 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 471 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
472 mAlarmDialog = new AlarmDialog( this ); 472 mAlarmDialog = new AlarmDialog( this );
473 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 473 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
474 mAlarmDialog->setServerNotification( false ); 474 mAlarmDialog->setServerNotification( false );
475 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 475 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
476 476
477 477
478#ifndef DESKTOP_VERSION 478#ifndef DESKTOP_VERSION
479//US listen for arriving address resultsets 479//US listen for arriving address resultsets
480 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 480 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
481 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 481 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
482#endif 482#endif
483 483
484} 484}
485 485
486 486
487CalendarView::~CalendarView() 487CalendarView::~CalendarView()
488{ 488{
489 // kdDebug() << "~CalendarView()" << endl; 489 // kdDebug() << "~CalendarView()" << endl;
490 //qDebug("CalendarView::~CalendarView() "); 490 //qDebug("CalendarView::~CalendarView() ");
491 delete mDialogManager; 491 delete mDialogManager;
492 delete mViewManager; 492 delete mViewManager;
493 delete mStorage; 493 delete mStorage;
494 delete mDateFrame ; 494 delete mDateFrame ;
495 delete beamDialog; 495 delete beamDialog;
496 //kdDebug() << "~CalendarView() done" << endl; 496 //kdDebug() << "~CalendarView() done" << endl;
497} 497}
498 498
499void CalendarView::showDay( QDate d ) 499void CalendarView::showDay( QDate d )
500{ 500{
501 dateNavigator()->blockSignals( true ); 501 dateNavigator()->blockSignals( true );
502 dateNavigator()->selectDate( d ); 502 dateNavigator()->selectDate( d );
503 dateNavigator()->blockSignals( false ); 503 dateNavigator()->blockSignals( false );
504 mViewManager->showWeekView(); 504 mViewManager->showDayView();
505 dateNavigator()->selectDate( d ); 505 //dateNavigator()->selectDate( d );
506} 506}
507void CalendarView::timerAlarm() 507void CalendarView::timerAlarm()
508{ 508{
509 //qDebug("CalendarView::timerAlarm() "); 509 //qDebug("CalendarView::timerAlarm() ");
510 computeAlarm(mAlarmNotification ); 510 computeAlarm(mAlarmNotification );
511} 511}
512 512
513void CalendarView::suspendAlarm() 513void CalendarView::suspendAlarm()
514{ 514{
515 //qDebug(" CalendarView::suspendAlarm() "); 515 //qDebug(" CalendarView::suspendAlarm() ");
516 computeAlarm(mSuspendAlarmNotification ); 516 computeAlarm(mSuspendAlarmNotification );
517 517
518} 518}
519 519
520void CalendarView::startAlarm( QString mess , QString filename) 520void CalendarView::startAlarm( QString mess , QString filename)
521{ 521{
522 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount ); 522 mAlarmDialog->eventNotification( mess, KOPrefs::instance()->mAlarmPlayBeeps, filename, true,KOPrefs::instance()->mAlarmBeepInterval ,KOPrefs::instance()->mAlarmSuspendCount );
523 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) ); 523 QTimer::singleShot( 3000, this, SLOT( checkNextTimerAlarm() ) );
524 524
525} 525}
526 526
527void CalendarView::checkNextTimerAlarm() 527void CalendarView::checkNextTimerAlarm()
528{ 528{
529 mCalendar->checkAlarmForIncidence( 0, true ); 529 mCalendar->checkAlarmForIncidence( 0, true );
530} 530}
531 531
532void CalendarView::computeAlarm( QString msg ) 532void CalendarView::computeAlarm( QString msg )
533{ 533{
534 534
535 QString mess = msg; 535 QString mess = msg;
536 QString mAlarmMessage = mess.mid( 9 ); 536 QString mAlarmMessage = mess.mid( 9 );
537 QString filename = MainWindow::resourcePath(); 537 QString filename = MainWindow::resourcePath();
538 filename += "koalarm.wav"; 538 filename += "koalarm.wav";
539 QString tempfilename; 539 QString tempfilename;
540 if ( mess.left( 13 ) == "suspend_alarm") { 540 if ( mess.left( 13 ) == "suspend_alarm") {
541 bool error = false; 541 bool error = false;
542 int len = mess.mid( 13 ).find("+++"); 542 int len = mess.mid( 13 ).find("+++");
543 if ( len < 2 ) 543 if ( len < 2 )
544 error = true; 544 error = true;
545 else { 545 else {
546 tempfilename = mess.mid( 13, len ); 546 tempfilename = mess.mid( 13, len );
547 if ( !QFile::exists( tempfilename ) ) 547 if ( !QFile::exists( tempfilename ) )
548 error = true; 548 error = true;
549 } 549 }
550 if ( ! error ) { 550 if ( ! error ) {
551 filename = tempfilename; 551 filename = tempfilename;
552 } 552 }
553 mAlarmMessage = mess.mid( 13+len+3 ); 553 mAlarmMessage = mess.mid( 13+len+3 );
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 842f6eb..b819eec 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -29,97 +29,97 @@
29#include <qwhatsthis.h> 29#include <qwhatsthis.h>
30#ifndef DESKTOP_VERSION 30#ifndef DESKTOP_VERSION
31#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
32#else 32#else
33#include <qapplication.h> 33#include <qapplication.h>
34#endif 34#endif
35 35
36#include <kdebug.h> 36#include <kdebug.h>
37#include <klocale.h> 37#include <klocale.h>
38#include <kglobal.h> 38#include <kglobal.h>
39#include <kconfig.h> 39#include <kconfig.h>
40#include <kiconloader.h> 40#include <kiconloader.h>
41 41
42#include <kcalendarsystem.h> 42#include <kcalendarsystem.h>
43 43
44#ifndef KORG_NOPRINTER 44#ifndef KORG_NOPRINTER
45#include "calprinter.h" 45#include "calprinter.h"
46#endif 46#endif
47#include "koprefs.h" 47#include "koprefs.h"
48#ifndef KORG_NOPLUGINS 48#ifndef KORG_NOPLUGINS
49#include "kocore.h" 49#include "kocore.h"
50#endif 50#endif
51#include "koglobals.h" 51#include "koglobals.h"
52#include <libkcal/kincidenceformatter.h> 52#include <libkcal/kincidenceformatter.h>
53 53
54#include "komonthview.h" 54#include "komonthview.h"
55 55
56#define PIXMAP_SIZE 5 56#define PIXMAP_SIZE 5
57#ifdef DESKTOP_VERSION 57#ifdef DESKTOP_VERSION
58 QToolTipGroup *MonthViewCell::mToolTipGroup = 0; 58 QToolTipGroup *MonthViewCell::mToolTipGroup = 0;
59#endif 59#endif
60class KNOWhatsThis :public QWhatsThis 60class KNOWhatsThis :public QWhatsThis
61{ 61{
62public: 62public:
63 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { }; 63 KNOWhatsThis( KNoScrollListBox* sbox ) : QWhatsThis( sbox ), _wid( sbox) { };
64 64
65protected: 65protected:
66 virtual QString text( const QPoint& p) 66 virtual QString text( const QPoint& p)
67 { 67 {
68 return _wid->getWhatsThisText(p) ; 68 return _wid->getWhatsThisText(p) ;
69 }; 69 };
70private: 70private:
71 KNoScrollListBox* _wid; 71 KNoScrollListBox* _wid;
72 72
73}; 73};
74 74
75 75
76KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 76KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
77 : QListBox(parent, name) 77 : QListBox(parent, name, WRepaintNoErase)
78{ 78{
79#ifndef DESKTOP_VERSION 79#ifndef DESKTOP_VERSION
80 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 80 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
81#endif 81#endif
82 mWT = new KNOWhatsThis(this); 82 mWT = new KNOWhatsThis(this);
83} 83}
84KNoScrollListBox::~KNoScrollListBox() 84KNoScrollListBox::~KNoScrollListBox()
85{ 85{
86 delete mWT; 86 delete mWT;
87} 87}
88QString KNoScrollListBox::getWhatsThisText(QPoint p) 88QString KNoScrollListBox::getWhatsThisText(QPoint p)
89{ 89{
90 QListBoxItem* item = itemAt ( p ); 90 QListBoxItem* item = itemAt ( p );
91 if ( ! item ) { 91 if ( ! item ) {
92 return i18n("Click in the cell\nto add an event!"); 92 return i18n("Click in the cell\nto add an event!");
93 } 93 }
94 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence()); 94 return KIncidenceFormatter::instance()->getFormattedText(((MonthViewItem*) item)->incidence());
95} 95}
96void KNoScrollListBox::keyPressEvent(QKeyEvent *e) 96void KNoScrollListBox::keyPressEvent(QKeyEvent *e)
97{ 97{
98 98
99 switch(e->key()) { 99 switch(e->key()) {
100 case Key_Right: 100 case Key_Right:
101 // if ( e->state() == Qt::ControlButton ) 101 // if ( e->state() == Qt::ControlButton )
102 { 102 {
103 e->ignore(); 103 e->ignore();
104 return; 104 return;
105 } 105 }
106 scrollBy(4,0); 106 scrollBy(4,0);
107 break; 107 break;
108 case Key_Left: 108 case Key_Left:
109 // if ( e->state() == Qt::ControlButton ) 109 // if ( e->state() == Qt::ControlButton )
110 { 110 {
111 e->ignore(); 111 e->ignore();
112 return; 112 return;
113 } 113 }
114 scrollBy(-4,0); 114 scrollBy(-4,0);
115 break; 115 break;
116 case Key_Up: 116 case Key_Up:
117 if(!count()) break; 117 if(!count()) break;
118 setCurrentItem((currentItem()+count()-1)%count()); 118 setCurrentItem((currentItem()+count()-1)%count());
119 if(!itemVisible(currentItem())) { 119 if(!itemVisible(currentItem())) {
120 if((unsigned int) currentItem() == (count()-1)) { 120 if((unsigned int) currentItem() == (count()-1)) {
121 setTopItem(currentItem()-numItemsVisible()+1); 121 setTopItem(currentItem()-numItemsVisible()+1);
122 } else { 122 } else {
123 setTopItem(topItem()-1); 123 setTopItem(topItem()-1);
124 } 124 }
125 } 125 }
@@ -337,114 +337,122 @@ void MonthViewCell::setMyPalette()
337 if ( mPrimary ) { 337 if ( mPrimary ) {
338 setPalette( mPrimaryPalette ); 338 setPalette( mPrimaryPalette );
339 } else { 339 } else {
340 setPalette( mNonPrimaryPalette ); 340 setPalette( mNonPrimaryPalette );
341 } 341 }
342 } 342 }
343 QPalette pal = palette(); 343 QPalette pal = palette();
344 344
345 mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) )); 345 mLabel->setPalette( QPalette ( pal.color( QPalette::Normal,QColorGroup::Base),pal.color(QPalette::Normal,QColorGroup::Base ) ));
346} 346}
347QPalette MonthViewCell::getPalette () 347QPalette MonthViewCell::getPalette ()
348{ 348{
349 if ( !KOPrefs::instance()->mMonthViewUsesDayColors ) 349 if ( !KOPrefs::instance()->mMonthViewUsesDayColors )
350 return mStandardPalette; 350 return mStandardPalette;
351 if ( mHoliday) { 351 if ( mHoliday) {
352 return mHolidayPalette ; 352 return mHolidayPalette ;
353 } else { 353 } else {
354 if ( mPrimary ) { 354 if ( mPrimary ) {
355 return mPrimaryPalette ; 355 return mPrimaryPalette ;
356 } 356 }
357 } 357 }
358 return mNonPrimaryPalette; 358 return mNonPrimaryPalette;
359} 359}
360bool MonthViewCell::isPrimary() const 360bool MonthViewCell::isPrimary() const
361{ 361{
362 return mPrimary; 362 return mPrimary;
363} 363}
364 364
365void MonthViewCell::setHoliday( bool holiday ) 365void MonthViewCell::setHoliday( bool holiday )
366{ 366{
367 mHoliday = holiday; 367 mHoliday = holiday;
368 //setMyPalette(); 368 //setMyPalette();
369} 369}
370 370
371void MonthViewCell::setHoliday( const QString &holiday ) 371void MonthViewCell::setHoliday( const QString &holiday )
372{ 372{
373 mHolidayString = holiday; 373 mHolidayString = holiday;
374 374
375 if ( !holiday.isEmpty() ) { 375 if ( !holiday.isEmpty() ) {
376 setHoliday( true ); 376 setHoliday( true );
377 } 377 }
378} 378}
379void MonthViewCell::keyPressEvent ( QKeyEvent * e ) 379void MonthViewCell::keyPressEvent ( QKeyEvent * e )
380{ 380{
381 381
382 e->ignore(); 382 e->ignore();
383 383
384} 384}
385void MonthViewCell::clear()
386{
387 mItemList->clear();
388 QApplication::removePostedEvents ( mItemList );
389 QApplication::removePostedEvents ( mLabel );
390 QApplication::removePostedEvents ( this );
391}
385void MonthViewCell::updateCell() 392void MonthViewCell::updateCell()
386{ 393{
387 if ( !mMonthView->isUpdatePossible() ) 394 if ( !mMonthView->isUpdatePossible() )
388 return; 395 return;
389 if ( !isVisible() ){ 396 /*
397 if ( !isVisible() ){
390 return; 398 return;
391 } 399 }
400 */
401 // qDebug("MonthViewCell::updateCell() ");
392 setPrimary( mDate.month()%2 ); 402 setPrimary( mDate.month()%2 );
393 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); 403 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays);
394 if ( mDate == QDate::currentDate() ) { 404 if ( mDate == QDate::currentDate() ) {
395 mItemList->setLineWidth( 3 ); 405 mItemList->setLineWidth( 3 );
396 } else { 406 } else {
397 mItemList->setLineWidth( 1 ); 407 mItemList->setLineWidth( 1 );
398 } 408 }
399 mItemList->clear(); 409 mItemList->clear();
400 410
401
402
403#ifdef DESKTOP_VERSION 411#ifdef DESKTOP_VERSION
404 QToolTip::remove(this); 412 QToolTip::remove(this);
405#endif 413#endif
406 QString tipText(""); 414 QString tipText("");
407 //qApp->processEvents(); 415 //qApp->processEvents();
408 if ( !mHolidayString.isEmpty() ) { 416 if ( !mHolidayString.isEmpty() ) {
409 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); 417 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
410 item->setPalette( mHolidayPalette ); 418 item->setPalette( mHolidayPalette );
411 mItemList->insertItem( item ); 419 mItemList->insertItem( item );
412 tipText += mHolidayString+"\n"; 420 tipText += mHolidayString+"\n";
413 } 421 }
414 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 422 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
415 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); 423 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
416 Event *event; 424 Event *event;
417 for( event = events.first(); event; event = events.next() ) { // for event 425 for( event = events.first(); event; event = events.next() ) { // for event
418 426
419 if ( !(event->doesRecur() == Recurrence::rNone) ) { 427 if ( !(event->doesRecur() == Recurrence::rNone) ) {
420 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily ) 428 if ( !KOPrefs::instance()->mMonthDailyRecur && event->doesRecur() == Recurrence::rDaily )
421 continue; 429 continue;
422 else 430 else
423 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly ) 431 if ( !KOPrefs::instance()->mMonthWeeklyRecur && event->doesRecur() == Recurrence::rWeekly )
424 continue; 432 continue;
425 } 433 }
426 434
427 if ( event->categories().contains("Holiday") || 435 if ( event->categories().contains("Holiday") ||
428 event->categories().contains(i18n("Holiday"))) { 436 event->categories().contains(i18n("Holiday"))) {
429 setHoliday( true ); 437 setHoliday( true );
430 if ( mDate.dayOfWeek() == 7 ) 438 if ( mDate.dayOfWeek() == 7 )
431 mItemList->setLineWidth( 3 ); 439 mItemList->setLineWidth( 3 );
432 } 440 }
433 QString text; 441 QString text;
434 if (event->isMultiDay()) { 442 if (event->isMultiDay()) {
435 QString prefix = "<->"; 443 QString prefix = "<->";
436 if ( event->doesRecur() ) { 444 if ( event->doesRecur() ) {
437 if ( event->recursOn( mDate) ) 445 if ( event->recursOn( mDate) )
438 prefix ="->" ; 446 prefix ="->" ;
439 else { 447 else {
440 int days = event->dtStart().date().daysTo ( event->dtEnd().date() ); 448 int days = event->dtStart().date().daysTo ( event->dtEnd().date() );
441 if ( event->recursOn( mDate.addDays( -days)) ) 449 if ( event->recursOn( mDate.addDays( -days)) )
442 prefix ="<-" ; 450 prefix ="<-" ;
443 } 451 }
444 452
445 } else { 453 } else {
446 if (mDate == event->dtStart().date()) { 454 if (mDate == event->dtStart().date()) {
447 prefix ="->" ; 455 prefix ="->" ;
448 } else if (mDate == event->dtEnd().date()) { 456 } else if (mDate == event->dtEnd().date()) {
449 prefix ="<-" ; 457 prefix ="<-" ;
450 } 458 }
@@ -521,100 +529,101 @@ void MonthViewCell::updateCell()
521 text += i18n("To-Do: %1").arg(todo->summary()); 529 text += i18n("To-Do: %1").arg(todo->summary());
522 530
523 MonthViewItem *item = new MonthViewItem( todo, mDate, text ); 531 MonthViewItem *item = new MonthViewItem( todo, mDate, text );
524 //item->setPalette( mStandardPalette ); 532 //item->setPalette( mStandardPalette );
525 QPalette pal; 533 QPalette pal;
526 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) { 534 if (KOPrefs::instance()->mMonthViewUsesCategoryColor) {
527 QStringList categories = todo->categories(); 535 QStringList categories = todo->categories();
528 QString cat = categories.first(); 536 QString cat = categories.first();
529 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) { 537 if ( KOPrefs::instance()->mMonthViewUsesForegroundColor ) {
530 pal = getPalette(); 538 pal = getPalette();
531 if (cat.isEmpty()) { 539 if (cat.isEmpty()) {
532 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor); 540 pal.setColor(QColorGroup::Foreground,KOPrefs::instance()->mEventColor);
533 } else { 541 } else {
534 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat))); 542 pal.setColor(QColorGroup::Foreground, *(KOPrefs::instance()->categoryColor(cat)));
535 } 543 }
536 544
537 } else { 545 } else {
538 if (cat.isEmpty()) { 546 if (cat.isEmpty()) {
539 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor); 547 pal = QPalette(KOPrefs::instance()->mEventColor, KOPrefs::instance()->mEventColor);
540 } else { 548 } else {
541 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat))); 549 pal = QPalette(*(KOPrefs::instance()->categoryColor(cat)), *(KOPrefs::instance()->categoryColor(cat)));
542 } 550 }
543 } 551 }
544 552
545 } else { 553 } else {
546 pal = mStandardPalette ; 554 pal = mStandardPalette ;
547 } 555 }
548 item->setPalette( pal ); 556 item->setPalette( pal );
549 mItemList->insertItem( item ); 557 mItemList->insertItem( item );
550 tipText += text+"\n"; 558 tipText += text+"\n";
551 } 559 }
552#ifdef DESKTOP_VERSION 560#ifdef DESKTOP_VERSION
553 if (tipText != "") 561 if (tipText != "")
554 QToolTip::add(this,tipText,toolTipGroup(),""); 562 QToolTip::add(this,tipText,toolTipGroup(),"");
555#endif 563#endif
556 564
557 //setMyPalette(); 565 //setMyPalette();
558 setMyPalette(); 566 setMyPalette();
559 QString text; 567 QString text;
560 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; 568 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
561 if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { 569 if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
562 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; 570 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
563 mLabel->resize( mLabelBigSize ); 571 mLabel->resize( mLabelBigSize );
564 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 572 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
565 } else { 573 } else {
566 mLabel->resize( mLabelSize ); 574 mLabel->resize( mLabelSize );
567 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 575 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
568 } 576 }
577
569 mLabel->setText( text ); 578 mLabel->setText( text );
570 resizeEvent( 0 ); 579 resizeEvent( 0 );
571 // if ( isVisible()) 580 // if ( isVisible())
572 qApp->processEvents(); 581 //qApp->processEvents();
573} 582}
574 583
575void MonthViewCell::updateConfig() 584void MonthViewCell::updateConfig()
576{ 585{
577 586
578 setFont( KOPrefs::instance()->mMonthViewFont ); 587 setFont( KOPrefs::instance()->mMonthViewFont );
579 588
580 QFontMetrics fm( font() ); 589 QFontMetrics fm( font() );
581 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); 590 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
582 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); 591 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
583 mHolidayPalette = mStandardPalette; 592 mHolidayPalette = mStandardPalette;
584 mPrimaryPalette = mStandardPalette; 593 mPrimaryPalette = mStandardPalette;
585 mNonPrimaryPalette = mStandardPalette; 594 mNonPrimaryPalette = mStandardPalette;
586 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { 595 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
587 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); 596 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
588 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); 597 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
589 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); 598 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
590 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); 599 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
591 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); 600 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
592 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); 601 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
593 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); 602 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
594 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); 603 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
595 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); 604 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
596 } 605 }
597 updateCell(); 606 updateCell();
598} 607}
599 608
600void MonthViewCell::enableScrollBars( bool enabled ) 609void MonthViewCell::enableScrollBars( bool enabled )
601{ 610{
602 if ( enabled ) { 611 if ( enabled ) {
603 mItemList->setVScrollBarMode(QScrollView::Auto); 612 mItemList->setVScrollBarMode(QScrollView::Auto);
604 mItemList->setHScrollBarMode(QScrollView::Auto); 613 mItemList->setHScrollBarMode(QScrollView::Auto);
605 } else { 614 } else {
606 mItemList->setVScrollBarMode(QScrollView::AlwaysOff); 615 mItemList->setVScrollBarMode(QScrollView::AlwaysOff);
607 mItemList->setHScrollBarMode(QScrollView::AlwaysOff); 616 mItemList->setHScrollBarMode(QScrollView::AlwaysOff);
608 } 617 }
609} 618}
610 619
611Incidence *MonthViewCell::selectedIncidence() 620Incidence *MonthViewCell::selectedIncidence()
612{ 621{
613 int index = mItemList->currentItem(); 622 int index = mItemList->currentItem();
614 if ( index < 0 ) return 0; 623 if ( index < 0 ) return 0;
615 624
616 MonthViewItem *item = 625 MonthViewItem *item =
617 static_cast<MonthViewItem *>( mItemList->item( index ) ); 626 static_cast<MonthViewItem *>( mItemList->item( index ) );
618 627
619 if ( !item ) return 0; 628 if ( !item ) return 0;
620 629
@@ -891,106 +900,107 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
891 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) { 900 while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) {
892 mStartDate = mStartDate.addDays( -1 ); 901 mStartDate = mStartDate.addDays( -1 );
893 } 902 }
894 903
895 bool primary = false; 904 bool primary = false;
896 uint i; 905 uint i;
897 for( i = 0; i < mCells.size(); ++i ) { 906 for( i = 0; i < mCells.size(); ++i ) {
898 QDate date = mStartDate.addDays( i ); 907 QDate date = mStartDate.addDays( i );
899 mCells[i]->setDate( date ); 908 mCells[i]->setDate( date );
900 909
901#ifndef KORG_NOPLUGINS 910#ifndef KORG_NOPLUGINS
902 // add holiday, if present 911 // add holiday, if present
903 QString hstring(KOCore::self()->holiday(date)); 912 QString hstring(KOCore::self()->holiday(date));
904 mCells[i]->setHoliday( hstring ); 913 mCells[i]->setHoliday( hstring );
905#endif 914#endif
906 915
907 } 916 }
908 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 ); 917 QDate date = mStartDate.addDays( mWeekStartsMonday ? 3 : 4 );
909 for( i = 0; i < 6; ++i ) { 918 for( i = 0; i < 6; ++i ) {
910 int wno; 919 int wno;
911 // remember, according to ISO 8601, the first week of the year is the 920 // remember, according to ISO 8601, the first week of the year is the
912 // first week that contains a thursday. Thus we must subtract off 4, 921 // first week that contains a thursday. Thus we must subtract off 4,
913 // not just 1. 922 // not just 1.
914 int dayOfYear = date.dayOfYear(); 923 int dayOfYear = date.dayOfYear();
915 if (dayOfYear % 7 != 0) 924 if (dayOfYear % 7 != 0)
916 wno = dayOfYear / 7 + 1; 925 wno = dayOfYear / 7 + 1;
917 else 926 else
918 wno =dayOfYear / 7; 927 wno =dayOfYear / 7;
919 mWeekLabels[i]->setWeekNum( wno ); 928 mWeekLabels[i]->setWeekNum( wno );
920 date = date.addDays( 7 ); 929 date = date.addDays( 7 );
921 } 930 }
922 updateView(); 931 updateView();
923} 932}
924 933
925void KOMonthView::showEvents(QPtrList<Event>) 934void KOMonthView::showEvents(QPtrList<Event>)
926{ 935{
927 qDebug("KOMonthView::selectEvents is not implemented yet. "); 936 qDebug("KOMonthView::selectEvents is not implemented yet. ");
928} 937}
929 938
930void KOMonthView::changeEventDisplay(Event *, int) 939void KOMonthView::changeEventDisplay(Event *, int)
931{ 940{
932 // this should be re-written to be much more efficient, but this 941 // this should be re-written to be much more efficient, but this
933 // quick-and-dirty-hack gets the job done for right now. 942 // quick-and-dirty-hack gets the job done for right now.
934 updateView(); 943 updateView();
935} 944}
936 945
937void KOMonthView::updateView() 946void KOMonthView::updateView()
938{ 947{
939 static int iii = 0;
940 ++iii;
941 if ( !updatePossible ) 948 if ( !updatePossible )
942 return; 949 return;
943 uint i; 950 //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
951 int i;
944 for( i = 0; i < mCells.count(); ++i ) { 952 for( i = 0; i < mCells.count(); ++i ) {
945 mCells[i]->updateCell(); 953 mCells[i]->updateCell();
946 } 954 }
955
947 //qDebug("KOMonthView::updateView() "); 956 //qDebug("KOMonthView::updateView() ");
948 processSelectionChange(); 957 processSelectionChange();
958 // qDebug("---------------------------------------------------------------------+ ");
949} 959}
950 960
951void KOMonthView::resizeEvent(QResizeEvent * e) 961void KOMonthView::resizeEvent(QResizeEvent * e)
952{ 962{
953 computeLayout(); 963 computeLayout();
954} 964}
955void KOMonthView::computeLayout() 965void KOMonthView::computeLayout()
956{ 966{
957 // select the appropriate heading string size. E.g. "Wednesday" or "Wed". 967 // select the appropriate heading string size. E.g. "Wednesday" or "Wed".
958 // note this only changes the text if the requested size crosses the 968 // note this only changes the text if the requested size crosses the
959 // threshold between big enough to support the full name and not big 969 // threshold between big enough to support the full name and not big
960 // enough. 970 // enough.
961 971
962 int daysToShow = 7; 972 int daysToShow = 7;
963 bool combinedSatSun = false; 973 bool combinedSatSun = false;
964 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) { 974 if (mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ) {
965 daysToShow = 6; 975 daysToShow = 6;
966 combinedSatSun = true; 976 combinedSatSun = true;
967 } 977 }
968 int tWid = topLevelWidget()->size().width(); 978 int tWid = topLevelWidget()->size().width();
969 int tHei = topLevelWidget()->size().height(); 979 int tHei = topLevelWidget()->size().height();
970 980
971 int wid = size().width();//e 981 int wid = size().width();//e
972 int hei = size().height()-1; 982 int hei = size().height()-1;
973 983
974 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei ) 984 if ( ((wid *3)/2) < tWid && (( hei *3) /2) < tHei )
975 return; 985 return;
976 //qDebug("KOMonthView::computeLayout()------------------------------------ "); 986 //qDebug("KOMonthView::computeLayout()------------------------------------ ");
977 QFontMetrics fm ( mWeekLabels[0]->font() ); 987 QFontMetrics fm ( mWeekLabels[0]->font() );
978 int weeklabelwid = fm.width( "888" ); 988 int weeklabelwid = fm.width( "888" );
979 wid -= weeklabelwid; 989 wid -= weeklabelwid;
980 990
981 int colWid = wid / daysToShow; 991 int colWid = wid / daysToShow;
982 int lastCol = wid - ( colWid*6 ); 992 int lastCol = wid - ( colWid*6 );
983 int dayLabelHei = mDayLabels[0]->sizeHint().height(); 993 int dayLabelHei = mDayLabels[0]->sizeHint().height();
984 int cellHei = (hei - dayLabelHei) /6; 994 int cellHei = (hei - dayLabelHei) /6;
985 int colModulo = wid % daysToShow; 995 int colModulo = wid % daysToShow;
986 int rowModulo = (hei- dayLabelHei) % 6; 996 int rowModulo = (hei- dayLabelHei) % 6;
987 //qDebug("rowmod %d ", rowModulo); 997 //qDebug("rowmod %d ", rowModulo);
988 int i; 998 int i;
989 int x,y,w,h; 999 int x,y,w,h;
990 x= 0; 1000 x= 0;
991 y= 0; 1001 y= 0;
992 w = colWid; 1002 w = colWid;
993 h = dayLabelHei ; 1003 h = dayLabelHei ;
994 for ( i = 0; i < 7; i++) { 1004 for ( i = 0; i < 7; i++) {
995 if ( i == daysToShow-colModulo ) 1005 if ( i == daysToShow-colModulo )
996 ++w; 1006 ++w;
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 727f511..a965bf3 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -102,96 +102,97 @@ class MonthViewItem: public QListBoxItem
102 QDate incidenceDate() { return mDate; } 102 QDate incidenceDate() { return mDate; }
103 103
104 protected: 104 protected:
105 virtual void paint(QPainter *); 105 virtual void paint(QPainter *);
106 virtual int height(const QListBox *) const; 106 virtual int height(const QListBox *) const;
107 virtual int width(const QListBox *) const; 107 virtual int width(const QListBox *) const;
108 108
109 private: 109 private:
110 bool mRecur; 110 bool mRecur;
111 bool mAlarm; 111 bool mAlarm;
112 bool mReply; 112 bool mReply;
113 bool mInfo; 113 bool mInfo;
114 114
115 QPalette mPalette; 115 QPalette mPalette;
116 QDate mDate; 116 QDate mDate;
117 117
118 Incidence *mIncidence; 118 Incidence *mIncidence;
119}; 119};
120 120
121 121
122class KOMonthView; 122class KOMonthView;
123 123
124class MonthViewCell : public QWidget 124class MonthViewCell : public QWidget
125{ 125{
126 Q_OBJECT 126 Q_OBJECT
127 public: 127 public:
128 MonthViewCell( KOMonthView * ); 128 MonthViewCell( KOMonthView * );
129 129
130 void setDate( const QDate & ); 130 void setDate( const QDate & );
131 QDate date() const; 131 QDate date() const;
132 132
133 void setPrimary( bool ); 133 void setPrimary( bool );
134 bool isPrimary() const; 134 bool isPrimary() const;
135 135
136 void setHoliday( bool ); 136 void setHoliday( bool );
137 void setHoliday( const QString & ); 137 void setHoliday( const QString & );
138 138
139 void updateCell(); 139 void updateCell();
140 140
141 void updateConfig(); 141 void updateConfig();
142 142
143 void enableScrollBars( bool ); 143 void enableScrollBars( bool );
144 144
145 Incidence *selectedIncidence(); 145 Incidence *selectedIncidence();
146 QDate selectedIncidenceDate(); 146 QDate selectedIncidenceDate();
147 147
148 void deselect(); 148 void deselect();
149 void select(); 149 void select();
150 void clear();
150 151
151#ifdef DESKTOP_VERSION 152#ifdef DESKTOP_VERSION
152 static QToolTipGroup *toolTipGroup(); 153 static QToolTipGroup *toolTipGroup();
153#endif 154#endif
154 signals: 155 signals:
155 void defaultAction( Incidence * ); 156 void defaultAction( Incidence * );
156 void newEventSignal( QDateTime ); 157 void newEventSignal( QDateTime );
157 void showDaySignal( QDate ); 158 void showDaySignal( QDate );
158 159
159 protected: 160 protected:
160 void resizeEvent( QResizeEvent * ); 161 void resizeEvent( QResizeEvent * );
161 162
162 protected slots: 163 protected slots:
163 void defaultAction( QListBoxItem * ); 164 void defaultAction( QListBoxItem * );
164 void contextMenu( QListBoxItem * ); 165 void contextMenu( QListBoxItem * );
165 void selection( QListBoxItem * ); 166 void selection( QListBoxItem * );
166 void cellClicked( QListBoxItem * ); 167 void cellClicked( QListBoxItem * );
167 void newEvent(); 168 void newEvent();
168 void showDay(); 169 void showDay();
169 170
170 private: 171 private:
171 KOMonthView *mMonthView; 172 KOMonthView *mMonthView;
172 173
173 QDate mDate; 174 QDate mDate;
174 bool mPrimary; 175 bool mPrimary;
175 bool mHoliday; 176 bool mHoliday;
176 QString mHolidayString; 177 QString mHolidayString;
177 178
178 //QLabel *mLabel; 179 //QLabel *mLabel;
179 QPushButton *mLabel; 180 QPushButton *mLabel;
180 QListBox *mItemList; 181 QListBox *mItemList;
181#ifdef DESKTOP_VERSION 182#ifdef DESKTOP_VERSION
182 static QToolTipGroup *mToolTipGroup; 183 static QToolTipGroup *mToolTipGroup;
183#endif 184#endif
184 QSize mLabelSize; 185 QSize mLabelSize;
185 QSize mLabelBigSize; 186 QSize mLabelBigSize;
186 QPalette mHolidayPalette; 187 QPalette mHolidayPalette;
187 QPalette mStandardPalette; 188 QPalette mStandardPalette;
188 QPalette mPrimaryPalette; 189 QPalette mPrimaryPalette;
189 QPalette mNonPrimaryPalette; 190 QPalette mNonPrimaryPalette;
190 void setMyPalette(); 191 void setMyPalette();
191 QPalette getPalette (); 192 QPalette getPalette ();
192 void keyPressEvent ( QKeyEvent * ) ; 193 void keyPressEvent ( QKeyEvent * ) ;
193 194
194}; 195};
195 196
196 197
197class KOMonthView: public KOEventView 198class KOMonthView: public KOEventView
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 00a5842..f6b7718 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -108,99 +108,100 @@ void KOViewManager::writeSettings(KConfig *config)
108 else if (mCurrentView == mListView) view = "List"; 108 else if (mCurrentView == mListView) view = "List";
109 else if (mCurrentView == mJournalView) view = "Journal"; 109 else if (mCurrentView == mJournalView) view = "Journal";
110 else if (mCurrentView == mTimeSpanView) view = "TimeSpan"; 110 else if (mCurrentView == mTimeSpanView) view = "TimeSpan";
111 else if (mCurrentView == mTodoView) view = "Todo"; 111 else if (mCurrentView == mTodoView) view = "Todo";
112 else view = "Agenda"; 112 else view = "Agenda";
113 113
114 config->writeEntry("Current View",view); 114 config->writeEntry("Current View",view);
115 115
116 if (mAgendaView) { 116 if (mAgendaView) {
117 mAgendaView->writeSettings(config); 117 mAgendaView->writeSettings(config);
118 } 118 }
119 if (mTimeSpanView) { 119 if (mTimeSpanView) {
120 mTimeSpanView->writeSettings(config); 120 mTimeSpanView->writeSettings(config);
121 } 121 }
122 if (mListView) { 122 if (mListView) {
123 mListView->writeSettings(config); 123 mListView->writeSettings(config);
124 } 124 }
125 if (mTodoView) { 125 if (mTodoView) {
126 mTodoView->saveLayout(config,"Todo View"); 126 mTodoView->saveLayout(config,"Todo View");
127 } 127 }
128} 128}
129 129
130void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen ) 130void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
131{ 131{
132 132
133 //mFlagShowNextxDays = false; 133 //mFlagShowNextxDays = false;
134 //if(view == mCurrentView) return; 134 //if(view == mCurrentView) return;
135 if ( view == 0 ) { 135 if ( view == 0 ) {
136 view = mCurrentView; 136 view = mCurrentView;
137 if ( view == 0 ) 137 if ( view == 0 )
138 return; 138 return;
139 } 139 }
140 bool full = fullScreen; 140 bool full = fullScreen;
141 if(view == mCurrentView && view != mWhatsNextView ) { 141 if(view == mCurrentView && view != mWhatsNextView ) {
142 if ( mCurrentAgendaView < 0 ) 142 if ( mCurrentAgendaView < 0 )
143 return; 143 return;
144 full = mMainView->leftFrame()->isVisible(); 144 full = mMainView->leftFrame()->isVisible();
145 } else { 145 } else {
146 mCurrentView = view; 146 mCurrentView = view;
147 147
148 // bool full = fullScreen; 148 // bool full = fullScreen;
149 bool isFull = !mMainView->leftFrame()->isVisible(); 149 bool isFull = !mMainView->leftFrame()->isVisible();
150 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 150 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
151 full = true; 151 full = true;
152 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 152 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
153 full = false; 153 full = false;
154 } 154 }
155 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 155 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
156 raiseCurrentView( full ); 156 //raiseCurrentView( full );
157 mMainView->processIncidenceSelection( 0 ); 157 mMainView->processIncidenceSelection( 0 );
158 mMainView->updateView(); 158 mMainView->updateView();
159 raiseCurrentView( full );
159 mMainView->adaptNavigationUnits(); 160 mMainView->adaptNavigationUnits();
160} 161}
161 162
162void KOViewManager::raiseCurrentView( bool fullScreen ) 163void KOViewManager::raiseCurrentView( bool fullScreen )
163{ 164{
164 //qDebug("raiseCurrentView "); 165 //qDebug("raiseCurrentView ");
165 mCurrentAgendaView = 0; 166 mCurrentAgendaView = 0;
166 int wid = mMainView->width() ; 167 int wid = mMainView->width() ;
167 int hei = mMainView->height(); 168 int hei = mMainView->height();
168 if ( mCurrentView == mMonthView ) { 169 if ( mCurrentView == mMonthView ) {
169 mMainView->navigatorBar()->show(); 170 mMainView->navigatorBar()->show();
170 hei -= mMainView->navigatorBar()->sizeHint().height(); 171 hei -= mMainView->navigatorBar()->sizeHint().height();
171 //mMainView->navigatorBar()->hide(); 172 //mMainView->navigatorBar()->hide();
172 } else { 173 } else {
173 mMainView->navigatorBar()->hide(); 174 mMainView->navigatorBar()->hide();
174 } 175 }
175 if ( fullScreen ) { 176 if ( fullScreen ) {
176 mMainView->leftFrame()->hide(); 177 mMainView->leftFrame()->hide();
177 } else { 178 } else {
178 mMainView->leftFrame()->show(); 179 mMainView->leftFrame()->show();
179 if ( KOPrefs::instance()->mVerticalScreen ) 180 if ( KOPrefs::instance()->mVerticalScreen )
180 hei -= mMainView->leftFrame()->height(); 181 hei -= mMainView->leftFrame()->height();
181 else 182 else
182 wid -= mMainView->leftFrame()->width(); 183 wid -= mMainView->leftFrame()->width();
183 } 184 }
184 185
185 if ( globalFlagBlockAgenda == 5 ) { 186 if ( globalFlagBlockAgenda == 5 ) {
186 globalFlagBlockAgenda = 4; 187 globalFlagBlockAgenda = 4;
187 globalFlagBlockAgendaItemPaint = 1; 188 globalFlagBlockAgendaItemPaint = 1;
188 } 189 }
189 mMainView->viewStack()->raiseWidget(mCurrentView); 190 mMainView->viewStack()->raiseWidget(mCurrentView);
190 if ( globalFlagBlockAgenda == 4 ) { 191 if ( globalFlagBlockAgenda == 4 ) {
191 if ( mCurrentView == mAgendaView ) { 192 if ( mCurrentView == mAgendaView ) {
192 //globalFlagBlockAgenda =1 ; 193 //globalFlagBlockAgenda =1 ;
193 if ( KOPrefs::instance()->mSetTimeToDayStartAt ) 194 if ( KOPrefs::instance()->mSetTimeToDayStartAt )
194 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins ); 195 mAgendaView->setStartHour( KOPrefs::instance()->mDayBegins );
195 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 196 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
196 mAgendaView->setStartHour( QTime::currentTime ().hour() ); 197 mAgendaView->setStartHour( QTime::currentTime ().hour() );
197 qApp->processEvents(); 198 qApp->processEvents();
198 //qDebug("qApp->processEvents() "); 199 //qDebug("qApp->processEvents() ");
199 globalFlagBlockAgenda = 0; 200 globalFlagBlockAgenda = 0;
200 mAgendaView->repaintAgenda(); 201 mAgendaView->repaintAgenda();
201 202
202 } 203 }
203 globalFlagBlockAgenda = 0; 204 globalFlagBlockAgenda = 0;
204 } 205 }
205 //qDebug("raiseCurrentView ende "); 206 //qDebug("raiseCurrentView ende ");
206} 207}