-rw-r--r-- | korganizer/calendarview.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp index 7044e90..f9685e9 100644 --- a/korganizer/calendarview.cpp +++ b/korganizer/calendarview.cpp | |||
@@ -322,97 +322,97 @@ class KOCatPrefs : public QDialog | |||
322 | format->setExclusive ( true ) ; | 322 | format->setExclusive ( true ) ; |
323 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); | 323 | addCatBut = new QRadioButton(i18n("Add to category list"), format ); |
324 | new QRadioButton(i18n("Remove from Events/Todos"), format ); | 324 | new QRadioButton(i18n("Remove from Events/Todos"), format ); |
325 | addCatBut->setChecked( true ); | 325 | addCatBut->setChecked( true ); |
326 | QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); | 326 | QPushButton * ok = new QPushButton( i18n("Change category list now!"), this ); |
327 | lay->addWidget( ok ); | 327 | lay->addWidget( ok ); |
328 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); | 328 | QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); |
329 | lay->addWidget( cancel ); | 329 | lay->addWidget( cancel ); |
330 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); | 330 | connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); |
331 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); | 331 | connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); |
332 | resize( 200, 200 ); | 332 | resize( 200, 200 ); |
333 | } | 333 | } |
334 | 334 | ||
335 | bool addCat() { return addCatBut->isChecked(); } | 335 | bool addCat() { return addCatBut->isChecked(); } |
336 | private: | 336 | private: |
337 | QRadioButton* addCatBut; | 337 | QRadioButton* addCatBut; |
338 | }; | 338 | }; |
339 | 339 | ||
340 | 340 | ||
341 | 341 | ||
342 | CalendarView::CalendarView( CalendarResources *calendar, | 342 | CalendarView::CalendarView( CalendarResources *calendar, |
343 | QWidget *parent, const char *name ) | 343 | QWidget *parent, const char *name ) |
344 | : CalendarViewBase( parent, name ), | 344 | : CalendarViewBase( parent, name ), |
345 | mCalendar( calendar ), | 345 | mCalendar( calendar ), |
346 | mResourceManager( calendar->resourceManager() ) | 346 | mResourceManager( calendar->resourceManager() ) |
347 | { | 347 | { |
348 | 348 | ||
349 | mEventEditor = 0; | 349 | mEventEditor = 0; |
350 | mTodoEditor = 0; | 350 | mTodoEditor = 0; |
351 | 351 | ||
352 | init(); | 352 | init(); |
353 | } | 353 | } |
354 | 354 | ||
355 | CalendarView::CalendarView( Calendar *calendar, | 355 | CalendarView::CalendarView( Calendar *calendar, |
356 | QWidget *parent, const char *name ) | 356 | QWidget *parent, const char *name ) |
357 | : CalendarViewBase( parent, name ), | 357 | : CalendarViewBase( parent, name ), |
358 | mCalendar( calendar ), | 358 | mCalendar( calendar ), |
359 | mResourceManager( 0 ) | 359 | mResourceManager( 0 ) |
360 | { | 360 | { |
361 | 361 | ||
362 | mEventEditor = 0; | 362 | mEventEditor = 0; |
363 | mTodoEditor = 0; | 363 | mTodoEditor = 0; |
364 | init(); | 364 | init(); |
365 | } | 365 | } |
366 | 366 | ||
367 | void CalendarView::init() | 367 | void CalendarView::init() |
368 | { | 368 | { |
369 | mNextAlarmDateTime = QDateTime::currentDateTime(); | 369 | mNextAlarmDateTime = QDateTime::currentDateTime(); |
370 | setFocusPolicy ( NoFocus ); | 370 | //setFocusPolicy ( NoFocus ); |
371 | mViewerCallerIsSearchDialog = false; | 371 | mViewerCallerIsSearchDialog = false; |
372 | mBlockShowDates = false; | 372 | mBlockShowDates = false; |
373 | 373 | ||
374 | mDatePickerMode = 0; | 374 | mDatePickerMode = 0; |
375 | mCurrentSyncDevice = ""; | 375 | mCurrentSyncDevice = ""; |
376 | mViewManager = new KOViewManager( this ); | 376 | mViewManager = new KOViewManager( this ); |
377 | mDialogManager = new KODialogManager( this ); | 377 | mDialogManager = new KODialogManager( this ); |
378 | mEventViewerDialog = 0; | 378 | mEventViewerDialog = 0; |
379 | mModified = false; | 379 | mModified = false; |
380 | mReadOnly = false; | 380 | mReadOnly = false; |
381 | mSelectedIncidence = 0; | 381 | mSelectedIncidence = 0; |
382 | mCalPrinter = 0; | 382 | mCalPrinter = 0; |
383 | mFilters.setAutoDelete(true); | 383 | mFilters.setAutoDelete(true); |
384 | 384 | ||
385 | mCalendar->registerObserver( this ); | 385 | mCalendar->registerObserver( this ); |
386 | // TODO: Make sure that view is updated, when calendar is changed. | 386 | // TODO: Make sure that view is updated, when calendar is changed. |
387 | 387 | ||
388 | mStorage = new FileStorage( mCalendar ); | 388 | mStorage = new FileStorage( mCalendar ); |
389 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); | 389 | mNavigator = new DateNavigator( this, "datevav", mViewManager ); |
390 | 390 | ||
391 | QBoxLayout *topLayout = (QBoxLayout*)layout(); | 391 | QBoxLayout *topLayout = (QBoxLayout*)layout(); |
392 | #ifndef KORG_NOSPLITTER | 392 | #ifndef KORG_NOSPLITTER |
393 | // create the main layout frames. | 393 | // create the main layout frames. |
394 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); | 394 | mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); |
395 | topLayout->addWidget(mPanner); | 395 | topLayout->addWidget(mPanner); |
396 | 396 | ||
397 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, | 397 | mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, |
398 | "CalendarView::LeftFrame"); | 398 | "CalendarView::LeftFrame"); |
399 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); | 399 | mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); |
400 | 400 | ||
401 | mDateNavigator = new DateNavigatorContainer( mLeftSplitter, | 401 | mDateNavigator = new DateNavigatorContainer( mLeftSplitter, |
402 | "CalendarView::DateNavigator" ); | 402 | "CalendarView::DateNavigator" ); |
403 | 403 | ||
404 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); | 404 | mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); |
405 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); | 405 | mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); |
406 | mTodoList->setNavigator( mNavigator ); | 406 | mTodoList->setNavigator( mNavigator ); |
407 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); | 407 | mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); |
408 | 408 | ||
409 | #ifdef KORG_NORESOURCEVIEW | 409 | #ifdef KORG_NORESOURCEVIEW |
410 | mResourceView = 0; | 410 | mResourceView = 0; |
411 | #else | 411 | #else |
412 | if ( mResourceManager ) { | 412 | if ( mResourceManager ) { |
413 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); | 413 | mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); |
414 | mResourceView->updateView(); | 414 | mResourceView->updateView(); |
415 | connect( mResourceView, SIGNAL( resourcesChanged() ), | 415 | connect( mResourceView, SIGNAL( resourcesChanged() ), |
416 | SLOT( updateView() ) ); | 416 | SLOT( updateView() ) ); |
417 | } else { | 417 | } else { |
418 | mResourceView = 0; | 418 | mResourceView = 0; |
@@ -4642,98 +4642,98 @@ bool CalendarView::removeCompletedSubTodos( Todo* t ) | |||
4642 | subTodos = t->relations(); | 4642 | subTodos = t->relations(); |
4643 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { | 4643 | for (aTodo = subTodos.first(); aTodo; aTodo = subTodos.next()) { |
4644 | if (! removeCompletedSubTodos( (Todo*) aTodo )) | 4644 | if (! removeCompletedSubTodos( (Todo*) aTodo )) |
4645 | deleteTodo = false; | 4645 | deleteTodo = false; |
4646 | } | 4646 | } |
4647 | if ( deleteTodo ) { | 4647 | if ( deleteTodo ) { |
4648 | if ( t->isCompleted() && !t->doesRecur()) { | 4648 | if ( t->isCompleted() && !t->doesRecur()) { |
4649 | checkExternalId( t ); | 4649 | checkExternalId( t ); |
4650 | mCalendar->deleteTodo( t ); | 4650 | mCalendar->deleteTodo( t ); |
4651 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); | 4651 | changeTodoDisplay( t,KOGlobals::EVENTDELETED ); |
4652 | } | 4652 | } |
4653 | else | 4653 | else |
4654 | deleteTodo = false; | 4654 | deleteTodo = false; |
4655 | } | 4655 | } |
4656 | return deleteTodo; | 4656 | return deleteTodo; |
4657 | 4657 | ||
4658 | } | 4658 | } |
4659 | void CalendarView::purgeCompleted() | 4659 | void CalendarView::purgeCompleted() |
4660 | { | 4660 | { |
4661 | int result = KMessageBox::warningContinueCancel(this, | 4661 | int result = KMessageBox::warningContinueCancel(this, |
4662 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); | 4662 | i18n("Delete all completed todos?\n(Completed recurring todos\nwill not be deleted!)"),i18n("Purge Todos"),i18n("Purge")); |
4663 | 4663 | ||
4664 | if (result == KMessageBox::Continue) { | 4664 | if (result == KMessageBox::Continue) { |
4665 | 4665 | ||
4666 | QPtrList<Todo> todoCal; | 4666 | QPtrList<Todo> todoCal; |
4667 | QPtrList<Todo> rootTodos; | 4667 | QPtrList<Todo> rootTodos; |
4668 | //QPtrList<Incidence> rel; | 4668 | //QPtrList<Incidence> rel; |
4669 | Todo *aTodo; | 4669 | Todo *aTodo; |
4670 | todoCal = calendar()->todos(); | 4670 | todoCal = calendar()->todos(); |
4671 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { | 4671 | for (aTodo = todoCal.first(); aTodo; aTodo = todoCal.next()) { |
4672 | if ( !aTodo->relatedTo() ) | 4672 | if ( !aTodo->relatedTo() ) |
4673 | rootTodos.append( aTodo ); | 4673 | rootTodos.append( aTodo ); |
4674 | } | 4674 | } |
4675 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { | 4675 | for (aTodo = rootTodos.first(); aTodo; aTodo = rootTodos.next()) { |
4676 | removeCompletedSubTodos( aTodo ); | 4676 | removeCompletedSubTodos( aTodo ); |
4677 | } | 4677 | } |
4678 | 4678 | ||
4679 | updateView(); | 4679 | updateView(); |
4680 | } | 4680 | } |
4681 | } | 4681 | } |
4682 | 4682 | ||
4683 | void CalendarView::slotCalendarChanged() | 4683 | void CalendarView::slotCalendarChanged() |
4684 | { | 4684 | { |
4685 | ; | 4685 | ; |
4686 | } | 4686 | } |
4687 | 4687 | ||
4688 | void CalendarView::keyPressEvent ( QKeyEvent *e) | 4688 | void CalendarView::keyPressEvent ( QKeyEvent *e) |
4689 | { | 4689 | { |
4690 | //qDebug(" alendarView::keyPressEvent "); | 4690 | //qDebug("CalendarView::keyPressEvent "); |
4691 | e->ignore(); | 4691 | e->ignore(); |
4692 | } | 4692 | } |
4693 | 4693 | ||
4694 | 4694 | ||
4695 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) | 4695 | bool CalendarView::sync(KSyncManager* manager, QString filename, int mode) |
4696 | { | 4696 | { |
4697 | 4697 | ||
4698 | if ( manager != mSyncManager) | 4698 | if ( manager != mSyncManager) |
4699 | qDebug("KO: Internal error-1. SyncManager mismatch "); | 4699 | qDebug("KO: Internal error-1. SyncManager mismatch "); |
4700 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { | 4700 | if ( filename == QDir::homeDirPath ()+"/.kdecalendardump.ics" ) { |
4701 | qDebug("KO: SyncKDE request detected!"); | 4701 | qDebug("KO: SyncKDE request detected!"); |
4702 | } | 4702 | } |
4703 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4703 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4704 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4704 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4705 | return syncCalendar( filename, mode ); | 4705 | return syncCalendar( filename, mode ); |
4706 | } | 4706 | } |
4707 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) | 4707 | bool CalendarView::syncExternal(KSyncManager* manager, QString resource) |
4708 | { | 4708 | { |
4709 | //mSyncManager = manager; | 4709 | //mSyncManager = manager; |
4710 | if ( manager != mSyncManager) | 4710 | if ( manager != mSyncManager) |
4711 | qDebug("KO: Internal error-2. SyncManager mismatch "); | 4711 | qDebug("KO: Internal error-2. SyncManager mismatch "); |
4712 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); | 4712 | mCurrentSyncDevice = mSyncManager->getCurrentSyncDevice(); |
4713 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); | 4713 | mCurrentSyncName = mSyncManager->getCurrentSyncName(); |
4714 | if ( resource == "sharp" ) | 4714 | if ( resource == "sharp" ) |
4715 | syncExternal( 0 ); | 4715 | syncExternal( 0 ); |
4716 | if ( resource == "phone" ) | 4716 | if ( resource == "phone" ) |
4717 | syncExternal( 1 ); | 4717 | syncExternal( 1 ); |
4718 | // pending setmodified | 4718 | // pending setmodified |
4719 | return true; | 4719 | return true; |
4720 | } | 4720 | } |
4721 | void CalendarView::setSyncManager(KSyncManager* manager) | 4721 | void CalendarView::setSyncManager(KSyncManager* manager) |
4722 | { | 4722 | { |
4723 | mSyncManager = manager; | 4723 | mSyncManager = manager; |
4724 | } | 4724 | } |
4725 | 4725 | ||
4726 | void CalendarView::removeSyncInfo( QString syncProfile) | 4726 | void CalendarView::removeSyncInfo( QString syncProfile) |
4727 | { | 4727 | { |
4728 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); | 4728 | qDebug("KO: removeSyncInfo for profile %s ", syncProfile.latin1()); |
4729 | mCalendar->removeSyncInfo( syncProfile ); | 4729 | mCalendar->removeSyncInfo( syncProfile ); |
4730 | 4730 | ||
4731 | } | 4731 | } |
4732 | 4732 | ||
4733 | void CalendarView::undo_delete() | 4733 | void CalendarView::undo_delete() |
4734 | { | 4734 | { |
4735 | //qDebug("undo_delete() "); | 4735 | //qDebug("undo_delete() "); |
4736 | Incidence* undo = mCalendar->undoIncidence(); | 4736 | Incidence* undo = mCalendar->undoIncidence(); |
4737 | if ( !undo ) { | 4737 | if ( !undo ) { |
4738 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), | 4738 | KMessageBox::sorry(this,i18n("There is nothing to undo!"), |
4739 | i18n("KO/Pi")); | 4739 | i18n("KO/Pi")); |