textinput/peninputarc/gsplugin/gspeninputplugin/src/gspeninputcontainer.cpp
branchRCL_3
changeset 20 ebd48d2de13c
parent 7 6defe5d1bd39
child 21 ecbabf52600f
--- a/textinput/peninputarc/gsplugin/gspeninputplugin/src/gspeninputcontainer.cpp	Thu Aug 19 10:15:25 2010 +0300
+++ b/textinput/peninputarc/gsplugin/gspeninputplugin/src/gspeninputcontainer.cpp	Tue Aug 31 15:31:50 2010 +0300
@@ -518,12 +518,9 @@
     CleanupStack::PopAndDestroy(dynamicText);
 
     // And add to listbox
-    if( iListboxItemArray != NULL )
-        {
-        iListboxItemArray->SetItemVisibilityL(
+    iListboxItemArray->SetItemVisibilityL(
             EGSDefaultChineseOnscreenKeyboard, 
             bVisible ? CGSItemTextArray::EVisible : CGSItemTextArray::EInvisible);
-        }
     }
 
 // ---------------------------------------------------------
@@ -763,8 +760,7 @@
             ptrBuffer = (*iChineseFindMethodItems)[chineseFindMethod];
             }
 
-        if ( !ptrBuffer.Length() && iChineseFindMethodItems != NULL && 
-                                    iChineseFindMethodItems->Count() > 0 )
+        if (!ptrBuffer.Length() && iChineseFindMethodItems->Count() > 0)
             {
             ptrBuffer = (*iChineseFindMethodItems)[0];
             }
@@ -1125,37 +1121,33 @@
 void CGSPenInputContainer::ShowGuideLinePageL()
     {
     TInt currentItem = iModel->GuideLine();
-    currentItem = ( 0 == currentItem ) ? 1 : 0;
-    
-    iModel->SetGuideLine(currentItem);
-    UpdateListBoxL(EGSInputpenIdGuidLine);
     
-//    if (currentItem == 1)
-//        {
-//        currentItem = 0;
-//        }
-//    else
-//        {
-//        currentItem = 1;
-//        }
-//
-//    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
-//                                      R_GS_GUIDLINE_TEXT_SETTING_PAGE, 
-//                                      currentItem, 
-//                                      iGuideLineItems);
-//
-//    CleanupStack::PushL(dlg);
-//    
-//    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
-//        {
-//        if(currentItem == iModel->GuideLine())
-//            {
-//            iModel->SetGuideLine(currentItem == 0? 1:0);
-//            UpdateListBoxL(EGSInputpenIdGuidLine);
-//            }
-//        }
-// 
-//    CleanupStack::Pop(dlg);  
+    if (currentItem == 1)
+        {
+        currentItem = 0;
+        }
+    else
+        {
+        currentItem = 1;
+        }
+
+    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
+                                      R_GS_GUIDLINE_TEXT_SETTING_PAGE, 
+                                      currentItem, 
+                                      iGuideLineItems);
+
+    CleanupStack::PushL(dlg);
+    
+    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
+        {
+        if(currentItem == iModel->GuideLine())
+            {
+            iModel->SetGuideLine(currentItem == 0? 1:0);
+            UpdateListBoxL(EGSInputpenIdGuidLine);
+            }
+        }
+ 
+    CleanupStack::Pop(dlg);  
     }
 
 // ---------------------------------------------------------
@@ -1165,10 +1157,33 @@
 void CGSPenInputContainer::ShowRecognitionWithDictionaryL()
     {
     TInt currentItem = iModel->RecognitionWithDictionary();
-    currentItem = ( 0 == currentItem ) ? 1 : 0;
-    iModel->SetRecognitionWithDictionary(currentItem);
-    UpdateListBoxL(EGSInputpenIdRecognitionWithDictionary);
     
+    if (currentItem == 1)
+        {
+        currentItem = 0;
+        }
+    else
+        {
+        currentItem = 1;
+        }
+
+    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
+            R_GS_RECOGNITIONWITHDICTIONARY_TEXT_SETTING_PAGE,  
+                                      currentItem, 
+                                      iRecognitionWithDictionaryItems);
+
+    CleanupStack::PushL(dlg);
+    
+    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
+        {
+        if(currentItem == iModel->RecognitionWithDictionary())
+            {
+            iModel->SetRecognitionWithDictionary(currentItem == 0? 1:0);
+            UpdateListBoxL(EGSInputpenIdRecognitionWithDictionary);
+            }
+        }
+ 
+    CleanupStack::Pop(dlg);  
     }
 
 // ---------------------------------------------------------
@@ -1178,28 +1193,24 @@
 void CGSPenInputContainer::ShowInputMethodForFindPageL()
     {
     TInt currentItem = iModel->InputMethodForFind();
-    currentItem = ( 0 == currentItem ) ? 1 : 0;
 
-    iModel->SetInputMethodForFind(currentItem);
-    UpdateListBoxL(EGSInputpenIdInputMethodForFind);
+    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
+                                      R_GS_INPUTMETHODFORFIND_TEXT_SETTING_PAGE, 
+                                      currentItem, 
+                                      iInputMethodForFindItems);
 
-//    CAknRadioButtonSettingPage* dlg = new (ELeave) CAknRadioButtonSettingPage(
-//                                      R_GS_INPUTMETHODFORFIND_TEXT_SETTING_PAGE, 
-//                                      currentItem, 
-//                                      iInputMethodForFindItems);
-//
-//    CleanupStack::PushL(dlg);
-//    
-//    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
-//        {
-//        if(currentItem != iModel->InputMethodForFind())
-//            {
-//            iModel->SetInputMethodForFind(currentItem);
-//            UpdateListBoxL(EGSInputpenIdInputMethodForFind);
-//            }
-//        }
-// 
-//    CleanupStack::Pop(dlg);
+    CleanupStack::PushL(dlg);
+    
+    if (dlg->ExecuteLD(CAknSettingPage::EUpdateWhenChanged))
+        {
+        if(currentItem != iModel->InputMethodForFind())
+            {
+            iModel->SetInputMethodForFind(currentItem);
+            UpdateListBoxL(EGSInputpenIdInputMethodForFind);
+            }
+        }
+ 
+    CleanupStack::Pop(dlg);
     }
 
 // ---------------------------------------------------------