summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-01-20 01:24:07 (UTC)
committer zautrix <zautrix>2005-01-20 01:24:07 (UTC)
commitdbb59deb5c0949f83b2d6fd79ec599e7b9e8ebf1 (patch) (unidiff)
tree3fac729225892ee1a4570a5852ee287f35e74ce7 /korganizer
parentade7e8fcdcf45d5bc73ea73da6f9a1b06964a64e (diff)
downloadkdepimpi-dbb59deb5c0949f83b2d6fd79ec599e7b9e8ebf1.zip
kdepimpi-dbb59deb5c0949f83b2d6fd79ec599e7b9e8ebf1.tar.gz
kdepimpi-dbb59deb5c0949f83b2d6fd79ec599e7b9e8ebf1.tar.bz2
more view fixes
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/komonthview.cpp26
-rw-r--r--korganizer/komonthview.h1
-rw-r--r--korganizer/koviewmanager.cpp3
4 files changed, 23 insertions, 11 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index f9af769..8f05276 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -492,26 +492,26 @@ CalendarView::~CalendarView()
492 delete mViewManager; 492 delete mViewManager;
493 delete mStorage; 493 delete mStorage;
494 delete mDateFrame ; 494 delete mDateFrame ;
495 delete beamDialog; 495 delete beamDialog;
496 //kdDebug() << "~CalendarView() done" << endl; 496 //kdDebug() << "~CalendarView() done" << endl;
497} 497}
498 498
499void CalendarView::showDay( QDate d ) 499void CalendarView::showDay( QDate d )
500{ 500{
501 dateNavigator()->blockSignals( true ); 501 dateNavigator()->blockSignals( true );
502 dateNavigator()->selectDate( d ); 502 dateNavigator()->selectDate( d );
503 dateNavigator()->blockSignals( false ); 503 dateNavigator()->blockSignals( false );
504 mViewManager->showWeekView(); 504 mViewManager->showDayView();
505 dateNavigator()->selectDate( d ); 505 //dateNavigator()->selectDate( d );
506} 506}
507void CalendarView::timerAlarm() 507void CalendarView::timerAlarm()
508{ 508{
509 //qDebug("CalendarView::timerAlarm() "); 509 //qDebug("CalendarView::timerAlarm() ");
510 computeAlarm(mAlarmNotification ); 510 computeAlarm(mAlarmNotification );
511} 511}
512 512
513void CalendarView::suspendAlarm() 513void CalendarView::suspendAlarm()
514{ 514{
515 //qDebug(" CalendarView::suspendAlarm() "); 515 //qDebug(" CalendarView::suspendAlarm() ");
516 computeAlarm(mSuspendAlarmNotification ); 516 computeAlarm(mSuspendAlarmNotification );
517 517
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 842f6eb..b819eec 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -65,25 +65,25 @@ public:
65protected: 65protected:
66 virtual QString text( const QPoint& p) 66 virtual QString text( const QPoint& p)
67 { 67 {
68 return _wid->getWhatsThisText(p) ; 68 return _wid->getWhatsThisText(p) ;
69 }; 69 };
70private: 70private:
71 KNoScrollListBox* _wid; 71 KNoScrollListBox* _wid;
72 72
73}; 73};
74 74
75 75
76KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name) 76KNoScrollListBox::KNoScrollListBox(QWidget *parent,const char *name)
77 : QListBox(parent, name) 77 : QListBox(parent, name, WRepaintNoErase)
78{ 78{
79#ifndef DESKTOP_VERSION 79#ifndef DESKTOP_VERSION
80 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold ); 80 QPEApplication::setStylusOperation( viewport(), QPEApplication::RightOnHold );
81#endif 81#endif
82 mWT = new KNOWhatsThis(this); 82 mWT = new KNOWhatsThis(this);
83} 83}
84KNoScrollListBox::~KNoScrollListBox() 84KNoScrollListBox::~KNoScrollListBox()
85{ 85{
86 delete mWT; 86 delete mWT;
87} 87}
88QString KNoScrollListBox::getWhatsThisText(QPoint p) 88QString KNoScrollListBox::getWhatsThisText(QPoint p)
89{ 89{
@@ -373,42 +373,50 @@ void MonthViewCell::setHoliday( const QString &holiday )
373 mHolidayString = holiday; 373 mHolidayString = holiday;
374 374
375 if ( !holiday.isEmpty() ) { 375 if ( !holiday.isEmpty() ) {
376 setHoliday( true ); 376 setHoliday( true );
377 } 377 }
378} 378}
379void MonthViewCell::keyPressEvent ( QKeyEvent * e ) 379void MonthViewCell::keyPressEvent ( QKeyEvent * e )
380{ 380{
381 381
382 e->ignore(); 382 e->ignore();
383 383
384} 384}
385void MonthViewCell::clear()
386{
387 mItemList->clear();
388 QApplication::removePostedEvents ( mItemList );
389 QApplication::removePostedEvents ( mLabel );
390 QApplication::removePostedEvents ( this );
391}
385void MonthViewCell::updateCell() 392void MonthViewCell::updateCell()
386{ 393{
387 if ( !mMonthView->isUpdatePossible() ) 394 if ( !mMonthView->isUpdatePossible() )
388 return; 395 return;
389 if ( !isVisible() ){ 396 /*
397 if ( !isVisible() ){
390 return; 398 return;
391 } 399 }
400 */
401 // qDebug("MonthViewCell::updateCell() ");
392 setPrimary( mDate.month()%2 ); 402 setPrimary( mDate.month()%2 );
393 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays); 403 setHoliday( KOGlobals::self()->calendarSystem()->dayOfWeek(mDate) == KOGlobals::self()->calendarSystem()->weekDayOfPray() || ( mDate.dayOfWeek() == 6 ) && KOPrefs::instance()-> mExcludeSaturdays);
394 if ( mDate == QDate::currentDate() ) { 404 if ( mDate == QDate::currentDate() ) {
395 mItemList->setLineWidth( 3 ); 405 mItemList->setLineWidth( 3 );
396 } else { 406 } else {
397 mItemList->setLineWidth( 1 ); 407 mItemList->setLineWidth( 1 );
398 } 408 }
399 mItemList->clear(); 409 mItemList->clear();
400 410
401
402
403#ifdef DESKTOP_VERSION 411#ifdef DESKTOP_VERSION
404 QToolTip::remove(this); 412 QToolTip::remove(this);
405#endif 413#endif
406 QString tipText(""); 414 QString tipText("");
407 //qApp->processEvents(); 415 //qApp->processEvents();
408 if ( !mHolidayString.isEmpty() ) { 416 if ( !mHolidayString.isEmpty() ) {
409 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString ); 417 MonthViewItem *item = new MonthViewItem( 0, mDate, mHolidayString );
410 item->setPalette( mHolidayPalette ); 418 item->setPalette( mHolidayPalette );
411 mItemList->insertItem( item ); 419 mItemList->insertItem( item );
412 tipText += mHolidayString+"\n"; 420 tipText += mHolidayString+"\n";
413 } 421 }
414 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2); 422 //mLabel->setMaximumWidth( width() - mItemList->lineWidth()*2);
@@ -557,28 +565,29 @@ void MonthViewCell::updateCell()
557 //setMyPalette(); 565 //setMyPalette();
558 setMyPalette(); 566 setMyPalette();
559 QString text; 567 QString text;
560 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog; 568 bool smallDisplay = QApplication::desktop()->width() < 320 && KOPrefs::instance()->mMonthViewSatSunTog;
561 if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) { 569 if ( KOGlobals::self()->calendarSystem()->day( mDate ) == 1 || (mDate.dayOfWeek() == 7 && !smallDisplay ) || KOPrefs::instance()->mMonthShowShort) {
562 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " "; 570 text = KOGlobals::self()->calendarSystem()->monthName( mDate, true ) + " ";
563 mLabel->resize( mLabelBigSize ); 571 mLabel->resize( mLabelBigSize );
564 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 572 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
565 } else { 573 } else {
566 mLabel->resize( mLabelSize ); 574 mLabel->resize( mLabelSize );
567 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) ); 575 text += QString::number( KOGlobals::self()->calendarSystem()->day(mDate) );
568 } 576 }
577
569 mLabel->setText( text ); 578 mLabel->setText( text );
570 resizeEvent( 0 ); 579 resizeEvent( 0 );
571 // if ( isVisible()) 580 // if ( isVisible())
572 qApp->processEvents(); 581 //qApp->processEvents();
573} 582}
574 583
575void MonthViewCell::updateConfig() 584void MonthViewCell::updateConfig()
576{ 585{
577 586
578 setFont( KOPrefs::instance()->mMonthViewFont ); 587 setFont( KOPrefs::instance()->mMonthViewFont );
579 588
580 QFontMetrics fm( font() ); 589 QFontMetrics fm( font() );
581 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 ); 590 mLabelSize = fm.size( 0, "30" ) + QSize( 4, 2 );
582 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 ); 591 mLabelBigSize = fm.size( 0, "Mag 30" ) + QSize( 2, 2 );
583 mHolidayPalette = mStandardPalette; 592 mHolidayPalette = mStandardPalette;
584 mPrimaryPalette = mStandardPalette; 593 mPrimaryPalette = mStandardPalette;
@@ -927,34 +936,35 @@ void KOMonthView::showEvents(QPtrList<Event>)
927 qDebug("KOMonthView::selectEvents is not implemented yet. "); 936 qDebug("KOMonthView::selectEvents is not implemented yet. ");
928} 937}
929 938
930void KOMonthView::changeEventDisplay(Event *, int) 939void KOMonthView::changeEventDisplay(Event *, int)
931{ 940{
932 // this should be re-written to be much more efficient, but this 941 // this should be re-written to be much more efficient, but this
933 // quick-and-dirty-hack gets the job done for right now. 942 // quick-and-dirty-hack gets the job done for right now.
934 updateView(); 943 updateView();
935} 944}
936 945
937void KOMonthView::updateView() 946void KOMonthView::updateView()
938{ 947{
939 static int iii = 0;
940 ++iii;
941 if ( !updatePossible ) 948 if ( !updatePossible )
942 return; 949 return;
943 uint i; 950 //qDebug("+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ");
951 int i;
944 for( i = 0; i < mCells.count(); ++i ) { 952 for( i = 0; i < mCells.count(); ++i ) {
945 mCells[i]->updateCell(); 953 mCells[i]->updateCell();
946 } 954 }
955
947 //qDebug("KOMonthView::updateView() "); 956 //qDebug("KOMonthView::updateView() ");
948 processSelectionChange(); 957 processSelectionChange();
958 // qDebug("---------------------------------------------------------------------+ ");
949} 959}
950 960
951void KOMonthView::resizeEvent(QResizeEvent * e) 961void KOMonthView::resizeEvent(QResizeEvent * e)
952{ 962{
953 computeLayout(); 963 computeLayout();
954} 964}
955void KOMonthView::computeLayout() 965void KOMonthView::computeLayout()
956{ 966{
957 // select the appropriate heading string size. E.g. "Wednesday" or "Wed". 967 // select the appropriate heading string size. E.g. "Wednesday" or "Wed".
958 // note this only changes the text if the requested size crosses the 968 // note this only changes the text if the requested size crosses the
959 // threshold between big enough to support the full name and not big 969 // threshold between big enough to support the full name and not big
960 // enough. 970 // enough.
diff --git a/korganizer/komonthview.h b/korganizer/komonthview.h
index 727f511..a965bf3 100644
--- a/korganizer/komonthview.h
+++ b/korganizer/komonthview.h
@@ -138,24 +138,25 @@ class MonthViewCell : public QWidget
138 138
139 void updateCell(); 139 void updateCell();
140 140
141 void updateConfig(); 141 void updateConfig();
142 142
143 void enableScrollBars( bool ); 143 void enableScrollBars( bool );
144 144
145 Incidence *selectedIncidence(); 145 Incidence *selectedIncidence();
146 QDate selectedIncidenceDate(); 146 QDate selectedIncidenceDate();
147 147
148 void deselect(); 148 void deselect();
149 void select(); 149 void select();
150 void clear();
150 151
151#ifdef DESKTOP_VERSION 152#ifdef DESKTOP_VERSION
152 static QToolTipGroup *toolTipGroup(); 153 static QToolTipGroup *toolTipGroup();
153#endif 154#endif
154 signals: 155 signals:
155 void defaultAction( Incidence * ); 156 void defaultAction( Incidence * );
156 void newEventSignal( QDateTime ); 157 void newEventSignal( QDateTime );
157 void showDaySignal( QDate ); 158 void showDaySignal( QDate );
158 159
159 protected: 160 protected:
160 void resizeEvent( QResizeEvent * ); 161 void resizeEvent( QResizeEvent * );
161 162
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 00a5842..f6b7718 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -144,27 +144,28 @@ void KOViewManager::showView(KOrg::BaseView *view, bool fullScreen )
144 full = mMainView->leftFrame()->isVisible(); 144 full = mMainView->leftFrame()->isVisible();
145 } else { 145 } else {
146 mCurrentView = view; 146 mCurrentView = view;
147 147
148 // bool full = fullScreen; 148 // bool full = fullScreen;
149 bool isFull = !mMainView->leftFrame()->isVisible(); 149 bool isFull = !mMainView->leftFrame()->isVisible();
150 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen ) 150 if ( isFull && KOPrefs::instance()->mViewChangeHoldFullscreen )
151 full = true; 151 full = true;
152 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen ) 152 if ( !isFull && KOPrefs::instance()->mViewChangeHoldNonFullscreen )
153 full = false; 153 full = false;
154 } 154 }
155 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime(); 155 if ( mAgendaView ) mAgendaView->deleteSelectedDateTime();
156 raiseCurrentView( full ); 156 //raiseCurrentView( full );
157 mMainView->processIncidenceSelection( 0 ); 157 mMainView->processIncidenceSelection( 0 );
158 mMainView->updateView(); 158 mMainView->updateView();
159 raiseCurrentView( full );
159 mMainView->adaptNavigationUnits(); 160 mMainView->adaptNavigationUnits();
160} 161}
161 162
162void KOViewManager::raiseCurrentView( bool fullScreen ) 163void KOViewManager::raiseCurrentView( bool fullScreen )
163{ 164{
164 //qDebug("raiseCurrentView "); 165 //qDebug("raiseCurrentView ");
165 mCurrentAgendaView = 0; 166 mCurrentAgendaView = 0;
166 int wid = mMainView->width() ; 167 int wid = mMainView->width() ;
167 int hei = mMainView->height(); 168 int hei = mMainView->height();
168 if ( mCurrentView == mMonthView ) { 169 if ( mCurrentView == mMonthView ) {
169 mMainView->navigatorBar()->show(); 170 mMainView->navigatorBar()->show();
170 hei -= mMainView->navigatorBar()->sizeHint().height(); 171 hei -= mMainView->navigatorBar()->sizeHint().height();