author | zautrix <zautrix> | 2005-02-07 13:03:38 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-07 13:03:38 (UTC) |
commit | 7de846e9f01ce27b622541493e6a02e26e37bf2c (patch) (unidiff) | |
tree | df59c7803b1e171b08d3c387f49b1239d1adc3b5 /korganizer/calendarview.cpp | |
parent | afc19166fcdc09d3d5b757a84abfeb0b2746f35f (diff) | |
download | kdepimpi-7de846e9f01ce27b622541493e6a02e26e37bf2c.zip kdepimpi-7de846e9f01ce27b622541493e6a02e26e37bf2c.tar.gz kdepimpi-7de846e9f01ce27b622541493e6a02e26e37bf2c.tar.bz2 |
fixxxx
-rw-r--r-- | korganizer/calendarview.cpp | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 77de94f..0fbaa9a 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -264,147 +264,128 @@ void CalendarView::init() | |||
264 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); | 264 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); |
265 | 265 | ||
266 | mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, | 266 | mDateNavigator = new KDateNavigator(mLeftSplitter, mCalendar, TRUE, |
267 | "CalendarView::DateNavigator", QDate::currentDate() ); | 267 | "CalendarView::DateNavigator", QDate::currentDate() ); |
268 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); | 268 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); |
269 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); | 269 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); |
270 | mTodoList->setNavigator( mNavigator ); | 270 | mTodoList->setNavigator( mNavigator ); |
271 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 271 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
272 | 272 | ||
273 | #ifdef KORG_NORESOURCEVIEW | 273 | #ifdef KORG_NORESOURCEVIEW |
274 | mResourceView = 0; | 274 | mResourceView = 0; |
275 | #else | 275 | #else |
276 | if ( mResourceManager ) { | 276 | if ( mResourceManager ) { |
277 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 277 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
278 | mResourceView->updateView(); | 278 | mResourceView->updateView(); |
279 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 279 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
280 | SLOT( updateView() ) ); | 280 | SLOT( updateView() ) ); |
281 | } else { | 281 | } else { |
282 | mResourceView = 0; | 282 | mResourceView = 0; |
283 | } | 283 | } |
284 | #endif | 284 | #endif |
285 | QWidget *rightBox = new QWidget( mPanner ); | 285 | QWidget *rightBox = new QWidget( mPanner ); |
286 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 286 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
287 | 287 | ||
288 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | ||
289 | rightLayout->addWidget( mNavigatorBar ); | ||
290 | |||
291 | mRightFrame = new QWidgetStack( rightBox ); | 288 | mRightFrame = new QWidgetStack( rightBox ); |
292 | rightLayout->addWidget( mRightFrame, 1 ); | 289 | rightLayout->addWidget( mRightFrame, 1 ); |
293 | 290 | ||
294 | mLeftFrame = mLeftSplitter; | 291 | mLeftFrame = mLeftSplitter; |
295 | #else | 292 | #else |
296 | QWidget *mainBox = new QWidget( this ); | 293 | QWidget *mainBox = new QWidget( this ); |
297 | QWidget *leftFrame = new QWidget( mainBox ); | 294 | QWidget *leftFrame = new QWidget( mainBox ); |
298 | 295 | ||
299 | QBoxLayout * mainBoxLayout; | 296 | QBoxLayout * mainBoxLayout; |
300 | QBoxLayout * leftFrameLayout; | 297 | QBoxLayout * leftFrameLayout; |
301 | if ( KOPrefs::instance()->mVerticalScreen ) { | 298 | if ( KOPrefs::instance()->mVerticalScreen ) { |
302 | mainBoxLayout = new QVBoxLayout(mainBox); | 299 | mainBoxLayout = new QVBoxLayout(mainBox); |
303 | leftFrameLayout = new QHBoxLayout(leftFrame ); | 300 | leftFrameLayout = new QHBoxLayout(leftFrame ); |
304 | } else { | 301 | } else { |
305 | mainBoxLayout = new QHBoxLayout(mainBox); | 302 | mainBoxLayout = new QHBoxLayout(mainBox); |
306 | leftFrameLayout = new QVBoxLayout(leftFrame ); | 303 | leftFrameLayout = new QVBoxLayout(leftFrame ); |
307 | } | 304 | } |
308 | topLayout->addWidget( mainBox ); | 305 | topLayout->addWidget( mainBox ); |
309 | mainBoxLayout->addWidget (leftFrame); | 306 | mainBoxLayout->addWidget (leftFrame); |
310 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, | 307 | mDateNavigator = new KDateNavigator(leftFrame, mCalendar, TRUE, |
311 | "CalendarView::DateNavigator", QDate::currentDate()); | 308 | "CalendarView::DateNavigator", QDate::currentDate()); |
312 | // mDateNavigator->blockSignals( true ); | 309 | // mDateNavigator->blockSignals( true ); |
313 | leftFrameLayout->addWidget( mDateNavigator ); | 310 | leftFrameLayout->addWidget( mDateNavigator ); |
314 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); | 311 | mFilterView = new KOFilterView(&mFilters,leftFrame,"CalendarView::FilterView"); |
315 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); | 312 | mTodoList = new KOTodoView(mCalendar, leftFrame, "todolistsmall"); |
316 | mTodoList->setNavigator( mNavigator ); | 313 | mTodoList->setNavigator( mNavigator ); |
317 | 314 | ||
318 | if ( QApplication::desktop()->width() < 480 ) { | 315 | if ( QApplication::desktop()->width() < 480 ) { |
319 | leftFrameLayout->addWidget(mFilterView); | 316 | leftFrameLayout->addWidget(mFilterView); |
320 | leftFrameLayout->addWidget(mTodoList, 2 ); | 317 | leftFrameLayout->addWidget(mTodoList, 2 ); |
321 | 318 | ||
322 | } else { | 319 | } else { |
323 | leftFrameLayout->addWidget(mTodoList,2 ); | 320 | leftFrameLayout->addWidget(mTodoList,2 ); |
324 | leftFrameLayout->addWidget(mFilterView ); | 321 | leftFrameLayout->addWidget(mFilterView ); |
325 | } | 322 | } |
326 | mFilterView->hide(); | 323 | mFilterView->hide(); |
327 | QWidget *rightBox = new QWidget( mainBox ); | 324 | QWidget *rightBox = new QWidget( mainBox ); |
328 | mainBoxLayout->addWidget ( rightBox, 10 ); | 325 | mainBoxLayout->addWidget ( rightBox, 10 ); |
329 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); | 326 | QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); |
330 | mNavigatorBar = new NavigatorBar( QDate::currentDate(), rightBox, "useBigPixmaps" ); | ||
331 | mRightFrame = new QWidgetStack( rightBox ); | 327 | mRightFrame = new QWidgetStack( rightBox ); |
332 | rightLayout->addWidget( mNavigatorBar ); | ||
333 | rightLayout->addWidget( mRightFrame, 10 ); | 328 | rightLayout->addWidget( mRightFrame, 10 ); |
334 | 329 | ||
335 | mLeftFrame = leftFrame; | 330 | mLeftFrame = leftFrame; |
336 | if ( KOPrefs::instance()->mVerticalScreen ) { | 331 | if ( KOPrefs::instance()->mVerticalScreen ) { |
337 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); | 332 | mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); |
338 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); | 333 | leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); |
339 | } else { | 334 | } else { |
340 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); | 335 | mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); |
341 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); | 336 | leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); |
342 | } | 337 | } |
343 | if ( !KOPrefs::instance()->mShowDateNavigator) | 338 | if ( !KOPrefs::instance()->mShowDateNavigator) |
344 | mDateNavigator->hide(); | 339 | mDateNavigator->hide(); |
345 | //qDebug("Calendarview Size %d %d ", width(), height()); | 340 | //qDebug("Calendarview Size %d %d ", width(), height()); |
346 | #endif | 341 | #endif |
347 | 342 | ||
348 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 343 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
349 | SLOT( showDates( const KCal::DateList & ) ) ); | 344 | SLOT( showDates( const KCal::DateList & ) ) ); |
350 | 345 | ||
351 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 346 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
352 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 347 | mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
353 | connect( mNavigatorBar, SIGNAL( goPrevYear() ), | 348 | |
354 | mNavigator, SLOT( selectPreviousYear() ) ); | ||
355 | connect( mNavigatorBar, SIGNAL( goNextYear() ), | ||
356 | mNavigator, SLOT( selectNextYear() ) ); | ||
357 | connect( mNavigatorBar, SIGNAL( goPrevMonth() ), | ||
358 | mNavigator, SLOT( selectPreviousMonth() ) ); | ||
359 | connect( mNavigatorBar, SIGNAL( goNextMonth() ), | ||
360 | mNavigator, SLOT( selectNextMonth() ) ); | ||
361 | connect( mNavigatorBar, SIGNAL( selectWeek( int ) ), | ||
362 | mNavigator, SLOT( selectWeek( int ) ) ); | ||
363 | |||
364 | connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | ||
365 | mNavigatorBar, SLOT( selectDates( const KCal::DateList & ) ) ); | ||
366 | 349 | ||
367 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), | 350 | connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), |
368 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); | 351 | mNavigator, SLOT( selectWeek( const QDate & ) ) ); |
369 | 352 | ||
370 | connect( mDateNavigator, SIGNAL( goPrevYear() ), | 353 | connect( mDateNavigator, SIGNAL( goPrevYear() ), |
371 | mNavigator, SLOT( selectPreviousYear() ) ); | 354 | mNavigator, SLOT( selectPreviousYear() ) ); |
372 | connect( mDateNavigator, SIGNAL( goNextYear() ), | 355 | connect( mDateNavigator, SIGNAL( goNextYear() ), |
373 | mNavigator, SLOT( selectNextYear() ) ); | 356 | mNavigator, SLOT( selectNextYear() ) ); |
374 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), | 357 | connect( mDateNavigator, SIGNAL( goPrevMonth() ), |
375 | mNavigator, SLOT( selectPreviousMonth() ) ); | 358 | mNavigator, SLOT( selectPreviousMonth() ) ); |
376 | connect( mDateNavigator, SIGNAL( goNextMonth() ), | 359 | connect( mDateNavigator, SIGNAL( goNextMonth() ), |
377 | mNavigator, SLOT( selectNextMonth() ) ); | 360 | mNavigator, SLOT( selectNextMonth() ) ); |
378 | 361 | ||
379 | connect( mDateNavigator, SIGNAL( goPrevious() ), | 362 | connect( mDateNavigator, SIGNAL( goPrevious() ), |
380 | mNavigator, SLOT( selectPrevious() ) ); | 363 | mNavigator, SLOT( selectPrevious() ) ); |
381 | connect( mDateNavigator, SIGNAL( goNext() ), | 364 | connect( mDateNavigator, SIGNAL( goNext() ), |
382 | mNavigator, SLOT( selectNext() ) ); | 365 | mNavigator, SLOT( selectNext() ) ); |
383 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), | 366 | connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), |
384 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | 367 | mNavigator, SLOT( slotMonthSelect( int ) ) ); |
385 | connect( mNavigatorBar, SIGNAL( monthSelected ( int ) ), | ||
386 | mNavigator, SLOT( slotMonthSelect( int ) ) ); | ||
387 | 368 | ||
388 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), | 369 | connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), |
389 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); | 370 | mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); |
390 | 371 | ||
391 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), | 372 | connect( mDateNavigator, SIGNAL( eventDropped( Event * ) ), |
392 | SLOT( eventAdded( Event *) ) ); | 373 | SLOT( eventAdded( Event *) ) ); |
393 | 374 | ||
394 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); | 375 | connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); |
395 | 376 | ||
396 | connect( this, SIGNAL( configChanged() ), | 377 | connect( this, SIGNAL( configChanged() ), |
397 | mDateNavigator, SLOT( updateConfig() ) ); | 378 | mDateNavigator, SLOT( updateConfig() ) ); |
398 | 379 | ||
399 | connect( mTodoList, SIGNAL( newTodoSignal() ), | 380 | connect( mTodoList, SIGNAL( newTodoSignal() ), |
400 | SLOT( newTodo() ) ); | 381 | SLOT( newTodo() ) ); |
401 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), | 382 | connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), |
402 | SLOT( newSubTodo( Todo * ) ) ); | 383 | SLOT( newSubTodo( Todo * ) ) ); |
403 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), | 384 | connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), |
404 | SLOT( editTodo( Todo * ) ) ); | 385 | SLOT( editTodo( Todo * ) ) ); |
405 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), | 386 | connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), |
406 | SLOT( showTodo( Todo *) ) ); | 387 | SLOT( showTodo( Todo *) ) ); |
407 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), | 388 | connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), |
408 | SLOT( deleteTodo( Todo *) ) ); | 389 | SLOT( deleteTodo( Todo *) ) ); |
409 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); | 390 | connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); |
410 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), | 391 | connect( mTodoList, SIGNAL( purgeCompletedSignal() ), |
@@ -3847,60 +3828,48 @@ void CalendarView::purgeCompleted() | |||
3847 | QPtrList<Todo> rootTodos; | 3828 | QPtrList<Todo> rootTodos; |
3848 | //QPtrList<Incidence> rel; | 3829 | //QPtrList<Incidence> rel; |
3849 | Todo *aTodo;//, *rTodo; | 3830 | Todo *aTodo;//, *rTodo; |
3850 | Incidence *rIncidence; | 3831 | Incidence *rIncidence; |
3851 | bool childDelete = false; | 3832 | bool childDelete = false; |
3852 | bool deletedOne = true; | 3833 | bool deletedOne = true; |
3853 | todoCal = calendar()->todos(); | 3834 | todoCal = calendar()->todos(); |
3854 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 3835 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
3855 | if ( !aTodo->relatedTo() ) | 3836 | if ( !aTodo->relatedTo() ) |
3856 | rootTodos.append( aTodo ); | 3837 | rootTodos.append( aTodo ); |
3857 | } | 3838 | } |
3858 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 3839 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
3859 | removeCompletedSubTodos( aTodo ); | 3840 | removeCompletedSubTodos( aTodo ); |
3860 | } | 3841 | } |
3861 | 3842 | ||
3862 | updateView(); | 3843 | updateView(); |
3863 | } | 3844 | } |
3864 | } | 3845 | } |
3865 | 3846 | ||
3866 | void CalendarView::slotCalendarChanged() | 3847 | void CalendarView::slotCalendarChanged() |
3867 | { | 3848 | { |
3868 | ; | 3849 | ; |
3869 | } | 3850 | } |
3870 | 3851 | ||
3871 | NavigatorBar *CalendarView::navigatorBar() | ||
3872 | { | ||
3873 | return mNavigatorBar; | ||
3874 | } | ||
3875 | void CalendarView::showNavigatorBar( bool b) | ||
3876 | { | ||
3877 | if ( b ) mNavigatorBar->show(); | ||
3878 | else mNavigatorBar->hide(); | ||
3879 | } | ||
3880 | |||
3881 | |||
3882 | |||
3883 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 3852 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
3884 | { | 3853 | { |
3885 | //qDebug(" alendarView::keyPressEvent "); | 3854 | //qDebug(" alendarView::keyPressEvent "); |
3886 | e->ignore(); | 3855 | e->ignore(); |
3887 | } | 3856 | } |
3888 | 3857 | ||
3889 | 3858 | ||
3890 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 3859 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
3891 | { | 3860 | { |
3892 | // mSyncManager = manager; | 3861 | // mSyncManager = manager; |
3893 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 3862 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
3894 | qDebug("KO: SyncKDE request detected!"); | 3863 | qDebug("KO: SyncKDE request detected!"); |
3895 | } | 3864 | } |
3896 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3865 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3897 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 3866 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
3898 | return syncCalendar( filename, mode ); | 3867 | return syncCalendar( filename, mode ); |
3899 | } | 3868 | } |
3900 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 3869 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
3901 | { | 3870 | { |
3902 | //mSyncManager = manager; | 3871 | //mSyncManager = manager; |
3903 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 3872 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
3904 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 3873 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
3905 | if ( resource == "sharp" ) | 3874 | if ( resource == "sharp" ) |
3906 | syncExternal( 0 ); | 3875 | syncExternal( 0 ); |