calendarui/settings/settingsui/src/calensettingsuicontainer.cpp
branchRCL_3
changeset 11 0f07cd1b5772
parent 10 38571fd2a704
child 25 bf573002ff72
--- a/calendarui/settings/settingsui/src/calensettingsuicontainer.cpp	Fri Mar 12 15:42:35 2010 +0200
+++ b/calendarui/settings/settingsui/src/calensettingsuicontainer.cpp	Mon Mar 15 12:40:18 2010 +0200
@@ -659,6 +659,9 @@
     // Construct setting item with parametrized values
     HBufC* itemTitle = StringLoader::LoadLC( R_CALEN_SETTING_DEFAULTMAILBOX_TITLE );
     // The resources loaded up here are empty as the items need to be dynamically updated.
+    
+    settingItem->SetEmptyItemTextL( KNullDesC );
+    
     settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL,
                              R_CALEN_SETTING_DEFAULTMAILBOX, EAknCtPopupSettingList,
                              NULL, R_CALEN_EMPTY_POPUP_SETTING_TEXTS );
@@ -788,7 +791,7 @@
 
     // 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.
-    AddBinaryItemL( iWeekTitle,
+    AddEnumerationItemL( iWeekTitle,
                          ECalenWeekTitleItemId,
                          R_CALEN_SETTING_WEEKTITLE_TITLE,
                          R_CALEN_SETTING_WEEKTITLE,
@@ -1007,7 +1010,12 @@
          // Open edit dialog if EAknCmdOpen, invert the value otherwise
         aPageStatus = ETrue;
         iPageStatus = aPageStatus;
-        item->EditItemL( aCommand == EAknCmdOpen );
+        // for week title only two options available
+        // so let's toggle instead of opening setting page
+        if( item->Identifier() != ECalenWeekTitleItemId )
+            {
+            item->EditItemL( aCommand == EAknCmdOpen );
+            }
         aPageStatus = EFalse;
         iPageStatus = aPageStatus;
         TBool isNativeSettingChange = ETrue;
@@ -1036,8 +1044,13 @@
                     iSetting->SetDefaultView( TUid::Uid( iDefView ) );
                     break;
                 case ECalenWeekTitleItemId:
-                    item->StoreL();
-                    iSetting->SetWeekTitle( static_cast<TCalenWeekTitle>( iWeekTitle ) );
+					//item->StoreL();
+                    // toggling option done here
+                    iSetting->SetWeekTitle( static_cast<TCalenWeekTitle>( iWeekTitle ) == EWeekTitleNumber ?
+                            EWeekTitleDuration  : EWeekTitleNumber );
+                    iWeekTitle = iSetting->WeekTitle();
+                    item->LoadL();
+                    item->UpdateListBoxTextL();
                     break;
                 case ECalenDefaultMailboxId:
                     item->StoreL();