summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Unidiff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagenda.cpp59
1 files changed, 32 insertions, 27 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 73ee5cb..0eeacb3 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -167,19 +167,9 @@ void MarcusBains::updateLocation(bool recalculate)
167KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent, 167KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
168 const char *name,WFlags f) : 168 const char *name,WFlags f) :
169 QScrollView(parent,name,f) 169 QScrollView(parent,name,f)
170{ 170{
171 mNewItemPopup = new QPopupMenu( this ); 171
172 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
173 QString pathString = "";
174 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
175 if ( QApplication::desktop()->width() < 480 )
176 pathString += "icons16/";
177 } else
178 pathString += "iconsmini/";
179
180 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
181 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
182 172
183 mColumns = columns; 173 mColumns = columns;
184 mRows = rows; 174 mRows = rows;
185 mGridSpacingY = rowSize; 175 mGridSpacingY = rowSize;
@@ -197,18 +187,8 @@ KOAgenda::KOAgenda(int columns,int rows,int rowSize,QWidget *parent,
197*/ 187*/
198KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) : 188KOAgenda::KOAgenda(int columns,QWidget *parent,const char *name,WFlags f) :
199 QScrollView(parent,name,f) 189 QScrollView(parent,name,f)
200{ 190{
201 mNewItemPopup = new QPopupMenu( this );
202 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
203 QString pathString = "";
204 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
205 if ( QApplication::desktop()->width() < 480 )
206 pathString += "icons16/";
207 } else
208 pathString += "iconsmini/";
209 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."),1 );
210 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
211 blockResize = false; 191 blockResize = false;
212 mColumns = columns; 192 mColumns = columns;
213 mRows = 1; 193 mRows = 1;
214 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize); 194 //qDebug("aaaaaaaaaaaaaaaaaaldays %d ", KOPrefs::instance()->mAllDaySize);
@@ -240,9 +220,27 @@ QDate KOAgenda::selectedIncidenceDate() const
240} 220}
241 221
242 222
243void KOAgenda::init() 223void KOAgenda::init()
244{ 224{
225 mNewItemPopup = new QPopupMenu( this );
226 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
227 QString pathString = "";
228 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
229 if ( QApplication::desktop()->width() < 480 )
230 pathString += "icons16/";
231 } else
232 pathString += "iconsmini/";
233
234 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
235 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
236 mNewItemPopup->insertSeparator ( );
237 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
238 mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
239 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 );
240 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
241 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next month"),6 );
242 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
245#ifndef _WIN32_ 243#ifndef _WIN32_
246 int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase 244 int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase
247 viewport()->setWFlags ( wflags); 245 viewport()->setWFlags ( wflags);
248#endif 246#endif
@@ -561,15 +559,22 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
561} 559}
562 560
563void KOAgenda::newItem( int item ) 561void KOAgenda::newItem( int item )
564{ 562{
565 qDebug("new %d ", item);
566 if ( item == 1 ) { //new event 563 if ( item == 1 ) { //new event
567 newEventSignal(mStartCellX ,mStartCellY ); 564 newEventSignal(mStartCellX ,mStartCellY );
568 } 565 } else
569 if ( item == 2 ) { //new event 566 if ( item == 2 ) { //new event
570 newTodoSignal(mStartCellX ,mStartCellY ); 567 newTodoSignal(mStartCellX ,mStartCellY );
571 } 568 } else
569 {
570 QDate day = mSelectedDates[mStartCellX];
571 emit showDateView( item, day );
572 // 3Day view
573 // 4Week view
574 // 5Month view
575 // 6Journal view
576 }
572} 577}
573void KOAgenda::startSelectAction(QPoint viewportPos) 578void KOAgenda::startSelectAction(QPoint viewportPos)
574{ 579{
575 //emit newStartSelectSignal(); 580 //emit newStartSelectSignal();