summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index b9909d6..2996acb 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -467,50 +467,50 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
467 467
468 468
469 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)), 469 connect(mAgenda,SIGNAL(showIncidencePopupSignal(Incidence *)),
470 mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 470 mAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
471 471
472 // make connections between dependent widgets 472 // make connections between dependent widgets
473 mTimeLabels->setAgenda(mAgenda); 473 mTimeLabels->setAgenda(mAgenda);
474 474
475 // Update widgets to reflect user preferences 475 // Update widgets to reflect user preferences
476 // updateConfig(); 476 // updateConfig();
477 477
478 // createDayLabels(); 478 // createDayLabels();
479 479
480 // these blank widgets make the All Day Event box line up with the agenda 480 // these blank widgets make the All Day Event box line up with the agenda
481 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 481 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
482 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 482 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
483 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 483 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
484 484
485 // Scrolling 485 // Scrolling
486 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), 486 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
487 mTimeLabels, SLOT(positionChanged())); 487 mTimeLabels, SLOT(positionChanged()));
488 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), 488 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
489 SLOT(setContentsPos(int))); 489 SLOT(setContentsPos(int)));
490 490
491 connect(mAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 491 connect(mAgenda,SIGNAL(showDateView( int, int)),SLOT(slotShowDateView( int, int )));
492 connect(mAllDayAgenda,SIGNAL(showDateView( int, QDate )),SIGNAL(showDateView( int, QDate ))); 492 connect(mAllDayAgenda,SIGNAL(showDateView( int, int )), SLOT(slotShowDateView( int, int ) ));
493 493
494 // Create/Show/Edit/Delete Event 494 // Create/Show/Edit/Delete Event
495 connect(mAgenda,SIGNAL(newEventSignal(int,int)), 495 connect(mAgenda,SIGNAL(newEventSignal(int,int)),
496 SLOT(newEvent(int,int))); 496 SLOT(newEvent(int,int)));
497 connect(mAgenda,SIGNAL(newTodoSignal(int,int)), 497 connect(mAgenda,SIGNAL(newTodoSignal(int,int)),
498 SLOT(newTodo(int,int))); 498 SLOT(newTodo(int,int)));
499 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), 499 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)),
500 SLOT(newEvent(int,int,int,int))); 500 SLOT(newEvent(int,int,int,int)));
501 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), 501 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)),
502 SLOT(newEventAllDay(int,int))); 502 SLOT(newEventAllDay(int,int)));
503 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)), 503 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)),
504 SLOT(newTodoAllDay(int,int))); 504 SLOT(newTodoAllDay(int,int)));
505 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), 505 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)),
506 SLOT(newEventAllDay(int,int))); 506 SLOT(newEventAllDay(int,int)));
507 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 507 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
508 SLOT(newTimeSpanSelected(int,int,int,int))); 508 SLOT(newTimeSpanSelected(int,int,int,int)));
509 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 509 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
510 SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); 510 SLOT(newTimeSpanSelectedAllDay(int,int,int,int)));
511 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 511 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
512 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 512 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
513 513
514 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 514 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
515 SIGNAL(editIncidenceSignal(Incidence *))); 515 SIGNAL(editIncidenceSignal(Incidence *)));
516 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 516 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
@@ -1289,48 +1289,59 @@ void KOAgendaView::repaintAgenda()
1289void KOAgendaView::clearView() 1289void KOAgendaView::clearView()
1290{ 1290{
1291 // kdDebug() << "ClearView" << endl; 1291 // kdDebug() << "ClearView" << endl;
1292 mAllDayAgenda->clear(); 1292 mAllDayAgenda->clear();
1293 mAgenda->clear(); 1293 mAgenda->clear();
1294} 1294}
1295 1295
1296void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd, 1296void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1297 const QDate &td) 1297 const QDate &td)
1298{ 1298{
1299#ifndef KORG_NOPRINTER 1299#ifndef KORG_NOPRINTER
1300 if (fd == td) 1300 if (fd == td)
1301 calPrinter->preview(CalPrinter::Day, fd, td); 1301 calPrinter->preview(CalPrinter::Day, fd, td);
1302 else 1302 else
1303 calPrinter->preview(CalPrinter::Week, fd, td); 1303 calPrinter->preview(CalPrinter::Week, fd, td);
1304#endif 1304#endif
1305} 1305}
1306 1306
1307// void KOAgendaView::updateMovedTodo() 1307// void KOAgendaView::updateMovedTodo()
1308// { 1308// {
1309// // updateConfig(); 1309// // updateConfig();
1310// // emit updateTodoViews(); 1310// // emit updateTodoViews();
1311// } 1311// }
1312 1312
1313void KOAgendaView::slotShowDateView( int mode , int d )
1314{
1315 if ( d >= mSelectedDates.count() ) {
1316 qDebug("KOAgendaView::slotShowDateView datecounterror %d d ", d, mSelectedDates.count() );
1317
1318 } else {
1319 QDate day = mSelectedDates[d];
1320 emit showDateView(mode , day );
1321 }
1322
1323}
1313void KOAgendaView::newEvent(int gx, int gy) 1324void KOAgendaView::newEvent(int gx, int gy)
1314{ 1325{
1315 if (!mSelectedDates.count()) return; 1326 if (!mSelectedDates.count()) return;
1316 1327
1317 QDate day = mSelectedDates[gx]; 1328 QDate day = mSelectedDates[gx];
1318 1329
1319 QTime time = mAgenda->gyToTime(gy); 1330 QTime time = mAgenda->gyToTime(gy);
1320 QDateTime dt(day,time); 1331 QDateTime dt(day,time);
1321 // if ( dt < QDateTime::currentDateTime () ) 1332 // if ( dt < QDateTime::currentDateTime () )
1322 // dt = QDateTime::currentDateTime ().addSecs( 3600 ); 1333 // dt = QDateTime::currentDateTime ().addSecs( 3600 );
1323 emit newEventSignal(dt); 1334 emit newEventSignal(dt);
1324} 1335}
1325 1336
1326void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) 1337void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd)
1327{ 1338{
1328 if (!mSelectedDates.count()) return; 1339 if (!mSelectedDates.count()) return;
1329 1340
1330 QDate dayStart = mSelectedDates[gxStart]; 1341 QDate dayStart = mSelectedDates[gxStart];
1331 QDate dayEnd = mSelectedDates[gxEnd]; 1342 QDate dayEnd = mSelectedDates[gxEnd];
1332 1343
1333 QTime timeStart = mAgenda->gyToTime(gyStart); 1344 QTime timeStart = mAgenda->gyToTime(gyStart);
1334 QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); 1345 QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 );
1335 1346
1336 QDateTime dtStart(dayStart,timeStart); 1347 QDateTime dtStart(dayStart,timeStart);