-rw-r--r-- | korganizer/calendarview.cpp | 16 |
1 files changed, 13 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 @@ -439,19 +439,22 @@ void CalendarView::init() //leftFrameLayout = new QVBoxLayout(leftFrame ); mMainFrame = new KDGanttMinimizeSplitter( Qt::Horizontal, this); mMainFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Left); mLeftFrame = new KDGanttMinimizeSplitter( Qt::Vertical, mMainFrame); mLeftFrame->setMinimizeDirection ( KDGanttMinimizeSplitter::Up ); } mMainFrame->setSizePolicy( QSizePolicy (QSizePolicy::Expanding,QSizePolicy::Expanding) ); //QBoxLayout * leftFrameLayout; - mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); topLayout->addWidget( mMainFrame ); - topLayout->addWidget( mDateScrollBar ); +#ifdef DESKTOP_VERSION + mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this ); + topLayout->addWidget( mDateScrollBar ); + connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); +#endif //mainBoxLayout->addWidget (mLeftFrame); mDateNavigator = new DateNavigatorContainer( mLeftFrame, "CalendarView::DateNavigator" ); #if 0 // FIXME mDateNavigator = new KDateNavigator(mLeftFrame, mCalendar, TRUE, "CalendarView::DateNavigator", QDate::currentDate()); #endif @@ -464,17 +467,17 @@ void CalendarView::init() connect( mCalEditView, SIGNAL( alarmEnabled(int,bool) ),mCalendar, SLOT( setAlarmEnabled(int,bool)) ); connect( mCalEditView, SIGNAL( calendarReadonly(int,bool) ),mCalendar, SLOT( setReadOnly(int,bool)) ); connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mCalendar, SLOT( setDefaultCalendar(int)) ); connect( mCalEditView, SIGNAL( setCalendarDefault(int) ),mViewManager, SLOT( setDefaultCalendar(int)) ); connect( mCalEditView, SIGNAL( removeCalendar(int) ),mCalendar, SLOT( setCalendarRemove(int)) ); connect( mCalEditView, SIGNAL( calendarAdded(int) ),this, SLOT( addCalendarId(int)) ); connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateView()) ); connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) ); - connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) ); + mTodoList->setNavigator( mNavigator ); #if 0 if ( QApplication::desktop()->width() < 480 ) { leftFrameLayout->addWidget(mFilterView); leftFrameLayout->addWidget(mTodoList, 2 ); } else { leftFrameLayout->addWidget(mTodoList,2 ); @@ -644,35 +647,40 @@ CalendarView::~CalendarView() delete mViewManager; delete mStorage; delete mDateFrame ; delete mEventViewerDialog; //kdDebug() << "~CalendarView() done" << endl; } void CalendarView::setScrollBarStep(int val ) { +#ifdef DESKTOP_VERSION mDateScrollBar->setLineStep ( val ); +#endif } void CalendarView::scrollBarValue(int val ) { +#ifdef DESKTOP_VERSION + if ( QApplication::desktop()->width() < 800 ) return; static bool block = false; if ( block ) return; block = true; val = val/mDateScrollBar->lineStep ()*mDateScrollBar->lineStep(); //qDebug("VAL %d ",val ); int count = mNavigator->selectedDates().count(); int year = mNavigator->selectedDates().first().year(); int day = mNavigator->selectedDates().first().dayOfYear(); if ( val == day -1 ) { block = false; return; } QDate d ( year,1,1 ); mNavigator->selectDates( d.addDays( val ), count ); block = false; +#endif } void CalendarView::checkAlarms() { KConfig *config = KOGlobals::config(); config->setGroup( "AppRun" ); QDateTime dt ( QDate (2005,1,1), QTime( 0,0,0 ) ); @@ -2579,17 +2587,19 @@ void CalendarView::updateTodoViews() mTodoList->updateView(); mViewManager->currentView()->updateView(); } void CalendarView::updateView(const QDate &start, const QDate &end) { +#ifdef DESKTOP_VERSION mDateScrollBar->setValue( start.dayOfYear()-1); +#endif mTodoList->updateView(); mViewManager->updateView(start, end); //mDateNavigator->updateView(); } void CalendarView::clearAllViews() { mTodoList->clearList(); |