author | zautrix <zautrix> | 2005-01-31 22:41:05 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-01-31 22:41:05 (UTC) |
commit | 336678d691a8c3346c92a4e561ac7938ed532003 (patch) (unidiff) | |
tree | d4c12ab5536003910727b4478f70372324b7c00d /korganizer | |
parent | 949ead6797c44f632a4addd2e6aae1fb88f37816 (diff) | |
download | kdepimpi-336678d691a8c3346c92a4e561ac7938ed532003.zip kdepimpi-336678d691a8c3346c92a4e561ac7938ed532003.tar.gz kdepimpi-336678d691a8c3346c92a4e561ac7938ed532003.tar.bz2 |
fixxx
-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 | |||
@@ -611,2 +611,18 @@ void KOAgendaView::resizeEvent( QResizeEvent* e ) | |||
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() |
@@ -672,3 +688,3 @@ void KOAgendaView::createDayLabels() | |||
672 | bool appendLabels = false; | 688 | bool appendLabels = false; |
673 | QLabel *dayLabel; | 689 | QPushButton *dayLabel; |
674 | dayLabel = mDayLabelsList.first(); | 690 | dayLabel = mDayLabelsList.first(); |
@@ -676,3 +692,6 @@ void KOAgendaView::createDayLabels() | |||
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 ); |
@@ -682,3 +701,4 @@ void KOAgendaView::createDayLabels() | |||
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 ) ); |
@@ -687,3 +707,5 @@ void KOAgendaView::createDayLabels() | |||
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; |
@@ -696,3 +718,6 @@ void KOAgendaView::createDayLabels() | |||
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 ); |
@@ -704,2 +729,3 @@ void KOAgendaView::createDayLabels() | |||
704 | dayLabel->show(); | 729 | dayLabel->show(); |
730 | dayLabel->setCaption(QString::number( counter )); | ||
705 | QString str; | 731 | QString str; |
@@ -748,3 +774,3 @@ void KOAgendaView::createDayLabels() | |||
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()) { |
@@ -783,3 +809,6 @@ void KOAgendaView::createDayLabels() | |||
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 ); |
@@ -792,4 +821,5 @@ void KOAgendaView::createDayLabels() | |||
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 ); |
diff --git a/korganizer/koagendaview.h b/korganizer/koagendaview.h index 7774fbe..fd0a7af 100644 --- a/korganizer/koagendaview.h +++ b/korganizer/koagendaview.h | |||
@@ -209,2 +209,3 @@ class KOAgendaView : public KOEventView { | |||
209 | protected slots: | 209 | protected slots: |
210 | void slotDaylabelClicked(); | ||
210 | /** Update event belonging to agenda item */ | 211 | /** Update event belonging to agenda item */ |
@@ -254,3 +255,3 @@ class KOAgendaView : public KOEventView { | |||
254 | QPixmap mNotExpandedPixmap; | 255 | QPixmap mNotExpandedPixmap; |
255 | QPtrList<QLabel> mDayLabelsList; | 256 | QPtrList<QPushButton> mDayLabelsList; |
256 | QDateTime mTimeSpanBegin; | 257 | QDateTime mTimeSpanBegin; |
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp index db23882..30f5fb1 100644 --- a/korganizer/koviewmanager.cpp +++ b/korganizer/koviewmanager.cpp | |||
@@ -113,6 +113,9 @@ void KOViewManager::showDateView( int view, QDate date) | |||
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); |
@@ -137,3 +140,7 @@ void KOViewManager::showDateView( int view, QDate date) | |||
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 | ||