summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-02 20:10:54 (UTC)
committer zautrix <zautrix>2005-02-02 20:10:54 (UTC)
commitf79d089ec5c44a27f9005da76e452b4574eae27f (patch) (unidiff)
treebba6aa76939a7bd736230329088b812cabfa3204
parent20191b4c5acf30282436a7f7215719f7b2ec8b01 (diff)
downloadkdepimpi-f79d089ec5c44a27f9005da76e452b4574eae27f.zip
kdepimpi-f79d089ec5c44a27f9005da76e452b4574eae27f.tar.gz
kdepimpi-f79d089ec5c44a27f9005da76e452b4574eae27f.tar.bz2
fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index f8301f8..918931a 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -243,544 +243,543 @@ void TimeLabels::contentsMouseReleaseEvent ( QMouseEvent * e )
243} 243}
244 244
245/** This is called in response to repaint() */ 245/** This is called in response to repaint() */
246void TimeLabels::paintEvent(QPaintEvent*) 246void TimeLabels::paintEvent(QPaintEvent*)
247{ 247{
248 248
249 // kdDebug() << "paintevent..." << endl; 249 // kdDebug() << "paintevent..." << endl;
250 // this is another hack! 250 // this is another hack!
251 // QPainter painter(this); 251 // QPainter painter(this);
252 //QString c 252 //QString c
253 repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight()); 253 repaintContents(contentsX(), contentsY(), visibleWidth(), visibleHeight());
254} 254}
255 255
256//////////////////////////////////////////////////////////////////////////// 256////////////////////////////////////////////////////////////////////////////
257 257
258EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name) 258EventIndicator::EventIndicator(Location loc,QWidget *parent,const char *name)
259 : QFrame(parent,name) 259 : QFrame(parent,name)
260{ 260{
261 mColumns = 1; 261 mColumns = 1;
262 mTopBox = 0; 262 mTopBox = 0;
263 mLocation = loc; 263 mLocation = loc;
264 mTopLayout = 0; 264 mTopLayout = 0;
265 mPaintWidget = 0; 265 mPaintWidget = 0;
266 mXOffset = 0; 266 mXOffset = 0;
267 if (mLocation == Top) mPixmap = SmallIcon("1uparrow"); 267 if (mLocation == Top) mPixmap = SmallIcon("1uparrow");
268 else mPixmap = SmallIcon("1downarrow"); 268 else mPixmap = SmallIcon("1downarrow");
269 mEnabled.resize(mColumns); 269 mEnabled.resize(mColumns);
270 if (mLocation == Top) 270 if (mLocation == Top)
271 setMaximumHeight(0); 271 setMaximumHeight(0);
272 else 272 else
273 setMinimumHeight(mPixmap.height()); 273 setMinimumHeight(mPixmap.height());
274} 274}
275 275
276EventIndicator::~EventIndicator() 276EventIndicator::~EventIndicator()
277{ 277{
278} 278}
279 279
280void EventIndicator::drawContents(QPainter *p) 280void EventIndicator::drawContents(QPainter *p)
281{ 281{
282 282
283 // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl; 283 // kdDebug() << "======== top: " << contentsRect().top() << " bottom " << // contentsRect().bottom() << " left " << contentsRect().left() << " right " << contentsRect().right() << endl;
284 KDGanttSplitterHandle* han = 0; 284 KDGanttSplitterHandle* han = 0;
285 if ( mPaintWidget ) 285 if ( mPaintWidget )
286 han = mPaintWidget->firstHandle(); 286 han = mPaintWidget->firstHandle();
287 if ( ! han ) { 287 if ( ! han ) {
288 int i; 288 int i;
289 for(i=0;i<mColumns;++i) { 289 for(i=0;i<mColumns;++i) {
290 if (mEnabled[i]) { 290 if (mEnabled[i]) {
291 int cellWidth = contentsRect().right()/mColumns; 291 int cellWidth = contentsRect().right()/mColumns;
292 int xOffset = KOGlobals::self()->reverseLayout() ? 292 int xOffset = KOGlobals::self()->reverseLayout() ?
293 (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : 293 (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 :
294 i*cellWidth + cellWidth/2 -mPixmap.width()/2; 294 i*cellWidth + cellWidth/2 -mPixmap.width()/2;
295 p->drawPixmap(QPoint(xOffset,0),mPixmap); 295 p->drawPixmap(QPoint(xOffset,0),mPixmap);
296 } 296 }
297 } 297 }
298 } else { 298 } else {
299 han->repaint(); 299 han->repaint();
300 //mPaintWidget->setBackgroundColor( red ); 300 //mPaintWidget->setBackgroundColor( red );
301 301
302 QPainter pa( han ); 302 QPainter pa( han );
303 int i; 303 int i;
304 bool setColor = false; 304 bool setColor = false;
305 for(i=0;i<mColumns;++i) { 305 for(i=0;i<mColumns;++i) {
306 if (mEnabled[i]) { 306 if (mEnabled[i]) {
307 setColor = true; 307 setColor = true;
308 308
309 int cellWidth = contentsRect().right()/mColumns; 309 int cellWidth = contentsRect().right()/mColumns;
310 int xOffset = KOGlobals::self()->reverseLayout() ? 310 int xOffset = KOGlobals::self()->reverseLayout() ?
311 (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 : 311 (mColumns - 1 - i)*cellWidth + cellWidth/2 -mPixmap.width()/2 :
312 i*cellWidth + cellWidth/2 -mPixmap.width()/2; 312 i*cellWidth + cellWidth/2 -mPixmap.width()/2;
313 pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap); 313 pa.drawPixmap(QPoint(mXOffset + xOffset,0),mPixmap);
314 //qDebug("222draw pix %d ",xOffset ); 314 //qDebug("222draw pix %d ",xOffset );
315 315
316 } 316 }
317 317
318 } 318 }
319 pa.end(); 319 pa.end();
320 320
321 } 321 }
322} 322}
323 323
324void EventIndicator::setXOffset( int x ) 324void EventIndicator::setXOffset( int x )
325{ 325{
326 mXOffset = x; 326 mXOffset = x;
327} 327}
328void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w ) 328void EventIndicator::setPaintWidget( KDGanttMinimizeSplitter * w )
329{ 329{
330 mPaintWidget = w; 330 mPaintWidget = w;
331} 331}
332void EventIndicator::changeColumns(int columns) 332void EventIndicator::changeColumns(int columns)
333{ 333{
334 mColumns = columns; 334 mColumns = columns;
335 mEnabled.resize(mColumns); 335 mEnabled.resize(mColumns);
336 336
337 update(); 337 update();
338} 338}
339 339
340void EventIndicator::enableColumn(int column, bool enable) 340void EventIndicator::enableColumn(int column, bool enable)
341{ 341{
342 mEnabled[column] = enable; 342 mEnabled[column] = enable;
343} 343}
344 344
345 345
346//////////////////////////////////////////////////////////////////////////// 346////////////////////////////////////////////////////////////////////////////
347//////////////////////////////////////////////////////////////////////////// 347////////////////////////////////////////////////////////////////////////////
348//////////////////////////////////////////////////////////////////////////// 348////////////////////////////////////////////////////////////////////////////
349 349
350KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) : 350KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
351 KOEventView (cal,parent,name) 351 KOEventView (cal,parent,name)
352{ 352{
353 mBlockUpdating = true; 353 mBlockUpdating = true;
354 mStartHour = 8; 354 mStartHour = 8;
355 mSelectedDates.append(QDate::currentDate()); 355 mSelectedDates.append(QDate::currentDate());
356 356
357 mLayoutDayLabels = 0; 357 mLayoutDayLabels = 0;
358 mDayLabelsFrame = 0; 358 mDayLabelsFrame = 0;
359 mDayLabels = 0; 359 mDayLabels = 0;
360 bool isRTL = KOGlobals::self()->reverseLayout(); 360 bool isRTL = KOGlobals::self()->reverseLayout();
361 361
362 if ( KOPrefs::instance()->mVerticalScreen ) { 362 if ( KOPrefs::instance()->mVerticalScreen ) {
363 mExpandedPixmap = SmallIcon( "1downarrow" ); 363 mExpandedPixmap = SmallIcon( "1downarrow" );
364 mNotExpandedPixmap = SmallIcon( "1uparrow" ); 364 mNotExpandedPixmap = SmallIcon( "1uparrow" );
365 } else { 365 } else {
366 mExpandedPixmap = SmallIcon( isRTL ? "1leftarrow" : "1rightarrow" ); 366 mExpandedPixmap = SmallIcon( isRTL ? "1leftarrow" : "1rightarrow" );
367 mNotExpandedPixmap = SmallIcon( isRTL ? "1rightarrow" : "1leftarrow" ); 367 mNotExpandedPixmap = SmallIcon( isRTL ? "1rightarrow" : "1leftarrow" );
368 } 368 }
369 369
370 QBoxLayout *topLayout = new QVBoxLayout(this); 370 QBoxLayout *topLayout = new QVBoxLayout(this);
371 371
372 // Create day name labels for agenda columns 372 // Create day name labels for agenda columns
373 mDayLabelsFrame = new QHBox(this); 373 mDayLabelsFrame = new QHBox(this);
374 topLayout->addWidget(mDayLabelsFrame); 374 topLayout->addWidget(mDayLabelsFrame);
375 mDayLabels = new QFrame (mDayLabelsFrame); 375 mDayLabels = new QFrame (mDayLabelsFrame);
376 mLayoutDayLabels = new QHBoxLayout(mDayLabels); 376 mLayoutDayLabels = new QHBoxLayout(mDayLabels);
377 // Create agenda splitter 377 // Create agenda splitter
378#ifndef KORG_NOSPLITTER 378#ifndef KORG_NOSPLITTER
379 mSplitterAgenda = new QSplitter(Vertical,this); 379 mSplitterAgenda = new QSplitter(Vertical,this);
380 topLayout->addWidget(mSplitterAgenda); 380 topLayout->addWidget(mSplitterAgenda);
381 mSplitterAgenda->setOpaqueResize(); 381 mSplitterAgenda->setOpaqueResize();
382 382
383 mAllDayFrame = new QHBox(mSplitterAgenda); 383 mAllDayFrame = new QHBox(mSplitterAgenda);
384 384
385 QWidget *agendaFrame = new QWidget(mSplitterAgenda); 385 QWidget *agendaFrame = new QWidget(mSplitterAgenda);
386#else 386#else
387#if 0 387#if 0
388 QWidget *mainBox = new QWidget( this ); 388 QWidget *mainBox = new QWidget( this );
389 topLayout->addWidget( mainBox ); 389 topLayout->addWidget( mainBox );
390 QBoxLayout *mainLayout = new QVBoxLayout(mainBox); 390 QBoxLayout *mainLayout = new QVBoxLayout(mainBox);
391 mAllDayFrame = new QHBox(mainBox); 391 mAllDayFrame = new QHBox(mainBox);
392 mainLayout->addWidget(mAllDayFrame); 392 mainLayout->addWidget(mAllDayFrame);
393 mainLayout->setStretchFactor( mAllDayFrame, 0 ); 393 mainLayout->setStretchFactor( mAllDayFrame, 0 );
394 mAllDayFrame->setFocusPolicy(NoFocus); 394 mAllDayFrame->setFocusPolicy(NoFocus);
395 QWidget *agendaFrame = new QWidget(mainBox); 395 QWidget *agendaFrame = new QWidget(mainBox);
396 mainLayout->addWidget(agendaFrame); 396 mainLayout->addWidget(agendaFrame);
397 mainLayout->setStretchFactor( agendaFrame, 10 ); 397 mainLayout->setStretchFactor( agendaFrame, 10 );
398 398
399 agendaFrame->setFocusPolicy(NoFocus); 399 agendaFrame->setFocusPolicy(NoFocus);
400#endif 400#endif
401 mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this); 401 mSplitterAgenda = new KDGanttMinimizeSplitter( Qt::Vertical, this);
402 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 402 mSplitterAgenda->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
403 topLayout->addWidget( mSplitterAgenda ); 403 topLayout->addWidget( mSplitterAgenda );
404 mAllDayFrame = new QHBox(mSplitterAgenda); 404 mAllDayFrame = new QHBox(mSplitterAgenda);
405 mAllDayFrame->setFocusPolicy(NoFocus); 405 mAllDayFrame->setFocusPolicy(NoFocus);
406 QWidget *agendaFrame = new QWidget(mSplitterAgenda); 406 QWidget *agendaFrame = new QWidget(mSplitterAgenda);
407 agendaFrame->setFocusPolicy(NoFocus); 407 agendaFrame->setFocusPolicy(NoFocus);
408 408
409#endif 409#endif
410 410
411 // Create all-day agenda widget 411 // Create all-day agenda widget
412 mDummyAllDayLeft = new QVBox( mAllDayFrame ); 412 mDummyAllDayLeft = new QVBox( mAllDayFrame );
413 413
414 mExpandButton = new QPushButton(mDummyAllDayLeft); 414 mExpandButton = new QPushButton(mDummyAllDayLeft);
415 mExpandButton->setPixmap( mNotExpandedPixmap ); 415 mExpandButton->setPixmap( mNotExpandedPixmap );
416 int widebut = mExpandButton->sizeHint().width(); 416 int widebut = mExpandButton->sizeHint().width();
417 if ( QApplication::desktop()->width() < 480 ) 417 if ( QApplication::desktop()->width() < 480 )
418 widebut = widebut*2; 418 widebut = widebut*2;
419 else 419 else
420 widebut = (widebut*3) / 2; 420 widebut = (widebut*3) / 2;
421 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed, 421 //mExpandButton->setSizePolicy( QSizePolicy( QSizePolicy::Fixed,
422 // QSizePolicy::Fixed ) ); 422 // QSizePolicy::Fixed ) );
423 mExpandButton->setFixedSize( widebut, widebut); 423 mExpandButton->setFixedSize( widebut, widebut);
424 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) ); 424 connect( mExpandButton, SIGNAL( clicked() ), SIGNAL( toggleExpand() ) );
425 mExpandButton->setFocusPolicy(NoFocus); 425 mExpandButton->setFocusPolicy(NoFocus);
426 mAllDayAgenda = new KOAgenda(1,mAllDayFrame); 426 mAllDayAgenda = new KOAgenda(1,mAllDayFrame);
427 mAllDayAgenda->setFocusPolicy(NoFocus); 427 mAllDayAgenda->setFocusPolicy(NoFocus);
428 QVBox *dummyAllDayRight = new QVBox(mAllDayFrame); 428 QVBox *dummyAllDayRight = new QVBox(mAllDayFrame);
429 429
430 QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight); 430 QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight);
431 mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); 431 mDummyAllDayRightL = new QLabel ( dummyAllDayRight );
432 432
433 dummyAllDayRightB->setFlat( true ); 433 dummyAllDayRightB->setFlat( true );
434 dummyAllDayRightB->setFocusPolicy(NoFocus); 434 dummyAllDayRightB->setFocusPolicy(NoFocus);
435 // dummyAllDayRightB->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding ));
436 dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); 435 dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 );
437 QPopupMenu * wpo = new QPopupMenu (this); 436 QPopupMenu * wpo = new QPopupMenu (this);
438 wpo->insertItem( i18n("W#"), 0 ); 437 wpo->insertItem( i18n("W#"), 0 );
439 int i; 438 int i;
440 for ( i = 1; i < 53; i++ ) 439 for ( i = 1; i < 53; i++ )
441 wpo->insertItem( QString::number( i ),i ); 440 wpo->insertItem( QString::number( i ),i );
442 //Qt bug - we must add some empty fields... 441 //Qt bug - we must add some empty fields...
443 for ( i = 53; i < 54; ++i ) { 442 for ( i = 53; i < 54; ++i ) {
444 wpo->insertItem( "", 52 ); 443 wpo->insertItem( "", 52 );
445 } 444 }
446 dummyAllDayRightB->setPopup( wpo ); 445 dummyAllDayRightB->setPopup( wpo );
447 446
448 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); 447 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
449 448
450 // Create event context menu for all day agenda 449 // Create event context menu for all day agenda
451 mAllDayAgendaPopup = eventPopup(); 450 mAllDayAgendaPopup = eventPopup();
452 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 451 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
453 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 452 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
454 453
455 // Create agenda frame 454 // Create agenda frame
456 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); 455 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3);
457 // QHBox *agendaFrame = new QHBox(splitterAgenda); 456 // QHBox *agendaFrame = new QHBox(splitterAgenda);
458 457
459 // create event indicator bars 458 // create event indicator bars
460 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); 459 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
461 agendaLayout->addWidget(mEventIndicatorTop,0,1); 460 agendaLayout->addWidget(mEventIndicatorTop,0,1);
462 mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); 461 mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
463 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, 462 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
464 agendaFrame); 463 agendaFrame);
465 agendaLayout->addWidget(mEventIndicatorBottom,2,1); 464 agendaLayout->addWidget(mEventIndicatorBottom,2,1);
466 QWidget *dummyAgendaRight = new QWidget(agendaFrame); 465 QWidget *dummyAgendaRight = new QWidget(agendaFrame);
467 agendaLayout->addWidget(dummyAgendaRight,0,2); 466 agendaLayout->addWidget(dummyAgendaRight,0,2);
468 467
469 // Create time labels 468 // Create time labels
470 mTimeLabels = new TimeLabels(24,agendaFrame); 469 mTimeLabels = new TimeLabels(24,agendaFrame);
471 agendaLayout->addWidget(mTimeLabels,1,0); 470 agendaLayout->addWidget(mTimeLabels,1,0);
472 connect(mTimeLabels,SIGNAL( scaleChanged()), 471 connect(mTimeLabels,SIGNAL( scaleChanged()),
473 this,SLOT(updateConfig())); 472 this,SLOT(updateConfig()));
474 473
475 // Create agenda 474 // Create agenda
476 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); 475 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
477 agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); 476 agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2);
478 agendaLayout->setColStretch(1,1); 477 agendaLayout->setColStretch(1,1);
479 mAgenda->setFocusPolicy(NoFocus); 478 mAgenda->setFocusPolicy(NoFocus);
480 // Create event context menu for agenda 479 // Create event context menu for agenda
481 mAgendaPopup = eventPopup(); 480 mAgendaPopup = eventPopup();
482 481
483 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), 482 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")),
484 i18n("Toggle Alarm"),mAgenda, 483 i18n("Toggle Alarm"),mAgenda,
485 SLOT(popupAlarm()),true); 484 SLOT(popupAlarm()),true);
486 485
487 486
488 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 487 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
489 mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 488 mAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
490 489
491 // make connections between dependent widgets 490 // make connections between dependent widgets
492 mTimeLabels->setAgenda(mAgenda); 491 mTimeLabels->setAgenda(mAgenda);
493 492
494 // Update widgets to reflect user preferences 493 // Update widgets to reflect user preferences
495 // updateConfig(); 494 // updateConfig();
496 495
497 // createDayLabels(); 496 // createDayLabels();
498 497
499 // these blank widgets make the All Day Event box line up with the agenda 498 // these blank widgets make the All Day Event box line up with the agenda
500 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 499 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
501 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 500 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
502 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 501 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
503 502
504 // Scrolling 503 // Scrolling
505 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), 504 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
506 mTimeLabels, SLOT(positionChanged())); 505 mTimeLabels, SLOT(positionChanged()));
507 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), 506 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
508 SLOT(setContentsPos(int))); 507 SLOT(setContentsPos(int)));
509 508
510 connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 509 connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
511 connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 510 connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
512 511
513 // Create/Show/Edit/Delete Event 512 // Create/Show/Edit/Delete Event
514 connect(mAgenda,SIGNAL(newEventSignal(int,int)), 513 connect(mAgenda,SIGNAL(newEventSignal(int,int)),
515 SLOT(newEvent(int,int))); 514 SLOT(newEvent(int,int)));
516 connect(mAgenda,SIGNAL(newTodoSignal(int,int)), 515 connect(mAgenda,SIGNAL(newTodoSignal(int,int)),
517 SLOT(newTodo(int,int))); 516 SLOT(newTodo(int,int)));
518 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), 517 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)),
519 SLOT(newEvent(int,int,int,int))); 518 SLOT(newEvent(int,int,int,int)));
520 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), 519 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)),
521 SLOT(newEventAllDay(int,int))); 520 SLOT(newEventAllDay(int,int)));
522 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), 521 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)),
523 SLOT(newTodoAllDay(int,int))); 522 SLOT(newTodoAllDay(int,int)));
524 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), 523 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)),
525 SLOT(newEventAllDay(int,int))); 524 SLOT(newEventAllDay(int,int)));
526 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 525 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
527 SLOT(newTimeSpanSelected(int,int,int,int))); 526 SLOT(newTimeSpanSelected(int,int,int,int)));
528 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 527 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
529 SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); 528 SLOT(newTimeSpanSelectedAllDay(int,int,int,int)));
530 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 529 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
531 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 530 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
532 531
533 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 532 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
534 SIGNAL(editIncidenceSignal(Incidence *))); 533 SIGNAL(editIncidenceSignal(Incidence *)));
535 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 534 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
536 SIGNAL(editIncidenceSignal(Incidence *))); 535 SIGNAL(editIncidenceSignal(Incidence *)));
537 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 536 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
538 SIGNAL(showIncidenceSignal(Incidence *))); 537 SIGNAL(showIncidenceSignal(Incidence *)));
539 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 538 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
540 SIGNAL(showIncidenceSignal(Incidence *))); 539 SIGNAL(showIncidenceSignal(Incidence *)));
541 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 540 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
542 SIGNAL(deleteIncidenceSignal(Incidence *))); 541 SIGNAL(deleteIncidenceSignal(Incidence *)));
543 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 542 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
544 SIGNAL(deleteIncidenceSignal(Incidence *))); 543 SIGNAL(deleteIncidenceSignal(Incidence *)));
545 544
546 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), 545 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )),
547 SLOT(updateEventDates(KOAgendaItem *, int ))); 546 SLOT(updateEventDates(KOAgendaItem *, int )));
548 connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), 547 connect(mAllDayAgenda,SIGNAL(itemModified(KOAgendaItem *, int )),
549 SLOT(updateEventDates(KOAgendaItem *, int))); 548 SLOT(updateEventDates(KOAgendaItem *, int)));
550 549
551 // event indicator update 550 // event indicator update
552 connect(mAgenda,SIGNAL(lowerYChanged(int)), 551 connect(mAgenda,SIGNAL(lowerYChanged(int)),
553 SLOT(updateEventIndicatorTop(int))); 552 SLOT(updateEventIndicatorTop(int)));
554 connect(mAgenda,SIGNAL(upperYChanged(int)), 553 connect(mAgenda,SIGNAL(upperYChanged(int)),
555 SLOT(updateEventIndicatorBottom(int))); 554 SLOT(updateEventIndicatorBottom(int)));
556 // drag signals 555 // drag signals
557 /* 556 /*
558 connect(mAgenda,SIGNAL(startDragSignal(Event *)), 557 connect(mAgenda,SIGNAL(startDragSignal(Event *)),
559 SLOT(startDrag(Event *))); 558 SLOT(startDrag(Event *)));
560 connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)), 559 connect(mAllDayAgenda,SIGNAL(startDragSignal(Event *)),
561 SLOT(startDrag(Event *))); 560 SLOT(startDrag(Event *)));
562 */ 561 */
563 // synchronize selections 562 // synchronize selections
564 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 563 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
565 mAllDayAgenda, SLOT( deselectItem() ) ); 564 mAllDayAgenda, SLOT( deselectItem() ) );
566 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 565 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
567 mAgenda, SLOT( deselectItem() ) ); 566 mAgenda, SLOT( deselectItem() ) );
568 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 567 connect( mAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
569 SIGNAL( incidenceSelected( Incidence * ) ) ); 568 SIGNAL( incidenceSelected( Incidence * ) ) );
570 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ), 569 connect( mAllDayAgenda, SIGNAL( incidenceSelected( Incidence * ) ),
571 SIGNAL( incidenceSelected( Incidence * ) ) ); 570 SIGNAL( incidenceSelected( Incidence * ) ) );
572 connect( mAgenda, SIGNAL( resizedSignal() ), 571 connect( mAgenda, SIGNAL( resizedSignal() ),
573 SLOT( updateConfig( ) ) ); 572 SLOT( updateConfig( ) ) );
574 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ), 573 connect( mAgenda, SIGNAL( addToCalSignal(Incidence *, Incidence *) ),
575 SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); 574 SLOT( addToCalSlot(Incidence *, Incidence * ) ) );
576 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), 575 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ),
577 SLOT( addToCalSlot(Incidence * , Incidence *) ) ); 576 SLOT( addToCalSlot(Incidence * , Incidence *) ) );
578 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 577 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
579 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 578 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
580 579
581 QFont dlf = KOPrefs::instance()->mTimeLabelsFont; 580 QFont dlf = KOPrefs::instance()->mTimeLabelsFont;
582 QFontMetrics fm ( dlf ); 581 QFontMetrics fm ( dlf );
583 QString dayTest = "30"; 582 QString dayTest = "30";
584 int wid = fm.width( dayTest ); 583 int wid = fm.width( dayTest );
585 int maxWid = dummyAllDayRight->width(); 584 int maxWid = dummyAllDayRight->width();
586 int fontPoint = dlf.pointSize(); 585 int fontPoint = dlf.pointSize();
587 while ( wid > maxWid ) { 586 while ( wid > maxWid ) {
588 --fontPoint; 587 --fontPoint;
589 dlf.setPointSize( fontPoint ); 588 dlf.setPointSize( fontPoint );
590 QFontMetrics f( dlf ); 589 QFontMetrics f( dlf );
591 wid = f.width( dayTest ); 590 wid = f.width( dayTest );
592 } 591 }
593 mDummyAllDayRightL->setFont( dlf ); 592 mDummyAllDayRightL->setFont( dlf );
594 593 mDummyAllDayRightL->setAlignment( AlignHCenter );
595} 594}
596 595
597void KOAgendaView::toggleAllDay() 596void KOAgendaView::toggleAllDay()
598{ 597{
599 if ( mSplitterAgenda->firstHandle() ) 598 if ( mSplitterAgenda->firstHandle() )
600 mSplitterAgenda->firstHandle()->toggle(); 599 mSplitterAgenda->firstHandle()->toggle();
601} 600}
602void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) 601void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
603{ 602{
604 calendar()->addIncidence( inc ); 603 calendar()->addIncidence( inc );
605 604
606 if ( incOld ) { 605 if ( incOld ) {
607 if ( incOld->type() == "Todo" ) 606 if ( incOld->type() == "Todo" )
608 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED ); 607 emit todoMoved((Todo*)incOld, KOGlobals::EVENTEDITED );
609 else 608 else
610 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED); 609 emit incidenceChanged(incOld, KOGlobals::EVENTEDITED);
611 } 610 }
612 611
613} 612}
614 613
615KOAgendaView::~KOAgendaView() 614KOAgendaView::~KOAgendaView()
616{ 615{
617 delete mAgendaPopup; 616 delete mAgendaPopup;
618 delete mAllDayAgendaPopup; 617 delete mAllDayAgendaPopup;
619 delete KOAgendaItem::paintPix(); 618 delete KOAgendaItem::paintPix();
620 delete KOAgendaItem::paintPixSel(); 619 delete KOAgendaItem::paintPixSel();
621} 620}
622void KOAgendaView::resizeEvent( QResizeEvent* e ) 621void KOAgendaView::resizeEvent( QResizeEvent* e )
623{ 622{
624 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width()); 623 //qDebug("KOAgendaView::resizeEvent( QResizeEvent* e ) %d ", e->size().width());
625 bool uc = false; 624 bool uc = false;
626 int ow = e->oldSize().width(); 625 int ow = e->oldSize().width();
627 int oh = e->oldSize().height(); 626 int oh = e->oldSize().height();
628 int w = e->size().width(); 627 int w = e->size().width();
629 int h = e->size().height(); 628 int h = e->size().height();
630 if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) { 629 if ( (ow > oh && w< h ) || (ow < oh && w > h ) ) {
631 if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda ) 630 if ( ! mBlockUpdating && !globalFlagBlockStartup && !globalFlagBlockAgenda )
632 uc = true; 631 uc = true;
633 //qDebug("view changed %d %d %d %d ", ow, oh , w , h); 632 //qDebug("view changed %d %d %d %d ", ow, oh , w , h);
634 } 633 }
635 mUpcomingWidth = e->size().width() ; 634 mUpcomingWidth = e->size().width() ;
636 if ( mBlockUpdating || uc ) { 635 if ( mBlockUpdating || uc ) {
637 mBlockUpdating = false; 636 mBlockUpdating = false;
638 //mAgenda->setMinimumSize(800 , 600 ); 637 //mAgenda->setMinimumSize(800 , 600 );
639 //qDebug("mAgenda->resize+++++++++++++++ "); 638 //qDebug("mAgenda->resize+++++++++++++++ ");
640 updateConfig(); 639 updateConfig();
641 //qDebug("KOAgendaView::Updating now possible "); 640 //qDebug("KOAgendaView::Updating now possible ");
642 } else 641 } else
643 createDayLabels(); 642 createDayLabels();
644 //qDebug("resizeEvent end "); 643 //qDebug("resizeEvent end ");
645 644
646} 645}
647void KOAgendaView::slotDaylabelClicked( int num ) 646void KOAgendaView::slotDaylabelClicked( int num )
648{ 647{
649 648
650 QDate firstDate = mSelectedDates.first(); 649 QDate firstDate = mSelectedDates.first();
651 if ( num == -1 ) 650 if ( num == -1 )
652 emit showDateView( 6, firstDate ); 651 emit showDateView( 6, firstDate );
653 else if (num >= 0 ) { 652 else if (num >= 0 ) {
654 if ( mSelectedDates.count() == 1) 653 if ( mSelectedDates.count() == 1)
655 emit showDateView( 9, firstDate.addDays( num ) ); 654 emit showDateView( 9, firstDate.addDays( num ) );
656 else 655 else
657 emit showDateView( 3, firstDate.addDays( num ) ); 656 emit showDateView( 3, firstDate.addDays( num ) );
658 } 657 }
659 else 658 else
660 showDateView( 10, firstDate.addDays(1) ); 659 showDateView( 10, firstDate.addDays(1) );
661} 660}
662 661
663KOAgendaButton* KOAgendaView::getNewDaylabel() 662KOAgendaButton* KOAgendaView::getNewDaylabel()
664{ 663{
665 664
666 KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels); 665 KOAgendaButton * dayLabel = new KOAgendaButton(mDayLabels);
667 connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) ); 666 connect( dayLabel, SIGNAL( numClicked(int) ), this, SLOT ( slotDaylabelClicked(int) ) );
668 mDayLabelsList.append( dayLabel ); 667 mDayLabelsList.append( dayLabel );
669 mLayoutDayLabels->addWidget(dayLabel); 668 mLayoutDayLabels->addWidget(dayLabel);
670 return dayLabel ; 669 return dayLabel ;
671} 670}
672 671
673void KOAgendaView::createDayLabels() 672void KOAgendaView::createDayLabels()
674{ 673{
675 674
676 if ( mBlockUpdating || globalFlagBlockLabel == 1) { 675 if ( mBlockUpdating || globalFlagBlockLabel == 1) {
677 // qDebug(" KOAgendaView::createDayLabels() blocked "); 676 // qDebug(" KOAgendaView::createDayLabels() blocked ");
678 return; 677 return;
679 678
680 } 679 }
681 int newHight; 680 int newHight;
682 681
683 // ### Before deleting and recreating we could check if mSelectedDates changed... 682 // ### Before deleting and recreating we could check if mSelectedDates changed...
684 // It would remove some flickering and gain speed (since this is called by 683 // It would remove some flickering and gain speed (since this is called by
685 // each updateView() call) 684 // each updateView() call)
686 685
687 int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2; 686 int maxWid = mUpcomingWidth - mTimeLabels->width()- mAgenda->verticalScrollBar()->width() - 2;
688 mDayLabelsFrame->setMaximumWidth( mUpcomingWidth ); 687 mDayLabelsFrame->setMaximumWidth( mUpcomingWidth );
689 if ( maxWid < 0 ) 688 if ( maxWid < 0 )
690 maxWid = 20; 689 maxWid = 20;
691 690
692 QFont dlf = KOPrefs::instance()->mTimeLabelsFont; 691 QFont dlf = KOPrefs::instance()->mTimeLabelsFont;
693 QFontMetrics fm ( dlf ); 692 QFontMetrics fm ( dlf );
694 int selCount = mSelectedDates.count(); 693 int selCount = mSelectedDates.count();
695 QString dayTest = "Mon 20"; 694 QString dayTest = "Mon 20";
696 //QString dayTest = "Mon 20"; 695 //QString dayTest = "Mon 20";
697 int wid = fm.width( dayTest ); 696 int wid = fm.width( dayTest );
698 //maxWid -= ( selCount * 3 ); //working for QLabels 697 //maxWid -= ( selCount * 3 ); //working for QLabels
699 maxWid -= ( selCount * 3 ); //working for QPushButton 698 maxWid -= ( selCount * 3 ); //working for QPushButton
700 if ( maxWid < 0 ) 699 if ( maxWid < 0 )
701 maxWid = 20; 700 maxWid = 20;
702 int needWid = wid * selCount; 701 int needWid = wid * selCount;
703 //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid ); 702 //qDebug("++++++++Needed : %d MaxWidth: %d", needWid, maxWid );
704 //if ( needWid > maxWid ) 703 //if ( needWid > maxWid )
705 // qDebug("DAYLABELS TOOOOOOO BIG "); 704 // qDebug("DAYLABELS TOOOOOOO BIG ");
706 while ( needWid > maxWid ) { 705 while ( needWid > maxWid ) {
707 dayTest = dayTest.left( dayTest.length() - 1 ); 706 dayTest = dayTest.left( dayTest.length() - 1 );
708 wid = fm.width( dayTest ); 707 wid = fm.width( dayTest );
709 needWid = wid * selCount; 708 needWid = wid * selCount;
710 } 709 }
711 int maxLen = dayTest.length(); 710 int maxLen = dayTest.length();
712 int fontPoint = dlf.pointSize(); 711 int fontPoint = dlf.pointSize();
713 if ( maxLen < 2 ) { 712 if ( maxLen < 2 ) {
714 int fontPoint = dlf.pointSize(); 713 int fontPoint = dlf.pointSize();
715 while ( fontPoint > 4 ) { 714 while ( fontPoint > 4 ) {
716 --fontPoint; 715 --fontPoint;
717 dlf.setPointSize( fontPoint ); 716 dlf.setPointSize( fontPoint );
718 QFontMetrics f( dlf ); 717 QFontMetrics f( dlf );
719 wid = f.width( "30" ); 718 wid = f.width( "30" );
720 needWid = wid * selCount; 719 needWid = wid * selCount;
721 if ( needWid < maxWid ) 720 if ( needWid < maxWid )
722 break; 721 break;
723 } 722 }
724 maxLen = 2; 723 maxLen = 2;
725 } 724 }
726 //qDebug("Max len %d ", dayTest.length() ); 725 //qDebug("Max len %d ", dayTest.length() );
727 726
728 QFontMetrics tempF( dlf ); 727 QFontMetrics tempF( dlf );
729 newHight = tempF.height(); 728 newHight = tempF.height();
730 mDayLabels->setFont( dlf ); 729 mDayLabels->setFont( dlf );
731 // mLayoutDayLabels = new QHBoxLayout(mDayLabels);; 730 // mLayoutDayLabels = new QHBoxLayout(mDayLabels);;
732 // mLayoutDayLabels->addSpacing(mTimeLabels->width()); 731 // mLayoutDayLabels->addSpacing(mTimeLabels->width());
733 //mLayoutDayLabels->addSpacing( 2 ); 732 //mLayoutDayLabels->addSpacing( 2 );
734 // QFont lFont = dlf; 733 // QFont lFont = dlf;
735 bool appendLabels = false; 734 bool appendLabels = false;
736 KOAgendaButton *dayLabel; 735 KOAgendaButton *dayLabel;
737 dayLabel = mDayLabelsList.first(); 736 dayLabel = mDayLabelsList.first();
738 if ( !dayLabel ) { 737 if ( !dayLabel ) {
739 appendLabels = true; 738 appendLabels = true;
740 dayLabel = getNewDaylabel(); 739 dayLabel = getNewDaylabel();
741 } 740 }
742 dayLabel->setFixedWidth( mTimeLabels->width()+2 ); 741 dayLabel->setFixedWidth( mTimeLabels->width()+2 );
743 dayLabel->setFont( dlf ); 742 dayLabel->setFont( dlf );
744 dayLabel->setNum( -1 ); 743 dayLabel->setNum( -1 );
745 //dayLabel->setAlignment(QLabel::AlignHCenter); 744 //dayLabel->setAlignment(QLabel::AlignHCenter);
746 dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); 745 dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) );
747 dayLabel->show(); 746 dayLabel->show();
748 DateList::ConstIterator dit; 747 DateList::ConstIterator dit;
749 bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); 748 bool oneday = (mSelectedDates.first() == mSelectedDates.last() );
750 int counter = -1; 749 int counter = -1;
751 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { 750 for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) {
752 ++counter; 751 ++counter;
753 QDate date = *dit; 752 QDate date = *dit;
754 // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); 753 // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels);
755 if ( ! appendLabels ) { 754 if ( ! appendLabels ) {
756 dayLabel = mDayLabelsList.next(); 755 dayLabel = mDayLabelsList.next();
757 if ( !dayLabel ) 756 if ( !dayLabel )
758 appendLabels = true; 757 appendLabels = true;
759 } 758 }
760 if ( appendLabels ) { 759 if ( appendLabels ) {
761 dayLabel = getNewDaylabel(); 760 dayLabel = getNewDaylabel();
762 } 761 }
763 dayLabel->setMinimumWidth( 1 ); 762 dayLabel->setMinimumWidth( 1 );
764 dayLabel->setMaximumWidth( 1024 ); 763 dayLabel->setMaximumWidth( 1024 );
765 dayLabel->setFont( dlf ); 764 dayLabel->setFont( dlf );
766 dayLabel->show(); 765 dayLabel->show();
767 dayLabel->setNum( counter ); 766 dayLabel->setNum( counter );
768 QString str; 767 QString str;
769 int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); 768 int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date);
770 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true ); 769 QString dayName = KOGlobals::self()->calendarSystem()->weekDayName( dW, true );
771 switch ( maxLen ) { 770 switch ( maxLen ) {
772 case 2: 771 case 2:
773 str = QString::number( date.day() ); 772 str = QString::number( date.day() );
774 break; 773 break;
775 774
776 case 3: 775 case 3:
777 str = dayName.left( 1 ) +QString::number( date.day()); 776 str = dayName.left( 1 ) +QString::number( date.day());
778 777
779 break; 778 break;
780 case 4: 779 case 4:
781 str = dayName.left( 1 ) + " " +QString::number( date.day()); 780 str = dayName.left( 1 ) + " " +QString::number( date.day());
782 781
783 break; 782 break;
784 case 5: 783 case 5:
785 str = dayName.left( 2 ) + " " +QString::number( date.day()); 784 str = dayName.left( 2 ) + " " +QString::number( date.day());
786 785