summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2005-06-11 09:22:29 (UTC)
committer zautrix <zautrix>2005-06-11 09:22:29 (UTC)
commitd4501288ba7414ba89a791dd2c306e9f74eeb3fa (patch) (unidiff)
treea99b30c87947a22f9c2da3ab5426f4e5ed8de9ab
parentb214921b2072079ec59a87ac84231f83532009d5 (diff)
downloadkdepimpi-d4501288ba7414ba89a791dd2c306e9f74eeb3fa.zip
kdepimpi-d4501288ba7414ba89a791dd2c306e9f74eeb3fa.tar.gz
kdepimpi-d4501288ba7414ba89a791dd2c306e9f74eeb3fa.tar.bz2
fixx
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp4
-rw-r--r--korganizer/kofilterview.cpp2
-rw-r--r--korganizer/kofilterview.h50
3 files changed, 54 insertions, 2 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index ea100d1..8d992b9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -282,384 +282,385 @@ class KOBeamPrefs : public QDialog
282 lay->addWidget( format ); 282 lay->addWidget( format );
283 format->setExclusive ( true ) ; 283 format->setExclusive ( true ) ;
284 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this ); 284 QButtonGroup* time = new QButtonGroup(1, Horizontal, i18n("Time format"), this );
285 lay->addWidget( time ); time->setExclusive ( true ) ; 285 lay->addWidget( time ); time->setExclusive ( true ) ;
286 vcal = new QRadioButton(" vCalendar ", format ); 286 vcal = new QRadioButton(" vCalendar ", format );
287 ical = new QRadioButton(" iCalendar ", format ); 287 ical = new QRadioButton(" iCalendar ", format );
288 vcal->setChecked( true ); 288 vcal->setChecked( true );
289 tz = new QRadioButton(i18n(" With timezone "), time ); 289 tz = new QRadioButton(i18n(" With timezone "), time );
290 local = new QRadioButton(i18n(" Local time "), time ); 290 local = new QRadioButton(i18n(" Local time "), time );
291 tz->setChecked( true ); 291 tz->setChecked( true );
292 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this ); 292 QPushButton * ok = new QPushButton( i18n("Beam via IR!"), this );
293 lay->addWidget( ok ); 293 lay->addWidget( ok );
294 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 294 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
295 lay->addWidget( cancel ); 295 lay->addWidget( cancel );
296 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 296 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
297 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 297 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
298 resize( 200, 200 ); 298 resize( 200, 200 );
299 } 299 }
300 300
301 bool beamVcal() { return vcal->isChecked(); } 301 bool beamVcal() { return vcal->isChecked(); }
302 bool beamLocal() { return local->isChecked(); } 302 bool beamLocal() { return local->isChecked(); }
303private: 303private:
304 QRadioButton* vcal, *ical, *local, *tz; 304 QRadioButton* vcal, *ical, *local, *tz;
305}; 305};
306class KOCatPrefs : public QDialog 306class KOCatPrefs : public QDialog
307{ 307{
308 public: 308 public:
309 KOCatPrefs( QWidget *parent=0, const char *name=0 ) : 309 KOCatPrefs( QWidget *parent=0, const char *name=0 ) :
310 QDialog( parent, name, true ) 310 QDialog( parent, name, true )
311 { 311 {
312 setCaption( i18n("Manage new Categories") ); 312 setCaption( i18n("Manage new Categories") );
313 QVBoxLayout* lay = new QVBoxLayout( this ); 313 QVBoxLayout* lay = new QVBoxLayout( this );
314 lay->setSpacing( 3 ); 314 lay->setSpacing( 3 );
315 lay->setMargin( 3 ); 315 lay->setMargin( 3 );
316 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this ); 316 QLabel * lab = new QLabel( i18n("After importing/loading/syncing\nthere may be new categories in\nevents or todos\nwhich are not in the category list.\nPlease choose what to do:\n "), this );
317 lay->addWidget( lab ); 317 lay->addWidget( lab );
318 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this ); 318 QButtonGroup* format = new QButtonGroup( 1, Horizontal, i18n("New categories not in list:"), this );
319 lay->addWidget( format ); 319 lay->addWidget( format );
320 format->setExclusive ( true ) ; 320 format->setExclusive ( true ) ;
321 addCatBut = new QRadioButton(i18n("Add to category list"), format ); 321 addCatBut = new QRadioButton(i18n("Add to category list"), format );
322 new QRadioButton(i18n("Remove from Events/Todos"), format ); 322 new QRadioButton(i18n("Remove from Events/Todos"), format );
323 addCatBut->setChecked( true ); 323 addCatBut->setChecked( true );
324 QPushButton * ok = new QPushButton( i18n("OK"), this ); 324 QPushButton * ok = new QPushButton( i18n("OK"), this );
325 lay->addWidget( ok ); 325 lay->addWidget( ok );
326 QPushButton * cancel = new QPushButton( i18n("Cancel"), this ); 326 QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
327 lay->addWidget( cancel ); 327 lay->addWidget( cancel );
328 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) ); 328 connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
329 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) ); 329 connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
330 resize( 200, 200 ); 330 resize( 200, 200 );
331 } 331 }
332 332
333 bool addCat() { return addCatBut->isChecked(); } 333 bool addCat() { return addCatBut->isChecked(); }
334private: 334private:
335 QRadioButton* addCatBut; 335 QRadioButton* addCatBut;
336}; 336};
337 337
338 338
339 339
340CalendarView::CalendarView( CalendarResources *calendar, 340CalendarView::CalendarView( CalendarResources *calendar,
341 QWidget *parent, const char *name ) 341 QWidget *parent, const char *name )
342 : CalendarViewBase( parent, name ), 342 : CalendarViewBase( parent, name ),
343 mCalendar( calendar ), 343 mCalendar( calendar ),
344 mResourceManager( calendar->resourceManager() ) 344 mResourceManager( calendar->resourceManager() )
345{ 345{
346 346
347 mEventEditor = 0; 347 mEventEditor = 0;
348 mTodoEditor = 0; 348 mTodoEditor = 0;
349 349
350 init(); 350 init();
351} 351}
352 352
353CalendarView::CalendarView( Calendar *calendar, 353CalendarView::CalendarView( Calendar *calendar,
354 QWidget *parent, const char *name ) 354 QWidget *parent, const char *name )
355 : CalendarViewBase( parent, name ), 355 : CalendarViewBase( parent, name ),
356 mCalendar( calendar ), 356 mCalendar( calendar ),
357 mResourceManager( 0 ) 357 mResourceManager( 0 )
358{ 358{
359 359
360 mEventEditor = 0; 360 mEventEditor = 0;
361 mTodoEditor = 0; 361 mTodoEditor = 0;
362 init(); 362 init();
363} 363}
364 364
365void CalendarView::init() 365void CalendarView::init()
366{ 366{
367 mNextAlarmDateTime = QDateTime::currentDateTime(); 367 mNextAlarmDateTime = QDateTime::currentDateTime();
368 setFocusPolicy ( NoFocus ); 368 setFocusPolicy ( NoFocus );
369 mViewerCallerIsSearchDialog = false; 369 mViewerCallerIsSearchDialog = false;
370 mBlockShowDates = false; 370 mBlockShowDates = false;
371 beamDialog = new KOBeamPrefs(); 371 beamDialog = new KOBeamPrefs();
372 mDatePickerMode = 0; 372 mDatePickerMode = 0;
373 mCurrentSyncDevice = ""; 373 mCurrentSyncDevice = "";
374 writeLocale(); 374 writeLocale();
375 mViewManager = new KOViewManager( this ); 375 mViewManager = new KOViewManager( this );
376 mDialogManager = new KODialogManager( this ); 376 mDialogManager = new KODialogManager( this );
377 mEventViewerDialog = 0; 377 mEventViewerDialog = 0;
378 mModified = false; 378 mModified = false;
379 mReadOnly = false; 379 mReadOnly = false;
380 mSelectedIncidence = 0; 380 mSelectedIncidence = 0;
381 mCalPrinter = 0; 381 mCalPrinter = 0;
382 mFilters.setAutoDelete(true); 382 mFilters.setAutoDelete(true);
383 383
384 mCalendar->registerObserver( this ); 384 mCalendar->registerObserver( this );
385 // TODO: Make sure that view is updated, when calendar is changed. 385 // TODO: Make sure that view is updated, when calendar is changed.
386 386
387 mStorage = new FileStorage( mCalendar ); 387 mStorage = new FileStorage( mCalendar );
388 mNavigator = new DateNavigator( this, "datevav", mViewManager ); 388 mNavigator = new DateNavigator( this, "datevav", mViewManager );
389 389
390 QBoxLayout *topLayout = (QBoxLayout*)layout(); 390 QBoxLayout *topLayout = (QBoxLayout*)layout();
391#ifndef KORG_NOSPLITTER 391#ifndef KORG_NOSPLITTER
392 // create the main layout frames. 392 // create the main layout frames.
393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner"); 393 mPanner = new QSplitter(QSplitter::Horizontal,this,"CalendarView::Panner");
394 topLayout->addWidget(mPanner); 394 topLayout->addWidget(mPanner);
395 395
396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner, 396 mLeftSplitter = new QSplitter(QSplitter::Vertical,mPanner,
397 "CalendarView::LeftFrame"); 397 "CalendarView::LeftFrame");
398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize); 398 mPanner->setResizeMode(mLeftSplitter,QSplitter::KeepSize);
399 399
400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter, 400 mDateNavigator = new DateNavigatorContainer( mLeftSplitter,
401 "CalendarView::DateNavigator" ); 401 "CalendarView::DateNavigator" );
402 402
403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize); 403 mLeftSplitter->setResizeMode(mDateNavigator,QSplitter::KeepSize);
404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2"); 404 mTodoList = new KOTodoView(mCalendar, mLeftSplitter, "todolist_small2");
405 mTodoList->setNavigator( mNavigator ); 405 mTodoList->setNavigator( mNavigator );
406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView"); 406 mFilterView = new KOFilterView(&mFilters,mLeftSplitter,"CalendarView::FilterView");
407 407
408#ifdef KORG_NORESOURCEVIEW 408#ifdef KORG_NORESOURCEVIEW
409 mResourceView = 0; 409 mResourceView = 0;
410#else 410#else
411 if ( mResourceManager ) { 411 if ( mResourceManager ) {
412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter ); 412 mResourceView = new ResourceView( mResourceManager, mLeftSplitter );
413 mResourceView->updateView(); 413 mResourceView->updateView();
414 connect( mResourceView, SIGNAL( resourcesChanged() ), 414 connect( mResourceView, SIGNAL( resourcesChanged() ),
415 SLOT( updateView() ) ); 415 SLOT( updateView() ) );
416 } else { 416 } else {
417 mResourceView = 0; 417 mResourceView = 0;
418 } 418 }
419#endif 419#endif
420 QWidget *rightBox = new QWidget( mPanner ); 420 QWidget *rightBox = new QWidget( mPanner );
421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 421 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
422 422
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 //mainBoxLayout->addWidget (mLeftFrame); 449 //mainBoxLayout->addWidget (mLeftFrame);
450 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 450 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
451 "CalendarView::DateNavigator" ); 451 "CalendarView::DateNavigator" );
452#if 0 452#if 0
453 // FIXME 453 // FIXME
454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 454 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
455 "CalendarView::DateNavigator", QDate::currentDate()); 455 "CalendarView::DateNavigator", QDate::currentDate());
456#endif 456#endif
457 // mDateNavigator->blockSignals( true ); 457 // mDateNavigator->blockSignals( true );
458 //leftFrameLayout->addWidget( mDateNavigator ); 458 //leftFrameLayout->addWidget( mDateNavigator );
459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 459 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 460 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 461 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
462 mTodoList->setNavigator( mNavigator ); 462 mTodoList->setNavigator( mNavigator );
463#if 0 463#if 0
464 if ( QApplication::desktop()->width() < 480 ) { 464 if ( QApplication::desktop()->width() < 480 ) {
465 leftFrameLayout->addWidget(mFilterView); 465 leftFrameLayout->addWidget(mFilterView);
466 leftFrameLayout->addWidget(mTodoList, 2 ); 466 leftFrameLayout->addWidget(mTodoList, 2 );
467 467
468 } else { 468 } else {
469 leftFrameLayout->addWidget(mTodoList,2 ); 469 leftFrameLayout->addWidget(mTodoList,2 );
470 leftFrameLayout->addWidget(mFilterView ); 470 leftFrameLayout->addWidget(mFilterView );
471 } 471 }
472#endif 472#endif
473 mFilterView->hide(); 473 mFilterView->hide();
474 mCalEditView->hide();
474 QWidget *rightBox = new QWidget( mMainFrame ); 475 QWidget *rightBox = new QWidget( mMainFrame );
475 //mainBoxLayout->addWidget ( rightBox, 10 ); 476 //mainBoxLayout->addWidget ( rightBox, 10 );
476 QBoxLayout *rightLayout = new QVBoxLayout( rightBox ); 477 QBoxLayout *rightLayout = new QVBoxLayout( rightBox );
477 mRightFrame = new QWidgetStack( rightBox ); 478 mRightFrame = new QWidgetStack( rightBox );
478 rightLayout->addWidget( mRightFrame, 10 ); 479 rightLayout->addWidget( mRightFrame, 10 );
479 480
480 //mLeftFrame = (QWidget *)leftFrame; 481 //mLeftFrame = (QWidget *)leftFrame;
481 if ( KOPrefs::instance()->mVerticalScreen ) { 482 if ( KOPrefs::instance()->mVerticalScreen ) {
482 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() ); 483 //mDateNavigator->setFixedHeight( mDateNavigator->sizeHint().height() );
483 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() ); 484 //mDateNavigator->setMinimumWidth( mDateNavigator->sizeHint().width() );
484 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() ); 485 //mTodoList->setFixedHeight( mDateNavigator->sizeHint().height() );
485 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() ); 486 //leftFrame->setFixedHeight( mDateNavigator->sizeHint().height() );
486 } else { 487 } else {
487 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() ); 488 //mDateNavigator->setFixedWidth( mDateNavigator->sizeHint().width() );
488 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() ); 489 //mTodoList->setFixedWidth( mDateNavigator->sizeHint().width() );
489 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() ); 490 //leftFrame->setFixedWidth( mDateNavigator->sizeHint().width() );
490 } 491 }
491 if ( !KOPrefs::instance()->mShowDateNavigator) 492 if ( !KOPrefs::instance()->mShowDateNavigator)
492 mDateNavigator->hide(); 493 mDateNavigator->hide();
493 //qDebug("Calendarview Size %d %d ", width(), height()); 494 //qDebug("Calendarview Size %d %d ", width(), height());
494#endif 495#endif
495 496
496 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 497 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
497 SLOT( showDates( const KCal::DateList & ) ) ); 498 SLOT( showDates( const KCal::DateList & ) ) );
498 499
499 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 500 connect( mNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
500 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 501 mDateNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
501 502
502 503
503 504
504 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ), 505 connect( mDateNavigator, SIGNAL( showMonth( const QDate & ) ),
505 mViewManager, SLOT( showMonth( const QDate & ) ) ); 506 mViewManager, SLOT( showMonth( const QDate & ) ) );
506 507
507 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ), 508 connect( mDateNavigator, SIGNAL( weekClicked( const QDate & ) ),
508 mNavigator, SLOT( selectWeek( const QDate & ) ) ); 509 mNavigator, SLOT( selectWeek( const QDate & ) ) );
509 510
510 connect( mDateNavigator, SIGNAL( goPrevYear() ), 511 connect( mDateNavigator, SIGNAL( goPrevYear() ),
511 mNavigator, SLOT( selectPreviousYear() ) ); 512 mNavigator, SLOT( selectPreviousYear() ) );
512 connect( mDateNavigator, SIGNAL( goNextYear() ), 513 connect( mDateNavigator, SIGNAL( goNextYear() ),
513 mNavigator, SLOT( selectNextYear() ) ); 514 mNavigator, SLOT( selectNextYear() ) );
514 connect( mDateNavigator, SIGNAL( goPrevMonth() ), 515 connect( mDateNavigator, SIGNAL( goPrevMonth() ),
515 mNavigator, SLOT( selectPreviousMonth() ) ); 516 mNavigator, SLOT( selectPreviousMonth() ) );
516 connect( mDateNavigator, SIGNAL( goNextMonth() ), 517 connect( mDateNavigator, SIGNAL( goNextMonth() ),
517 mNavigator, SLOT( selectNextMonth() ) ); 518 mNavigator, SLOT( selectNextMonth() ) );
518 519
519 connect( mDateNavigator, SIGNAL( goPrevious() ), 520 connect( mDateNavigator, SIGNAL( goPrevious() ),
520 mNavigator, SLOT( selectPrevious() ) ); 521 mNavigator, SLOT( selectPrevious() ) );
521 connect( mDateNavigator, SIGNAL( goNext() ), 522 connect( mDateNavigator, SIGNAL( goNext() ),
522 mNavigator, SLOT( selectNext() ) ); 523 mNavigator, SLOT( selectNext() ) );
523 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ), 524 connect( mDateNavigator, SIGNAL( monthSelected ( int ) ),
524 mNavigator, SLOT( slotMonthSelect( int ) ) ); 525 mNavigator, SLOT( slotMonthSelect( int ) ) );
525 526
526 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ), 527 connect( mDateNavigator, SIGNAL( datesSelected( const KCal::DateList & ) ),
527 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) ); 528 mNavigator, SLOT( selectDates( const KCal::DateList & ) ) );
528#if 0 529#if 0
529 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ), 530 connect( mDateNavigator, SIGNAL( incidenceDropped( Incidence * ) ),
530 SLOT( incidenceAdded( Incidence *) ) ); 531 SLOT( incidenceAdded( Incidence *) ) );
531#endif 532#endif
532 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView())); 533 // connect(mDateNavigator,SIGNAL(dayPassed(QDate)),SLOT(updateView()));
533 534
534 connect( this, SIGNAL( configChanged() ), 535 connect( this, SIGNAL( configChanged() ),
535 mDateNavigator, SLOT( updateConfig() ) ); 536 mDateNavigator, SLOT( updateConfig() ) );
536 537
537 connect( mTodoList, SIGNAL( newTodoSignal() ), 538 connect( mTodoList, SIGNAL( newTodoSignal() ),
538 SLOT( newTodo() ) ); 539 SLOT( newTodo() ) );
539 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ), 540 connect( mTodoList, SIGNAL( newSubTodoSignal( Todo *) ),
540 SLOT( newSubTodo( Todo * ) ) ); 541 SLOT( newSubTodo( Todo * ) ) );
541 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ), 542 connect( mTodoList, SIGNAL( editTodoSignal( Todo * ) ),
542 SLOT( editTodo( Todo * ) ) ); 543 SLOT( editTodo( Todo * ) ) );
543 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ), 544 connect( mTodoList, SIGNAL( showTodoSignal( Todo * ) ),
544 SLOT( showTodo( Todo *) ) ); 545 SLOT( showTodo( Todo *) ) );
545 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ), 546 connect( mTodoList, SIGNAL( deleteTodoSignal( Todo *) ),
546 SLOT( deleteTodo( Todo *) ) ); 547 SLOT( deleteTodo( Todo *) ) );
547 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) ); 548 connect( this, SIGNAL( configChanged()), mTodoList, SLOT( updateConfig() ) );
548 connect( mTodoList, SIGNAL( purgeCompletedSignal() ), 549 connect( mTodoList, SIGNAL( purgeCompletedSignal() ),
549 SLOT( purgeCompleted() ) ); 550 SLOT( purgeCompleted() ) );
550 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ), 551 connect( mTodoList, SIGNAL( todoModifiedSignal( Todo *, int ) ),
551 SIGNAL( todoModified( Todo *, int ) ) ); 552 SIGNAL( todoModified( Todo *, int ) ) );
552 553
553 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ), 554 connect( mTodoList, SIGNAL( cloneTodoSignal( Incidence * ) ),
554 this, SLOT ( cloneIncidence( Incidence * ) ) ); 555 this, SLOT ( cloneIncidence( Incidence * ) ) );
555 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ), 556 connect( mTodoList, SIGNAL( cancelTodoSignal( Incidence * ) ),
556 this, SLOT (cancelIncidence( Incidence * ) ) ); 557 this, SLOT (cancelIncidence( Incidence * ) ) );
557 558
558 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ), 559 connect( mTodoList, SIGNAL( moveTodoSignal( Incidence * ) ),
559 this, SLOT ( moveIncidence( Incidence * ) ) ); 560 this, SLOT ( moveIncidence( Incidence * ) ) );
560 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ), 561 connect( mTodoList, SIGNAL( beamTodoSignal( Incidence * ) ),
561 this, SLOT ( beamIncidence( Incidence * ) ) ); 562 this, SLOT ( beamIncidence( Incidence * ) ) );
562 563
563 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ), 564 connect( mTodoList, SIGNAL( unparentTodoSignal( Todo * ) ),
564 this, SLOT ( todo_unsub( Todo * ) ) ); 565 this, SLOT ( todo_unsub( Todo * ) ) );
565 566
566 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ), 567 connect( mTodoList, SIGNAL( reparentTodoSignal( Todo *,Todo * ) ),
567 this, SLOT ( todo_resub( Todo *,Todo * ) ) ); 568 this, SLOT ( todo_resub( Todo *,Todo * ) ) );
568 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList, 569 connect( this, SIGNAL( todoModified( Todo *, int )), mTodoList,
569 SLOT( updateTodo( Todo *, int ) ) ); 570 SLOT( updateTodo( Todo *, int ) ) );
570 connect( this, SIGNAL( todoModified( Todo *, int )), this, 571 connect( this, SIGNAL( todoModified( Todo *, int )), this,
571 SLOT( changeTodoDisplay( Todo *, int ) ) ); 572 SLOT( changeTodoDisplay( Todo *, int ) ) );
572 573
573 574
574 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) ); 575 connect( mFilterView, SIGNAL( filterChanged() ), SLOT( updateFilter() ) );
575 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) ); 576 connect( mFilterView, SIGNAL( editFilters() ), SLOT( editFilters() ) );
576 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) ); 577 connect( mCalendar, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addAlarm(const QDateTime &, const QString & ) ) );
577 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) ); 578 connect( mCalendar, SIGNAL( removeAlarm(const QDateTime &, const QString & ) ), SLOT( removeAlarm(const QDateTime &, const QString & ) ) );
578 579
579 580
580 581
581 582
582 583
583 connect(QApplication::clipboard(),SIGNAL(dataChanged()), 584 connect(QApplication::clipboard(),SIGNAL(dataChanged()),
584 SLOT(checkClipboard())); 585 SLOT(checkClipboard()));
585 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ), 586 connect( mTodoList,SIGNAL( incidenceSelected( Incidence * ) ),
586 SLOT( processTodoListSelection( Incidence * ) ) ); 587 SLOT( processTodoListSelection( Incidence * ) ) );
587 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool))); 588 connect(mTodoList,SIGNAL(isModified(bool)),SLOT(setModified(bool)));
588 589
589 // kdDebug() << "CalendarView::CalendarView() done" << endl; 590 // kdDebug() << "CalendarView::CalendarView() done" << endl;
590 591
591 mDateFrame = new QVBox(0,0,WType_Popup); 592 mDateFrame = new QVBox(0,0,WType_Popup);
592 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised); 593 //mDateFrame->setFrameStyle(QFrame::PopupPanel | QFrame::Raised);
593 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised ); 594 mDateFrame->setFrameStyle( QFrame::WinPanel |QFrame::Raised );
594 mDateFrame->setLineWidth(3); 595 mDateFrame->setLineWidth(3);
595 mDateFrame->hide(); 596 mDateFrame->hide();
596 mDateFrame->setCaption( i18n( "Pick a date to display")); 597 mDateFrame->setCaption( i18n( "Pick a date to display"));
597 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() ); 598 mDatePicker = new KDatePicker ( mDateFrame , QDate::currentDate() );
598 599
599 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate))); 600 connect(mDatePicker,SIGNAL(dateSelected(QDate)),SLOT(slotSelectPickerDate(QDate)));
600 601
601 mEventEditor = mDialogManager->getEventEditor(); 602 mEventEditor = mDialogManager->getEventEditor();
602 mTodoEditor = mDialogManager->getTodoEditor(); 603 mTodoEditor = mDialogManager->getTodoEditor();
603 604
604 mFlagEditDescription = false; 605 mFlagEditDescription = false;
605 606
606 mSuspendTimer = new QTimer( this ); 607 mSuspendTimer = new QTimer( this );
607 mAlarmTimer = new QTimer( this ); 608 mAlarmTimer = new QTimer( this );
608 mRecheckAlarmTimer = new QTimer( this ); 609 mRecheckAlarmTimer = new QTimer( this );
609 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) ); 610 connect( mRecheckAlarmTimer, SIGNAL( timeout () ), SLOT( recheckTimerAlarm() ) );
610 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) ); 611 connect( mSuspendTimer, SIGNAL( timeout () ), SLOT( suspendAlarm() ) );
611 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) ); 612 connect( mAlarmTimer, SIGNAL( timeout () ), SLOT( timerAlarm() ) );
612 mAlarmDialog = new AlarmDialog( this ); 613 mAlarmDialog = new AlarmDialog( this );
613 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) ); 614 connect( mAlarmDialog, SIGNAL( addAlarm(const QDateTime &, const QString & ) ), SLOT( addSuspendAlarm(const QDateTime &, const QString & ) ) );
614 mAlarmDialog->setServerNotification( false ); 615 mAlarmDialog->setServerNotification( false );
615 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime ); 616 mAlarmDialog->setSuspendTime( KOPrefs::instance()->mAlarmSuspendTime );
616 617
617 618
618#ifndef DESKTOP_VERSION 619#ifndef DESKTOP_VERSION
619//US listen for arriving address resultsets 620//US listen for arriving address resultsets
620 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)), 621 connect(ExternalAppHandler::instance(), SIGNAL(receivedBirthdayListEvent(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)),
621 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&))); 622 this, SLOT(insertBirthdays(const QString&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&, const QStringList&)));
622#endif 623#endif
623 mDateNavigator->setCalendar( mCalendar ); 624 mDateNavigator->setCalendar( mCalendar );
624} 625}
625 626
626 627
627CalendarView::~CalendarView() 628CalendarView::~CalendarView()
628{ 629{
629 // kdDebug() << "~CalendarView()" << endl; 630 // kdDebug() << "~CalendarView()" << endl;
630 //qDebug("CalendarView::~CalendarView() "); 631 //qDebug("CalendarView::~CalendarView() ");
631 delete mDialogManager; 632 delete mDialogManager;
632 delete mViewManager; 633 delete mViewManager;
633 delete mStorage; 634 delete mStorage;
634 delete mDateFrame ; 635 delete mDateFrame ;
635 delete beamDialog; 636 delete beamDialog;
636 delete mEventViewerDialog; 637 delete mEventViewerDialog;
637 //kdDebug() << "~CalendarView() done" << endl; 638 //kdDebug() << "~CalendarView() done" << endl;
638} 639}
639void CalendarView::checkAlarms() 640void CalendarView::checkAlarms()
640{ 641{
641 KConfig *config = KOGlobals::config(); 642 KConfig *config = KOGlobals::config();
642 config->setGroup( "AppRun" ); 643 config->setGroup( "AppRun" );
643 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 644 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
644 int secto = dt.secsTo( QDateTime::currentDateTime() ); 645 int secto = dt.secsTo( QDateTime::currentDateTime() );
645 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30; 646 int secs = config->readNumEntry( "LatestProgramStop" , secto) - 30;
646 //secs -= ( 3600 * 24*3 ); // debug only 647 //secs -= ( 3600 * 24*3 ); // debug only
647 QDateTime latest = dt.addSecs ( secs ); 648 QDateTime latest = dt.addSecs ( secs );
648 qDebug("KO: Last termination on %s ", latest.toString().latin1()); 649 qDebug("KO: Last termination on %s ", latest.toString().latin1());
649 QPtrList<Incidence> el = mCalendar->rawIncidences(); 650 QPtrList<Incidence> el = mCalendar->rawIncidences();
650 QPtrList<Incidence> al; 651 QPtrList<Incidence> al;
651 Incidence* inL = el.first(); 652 Incidence* inL = el.first();
652 while ( inL ) { 653 while ( inL ) {
653 bool ok = false; 654 bool ok = false;
654 int offset = 0; 655 int offset = 0;
655 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ; 656 QDateTime next = inL->getNextAlarmDateTime(& ok, &offset, latest ) ;
656 if ( ok ) { 657 if ( ok ) {
657 //qDebug("OK %s",next.toString().latin1()); 658 //qDebug("OK %s",next.toString().latin1());
658 if ( next < QDateTime::currentDateTime() ) { 659 if ( next < QDateTime::currentDateTime() ) {
659 al.append( inL ); 660 al.append( inL );
660 //qDebug("found missed alarm: %s ", inL->summary().latin1() ); 661 //qDebug("found missed alarm: %s ", inL->summary().latin1() );
661 } 662 }
662 } 663 }
663 inL = el.next(); 664 inL = el.next();
664 } 665 }
665 if ( al.count() ) { 666 if ( al.count() ) {
@@ -3720,387 +3721,388 @@ bool CalendarView::exportVCalendar( QString filename )
3720 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"), 3721 i18n("Data Loss Warning"),i18n("Proceed"),i18n("Cancel"),
3721 true); 3722 true);
3722 if (result != KMessageBox::Continue) return false; 3723 if (result != KMessageBox::Continue) return false;
3723 } 3724 }
3724 3725
3725 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this); 3726 //QString filename = KFileDialog::getSaveFileName("vcalout.vcs",i18n("*.vcs|VCalendars"),this);
3726 3727
3727 // Force correct extension 3728 // Force correct extension
3728 if (filename.right(4) != ".vcs") filename += ".vcs"; 3729 if (filename.right(4) != ".vcs") filename += ".vcs";
3729 3730
3730 FileStorage storage( mCalendar, filename, new VCalFormat ); 3731 FileStorage storage( mCalendar, filename, new VCalFormat );
3731 return storage.save(); 3732 return storage.save();
3732 3733
3733} 3734}
3734 3735
3735void CalendarView::eventUpdated(Incidence *) 3736void CalendarView::eventUpdated(Incidence *)
3736{ 3737{
3737 setModified(); 3738 setModified();
3738 // Don't call updateView here. The code, which has caused the update of the 3739 // Don't call updateView here. The code, which has caused the update of the
3739 // event is responsible for updating the view. 3740 // event is responsible for updating the view.
3740 // updateView(); 3741 // updateView();
3741} 3742}
3742 3743
3743void CalendarView::adaptNavigationUnits() 3744void CalendarView::adaptNavigationUnits()
3744{ 3745{
3745 if (mViewManager->currentView()->isEventView()) { 3746 if (mViewManager->currentView()->isEventView()) {
3746 int days = mViewManager->currentView()->currentDateCount(); 3747 int days = mViewManager->currentView()->currentDateCount();
3747 if (days == 1) { 3748 if (days == 1) {
3748 emit changeNavStringPrev(i18n("&Previous Day")); 3749 emit changeNavStringPrev(i18n("&Previous Day"));
3749 emit changeNavStringNext(i18n("&Next Day")); 3750 emit changeNavStringNext(i18n("&Next Day"));
3750 } else { 3751 } else {
3751 emit changeNavStringPrev(i18n("&Previous Week")); 3752 emit changeNavStringPrev(i18n("&Previous Week"));
3752 emit changeNavStringNext(i18n("&Next Week")); 3753 emit changeNavStringNext(i18n("&Next Week"));
3753 } 3754 }
3754 } 3755 }
3755} 3756}
3756 3757
3757void CalendarView::processMainViewSelection( Incidence *incidence ) 3758void CalendarView::processMainViewSelection( Incidence *incidence )
3758{ 3759{
3759 if ( incidence ) mTodoList->clearSelection(); 3760 if ( incidence ) mTodoList->clearSelection();
3760 processIncidenceSelection( incidence ); 3761 processIncidenceSelection( incidence );
3761} 3762}
3762 3763
3763void CalendarView::processTodoListSelection( Incidence *incidence ) 3764void CalendarView::processTodoListSelection( Incidence *incidence )
3764{ 3765{
3765 if ( incidence && mViewManager->currentView() ) { 3766 if ( incidence && mViewManager->currentView() ) {
3766 mViewManager->currentView()->clearSelection(); 3767 mViewManager->currentView()->clearSelection();
3767 } 3768 }
3768 processIncidenceSelection( incidence ); 3769 processIncidenceSelection( incidence );
3769} 3770}
3770 3771
3771void CalendarView::processIncidenceSelection( Incidence *incidence ) 3772void CalendarView::processIncidenceSelection( Incidence *incidence )
3772{ 3773{
3773 if ( incidence == mSelectedIncidence ) return; 3774 if ( incidence == mSelectedIncidence ) return;
3774 3775
3775 mSelectedIncidence = incidence; 3776 mSelectedIncidence = incidence;
3776 3777
3777 emit incidenceSelected( mSelectedIncidence ); 3778 emit incidenceSelected( mSelectedIncidence );
3778 3779
3779 if ( incidence && incidence->typeID() == eventID ) { 3780 if ( incidence && incidence->typeID() == eventID ) {
3780 Event *event = static_cast<Event *>( incidence ); 3781 Event *event = static_cast<Event *>( incidence );
3781 if ( event->organizer() == KOPrefs::instance()->email() ) { 3782 if ( event->organizer() == KOPrefs::instance()->email() ) {
3782 emit organizerEventsSelected( true ); 3783 emit organizerEventsSelected( true );
3783 } else { 3784 } else {
3784 emit organizerEventsSelected(false); 3785 emit organizerEventsSelected(false);
3785 } 3786 }
3786 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3787 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3787 KOPrefs::instance()->email() ) ) { 3788 KOPrefs::instance()->email() ) ) {
3788 emit groupEventsSelected( true ); 3789 emit groupEventsSelected( true );
3789 } else { 3790 } else {
3790 emit groupEventsSelected(false); 3791 emit groupEventsSelected(false);
3791 } 3792 }
3792 return; 3793 return;
3793 } else { 3794 } else {
3794 if ( incidence && incidence->typeID() == todoID ) { 3795 if ( incidence && incidence->typeID() == todoID ) {
3795 emit todoSelected( true ); 3796 emit todoSelected( true );
3796 Todo *event = static_cast<Todo *>( incidence ); 3797 Todo *event = static_cast<Todo *>( incidence );
3797 if ( event->organizer() == KOPrefs::instance()->email() ) { 3798 if ( event->organizer() == KOPrefs::instance()->email() ) {
3798 emit organizerEventsSelected( true ); 3799 emit organizerEventsSelected( true );
3799 } else { 3800 } else {
3800 emit organizerEventsSelected(false); 3801 emit organizerEventsSelected(false);
3801 } 3802 }
3802 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails, 3803 if (event->attendeeByMails( KOPrefs::instance()->mAdditionalMails,
3803 KOPrefs::instance()->email() ) ) { 3804 KOPrefs::instance()->email() ) ) {
3804 emit groupEventsSelected( true ); 3805 emit groupEventsSelected( true );
3805 } else { 3806 } else {
3806 emit groupEventsSelected(false); 3807 emit groupEventsSelected(false);
3807 } 3808 }
3808 return; 3809 return;
3809 } else { 3810 } else {
3810 emit todoSelected( false ); 3811 emit todoSelected( false );
3811 emit organizerEventsSelected(false); 3812 emit organizerEventsSelected(false);
3812 emit groupEventsSelected(false); 3813 emit groupEventsSelected(false);
3813 } 3814 }
3814 return; 3815 return;
3815 } 3816 }
3816 3817
3817 /* if ( incidence && incidence->typeID() == todoID ) { 3818 /* if ( incidence && incidence->typeID() == todoID ) {
3818 emit todoSelected( true ); 3819 emit todoSelected( true );
3819 } else { 3820 } else {
3820 emit todoSelected( false ); 3821 emit todoSelected( false );
3821 }*/ 3822 }*/
3822} 3823}
3823 3824
3824 3825
3825void CalendarView::checkClipboard() 3826void CalendarView::checkClipboard()
3826{ 3827{
3827#ifndef KORG_NODND 3828#ifndef KORG_NODND
3828 if (ICalDrag::canDecode(QApplication::clipboard()->data())) { 3829 if (ICalDrag::canDecode(QApplication::clipboard()->data())) {
3829 emit pasteEnabled(true); 3830 emit pasteEnabled(true);
3830 } else { 3831 } else {
3831 emit pasteEnabled(false); 3832 emit pasteEnabled(false);
3832 } 3833 }
3833#endif 3834#endif
3834} 3835}
3835 3836
3836void CalendarView::showDates(const DateList &selectedDates) 3837void CalendarView::showDates(const DateList &selectedDates)
3837{ 3838{
3838 // kdDebug() << "CalendarView::selectDates()" << endl; 3839 // kdDebug() << "CalendarView::selectDates()" << endl;
3839 3840
3840 3841
3841 if ( !mBlockShowDates ) { 3842 if ( !mBlockShowDates ) {
3842 if ( mViewManager->currentView() ) { 3843 if ( mViewManager->currentView() ) {
3843 updateView( selectedDates.first(), selectedDates.last() ); 3844 updateView( selectedDates.first(), selectedDates.last() );
3844 } else { 3845 } else {
3845 mViewManager->showAgendaView(); 3846 mViewManager->showAgendaView();
3846 } 3847 }
3847 } 3848 }
3848 3849
3849 QDate date = selectedDates.first(); 3850 QDate date = selectedDates.first();
3850 if ( ! date.isValid() ) { 3851 if ( ! date.isValid() ) {
3851 topLevelWidget()->setCaption(""); 3852 topLevelWidget()->setCaption("");
3852 return; 3853 return;
3853 } 3854 }
3854 3855
3855 QString selDates; 3856 QString selDates;
3856 selDates = KGlobal::locale()->formatDate( date, true); 3857 selDates = KGlobal::locale()->formatDate( date, true);
3857 if (selectedDates.first() < selectedDates.last() ) 3858 if (selectedDates.first() < selectedDates.last() )
3858 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true); 3859 selDates += " - " + KGlobal::locale()->formatDate( selectedDates.last(),true);
3859 else { 3860 else {
3860 QString addString; 3861 QString addString;
3861 if ( date == QDateTime::currentDateTime().date() ) 3862 if ( date == QDateTime::currentDateTime().date() )
3862 addString = i18n("Today"); 3863 addString = i18n("Today");
3863 else if ( date == QDateTime::currentDateTime().date().addDays(1) ) 3864 else if ( date == QDateTime::currentDateTime().date().addDays(1) )
3864 addString = i18n("Tomorrow"); 3865 addString = i18n("Tomorrow");
3865 else if ( date == QDateTime::currentDateTime().date().addDays(-1) ) 3866 else if ( date == QDateTime::currentDateTime().date().addDays(-1) )
3866 addString = i18n("Yesterday"); 3867 addString = i18n("Yesterday");
3867 else if ( date == QDateTime::currentDateTime().date().addDays(-2) ) 3868 else if ( date == QDateTime::currentDateTime().date().addDays(-2) )
3868 addString = i18n("Day before yesterday"); 3869 addString = i18n("Day before yesterday");
3869 else if ( date == QDateTime::currentDateTime().date().addDays(2) ) 3870 else if ( date == QDateTime::currentDateTime().date().addDays(2) )
3870 addString = i18n("Day after tomorrow"); 3871 addString = i18n("Day after tomorrow");
3871 if ( !addString.isEmpty() ) { 3872 if ( !addString.isEmpty() ) {
3872 topLevelWidget()->setCaption( addString+", " + selDates ); 3873 topLevelWidget()->setCaption( addString+", " + selDates );
3873 return; 3874 return;
3874 } 3875 }
3875 } 3876 }
3876 topLevelWidget()->setCaption( i18n("Dates: ") + selDates ); 3877 topLevelWidget()->setCaption( i18n("Dates: ") + selDates );
3877 3878
3878} 3879}
3879 3880
3880QPtrList<CalFilter> CalendarView::filters() 3881QPtrList<CalFilter> CalendarView::filters()
3881{ 3882{
3882 return mFilters; 3883 return mFilters;
3883 3884
3884} 3885}
3885void CalendarView::editFilters() 3886void CalendarView::editFilters()
3886{ 3887{
3887 // kdDebug() << "CalendarView::editFilters()" << endl; 3888 // kdDebug() << "CalendarView::editFilters()" << endl;
3888 3889
3889 CalFilter *filter = mFilters.first(); 3890 CalFilter *filter = mFilters.first();
3890 while(filter) { 3891 while(filter) {
3891 kdDebug() << " Filter: " << filter->name() << endl; 3892 kdDebug() << " Filter: " << filter->name() << endl;
3892 filter = mFilters.next(); 3893 filter = mFilters.next();
3893 } 3894 }
3894 3895
3895 mDialogManager->showFilterEditDialog(&mFilters); 3896 mDialogManager->showFilterEditDialog(&mFilters);
3896} 3897}
3897void CalendarView::toggleFilter() 3898void CalendarView::toggleFilter()
3898{ 3899{
3899 showFilter(! mFilterView->isVisible()); 3900 showFilter(! mFilterView->isVisible());
3900} 3901}
3901 3902
3902KOFilterView *CalendarView::filterView() 3903KOFilterView *CalendarView::filterView()
3903{ 3904{
3904 return mFilterView; 3905 return mFilterView;
3905} 3906}
3906void CalendarView::selectFilter( int fil ) 3907void CalendarView::selectFilter( int fil )
3907{ 3908{
3908 mFilterView->setSelectedFilter( fil ); 3909 mFilterView->setSelectedFilter( fil );
3909} 3910}
3910void CalendarView::showFilter(bool visible) 3911void CalendarView::showFilter(bool visible)
3911{ 3912{
3913#if 0
3912 if (visible) mCalEditView->show(); 3914 if (visible) mCalEditView->show();
3913 else mCalEditView->hide(); 3915 else mCalEditView->hide();
3914#if 0 3916#else
3915 if (visible) mFilterView->show(); 3917 if (visible) mFilterView->show();
3916 else mFilterView->hide(); 3918 else mFilterView->hide();
3917#endif 3919#endif
3918} 3920}
3919void CalendarView::toggleFilerEnabled( ) 3921void CalendarView::toggleFilerEnabled( )
3920{ 3922{
3921 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() ); 3923 mFilterView->setFiltersEnabled ( !mFilterView->filtersEnabled() );
3922 if ( !mFilterView->filtersEnabled() ) 3924 if ( !mFilterView->filtersEnabled() )
3923 topLevelWidget()->setCaption( i18n("Filter disabled ") ); 3925 topLevelWidget()->setCaption( i18n("Filter disabled ") );
3924 3926
3925} 3927}
3926void CalendarView::updateFilter() 3928void CalendarView::updateFilter()
3927{ 3929{
3928 CalFilter *filter = mFilterView->selectedFilter(); 3930 CalFilter *filter = mFilterView->selectedFilter();
3929 if (filter) { 3931 if (filter) {
3930 QString mess; 3932 QString mess;
3931 if (mFilterView->filtersEnabled()) { 3933 if (mFilterView->filtersEnabled()) {
3932 mess = i18n("Filter selected: ")+filter->name(); 3934 mess = i18n("Filter selected: ")+filter->name();
3933 filter->setEnabled(true); 3935 filter->setEnabled(true);
3934 } 3936 }
3935 else filter->setEnabled(false); 3937 else filter->setEnabled(false);
3936 mCalendar->setFilter(filter); 3938 mCalendar->setFilter(filter);
3937 updateView(); 3939 updateView();
3938 if ( !mess.isEmpty() ) 3940 if ( !mess.isEmpty() )
3939 topLevelWidget()->setCaption( mess ); 3941 topLevelWidget()->setCaption( mess );
3940 3942
3941 } 3943 }
3942} 3944}
3943 3945
3944void CalendarView::filterEdited() 3946void CalendarView::filterEdited()
3945{ 3947{
3946 mFilterView->updateFilters(); 3948 mFilterView->updateFilters();
3947 updateFilter(); 3949 updateFilter();
3948 writeSettings(); 3950 writeSettings();
3949} 3951}
3950 3952
3951 3953
3952void CalendarView::takeOverEvent() 3954void CalendarView::takeOverEvent()
3953{ 3955{
3954 Incidence *incidence = currentSelection(); 3956 Incidence *incidence = currentSelection();
3955 3957
3956 if (!incidence) return; 3958 if (!incidence) return;
3957 3959
3958 incidence->setOrganizer(KOPrefs::instance()->email()); 3960 incidence->setOrganizer(KOPrefs::instance()->email());
3959 incidence->recreate(); 3961 incidence->recreate();
3960 incidence->setReadOnly(false); 3962 incidence->setReadOnly(false);
3961 3963
3962 updateView(); 3964 updateView();
3963} 3965}
3964 3966
3965void CalendarView::takeOverCalendar() 3967void CalendarView::takeOverCalendar()
3966{ 3968{
3967 // TODO: Create Calendar::allIncidences() function and use it here 3969 // TODO: Create Calendar::allIncidences() function and use it here
3968 3970
3969 clearAllViews(); 3971 clearAllViews();
3970 QPtrList<Event> events = mCalendar->events(); 3972 QPtrList<Event> events = mCalendar->events();
3971 for(uint i=0; i<events.count(); ++i) { 3973 for(uint i=0; i<events.count(); ++i) {
3972 events.at(i)->setOrganizer(KOPrefs::instance()->email()); 3974 events.at(i)->setOrganizer(KOPrefs::instance()->email());
3973 events.at(i)->recreate(); 3975 events.at(i)->recreate();
3974 events.at(i)->setReadOnly(false); 3976 events.at(i)->setReadOnly(false);
3975 } 3977 }
3976 3978
3977 QPtrList<Todo> todos = mCalendar->todos(); 3979 QPtrList<Todo> todos = mCalendar->todos();
3978 for(uint i=0; i<todos.count(); ++i) { 3980 for(uint i=0; i<todos.count(); ++i) {
3979 todos.at(i)->setOrganizer(KOPrefs::instance()->email()); 3981 todos.at(i)->setOrganizer(KOPrefs::instance()->email());
3980 todos.at(i)->recreate(); 3982 todos.at(i)->recreate();
3981 todos.at(i)->setReadOnly(false); 3983 todos.at(i)->setReadOnly(false);
3982 } 3984 }
3983 3985
3984 QPtrList<Journal> journals = mCalendar->journals(); 3986 QPtrList<Journal> journals = mCalendar->journals();
3985 for(uint i=0; i<journals.count(); ++i) { 3987 for(uint i=0; i<journals.count(); ++i) {
3986 journals.at(i)->setOrganizer(KOPrefs::instance()->email()); 3988 journals.at(i)->setOrganizer(KOPrefs::instance()->email());
3987 journals.at(i)->recreate(); 3989 journals.at(i)->recreate();
3988 journals.at(i)->setReadOnly(false); 3990 journals.at(i)->setReadOnly(false);
3989 } 3991 }
3990 3992
3991 updateView(); 3993 updateView();
3992} 3994}
3993 3995
3994void CalendarView::showIntro() 3996void CalendarView::showIntro()
3995{ 3997{
3996 kdDebug() << "To be implemented." << endl; 3998 kdDebug() << "To be implemented." << endl;
3997} 3999}
3998 4000
3999QWidgetStack *CalendarView::viewStack() 4001QWidgetStack *CalendarView::viewStack()
4000{ 4002{
4001 return mRightFrame; 4003 return mRightFrame;
4002} 4004}
4003 4005
4004QWidget *CalendarView::leftFrame() 4006QWidget *CalendarView::leftFrame()
4005{ 4007{
4006 return ( QWidget *)mLeftFrame; 4008 return ( QWidget *)mLeftFrame;
4007} 4009}
4008 4010
4009DateNavigator *CalendarView::dateNavigator() 4011DateNavigator *CalendarView::dateNavigator()
4010{ 4012{
4011 return mNavigator; 4013 return mNavigator;
4012} 4014}
4013 4015
4014KDateNavigator* CalendarView::dateNavigatorWidget() 4016KDateNavigator* CalendarView::dateNavigatorWidget()
4015{ 4017{
4016 return mDateNavigator->navigatorView(); 4018 return mDateNavigator->navigatorView();
4017} 4019}
4018void CalendarView::toggleDateNavigatorWidget() 4020void CalendarView::toggleDateNavigatorWidget()
4019{ 4021{
4020 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ; 4022 KOPrefs::instance()->mShowDateNavigator = !KOPrefs::instance()->mShowDateNavigator ;
4021 4023
4022 if (!KOPrefs::instance()->mShowDateNavigator ) 4024 if (!KOPrefs::instance()->mShowDateNavigator )
4023 mDateNavigator->hide(); 4025 mDateNavigator->hide();
4024 else 4026 else
4025 mDateNavigator->show(); 4027 mDateNavigator->show();
4026} 4028}
4027void CalendarView::addView(KOrg::BaseView *view) 4029void CalendarView::addView(KOrg::BaseView *view)
4028{ 4030{
4029 mViewManager->addView(view); 4031 mViewManager->addView(view);
4030} 4032}
4031 4033
4032void CalendarView::showView(KOrg::BaseView *view) 4034void CalendarView::showView(KOrg::BaseView *view)
4033{ 4035{
4034 mViewManager->showView(view, mLeftFrame->isVisible()); 4036 mViewManager->showView(view, mLeftFrame->isVisible());
4035} 4037}
4036 4038
4037Incidence *CalendarView::currentSelection() 4039Incidence *CalendarView::currentSelection()
4038{ 4040{
4039 return mViewManager->currentSelection(); 4041 return mViewManager->currentSelection();
4040} 4042}
4041void CalendarView::toggleAllDaySize() 4043void CalendarView::toggleAllDaySize()
4042{ 4044{
4043 /* 4045 /*
4044 if ( KOPrefs::instance()->mAllDaySize > 47 ) 4046 if ( KOPrefs::instance()->mAllDaySize > 47 )
4045 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2; 4047 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize /2;
4046 else 4048 else
4047 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2; 4049 KOPrefs::instance()->mAllDaySize = KOPrefs::instance()->mAllDaySize *2;
4048 */ 4050 */
4049 viewManager()->agendaView()->toggleAllDay(); 4051 viewManager()->agendaView()->toggleAllDay();
4050} 4052}
4051void CalendarView::toggleExpand() 4053void CalendarView::toggleExpand()
4052{ 4054{
4053 // if ( mLeftFrame->isHidden() ) { 4055 // if ( mLeftFrame->isHidden() ) {
4054 // mLeftFrame->show(); 4056 // mLeftFrame->show();
4055 // emit calendarViewExpanded( false ); 4057 // emit calendarViewExpanded( false );
4056 // } else { 4058 // } else {
4057 // mLeftFrame->hide(); 4059 // mLeftFrame->hide();
4058 // emit calendarViewExpanded( true ); 4060 // emit calendarViewExpanded( true );
4059 // } 4061 // }
4060 //qDebug(" CalendarView::toggleExpand()"); 4062 //qDebug(" CalendarView::toggleExpand()");
4061 globalFlagBlockAgenda = 1; 4063 globalFlagBlockAgenda = 1;
4062 emit calendarViewExpanded( !mLeftFrame->isHidden() ); 4064 emit calendarViewExpanded( !mLeftFrame->isHidden() );
4063 globalFlagBlockAgenda = 5; 4065 globalFlagBlockAgenda = 5;
4064 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() ); 4066 mViewManager->raiseCurrentView( !mLeftFrame->isHidden() );
4065 //mViewManager->showView( 0, true ); 4067 //mViewManager->showView( 0, true );
4066} 4068}
4067 4069
4068void CalendarView::calendarModified( bool modified, Calendar * ) 4070void CalendarView::calendarModified( bool modified, Calendar * )
4069{ 4071{
4070 setModified( modified ); 4072 setModified( modified );
4071} 4073}
4072 4074
4073Todo *CalendarView::selectedTodo() 4075Todo *CalendarView::selectedTodo()
4074{ 4076{
4075 Incidence *incidence = currentSelection(); 4077 Incidence *incidence = currentSelection();
4076 if ( incidence && incidence->typeID() == todoID ) { 4078 if ( incidence && incidence->typeID() == todoID ) {
4077 return static_cast<Todo *>( incidence ); 4079 return static_cast<Todo *>( incidence );
4078 } 4080 }
4079 4081
4080 incidence = mTodoList->selectedIncidences().first(); 4082 incidence = mTodoList->selectedIncidences().first();
4081 if ( incidence && incidence->typeID() == todoID ) { 4083 if ( incidence && incidence->typeID() == todoID ) {
4082 return static_cast<Todo *>( incidence ); 4084 return static_cast<Todo *>( incidence );
4083 } 4085 }
4084 4086
4085 return 0; 4087 return 0;
4086} 4088}
4087 4089
4088void CalendarView::dialogClosing(Incidence *in) 4090void CalendarView::dialogClosing(Incidence *in)
4089{ 4091{
4090 // mDialogList.remove(in); 4092 // mDialogList.remove(in);
4091} 4093}
4092 4094
4093void CalendarView::showIncidence() 4095void CalendarView::showIncidence()
4094{ 4096{
4095 mViewerCallerIsSearchDialog = false; 4097 mViewerCallerIsSearchDialog = false;
4096 Incidence *incidence = currentSelection(); 4098 Incidence *incidence = currentSelection();
4097 if ( !incidence ) incidence = mTodoList->selectedIncidences().first(); 4099 if ( !incidence ) incidence = mTodoList->selectedIncidences().first();
4098 if ( incidence ) { 4100 if ( incidence ) {
4099 ShowIncidenceVisitor v; 4101 ShowIncidenceVisitor v;
4100 v.act( incidence, this ); 4102 v.act( incidence, this );
4101 } 4103 }
4102} 4104}
4103void CalendarView::editIncidenceDescription() 4105void CalendarView::editIncidenceDescription()
4104{ 4106{
4105 mFlagEditDescription = true; 4107 mFlagEditDescription = true;
4106 editIncidence(); 4108 editIncidence();
diff --git a/korganizer/kofilterview.cpp b/korganizer/kofilterview.cpp
index 1bfe4dd..dc6237b 100644
--- a/korganizer/kofilterview.cpp
+++ b/korganizer/kofilterview.cpp
@@ -1,176 +1,176 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23 23
24#include <qcheckbox.h> 24#include <qcheckbox.h>
25#include <qcombobox.h> 25#include <qcombobox.h>
26#include <qpushbutton.h> 26#include <qpushbutton.h>
27#include <qlayout.h> 27#include <qlayout.h>
28#include <qlabel.h> 28#include <qlabel.h>
29 29
30 30
31#include <libkcal/calfilter.h> 31#include <libkcal/calfilter.h>
32 32
33#include "kofilterview.h" 33#include "kofilterview.h"
34#include <kiconloader.h> 34#include <kiconloader.h>
35#include <kglobal.h> 35#include <kglobal.h>
36 36
37KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent, 37KOFilterView::KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent,
38 const char* name,WFlags fl ) 38 const char* name,WFlags fl )
39 : KOFilterView_base(parent,name,fl) 39 : KOFilterView_base(parent,name,fl)
40{ 40{
41 mFilters = filterList; 41 mFilters = filterList;
42 42
43 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); 43 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
44 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); 44 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
45 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters())); 45 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editFilters()));
46} 46}
47 47
48KOFilterView::~KOFilterView() 48KOFilterView::~KOFilterView()
49{ 49{
50 // no need to delete child widgets, Qt does it all for us 50 // no need to delete child widgets, Qt does it all for us
51} 51}
52 52
53bool KOFilterView::filtersEnabled() 53bool KOFilterView::filtersEnabled()
54{ 54{
55 return mEnabledCheck->isChecked(); 55 return mEnabledCheck->isChecked();
56} 56}
57 57
58void KOFilterView::setFiltersEnabled(bool set) 58void KOFilterView::setFiltersEnabled(bool set)
59{ 59{
60 mEnabledCheck->setChecked(set); 60 mEnabledCheck->setChecked(set);
61 emit filterChanged(); 61 emit filterChanged();
62} 62}
63 63
64 64
65void KOFilterView::updateFilters() 65void KOFilterView::updateFilters()
66{ 66{
67 mSelectionCombo->clear(); 67 mSelectionCombo->clear();
68 68
69 CalFilter *filter = mFilters->first(); 69 CalFilter *filter = mFilters->first();
70 while(filter) { 70 while(filter) {
71 mSelectionCombo->insertItem(filter->name()); 71 mSelectionCombo->insertItem(filter->name());
72 filter = mFilters->next(); 72 filter = mFilters->next();
73 } 73 }
74} 74}
75 75
76CalFilter *KOFilterView::selectedFilter() 76CalFilter *KOFilterView::selectedFilter()
77{ 77{
78 CalFilter *f = mFilters->at(mSelectionCombo->currentItem()); 78 CalFilter *f = mFilters->at(mSelectionCombo->currentItem());
79 return f; 79 return f;
80} 80}
81 81
82void KOFilterView::setSelectedFilter(QString filterName) 82void KOFilterView::setSelectedFilter(QString filterName)
83{ 83{
84 int filter_num = mSelectionCombo->count(); 84 int filter_num = mSelectionCombo->count();
85 int i; 85 int i;
86 for (i=0;i<filter_num;i++) { 86 for (i=0;i<filter_num;i++) {
87 if (mSelectionCombo->text(i)==filterName) 87 if (mSelectionCombo->text(i)==filterName)
88 mSelectionCombo->setCurrentItem(i); 88 mSelectionCombo->setCurrentItem(i);
89 } 89 }
90 emit filterChanged(); 90 emit filterChanged();
91} 91}
92void KOFilterView::setSelectedFilter( int fil ) 92void KOFilterView::setSelectedFilter( int fil )
93{ 93{
94 if ( fil >= mSelectionCombo->count() ) 94 if ( fil >= mSelectionCombo->count() )
95 return; 95 return;
96 mSelectionCombo->setCurrentItem( fil ); 96 mSelectionCombo->setCurrentItem( fil );
97 emit filterChanged(); 97 emit filterChanged();
98} 98}
99 99
100 100
101 101
102KOCalEditView::KOCalEditView(QWidget* parent, 102KOCalEditView::KOCalEditView(QWidget* parent,
103 const char* name ) 103 const char* name )
104 : QWidget(parent,name) 104 : QWidget(parent,name)
105{ 105{
106 /* 106 /*
107 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged())); 107 connect(mSelectionCombo,SIGNAL(activated(int)),SIGNAL(filterChanged()));
108 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged())); 108 connect(mEnabledCheck,SIGNAL(clicked()),SIGNAL(filterChanged()));
109 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editCalEdits())); 109 connect(mEditButton,SIGNAL(clicked()),SIGNAL(editCalEdits()));
110 */ 110 */
111 QGridLayout* mainLayout = new QGridLayout ( this , 2, 6 ); 111 QGridLayout* mainLayout = new QGridLayout ( this , 2, 6 );
112 QPushButton * addBut = new QPushButton ( this ); 112 QPushButton * addBut = new QPushButton ( this );
113 mainLayout->addWidget( addBut,0,0 ); 113 mainLayout->addWidget( addBut,0,0 );
114 addBut->setPixmap ( SmallIcon("plus")); 114 addBut->setPixmap ( SmallIcon("plus"));
115 connect(addBut,SIGNAL(clicked()),SLOT(addCal())); 115 connect(addBut,SIGNAL(clicked()),SLOT(addCal()));
116 addBut->setMaximumWidth( addBut->sizeHint().height() ); 116 addBut->setMaximumWidth( addBut->sizeHint().height() );
117 117
118 addBut = new QPushButton ( this ); 118 addBut = new QPushButton ( this );
119 mainLayout->addWidget( addBut,0,1 ); 119 mainLayout->addWidget( addBut,0,1 );
120 addBut->setPixmap ( SmallIcon("eye")); 120 addBut->setPixmap ( SmallIcon("eye"));
121 connect(addBut,SIGNAL(clicked()),SLOT(enableAll())); 121 connect(addBut,SIGNAL(clicked()),SLOT(enableAll()));
122 addBut->setMaximumWidth( addBut->sizeHint().height() ); 122 addBut->setMaximumWidth( addBut->sizeHint().height() );
123 123
124 QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", this ); 124 QLabel* lab = new QLabel ( " "+i18n("Calendar")+" ", this );
125 mainLayout->addWidget( lab,0,2 ); 125 mainLayout->addWidget( lab,0,2 );
126 126
127 addBut = new QPushButton ( this ); 127 addBut = new QPushButton ( this );
128 mainLayout->addWidget( addBut,0,3 ); 128 mainLayout->addWidget( addBut,0,3 );
129 addBut->setPixmap ( SmallIcon("bell")); 129 addBut->setPixmap ( SmallIcon("bell"));
130 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm())); 130 connect(addBut,SIGNAL(clicked()),SLOT(enableAlarm()));
131 addBut->setMaximumWidth( addBut->sizeHint().height() ); 131 addBut->setMaximumWidth( addBut->sizeHint().height() );
132 132
133 addBut = new QPushButton ( this ); 133 addBut = new QPushButton ( this );
134 mainLayout->addWidget( addBut,0,4 ); 134 mainLayout->addWidget( addBut,0,4 );
135 addBut->setPixmap ( SmallIcon("pencil")); 135 addBut->setPixmap ( SmallIcon("pencil"));
136 connect(addBut,SIGNAL(clicked()),SLOT(disableRO())); 136 connect(addBut,SIGNAL(clicked()),SLOT(disableRO()));
137 addBut->setMaximumWidth( addBut->sizeHint().height() ); 137 addBut->setMaximumWidth( addBut->sizeHint().height() );
138 138
139 addBut = new QPushButton ( this ); 139 addBut = new QPushButton ( this );
140 mainLayout->addWidget( addBut,0,5 ); 140 mainLayout->addWidget( addBut,0,5 );
141 addBut->setPixmap ( SmallIcon("trash")); 141 addBut->setPixmap ( SmallIcon("minus"));
142 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll())); 142 connect(addBut,SIGNAL(clicked()),SLOT(deleteAll()));
143 addBut->setMaximumWidth( addBut->sizeHint().height() ); 143 addBut->setMaximumWidth( addBut->sizeHint().height() );
144 144
145 145
146 146
147} 147}
148 148
149KOCalEditView::~KOCalEditView() 149KOCalEditView::~KOCalEditView()
150{ 150{
151 // no need to delete child widgets, Qt does it all for us 151 // no need to delete child widgets, Qt does it all for us
152} 152}
153void KOCalEditView::readConfig( KConfig *) 153void KOCalEditView::readConfig( KConfig *)
154{ 154{
155 155
156} 156}
157void KOCalEditView::addCal() 157void KOCalEditView::addCal()
158{ 158{
159 qDebug("addcal "); 159 qDebug("addcal ");
160} 160}
161void KOCalEditView::enableAll() 161void KOCalEditView::enableAll()
162{ 162{
163 qDebug("enableAll"); 163 qDebug("enableAll");
164} 164}
165void KOCalEditView::enableAlarm() 165void KOCalEditView::enableAlarm()
166{ 166{
167 qDebug("enableAlarm"); 167 qDebug("enableAlarm");
168} 168}
169void KOCalEditView::disableRO() 169void KOCalEditView::disableRO()
170{ 170{
171 qDebug("OCalEditView::disableRO() "); 171 qDebug("OCalEditView::disableRO() ");
172} 172}
173void KOCalEditView::deleteAll() 173void KOCalEditView::deleteAll()
174{ 174{
175 qDebug("delteAll"); 175 qDebug("delteAll");
176} 176}
diff --git a/korganizer/kofilterview.h b/korganizer/kofilterview.h
index d434c52..060108f 100644
--- a/korganizer/kofilterview.h
+++ b/korganizer/kofilterview.h
@@ -1,83 +1,133 @@
1/* 1/*
2 This file is part of KOrganizer. 2 This file is part of KOrganizer.
3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org> 3 Copyright (c) 2001 Cornelius Schumacher <schumacher@kde.org>
4 4
5 This program is free software; you can redistribute it and/or modify 5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by 6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or 7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version. 8 (at your option) any later version.
9 9
10 This program is distributed in the hope that it will be useful, 10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of 11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details. 13 GNU General Public License for more details.
14 14
15 You should have received a copy of the GNU General Public License 15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software 16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 18
19 As a special exception, permission is given to link this program 19 As a special exception, permission is given to link this program
20 with any edition of Qt, and distribute the resulting executable, 20 with any edition of Qt, and distribute the resulting executable,
21 without including the source code for Qt in the source distribution. 21 without including the source code for Qt in the source distribution.
22*/ 22*/
23#ifndef KOFILTERVIEW_H 23#ifndef KOFILTERVIEW_H
24#define KOFILTERVIEW_H 24#define KOFILTERVIEW_H
25 25
26#include <qstring.h> 26#include <qstring.h>
27#include <qcheckbox.h>
28#include <qpushbutton.h>
27#include <kconfig.h> 29#include <kconfig.h>
28#include "kofilterview_base.h" 30#include "kofilterview_base.h"
29 31
30#include <libkcal/calfilter.h> 32#include <libkcal/calfilter.h>
31 33
32using namespace KCal; 34using namespace KCal;
33 35
34class KOFilterView : public KOFilterView_base 36class KOFilterView : public KOFilterView_base
35{ 37{
36 Q_OBJECT 38 Q_OBJECT
37 public: 39 public:
38 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0); 40 KOFilterView(QPtrList<CalFilter> *filterList,QWidget* parent=0,const char* name=0, WFlags fl=0);
39 ~KOFilterView(); 41 ~KOFilterView();
40 42
41 void updateFilters(); 43 void updateFilters();
42 44
43 bool filtersEnabled(); 45 bool filtersEnabled();
44 void setFiltersEnabled(bool); 46 void setFiltersEnabled(bool);
45 CalFilter *selectedFilter(); 47 CalFilter *selectedFilter();
46 void setSelectedFilter(QString); 48 void setSelectedFilter(QString);
47 void setSelectedFilter( int ); 49 void setSelectedFilter( int );
48 50
49 signals: 51 signals:
50 void filterChanged(); 52 void filterChanged();
51 void editFilters(); 53 void editFilters();
52 54
53 private: 55 private:
54 QPtrList<CalFilter> *mFilters; 56 QPtrList<CalFilter> *mFilters;
55}; 57};
56 58
57class KOCalEditView : public QWidget 59class KOCalEditView : public QWidget
58{ 60{
59 Q_OBJECT 61 Q_OBJECT
60 public: 62 public:
61 KOCalEditView( QWidget* parent=0,const char* name=0); 63 KOCalEditView( QWidget* parent=0,const char* name=0);
62 ~KOCalEditView(); 64 ~KOCalEditView();
63 65
64 void readConfig( KConfig *); 66 void readConfig( KConfig *);
65 public slots: 67 public slots:
66 void addCal(); 68 void addCal();
67 void enableAll(); 69 void enableAll();
68 void enableAlarm(); 70 void enableAlarm();
69 void disableRO(); 71 void disableRO();
70 void deleteAll(); 72 void deleteAll();
71 signals: 73 signals:
72 void alarmEnabled ( int cal, bool enable ); 74 void alarmEnabled ( int cal, bool enable );
73 void calendarEnabled ( int cal, bool enable ); 75 void calendarEnabled ( int cal, bool enable );
74 void calendarReadonly ( int cal, bool readonly ); 76 void calendarReadonly ( int cal, bool readonly );
75 void setCalendarDefault ( int cal ); 77 void setCalendarDefault ( int cal );
76 void removeCalendar ( int cal ); 78 void removeCalendar ( int cal );
77 79
78 private: 80 private:
79}; 81};
80 82
83class KOCalButton : public QPushButton
84{
85 Q_OBJECT
86 public:
87 KOCalButton( QWidget *parent=0, const char *name=0 ) :
88 QPushButton( parent, name)
89 {
90 connect( this, SIGNAL( clicked() ),
91 SLOT( bottonClicked() ));
92 mNumber = -1;
93 }
94 void setNum ( int num ) {mNumber = num; }
95 signals:
96 void selectNum ( int );
97private:
98 int mNumber;
99 void keyPressEvent ( QKeyEvent * e )
100 {
101 e->ignore();
102 }
103
104private slots :
105 void bottonClicked() { if ( mNumber > 0 ) emit selectNum ( mNumber ); }
106};
107class KOCalCheckButton : public QCheckBox
108{
109 Q_OBJECT
110 public:
111 KOCalCheckButton( QWidget *parent=0, const char *name=0 ) :
112 QCheckBox( parent, name)
113 {
114 connect( this, SIGNAL( toggled ( bool ) ),
115 SLOT( bottonClicked( bool ) ));
116 mNumber = -1;
117 }
118 void setNum ( int num ) {mNumber = num; }
119 signals:
120 void selectNum ( int, bool );
121private:
122 int mNumber;
123 void keyPressEvent ( QKeyEvent * e )
124 {
125 e->ignore();
126 }
127
128private slots :
129 void bottonClicked( bool b) { if ( mNumber > 0 ) emit selectNum ( mNumber , b); }
130};
81 131
82 132
83#endif // KOFILTERVIEW_H 133#endif // KOFILTERVIEW_H