N_SE-32724
authorDivya Darshini <d.darshini@samsung.com>
Tue, 16 Apr 2013 09:30:26 +0000 (15:00 +0530)
committerDivya Darshini <d.darshini@samsung.com>
Tue, 16 Apr 2013 09:30:26 +0000 (15:00 +0530)
N_SE-34340

Change-Id: Ib5a4bb8499bef46e35db9ccbb17105732f798b92

inc/MmTextEditorForm.h
src/MmListEditorForm.cpp
src/MmListForm.cpp
src/MmListPresentationModel.cpp
src/MmTextEditorForm.cpp

index a045a7e..5034250 100644 (file)
@@ -77,7 +77,7 @@ public:
        void SetOnAdjustmentValueChanged(void);
 
        ///Enable or disable the Save button in header
-       void SetSaveEnable(void);
+       void SetSaveEnable(bool isEnable);
        ///sets the memo content text color
        /**
         * @param the memo text color
index 63b17aa..6a4f6d7 100644 (file)
@@ -441,6 +441,7 @@ MemoListEditorForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& current
        SetFooterEnabled(false);
        CheckEditListItems(__isSelectAll);
        ShowSelectedPopUp(__selectedMemoCount);
+       MemoListPresentationModel::GetInstance()->SetDataEventListener(null);
 }
 
 void
index 5d6ba15..658e079 100644 (file)
@@ -401,6 +401,7 @@ MemoListForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& n
        __pSearchBar->SetShowState(false);
        __pMemoListView->SetBounds(GetClientAreaBounds().x, 0, GetClientAreaBounds().width, GetClientAreaBounds().height);
 
+       MemoListPresentationModel::GetInstance()->SetDataEventListener(null);
        return;
 }
 
index b0412c5..905d3ea 100644 (file)
@@ -335,6 +335,10 @@ MemoListPresentationModel::HandleTaskComplete(const RequestId requestId, IList*
        {
        case ID_MEMO_LIST:
                {
+                       if (__pDataReceiver == null)
+                       {
+                               break;
+                       }
                        if (__pEnum != null)
                        {
                                delete __pEnum;
@@ -361,6 +365,10 @@ MemoListPresentationModel::HandleTaskComplete(const RequestId requestId, IList*
        break;
        case ID_SEARCH_LIST:
                {
+                       if (__pDataReceiver == null)
+                       {
+                               break;
+                       }
                        if (__pEnum != null)
                        {
                                delete __pEnum;
index 956f0cf..0c584de 100644 (file)
@@ -415,7 +415,7 @@ void
 MemoTextEditorForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs)
 {
        RepositionControls(ID_DEFAULT_POSITION);
-       SetSaveEnable();
+       SetSaveEnable(false);
        if (pArgs != null)
        {
                Integer* isNew = static_cast<Integer*>(pArgs->GetAt(0));
@@ -477,7 +477,7 @@ MemoTextEditorForm::OnSliderBarMoved(Slider& source, int value)
 {
        __cursorPosition = __pMemoContentEditarea->GetCursorPosition();
        SetTextSize(value);
-       SetSaveEnable();
+       SetSaveEnable(true);
        return;
 }
 
@@ -486,7 +486,7 @@ void
 MemoTextEditorForm::OnColorChanged(const Control& source, const Color& color)
 {
        SetTextColor(color);
-       SetSaveEnable();
+       SetSaveEnable(true);
        
        return;
 }
@@ -500,15 +500,20 @@ MemoTextEditorForm::OnFormBackRequested(Form& source)
 void
 MemoTextEditorForm::OnTextValueChanged (const Control& source)
 {
+       __isEdited = true;
        if(__isEditMode == true && __isMemoTextMaxLength == true )
        {
                if(__pMemoContentEditarea->GetTextLength() < MAX_TEXTMEMO_LENGTH)
                {
                        __isMemoTextMaxLength = false;
                }
+               else
+               {
+                       SetSaveEnable(false);
+                       return;
+               }
        }
-       __isEdited = true;
-       SetSaveEnable();
+       SetSaveEnable(true);
        return;
 }
 
@@ -762,7 +767,7 @@ MemoTextEditorForm::SetTextColor(Tizen::Graphics::Color color)
 }
 
 void
-MemoTextEditorForm::SetSaveEnable(void)
+MemoTextEditorForm::SetSaveEnable(bool isEnable)
 {
        if (__pMemoContentEditarea->GetTextLength() == 0)
        {
@@ -772,23 +777,9 @@ MemoTextEditorForm::SetSaveEnable(void)
        }
        else
        {
-               if(__isMemoTextMaxLength == false)
-               {
-                       String text = __pMemoContentEditarea->GetText();
-                       text.Trim();
-                       if(text.GetLength() == 0)
-                       {
-                               __pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
-                       }
-                       else
-                       {
-                               __pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
-                       }
-               }
-               else
-               {
-                       __pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
-               }
+               String text = __pMemoContentEditarea->GetText();
+               text.Trim();
+               __pFormHeader->SetButtonEnabled(BUTTON_POSITION_LEFT, isEnable);
                __pFormHeader->SetItemSelected(0);
        }
        __pFormHeader->Draw();