Fix for 45027
[apps/osp/Gallery.git] / src / GlAlbumListForm.cpp
index b09136e..1e09917 100644 (file)
@@ -161,9 +161,11 @@ AlbumListForm::InitializeFooter(void)
        if (__pPresentationModel->GetAppControlMode() == APPCONTROL_MODE_PICK)
        {
                SetFormBackEventListener(this);
+               pFooter->SetShowState(false);
        }
        else
        {
+               pFooter->SetShowState(true);
                pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON);
                pFooter->RemoveAllItems();
 
@@ -218,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()));
@@ -326,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;
@@ -352,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;
 
@@ -376,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)
                        {
@@ -444,7 +441,7 @@ AlbumListForm::OnContentUpdated(void)
 {
        AppLogDebug("ENTER");
 
-       if ( __pOptionMenu != null && __pOptionMenu ->GetShowState() == true)
+       if (__pOptionMenu != null && __pOptionMenu ->GetShowState() == true)
        {
                __pOptionMenu->SetShowState(false);
                __pOptionMenu->Show();
@@ -454,7 +451,6 @@ AlbumListForm::OnContentUpdated(void)
        {
                if (__pPresentationModel->GetAppControlMediaType() == APPCONTROL_MEDIA_TYPE_IMAGE)
                {
-                       __pPresentationModel->ClearThumbnailRequests(false);
                        __pPresentationModel->InitializeAlbumInfoList(CONTENT_TYPE_IMAGE);
                }
                else if (__pPresentationModel->GetAppControlMediaType() == APPCONTROL_MEDIA_TYPE_VIDEO)
@@ -493,6 +489,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)
 {
@@ -507,28 +514,26 @@ void
 AlbumListForm::OnFormMenuRequested (Tizen::Ui::Controls::Form &source)
 {
 
-       if ( __pOptionMenu == null )
+       if (__pOptionMenu == null || GetItemCount() == 0)
        {
-               return ;
+               return;
        }
 
        __pOptionMenu->SetShowState(true);
        __pOptionMenu->Show();
-
 }
 
 void
 AlbumListForm::OnOrientationChanged(const Tizen::Ui::Control &source, Tizen::Ui::OrientationStatus orientationStatus)
 {
-
-       if( __pAlbumViewIconList != null )
+       if (__pAlbumViewIconList != null)
        {
                RemoveControl(__pAlbumViewIconList);
        }
 
        __pAlbumViewIconList = new IconListView();
 
-       if( orientationStatus == ORIENTATION_STATUS_PORTRAIT )
+       if (orientationStatus == ORIENTATION_STATUS_PORTRAIT)
        {
        __pAlbumViewIconList->Construct(Rectangle(0, 0, GetClientAreaBounds().width, GetClientAreaBounds().height),
                    Dimension(W_FOLDER_SIZE, H_FOLDER_SIZE), ICON_LIST_VIEW_STYLE_NORMAL, ICON_LIST_VIEW_SCROLL_DIRECTION_VERTICAL);
@@ -561,12 +566,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);
 
 }
-
-
-
-
-
-