summaryrefslogtreecommitdiffabout
path: root/korganizer/koagenda.cpp
Unidiff
Diffstat (limited to 'korganizer/koagenda.cpp') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/koagenda.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/korganizer/koagenda.cpp b/korganizer/koagenda.cpp
index 1a24887..9720f43 100644
--- a/korganizer/koagenda.cpp
+++ b/korganizer/koagenda.cpp
@@ -219,49 +219,49 @@ QDate KOAgenda::selectedIncidenceDate() const
219} 219}
220 220
221 221
222void KOAgenda::init() 222void KOAgenda::init()
223{ 223{
224 mPopupTimer = new QTimer(this); 224 mPopupTimer = new QTimer(this);
225 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu())); 225 connect(mPopupTimer , SIGNAL(timeout()), this, SLOT(popupMenu()));
226 226
227 mNewItemPopup = new QPopupMenu( this ); 227 mNewItemPopup = new QPopupMenu( this );
228 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) ); 228 connect ( mNewItemPopup, SIGNAL (activated ( int ) ), this, SLOT ( newItem(int)) );
229 QString pathString = ""; 229 QString pathString = "";
230 if ( !KOPrefs::instance()->mToolBarMiniIcons ) { 230 if ( !KOPrefs::instance()->mToolBarMiniIcons ) {
231 if ( QApplication::desktop()->width() < 480 ) 231 if ( QApplication::desktop()->width() < 480 )
232 pathString += "icons16/"; 232 pathString += "icons16/";
233 } else 233 } else
234 pathString += "iconsmini/"; 234 pathString += "iconsmini/";
235 235
236 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 ); 236 mNewItemPopup->insertItem ( SmallIcon( pathString +"newevent" ), i18n("New Event..."), 1 );
237 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 ); 237 mNewItemPopup->insertItem ( SmallIcon( pathString +"newtodo" ), i18n("New Todo..."),2 );
238 mNewItemPopup->insertSeparator ( ); 238 mNewItemPopup->insertSeparator ( );
239 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); 239 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
240 mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 ); 240 mNewItemPopup->insertItem ( SmallIcon( pathString +"xdays" ), i18n("Next days"),8 );
241 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 ); 241 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next week"),4 );
242 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 ); 242 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next two weeks"),5 );
243 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next month"),6 ); 243 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("This month"),6 );
244 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); 244 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
245#ifndef _WIN32_ 245#ifndef _WIN32_
246 int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase 246 int wflags = viewport()-> getWFlags() |WRepaintNoErase;//WResizeNoErase
247 viewport()->setWFlags ( wflags); 247 viewport()->setWFlags ( wflags);
248#endif 248#endif
249 mGridSpacingX = 80; 249 mGridSpacingX = 80;
250 mResizeBorderWidth = 8; 250 mResizeBorderWidth = 8;
251 mScrollBorderWidth = 8; 251 mScrollBorderWidth = 8;
252 mScrollDelay = 30; 252 mScrollDelay = 30;
253 mScrollOffset = 10; 253 mScrollOffset = 10;
254 mPaintPixmap.resize( 20,20); 254 mPaintPixmap.resize( 20,20);
255 //enableClipper(true); 255 //enableClipper(true);
256 256
257 // Grab key strokes for keyboard navigation of agenda. Seems to have no 257 // Grab key strokes for keyboard navigation of agenda. Seems to have no
258 // effect. Has to be fixed. 258 // effect. Has to be fixed.
259 setFocusPolicy(WheelFocus); 259 setFocusPolicy(WheelFocus);
260 260
261 connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp())); 261 connect(&mScrollUpTimer,SIGNAL(timeout()),SLOT(scrollUp()));
262 connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown())); 262 connect(&mScrollDownTimer,SIGNAL(timeout()),SLOT(scrollDown()));
263 connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize())); 263 connect(&mResizeTimer,SIGNAL(timeout()),SLOT(finishResize()));
264 264
265 mStartCellX = 0; 265 mStartCellX = 0;
266 mStartCellY = 0; 266 mStartCellY = 0;
267 mCurrentCellX = 0; 267 mCurrentCellX = 0;
@@ -733,50 +733,49 @@ bool KOAgenda::eventFilter_mouse(QObject *object, QMouseEvent *me)
733 selectItem(doubleClickedItem); 733 selectItem(doubleClickedItem);
734 if ( KOPrefs::instance()->mEditOnDoubleClick ) 734 if ( KOPrefs::instance()->mEditOnDoubleClick )
735 emit editIncidenceSignal(doubleClickedItem->incidence()); 735 emit editIncidenceSignal(doubleClickedItem->incidence());
736 else 736 else
737 emit showIncidenceSignal(doubleClickedItem->incidence()); 737 emit showIncidenceSignal(doubleClickedItem->incidence());
738 } 738 }
739 break; 739 break;
740 740
741 default: 741 default:
742 break; 742 break;
743 } 743 }
744 return true; 744 return true;
745#endif 745#endif
746} 746}
747 747
748void KOAgenda::newItem( int item ) 748void KOAgenda::newItem( int item )
749{ 749{
750 if ( item == 1 ) { //new event 750 if ( item == 1 ) { //new event
751 newEventSignal(mStartCellX ,mStartCellY ); 751 newEventSignal(mStartCellX ,mStartCellY );
752 } else 752 } else
753 if ( item == 2 ) { //new event 753 if ( item == 2 ) { //new event
754 newTodoSignal(mStartCellX ,mStartCellY ); 754 newTodoSignal(mStartCellX ,mStartCellY );
755 } else 755 } else
756 { 756 {
757 QDate day = mSelectedDates[mStartCellX]; 757 emit showDateView( item, mStartCellX );
758 emit showDateView( item, day );
759 // 3Day view 758 // 3Day view
760 // 4Week view 759 // 4Week view
761 // 5Month view 760 // 5Month view
762 // 6Journal view 761 // 6Journal view
763 } 762 }
764} 763}
765void KOAgenda::startSelectAction(QPoint viewportPos) 764void KOAgenda::startSelectAction(QPoint viewportPos)
766{ 765{
767 //emit newStartSelectSignal(); 766 //emit newStartSelectSignal();
768 767
769 mActionType = SELECT; 768 mActionType = SELECT;
770 769
771 int x,y; 770 int x,y;
772 viewportToContents(viewportPos.x(),viewportPos.y(),x,y); 771 viewportToContents(viewportPos.x(),viewportPos.y(),x,y);
773 int gx,gy; 772 int gx,gy;
774 contentsToGrid(x,y,gx,gy); 773 contentsToGrid(x,y,gx,gy);
775 774
776 mStartCellX = gx; 775 mStartCellX = gx;
777 mStartCellY = gy; 776 mStartCellY = gy;
778 mCurrentCellX = gx; 777 mCurrentCellX = gx;
779 mCurrentCellY = gy; 778 mCurrentCellY = gy;
780 779
781 // Store coordinates of old selection 780 // Store coordinates of old selection
782 int selectionX = mSelectionCellX * mGridSpacingX; 781 int selectionX = mSelectionCellX * mGridSpacingX;