korganizer

multiagendaview.cpp

00001 /*
00002     Copyright (c) 2007 Volker Krause <vkrause@kde.org>
00003 
00004     This program is free software; you can redistribute it and/or modify
00005     it under the terms of the GNU General Public License as published by
00006     the Free Software Foundation; either version 2 of the License, or
00007     (at your option) any later version.
00008 
00009     This program is distributed in the hope that it will be useful,
00010     but WITHOUT ANY WARRANTY; without even the implied warranty of
00011     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00012     GNU General Public License for more details.
00013 
00014     You should have received a copy of the GNU General Public License
00015     along with this program; if not, write to the Free Software
00016     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017 */
00018 
00019 #include "multiagendaview.h"
00020 
00021 #include "koagendaview.h"
00022 #include "koagenda.h"
00023 #include "koprefs.h"
00024 #include "timelabels.h"
00025 
00026 #include <libkcal/calendarresources.h>
00027 
00028 #include <kglobalsettings.h>
00029 
00030 #include <qlayout.h>
00031 #include <qvbox.h>
00032 #include <qobjectlist.h>
00033 #include <qheader.h>
00034 
00035 #define FOREACH_VIEW(av) \
00036 for(QValueList<KOAgendaView*>::ConstIterator it = mAgendaViews.constBegin(); \
00037   it != mAgendaViews.constEnd();) \
00038   for(KOAgendaView* av = (it != mAgendaViews.constEnd() ? (*it) : 0); \
00039       it != mAgendaViews.constEnd(); ++it, av = (*it)  )
00040 
00041 using namespace KOrg;
00042 
00043 MultiAgendaView::MultiAgendaView( Calendar * cal, CalendarView *calendarView,
00044                                  QWidget * parent, const char *name ) :
00045     AgendaView( cal, parent, name ),
00046     mSelectedAgendaView( 0 ),
00047     mLastMovedSplitter( 0 ),
00048     mUpdateOnShow( false ),
00049     mPendingChanges( true ),
00050     mCalendarView( calendarView )
00051 {
00052   QBoxLayout *topLevelLayout = new QHBoxLayout( this );
00053 
00054   QFontMetrics fm( font() );
00055   int topLabelHeight = 2 * fm.height() + fm.lineSpacing();
00056 
00057   QVBox *topSideBox = new QVBox( this );
00058   mLeftTopSpacer = new QWidget( topSideBox );
00059   mLeftTopSpacer->setFixedHeight( topLabelHeight );
00060   mLeftSplitter = new QSplitter( Qt::Vertical, topSideBox );
00061   mLeftSplitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
00062   QLabel *label = new QLabel( i18n("All Day"), mLeftSplitter );
00063   label->setAlignment( Qt::AlignRight | Qt::AlignVCenter | Qt::WordBreak );
00064   QVBox *sideBox = new QVBox( mLeftSplitter );
00065   EventIndicator *eiSpacer = new EventIndicator( EventIndicator::Top, sideBox );
00066   eiSpacer->changeColumns( 0 );
00067   mTimeLabels = new TimeLabels( 24, sideBox );
00068   eiSpacer = new EventIndicator( EventIndicator::Bottom, sideBox );
00069   eiSpacer->changeColumns( 0 );
00070   mLeftBottomSpacer = new QWidget( topSideBox );
00071   topLevelLayout->addWidget( topSideBox );
00072 
00073   mScrollView = new QScrollView( this );
00074   mScrollView->setResizePolicy( QScrollView::Manual );
00075   mScrollView->setVScrollBarMode( QScrollView::AlwaysOff );
00076   mScrollView->setFrameShape( QFrame::NoFrame );
00077   topLevelLayout->addWidget( mScrollView, 100 );
00078   mTopBox = new QHBox( mScrollView->viewport() );
00079   mScrollView->addChild( mTopBox );
00080 
00081   topSideBox = new QVBox( this );
00082   mRightTopSpacer = new QWidget( topSideBox );
00083   mRightTopSpacer->setFixedHeight( topLabelHeight );
00084   mRightSplitter = new QSplitter( Qt::Vertical, topSideBox );
00085   mRightSplitter->setOpaqueResize( KGlobalSettings::opaqueResize() );
00086   new QWidget( mRightSplitter );
00087   sideBox = new QVBox( mRightSplitter );
00088   eiSpacer = new EventIndicator( EventIndicator::Top, sideBox );
00089   eiSpacer->setFixedHeight( eiSpacer->minimumHeight() );
00090   eiSpacer->changeColumns( 0 );
00091   mScrollBar = new QScrollBar( Qt::Vertical, sideBox );
00092   eiSpacer = new EventIndicator( EventIndicator::Bottom, sideBox );
00093   eiSpacer->setFixedHeight( eiSpacer->minimumHeight() );
00094   eiSpacer->changeColumns( 0 );
00095   mRightBottomSpacer = new QWidget( topSideBox );
00096   topLevelLayout->addWidget( topSideBox );
00097 
00098   recreateViews();
00099 }
00100 
00101 void MultiAgendaView::recreateViews()
00102 {
00103   if ( !mPendingChanges ) {
00104     return;
00105   }
00106 
00107   mPendingChanges = false;
00108 
00109   deleteViews();
00110 
00111   CalendarResources *calres = dynamic_cast<CalendarResources*>( calendar() );
00112   if ( !calres ) {
00113     // fallback to single-agenda
00114     KOAgendaView* av = new KOAgendaView( calendar(), mCalendarView, mTopBox );
00115     mAgendaViews.append( av );
00116     mAgendaWidgets.append( av );
00117     mSelectedAgendaView = av;
00118     av->show();
00119   } else {
00120     CalendarResourceManager *manager = calres->resourceManager();
00121     for ( CalendarResourceManager::ActiveIterator it = manager->activeBegin(); it != manager->activeEnd(); ++it ) {
00122       if ( (*it)->canHaveSubresources() ) {
00123         QStringList subResources = (*it)->subresources();
00124         for ( QStringList::ConstIterator subit = subResources.constBegin(); subit != subResources.constEnd(); ++subit ) {
00125           QString type = (*it)->subresourceType( *subit );
00126 
00127           if ( !(*it)->subresourceActive( *subit ) || (!type.isEmpty() && type != "event") ) {
00128             continue;
00129           }
00130 
00131           addView( (*it)->labelForSubresource( *subit ), *it, *subit );
00132         }
00133       } else {
00134         addView( (*it)->resourceName(), *it );
00135       }
00136     }
00137   }
00138 
00139   // no resources activated, so stop here to avoid crashing somewhere down the line, TODO: show a nice message instead
00140   if ( mAgendaViews.isEmpty() ) {
00141     return;
00142   }
00143 
00144   setupViews();
00145   QTimer::singleShot( 0, this, SLOT(slotResizeScrollView()) );
00146   mTimeLabels->updateConfig();
00147 
00148   connect( mTimeLabels->verticalScrollBar(), SIGNAL(valueChanged(int)),
00149            mScrollBar, SLOT(setValue(int)) );
00150   connect( mScrollBar, SIGNAL(valueChanged(int)),
00151            mTimeLabels, SLOT(positionChanged(int)) );
00152 
00153   installSplitterEventFilter( mLeftSplitter );
00154   installSplitterEventFilter( mRightSplitter );
00155 
00156   QValueList<int> sizes = KOGlobals::self()->config()->readIntListEntry( "Separator AgendaView" );
00157   if ( sizes.count() != 2 ) {
00158     sizes = mLeftSplitter->sizes();
00159   }
00160   FOREACH_VIEW( agenda ) {
00161     agenda->splitter()->setSizes( sizes );
00162   }
00163   mLeftSplitter->setSizes( sizes );
00164   mRightSplitter->setSizes( sizes );
00165 
00166   QTimer::singleShot( 0, this, SLOT(setupScrollBar()) );
00167 
00168   mTimeLabels->positionChanged();
00169 }
00170 
00171 void MultiAgendaView::deleteViews()
00172 {
00173   for ( QValueList<QWidget*>::ConstIterator it = mAgendaWidgets.constBegin();
00174         it != mAgendaWidgets.constEnd(); ++it ) {
00175     delete *it;
00176   }
00177   mAgendaViews.clear();
00178   mAgendaWidgets.clear();
00179   mLastMovedSplitter = 0;
00180 }
00181 
00182 void MultiAgendaView::setupViews()
00183 {
00184   FOREACH_VIEW( agenda ) {
00185     if ( !agenda->readOnly() ) {
00186       connect( agenda,
00187                SIGNAL(newEventSignal(ResourceCalendar *,const QString &)),
00188                SIGNAL(newEventSignal(ResourceCalendar *,const QString &)) );
00189       connect( agenda,
00190                SIGNAL(newEventSignal(ResourceCalendar *,const QString &,const QDate &)),
00191                SIGNAL(newEventSignal(ResourceCalendar *,const QString &,const QDate &)) );
00192       connect( agenda,
00193                SIGNAL(newEventSignal(ResourceCalendar *,const QString &,const QDateTime &)),
00194                SIGNAL(newEventSignal(ResourceCalendar *,const QString &,const QDateTime &)) );
00195       connect( agenda,
00196                SIGNAL(newEventSignal(ResourceCalendar *,const QString &,const QDateTime &,const QDateTime &)),
00197                SIGNAL(newEventSignal(ResourceCalendar *,const QString &,const QDateTime &,const QDateTime&)) );
00198 
00199       connect( agenda,
00200                SIGNAL(newTodoSignal(ResourceCalendar *,const QString &,const QDate &)),
00201                SIGNAL(newTodoSignal(ResourceCalendar *,const QString &,const QDate &)) );
00202 
00203       connect( agenda,
00204                SIGNAL(editIncidenceSignal(Incidence *,const QDate &)),
00205                SIGNAL(editIncidenceSignal(Incidence *,const QDate &)) );
00206       connect( agenda,
00207                SIGNAL(deleteIncidenceSignal(Incidence *)),
00208                SIGNAL(deleteIncidenceSignal(Incidence *)) );
00209       connect( agenda,
00210                SIGNAL(startMultiModify(const QString &)),
00211                SIGNAL(startMultiModify(const QString &)) );
00212       connect( agenda,
00213                SIGNAL(endMultiModify()),
00214                SIGNAL(endMultiModify()) );
00215 
00216       connect( agenda,
00217                SIGNAL(cutIncidenceSignal(Incidence*)),
00218                SIGNAL(cutIncidenceSignal(Incidence*)) );
00219       connect( agenda,
00220                SIGNAL(pasteIncidenceSignal()),
00221                SIGNAL(pasteIncidenceSignal()) );
00222       connect( agenda,
00223                SIGNAL(toggleAlarmSignal(Incidence*)),
00224                SIGNAL(toggleAlarmSignal(Incidence*)) );
00225       connect( agenda,
00226                SIGNAL(dissociateOccurrenceSignal(Incidence*, const QDate&)),
00227                SIGNAL(dissociateOccurrenceSignal(Incidence*, const QDate&)) );
00228       connect( agenda,
00229                SIGNAL(dissociateFutureOccurrenceSignal(Incidence*, const QDate&)),
00230                SIGNAL(dissociateFutureOccurrenceSignal(Incidence*, const QDate&)) );
00231     }
00232 
00233     connect( agenda,
00234              SIGNAL(copyIncidenceSignal(Incidence*)),
00235              SIGNAL(copyIncidenceSignal(Incidence*)) );
00236     connect( agenda,
00237              SIGNAL(showIncidenceSignal(Incidence *,const QDate &)),
00238              SIGNAL(showIncidenceSignal(Incidence *,const QDate &)) );
00239     connect( agenda,
00240              SIGNAL(incidenceSelected(Incidence *,const QDate &)),
00241              SIGNAL(incidenceSelected(Incidence *,const QDate &)) );
00242     connect( agenda,
00243              SIGNAL(incidenceSelected(Incidence*,const QDate &)),
00244              SLOT(slotSelectionChanged()) );
00245 
00246     connect( agenda,
00247              SIGNAL(timeSpanSelectionChanged()),
00248              SLOT(slotClearTimeSpanSelection()) );
00249 
00250     disconnect( agenda->agenda(),
00251                 SIGNAL(zoomView(const int,const QPoint&,const Qt::Orientation)),
00252                 agenda, 0 );
00253     connect( agenda->agenda(),
00254              SIGNAL(zoomView(const int,const QPoint&,const Qt::Orientation)),
00255              SLOT(zoomView(const int,const QPoint&,const Qt::Orientation)) );
00256   }
00257 
00258   KOAgenda *anAgenda = mAgendaViews.first()->agenda();
00259   connect( anAgenda, SIGNAL(lowerYChanged(int) ), SLOT(resizeSpacers(int)) );
00260 
00261   FOREACH_VIEW( agenda ) {
00262     agenda->readSettings();
00263   }
00264 
00265   int minWidth = 0;
00266   for ( QValueList<QWidget*>::ConstIterator it = mAgendaWidgets.constBegin(); it != mAgendaWidgets.constEnd(); ++it )
00267     minWidth = QMAX( minWidth, (*it)->minimumSizeHint().width() );
00268   for ( QValueList<QWidget*>::ConstIterator it = mAgendaWidgets.constBegin(); it != mAgendaWidgets.constEnd(); ++it )
00269     (*it)->setMinimumWidth( minWidth );
00270 }
00271 
00272 MultiAgendaView::~ MultiAgendaView()
00273 {
00274 }
00275 
00276 Incidence::List MultiAgendaView::selectedIncidences()
00277 {
00278   Incidence::List list;
00279   FOREACH_VIEW(agendaView) {
00280     list += agendaView->selectedIncidences();
00281   }
00282   return list;
00283 }
00284 
00285 DateList MultiAgendaView::selectedIncidenceDates()
00286 {
00287   DateList list;
00288   FOREACH_VIEW(agendaView) {
00289     list += agendaView->selectedIncidenceDates();
00290   }
00291   return list;
00292 }
00293 
00294 int MultiAgendaView::currentDateCount()
00295 {
00296   FOREACH_VIEW( agendaView )
00297     return agendaView->currentDateCount();
00298   return 0;
00299 }
00300 
00301 void MultiAgendaView::showDates(const QDate & start, const QDate & end)
00302 {
00303   mStartDate = start;
00304   mEndDate = end;
00305   recreateViews();
00306   FOREACH_VIEW( agendaView )
00307     agendaView->showDates( start, end );
00308 }
00309 
00310 void MultiAgendaView::showIncidences(const Incidence::List & incidenceList, const QDate &date)
00311 {
00312   FOREACH_VIEW( agendaView )
00313     agendaView->showIncidences( incidenceList, date );
00314 }
00315 
00316 void MultiAgendaView::updateView()
00317 {
00318   recreateViews();
00319   FOREACH_VIEW( agendaView )
00320     agendaView->updateView();
00321 }
00322 
00323 void MultiAgendaView::changeIncidenceDisplay(Incidence * incidence, int mode)
00324 {
00325   FOREACH_VIEW( agendaView )
00326     agendaView->changeIncidenceDisplay( incidence, mode );
00327 }
00328 
00329 int MultiAgendaView::maxDatesHint()
00330 {
00331   FOREACH_VIEW( agendaView )
00332     return agendaView->maxDatesHint();
00333   return 0;
00334 }
00335 
00336 void MultiAgendaView::slotSelectionChanged()
00337 {
00338   FOREACH_VIEW( agenda ) {
00339     if ( agenda != sender() )
00340       agenda->clearSelection();
00341   }
00342 }
00343 
00344 bool MultiAgendaView::eventDurationHint(QDateTime & startDt, QDateTime & endDt, bool & allDay)
00345 {
00346   FOREACH_VIEW( agenda ) {
00347     bool valid = agenda->eventDurationHint( startDt, endDt, allDay );
00348     if ( valid )
00349       return true;
00350   }
00351   return false;
00352 }
00353 
00354 void MultiAgendaView::slotClearTimeSpanSelection()
00355 {
00356   FOREACH_VIEW( agenda ) {
00357     if ( agenda != sender() )
00358       agenda->clearTimeSpanSelection();
00359   }
00360 }
00361 
00362 void MultiAgendaView::setTypeAheadReceiver(QObject * o)
00363 {
00364   FOREACH_VIEW( agenda )
00365     agenda->setTypeAheadReceiver( o );
00366 }
00367 
00368 void MultiAgendaView::finishTypeAhead()
00369 {
00370   FOREACH_VIEW( agenda )
00371     agenda->finishTypeAhead();
00372 }
00373 
00374 void MultiAgendaView::addView( const QString &label, KCal::ResourceCalendar * res, const QString & subRes )
00375 {
00376   bool readOnlyView = false;
00377 
00378   QVBox *box = new QVBox( mTopBox );
00379 
00380   // First, the calendar folder title
00381   QHeader *title = new QHeader( 1, box );
00382   title->setClickEnabled( false );
00383   title->setStretchEnabled( true );
00384   if ( res->readOnly() || !res->subresourceWritable( subRes ) ) {
00385     readOnlyView = true;
00386     title->setLabel( 0, QIconSet( KOGlobals::self()->smallIcon( "readonlyevent" ) ), label );
00387   } else {
00388     QColor resColor;
00389     if ( subRes.isEmpty() ) {
00390       resColor = *KOPrefs::instance()->resourceColor( res->identifier() );
00391     } else {
00392       resColor = *KOPrefs::instance()->resourceColor( subRes );
00393     }
00394     QFontMetrics fm = fontMetrics();
00395     QPixmap px( fm.height(), fm.height() );
00396     px.fill( resColor );
00397     title->setLabel( 0, QIconSet( px, QIconSet::Small ), label );
00398   }
00399 
00400   // Now, the sub agenda view
00401   KOAgendaView* av = new KOAgendaView( calendar(), mCalendarView, box, 0, true );
00402   mSelectedAgendaView = av;
00403   av->setReadOnly( readOnlyView );
00404   av->setResource( res, subRes );
00405   av->setIncidenceChanger( mChanger );
00406   av->agenda()->setVScrollBarMode( QScrollView::AlwaysOff );
00407   mAgendaViews.append( av );
00408   mAgendaWidgets.append( box );
00409   box->show();
00410   mTimeLabels->setAgenda( av->agenda() );
00411 
00412   connect( av->agenda()->verticalScrollBar(), SIGNAL(valueChanged(int)),
00413            mTimeLabels, SLOT(positionChanged(int)) );
00414   connect( mTimeLabels->verticalScrollBar(), SIGNAL(valueChanged(int)),
00415            av, SLOT(setContentsPos(int)) );
00416 
00417   av->installEventFilter( this );
00418   installSplitterEventFilter( av->splitter() );
00419 }
00420 
00421 void MultiAgendaView::resizeEvent(QResizeEvent * ev)
00422 {
00423   resizeScrollView( ev->size() );
00424   AgendaView::resizeEvent( ev );
00425 }
00426 
00427 void MultiAgendaView::resizeScrollView(const QSize & size)
00428 {
00429   const int widgetWidth = size.width() - mTimeLabels->width() - mScrollBar->width();
00430   int width = QMAX( mTopBox->sizeHint().width(), widgetWidth );
00431   int height = size.height();
00432   if ( width > widgetWidth ) {
00433     const int sbHeight = mScrollView->horizontalScrollBar()->height();
00434     height -= sbHeight;
00435     mLeftBottomSpacer->setFixedHeight( sbHeight );
00436     mRightBottomSpacer->setFixedHeight( sbHeight );
00437   } else {
00438     mLeftBottomSpacer->setFixedHeight( 0 );
00439     mRightBottomSpacer->setFixedHeight( 0 );
00440   }
00441   mScrollView->resizeContents( width, height );
00442   mTopBox->resize( width, height );
00443 }
00444 
00445 void MultiAgendaView::setIncidenceChanger(IncidenceChangerBase * changer)
00446 {
00447   AgendaView::setIncidenceChanger( changer );
00448   FOREACH_VIEW( agenda )
00449     agenda->setIncidenceChanger( changer );
00450 }
00451 
00452 void MultiAgendaView::updateConfig()
00453 {
00454   AgendaView::updateConfig();
00455   mTimeLabels->updateConfig();
00456   FOREACH_VIEW( agenda )
00457     agenda->updateConfig();
00458 }
00459 
00460 bool MultiAgendaView::eventFilter(QObject * obj, QEvent * event)
00461 {
00462   if ( obj->className() == QCString("QSplitterHandle") ) {
00463     // KDE4: not needed anymore, QSplitter has a moved signal there
00464     if ( (event->type() == QEvent::MouseMove && KGlobalSettings::opaqueResize())
00465            || event->type() == QEvent::MouseButtonRelease ) {
00466       FOREACH_VIEW( agenda ) {
00467         if ( agenda->splitter() == obj->parent() )
00468           mLastMovedSplitter = agenda->splitter();
00469       }
00470       if ( mLeftSplitter == obj->parent() )
00471         mLastMovedSplitter = mLeftSplitter;
00472       else if ( mRightSplitter == obj->parent() )
00473         mLastMovedSplitter = mRightSplitter;
00474       QTimer::singleShot( 0, this, SLOT(resizeSplitters()) );
00475     }
00476   }
00477 
00478   if ( obj->className() == QCString( "KOAgendaView" ) ) {
00479     if ( event->type() == QEvent::Enter ) {
00480       mSelectedAgendaView = (KOAgendaView *)obj;
00481     }
00482   }
00483 
00484   return AgendaView::eventFilter( obj, event );
00485 }
00486 
00487 void MultiAgendaView::resizeSplitters()
00488 {
00489   if ( !mLastMovedSplitter )
00490     mLastMovedSplitter = mAgendaViews.first()->splitter();
00491   FOREACH_VIEW( agenda ) {
00492     if ( agenda->splitter() == mLastMovedSplitter )
00493       continue;
00494     agenda->splitter()->setSizes( mLastMovedSplitter->sizes() );
00495   }
00496   if ( mLastMovedSplitter != mLeftSplitter )
00497     mLeftSplitter->setSizes( mLastMovedSplitter->sizes() );
00498   if ( mLastMovedSplitter != mRightSplitter )
00499     mRightSplitter->setSizes( mLastMovedSplitter->sizes() );
00500 }
00501 
00502 void MultiAgendaView::resizeSpacers( int newY )
00503 {
00504   // this slot is needed because the Agenda view's day labels frame height
00505   // can change depending if holidays are shown. When this happens, all
00506   // the widgets move down except the timelabels, so we need to change
00507   // the top spacer height accordingly to move the timelabels up/down.
00508   // kolab/issue2656
00509   Q_UNUSED( newY );
00510   QFontMetrics fm( font() );
00511   int topLabelHeight = mAgendaViews.first()->dayLabels()->height() +
00512                        fm.height() + mLeftSplitter->handleWidth();
00513   mLeftTopSpacer->setFixedHeight( topLabelHeight );
00514   mRightTopSpacer->setFixedHeight( topLabelHeight );
00515 }
00516 
00517 void MultiAgendaView::zoomView( const int delta, const QPoint & pos, const Qt::Orientation ori )
00518 {
00519   if ( ori == Qt::Vertical ) {
00520     if ( delta > 0 ) {
00521       if ( KOPrefs::instance()->mHourSize > 4 )
00522         KOPrefs::instance()->mHourSize--;
00523     } else {
00524       KOPrefs::instance()->mHourSize++;
00525     }
00526   }
00527 
00528   FOREACH_VIEW( agenda )
00529     agenda->zoomView( delta, pos, ori );
00530 
00531   mTimeLabels->updateConfig();
00532   mTimeLabels->positionChanged();
00533   mTimeLabels->repaint();
00534 }
00535 
00536 // KDE4: not needed, use existing QSplitter signals instead
00537 void MultiAgendaView::installSplitterEventFilter(QSplitter * splitter)
00538 {
00539   QObjectList *objlist = splitter->queryList( "QSplitterHandle" );
00540   // HACK: when not being visible, the splitter handle is sometimes not found
00541   // for unknown reasons, so trigger an update when we are shown again
00542   if ( objlist->count() == 0 && !isVisible() )
00543     mUpdateOnShow = true;
00544   QObjectListIt it( *objlist );
00545   QObject *obj;
00546   while ( (obj = it.current()) != 0 ) {
00547     obj->removeEventFilter( this );
00548     obj->installEventFilter( this );
00549     ++it;
00550   }
00551   delete objlist;
00552 }
00553 
00554 void MultiAgendaView::slotResizeScrollView()
00555 {
00556   resizeScrollView( size() );
00557 }
00558 
00559 void MultiAgendaView::show()
00560 {
00561   AgendaView::show();
00562   if ( mUpdateOnShow ) {
00563     mUpdateOnShow = false;
00564     mPendingChanges = true; // force a full view recreation
00565     showDates( mStartDate, mEndDate );
00566   }
00567 }
00568 
00569 void MultiAgendaView::resourcesChanged()
00570 {
00571   mPendingChanges = true;
00572   FOREACH_VIEW( agenda )
00573     agenda->resourcesChanged();
00574 }
00575 
00576 void MultiAgendaView::setupScrollBar()
00577 {
00578   if ( !mAgendaViews.isEmpty() && mAgendaViews.first()->agenda() ) {
00579     QScrollBar *scrollBar = mAgendaViews.first()->agenda()->verticalScrollBar();
00580     mScrollBar->setMinValue( scrollBar->minValue() );
00581     mScrollBar->setMaxValue( scrollBar->maxValue() );
00582     mScrollBar->setLineStep( scrollBar->lineStep() );
00583     mScrollBar->setPageStep( scrollBar->pageStep() );
00584     mScrollBar->setValue( scrollBar->value() );
00585   }
00586 }
00587 
00588 #include "multiagendaview.moc"
KDE Home | KDE Accessibility Home | Description of Access Keys