summaryrefslogtreecommitdiffabout
path: root/korganizer
authorzautrix <zautrix>2005-06-29 20:48:31 (UTC)
committer zautrix <zautrix>2005-06-29 20:48:31 (UTC)
commitf55b992a98cc081207b23283aadcf2ecffc90a87 (patch) (unidiff)
treeb0b54ac4f2a164ac7e7ca49bea78f62e4f58fa62 /korganizer
parent8954bae7bb5afc9706e37e808e9c1e237399f214 (diff)
downloadkdepimpi-f55b992a98cc081207b23283aadcf2ecffc90a87.zip
kdepimpi-f55b992a98cc081207b23283aadcf2ecffc90a87.tar.gz
kdepimpi-f55b992a98cc081207b23283aadcf2ecffc90a87.tar.bz2
fixxxx
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp16
-rw-r--r--korganizer/calendarview.h2
2 files changed, 15 insertions, 3 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 776cdd3..623cf9d 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -435,50 +435,53 @@ void CalendarView::init()
435 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);; 435 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, mMainFrame);;
436 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right ); 436 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Right );
437 } else { 437 } else {
438 //mainBoxLayout = new QHBoxLayout(mainBox); 438 //mainBoxLayout = new QHBoxLayout(mainBox);
439 //leftFrameLayout = new QVBoxLayout(leftFrame ); 439 //leftFrameLayout = new QVBoxLayout(leftFrame );
440 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); 440 mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this);
441 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); 441 mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left);
442 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); 442 mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame);
443 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); 443 mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up );
444 } 444 }
445 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); 445 mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) );
446 //QBoxLayout * leftFrameLayout; 446 //QBoxLayout * leftFrameLayout;
447 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
448 topLayout->addWidget( mMainFrame ); 447 topLayout->addWidget( mMainFrame );
449 topLayout->addWidget( mDateScrollBar ); 448#ifdef DESKTOP_VERSION
449 mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
450 topLayout->addWidget( mDateScrollBar );
451 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
452#endif
450 //mainBoxLayout->addWidget (mLeftFrame); 453 //mainBoxLayout->addWidget (mLeftFrame);
451 mDateNavigator = new DateNavigatorContainer( mLeftFrame, 454 mDateNavigator = new DateNavigatorContainer( mLeftFrame,
452 "CalendarView::DateNavigator" ); 455 "CalendarView::DateNavigator" );
453#if 0 456#if 0
454 // FIXME 457 // FIXME
455 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, 458 mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE,
456 "CalendarView::DateNavigator", QDate::currentDate()); 459 "CalendarView::DateNavigator", QDate::currentDate());
457#endif 460#endif
458 // mDateNavigator->blockSignals( true ); 461 // mDateNavigator->blockSignals( true );
459 //leftFrameLayout->addWidget( mDateNavigator ); 462 //leftFrameLayout->addWidget( mDateNavigator );
460 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall"); 463 mTodoList = new KOTodoView(mCalendar, mLeftFrame, "todolistsmall");
461 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView"); 464 mFilterView = new KOFilterView(&mFilters,mLeftFrame,"CalendarView::FilterView");
462 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView"); 465 mCalEditView = new KOCalEditView(mLeftFrame,"CalendarView::CaleditView");
463 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) ); 466 connect( mCalEditView, SIGNAL( calendarEnabled (int,bool) ),mCalendar, SLOT( setCalendarEnabled(int,bool)) );
464 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); 467 connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) );
465 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); 468 connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) );
466 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); 469 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) );
467 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); 470 connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) );
468 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); 471 connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) );
469 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); 472 connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) );
470 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); 473 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) );
471 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); 474 connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
472 connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); 475
473 mTodoList->setNavigator( mNavigator ); 476 mTodoList->setNavigator( mNavigator );
474#if 0 477#if 0
475 if ( QApplication::desktop()->width() < 480 ) { 478 if ( QApplication::desktop()->width() < 480 ) {
476 leftFrameLayout->addWidget(mFilterView); 479 leftFrameLayout->addWidget(mFilterView);
477 leftFrameLayout->addWidget(mTodoList, 2 ); 480 leftFrameLayout->addWidget(mTodoList, 2 );
478 481
479 } else { 482 } else {
480 leftFrameLayout->addWidget(mTodoList,2 ); 483 leftFrameLayout->addWidget(mTodoList,2 );
481 leftFrameLayout->addWidget(mFilterView ); 484 leftFrameLayout->addWidget(mFilterView );
482 } 485 }
483#endif 486#endif
484 mFilterView->hide(); 487 mFilterView->hide();
@@ -640,43 +643,48 @@ CalendarView::~CalendarView()
640{ 643{
641 // kdDebug() << "~CalendarView()" << endl; 644 // kdDebug() << "~CalendarView()" << endl;
642 //qDebug("CalendarView::~CalendarView() "); 645 //qDebug("CalendarView::~CalendarView() ");
643 delete mDialogManager; 646 delete mDialogManager;
644 delete mViewManager; 647 delete mViewManager;
645 delete mStorage; 648 delete mStorage;
646 delete mDateFrame ; 649 delete mDateFrame ;
647 delete mEventViewerDialog; 650 delete mEventViewerDialog;
648 //kdDebug() << "~CalendarView() done" << endl; 651 //kdDebug() << "~CalendarView() done" << endl;
649} 652}
650void CalendarView::setScrollBarStep(int val ) 653void CalendarView::setScrollBarStep(int val )
651{ 654{
655#ifdef DESKTOP_VERSION
652 mDateScrollBar->setLineStep ( val ); 656 mDateScrollBar->setLineStep ( val );
657#endif
653} 658}
654void CalendarView::scrollBarValue(int val ) 659void CalendarView::scrollBarValue(int val )
655{ 660{
661#ifdef DESKTOP_VERSION
662 if ( QApplication::desktop()->width() < 800 ) return;
656 static bool block = false; 663 static bool block = false;
657 if ( block ) return; 664 if ( block ) return;
658 block = true; 665 block = true;
659 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); 666 val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep();
660 //qDebug("VAL %d ",val ); 667 //qDebug("VAL %d ",val );
661 int count = mNavigator->selectedDates().count(); 668 int count = mNavigator->selectedDates().count();
662 int year = mNavigator->selectedDates().first().year(); 669 int year = mNavigator->selectedDates().first().year();
663 int day = mNavigator->selectedDates().first().dayOfYear(); 670 int day = mNavigator->selectedDates().first().dayOfYear();
664 if ( val == day -1 ) { 671 if ( val == day -1 ) {
665 block = false; 672 block = false;
666 return; 673 return;
667 } 674 }
668 QDate d ( year,1,1 ); 675 QDate d ( year,1,1 );
669 mNavigator->selectDates( d.addDays( val ), count ); 676 mNavigator->selectDates( d.addDays( val ), count );
670 block = false; 677 block = false;
678#endif
671 679
672} 680}
673 681
674void CalendarView::checkAlarms() 682void CalendarView::checkAlarms()
675{ 683{
676 KConfig *config = KOGlobals::config(); 684 KConfig *config = KOGlobals::config();
677 config->setGroup( "AppRun" ); 685 config->setGroup( "AppRun" );
678 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); 686 QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) );
679 int daysto = dt.daysTo( QDate::currentDate() ); 687 int daysto = dt.daysTo( QDate::currentDate() );
680 int days = config->readNumEntry( "LatestProgramStopDays" , daysto); 688 int days = config->readNumEntry( "LatestProgramStopDays" , daysto);
681 dt = dt.addDays( days ); 689 dt = dt.addDays( days );
682 int secto = dt.secsTo( QDateTime::currentDateTime() ); 690 int secto = dt.secsTo( QDateTime::currentDateTime() );
@@ -2575,25 +2583,27 @@ void CalendarView::changeEventDisplay(Event *which, int action)
2575 2583
2576 2584
2577void CalendarView::updateTodoViews() 2585void CalendarView::updateTodoViews()
2578{ 2586{
2579 mTodoList->updateView(); 2587 mTodoList->updateView();
2580 mViewManager->currentView()->updateView(); 2588 mViewManager->currentView()->updateView();
2581 2589
2582} 2590}
2583 2591
2584 2592
2585void CalendarView::updateView(const QDate &start, const QDate &end) 2593void CalendarView::updateView(const QDate &start, const QDate &end)
2586{ 2594{
2595#ifdef DESKTOP_VERSION
2587 mDateScrollBar->setValue( start.dayOfYear()-1); 2596 mDateScrollBar->setValue( start.dayOfYear()-1);
2597#endif
2588 mTodoList->updateView(); 2598 mTodoList->updateView();
2589 mViewManager->updateView(start, end); 2599 mViewManager->updateView(start, end);
2590 //mDateNavigator->updateView(); 2600 //mDateNavigator->updateView();
2591} 2601}
2592 2602
2593void CalendarView::clearAllViews() 2603void CalendarView::clearAllViews()
2594{ 2604{
2595 mTodoList->clearList(); 2605 mTodoList->clearList();
2596 mViewManager->clearAllViews(); 2606 mViewManager->clearAllViews();
2597 SearchDialog * sd = mDialogManager->getSearchDialog(); 2607 SearchDialog * sd = mDialogManager->getSearchDialog();
2598 if ( sd ) { 2608 if ( sd ) {
2599 KOListView* kol = sd->listview(); 2609 KOListView* kol = sd->listview();
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index c89bbf7..f7e5366 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -526,25 +526,27 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
526 void setBlockShowDates( bool b ) { mBlockShowDates = b ;} 526 void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
527 void setScrollBarStep(int val ); 527 void setScrollBarStep(int val );
528 528
529 protected: 529 protected:
530 void schedule(Scheduler::Method, Incidence *incidence = 0); 530 void schedule(Scheduler::Method, Incidence *incidence = 0);
531 531
532 // returns KMsgBox::OKCandel() 532 // returns KMsgBox::OKCandel()
533 int msgItemDelete(const QString name); 533 int msgItemDelete(const QString name);
534 void showEventEditor(); 534 void showEventEditor();
535 void showTodoEditor(); 535 void showTodoEditor();
536 Todo *selectedTodo(); 536 Todo *selectedTodo();
537 private: 537 private:
538#ifdef DESKTOP_VERSION
538 QScrollBar * mDateScrollBar; 539 QScrollBar * mDateScrollBar;
540#endif
539 QDateTime mNextAlarmDateTime; 541 QDateTime mNextAlarmDateTime;
540 bool mViewerCallerIsSearchDialog; 542 bool mViewerCallerIsSearchDialog;
541 bool mBlockShowDates; 543 bool mBlockShowDates;
542 KSyncManager* mSyncManager; 544 KSyncManager* mSyncManager;
543 AlarmDialog * mAlarmDialog; 545 AlarmDialog * mAlarmDialog;
544 QString mAlarmNotification; 546 QString mAlarmNotification;
545 QString mSuspendAlarmNotification; 547 QString mSuspendAlarmNotification;
546 QTimer* mSuspendTimer; 548 QTimer* mSuspendTimer;
547 QTimer* mAlarmTimer; 549 QTimer* mAlarmTimer;
548 QTimer* mRecheckAlarmTimer; 550 QTimer* mRecheckAlarmTimer;
549 void computeAlarm( QString ); 551 void computeAlarm( QString );
550 void startAlarm( QString, QString ); 552 void startAlarm( QString, QString );