Fixed focus issue with HostKeyboard
[apps/osp/Gallery.git] / src / GlSettingMainForm.cpp
index 512e62e..65c7763 100644 (file)
@@ -131,10 +131,13 @@ SettingMainForm::OnFormBackRequested(Form& source)
        GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
        if (pApp != null)
        {
-               if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_CONFIGURE && pApp->GetFrameActivated() == true)
+               if (pApp->GetAppControlOperationId() == APPCONTROL_OPERATION_ID_CONFIGURE)
                {
-                       pApp->SendAppControlResult(APP_CTRL_RESULT_TERMINATED, null);
-                       pApp->Terminate();
+                       if (pApp->GetFrameActivated() == true)
+                       {
+                               pApp->SendAppControlResult(APP_CTRL_RESULT_TERMINATED, null);
+                               pApp->Terminate();
+                       }
                }
                else
                {
@@ -183,7 +186,7 @@ void
 SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, int groupIndex, int itemIndex, int elementId, ListItemStatus status)
 {
        int effectiveIndex = 0;
-       int inputValue = 0 ;
+       int inputValue = 0;
 
        effectiveIndex = effectiveIndex + itemIndex;
 
@@ -198,7 +201,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
                        {
                                if (settingInfo[iter].itemType == ITEM_TYPE_RADIO)
                                {
-                                       settingInfo[effectiveIndex].childCount++;
+                                       ++settingInfo[effectiveIndex].childCount;
                                }
                                else
                                {
@@ -261,7 +264,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
        {
        case SETTING_INTERVAL_2:
        {
-               inputValue = 2 ;
+               inputValue = 2;
                __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER, ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL,
                                inputValue);
                listView.UpdateList();
@@ -270,7 +273,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_INTERVAL_3:
        {
-               inputValue = 3 ;
+               inputValue = 3;
                __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
                listView.UpdateList();
@@ -279,7 +282,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_INTERVAL_5:
        {
-               inputValue = 5 ;
+               inputValue = 5;
                __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
                listView.UpdateList();
@@ -288,7 +291,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_INTERVAL_10:
        {
-               inputValue = 10 ;
+               inputValue = 10;
                __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
                listView.UpdateList();
@@ -297,7 +300,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_INTERVAL_20:
        {
-               inputValue = 20 ;
+               inputValue = 20;
                __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_INTERVAL, inputValue);
                listView.UpdateList();
@@ -306,7 +309,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_TRANSITION_PAGE:
        {
-               inputValue = 0 ;
+               inputValue = 0;
                __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, inputValue);
                listView.UpdateList();
@@ -315,12 +318,12 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_TRANSITION_DISSOLVE:
        {
-               inputValue = 1 ;
+               inputValue = 1;
                result r = __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, inputValue);
                if (r == E_SUCCESS)
                {
-                       AppLogDebug(" Passed") ;
+                       AppLogDebug(" Passed");
                }
 
                listView.UpdateList();
@@ -329,7 +332,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_TRANSITION_ZOOM:
        {
-               inputValue = 2 ;
+               inputValue = 2;
                 __pPresentationModel->SetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_SLIDESHOW_TRANSITION_EFFECT, inputValue);
                listView.UpdateList();
@@ -338,7 +341,7 @@ SettingMainForm::OnGroupedListViewItemStateChanged(GroupedListView& listView, in
 
        case SETTING_REPEAT:
        {
-               int repeatValue = 0 ;
+               int repeatValue = 0;
 
                __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
                                ENTRY_NAME_IMAGE_VIEWER_REPEAT_VALUE, repeatValue);
@@ -435,8 +438,8 @@ SettingMainForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        String fontSizeStr;
        int fontSize = 0;
        int itemHeight = 0;
-       int defaultHeight = 112 ;
-       int defaultFontSize = 44 ;
+       int defaultHeight = 112;
+       int defaultFontSize = 44;
 
        SettingInfo::GetValue("http://tizen.org/setting/font.size", fontSizeStr);
        AppLog("the font value is %S",fontSizeStr.GetPointer());
@@ -444,27 +447,27 @@ SettingMainForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        if(fontSizeStr == "medium")
        {
                fontSize = 44;
-               itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+               itemHeight = defaultHeight + (fontSize - defaultFontSize);
        }
        else if(fontSizeStr == "huge")
        {
                fontSize =  81;
-               itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+               itemHeight = defaultHeight + (fontSize - defaultFontSize);
        }
        else if(fontSizeStr == "giant")
        {
                fontSize = 98;
-               itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+               itemHeight = defaultHeight + (fontSize - defaultFontSize);
        }
        else if(fontSizeStr == "small")
        {
                fontSize = 36;
-               itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+               itemHeight = defaultHeight + (fontSize - defaultFontSize);
        }
        else if(fontSizeStr == "large")
        {
                fontSize = 64;
-               itemHeight = defaultHeight + ( fontSize - defaultFontSize);
+               itemHeight = defaultHeight + (fontSize - defaultFontSize);
        }
        else
        {
@@ -544,12 +547,14 @@ SettingMainForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                if (settingInfo[parentIndex].isOpen == false)
                {
                        r = pItem->Construct(itemWidth, 0);
+                       __pList->SetItemEnabled(groupIndex, itemIndex,false);
                        AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
                        return pItem;
                }
                else
                {
                        pItem->Construct(itemWidth, itemHeight);
+                       __pList->SetItemEnabled(groupIndex, itemIndex, true);
                }
 
                pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL, ITEM_RADIO_ITEM_BACKGROUND_COLOR);
@@ -586,7 +591,7 @@ SettingMainForm::DeleteItem(int groupIndex, int itemIndex, ListItemBase* pItem,
 int
 SettingMainForm::GetGroupCount(void)
 {
-       int groupCount = 1 ;
+       int groupCount = 1;
 
        return groupCount;
 }
@@ -696,7 +701,7 @@ SettingMainForm::InitializeSettingValues(void)
        }
 
        settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_SLIDESHOW_INTERVAL");
-       settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].subText = selectedInterval ;
+       settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].subText = selectedInterval;
        settingInfo[SETTING_SLIDESHOW_INTERVAL_TITLE].itemType = ITEM_TYPE_DROPDOWN;
 
        settingInfo[SETTING_INTERVAL_2].titleText = ResourceManager::GetString(L"IDS_MEDIABR_OPT_2_SECONDS");
@@ -726,11 +731,11 @@ SettingMainForm::InitializeSettingValues(void)
 
        if (repeatValue == 0)
        {
-               settingInfo[SETTING_REPEAT].isSelected = false ;
+               settingInfo[SETTING_REPEAT].isSelected = false;
        }
        else
        {
-               settingInfo[SETTING_REPEAT].isSelected = true ;
+               settingInfo[SETTING_REPEAT].isSelected = true;
        }
 
        r = __pPresentationModel->GetValue(SECTION_NAME_IMAGE_VIEWER,
@@ -741,11 +746,11 @@ SettingMainForm::InitializeSettingValues(void)
 
        if (shuffletValue == 0)
        {
-               settingInfo[SETTING_SHUFFLE].isSelected = false ;
+               settingInfo[SETTING_SHUFFLE].isSelected = false;
        }
        else
        {
-               settingInfo[SETTING_SHUFFLE].isSelected = true ;
+               settingInfo[SETTING_SHUFFLE].isSelected = true;
        }
 
        settingInfo[SETTING_TRANSITION_EFFECT_TITLE].titleText = ResourceManager::GetString(L"IDS_MEDIABR_BODY_TRANSITION_EFFECT");