summaryrefslogtreecommitdiffabout
path: root/korganizer
Side-by-side diff
Diffstat (limited to 'korganizer') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp60
-rw-r--r--korganizer/calendarview.h8
-rw-r--r--korganizer/koviewmanager.cpp10
3 files changed, 50 insertions, 28 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 697093e..776cdd3 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -370,6 +370,5 @@ void CalendarView::init()
mBlockShowDates = false;
- beamDialog = new KOBeamPrefs();
+
mDatePickerMode = 0;
mCurrentSyncDevice = "";
- writeLocale();
mViewManager = new KOViewManager( this );
@@ -447,3 +446,5 @@ void CalendarView::init()
//QBoxLayout * leftFrameLayout;
+ mDateScrollBar = new QScrollBar ( 0, 364, 1,30, 200,QScrollBar::Horizontal, this );
topLayout->addWidget( mMainFrame );
+ topLayout->addWidget( mDateScrollBar );
//mainBoxLayout->addWidget (mLeftFrame);
@@ -470,2 +471,3 @@ void CalendarView::init()
connect( mCalEditView, SIGNAL( needsUpdate() ),this, SLOT( updateUnmanagedViews()) );
+ connect( mDateScrollBar, SIGNAL( valueChanged ( int ) ),this, SLOT( scrollBarValue( int )) );
mTodoList->setNavigator( mNavigator );
@@ -644,3 +646,2 @@ CalendarView::~CalendarView()
delete mDateFrame ;
- delete beamDialog;
delete mEventViewerDialog;
@@ -648,2 +649,26 @@ CalendarView::~CalendarView()
}
+void CalendarView::setScrollBarStep(int val )
+{
+ mDateScrollBar->setLineStep ( val );
+}
+void CalendarView::scrollBarValue(int val )
+{
+ 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;
+
+}
+
void CalendarView::checkAlarms()
@@ -2469,23 +2494,5 @@ void CalendarView::goPreviousMonth()
}
-void CalendarView::writeLocale()
-{
- //KPimGlobalPrefs::instance()->setGlobalConfig();
-#if 0
- KGlobal::locale()->setHore24Format( !KOPrefs::instance()->mPreferredTime );
- KGlobal::locale()->setWeekStartMonday( !KOPrefs::instance()->mWeekStartsOnSunday );
- KGlobal::locale()->setIntDateFormat( (KLocale::IntDateFormat)KOPrefs::instance()->mPreferredDate );
- KGlobal::locale()->setLanguage( KOPrefs::instance()->mPreferredLanguage );
- QString dummy = KOPrefs::instance()->mUserDateFormatLong;
- KGlobal::locale()->setDateFormat(dummy.replace( QRegExp("K"), QString(",") ));
- dummy = KOPrefs::instance()->mUserDateFormatShort;
- KGlobal::locale()->setDateFormatShort(dummy.replace( QRegExp("K"), QString(",") ));
- KGlobal::locale()->setDaylightSaving( KOPrefs::instance()->mUseDaylightsaving,
- KOPrefs::instance()->mDaylightsavingStart,
- KOPrefs::instance()->mDaylightsavingEnd );
- KGlobal::locale()->setTimezone( KPimGlobalPrefs::instance()->mTimeZoneId );
-#endif
-}
+
void CalendarView::updateConfig()
{
- writeLocale();
if ( KOPrefs::instance()->mUseAppColors )
@@ -2579,2 +2586,3 @@ void CalendarView::updateView(const QDate &start, const QDate &end)
{
+ mDateScrollBar->setValue( start.dayOfYear()-1);
mTodoList->updateView();
@@ -2846,3 +2854,5 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
{
- if ( beamDialog->exec () == QDialog::Rejected )
+
+ KOBeamPrefs beamDialog;
+ if ( beamDialog.exec () == QDialog::Rejected )
return;
@@ -2858,3 +2868,3 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
CalendarLocal* cal = new CalendarLocal();
- if ( beamDialog->beamLocal() )
+ if ( beamDialog.beamLocal() )
cal->setLocalTime();
@@ -2882,3 +2892,3 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
}
- if ( beamDialog->beamVcal() ) {
+ if ( beamDialog.beamVcal() ) {
fn += ".vcs";
diff --git a/korganizer/calendarview.h b/korganizer/calendarview.h
index be18e8f..c89bbf7 100644
--- a/korganizer/calendarview.h
+++ b/korganizer/calendarview.h
@@ -32,2 +32,3 @@
#include <qmap.h>
+#include <qscrollbar.h>
#ifndef DESKTOP_VERSION
@@ -494,2 +495,3 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void resetFocus();
+ void scrollBarValue(int);
void slotViewerClosed();
@@ -524,2 +526,4 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void setBlockShowDates( bool b ) { mBlockShowDates = b ;}
+ void setScrollBarStep(int val );
+
protected:
@@ -531,6 +535,5 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
void showTodoEditor();
- void writeLocale();
Todo *selectedTodo();
-
private:
+ QScrollBar * mDateScrollBar;
QDateTime mNextAlarmDateTime;
@@ -555,3 +558,2 @@ class CalendarView : public KOrg::CalendarViewBase, public KCal::Calendar::Obser
QString mCurrentSyncName;
- KOBeamPrefs* beamDialog;
void init();
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index 7b307f7..bd191d8 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -470,2 +470,3 @@ void KOViewManager::showListView()
KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
+ mMainView->setScrollBarStep( 7 );
}
@@ -537,2 +538,3 @@ void KOViewManager::showAgendaView( bool fullScreen )
KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
+ mMainView->setScrollBarStep( 1 );
}
@@ -553,2 +555,3 @@ void KOViewManager::showDayView()
mCurrentAgendaView = 1 ;
+ mMainView->setScrollBarStep( 1 );
@@ -570,2 +573,3 @@ void KOViewManager::showWorkWeekView()
mCurrentAgendaView = 5 ;
+ mMainView->setScrollBarStep( 1 );
@@ -588,2 +592,3 @@ void KOViewManager::showWeekView()
mCurrentAgendaView = 7 ;
+ mMainView->setScrollBarStep( 1 );
}
@@ -604,2 +609,3 @@ void KOViewManager::showNextXView()
KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
+ mMainView->setScrollBarStep( KOPrefs::instance()->mNextXDays );
}
@@ -697,2 +703,3 @@ void KOViewManager::showMonthViewWeek()
KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ;
+ mMainView->setScrollBarStep( 7 );
}
@@ -729,2 +736,3 @@ void KOViewManager::showMonthView()
KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ;
+ mMainView->setScrollBarStep( 7 );
@@ -786,2 +794,3 @@ void KOViewManager::showTodoView()
KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
+ mMainView->setScrollBarStep( 7 );
@@ -805,2 +814,3 @@ void KOViewManager::showJournalView()
KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
+ mMainView->setScrollBarStep( 1 );
}