calendarui/settings/settingsui/src/calensettingsuicontainer.cpp
branchRCL_3
changeset 13 0f07cd1b5772
parent 12 38571fd2a704
child 48 bf573002ff72
equal deleted inserted replaced
12:38571fd2a704 13:0f07cd1b5772
   657     CleanupStack::PushL( settingItem );
   657     CleanupStack::PushL( settingItem );
   658 
   658 
   659     // Construct setting item with parametrized values
   659     // Construct setting item with parametrized values
   660     HBufC* itemTitle = StringLoader::LoadLC( R_CALEN_SETTING_DEFAULTMAILBOX_TITLE );
   660     HBufC* itemTitle = StringLoader::LoadLC( R_CALEN_SETTING_DEFAULTMAILBOX_TITLE );
   661     // The resources loaded up here are empty as the items need to be dynamically updated.
   661     // The resources loaded up here are empty as the items need to be dynamically updated.
       
   662     
       
   663     settingItem->SetEmptyItemTextL( KNullDesC );
       
   664     
   662     settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL,
   665     settingItem->ConstructL( EFalse, aOrdinal, *itemTitle, NULL,
   663                              R_CALEN_SETTING_DEFAULTMAILBOX, EAknCtPopupSettingList,
   666                              R_CALEN_SETTING_DEFAULTMAILBOX, EAknCtPopupSettingList,
   664                              NULL, R_CALEN_EMPTY_POPUP_SETTING_TEXTS );
   667                              NULL, R_CALEN_EMPTY_POPUP_SETTING_TEXTS );
   665 
   668 
   666     CArrayPtr<CAknEnumeratedText>* items = settingItem->EnumeratedTextArray();
   669     CArrayPtr<CAknEnumeratedText>* items = settingItem->EnumeratedTextArray();
   786                          ordinal++ );
   789                          ordinal++ );
   787 
   790 
   788 
   791 
   789     // Always add this in. We will set it hidden when it's not needed (i.e. when the
   792     // Always add this in. We will set it hidden when it's not needed (i.e. when the
   790     // week start is set to anything other than "Monday") at the bottom of this function.
   793     // week start is set to anything other than "Monday") at the bottom of this function.
   791     AddBinaryItemL( iWeekTitle,
   794     AddEnumerationItemL( iWeekTitle,
   792                          ECalenWeekTitleItemId,
   795                          ECalenWeekTitleItemId,
   793                          R_CALEN_SETTING_WEEKTITLE_TITLE,
   796                          R_CALEN_SETTING_WEEKTITLE_TITLE,
   794                          R_CALEN_SETTING_WEEKTITLE,
   797                          R_CALEN_SETTING_WEEKTITLE,
   795                          R_CALEN_WEEKTITLE_TEXTS,
   798                          R_CALEN_WEEKTITLE_TEXTS,
   796                          ordinal++ );
   799                          ordinal++ );
  1005             item = iSettingItemArray->At( index );          
  1008             item = iSettingItemArray->At( index );          
  1006             }
  1009             }
  1007          // Open edit dialog if EAknCmdOpen, invert the value otherwise
  1010          // Open edit dialog if EAknCmdOpen, invert the value otherwise
  1008         aPageStatus = ETrue;
  1011         aPageStatus = ETrue;
  1009         iPageStatus = aPageStatus;
  1012         iPageStatus = aPageStatus;
  1010         item->EditItemL( aCommand == EAknCmdOpen );
  1013         // for week title only two options available
       
  1014         // so let's toggle instead of opening setting page
       
  1015         if( item->Identifier() != ECalenWeekTitleItemId )
       
  1016             {
       
  1017             item->EditItemL( aCommand == EAknCmdOpen );
       
  1018             }
  1011         aPageStatus = EFalse;
  1019         aPageStatus = EFalse;
  1012         iPageStatus = aPageStatus;
  1020         iPageStatus = aPageStatus;
  1013         TBool isNativeSettingChange = ETrue;
  1021         TBool isNativeSettingChange = ETrue;
  1014         
  1022         
  1015        if(item->Identifier() > 0 )
  1023        if(item->Identifier() > 0 )
  1034                 case ECalenDefaultViewItemId:
  1042                 case ECalenDefaultViewItemId:
  1035                     item->StoreL();
  1043                     item->StoreL();
  1036                     iSetting->SetDefaultView( TUid::Uid( iDefView ) );
  1044                     iSetting->SetDefaultView( TUid::Uid( iDefView ) );
  1037                     break;
  1045                     break;
  1038                 case ECalenWeekTitleItemId:
  1046                 case ECalenWeekTitleItemId:
  1039                     item->StoreL();
  1047 					//item->StoreL();
  1040                     iSetting->SetWeekTitle( static_cast<TCalenWeekTitle>( iWeekTitle ) );
  1048                     // toggling option done here
       
  1049                     iSetting->SetWeekTitle( static_cast<TCalenWeekTitle>( iWeekTitle ) == EWeekTitleNumber ?
       
  1050                             EWeekTitleDuration  : EWeekTitleNumber );
       
  1051                     iWeekTitle = iSetting->WeekTitle();
       
  1052                     item->LoadL();
       
  1053                     item->UpdateListBoxTextL();
  1041                     break;
  1054                     break;
  1042                 case ECalenDefaultMailboxId:
  1055                 case ECalenDefaultMailboxId:
  1043                     item->StoreL();
  1056                     item->StoreL();
  1044                     StoreMailboxSettingsL();
  1057                     StoreMailboxSettingsL();
  1045                     break;
  1058                     break;