summaryrefslogtreecommitdiffabout
path: root/korganizer/koagendaview.cpp
Unidiff
Diffstat (limited to 'korganizer/koagendaview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index f54f7bc..60ae41f 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -467,52 +467,56 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
467 mAgendaPopup,SLOT(showIncidencePopup(Incidence *))); 467 mAgendaPopup,SLOT(showIncidencePopup(Incidence *)));
468 468
469 // make connections between dependent widgets 469 // make connections between dependent widgets
470 mTimeLabels->setAgenda(mAgenda); 470 mTimeLabels->setAgenda(mAgenda);
471 471
472 // Update widgets to reflect user preferences 472 // Update widgets to reflect user preferences
473 // updateConfig(); 473 // updateConfig();
474 474
475 // createDayLabels(); 475 // createDayLabels();
476 476
477 // these blank widgets make the All Day Event box line up with the agenda 477 // these blank widgets make the All Day Event box line up with the agenda
478 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 478 dummyAllDayRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
479 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width()); 479 dummyAgendaRight->setFixedWidth(mAgenda->verticalScrollBar()->width());
480 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width()); 480 mDummyAllDayLeft->setFixedWidth(mTimeLabels->width());
481 481
482 // Scrolling 482 // Scrolling
483 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)), 483 connect(mAgenda->verticalScrollBar(),SIGNAL(valueChanged(int)),
484 mTimeLabels, SLOT(positionChanged())); 484 mTimeLabels, SLOT(positionChanged()));
485 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)), 485 connect(mTimeLabels->verticalScrollBar(),SIGNAL(valueChanged(int)),
486 SLOT(setContentsPos(int))); 486 SLOT(setContentsPos(int)));
487 487
488 // Create/Show/Edit/Delete Event 488 // Create/Show/Edit/Delete Event
489 connect(mAgenda,SIGNAL(newEventSignal(int,int)), 489 connect(mAgenda,SIGNAL(newEventSignal(int,int)),
490 SLOT(newEvent(int,int))); 490 SLOT(newEvent(int,int)));
491 connect(mAgenda,SIGNAL(newTodoSignal(int,int)),
492 SLOT(newTodo(int,int)));
491 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)), 493 connect(mAgenda,SIGNAL(newEventSignal(int,int,int,int)),
492 SLOT(newEvent(int,int,int,int))); 494 SLOT(newEvent(int,int,int,int)));
493 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)), 495 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int)),
494 SLOT(newEventAllDay(int,int))); 496 SLOT(newEventAllDay(int,int)));
497 connect(mAllDayAgenda,SIGNAL(newTodoSignal(int,int)),
498 SLOT(newTodoAllDay(int,int)));
495 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)), 499 connect(mAllDayAgenda,SIGNAL(newEventSignal(int,int,int,int)),
496 SLOT(newEventAllDay(int,int))); 500 SLOT(newEventAllDay(int,int)));
497 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 501 connect(mAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
498 SLOT(newTimeSpanSelected(int,int,int,int))); 502 SLOT(newTimeSpanSelected(int,int,int,int)));
499 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)), 503 connect(mAllDayAgenda,SIGNAL(newTimeSpanSignal(int,int,int,int)),
500 SLOT(newTimeSpanSelectedAllDay(int,int,int,int))); 504 SLOT(newTimeSpanSelectedAllDay(int,int,int,int)));
501 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 505 connect(mAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
502 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView())); 506 connect(mAllDayAgenda,SIGNAL(newStartSelectSignal()),SLOT(updateView()));
503 507
504 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 508 connect(mAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
505 SIGNAL(editIncidenceSignal(Incidence *))); 509 SIGNAL(editIncidenceSignal(Incidence *)));
506 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)), 510 connect(mAllDayAgenda,SIGNAL(editIncidenceSignal(Incidence *)),
507 SIGNAL(editIncidenceSignal(Incidence *))); 511 SIGNAL(editIncidenceSignal(Incidence *)));
508 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 512 connect(mAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
509 SIGNAL(showIncidenceSignal(Incidence *))); 513 SIGNAL(showIncidenceSignal(Incidence *)));
510 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)), 514 connect(mAllDayAgenda,SIGNAL(showIncidenceSignal(Incidence *)),
511 SIGNAL(showIncidenceSignal(Incidence *))); 515 SIGNAL(showIncidenceSignal(Incidence *)));
512 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 516 connect(mAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
513 SIGNAL(deleteIncidenceSignal(Incidence *))); 517 SIGNAL(deleteIncidenceSignal(Incidence *)));
514 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)), 518 connect(mAllDayAgenda,SIGNAL(deleteIncidenceSignal(Incidence *)),
515 SIGNAL(deleteIncidenceSignal(Incidence *))); 519 SIGNAL(deleteIncidenceSignal(Incidence *)));
516 520
517 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )), 521 connect(mAgenda,SIGNAL(itemModified(KOAgendaItem *, int )),
518 SLOT(updateEventDates(KOAgendaItem *, int ))); 522 SLOT(updateEventDates(KOAgendaItem *, int )));
@@ -1262,48 +1266,63 @@ void KOAgendaView::newEvent(int gx, int gy)
1262void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd) 1266void KOAgendaView::newEvent(int gxStart, int gyStart, int gxEnd, int gyEnd)
1263{ 1267{
1264 if (!mSelectedDates.count()) return; 1268 if (!mSelectedDates.count()) return;
1265 1269
1266 QDate dayStart = mSelectedDates[gxStart]; 1270 QDate dayStart = mSelectedDates[gxStart];
1267 QDate dayEnd = mSelectedDates[gxEnd]; 1271 QDate dayEnd = mSelectedDates[gxEnd];
1268 1272
1269 QTime timeStart = mAgenda->gyToTime(gyStart); 1273 QTime timeStart = mAgenda->gyToTime(gyStart);
1270 QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 ); 1274 QTime timeEnd = mAgenda->gyToTime( gyEnd + 1 );
1271 1275
1272 QDateTime dtStart(dayStart,timeStart); 1276 QDateTime dtStart(dayStart,timeStart);
1273 QDateTime dtEnd(dayEnd,timeEnd); 1277 QDateTime dtEnd(dayEnd,timeEnd);
1274 1278
1275 emit newEventSignal(dtStart,dtEnd); 1279 emit newEventSignal(dtStart,dtEnd);
1276} 1280}
1277 1281
1278void KOAgendaView::newEventAllDay(int gx, int ) 1282void KOAgendaView::newEventAllDay(int gx, int )
1279{ 1283{
1280 if (!mSelectedDates.count()) return; 1284 if (!mSelectedDates.count()) return;
1281 1285
1282 QDate day = mSelectedDates[gx]; 1286 QDate day = mSelectedDates[gx];
1283 1287
1284 emit newEventSignal(day); 1288 emit newEventSignal(day);
1285} 1289}
1290void KOAgendaView::newTodoAllDay(int gx, int )
1291{
1292 if (!mSelectedDates.count()) return;
1293
1294 QDateTime day (mSelectedDates[gx] );
1295 emit newTodoSignal(day, true);
1296}
1297void KOAgendaView::newTodo(int gx, int gy )
1298{
1299 if (!mSelectedDates.count()) return;
1300 QDate dayStart = mSelectedDates[gx];
1301 QTime timeStart = mAgenda->gyToTime(gy);
1302 QDateTime dt (dayStart,timeStart);
1303 emit newTodoSignal( dt, false );
1304}
1286 1305
1287void KOAgendaView::updateEventIndicatorTop(int newY) 1306void KOAgendaView::updateEventIndicatorTop(int newY)
1288{ 1307{
1289 uint i; 1308 uint i;
1290 for(i=0;i<mMinY.size();++i) { 1309 for(i=0;i<mMinY.size();++i) {
1291 if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true); 1310 if (newY >= mMinY.at(i)) mEventIndicatorTop->enableColumn(i,true);
1292 else mEventIndicatorTop->enableColumn(i,false); 1311 else mEventIndicatorTop->enableColumn(i,false);
1293 } 1312 }
1294 1313
1295 mEventIndicatorTop->update(); 1314 mEventIndicatorTop->update();
1296} 1315}
1297 1316
1298void KOAgendaView::updateEventIndicatorBottom(int newY) 1317void KOAgendaView::updateEventIndicatorBottom(int newY)
1299{ 1318{
1300 uint i; 1319 uint i;
1301 for(i=0;i<mMaxY.size();++i) { 1320 for(i=0;i<mMaxY.size();++i) {
1302 if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true); 1321 if (newY <= mMaxY.at(i)) mEventIndicatorBottom->enableColumn(i,true);
1303 else mEventIndicatorBottom->enableColumn(i,false); 1322 else mEventIndicatorBottom->enableColumn(i,false);
1304 } 1323 }
1305 1324
1306 mEventIndicatorBottom->update(); 1325 mEventIndicatorBottom->update();
1307} 1326}
1308 1327
1309void KOAgendaView::startDrag(Event *event) 1328void KOAgendaView::startDrag(Event *event)