summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-02-04 17:51:45 (UTC)
committer zautrix <zautrix>2005-02-04 17:51:45 (UTC)
commit4659ee80518c7d5108c21ba04a12a25eab783113 (patch) (unidiff)
tree50a9b0e55ca68c58d6159b7617db0b2d19d9338a
parentf4c3a3e3da57e957b920fe4662c6decd6764f0ee (diff)
downloadkdepimpi-4659ee80518c7d5108c21ba04a12a25eab783113.zip
kdepimpi-4659ee80518c7d5108c21ba04a12a25eab783113.tar.gz
kdepimpi-4659ee80518c7d5108c21ba04a12a25eab783113.tar.bz2
nochn fix
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index 1908b1c..36c66ea 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -334,195 +334,196 @@ void EventIndicator::changeColumns(int columns)
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);
431 mDummyAllDayRightL = new QLabel ( dummyAllDayRight ); 430 mDummyAllDayRightL = new QLabel ( dummyAllDayRight );
432 431 QPushButton *dummyAllDayRightB = new QPushButton(dummyAllDayRight);
432 new QLabel ( dummyAllDayRight );
433 mDummyAllDayRightL->setSizePolicy( QSizePolicy( QSizePolicy::Minimum,QSizePolicy::Fixed ) );
433 dummyAllDayRightB->setFlat( true ); 434 dummyAllDayRightB->setFlat( true );
434 dummyAllDayRightB->setFocusPolicy(NoFocus); 435 dummyAllDayRightB->setFocusPolicy(NoFocus);
435 dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 ); 436 dummyAllDayRightB->setFixedHeight( (dummyAllDayRightB->sizeHint().height()/4)*3 );
436 437
437 QPopupMenu * wpo = new QPopupMenu (this); 438 QPopupMenu * wpo = new QPopupMenu (this);
438 QPopupMenu * all = new QPopupMenu (this); 439 QPopupMenu * all = new QPopupMenu (this);
439 //wpo->insertItem( i18n("W#"), 0 ); 440 //wpo->insertItem( i18n("W#"), 0 );
440 int first = 1; 441 int first = 1;
441 int i; 442 int i;
442 for ( i = 1; i < 50; ++i ) { 443 for ( i = 1; i < 50; ++i ) {
443 if ( !(i%10) ) { 444 if ( !(i%10) ) {
444 all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); 445 all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo );
445 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); 446 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
446 first = i; 447 first = i;
447 wpo = new QPopupMenu (this); 448 wpo = new QPopupMenu (this);
448 } 449 }
449 wpo->insertItem( QString::number(i), i ); 450 wpo->insertItem( QString::number(i), i );
450 } 451 }
451 for ( i = 50; i < 53; ++i ) { 452 for ( i = 50; i < 53; ++i ) {
452 wpo->insertItem( QString::number(i), i); 453 wpo->insertItem( QString::number(i), i);
453 } 454 }
454 all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo ); 455 all->insertItem( i18n("Select week %1-%2" ).arg(first).arg( i-1) ,wpo );
455 dummyAllDayRightB->setPopup( all ); 456 dummyAllDayRightB->setPopup( all );
456 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) ); 457 connect( wpo, SIGNAL( activated(int) ), SIGNAL( selectWeekNum ( int ) ) );
457 458
458 // Create event context menu for all day agenda 459 // Create event context menu for all day agenda
459 mAllDayAgendaPopup = eventPopup(); 460 mAllDayAgendaPopup = eventPopup();
460 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 461 connect(mAllDayAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
461 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 462 mAllDayAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
462 463
463 // Create agenda frame 464 // Create agenda frame
464 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3); 465 QGridLayout *agendaLayout = new QGridLayout(agendaFrame,3,3);
465 // QHBox *agendaFrame = new QHBox(splitterAgenda); 466 // QHBox *agendaFrame = new QHBox(splitterAgenda);
466 467
467 // create event indicator bars 468 // create event indicator bars
468 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame); 469 mEventIndicatorTop = new EventIndicator(EventIndicator::Top,agendaFrame);
469 agendaLayout->addWidget(mEventIndicatorTop,0,1); 470 agendaLayout->addWidget(mEventIndicatorTop,0,1);
470 mEventIndicatorTop->setPaintWidget( mSplitterAgenda ); 471 mEventIndicatorTop->setPaintWidget( mSplitterAgenda );
471 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom, 472 mEventIndicatorBottom = new EventIndicator(EventIndicator::Bottom,
472 agendaFrame); 473 agendaFrame);
473 agendaLayout->addWidget(mEventIndicatorBottom,2,1); 474 agendaLayout->addWidget(mEventIndicatorBottom,2,1);
474 QWidget *dummyAgendaRight = new QWidget(agendaFrame); 475 QWidget *dummyAgendaRight = new QWidget(agendaFrame);
475 agendaLayout->addWidget(dummyAgendaRight,0,2); 476 agendaLayout->addWidget(dummyAgendaRight,0,2);
476 477
477 // Create time labels 478 // Create time labels
478 mTimeLabels = new TimeLabels(24,agendaFrame); 479 mTimeLabels = new TimeLabels(24,agendaFrame);
479 agendaLayout->addWidget(mTimeLabels,1,0); 480 agendaLayout->addWidget(mTimeLabels,1,0);
480 connect(mTimeLabels,SIGNAL( scaleChanged()), 481 connect(mTimeLabels,SIGNAL( scaleChanged()),
481 this,SLOT(updateConfig())); 482 this,SLOT(updateConfig()));
482 483
483 // Create agenda 484 // Create agenda
484 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame); 485 mAgenda = new KOAgenda(1,96,KOPrefs::instance()->mHourSize,agendaFrame);
485 agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2); 486 agendaLayout->addMultiCellWidget(mAgenda,1,1,1,2);
486 agendaLayout->setColStretch(1,1); 487 agendaLayout->setColStretch(1,1);
487 mAgenda->setFocusPolicy(NoFocus); 488 mAgenda->setFocusPolicy(NoFocus);
488 // Create event context menu for agenda 489 // Create event context menu for agenda
489 mAgendaPopup = eventPopup(); 490 mAgendaPopup = eventPopup();
490 491
491 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")), 492 mAgendaPopup->addAdditionalItem(QIconSet(SmallIcon("bell")),
492 i18n("Toggle Alarm"),mAgenda, 493 i18n("Toggle Alarm"),mAgenda,
493 SLOT(popupAlarm()),true); 494 SLOT(popupAlarm()),true);
494 495
495 496
496 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 497 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
497 mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 498 mAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
498 499
499 // make connections between dependent widgets 500 // make connections between dependent widgets
500 mTimeLabels->setAgenda(mAgenda); 501 mTimeLabels->setAgenda(mAgenda);
501 502
502 // Update widgets to reflect user preferences 503 // Update widgets to reflect user preferences
503 // updateConfig(); 504 // updateConfig();
504 505
505 // createDayLabels(); 506 // createDayLabels();
506 507
507 // these blank widgets make the All Day Event box line up with the agenda 508 // these blank widgets make the All Day Event box line up with the agenda
508 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 509 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
509 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 510 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
510 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 511 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
511 512
512 // Scrolling 513 // Scrolling
513 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), 514 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
514 mTimeLabels, SLOT(positionChanged())); 515 mTimeLabels, SLOT(positionChanged()));
515 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), 516 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
516 SLOT(setContentsPos(int))); 517 SLOT(setContentsPos(int)));
517 518
518 connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 519 connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
519 connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 520 connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate )));
520 521
521 // Create/Show/Edit/Delete Event 522 // Create/Show/Edit/Delete Event
522 connect(mAgenda,SIGNAL(newEventSignal(int,int)), 523 connect(mAgenda,SIGNAL(newEventSignal(int,int)),
523 SLOT(newEvent(int,int))); 524 SLOT(newEvent(int,int)));
524 connect(mAgenda,SIGNAL(newTodoSignal(int,int)), 525 connect(mAgenda,SIGNAL(newTodoSignal(int,int)),
525 SLOT(newTodo(int,int))); 526 SLOT(newTodo(int,int)));
526 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), 527 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)),
527 SLOT(newEvent(int,int,int,int))); 528 SLOT(newEvent(int,int,int,int)));
528 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), 529 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)),