Back event changes
[apps/osp/Gallery.git] / src / GlAlbumListForm.cpp
index 5b6bc71..56dfba2 100644 (file)
@@ -220,7 +220,7 @@ AlbumListForm::CreateIconListView(void)
        }
        __pAlbumViewIconList->SetTextOfEmptyList(ResourceManager::GetString(L"IDS_COM_BODY_NO_ITEMS"));
 
-       AddControl(*__pAlbumViewIconList);
+       AddControl(__pAlbumViewIconList);
 
        __pAlbumViewIconList->SetShowState(true);
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
@@ -328,11 +328,6 @@ AlbumListForm::OnTerminating(void)
        AppLogDebug("ENTER");
        __pPresentationModel->RemovePresentationModelListener(*this);
        __pPresentationModel->RemoveContentEventListener(*this);
-       if (__pContextMenuMore != null)
-       {
-               delete __pContextMenuMore;
-               __pContextMenuMore = null;
-       }
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 
        return E_SUCCESS;
@@ -354,7 +349,7 @@ AlbumListForm::OnActionPerformed(const Control& source, int actionId)
                                new (std::nothrow) String(APPCONTROL_DATA_TRUE));
                __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_CAMERA,
                                APPCONTROL_OPERATION_ID_CREATE_CONTENT, null,
-                               new (std::nothrow) String(APPCONTROL_MIME_IMAGE_JPG), pDataList, null);
+                               new (std::nothrow) String(APPCONTROL_MIME_IMAGE_JPG), pDataList, this);
        }
        break;
 
@@ -378,7 +373,7 @@ AlbumListForm::OnFormBackRequested(Form& source)
        {
                AppLogDebug("APP_CONTROL_MODE_PICK");
                GalleryApp* pApp = dynamic_cast<GalleryApp*>(UiApp::GetInstance());
-               if (pApp != null)
+               if (pApp != null && pApp->GetFrameActivated() == true)
                {
                        if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
                        {
@@ -495,6 +490,17 @@ AlbumListForm::OnThumbnailDecoded(const int index)
        AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
 }
 
+void
+AlbumListForm::OnAppControlCompleteResponseReceived(const AppId& appId, const Tizen::Base::String& operationId,
+                       AppCtrlResult appControlResult, const Tizen::Base::Collection::IMap* pExtraData)
+{
+       AppLogDebug("OnAppControlCompleteResponseReceived : %d", appControlResult);
+
+       GalleryApp* pGalleryApp = static_cast<GalleryApp*>(GalleryApp::GetInstance());
+       TryReturnVoid(pGalleryApp != null, "pGalleryApp is null");
+       pGalleryApp->SetFrameEnabled(true);
+}
+
 result
 AlbumListForm::Update(void)
 {
@@ -509,7 +515,7 @@ void
 AlbumListForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
 {
 
-       if ( __pOptionMenu == null )
+       if ( __pOptionMenu == null || GetItemCount() == 0)
        {
                return ;
        }
@@ -563,12 +569,6 @@ AlbumListForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui:
        __pAlbumViewIconList->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE);
        __pAlbumViewIconList->AddIconListViewItemEventListener(*this);
 
-       AddControl(*__pAlbumViewIconList);
+       AddControl(__pAlbumViewIconList);
 
 }
-
-
-
-
-
-