summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/koagendaview.cpp41
-rw-r--r--korganizer/koagendaview.h1
-rw-r--r--korganizer/kodaymatrix.cpp8
-rw-r--r--korganizer/koviewmanager.cpp41
4 files changed, 48 insertions, 43 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp
index aa36553..8c27c43 100644
--- a/korganizer/koagendaview.cpp
+++ b/korganizer/koagendaview.cpp
@@ -627,2 +627,17 @@ void KOAgendaView::slotDaylabelClicked()
627} 627}
628
629QPushButton* KOAgendaView::getNewDaylabel()
630{
631
632 QPushButton * dayLabel = new QPushButton(mDayLabels);
633 dayLabel->setFlat( true );
634 connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) );
635 dayLabel->setFocusPolicy(NoFocus);
636 dayLabel->setSizePolicy(QSizePolicy( QSizePolicy::Expanding ,QSizePolicy::Expanding ));
637 mDayLabelsList.append( dayLabel );
638 mLayoutDayLabels->addWidget(dayLabel);
639 //mLayoutDayLabels->setStretchFactor(dayLabel, 100);
640 return dayLabel ;
641}
642
628void KOAgendaView::createDayLabels() 643void KOAgendaView::createDayLabels()
@@ -651,3 +666,4 @@ void KOAgendaView::createDayLabels()
651 int wid = fm.width( dayTest ); 666 int wid = fm.width( dayTest );
652 maxWid -= ( selCount * 3 ); 667 //maxWid -= ( selCount * 3 ); //working for QLabels
668 maxWid -= ( selCount * 5 ); //working for QPushButton
653 if ( maxWid < 0 ) 669 if ( maxWid < 0 )
@@ -671,3 +687,3 @@ void KOAgendaView::createDayLabels()
671 QFontMetrics f( dlf ); 687 QFontMetrics f( dlf );
672 wid = f.width( "20" ); 688 wid = f.width( "20" )+2;
673 needWid = wid * selCount; 689 needWid = wid * selCount;
@@ -692,8 +708,3 @@ void KOAgendaView::createDayLabels()
692 appendLabels = true; 708 appendLabels = true;
693 dayLabel = new QPushButton(mDayLabels); 709 dayLabel = getNewDaylabel();
694 dayLabel->setFlat( true );
695 connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) );
696 dayLabel->setFocusPolicy(NoFocus);
697 mDayLabelsList.append( dayLabel );
698 mLayoutDayLabels->addWidget(dayLabel);
699 } 710 }
@@ -718,8 +729,3 @@ void KOAgendaView::createDayLabels()
718 if ( appendLabels ) { 729 if ( appendLabels ) {
719 dayLabel = new QPushButton(mDayLabels); 730 dayLabel = getNewDaylabel();
720 dayLabel->setFlat( true );
721 connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) );
722 dayLabel->setFocusPolicy(NoFocus);
723 mDayLabelsList.append( dayLabel );
724 mLayoutDayLabels->addWidget(dayLabel);
725 } 731 }
@@ -809,8 +815,3 @@ void KOAgendaView::createDayLabels()
809 if ( appendLabels ) { 815 if ( appendLabels ) {
810 dayLabel = new QPushButton(mDayLabels); 816 dayLabel = getNewDaylabel();
811 dayLabel->setFlat( true );
812 connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) );
813 dayLabel->setFocusPolicy(NoFocus);
814 mDayLabelsList.append( dayLabel );
815 mLayoutDayLabels->addWidget(dayLabel);
816 } 817 }
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h
index fd0a7af..cbe86b6 100644
--- a/korganizer/koagendaview.h
+++ b/korganizer/koagendaview.h
@@ -192,2 +192,3 @@ class KOAgendaView : public KOEventView {
192 protected: 192 protected:
193 QPushButton* getNewDaylabel();
193 bool mBlockUpdating; 194 bool mBlockUpdating;
diff --git a/korganizer/kodaymatrix.cpp b/korganizer/kodaymatrix.cpp
index dd83d48..989f758 100644
--- a/korganizer/kodaymatrix.cpp
+++ b/korganizer/kodaymatrix.cpp
@@ -342,3 +342,3 @@ void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
342 mSelStart = tmp; 342 mSelStart = tmp;
343 repaint(); 343 repaint(false);
344 } 344 }
@@ -350,3 +350,3 @@ void KODayMatrix::mouseReleaseEvent (QMouseEvent* e)
350 mSelEnd = tmp; 350 mSelEnd = tmp;
351 repaint(); 351 repaint(false);
352 } 352 }
@@ -373,3 +373,3 @@ void KODayMatrix::mouseMoveEvent (QMouseEvent* e)
373 mSelStart = tmp; 373 mSelStart = tmp;
374 repaint(); 374 repaint(false);
375 } 375 }
@@ -381,3 +381,3 @@ void KODayMatrix::mouseMoveEvent (QMouseEvent* e)
381 mSelEnd = tmp; 381 mSelEnd = tmp;
382 repaint(); 382 repaint(false);
383 } 383 }
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 188ad23..7e126d9 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -100,16 +100,18 @@ void KOViewManager::readSettings(KConfig *config)
100 100
101
102void KOViewManager::showDateView( int view, QDate date) 101void KOViewManager::showDateView( int view, QDate date)
103{ 102{
104 103 static int lastMode = 0;
104 static int lastCount = 0;
105 static bool lastNDMode = false;
106 static QDate lastDate;
105 //qDebug("date %d %s", view, date.toString().latin1()); 107 //qDebug("date %d %s", view, date.toString().latin1());
106#if 0 108
107 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); 109 //qDebug("%d %d ", lastNDMode, mFlagShowNextxDays );
108 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); 110 bool savemFlagShowNextxDays = mFlagShowNextxDays;
109 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); 111 mFlagShowNextxDays = false;
110 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 );
111 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
112#endif
113 if ( view == 3 ) { 112 if ( view == 3 ) {
114 //mCurrentAgendaView = 1 ; 113 //mCurrentAgendaView = 1 ;
114 lastDate = mMainView->dateNavigator()->selectedDates().first();
115 lastCount = mMainView->dateNavigator()->selectedDates().count();
116 lastNDMode = savemFlagShowNextxDays;
115 mMainView->showDay( date ); 117 mMainView->showDay( date );
@@ -140,4 +142,12 @@ void KOViewManager::showDateView( int view, QDate date)
140 mCurrentAgendaView = 3 ; 142 mCurrentAgendaView = 3 ;
141 } if (view == 9) { 143 } if (view == 9) { // return behaviour, for getting back from mode == 3 (single day mode )
142 showWeekView(); 144 if ( lastMode ) {
145 mCurrentAgendaView = lastCount ;
146 mMainView->dateNavigator()->selectDates( lastDate, lastCount);
147 mFlagShowNextxDays = lastNDMode;
148 if ( mFlagShowNextxDays ) {
149 mCurrentAgendaView = 3 ;
150 }
151 } else
152 showWeekView();
143 } else if (view == 10) { 153 } else if (view == 10) {
@@ -145,10 +155,3 @@ void KOViewManager::showDateView( int view, QDate date)
145 } 155 }
146 156 lastMode = view;
147#if 0
148 dateNavigator()->blockSignals( true );
149 dateNavigator()->selectDate( d );
150 dateNavigator()->blockSignals( false );
151 mViewManager->showDayView();
152#endif
153
154} 157}