Remove unnecessary exception.
authorKeuckdo Bang <keuckdo.bang@samsung.net>
Wed, 12 Jun 2013 04:37:21 +0000 (13:37 +0900)
committerKeuckdo Bang <keuckdo.bang@samsung.net>
Wed, 12 Jun 2013 06:08:14 +0000 (15:08 +0900)
Change-Id: I5887c76aef99c3c6a4f1b1a923ad88f64208a085

src/ui/controls/FUiCtrl_Form.cpp
src/ui/controls/FUiCtrl_FormImpl.cpp

index 487ff38..dc460cc 100644 (file)
@@ -339,8 +339,8 @@ _Form::OnDraw(void)
 void
 _Form::SetFormBackEventListener(_IFormBackEventListener* pFormBackEventListener)
 {
-       SysTryReturnVoidResult(NID_UI_CTRL, __pFooter || __pHeader, E_INVALID_STATE, "[E_INVALID_STATE] Footer and Header aren't constructed.");
        __pFormBackEventListener = pFormBackEventListener;
+
        if (__pFooter)
        {
                __pFooter->SetBackEventListener(*this, ID_BACK_BUTTON);
@@ -356,8 +356,8 @@ _Form::SetFormBackEventListener(_IFormBackEventListener* pFormBackEventListener)
 void
 _Form::SetFormMenuEventListener(_IFormMenuEventListener* pFormMenuEventListener)
 {
-       SysTryReturnVoidResult(NID_UI_CTRL, __pFooter, E_INVALID_STATE, "[E_INVALID_STATE] Footer and Header aren't constructed.");
        __pFormMenuEventListener = pFormMenuEventListener;
+
        if (__pFooter)
        {
                __pFooter->SetMenuEventListener(*this, ID_MENU_BUTTON);
index de0c8d7..04ab5ee 100644 (file)
@@ -376,8 +376,6 @@ _FormImpl::SetFormStyle(unsigned long formStyle)
 
                        r = GetCore().AttachSystemChild(pHeader->GetCore());
                        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-
-                       GetCore().SetFormBackEventListener(this);
                }
        }
        else if (formStyle & FORM_STYLE_TITLE)
@@ -495,9 +493,6 @@ _FormImpl::SetFormStyle(unsigned long formStyle)
 
                        r = GetCore().AttachSystemChild(pFooter->GetCore());
                        SysTryReturnVoidResult(NID_UI_CTRL, r == E_SUCCESS, r, "[%s] Propagating.", GetErrorMessage(r));
-                       //[ToDo]
-                       GetCore().SetFormBackEventListener(this);
-                       GetCore().SetFormMenuEventListener(this);
                }
        }
        else if (formStyle & FORM_STYLE_SOFTKEY_0 || formStyle & FORM_STYLE_SOFTKEY_1 || formStyle & FORM_STYLE_OPTIONKEY)
@@ -544,6 +539,9 @@ _FormImpl::SetFormStyle(unsigned long formStyle)
                }
        }
 
+       GetCore().SetFormBackEventListener(this);
+       GetCore().SetFormMenuEventListener(this);
+
        GetCore().AdjustClientBounds();
 
        SetLastResult(E_SUCCESS);
@@ -842,7 +840,15 @@ _FormImpl::TranslateFromClientAreaPosition(const FloatPoint& clientPosition) con
 void
 _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEventListener)
 {
-       SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
+       bool isBackButton = false;
+
+       Tizen::System::SystemInfo::GetValue(L"http://tizen.org/feature/input.keys.back", isBackButton);
+
+       if(!isBackButton)
+       {
+               SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
+       }
+
        __pFormBackEventListener = const_cast <IFormBackEventListener*>(pFormBackEventListener);
        GetCore().SetFormBackEventListener(this);
        result r = GetLastResult();
@@ -852,7 +858,14 @@ _FormImpl::SetFormBackEventListener(const IFormBackEventListener* pFormBackEvent
 void
 _FormImpl::SetFormMenuEventListener(const IFormMenuEventListener* pFormMenuEventListener)
 {
-       SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
+       bool isBackButton = false;
+
+       Tizen::System::SystemInfo::GetValue(L"http://tizen.org/feature/input.keys.back", isBackButton);
+
+       if(!isBackButton)
+       {
+               SysTryReturnVoidResult(NID_UI_CTRL, GetFooter() || GetHeader(), E_INVALID_STATE, "[E_INVALID_STATE] Footer isn't constructed.");
+       }
        __pFormMenuEventListener = const_cast <IFormMenuEventListener*>(pFormMenuEventListener);
        GetCore().SetFormMenuEventListener(this);
        result r = GetLastResult();