summaryrefslogtreecommitdiffabout
path: root/korganizer/komonthview.cpp
authorzautrix <zautrix>2005-03-28 23:39:37 (UTC)
committer zautrix <zautrix>2005-03-28 23:39:37 (UTC)
commit4e7c45695672ecdbd0cd14cac0ea29a8e134ee78 (patch) (side-by-side diff)
tree6815e055d6cb35d56d43f036261f5be9d2a9c350 /korganizer/komonthview.cpp
parent4034290f894ff7d1b0cf1197078e0ed832566bb7 (diff)
downloadkdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.zip
kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.gz
kdepimpi-4e7c45695672ecdbd0cd14cac0ea29a8e134ee78.tar.bz2
montview sunday fix
Diffstat (limited to 'korganizer/komonthview.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/komonthview.cpp25
1 files changed, 12 insertions, 13 deletions
diff --git a/korganizer/komonthview.cpp b/korganizer/komonthview.cpp
index 9085775..d825493 100644
--- a/korganizer/komonthview.cpp
+++ b/korganizer/komonthview.cpp
@@ -1001,10 +1001,7 @@ KOMonthView::KOMonthView(Calendar *calendar, QWidget *parent, const char *name)
#endif
hb->addWidget( mNavigatorBar );
hb->addWidget( mWidStack );
- mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
mShowWeekView = KOPrefs::instance()->mMonthViewWeek;
- if ( mShowWeekView )
- mWeekStartsMonday = true;
updatePossible = false;
//updatePossible = true;
mCells.setAutoDelete( true );
@@ -1217,9 +1214,9 @@ void KOMonthView::printPreview(CalPrinter *calPrinter, const QDate &fd,
void KOMonthView::updateConfig()
{
- mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
+ int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
- if ( mShowWeekView ) {
+ if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) {
mWeekStartsMonday = true;
}
QFontMetrics fontmetric(mDayLabels[0]->font());
@@ -1259,20 +1256,16 @@ void KOMonthView::updateDayLabels()
mDayLabelsT = &mDayLabelsW;
for (int i = 0; i < 7; i++) {
- if (mWeekStartsMonday) {
+ {
bool show = mShortDayLabelsW;
if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
show = true;
(*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i+1,show));
- } else {
- if (i==0) (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(7,mShortDayLabelsW));
- else (*mDayLabelsT)[i]->setText(KOGlobals::self()->calendarSystem()->weekDayName(i,mShortDayLabelsW));
-
}
}
mDayLabelsT = &mDayLabels;
for (int i = 0; i < 7; i++) {
- if (mWeekStartsMonday) {
+ if (KGlobal::locale()->weekStartsMonday() || KOPrefs::instance()->mMonthViewSatSunTog ) {
bool show = mShortDayLabelsM;
if ( i > 4 && mShowSatSunComp && mWidthLongDayLabel > (*mDayLabelsT)[i]->width() )
show = true;
@@ -1294,25 +1287,31 @@ void KOMonthView::showDates(const QDate &start, const QDate &)
QPtrVector<QLabel> *dayLabels;
QPtrVector<KOWeekButton> *weekLabels;
int weekNum = 6;
+ mStartDate = start;
if ( mShowWeekView ) {
weekNum = 1;
cells = &mCellsW;
dayLabels = &mDayLabelsW;
weekLabels = &mWeekLabelsW;
+ if ( !KGlobal::locale()->weekStartsMonday() ) {
+ mStartDate = mStartDate.addDays( 1 );
+ }
} else {
cells = &mCells;
dayLabels = &mDayLabels;
weekLabels = &mWeekLabels;
}
- mStartDate = start;
+ int mWeekStartsMonday = KGlobal::locale()->weekStartsMonday();
+ if ( mShowWeekView || KOPrefs::instance()->mMonthViewSatSunTog ) {
+ mWeekStartsMonday = true;
+ }
int startWeekDay = mWeekStartsMonday ? 1 : 7;
while( KOGlobals::self()->calendarSystem()->dayOfWeek(mStartDate) != startWeekDay ) {
mStartDate = mStartDate.addDays( -1 );
}
-
bool primary = false;
uint i;
for( i = 0; i < (*cells).size(); ++i ) {