summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
Side-by-side diff
Diffstat (limited to 'korganizer/calendarview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp60
1 files changed, 35 insertions, 25 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 697093e..776cdd3 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -367,12 +367,11 @@ void CalendarView::init()
mNextAlarmDateTime = QDateTime::currentDateTime();
setFocusPolicy ( NoFocus );
mViewerCallerIsSearchDialog = false;
mBlockShowDates = false;
- beamDialog = new KOBeamPrefs();
+
mDatePickerMode = 0;
mCurrentSyncDevice = "";
- writeLocale();
mViewManager = new KOViewManager( this );
mDialogManager = new KODialogManager( this );
mEventViewerDialog = 0;
mModified = false;
@@ -444,9 +443,11 @@ void CalendarView::init()
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 );
//mainBoxLayout->addWidget (mLeftFrame);
mDateNavigator = new DateNavigatorContainer( mLeftFrame,
"CalendarView::DateNavigator" );
#if 0
@@ -467,8 +468,9 @@ void CalendarView::init()
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);
@@ -641,12 +643,35 @@ CalendarView::~CalendarView()
delete mDialogManager;
delete mViewManager;
delete mStorage;
delete mDateFrame ;
- delete beamDialog;
delete mEventViewerDialog;
//kdDebug() << "~CalendarView() done" << endl;
}
+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()
{
KConfig *config = KOGlobals::config();
config->setGroup( "AppRun" );
@@ -2466,29 +2491,11 @@ void CalendarView::goNextMonth()
void CalendarView::goPreviousMonth()
{
mNavigator->selectPreviousMonth();
}
-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 )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
emit configChanged();
mTodoList->updateConfig();
@@ -2576,8 +2583,9 @@ void CalendarView::updateTodoViews()
void CalendarView::updateView(const QDate &start, const QDate &end)
{
+ mDateScrollBar->setValue( start.dayOfYear()-1);
mTodoList->updateView();
mViewManager->updateView(start, end);
//mDateNavigator->updateView();
}
@@ -2843,9 +2851,11 @@ void CalendarView::beamFilteredCalendar()
beamIncidenceList( delSel );
}
void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
{
- if ( beamDialog->exec () == QDialog::Rejected )
+
+ KOBeamPrefs beamDialog;
+ if ( beamDialog.exec () == QDialog::Rejected )
return;
#ifdef DESKTOP_VERSION
QString fn = locateLocal( "tmp", "kopibeamfile" );
#else
@@ -2855,9 +2865,9 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
bool createbup = true;
if ( createbup ) {
QString description = "\n";
CalendarLocal* cal = new CalendarLocal();
- if ( beamDialog->beamLocal() )
+ if ( beamDialog.beamLocal() )
cal->setLocalTime();
else
cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
Incidence *incidence = delSel.first();
@@ -2879,9 +2889,9 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
description += in->summary() + "\n";
cal->addIncidence( in );
incidence = delSel.next();
}
- if ( beamDialog->beamVcal() ) {
+ if ( beamDialog.beamVcal() ) {
fn += ".vcs";
FileStorage storage( cal, fn, new VCalFormat );
storage.save();
} else {