calendarui/settings/settingsui/src/calensettingsuicontainer.cpp
branchRCL_3
changeset 48 bf573002ff72
parent 13 0f07cd1b5772
child 67 1539a383d7b6
--- a/calendarui/settings/settingsui/src/calensettingsuicontainer.cpp	Wed Jun 09 09:40:23 2010 +0300
+++ b/calendarui/settings/settingsui/src/calensettingsuicontainer.cpp	Mon Jun 21 15:38:59 2010 +0300
@@ -788,6 +788,12 @@
                          R_CALEN_WEEKFORMAT_TEXTS,
                          ordinal++ );
 
+    AddEnumerationItemL( iWeekNumberEnable,
+                         ECalenWeekNumberItemId,
+                         R_CALEN_SETTING_WEEKNUMBER_TITLE,
+                         R_CALEN_SETTING_WEEKNUMBER,
+                         R_CALEN_WEEKNUMBER_TEXTS,
+                         ordinal++ );
 
     // Always add this in. We will set it hidden when it's not needed (i.e. when the
     // week start is set to anything other than "Monday") at the bottom of this function.
@@ -839,6 +845,7 @@
 
     // Hide the week title setting if the week start is anything other than Monday.
     Item( ECalenWeekTitleItemId )->SetHidden( !ShouldShowWeekTitleItem() );
+    Item( ECalenWeekNumberItemId )->SetHidden( !ShouldShowWeekTitleItem() );
 
     TRACE_EXIT_POINT;
     }
@@ -935,10 +942,12 @@
     if ( wasShown != doShow )
         {
         Item( ECalenWeekTitleItemId )->SetHidden( !doShow );
+        Item( ECalenWeekNumberItemId )->SetHidden( !doShow );
 
         if ( !doShow )
             {
             Item( ECalenWeekTitleItemId )->LoadL();
+            Item( ECalenWeekNumberItemId )->LoadL();            
             }
 
         iSettingItemArray->RecalculateVisibleIndicesL();
@@ -1012,7 +1021,7 @@
         iPageStatus = aPageStatus;
         // for week title only two options available
         // so let's toggle instead of opening setting page
-        if( item->Identifier() != ECalenWeekTitleItemId )
+        if( (item->Identifier() != ECalenWeekTitleItemId) && (item->Identifier() != ECalenWeekNumberItemId))
             {
             item->EditItemL( aCommand == EAknCmdOpen );
             }
@@ -1052,6 +1061,14 @@
                     item->LoadL();
                     item->UpdateListBoxTextL();
                     break;
+                case ECalenWeekNumberItemId:
+                    // toggling option done here
+                    iSetting->SetWeekNumber( static_cast<TCalenWeekNumber>( iWeekNumberEnable ) == EWeekNumberOn ?
+                        EWeekNumberOff : EWeekNumberOn );
+                    iWeekNumberEnable = iSetting->WeekNumberEnable();
+                    item->LoadL();
+                    item->UpdateListBoxTextL();
+                    break;
                 case ECalenDefaultMailboxId:
                     item->StoreL();
                     StoreMailboxSettingsL();
@@ -1267,6 +1284,7 @@
     iDefView = iSetting->DefaultView().iUid;
     iWeekFormat = iSetting->WeekFormat();
     iWeekTitle = iSetting->WeekTitle();
+    iWeekNumberEnable = iSetting->WeekNumberEnable();
     iSnoozeTime = iSetting->SnoozeTime();
 #ifdef RD_SCALABLE_UI_V2_NO_TOOLBAR_SETTING
     iToolbar = iSetting->Toolbar();