From: rashmi udaya Date: Tue, 11 Jun 2013 11:29:29 +0000 (+0530) Subject: NSE_41049 X-Git-Tag: submit/tizen_2.2/20130714.134410~57 X-Git-Url: http://review.tizen.org/git/?p=apps%2Fosp%2FGallery.git;a=commitdiff_plain;h=24c51f0a2c5875dd01132ffe55f62243ad9a15ee NSE_41049 Change-Id: Iecf9a75186ee8361c21532d2373fa0194f579f4a --- diff --git a/inc/GlSettingMainForm.h b/inc/GlSettingMainForm.h index b357467..ebfe00c 100644 --- a/inc/GlSettingMainForm.h +++ b/inc/GlSettingMainForm.h @@ -22,6 +22,8 @@ #ifndef _GL_SETTING_MAIN_FORM_H_ #define _GL_SETTING_MAIN_FORM_H_ +#include "GlFormContentUpdateEventListener.h" + enum SettingListItemType { ITEM_TYPE_NORMAL = 0, @@ -51,7 +53,8 @@ enum class SettingPresentationModel; class SettingMainForm - : public Tizen::Ui::Controls::Form + : public IFormContentUpdateEventListener + , public Tizen::Ui::Controls::Form , public Tizen::Ui::IActionEventListener , public Tizen::Ui::Controls::IGroupedListViewItemEventListener , public Tizen::Ui::Controls::IGroupedListViewItemProvider @@ -65,6 +68,7 @@ public: virtual result OnInitializing(void); virtual result OnTerminating(void); + virtual void OnContentUpdated(void); virtual void OnActionPerformed(const Tizen::Ui::Control& source, int actionId); @@ -113,6 +117,7 @@ private: private: Tizen::Ui::Controls::GroupedListView* __pList; SettingPresentationModel* __pPresentationModel; + bool __contentUpdated; }; #endif /* _GL_SETTING_MAIN_FORM_H_ */ diff --git a/src/GlSettingMainForm.cpp b/src/GlSettingMainForm.cpp index 2b1f3c7..efe7551 100644 --- a/src/GlSettingMainForm.cpp +++ b/src/GlSettingMainForm.cpp @@ -20,6 +20,7 @@ */ #include "GlDropDownCustomItem.h" +#include "GlFileListPresentationModel.h" #include "GlGalleryApp.h" #include "GlRadioCustomItem.h" #include "GlResourceManager.h" @@ -142,7 +143,14 @@ SettingMainForm::OnFormBackRequested(Form& source) else { SceneManager* pSceneManager = SceneManager::GetInstance(); - pSceneManager->GoBackward(BackwardSceneTransition()); + if (__contentUpdated) + { + pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_LIST)); + } + else + { + pSceneManager->GoBackward(BackwardSceneTransition()); + } } } @@ -150,10 +158,19 @@ SettingMainForm::OnFormBackRequested(Form& source) } void +SettingMainForm::OnContentUpdated(void) +{ + AppLogDebug("ENTER"); + __contentUpdated = true; + AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); +} + +void SettingMainForm::OnSceneActivatedN(const SceneId& previousSceneId, const SceneId& currentSceneId, IList* pArgs) { AppLogDebug("ENTER"); + FileListPresentationModel::GetInstance()->AddContentEventListener(this); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -162,6 +179,7 @@ SettingMainForm::OnSceneDeactivated(const SceneId& currentSceneId, const SceneId& nextSceneId) { AppLogDebug("ENTER"); + FileListPresentationModel::GetInstance()->RemoveContentEventListener(this); AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); }