-rw-r--r-- | korganizer/koagendaview.cpp | 44 | ||||
-rw-r--r-- | korganizer/koagendaview.h | 3 | ||||
-rw-r--r-- | korganizer/koviewmanager.cpp | 9 |
3 files changed, 47 insertions, 9 deletions
diff --git a/korganizer/koagendaview.cpp b/korganizer/koagendaview.cpp index 8e9add3..d43712f 100644 --- a/korganizer/koagendaview.cpp +++ b/korganizer/koagendaview.cpp | |||
@@ -610,4 +610,20 @@ void KOAgendaView::resizeEvent( QResizeEvent* e ) | |||
610 | 610 | ||
611 | } | 611 | } |
612 | void KOAgendaView::slotDaylabelClicked() | ||
613 | { | ||
614 | QString cap = ((QPushButton*) sender() )->caption(); | ||
615 | |||
616 | QDate firstDate = mSelectedDates.first(); | ||
617 | if ( cap == "0" ) | ||
618 | emit showDateView( 6, firstDate ); | ||
619 | else if ( cap != "last" ) { | ||
620 | if ( mSelectedDates.count() == 1) | ||
621 | emit showDateView( 9, firstDate.addDays( cap.toInt()-1 ) ); | ||
622 | else | ||
623 | emit showDateView( 3, firstDate.addDays( cap.toInt()-1 ) ); | ||
624 | } | ||
625 | else | ||
626 | showDateView( 10, firstDate.addDays(1 ) ); | ||
627 | } | ||
612 | void KOAgendaView::createDayLabels() | 628 | void KOAgendaView::createDayLabels() |
613 | { | 629 | { |
@@ -671,9 +687,12 @@ void KOAgendaView::createDayLabels() | |||
671 | // QFont lFont = dlf; | 687 | // QFont lFont = dlf; |
672 | bool appendLabels = false; | 688 | bool appendLabels = false; |
673 | QLabel *dayLabel; | 689 | QPushButton *dayLabel; |
674 | dayLabel = mDayLabelsList.first(); | 690 | dayLabel = mDayLabelsList.first(); |
675 | if ( !dayLabel ) { | 691 | if ( !dayLabel ) { |
676 | appendLabels = true; | 692 | appendLabels = true; |
677 | dayLabel = new QLabel(mDayLabels); | 693 | dayLabel = new QPushButton(mDayLabels); |
694 | dayLabel->setFlat( true ); | ||
695 | connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); | ||
696 | dayLabel->setFocusPolicy(NoFocus); | ||
678 | mDayLabelsList.append( dayLabel ); | 697 | mDayLabelsList.append( dayLabel ); |
679 | mLayoutDayLabels->addWidget(dayLabel); | 698 | mLayoutDayLabels->addWidget(dayLabel); |
@@ -681,10 +700,13 @@ void KOAgendaView::createDayLabels() | |||
681 | dayLabel->setFixedWidth( mTimeLabels->width()+2 ); | 700 | dayLabel->setFixedWidth( mTimeLabels->width()+2 ); |
682 | dayLabel->setFont( dlf ); | 701 | dayLabel->setFont( dlf ); |
683 | dayLabel->setAlignment(QLabel::AlignHCenter); | 702 | dayLabel->setCaption("0"); |
703 | //dayLabel->setAlignment(QLabel::AlignHCenter); | ||
684 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); | 704 | dayLabel->setText( KOGlobals::self()->calendarSystem()->monthName( mSelectedDates.first(), true ) ); |
685 | dayLabel->show(); | 705 | dayLabel->show(); |
686 | DateList::ConstIterator dit; | 706 | DateList::ConstIterator dit; |
687 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); | 707 | bool oneday = (mSelectedDates.first() == mSelectedDates.last() ); |
708 | int counter = 0; | ||
688 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { | 709 | for( dit = mSelectedDates.begin(); dit != mSelectedDates.end(); ++dit ) { |
710 | ++counter; | ||
689 | QDate date = *dit; | 711 | QDate date = *dit; |
690 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); | 712 | // QBoxLayout *dayLayout = new QVBoxLayout(mLayoutDayLabels); |
@@ -695,5 +717,8 @@ void KOAgendaView::createDayLabels() | |||
695 | } | 717 | } |
696 | if ( appendLabels ) { | 718 | if ( appendLabels ) { |
697 | dayLabel = new QLabel(mDayLabels); | 719 | dayLabel = new QPushButton(mDayLabels); |
720 | dayLabel->setFlat( true ); | ||
721 | connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); | ||
722 | dayLabel->setFocusPolicy(NoFocus); | ||
698 | mDayLabelsList.append( dayLabel ); | 723 | mDayLabelsList.append( dayLabel ); |
699 | mLayoutDayLabels->addWidget(dayLabel); | 724 | mLayoutDayLabels->addWidget(dayLabel); |
@@ -703,4 +728,5 @@ void KOAgendaView::createDayLabels() | |||
703 | dayLabel->setFont( dlf ); | 728 | dayLabel->setFont( dlf ); |
704 | dayLabel->show(); | 729 | dayLabel->show(); |
730 | dayLabel->setCaption(QString::number( counter )); | ||
705 | QString str; | 731 | QString str; |
706 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); | 732 | int dW = KOGlobals::self()->calendarSystem()->dayOfWeek(date); |
@@ -747,5 +773,5 @@ void KOAgendaView::createDayLabels() | |||
747 | } | 773 | } |
748 | dayLabel->setText(str); | 774 | dayLabel->setText(str); |
749 | dayLabel->setAlignment(QLabel::AlignHCenter); | 775 | //dayLabel->setAlignment(QLabel::AlignHCenter); |
750 | if (date == QDate::currentDate()) { | 776 | if (date == QDate::currentDate()) { |
751 | QFont bFont = dlf; | 777 | QFont bFont = dlf; |
@@ -782,5 +808,8 @@ void KOAgendaView::createDayLabels() | |||
782 | } | 808 | } |
783 | if ( appendLabels ) { | 809 | if ( appendLabels ) { |
784 | dayLabel = new QLabel(mDayLabels); | 810 | dayLabel = new QPushButton(mDayLabels); |
811 | dayLabel->setFlat( true ); | ||
812 | connect( dayLabel, SIGNAL( clicked() ), this, SLOT ( slotDaylabelClicked() ) ); | ||
813 | dayLabel->setFocusPolicy(NoFocus); | ||
785 | mDayLabelsList.append( dayLabel ); | 814 | mDayLabelsList.append( dayLabel ); |
786 | mLayoutDayLabels->addWidget(dayLabel); | 815 | mLayoutDayLabels->addWidget(dayLabel); |
@@ -791,6 +820,7 @@ void KOAgendaView::createDayLabels() | |||
791 | if ( offset < 0 ) offset = 0; | 820 | if ( offset < 0 ) offset = 0; |
792 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); | 821 | //qDebug("mLayoutDayLabels->addSpacing %d ", mAgenda->verticalScrollBar()->width()+offset+2 ); |
793 | dayLabel->setText("");//QString::number ( mSelectedDates.first().month() ) ); | 822 | dayLabel->setText(">");//QString::number ( mSelectedDates.first().month() ) ); |
794 | dayLabel->show(); | 823 | dayLabel->show(); |
824 | dayLabel->setCaption("last"); | ||
795 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); | 825 | dayLabel->setFixedWidth( mAgenda->verticalScrollBar()->width()+ offset ); |
796 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); | 826 | //qDebug("setToFixed %d ", mAgenda->verticalScrollBar()->width()+ offset+2); |
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 7774fbe..fd0a7af 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -208,4 +208,5 @@ class KOAgendaView : public KOEventView { | |||
208 | 208 | ||
209 | protected slots: | 209 | protected slots: |
210 | void slotDaylabelClicked(); | ||
210 | /** Update event belonging to agenda item */ | 211 | /** Update event belonging to agenda item */ |
211 | void updateEventDates(KOAgendaItem *item, int mode = -1); | 212 | void updateEventDates(KOAgendaItem *item, int mode = -1); |
@@ -253,5 +254,5 @@ class KOAgendaView : public KOEventView { | |||
253 | QPixmap mExpandedPixmap; | 254 | QPixmap mExpandedPixmap; |
254 | QPixmap mNotExpandedPixmap; | 255 | QPixmap mNotExpandedPixmap; |
255 | QPtrList<QLabel> mDayLabelsList; | 256 | QPtrList<QPushButton> mDayLabelsList; |
256 | QDateTime mTimeSpanBegin; | 257 | QDateTime mTimeSpanBegin; |
257 | QDateTime mTimeSpanEnd; | 258 | QDateTime mTimeSpanEnd; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index db23882..30f5fb1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -112,8 +112,11 @@ void KOViewManager::showDateView( int view, QDate date) | |||
112 | #endif | 112 | #endif |
113 | if ( view == 3 ) { | 113 | if ( view == 3 ) { |
114 | //mCurrentAgendaView = 1 ; | ||
114 | mMainView->showDay( date ); | 115 | mMainView->showDay( date ); |
115 | } else if (view == 4 ) { | 116 | } else if (view == 4 ) { |
117 | mCurrentAgendaView = 7 ; | ||
116 | mMainView->dateNavigator()->selectDates( date, 7 ); | 118 | mMainView->dateNavigator()->selectDates( date, 7 ); |
117 | } else if (view == 5 ) { | 119 | } else if (view == 5 ) { |
120 | mCurrentAgendaView = 14 ; | ||
118 | mMainView->dateNavigator()->selectDates( date, 14); | 121 | mMainView->dateNavigator()->selectDates( date, 14); |
119 | } else if (view == 6 ) { | 122 | } else if (view == 6 ) { |
@@ -136,5 +139,9 @@ void KOViewManager::showDateView( int view, QDate date) | |||
136 | mFlagShowNextxDays = true; | 139 | mFlagShowNextxDays = true; |
137 | mCurrentAgendaView = 3 ; | 140 | mCurrentAgendaView = 3 ; |
138 | } | 141 | } if (view == 9) { |
142 | showWeekView(); | ||
143 | } else if (view == 10) { | ||
144 | mMainView->dateNavigator()->selectDates( date,mMainView->dateNavigator()->selectedDates().count() ); | ||
145 | } | ||
139 | 146 | ||
140 | #if 0 | 147 | #if 0 |