Changed Add/Edit comment logic
authorSeema <seema.nagraj@samsung.com>
Mon, 22 Apr 2013 11:23:32 +0000 (16:53 +0530)
committerSeema <seema.nagraj@samsung.com>
Mon, 22 Apr 2013 11:23:32 +0000 (16:53 +0530)
Change-Id: Ia25d433e6dbc108aecbef7dbe0a418a67dfb5495
Signed-off-by: Seema <seema.nagraj@samsung.com>
inc/MmAddEditCommentForm.h
res/screen-size-normal/IDL_MEMO_TEXT_EDITOR.xml
src/MmAddEditCommentForm.cpp

index 02af935..a17be71 100644 (file)
@@ -41,6 +41,7 @@ public:
        Tizen::Ui::Controls::FooterItem         __footerItemDone;
        Tizen::Base::Collection::ArrayList*     __pUpdateDetails;
        Tizen::Ui::Scenes::SceneId                              __previousSceneId;
+       bool                                                                    __isEditMode;
 };
 
 #endif
index fe2310e..5698d13 100644 (file)
@@ -76,7 +76,7 @@
     </Button>
     <Panel id="IDC_PANEL_COLORPICKER" parent="IDL_MEMO_TEXT_EDITOR">
         <property backgroundColor="#FFFFFF" backgroundColorOpacity="100" compositeEnabled="true" groupStyle="GROUP_STYLE_NONE"/>
-        <layout bottomRelation="IDL_MEMO_TEXT_EDITOR" bottomRelationType="RECT_EDGE_RELATION_BOTTOM_TO_BOTTOM" centerHorizontal="false" centerVertical="false" height="600.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="None" topRelationType="" type="NONE" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="509.0"/>
+        <layout bottomRelation="None" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="600.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Portrait" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="NONE" verticalFitPolicy="FIT_POLICY_FIXED" width="720.0" x="0.0" y="509.0"/>
         <layout bottomRelation="" bottomRelationType="" centerHorizontal="false" centerVertical="false" height="500.0" horizontalFitPolicy="FIT_POLICY_FIXED" leftRelation="" leftRelationType="" marginBottom="0.0" marginLeft="0.0" marginRight="0.0" marginTop="0.0" mode="Landscape" rightRelation="" rightRelationType="" topRelation="" topRelationType="" type="NONE" verticalFitPolicy="FIT_POLICY_FIXED" width="1299.0" x="29.0" y="69.0"/>
     </Panel>
     <ColorPicker id="IDC_COLORPICKER" parent="IDC_PANEL_COLORPICKER">
index 89b3c66..fdaf88c 100644 (file)
@@ -16,6 +16,7 @@ MemoAddEditCommentForm::MemoAddEditCommentForm(void)
 , __pHeader(null)
 , __pFooter(null)
 , __pUpdateDetails(null)
+, __isEditMode(false)
 {
 }
 
@@ -84,6 +85,7 @@ MemoAddEditCommentForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& prev
                String* pComment = static_cast<String*>(pArgs->GetAt(0));
                if(pComment != null)
                {
+                       __isEditMode = true;
                        __pComment->SetText(pComment->GetPointer());
                        __pHeader->SetTitleText(L"Edit Comment"); //TODO: Resource string
                        if(pComment->IsEmpty() == true || pComment->GetLength() >= 100)
@@ -101,6 +103,7 @@ MemoAddEditCommentForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& prev
        {
                __pHeader->SetTitleText(GetResourceString(L"IDS_MEMO_BODY_ADD_COMMENT"));
                __pFooter->SetItemEnabled(0, false);
+               __isEditMode = false;
        }
        __pFooter->Draw();
 }
@@ -172,7 +175,11 @@ MemoAddEditCommentForm::OnTextValueChanged(const Tizen::Ui::Control& source)
        {
                __pFooter->SetItemEnabled(0, true);
        }
-       else if(__pComment->GetTextLength() == 0)
+       else if(__pComment->GetTextLength() == 0 && __isEditMode == true)
+       {
+               __pFooter->SetItemEnabled(0, true);
+       }
+       else
        {
                __pFooter->SetItemEnabled(0, false);
        }