summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-31 17:16:55 (UTC)
committer zautrix <zautrix>2005-01-31 17:16:55 (UTC)
commit8e627854bec00289be27915b81458cf22bbb000f (patch) (unidiff)
tree18db63d50f031122b5069927c2491ac8cf5c6295 /korganizer
parentec037c4616342c1b3976c55db98b775f48e0d455 (diff)
downloadkdepimpi-8e627854bec00289be27915b81458cf22bbb000f.zip
kdepimpi-8e627854bec00289be27915b81458cf22bbb000f.tar.gz
kdepimpi-8e627854bec00289be27915b81458cf22bbb000f.tar.bz2
sss
Diffstat (limited to 'korganizer') (more/less context) (show whitespace changes)
-rw-r--r--korganizer/komonthview.cpp4
-rw-r--r--korganizer/koviewmanager.cpp1
2 files changed, 2 insertions, 3 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 6646b98..4cff23a 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -587,69 +587,68 @@ void MonthViewCell::finishUpdateCell()
587void MonthViewCell::updateCell() 587void MonthViewCell::updateCell()
588{ 588{
589 if ( !mMonthView->isUpdatePossible() ) 589 if ( !mMonthView->isUpdatePossible() )
590 return; 590 return;
591 startUpdateCell(); 591 startUpdateCell();
592 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 592 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
593 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true ); 593 QPtrList<Event> events = mMonthView->calendar()->events( mDate, true );
594 Event *event; 594 Event *event;
595 for( event = events.first(); event; event = events.next() ) { // for event 595 for( event = events.first(); event; event = events.next() ) { // for event
596 insertEvent(event); 596 insertEvent(event);
597 } 597 }
598 // insert due todos 598 // insert due todos
599 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate ); 599 QPtrList<Todo> todos = mMonthView->calendar()->todos( mDate );
600 Todo *todo; 600 Todo *todo;
601 for(todo = todos.first(); todo; todo = todos.next()) { 601 for(todo = todos.first(); todo; todo = todos.next()) {
602 insertTodo( todo ); 602 insertTodo( todo );
603 } 603 }
604 finishUpdateCell(); 604 finishUpdateCell();
605 // if ( isVisible()) 605 // if ( isVisible())
606 //qApp->processEvents(); 606 //qApp->processEvents();
607} 607}
608 608
609void MonthViewCell::updateConfig() 609void MonthViewCell::updateConfig()
610{ 610{
611 qDebug("MonthViewCell::updateConfig() ");
612 setFont( KOPrefs::instance()->mMonthViewFont ); 611 setFont( KOPrefs::instance()->mMonthViewFont );
613 612
614 QFontMetrics fm( font() ); 613 QFontMetrics fm( font() );
615 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); 614 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
616 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); 615 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
617 mHolidayPalette = mStandardPalette; 616 mHolidayPalette = mStandardPalette;
618 mPrimaryPalette = mStandardPalette; 617 mPrimaryPalette = mStandardPalette;
619 mNonPrimaryPalette = mStandardPalette; 618 mNonPrimaryPalette = mStandardPalette;
620 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) { 619 if ( KOPrefs::instance()->mMonthViewUsesDayColors ) {
621 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor ); 620 mHolidayPalette.setColor(QColorGroup::Base, KOPrefs::instance()->mMonthViewHolidayColor );
622 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor ); 621 mHolidayPalette.setColor(QColorGroup::Background, KOPrefs::instance()->mMonthViewHolidayColor );
623 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark()); 622 mHolidayPalette.setColor(QColorGroup::Foreground, KOPrefs::instance()->mMonthViewHolidayColor.dark());
624 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark()); 623 mPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewOddColor.dark());
625 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor); 624 mPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewOddColor);
626 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor); 625 mPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewOddColor);
627 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark()); 626 mNonPrimaryPalette.setColor(QColorGroup::Foreground,KOPrefs::instance()->mMonthViewEvenColor.dark());
628 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor); 627 mNonPrimaryPalette.setColor(QColorGroup::Base,KOPrefs::instance()->mMonthViewEvenColor);
629 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor); 628 mNonPrimaryPalette.setColor(QColorGroup::Background,KOPrefs::instance()->mMonthViewEvenColor);
630 } 629 }
631 updateCell(); 630 //updateCell();
632} 631}
633 632
634void MonthViewCell::enableScrollBars( bool enabled ) 633void MonthViewCell::enableScrollBars( bool enabled )
635{ 634{
636 if ( enabled ) { 635 if ( enabled ) {
637 mItemList->setVScrollBarMode(QScrollView::Auto); 636 mItemList->setVScrollBarMode(QScrollView::Auto);
638 mItemList->setHScrollBarMode(QScrollView::Auto); 637 mItemList->setHScrollBarMode(QScrollView::Auto);
639 } else { 638 } else {
640 mItemList->setVScrollBarMode(QScrollView::AlwaysOff); 639 mItemList->setVScrollBarMode(QScrollView::AlwaysOff);
641 mItemList->setHScrollBarMode(QScrollView::AlwaysOff); 640 mItemList->setHScrollBarMode(QScrollView::AlwaysOff);
642 } 641 }
643} 642}
644 643
645Incidence *MonthViewCell::selectedIncidence() 644Incidence *MonthViewCell::selectedIncidence()
646{ 645{
647 int index = mItemList->currentItem(); 646 int index = mItemList->currentItem();
648 if ( index < 0 ) return 0; 647 if ( index < 0 ) return 0;
649 648
650 MonthViewItem *item = 649 MonthViewItem *item =
651 static_cast<MonthViewItem *>( mItemList->item( index ) ); 650 static_cast<MonthViewItem *>( mItemList->item( index ) );
652 651
653 if ( !item ) return 0; 652 if ( !item ) return 0;
654 653
655 return item->incidence(); 654 return item->incidence();
@@ -876,48 +875,49 @@ void KOMonthView::updateConfig()
876 875
877 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday(); 876 mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
878 877
879 QFontMetrics fontmetric(mDayLabels[0]->font()); 878 QFontMetrics fontmetric(mDayLabels[0]->font());
880 mWidthLongDayLabel = 0; 879 mWidthLongDayLabel = 0;
881 880
882 for (int i = 0; i < 7; i++) { 881 for (int i = 0; i < 7; i++) {
883 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1)); 882 int width = fontmetric.width(KOGlobals::self()->calendarSystem()->weekDayName(i+1));
884 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width; 883 if ( width > mWidthLongDayLabel ) mWidthLongDayLabel = width;
885 } 884 }
886 bool temp = mShowSatSunComp ; 885 bool temp = mShowSatSunComp ;
887 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ; 886 mShowSatSunComp = KOPrefs::instance()->mMonthViewSatSunTog ;
888 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog ) 887 if ( temp != KOPrefs::instance()->mMonthViewSatSunTog )
889 computeLayout(); 888 computeLayout();
890 updateDayLabels(); 889 updateDayLabels();
891 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks); 890 //qDebug("KOMonthView::updateConfig() %d %d %d ",height(), mDayLabels[0]->sizeHint().height() ,mNumWeeks);
892 int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks; 891 int cellHeight = (height() - mDayLabels[0]->sizeHint().height()) /mNumWeeks;
893 //resizeEvent( 0 ); 892 //resizeEvent( 0 );
894 for (uint i = 0; i < mCells.count(); ++i) { 893 for (uint i = 0; i < mCells.count(); ++i) {
895 mCells[i]->updateConfig(); 894 mCells[i]->updateConfig();
896 } 895 }
897#ifdef DESKTOP_VERSION 896#ifdef DESKTOP_VERSION
898 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips); 897 MonthViewCell::toolTipGroup()->setEnabled(KOPrefs::instance()->mEnableToolTips);
899#endif 898#endif
899 updateView();
900} 900}
901 901
902void KOMonthView::updateDayLabels() 902void KOMonthView::updateDayLabels()
903{ 903{
904 904
905 for (int i = 0; i < 7; i++) { 905 for (int i = 0; i < 7; i++) {
906 if (mWeekStartsMonday) { 906 if (mWeekStartsMonday) {
907 bool show = mShortDayLabels; 907 bool show = mShortDayLabels;
908 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() ) 908 if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > mDayLabels[i]->width() )
909 show = true; 909 show = true;
910 mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show)); 910 mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
911 } else { 911 } else {
912 if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels)); 912 if (i==0) mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabels));
913 else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels)); 913 else mDayLabels[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabels));
914 914
915 } 915 }
916 } 916 }
917} 917}
918 918
919void KOMonthView::showDates(const QDate &start, const QDate &) 919void KOMonthView::showDates(const QDate &start, const QDate &)
920{ 920{
921 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl; 921 // kdDebug() << "KOMonthView::showDates(): " << start.toString() << endl;
922 922
923 923
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index c95917f..db23882 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -98,49 +98,48 @@ void KOViewManager::readSettings(KConfig *config)
98 } 98 }
99} 99}
100 100
101 101
102void KOViewManager::showDateView( int view, QDate date) 102void KOViewManager::showDateView( int view, QDate date)
103{ 103{
104 104
105 //qDebug("date %d %s", view, date.toString().latin1()); 105 //qDebug("date %d %s", view, date.toString().latin1());
106#if 0 106#if 0
107 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 ); 107 mNewItemPopup->insertItem ( SmallIcon( pathString +"day" ), i18n("Day view"),3 );
108 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 ); 108 mNewItemPopup->insertItem ( SmallIcon( pathString +"week" ), i18n("Next Week"),4 );
109 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 ); 109 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Two Weeks"),5 );
110 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 ); 110 mNewItemPopup->insertItem ( SmallIcon( pathString +"month" ), i18n("Next Month"),6 );
111 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 ); 111 mNewItemPopup->insertItem ( SmallIcon( pathString +"journal" ), i18n("Journal view"),7 );
112#endif 112#endif
113 if ( view == 3 ) { 113 if ( view == 3 ) {
114 mMainView->showDay( date ); 114 mMainView->showDay( date );
115 } else if (view == 4 ) { 115 } else if (view == 4 ) {
116 mMainView->dateNavigator()->selectDates( date, 7 ); 116 mMainView->dateNavigator()->selectDates( date, 7 );
117 } else if (view == 5 ) { 117 } else if (view == 5 ) {
118 mMainView->dateNavigator()->selectDates( date, 14); 118 mMainView->dateNavigator()->selectDates( date, 14);
119 } else if (view == 6 ) { 119 } else if (view == 6 ) {
120 mMainView->dateNavigator()->blockSignals( true ); 120 mMainView->dateNavigator()->blockSignals( true );
121 showMonthView(); 121 showMonthView();
122 qApp->processEvents();
123 mMainView->dateNavigator()->selectMonthByDate( date ); 122 mMainView->dateNavigator()->selectMonthByDate( date );
124 mMainView->dateNavigator()->blockSignals( false ); 123 mMainView->dateNavigator()->blockSignals( false );
125 mMainView->dateNavigator()->selectDate( date ); 124 mMainView->dateNavigator()->selectDate( date );
126 } else if (view == 7 ) { 125 } else if (view == 7 ) {
127 mMainView->dateNavigator()->selectDate( date ); 126 mMainView->dateNavigator()->selectDate( date );
128 showJournalView(); 127 showJournalView();
129 } else if (view == 8 ) { 128 } else if (view == 8 ) {
130 globalFlagBlockAgenda = 1; 129 globalFlagBlockAgenda = 1;
131 if ( mCurrentAgendaView != 3 ) 130 if ( mCurrentAgendaView != 3 )
132 mCurrentAgendaView = -1; 131 mCurrentAgendaView = -1;
133 showAgendaView(KOPrefs::instance()->mFullViewMonth); 132 showAgendaView(KOPrefs::instance()->mFullViewMonth);
134 globalFlagBlockAgenda = 2; 133 globalFlagBlockAgenda = 2;
135 mMainView->dateNavigator()->selectDates( date , 134 mMainView->dateNavigator()->selectDates( date ,
136 KOPrefs::instance()->mNextXDays ); 135 KOPrefs::instance()->mNextXDays );
137 mFlagShowNextxDays = true; 136 mFlagShowNextxDays = true;
138 mCurrentAgendaView = 3 ; 137 mCurrentAgendaView = 3 ;
139 } 138 }
140 139
141#if 0 140#if 0
142 dateNavigator()->blockSignals( true ); 141 dateNavigator()->blockSignals( true );
143 dateNavigator()->selectDate( d ); 142 dateNavigator()->selectDate( d );
144 dateNavigator()->blockSignals( false ); 143 dateNavigator()->blockSignals( false );
145 mViewManager->showDayView(); 144 mViewManager->showDayView();
146#endif 145#endif