[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdepim/korganizer
From:       Reinhold Kainhofer <reinhold () kainhofer ! com>
Date:       2003-08-01 0:20:25
[Download RAW message or body]

CVS commit by kainhofe: 

This patch fixes the order of the checkboxes for the weekdays in the 
recurrence editor dialog. So far, the always were:
Mon  Tue  Wed  Thu  Fri  Sat  Sun
even if you set the start of the week to e.g. Thursday.

Now, in that case the checkboxes are ordered like
Thu  Fri  Sat  Sun  Mon  Tue  Wed 

Internally, monday still has index 0 in mDayBoxes, the only difference is that 
the checkboxes are created in a different order and so appear also 
in this different order.

CCMAIL: 61380-done@bugs.kde.org


  M +8 -3      koeditorrecurrence.cpp   1.48


--- kdepim/korganizer/koeditorrecurrence.cpp  #1.47:1.48
@@ -116,11 +116,16 @@ RecurWeekly::RecurWeekly( QWidget *paren
   QHBox *dayBox = new QHBox( this );
   topLayout->addWidget( dayBox, 1, AlignVCenter );
-  // TODO: Respect start of week setting
+  // Respect start of week setting
+  int weekStart=KGlobal::locale()->weekStartDay();
   for ( int i = 0; i < 7; ++i ) {
-    QString weekDayName = KGlobal::locale()->weekDayName( i + 1, true );
+    // i is the nr of the combobox, not the day of week!
+    // label=(i+weekStart+6)%7 + 1;
+    // index in CheckBox array(=day): label-1
+    QString weekDayName = KGlobal::locale()->weekDayName(
+      (i + weekStart + 6)%7 + 1, true );
     if ( KOPrefs::instance()->mCompactDialogs ) {
       weekDayName = weekDayName.left( 1 );
     }
-    mDayBoxes[ i ] = new QCheckBox( weekDayName, dayBox );
+    mDayBoxes[ (i + weekStart + 6)%7 ] = new QCheckBox( weekDayName, dayBox );
   }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic