#include "GlGalleryApp.h"
#include "GlImageListEditorPanel.h"
#include "GlResourceManager.h"
+#include "GlSlideSettingListener.h"
#include "GlTypes.h"
#include "GlVideoListEditorPanel.h"
#include "GlFileMoveTimer.h"
return r;
}
+
result
FileListEditorForm::OnInitializing(void)
{
Header* pHeader = GetHeader();
TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
+ __pPopUp = new (std::nothrow) SlideShowPopUp();
+
+ if (__pPopUp != null)
+ {
+ __pPopUp->Initialize();
+ __pPopUp->SetEventListner(this);
+ AddControl(*__pPopUp);
+ }
+
__pPresentationModel = FileListPresentationModel::GetInstance();
__pPresentationModel->ClearThumbnailRequests();
+ __pPresentationModel->AddContentEventListener(this);
pHeader->SetStyle(HEADER_STYLE_TITLE);
pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
+
+ if ((__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK
+ && __pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_SINGLE) == false)
+ {
+ Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL);
+ Bitmap* pPressBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL_PRESS);
+ ButtonItem selectAll;
+ selectAll.Construct(BUTTON_ITEM_STYLE_ICON, ACTION_ID_FILE_LIST_SELECT_ALL);
+ selectAll.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pNormalBitmap);
+ selectAll.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pPressBitmap);
+ pHeader->SetButton(BUTTON_POSITION_LEFT, selectAll);
+ delete pNormalBitmap;
+ delete pPressBitmap;
+ }
+
pHeader->AddActionEventListener(*this);
InitializeFooter();
{
if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
{
- pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
+ pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
FooterItem footerConfirm;
- r = footerConfirm.Construct(ACTION_ID_FOOTER_CONFIRM);
- TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
- footerConfirm.SetText(ResourceManager::GetString(L"IDS_COM_POP_DONE"));
- r = pFooter->AddItem(footerConfirm);
- TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
-
- pFooter->SetBackButton();
- SetFormBackEventListener(this);
+ footerConfirm.Construct(ACTION_ID_FOOTER_CONFIRM);
+ footerConfirm.SetText(ResourceManager::GetString(L"IDS_COM_SK_DONE"));
+ pFooter->AddItem(footerConfirm);
}
else
{
pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
- pFooter->SetBackButton();
- SetFormBackEventListener(this);
}
+ pFooter->SetBackButton();
+ SetFormBackEventListener(this);
}
else
{
Bitmap* pBitmapMore = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE);
Bitmap* pBitmapMoreDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_DISABLED);
- if (pBitmapMore != null && pBitmapMoreDim != NULL )
+ if (pBitmapMore != null && pBitmapMoreDim != NULL)
{
footerMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapMore);
footerMore.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapMoreDim);
Bitmap* pBitmapShare = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE);
Bitmap* pBitmapShareDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE_DIM);
- if (pBitmapShare != null && pBitmapShareDim != null )
+ if (pBitmapShare != null && pBitmapShareDim != null)
{
footerShare.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapShare);
footerShare.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapShareDim);
{
AppLogDebug("ENTER");
+ __pPresentationModel->RemoveContentEventListener(this);
if (__pContextMenuMore != null)
{
__pContextMenuMore->RemoveActionEventListener(*this);
switch (actionId)
{
+ case ACTION_ID_FILE_LIST_SELECT_ALL:
+ SelectAllPressed();
+ break;
case ACTION_ID_FOOTER_MORE:
{
-
InitializeFooter();
if (__pContextMenuMore->GetShowState() == false)
}
case ACTION_ID_CONTEXT_MENU_MORE_SLIDE_SHOW:
{
- if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
- {
- AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
- if (pEditorPanel != null)
- {
- pEditorPanel->OnRequestSlideShow();
- }
- }
- else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+ if (__pPopUp != null)
{
- AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
- if (pSelectionPanel != null)
- {
- pSelectionPanel->OnRequestSlideShow();
- }
+ __pPopUp->SetShowState(true);
+ __pPopUp->Show();
}
break;
{
AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
-
+ pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
}
break;
AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
(pSceneManager->GetCurrentScene()->GetPanel());
IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
+ pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
}
break;
if (pEditorPanel != null)
{
result r = pEditorPanel->OnRequestDelete();
- if ( IsFailed(r) )
+ if (IsFailed(r))
{
AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
}
if (pSelectionPanel != null)
{
result r = pSelectionPanel->OnRequestDelete();
- if ( IsFailed(r) )
+ if (IsFailed(r))
{
AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
}
}
}
-
break;
}
case ACTION_ID_DELETE_POPUP_CANCEL:
delete __pFileMove;
IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
- __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList,
- __pPresentationModel, this );
+ __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
result r = __pFileMove->StartTimer();
if (IsFailed(r))
{
delete __pFileMove;
IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
- __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList,
- __pPresentationModel, this );
+ __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
result r = __pFileMove->StartTimer();
if (IsFailed(r))
{
}
}
}
-
break;
}
}
}
void
-FileListEditorForm::OnUpdateContentList()
+FileListEditorForm::OnContentUpdated()
{
AppLogDebug("ENTER");
if (__overlayMsg == false)
pContentTypeList->Add(CONTENT_TYPE_VIDEO);
contentDirectory.Construct(*pContentTypeList);
delete pContentTypeList;
- pContentTypeList = null;
if (__pContentDirectoryList != null)
{
return r;
}
+
+void
+FileListEditorForm::SelectAllPressed(void)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GetCurrentScene();
+
+ if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
+ {
+ AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+ if (pEditorPanel != null)
+ {
+ pEditorPanel->SelectAllPressed();
+ }
+ }
+ else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
+ {
+ ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+ if (pEditorPanel != null)
+ {
+ pEditorPanel->SelectAllPressed();
+ }
+ }
+ else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
+ {
+ VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+ if (pEditorPanel != null)
+ {
+ pEditorPanel->SelectAllPressed();
+ }
+ }
+ else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+ {
+ AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+ if (pEditorPanel != null)
+ {
+ pEditorPanel->SelectAllPressed();
+ }
+ }
+}
+
+void
+FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
+{
+ if (__pPopUp != NULL)
+ {
+ __pPopUp->SetShowState(false);
+ }
+
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+
+ if (index == 0) // start slide show
+ {
+ if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
+ {
+ AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
+ if (pEditorPanel != null)
+ {
+ pEditorPanel->OnRequestSlideShow();
+ }
+ }
+ else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
+ {
+ AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
+ (pSceneManager->GetCurrentScene()->GetPanel());
+
+ if (pSelectionPanel != null)
+ {
+ pSelectionPanel->OnRequestSlideShow();
+ }
+ }
+ }
+ else if (index == 1) // go to settingsForm
+ {
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
+
+ pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
+ }
+}