summaryrefslogtreecommitdiffabout
path: root/korganizer/calendarview.cpp
authorzautrix <zautrix>2005-06-29 20:23:04 (UTC)
committer zautrix <zautrix>2005-06-29 20:23:04 (UTC)
commit8954bae7bb5afc9706e37e808e9c1e237399f214 (patch) (side-by-side diff)
tree18932b26b38e319cc4c568f4624678fa50531c37 /korganizer/calendarview.cpp
parent77aa480c9891a90c9b492618ebfd2b20f2d0727a (diff)
downloadkdepimpi-8954bae7bb5afc9706e37e808e9c1e237399f214.zip
kdepimpi-8954bae7bb5afc9706e37e808e9c1e237399f214.tar.gz
kdepimpi-8954bae7bb5afc9706e37e808e9c1e237399f214.tar.bz2
fixxx
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
@@ -368,10 +368,9 @@ void CalendarView::init()
setFocusPolicy ( NoFocus );
mViewerCallerIsSearchDialog = false;
mBlockShowDates = false;
- beamDialog = new KOBeamPrefs();
+
mDatePickerMode = 0;
mCurrentSyncDevice = "";
- writeLocale();
mViewManager = new KOViewManager( this );
mDialogManager = new KODialogManager( this );
mEventViewerDialog = 0;
@@ -445,7 +444,9 @@ void CalendarView::init()
}
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" );
@@ -468,6 +469,7 @@ void CalendarView::init()
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 ) {
@@ -642,10 +644,33 @@ CalendarView::~CalendarView()
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();
@@ -2467,27 +2492,9 @@ 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();
@@ -2577,6 +2584,7 @@ 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();
@@ -2844,7 +2852,9 @@ void CalendarView::beamFilteredCalendar()
}
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" );
@@ -2856,7 +2866,7 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
if ( createbup ) {
QString description = "\n";
CalendarLocal* cal = new CalendarLocal();
- if ( beamDialog->beamLocal() )
+ if ( beamDialog.beamLocal() )
cal->setLocalTime();
else
cal->setTimeZoneId(KPimGlobalPrefs::instance()->mTimeZoneId);
@@ -2880,7 +2890,7 @@ void CalendarView::beamIncidenceList(QPtrList<Incidence> delSel )
cal->addIncidence( in );
incidence = delSel.next();
}
- if ( beamDialog->beamVcal() ) {
+ if ( beamDialog.beamVcal() ) {
fn += ".vcs";
FileStorage storage( cal, fn, new VCalFormat );
storage.save();