Fixed Nabi Issues
[apps/osp/Internet.git] / src / IntSettingForm.cpp
index 54d5b87..91d2d82 100644 (file)
@@ -28,6 +28,7 @@
 #include "IntDefaultCustomItem.h"
 #include "IntDropDownCustomItem.h"
 #include "IntHistoryPresentationModel.h"
+#include "IntInternetApp.h"
 #include "IntMultipleWindowPresentationModel.h"
 #include "IntNotificationPanel.h"
 #include "IntRadioCustomItem.h"
@@ -41,17 +42,20 @@ using namespace Tizen::App;
 using namespace Tizen::Base;
 using namespace Tizen::Base::Collection;
 using namespace Tizen::Graphics;
+using namespace Tizen::System;
 using namespace Tizen::Ui;
 using namespace Tizen::Ui::Controls;
 using namespace Tizen::Ui::Scenes;
 
 
+
 SettingForm::SettingForm(void)
 : __fontValue(0),__pResetPopup(null),__pWindowInfo(null) , __pConfirmationPopup(null)
 {
        __currentURL = L"";
        __pList = null;
        InitializeSettingValues();
+       __fontSize = 44;
 }
 
 SettingForm::~SettingForm(void)
@@ -255,6 +259,11 @@ SettingForm::OnInitializing(void)
        Footer* pFooter = NULL;
        SceneManager* pSceneManager = NULL;
 
+       __fontSize = CommonUtil::GetFontSize();
+
+       bool isHwKeySupported = false;
+
+       SetFormStyle(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR);
        __pList = static_cast< GroupedListView* >(GetControl(L"IDC_SETTING_LIST"));
        if ( __pList != NULL )
        {
@@ -264,13 +273,14 @@ SettingForm::OnInitializing(void)
                __pList->AddGroupedListViewItemEventListener(*this);
        }
 
-       pFooter = GetFooter();
-       if (pFooter)
-       {
-               AppLogDebug("setting back button");
-               pFooter->SetBackButtonEnabled(true);
-               SetFormBackEventListener(this);
-       }
+//     pFooter = GetFooter();
+//     if (pFooter)
+//     {
+//             AppLogDebug("setting back button");
+//             pFooter->SetBackButtonEnabled(true);
+//     }
+       SetFormBackEventListener(this);
+       AppLog("SetFormBackEventListener result %s",GetErrorMessage(GetLastResult()));
        pSceneManager = SceneManager::GetInstance();
        if (pSceneManager != null)
        {
@@ -535,7 +545,7 @@ SettingForm::CreateGroupItem(int groupIndex, int itemWidth)
                break;
 
        case 4:
-               text = L"";
+               text = L" ";
                break;
 
        default:
@@ -569,7 +579,7 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_TOGGLE)
        {
                SettingToggleCustomItem* pItem = new(std::nothrow) SettingToggleCustomItem();
-               r = pItem->Construct(itemWidth, 112);
+               r = pItem->Construct(itemWidth, 112 + (__fontSize - 44));
                if (IsFailed(r))
                {
                        delete pItem;
@@ -648,8 +658,6 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        }
        else if (settingInfo[effectiveIndex].itemType == ITEM_TYPE_RADIO)
        {
-
-
                RadioCustomItem* pItem = new(std::nothrow) RadioCustomItem();
                int parentIndex = 0;
                for (parentIndex = effectiveIndex; parentIndex > SETTING_INVALID; parentIndex--)
@@ -660,12 +668,14 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                if (settingInfo[parentIndex].isOpen == false || (__isCurrentPageDisable == true && groupIndex == 0 && itemIndex == 1))
                {
                        r = pItem->Construct(itemWidth, 0);
+                       __pList->SetItemEnabled(groupIndex,itemIndex,false);
                        AppLogDebug("construct with height 0 %s", GetErrorMessage(r));
                        return pItem;
                }
                else
                {
-                       pItem->Construct(itemWidth, 112);
+                       __pList->SetItemEnabled(groupIndex,itemIndex,true);
+                       pItem->Construct(itemWidth, 112 +  (__fontSize - 44));
                }
 /*
                Bitmap* pNormalBackgroundBitmap = CommonUtil::GetNinepatchedBitmapN(IDB_LIST_GROUP_BG9,itemWidth,112);
@@ -693,7 +703,8 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                //if (pBitmap != null)
                //      pItem->AddElement(Rectangle(0, 0, 10, 112), IDA_LIST_LEFT_SIDE_MARGIN, *pBitmap, null);
 
-               pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
+//             pItem->SetSelected(settingInfo[effectiveIndex].isSelected);
+               __pList->SetItemChecked(groupIndex,itemIndex,settingInfo[effectiveIndex].isSelected);
                pItem->Make();
 
                return pItem;
@@ -702,7 +713,7 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
        {
                DefaultCustomItem* pItem = new(std::nothrow) DefaultCustomItem();
 
-               r = pItem->Construct(itemWidth, 112);
+               r = pItem->Construct(itemWidth, 112 + (__fontSize - 44));
                if (IsFailed(r))
                {
                        delete pItem;
@@ -728,6 +739,7 @@ SettingForm::CreateItem(int groupIndex, int itemIndex, int itemWidth)
                pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_NORMAL,ITEM_BACKGROUND_COLOR);
                pItem->SetBackgroundColor(LIST_ITEM_DRAWING_STATUS_PRESSED,ITEM_BACKGROUND_COLOR_HIGHLIGHTED);
 
+
                pItem->SetText(settingInfo[effectiveIndex].titleText);
 
                //if (pBitmap != null)
@@ -779,6 +791,7 @@ SettingForm::GetItemCount(int groupIndex)
 void
 SettingForm::OnFormBackRequested(Form& source)
 {
+       AppLog("SettingForm::OnFormBackRequested entered");
        String* pSelectedScene = NULL;
        Object* value = NULL;
        MultipleWindowPresentationModel::GetInstance()->GetValue(SELECTED_SCENE_ID, &value);
@@ -1006,6 +1019,13 @@ SettingForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& ne
 void
 SettingForm::ClearHistory(void)
 {
+       if(__pConfirmationPopup)
+       {
+               __pConfirmationPopup->SetShowState(false);
+               __pConfirmationPopup->Show();
+               delete __pConfirmationPopup;
+               __pConfirmationPopup = null;
+       }
        String message = CommonUtil::GetString(L"IDS_BR_BODY_DELETE_BROWSER_HISTORY_Q");
        if(!__pConfirmationPopup)
        {
@@ -1021,6 +1041,13 @@ SettingForm::ClearHistory(void)
 void
 SettingForm::ClearCache(void)
 {
+       if(__pConfirmationPopup)
+       {
+               __pConfirmationPopup->SetShowState(false);
+               __pConfirmationPopup->Show();
+               delete __pConfirmationPopup;
+               __pConfirmationPopup = null;
+       }
        String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_LOCALLY_CACHED_CONTENT_AND_DATABASES_Q");
        if(!__pConfirmationPopup)
        {
@@ -1036,6 +1063,13 @@ SettingForm::ClearCache(void)
 void
 SettingForm::ClearCookie(void)
 {
+       if(__pConfirmationPopup)
+       {
+               __pConfirmationPopup->SetShowState(false);
+               __pConfirmationPopup->Show();
+               delete __pConfirmationPopup;
+               __pConfirmationPopup = null;
+       }
        String message = CommonUtil::GetString(L"IDS_BR_POP_EMPTY_COOKIE_POPUP_BNO");
        if(!__pConfirmationPopup)
        {
@@ -1051,6 +1085,13 @@ SettingForm::ClearCookie(void)
 void
 SettingForm::ClearFormData(void)
 {
+       if(__pConfirmationPopup)
+       {
+               __pConfirmationPopup->SetShowState(false);
+               __pConfirmationPopup->Show();
+               delete __pConfirmationPopup;
+               __pConfirmationPopup = null;
+       }
        String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_FORM_DATA_Q");
        if(!__pConfirmationPopup)
        {
@@ -1066,6 +1107,13 @@ SettingForm::ClearFormData(void)
 void
 SettingForm::ClearPasswords(void)
 {
+       if(__pConfirmationPopup)
+       {
+               __pConfirmationPopup->SetShowState(false);
+               __pConfirmationPopup->Show();
+               delete __pConfirmationPopup;
+               __pConfirmationPopup = null;
+       }
        String message = CommonUtil::GetString(L"IDS_BR_POP_DELETE_ALL_SAVED_PASSWORDS_Q");
        if(!__pConfirmationPopup)
        {
@@ -1082,6 +1130,13 @@ SettingForm::ClearPasswords(void)
 void
 SettingForm::ResetToDefault()
 {
+       if(__pConfirmationPopup)
+       {
+               __pConfirmationPopup->SetShowState(false);
+               __pConfirmationPopup->Show();
+               delete __pConfirmationPopup;
+               __pConfirmationPopup = null;
+       }
        String message = CommonUtil::GetString(L"IDS_BR_POP_ALL_SETTINGS_TO_DEFAULT_CONTINUE_Q");
        if(!__pConfirmationPopup)
        {