summaryrefslogtreecommitdiffabout
path: root/korganizer
Unidiff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp9
-rw-r--r--korganizer/calendarview.h1
-rw-r--r--korganizer/kofilterview.cpp4
3 files changed, 11 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 5c88abd..6746de2 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -423,97 +423,97 @@ void CalendarView::init()
423 mRightFrame = new QWidgetStack( rightBox ); 423 mRightFrame = new QWidgetStack( rightBox );
424 rightLayout->addWidget( mRightFrame, 1 ); 424 rightLayout->addWidget( mRightFrame, 1 );
425 425
426 mLeftFrame = mLeftSplitter; 426 mLeftFrame = mLeftSplitter;
427#else 427#else
428 //QWidget *mainBox = new QWidget( this ); 428 //QWidget *mainBox = new QWidget( this );
429 //QWidget *leftFrame = new QWidget( mainBox ); 429 //QWidget *leftFrame = new QWidget( mainBox );
430 //QBoxLayout * mainBoxLayout; 430 //QBoxLayout * mainBoxLayout;
431 if ( KOPrefs::instance()->mVerticalScreen ) { 431 if ( KOPrefs::instance()->mVerticalScreen ) {
432 //mainBoxLayout = new QVBoxLayout(mainBox); 432 //mainBoxLayout = new QVBoxLayout(mainBox);
433 //leftFrameLayout = new QHBoxLayout(leftFrame ); 433 //leftFrameLayout = new QHBoxLayout(leftFrame );
434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this ); 434 mMainFrame = new KDGanttMinimizeSplitter( Qt::Vertical, this );
435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 435 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 436 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 437 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
438 } else { 438 } else {
439 //mainBoxLayout = new QHBoxLayout(mainBox); 439 //mainBoxLayout = new QHBoxLayout(mainBox);
440 //leftFrameLayout = new QVBoxLayout(leftFrame ); 440 //leftFrameLayout = new QVBoxLayout(leftFrame );
441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 441 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 442 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 443 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 444 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
445 } 445 }
446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 446 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
447 //QBoxLayout * leftFrameLayout; 447 //QBoxLayout * leftFrameLayout;
448 topLayout->addWidget( mMainFrame ); 448 topLayout->addWidget( mMainFrame );
449#ifdef DESKTOP_VERSION 449#ifdef DESKTOP_VERSION
450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); 450 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
451 topLayout->addWidget( mDateScrollBar ); 451 topLayout->addWidget( mDateScrollBar );
452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 452 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
453 if ( QApplication::desktop()->width() < 800 ) 453 if ( QApplication::desktop()->width() < 800 )
454 mDateScrollBar->hide(); 454 mDateScrollBar->hide();
455#endif 455#endif
456 //mainBoxLayout->addWidget (mLeftFrame); 456 //mainBoxLayout->addWidget (mLeftFrame);
457 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 457 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
458 "CalendarView::DateNavigator" ); 458 "CalendarView::DateNavigator" );
459#if 0 459#if 0
460 // FIXME 460 // FIXME
461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 461 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
462 "CalendarView::DateNavigator", QDate::currentDate()); 462 "CalendarView::DateNavigator", QDate::currentDate());
463#endif 463#endif
464 // mDateNavigator->blockSignals( true ); 464 // mDateNavigator->blockSignals( true );
465 //leftFrameLayout->addWidget( mDateNavigator ); 465 //leftFrameLayout->addWidget( mDateNavigator );
466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 466 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 467 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 468 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 469 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 470 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); 471 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),this, SLOT( setCalReadOnly(int,bool)) );
472 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 472 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 473 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
474 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 474 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
475 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 475 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
476 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 476 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
477 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() )); 477 connect( mCalEditView, SIGNAL( checkCalendar() ),this, SLOT( checkFiles() ));
478 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 478 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
479 479
480 mTodoList->setNavigator( mNavigator ); 480 mTodoList->setNavigator( mNavigator );
481#if 0 481#if 0
482 if ( QApplication::desktop()->width() < 480 ) { 482 if ( QApplication::desktop()->width() < 480 ) {
483 leftFrameLayout->addWidget(mFilterView); 483 leftFrameLayout->addWidget(mFilterView);
484 leftFrameLayout->addWidget(mTodoList, 2 ); 484 leftFrameLayout->addWidget(mTodoList, 2 );
485 485
486 } else { 486 } else {
487 leftFrameLayout->addWidget(mTodoList,2 ); 487 leftFrameLayout->addWidget(mTodoList,2 );
488 leftFrameLayout->addWidget(mFilterView ); 488 leftFrameLayout->addWidget(mFilterView );
489 } 489 }
490#endif 490#endif
491 mFilterView->hide(); 491 mFilterView->hide();
492 mCalEditView->hide(); 492 mCalEditView->hide();
493 QWidget *rightBox = new QWidget( mMainFrame ); 493 QWidget *rightBox = new QWidget( mMainFrame );
494 //mainBoxLayout->addWidget ( rightBox, 10 ); 494 //mainBoxLayout->addWidget ( rightBox, 10 );
495 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 495 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
496 mRightFrame = new QWidgetStack( rightBox ); 496 mRightFrame = new QWidgetStack( rightBox );
497 rightLayout->addWidget( mRightFrame, 10 ); 497 rightLayout->addWidget( mRightFrame, 10 );
498 498
499 //mLeftFrame = (QWidget *)leftFrame; 499 //mLeftFrame = (QWidget *)leftFrame;
500 if ( KOPrefs::instance()->mVerticalScreen ) { 500 if ( KOPrefs::instance()->mVerticalScreen ) {
501 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 501 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
502 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 502 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
503 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 503 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
504 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 504 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
505 } else { 505 } else {
506 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 506 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
507 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 507 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
508 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 508 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
509 } 509 }
510 if ( !KOPrefs::instance()->mShowDateNavigator) 510 if ( !KOPrefs::instance()->mShowDateNavigator)
511 mDateNavigator->hide(); 511 mDateNavigator->hide();
512 //qDebug("Calendarview Size %d %d ", width(), height()); 512 //qDebug("Calendarview Size %d %d ", width(), height());
513#endif 513#endif
514 514
515 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 515 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
516 SLOT( showDates( const KCal::DateList & ) ) ); 516 SLOT( showDates( const KCal::DateList & ) ) );
517 517
518 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 518 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
519 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 519 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
@@ -609,96 +609,103 @@ void CalendarView::init()
609 609
610 mDateFrame = new QVBox(0,0,WType_Popup); 610 mDateFrame = new QVBox(0,0,WType_Popup);
611 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 611 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
612 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 612 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
613 mDateFrame->setLineWidth(3); 613 mDateFrame->setLineWidth(3);
614 mDateFrame->hide(); 614 mDateFrame->hide();
615 mDateFrame->setCaption( i18n( "Pick a date to display")); 615 mDateFrame->setCaption( i18n( "Pick a date to display"));
616 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 616 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
617 617
618 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 618 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
619 619
620 mEventEditor = mDialogManager->getEventEditor(); 620 mEventEditor = mDialogManager->getEventEditor();
621 mTodoEditor = mDialogManager->getTodoEditor(); 621 mTodoEditor = mDialogManager->getTodoEditor();
622 622
623 mFlagEditDescription = false; 623 mFlagEditDescription = false;
624 624
625 mSuspendTimer = new QTimer( this ); 625 mSuspendTimer = new QTimer( this );
626 mAlarmTimer = new QTimer( this ); 626 mAlarmTimer = new QTimer( this );
627 mRecheckAlarmTimer = new QTimer( this ); 627 mRecheckAlarmTimer = new QTimer( this );
628 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 628 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 629 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 630 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
631 mAlarmDialog = new AlarmDialog( this ); 631 mAlarmDialog = new AlarmDialog( this );
632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 632 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
633 mAlarmDialog->setServerNotification( false ); 633 mAlarmDialog->setServerNotification( false );
634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 634 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
635 635
636 636
637#ifndef DESKTOP_VERSION 637#ifndef DESKTOP_VERSION
638//US listen for arriving address resultsets 638//US listen for arriving address resultsets
639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 639 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 640 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
641#endif 641#endif
642 mDateNavigator->setCalendar( mCalendar ); 642 mDateNavigator->setCalendar( mCalendar );
643} 643}
644 644
645 645
646CalendarView::~CalendarView() 646CalendarView::~CalendarView()
647{ 647{
648 // kdDebug() << "~CalendarView()" << endl; 648 // kdDebug() << "~CalendarView()" << endl;
649 //qDebug("CalendarView::~CalendarView() "); 649 //qDebug("CalendarView::~CalendarView() ");
650 delete mDialogManager; 650 delete mDialogManager;
651 delete mViewManager; 651 delete mViewManager;
652 delete mStorage; 652 delete mStorage;
653 delete mDateFrame ; 653 delete mDateFrame ;
654 delete mEventViewerDialog; 654 delete mEventViewerDialog;
655 //kdDebug() << "~CalendarView() done" << endl; 655 //kdDebug() << "~CalendarView() done" << endl;
656} 656}
657void CalendarView::setCalReadOnly( int id, bool readO )
658{
659 if ( readO ) {
660 emit save();
661 }
662 mCalendar->setReadOnly( id, readO );
663}
657void CalendarView::setScrollBarStep(int val ) 664void CalendarView::setScrollBarStep(int val )
658{ 665{
659#ifdef DESKTOP_VERSION 666#ifdef DESKTOP_VERSION
660 mDateScrollBar->setLineStep ( val ); 667 mDateScrollBar->setLineStep ( val );
661#endif 668#endif
662} 669}
663void CalendarView::scrollBarValue(int val ) 670void CalendarView::scrollBarValue(int val )
664{ 671{
665#ifdef DESKTOP_VERSION 672#ifdef DESKTOP_VERSION
666 if ( QApplication::desktop()->width() < 800 ) return; 673 if ( QApplication::desktop()->width() < 800 ) return;
667 static bool block = false; 674 static bool block = false;
668 if ( block ) return; 675 if ( block ) return;
669 block = true; 676 block = true;
670 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 677 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
671 //qDebug("VAL %d ",val ); 678 //qDebug("VAL %d ",val );
672 int count = mNavigator->selectedDates().count(); 679 int count = mNavigator->selectedDates().count();
673 int year = mNavigator->selectedDates().first().year(); 680 int year = mNavigator->selectedDates().first().year();
674 int day = mNavigator->selectedDates().first().dayOfYear(); 681 int day = mNavigator->selectedDates().first().dayOfYear();
675 if ( val == day -1 ) { 682 if ( val == day -1 ) {
676 block = false; 683 block = false;
677 return; 684 return;
678 } 685 }
679 QDate d ( year,1,1 ); 686 QDate d ( year,1,1 );
680 mNavigator->selectDates( d.addDays( val ), count ); 687 mNavigator->selectDates( d.addDays( val ), count );
681 block = false; 688 block = false;
682#endif 689#endif
683 690
684} 691}
685void CalendarView::checkFiles() 692void CalendarView::checkFiles()
686{ 693{
687 QString message; 694 QString message;
688 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars; 695 QPtrList<KopiCalendarFile> calendars = KOPrefs::instance()->mCalendars;
689 KopiCalendarFile * cal = calendars.first(); 696 KopiCalendarFile * cal = calendars.first();
690 while ( cal ) { 697 while ( cal ) {
691 if ( cal->mErrorOnLoad ) { 698 if ( cal->mErrorOnLoad ) {
692 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n"; 699 message += cal->mName +"\n"+KGlobal::formatMessage ( "(" +i18n( "Filepath: ")+ cal->mFileName+")" ,0 )+"\n";
693 } 700 }
694 cal = calendars.next(); 701 cal = calendars.next();
695 } 702 }
696 if ( !message.isEmpty() ) { 703 if ( !message.isEmpty() ) {
697 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0); 704 message = KGlobal::formatMessage( i18n("Calendar(s) not loaded:"),0 )+"\n" + message +KGlobal::formatMessage(i18n("You can try to reload the calendar in the Resource View!"),0);
698 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed")); 705 KMessageBox::error(this,message, i18n("Loding of calendar(s) failed"));
699 } 706 }
700 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() )); 707 QTimer::singleShot( 2000, this, SLOT ( checkAlarms() ));
701} 708}
702void CalendarView::checkAlarms() 709void CalendarView::checkAlarms()
703{ 710{
704 711
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index 651194b..a5f230a 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -155,96 +155,97 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
155 void closingDown(); 155 void closingDown();
156 /** emitted right before we die */ 156 /** emitted right before we die */
157 void closed(QWidget *); 157 void closed(QWidget *);
158 158
159 /** Emitted when state of modified flag changes */ 159 /** Emitted when state of modified flag changes */
160 void modifiedChanged(bool); 160 void modifiedChanged(bool);
161 void signalmodified(); 161 void signalmodified();
162 162
163 /** Emitted when state of read-only flag changes */ 163 /** Emitted when state of read-only flag changes */
164 void readOnlyChanged(bool); 164 void readOnlyChanged(bool);
165 165
166 /** Emitted when the unit of navigation changes */ 166 /** Emitted when the unit of navigation changes */
167 void changeNavStringPrev(const QString &); 167 void changeNavStringPrev(const QString &);
168 void changeNavStringNext(const QString &); 168 void changeNavStringNext(const QString &);
169 169
170 /** Emitted when state of events selection has changed and user is organizer*/ 170 /** Emitted when state of events selection has changed and user is organizer*/
171 void organizerEventsSelected(bool); 171 void organizerEventsSelected(bool);
172 /** Emitted when state of events selection has changed and user is attendee*/ 172 /** Emitted when state of events selection has changed and user is attendee*/
173 void groupEventsSelected(bool); 173 void groupEventsSelected(bool);
174 /** 174 /**
175 Emitted when an incidence gets selected. If the selection is cleared the 175 Emitted when an incidence gets selected. If the selection is cleared the
176 signal is emitted with 0 as argument. 176 signal is emitted with 0 as argument.
177 */ 177 */
178 void incidenceSelected( Incidence * ); 178 void incidenceSelected( Incidence * );
179 /** Emitted, when a todoitem is selected or deselected. */ 179 /** Emitted, when a todoitem is selected or deselected. */
180 void todoSelected( bool ); 180 void todoSelected( bool );
181 181
182 /** 182 /**
183 Emitted, when clipboard content changes. Parameter indicates if paste 183 Emitted, when clipboard content changes. Parameter indicates if paste
184 is possible or not. 184 is possible or not.
185 */ 185 */
186 void pasteEnabled(bool); 186 void pasteEnabled(bool);
187 187
188 /** Emitted, when the number of incoming messages has changed. */ 188 /** Emitted, when the number of incoming messages has changed. */
189 void numIncomingChanged(int); 189 void numIncomingChanged(int);
190 190
191 /** Emitted, when the number of outgoing messages has changed. */ 191 /** Emitted, when the number of outgoing messages has changed. */
192 void numOutgoingChanged(int); 192 void numOutgoingChanged(int);
193 193
194 /** Send status message, which can e.g. be displayed in the status bar. */ 194 /** Send status message, which can e.g. be displayed in the status bar. */
195 void statusMessage(const QString &); 195 void statusMessage(const QString &);
196 196
197 void calendarViewExpanded( bool ); 197 void calendarViewExpanded( bool );
198 void updateSearchDialog(); 198 void updateSearchDialog();
199 void filtersUpdated(); 199 void filtersUpdated();
200 200
201 201
202 public slots: 202 public slots:
203 void setCalReadOnly( int id, bool readO );
203 void checkAlarms(); 204 void checkAlarms();
204 void checkFiles(); 205 void checkFiles();
205 void slotprintSelInc(); 206 void slotprintSelInc();
206 void showNextAlarms(); 207 void showNextAlarms();
207 void showOpenError(); 208 void showOpenError();
208 void watchSavedFile(); 209 void watchSavedFile();
209 void recheckTimerAlarm(); 210 void recheckTimerAlarm();
210 void checkNextTimerAlarm(); 211 void checkNextTimerAlarm();
211 void addAlarm(const QDateTime &qdt, const QString &noti ); 212 void addAlarm(const QDateTime &qdt, const QString &noti );
212 void addSuspendAlarm(const QDateTime &qdt, const QString &noti ); 213 void addSuspendAlarm(const QDateTime &qdt, const QString &noti );
213 void removeAlarm(const QDateTime &qdt, const QString &noti ); 214 void removeAlarm(const QDateTime &qdt, const QString &noti );
214 215
215 /** options dialog made a changed to the configuration. we catch this 216 /** options dialog made a changed to the configuration. we catch this
216 * and notify all widgets which need to update their configuration. */ 217 * and notify all widgets which need to update their configuration. */
217 void updateConfig(); 218 void updateConfig();
218 219
219 void insertBirthdays(const QString& uid, const QStringList& birthdayList, 220 void insertBirthdays(const QString& uid, const QStringList& birthdayList,
220 const QStringList& anniversaryList, const QStringList& realNameList, 221 const QStringList& anniversaryList, const QStringList& realNameList,
221 const QStringList& emailList, const QStringList& assembledNameList, 222 const QStringList& emailList, const QStringList& assembledNameList,
222 const QStringList& uidList); 223 const QStringList& uidList);
223 224
224 /** 225 /**
225 Load calendar from file \a filename. If \a merge is true, load 226 Load calendar from file \a filename. If \a merge is true, load
226 calendar into existing one, if it is false, clear calendar, before 227 calendar into existing one, if it is false, clear calendar, before
227 loading. Return true, if calendar could be successfully loaded. 228 loading. Return true, if calendar could be successfully loaded.
228 */ 229 */
229 bool openCalendar(QString filename, bool merge=false); 230 bool openCalendar(QString filename, bool merge=false);
230 bool loadCalendars(); 231 bool loadCalendars();
231 bool saveCalendars(); 232 bool saveCalendars();
232 bool restoreCalendarSettings(); 233 bool restoreCalendarSettings();
233 bool addCalendar( KopiCalendarFile * ); 234 bool addCalendar( KopiCalendarFile * );
234 void addCalendarId( int id ); 235 void addCalendarId( int id );
235 bool syncCalendar(QString filename,int mode = 0 ); 236 bool syncCalendar(QString filename,int mode = 0 );
236 237
237 /** 238 /**
238 Save calendar data to file. Return true if calendar could be 239 Save calendar data to file. Return true if calendar could be
239 successfully saved. 240 successfully saved.
240 */ 241 */
241 bool saveCalendar(QString filename); 242 bool saveCalendar(QString filename);
242 243
243 /** 244 /**
244 Close calendar. Clear calendar data and reset views to display an empty 245 Close calendar. Clear calendar data and reset views to display an empty
245 calendar. 246 calendar.
246 */ 247 */
247 void closeCalendar(); 248 void closeCalendar();
248 249
249 /** Archive old events of calendar */ 250 /** Archive old events of calendar */
250 void archiveCalendar(); 251 void archiveCalendar();
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 1335d7e..3f08ef8 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -112,113 +112,113 @@ void KOFilterView::setSelectedFilter( int fil )
112KOCalEditView::KOCalEditView(QWidget* parent, 112KOCalEditView::KOCalEditView(QWidget* parent,
113 const char* name ) 113 const char* name )
114 : QScrollView(parent,name) 114 : QScrollView(parent,name)
115{ 115{
116 mw = 0; 116 mw = 0;
117 setResizePolicy( AutoOneFit ); 117 setResizePolicy( AutoOneFit );
118 setFrameStyle ( QFrame::Panel | QFrame::Plain ); 118 setFrameStyle ( QFrame::Panel | QFrame::Plain );
119 setLineWidth ( 1 ); 119 setLineWidth ( 1 );
120 setMidLineWidth ( 1 ); 120 setMidLineWidth ( 1 );
121 setFocusPolicy(NoFocus); 121 setFocusPolicy(NoFocus);
122} 122}
123 123
124KOCalEditView::~KOCalEditView() 124KOCalEditView::~KOCalEditView()
125{ 125{
126 // no need to delete child widgets, Qt does it all for us 126 // no need to delete child widgets, Qt does it all for us
127} 127}
128void KOCalEditView::selectCal(int id ,bool b) 128void KOCalEditView::selectCal(int id ,bool b)
129{ 129{
130 KOPrefs::instance()->getCalendar( id )->isEnabled = b; 130 KOPrefs::instance()->getCalendar( id )->isEnabled = b;
131 emit calendarEnabled ( id, b ); 131 emit calendarEnabled ( id, b );
132 emit needsUpdate(); 132 emit needsUpdate();
133 133
134} 134}
135void KOCalEditView::selectStdCal( int id ) 135void KOCalEditView::selectStdCal( int id )
136{ 136{
137 KOCalRadioButton* it = mStdandardB.first(); 137 KOCalRadioButton* it = mStdandardB.first();
138 while ( it ) { 138 while ( it ) {
139 it->blockSignals( true ); 139 it->blockSignals( true );
140 it->setChecked( it->num() == id ); 140 it->setChecked( it->num() == id );
141 it->blockSignals( false ); 141 it->blockSignals( false );
142 it = mStdandardB.next(); 142 it = mStdandardB.next();
143 } 143 }
144 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 144 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
145 while ( kkf ) { 145 while ( kkf ) {
146 kkf->isStandard = (kkf->mCalNumber == id ); 146 kkf->isStandard = (kkf->mCalNumber == id );
147 kkf = KOPrefs::instance()->mCalendars.next(); 147 kkf = KOPrefs::instance()->mCalendars.next();
148 } 148 }
149 emit setCalendarDefault ( id ); 149 emit setCalendarDefault ( id );
150} 150}
151 151
152void KOCalEditView::selectCalAlarm(int id ,bool b ) 152void KOCalEditView::selectCalAlarm(int id ,bool b )
153{ 153{
154 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b; 154 KOPrefs::instance()->getCalendar( id )->isAlarmEnabled = b;
155 emit alarmEnabled ( id , b ); 155 emit alarmEnabled ( id , b );
156 emit needsUpdate(); 156 emit needsUpdate();
157} 157}
158void KOCalEditView::selectReadOnly(int id ,bool b ) 158void KOCalEditView::selectReadOnly(int id ,bool b )
159{ 159{
160 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
161 emit calendarReadonly ( id , b );
162 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) { 160 if ( KOPrefs::instance()->getCalendar( id )->isStandard && b ) {
163 findNewStandard(); 161 findNewStandard();
164 } else { 162 } else {
165 if ( !b ){ 163 if ( !b ){
166 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 164 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
167 while ( kkf ) { 165 while ( kkf ) {
168 if (kkf->isReadOnly && kkf->isStandard ) { 166 if (kkf->isReadOnly && kkf->isStandard ) {
169 selectStdCal( id ); 167 selectStdCal( id );
170 break; 168 break;
171 } 169 }
172 kkf = KOPrefs::instance()->mCalendars.next(); 170 kkf = KOPrefs::instance()->mCalendars.next();
173 } 171 }
174 } 172 }
175 } 173 }
176 mStdandardB.at(id-1)->setEnabled( !b ); 174 mStdandardB.at(id-1)->setEnabled( !b );
175 emit calendarReadonly ( id , b );
176 KOPrefs::instance()->getCalendar( id )->isReadOnly = b;
177 emit needsUpdate(); 177 emit needsUpdate();
178 178
179} 179}
180void KOCalEditView::findNewStandard() 180void KOCalEditView::findNewStandard()
181{ 181{
182 bool found = false; 182 bool found = false;
183 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first(); 183 KopiCalendarFile * kkf = KOPrefs::instance()->mCalendars.first();
184 while ( kkf ) { 184 while ( kkf ) {
185 if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) { 185 if (!kkf->isReadOnly && !kkf->mErrorOnLoad ) {
186 found = true; 186 found = true;
187 selectStdCal( kkf->mCalNumber ); 187 selectStdCal( kkf->mCalNumber );
188 break; 188 break;
189 } 189 }
190 kkf = KOPrefs::instance()->mCalendars.next(); 190 kkf = KOPrefs::instance()->mCalendars.next();
191 } 191 }
192 if ( !found ) { 192 if ( !found ) {
193 KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"), 193 KMessageBox::error( this,i18n("\nNO\n WRITEABLE\n CALENDAR\n FOUND!\n\nPlease fix your calendar settings!\n"),
194 i18n("Houston, we have a problem!") ); 194 i18n("Houston, we have a problem!") );
195 195
196 } 196 }
197} 197}
198 198
199void KOCalEditView::setColor( const QColor& c, int id ) 199void KOCalEditView::setColor( const QColor& c, int id )
200{ 200{
201 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c; 201 KOPrefs::instance()->getCalendar( id )->mDefaultColor = c;
202 emit needsUpdate(); 202 emit needsUpdate();
203} 203}
204void KOCalEditView::deleteCal( int id ) 204void KOCalEditView::deleteCal( int id )
205{ 205{
206 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id ); 206 KopiCalendarFile * kkf = KOPrefs::instance()->getCalendar( id );
207 QString name = kkf->mName; 207 QString name = kkf->mName;
208 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 ); 208 QString file = KGlobal::formatMessage ( kkf->mFileName ,0 );
209 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return; 209 if ( KMessageBox::warningContinueCancel( this, i18n("The calendar <b>%1</b> is displaying file <b>%2</b>. Do you want to remove this calendar from KO/Pi? (The file is not removed!)").arg(name).arg(file) ) != KMessageBox::Continue ) return;
210 bool findnewstd = kkf->isStandard; 210 bool findnewstd = kkf->isStandard;
211 emit removeCalendar ( id ); 211 emit removeCalendar ( id );
212 KOPrefs::instance()->mCalendars.remove ( kkf ); 212 KOPrefs::instance()->mCalendars.remove ( kkf );
213 if ( findnewstd ) findNewStandard(); 213 if ( findnewstd ) findNewStandard();
214 emit needsUpdate(); 214 emit needsUpdate();
215 QTimer::singleShot( 0, this, SLOT ( readConfig() ) ); 215 QTimer::singleShot( 0, this, SLOT ( readConfig() ) );
216} 216}
217void KOCalEditView::infoCal( int id ) 217void KOCalEditView::infoCal( int id )
218{ 218{
219 QString name = KOPrefs::instance()->getCalendar( id )->mName; 219 QString name = KOPrefs::instance()->getCalendar( id )->mName;
220 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 ); 220 QString file = KGlobal::formatMessage ( KOPrefs::instance()->getCalendar( id )->mFileName, 0 );
221 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) { 221 if ( KOPrefs::instance()->getCalendar( id )->mErrorOnLoad ) {
222 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) { 222 if ( KMessageBox::Yes == KMessageBox::questionYesNo( this, i18n("The calendar <b>%1</b> is not loaded! Loading of file <b>%2</b> failed! <b>Try again to load the calendar?</b>").arg(name).arg(file) ) ) {
223 emit calendarAdded( id ); 223 emit calendarAdded( id );
224 emit needsUpdate(); 224 emit needsUpdate();