summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp30
-rw-r--r--korganizer/koagenda.h4
-rw-r--r--korganizer/koagendaitem.cpp5
-rw-r--r--korganizer/koagendaview.cpp31
-rw-r--r--korganizer/koagendaview.h5
5 files changed, 65 insertions, 10 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 0280c74..c339b57 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -55,16 +55,17 @@
55#endif 55#endif
56 56
57//extern bool globalFlagBlockPainting; 57//extern bool globalFlagBlockPainting;
58extern int globalFlagBlockAgenda; 58extern int globalFlagBlockAgenda;
59extern int globalFlagBlockAgendaItemPaint; 59extern int globalFlagBlockAgendaItemPaint;
60extern int globalFlagBlockAgendaItemUpdate; 60extern int globalFlagBlockAgendaItemUpdate;
61extern int globalFlagBlockStartup; 61extern int globalFlagBlockStartup;
62 62
63bool KOAgenda::mInvalidPixmap = false;
63//////////////////////////////////////////////////////////////////////////// 64////////////////////////////////////////////////////////////////////////////
64MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name) 65MarcusBains::MarcusBains(KOAgenda *_agenda,const char *name)
65 : QFrame(_agenda->viewport(),name), agenda(_agenda) 66 : QFrame(_agenda->viewport(),name), agenda(_agenda)
66{ 67{
67 setLineWidth(0); 68 setLineWidth(0);
68 setMargin(0); 69 setMargin(0);
69 setBackgroundColor(Qt::red); 70 setBackgroundColor(Qt::red);
70 minutes = new QTimer(this); 71 minutes = new QTimer(this);
@@ -173,16 +174,17 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
173 mRows = rows; 174 mRows = rows;
174 mGridSpacingY = rowSize; 175 mGridSpacingY = rowSize;
175 mAllDayMode = false; 176 mAllDayMode = false;
176#ifndef DESKTOP_VERSION 177#ifndef DESKTOP_VERSION
177 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 178 //QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
178#endif 179#endif
179 mHolidayMask = 0; 180 mHolidayMask = 0;
180 init(); 181 init();
182 connect ( this, SIGNAL (contentsMoving ( int , int ) ), this, SLOT ( slotContentMove(int,int)) );
181} 183}
182 184
183/* 185/*
184 Create an agenda widget with columns columns and one row. This is used for 186 Create an agenda widget with columns columns and one row. This is used for
185 all-day events. 187 all-day events.
186*/ 188*/
187KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : 189KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) :
188 QScrollView(parent,name,f) 190 QScrollView(parent,name,f)
@@ -312,18 +314,34 @@ void KOAgenda::init()
312 if(mAllDayMode) 314 if(mAllDayMode)
313 mMarcusBains = 0; 315 mMarcusBains = 0;
314 else { 316 else {
315 mMarcusBains = new MarcusBains(this); 317 mMarcusBains = new MarcusBains(this);
316 addChild(mMarcusBains); 318 addChild(mMarcusBains);
317 } 319 }
318 mPopupKind = 0; 320 mPopupKind = 0;
319 mPopupItem = 0; 321 mPopupItem = 0;
322 mInvalidPixmap = false;
323
320} 324}
321 325
326void KOAgenda::shrinkPixmap()
327{
328 mPaintPixmap.resize( 20,20);
329 mInvalidPixmap = true;
330}
331void KOAgenda::slotContentMove(int,int)
332{
333 if ( mActionType == NOP )
334 slotClearSelection();
335 if ( mSelectedItem && !mActionItem ) {
336 deselectItem();
337 emit incidenceSelected( 0 );
338 }
339}
322void KOAgenda::clear() 340void KOAgenda::clear()
323{ 341{
324 KOAgendaItem *item; 342 KOAgendaItem *item;
325 for ( item=mItems.first(); item != 0; item=mItems.next() ) { 343 for ( item=mItems.first(); item != 0; item=mItems.next() ) {
326 mUnusedItems.append( item ); 344 mUnusedItems.append( item );
327 //item->hide(); 345 //item->hide();
328 } 346 }
329 mItems.clear(); 347 mItems.clear();
@@ -917,16 +935,17 @@ void KOAgenda::performItemAction(QPoint viewportPos)
917 int dy; 935 int dy;
918 if (isMultiItem) dy = 0; 936 if (isMultiItem) dy = 0;
919 else dy = gy - mCurrentCellY; 937 else dy = gy - mCurrentCellY;
920 moveItem->moveRelative(gx - mCurrentCellX,dy); 938 moveItem->moveRelative(gx - mCurrentCellX,dy);
921 int x,y; 939 int x,y;
922 gridToContents(moveItem->cellX(),moveItem->cellYTop(),x,y); 940 gridToContents(moveItem->cellX(),moveItem->cellYTop(),x,y);
923 moveItem->resize(mGridSpacingX * moveItem->cellWidth(), 941 moveItem->resize(mGridSpacingX * moveItem->cellWidth(),
924 mGridSpacingY * moveItem->cellHeight()); 942 mGridSpacingY * moveItem->cellHeight());
943 moveItem->raise();
925 moveChild(moveItem,x,y); 944 moveChild(moveItem,x,y);
926 moveItem = moveItem->nextMultiItem(); 945 moveItem = moveItem->nextMultiItem();
927 } 946 }
928 } else if (mActionType == RESIZETOP) { 947 } else if (mActionType == RESIZETOP) {
929 if (mCurrentCellY <= mActionItem->cellYBottom()) { 948 if (mCurrentCellY <= mActionItem->cellYBottom()) {
930 mActionItem->expandTop(gy - mCurrentCellY); 949 mActionItem->expandTop(gy - mCurrentCellY);
931 mActionItem->resize(mActionItem->width(), 950 mActionItem->resize(mActionItem->width(),
932 mGridSpacingY * mActionItem->cellHeight()); 951 mGridSpacingY * mActionItem->cellHeight());
@@ -1239,16 +1258,23 @@ void KOAgenda::placeSubCells(KOAgendaItem *placeItem)
1239// } 1258// }
1240// placeItem->updateItem(); 1259// placeItem->updateItem();
1241} 1260}
1242 1261
1243void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch) 1262void KOAgenda::drawContents(QPainter* p, int cx, int cy, int cw, int ch)
1244{ 1263{
1245 if ( globalFlagBlockAgenda ) 1264 if ( globalFlagBlockAgenda )
1246 return; 1265 return;
1266
1267 if ( mInvalidPixmap ) {
1268 mInvalidPixmap = false;
1269 qDebug("InvalidPixmap ");
1270 QTimer::singleShot( 0, this, SIGNAL( updateViewSignal() ));
1271 return;
1272 }
1247 if ( ! mAllDayMode ) { 1273 if ( ! mAllDayMode ) {
1248 // currently not working for 1274 // currently not working for
1249 1275
1250 //qDebug("KOAgenda::drawContents "); 1276 //qDebug("KOAgenda::drawContents ");
1251 if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() ) 1277 if ( mCurPixWid != contentsWidth() || mCurPixHei != contentsHeight() )
1252 ;//drawContentsToPainter(); 1278 ;//drawContentsToPainter();
1253 1279
1254 QPaintDevice* pd = p->device(); 1280 QPaintDevice* pd = p->device();
@@ -1911,23 +1937,23 @@ void KOAgenda::computeSizes()
1911 item->subCell() * subCellWidth,childY(item)); 1937 item->subCell() * subCellWidth,childY(item));
1912 } 1938 }
1913 } 1939 }
1914 int cw = contentsWidth(); 1940 int cw = contentsWidth();
1915 int ch = contentsHeight(); 1941 int ch = contentsHeight();
1916 if ( mAllDayMode ) { 1942 if ( mAllDayMode ) {
1917 QPixmap* paintPixAll = KOAgendaItem::paintPixAllday(); 1943 QPixmap* paintPixAll = KOAgendaItem::paintPixAllday();
1918 if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 ) { 1944 if ( (paintPixAll->width() < cw || paintPixAll->height() < ch) && cw > 0 && ch > 0 ) {
1919 //qDebug("paintPixAll->resize "); 1945 qDebug("paintPixAll->resize ");
1920 paintPixAll->resize( cw, ch ); 1946 paintPixAll->resize( cw, ch );
1921 } 1947 }
1922 } else { 1948 } else {
1923 QPixmap* paintPix = KOAgendaItem::paintPix(); 1949 QPixmap* paintPix = KOAgendaItem::paintPix();
1924 if ( paintPix->width() < cw || paintPix->height() < ch ) { 1950 if ( paintPix->width() < cw || paintPix->height() < ch ) {
1925 //qDebug("paintPix->resize "); 1951 qDebug("paintPix->resize ");
1926 paintPix->resize( cw , ch ); 1952 paintPix->resize( cw , ch );
1927 } 1953 }
1928 } 1954 }
1929 1955
1930 checkScrollBoundaries(); 1956 checkScrollBoundaries();
1931 marcus_bains(); 1957 marcus_bains();
1932 drawContentsToPainter(); 1958 drawContentsToPainter();
1933 viewport()->repaint(false); 1959 viewport()->repaint(false);
diff --git a/korganizer/koagenda.h b/korganizer/koagenda.h
index de6acac..5d813b2 100644
--- a/korganizer/koagenda.h
+++ b/korganizer/koagenda.h
@@ -70,16 +70,17 @@ class KOAgenda : public QScrollView
70 enum MouseActionType { NOP, MOVE, SELECT, 70 enum MouseActionType { NOP, MOVE, SELECT,
71 RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT }; 71 RESIZETOP, RESIZEBOTTOM, RESIZELEFT, RESIZERIGHT };
72 72
73 KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0, 73 KOAgenda ( int columns, int rows, int columnSize, QWidget * parent=0,
74 const char * name=0, WFlags f=0 ); 74 const char * name=0, WFlags f=0 );
75 KOAgenda ( int columns, QWidget * parent=0, 75 KOAgenda ( int columns, QWidget * parent=0,
76 const char * name=0, WFlags f=0 ); 76 const char * name=0, WFlags f=0 );
77 virtual ~KOAgenda(); 77 virtual ~KOAgenda();
78 static bool mInvalidPixmap;
78 79
79 Incidence *selectedIncidence() const; 80 Incidence *selectedIncidence() const;
80 QDate selectedIncidenceDate() const; 81 QDate selectedIncidenceDate() const;
81 82
82 virtual bool eventFilter ( QObject *, QEvent * ); 83 virtual bool eventFilter ( QObject *, QEvent * );
83 84
84 void contentsToGrid (int x, int y, int& gx, int& gy); 85 void contentsToGrid (int x, int y, int& gx, int& gy);
85 void gridToContents (int gx, int gy, int& x, int& y); 86 void gridToContents (int gx, int gy, int& x, int& y);
@@ -120,18 +121,20 @@ class KOAgenda : public QScrollView
120 void setDateList(const DateList &selectedDates); 121 void setDateList(const DateList &selectedDates);
121 DateList dateList() const; 122 DateList dateList() const;
122 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false); 123 void drawContentsToPainter( QPainter* paint = 0, bool backgroundOnly = false);
123 void finishUpdate(); 124 void finishUpdate();
124 void printSelection(); 125 void printSelection();
125 void storePosition(); 126 void storePosition();
126 void restorePosition(); 127 void restorePosition();
127 void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; } 128 void setPopup( KOEventPopupMenu * p ) { mAllAgendaPopup = p; }
129 void shrinkPixmap();
128 130
129 public slots: 131 public slots:
132 void slotContentMove(int,int);
130 void categoryChanged(Incidence * inc); 133 void categoryChanged(Incidence * inc);
131 void slotClearSelection(); 134 void slotClearSelection();
132 void popupMenu(); 135 void popupMenu();
133 void newItem( int ); 136 void newItem( int );
134 void moveChild( QWidget *, int, int ); 137 void moveChild( QWidget *, int, int );
135 void scrollUp(); 138 void scrollUp();
136 void scrollDown(); 139 void scrollDown();
137 void updateTodo( Todo * t, int , bool ); 140 void updateTodo( Todo * t, int , bool );
@@ -165,16 +168,17 @@ class KOAgenda : public QScrollView
165 void incidenceSelected(Incidence *); 168 void incidenceSelected(Incidence *);
166 169
167 void lowerYChanged(int); 170 void lowerYChanged(int);
168 void upperYChanged(int); 171 void upperYChanged(int);
169 172
170 void startDragSignal(Incidence *); 173 void startDragSignal(Incidence *);
171 void addToCalSignal(Incidence *, Incidence *); 174 void addToCalSignal(Incidence *, Incidence *);
172 void resizedSignal(); 175 void resizedSignal();
176 void updateViewSignal();
173 177
174 protected: 178 protected:
175 KOEventPopupMenu * mAllAgendaPopup; 179 KOEventPopupMenu * mAllAgendaPopup;
176 QPainter mPixPainter; 180 QPainter mPixPainter;
177 QPixmap mPaintPixmap; 181 QPixmap mPaintPixmap;
178 QPixmap mHighlightPixmap; 182 QPixmap mHighlightPixmap;
179 void drawContents(QPainter *p,int cx, int cy, int cw, int ch); 183 void drawContents(QPainter *p,int cx, int cy, int cw, int ch);
180 virtual void resizeEvent ( QResizeEvent * ); 184 virtual void resizeEvent ( QResizeEvent * );
diff --git a/korganizer/koagendaitem.cpp b/korganizer/koagendaitem.cpp
index 8675ff6..303a92a 100644
--- a/korganizer/koagendaitem.cpp
+++ b/korganizer/koagendaitem.cpp
@@ -491,28 +491,25 @@ QPixmap * KOAgendaItem::paintPixAllday()
491 } 491 }
492 return mPaintPixA ; 492 return mPaintPixA ;
493} 493}
494 494
495void KOAgendaItem::repaintItem() 495void KOAgendaItem::repaintItem()
496{ 496{
497 globalFlagBlockAgendaItemPaint = 0; 497 globalFlagBlockAgendaItemPaint = 0;
498 globalFlagBlockAgenda = 0; 498 globalFlagBlockAgenda = 0;
499 //qDebug("AAA ");
500 repaint( false ); 499 repaint( false );
501 //qDebug("BBB ");
502} 500}
503void KOAgendaItem::paintEvent ( QPaintEvent *e ) 501void KOAgendaItem::paintEvent ( QPaintEvent *e )
504{ 502{
505 qDebug("CCC "); 503
506 if ( globalFlagBlockAgendaItemPaint ) 504 if ( globalFlagBlockAgendaItemPaint )
507 return; 505 return;
508 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 ) 506 if ( globalFlagBlockAgenda > 0 && globalFlagBlockAgenda < 5 )
509 return; 507 return;
510 qDebug("DDD ");
511 int yy; 508 int yy;
512 if ( mAllDay ) 509 if ( mAllDay )
513 yy = y(); 510 yy = y();
514 else 511 else
515 yy = mCellYTop * ( height() / cellHeight() ); 512 yy = mCellYTop * ( height() / cellHeight() );
516 int xx = x(); 513 int xx = x();
517 514
518 if ( xPaintCoord != xx || yPaintCoord != yy || 515 if ( xPaintCoord != xx || yPaintCoord != yy ||
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index f811fba..488d9d4 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -71,17 +71,17 @@
71//extern bool globalFlagBlockPainting; 71//extern bool globalFlagBlockPainting;
72extern int globalFlagBlockAgenda; 72extern int globalFlagBlockAgenda;
73extern int globalFlagBlockStartup; 73extern int globalFlagBlockStartup;
74extern int globalFlagBlockAgendaItemPaint; 74extern int globalFlagBlockAgendaItemPaint;
75extern int globalFlagBlockAgendaItemUpdate; 75extern int globalFlagBlockAgendaItemUpdate;
76extern int globalFlagBlockLabel; 76extern int globalFlagBlockLabel;
77using namespace KOrg; 77using namespace KOrg;
78 78
79 79#define IDLETIMEOUT 3
80 80
81TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) : 81TimeLabels::TimeLabels(int rows,QWidget *parent,const char *name,WFlags f) :
82 QScrollView(parent,name,f) 82 QScrollView(parent,name,f)
83{ 83{
84 myPix.resize( 1, 1 ); 84 myPix.resize( 1, 1 );
85 mRows = rows; 85 mRows = rows;
86 86
87 mRedrawNeeded = true; 87 mRedrawNeeded = true;
@@ -568,19 +568,42 @@ KOAgendaView::KOAgendaView(Calendar *cal,QWidget *parent,const char *name) :
568 SLOT( addToCalSlot(Incidence *, Incidence * ) ) ); 568 SLOT( addToCalSlot(Incidence *, Incidence * ) ) );
569 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ), 569 connect( mAllDayAgenda, SIGNAL( addToCalSignal(Incidence * ,Incidence *) ),
570 SLOT( addToCalSlot(Incidence * , Incidence *) ) ); 570 SLOT( addToCalSlot(Incidence * , Incidence *) ) );
571 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 571 // connect( mAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
572 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) ); 572 //connect( mAllDayAgenda, SIGNAL( cloneIncidenceSignal(Incidence *) ), SIGNAL( cloneIncidenceSignal(Incidence *) ) );
573 573
574 connect( mAllDayAgenda, SIGNAL( signalClearSelection() ),mAgenda, SLOT( slotClearSelection()) ); 574 connect( mAllDayAgenda, SIGNAL( signalClearSelection() ),mAgenda, SLOT( slotClearSelection()) );
575 connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) ); 575 connect( mAgenda, SIGNAL( signalClearSelection() ),mAllDayAgenda, SLOT( slotClearSelection()) );
576 576 connect( mAllDayAgenda, SIGNAL( updateViewSignal() ),this, SLOT( fillAgenda()) );
577 connect( mAgenda, SIGNAL( updateViewSignal() ), this, SLOT( fillAgenda()) );
578
579 mIdleTimer = new QTimer ( this );;
580 connect(mIdleTimer,SIGNAL(timeout()),SLOT(slotIdleTimeout()));
581}
582void KOAgendaView::slotIdleTimeout()
583{
584 qDebug("SECS TO %d ",mIdleStart.secsTo( QDateTime::currentDateTime() ) );
585 int secsfromstart = mIdleStart.secsTo( QDateTime::currentDateTime() );
586 mIdleTimer->stop();
587 bool isActice = topLevelWidget()->isActiveWindow();
588 qDebug("KO: Active Window %d ", isActice);
589 // we do nothing if we wake up from a suspend
590 if ( secsfromstart > IDLETIMEOUT + 50 && isActice ) {
591 qDebug("KO: Wakeup from suspend ");
592 mIdleTimer->start( IDLETIMEOUT * 1000 );
593 return;
577} 594}
595 qDebug("KO: Downsizing Pixmaps ");
596 mAgenda->shrinkPixmap();
597 mAllDayAgenda->shrinkPixmap();
598 KOAgendaItem::paintPix()->resize( 20,20);
599 KOAgendaItem::paintPixAllday()->resize( 20,20);
578 600
601}
579void KOAgendaView::toggleAllDay() 602void KOAgendaView::toggleAllDay()
580{ 603{
581 if ( mSplitterAgenda->firstHandle() ) 604 if ( mSplitterAgenda->firstHandle() )
582 mSplitterAgenda->firstHandle()->toggle(); 605 mSplitterAgenda->firstHandle()->toggle();
583} 606}
584void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld ) 607void KOAgendaView::addToCalSlot(Incidence * inc, Incidence * incOld )
585{ 608{
586 calendar()->addIncidence( inc ); 609 calendar()->addIncidence( inc );
@@ -1293,16 +1316,18 @@ void KOAgendaView::fillAgenda()
1293 else if ( KOPrefs::instance()->mCenterOnCurrentTime ) 1316 else if ( KOPrefs::instance()->mCenterOnCurrentTime )
1294 setStartHour( QTime::currentTime ().hour() ); 1317 setStartHour( QTime::currentTime ().hour() );
1295 } 1318 }
1296 qApp->processEvents(); 1319 qApp->processEvents();
1297 globalFlagBlockAgenda = 0; 1320 globalFlagBlockAgenda = 0;
1298 mAllDayAgenda->drawContentsToPainter(); 1321 mAllDayAgenda->drawContentsToPainter();
1299 mAgenda->drawContentsToPainter(); 1322 mAgenda->drawContentsToPainter();
1300 repaintAgenda(); 1323 repaintAgenda();
1324 mIdleTimer->start ( IDLETIMEOUT *1000 );
1325 mIdleStart = QDateTime::currentDateTime();
1301 onlyOne = false; 1326 onlyOne = false;
1302} 1327}
1303void KOAgendaView::repaintAgenda() 1328void KOAgendaView::repaintAgenda()
1304{ 1329{
1305 mAgenda->viewport()->repaint( false ); 1330 mAgenda->viewport()->repaint( false );
1306 mAllDayAgenda->viewport()->repaint( false ); 1331 mAllDayAgenda->viewport()->repaint( false );
1307 mAgenda->finishUpdate(); 1332 mAgenda->finishUpdate();
1308 mAllDayAgenda->finishUpdate(); 1333 mAllDayAgenda->finishUpdate();
@@ -1336,17 +1361,17 @@ void KOAgendaView::printPreview(CalPrinter *calPrinter, const QDate &fd,
1336// { 1361// {
1337// // updateConfig(); 1362// // updateConfig();
1338// // emit updateTodoViews(); 1363// // emit updateTodoViews();
1339// } 1364// }
1340 1365
1341void KOAgendaView::slotShowDateView( int mode , int d ) 1366void KOAgendaView::slotShowDateView( int mode , int d )
1342{ 1367{
1343 if ( d >= mSelectedDates.count() ) { 1368 if ( d >= mSelectedDates.count() ) {
1344 qDebug("KOAgendaView::slotShowDateView datecounterror %d d ", d, mSelectedDates.count() ); 1369 qDebug("KOAgendaView::slotShowDateView datecounterror %d %d ", d, mSelectedDates.count() );
1345 1370
1346 } else { 1371 } else {
1347 QDate day = mSelectedDates[d]; 1372 QDate day = mSelectedDates[d];
1348 emit showDateView(mode , day ); 1373 emit showDateView(mode , day );
1349 } 1374 }
1350 1375
1351} 1376}
1352void KOAgendaView::newEvent(int gx, int gy) 1377void KOAgendaView::newEvent(int gx, int gy)
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index a1cf308..effd7a3 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -205,16 +205,17 @@ class KOAgendaView : public KOEventView {
205 void writeSettings(KConfig *); 205 void writeSettings(KConfig *);
206 206
207 void setContentsPos(int y); 207 void setContentsPos(int y);
208 208
209 void scrollOneHourUp(); 209 void scrollOneHourUp();
210 void scrollOneHourDown(); 210 void scrollOneHourDown();
211 void addToCalSlot(Incidence *, Incidence *); 211 void addToCalSlot(Incidence *, Incidence *);
212 void slotShowDateView( int, int ); 212 void slotShowDateView( int, int );
213 void fillAgenda();
213 214
214 signals: 215 signals:
215 void showDateView( int, QDate ); 216 void showDateView( int, QDate );
216 void newTodoSignal( QDateTime ,bool ); 217 void newTodoSignal( QDateTime ,bool );
217 void toggleExpand(); 218 void toggleExpand();
218 void selectWeekNum( int ); 219 void selectWeekNum( int );
219 void todoMoved( Todo *, int ); 220 void todoMoved( Todo *, int );
220 void incidenceChanged(Incidence * , int ); 221 void incidenceChanged(Incidence * , int );
@@ -223,42 +224,44 @@ class KOAgendaView : public KOEventView {
223 protected: 224 protected:
224 KOAgendaButton* getNewDaylabel(); 225 KOAgendaButton* getNewDaylabel();
225 bool mBlockUpdating; 226 bool mBlockUpdating;
226 int mUpcomingWidth; 227 int mUpcomingWidth;
227 /** Fill agenda beginning with date startDate */ 228 /** Fill agenda beginning with date startDate */
228 void fillAgenda(const QDate &startDate); 229 void fillAgenda(const QDate &startDate);
229 void resizeEvent( QResizeEvent* e ); 230 void resizeEvent( QResizeEvent* e );
230 /** Fill agenda using the current set value for the start date */ 231 /** Fill agenda using the current set value for the start date */
231 void fillAgenda();
232 232
233 /** Create labels for the selected dates. */ 233 /** Create labels for the selected dates. */
234 void createDayLabels(); 234 void createDayLabels();
235 235
236 /** 236 /**
237 Set the masks on the agenda widgets indicating, which days are holidays. 237 Set the masks on the agenda widgets indicating, which days are holidays.
238 */ 238 */
239 void setHolidayMasks(); 239 void setHolidayMasks();
240 240
241 protected slots: 241 protected slots:
242 void slotIdleTimeout();
242 void categoryChanged( Incidence * ); 243 void categoryChanged( Incidence * );
243 void slotDaylabelClicked( int ); 244 void slotDaylabelClicked( int );
244 /** Update event belonging to agenda item */ 245 /** Update event belonging to agenda item */
245 void updateEventDates(KOAgendaItem *item, int mode = -1); 246 void updateEventDates(KOAgendaItem *item, int mode = -1);
246 //void updateMovedTodo(); 247 //void updateMovedTodo();
247 248
248 void updateEventIndicatorTop(int newY); 249 void updateEventIndicatorTop(int newY);
249 void updateEventIndicatorBottom(int newY); 250 void updateEventIndicatorBottom(int newY);
250 251
251 /** Updates data for selected timespan */ 252 /** Updates data for selected timespan */
252 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd); 253 void newTimeSpanSelected(int gxStart, int gyStart, int gxEnd, int gyEnd);
253 /** Updates data for selected timespan for all day event*/ 254 /** Updates data for selected timespan for all day event*/
254 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd); 255 void newTimeSpanSelectedAllDay(int gxStart, int gyStart, int gxEnd, int gyEnd);
255 256
256 private: 257 private:
258 QTimer* mIdleTimer;
259 QDateTime mIdleStart;
257 // view widgets 260 // view widgets
258 QFrame *mDayLabels; 261 QFrame *mDayLabels;
259 QHBox *mDayLabelsFrame; 262 QHBox *mDayLabelsFrame;
260 QBoxLayout *mLayoutDayLabels; 263 QBoxLayout *mLayoutDayLabels;
261 QFrame *mAllDayFrame; 264 QFrame *mAllDayFrame;
262 KOAgenda *mAllDayAgenda; 265 KOAgenda *mAllDayAgenda;
263 KOAgenda *mAgenda; 266 KOAgenda *mAgenda;
264 TimeLabels *mTimeLabels; 267 TimeLabels *mTimeLabels;