Support new language - farsi, urdu, Thai
[apps/osp/Gallery.git] / src / GlFileListEditorForm.cpp
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
4 // Licensed under the Flora License, Version 1.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //     http://floralicense.org/license/
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an AS IS BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 //
16
17 /**
18  * @file                GlFileListEditorForm.cpp
19  * @brief               This is the implementation file for FileListEditorForm class.
20  */
21
22 #include "GlAllListEditorPanel.h"
23 #include "GlAllListSelectionPanel.h"
24 #include "GlFileListEditorForm.h"
25 #include "GlFileListPresentationModel.h"
26 #include "GlGalleryApp.h"
27 #include "GlImageListEditorPanel.h"
28 #include "GlResourceManager.h"
29 #include "GlSlideSettingListener.h"
30 #include "GlTypes.h"
31 #include "GlVideoListEditorPanel.h"
32 #include "GlFileMoveTimer.h"
33
34
35 using namespace Tizen::App;
36 using namespace Tizen::Base;
37 using namespace Tizen::Base::Collection;
38 using namespace Tizen::Content;
39 using namespace Tizen::Graphics;
40 using namespace Tizen::Ui;
41 using namespace Tizen::Ui::Controls;
42 using namespace Tizen::Ui::Scenes;
43 using namespace Tizen::Base::Utility;
44
45 static const int GAP_W_POPUP_ITEM = 5;
46 static const int W_DELETE_POPUP = 600;
47 static const int H_DELETE_POPUP = 300;
48 static const int H_DELETE_LABEL = 180;
49 static const int Y_DELETE_BUTTON = 180;
50 static const int H_DELETE_BUTTON = 80;
51
52 static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value;
53 static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value;
54 static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value;
55
56 FileListEditorForm::FileListEditorForm(void)
57         : __pContextMenuMore(null)
58         , __pContextMenuShare(null)
59         , __pContextEditorMenuMove(null)
60         , __pContextSelectionMenuMove(null)
61         , __pDeletePopup(null)
62         , __morePosition(Point(0, 0))
63         , __pContentDirectoryList(null)
64         , __pContentDirectoryNameList(null)
65         , __pPresentationModel(null)
66         , __pFileMove(null)
67         ,__isCopyOperation(false)
68 {
69         AppLogDebug("ENTER");
70         __overlayMsg = false;
71         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
72 }
73
74 FileListEditorForm::~FileListEditorForm(void)
75 {
76         AppLogDebug("ENTER");
77         if (__pContentDirectoryList != null)
78         {
79                 delete __pContentDirectoryList;
80         }
81         if (__pContentDirectoryNameList != null)
82         {
83                 delete __pContentDirectoryNameList;
84         }
85         delete __pFileMove;
86         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
87 }
88
89 result
90 FileListEditorForm::Initialize(void)
91 {
92         AppLogDebug("ENTER");
93         result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
94         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
95
96         return r;
97 }
98
99 result
100 FileListEditorForm::OnInitializing(void)
101 {
102         AppLogDebug("ENTER");
103         Header* pHeader = GetHeader();
104         TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
105
106         __pPopUp = new (std::nothrow) SlideShowPopUp();
107
108         if (__pPopUp != null)
109         {
110                 __pPopUp->Initialize();
111                 __pPopUp->SetEventListner(this);
112                 AddControl(*__pPopUp);
113         }
114
115         __pPresentationModel = FileListPresentationModel::GetInstance();
116         __pPresentationModel->ClearThumbnailRequests();
117
118         pHeader->SetStyle(HEADER_STYLE_TITLE);
119         pHeader->SetTitleText(ResourceManager::GetString(L"IDS_COM_BODY_EDIT"));
120
121         if ((__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK
122                 && __pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_SINGLE) == false)
123         {
124                 Bitmap* pNormalBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL);
125                 Bitmap* pPressBitmap = ResourceManager::GetBitmapN(IDB_ICON_SELECT_ALL_PRESS);
126                 ButtonItem selectAll;
127                 selectAll.Construct(BUTTON_ITEM_STYLE_ICON, ACTION_ID_FILE_LIST_SELECT_ALL);
128                 selectAll.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pNormalBitmap);
129                 selectAll.SetIcon(BUTTON_ITEM_STATUS_PRESSED, pPressBitmap);
130                 pHeader->SetButton(BUTTON_POSITION_LEFT, selectAll);
131                 delete pNormalBitmap;
132                 delete pPressBitmap;
133         }
134
135         pHeader->AddActionEventListener(*this);
136
137         InitializeFooter();
138         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
139
140         return E_SUCCESS;
141 }
142
143 result
144 FileListEditorForm::InitializeFooter(void)
145 {
146         AppLogDebug("ENTER");
147         Footer* pFooter = GetFooter();
148         TryReturn(pFooter != null, E_FAILURE, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
149         pFooter->RemoveAllItems();
150
151         result r = E_SUCCESS;
152
153         if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
154         {
155                 if (__pPresentationModel->GetAppControlSelectionMode() == APPCONTROL_SELECTION_MODE_MULTIPLE)
156                 {
157                         pFooter->SetStyle(FOOTER_STYLE_BUTTON_TEXT);
158
159                         FooterItem footerConfirm;
160                         footerConfirm.Construct(ACTION_ID_FOOTER_CONFIRM);
161                         footerConfirm.SetText(ResourceManager::GetString(L"IDS_COM_SK_DONE"));
162                         pFooter->AddItem(footerConfirm);
163                 }
164                 else
165                 {
166                         pFooter->SetStyle(FOOTER_STYLE_SEGMENTED_TEXT);
167                 }
168                 pFooter->SetBackButton();
169                 SetFormBackEventListener(this);
170         }
171         else
172         {
173                 pFooter->SetStyle(FOOTER_STYLE_BUTTON_ICON_TEXT);
174
175                 ButtonItem footerMore;
176                 footerMore.Construct(BUTTON_ITEM_STYLE_ICON, ACTION_ID_FOOTER_MORE);
177                 Bitmap* pBitmapMore = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE);
178                 Bitmap* pBitmapMoreDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_DISABLED);
179
180                 if (pBitmapMore != null && pBitmapMoreDim != NULL)
181                 {
182                         footerMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapMore);
183                         footerMore.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapMoreDim);
184                 }
185                 pFooter->SetButton(BUTTON_POSITION_LEFT,footerMore);
186
187                 delete pBitmapMore;
188                 delete pBitmapMoreDim;
189
190                 FooterItem footerShare;
191                 r = footerShare.Construct(ACTION_ID_FOOTER_SHARE);
192                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
193                 Bitmap* pBitmapShare = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE);
194                 Bitmap* pBitmapShareDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_SHARE_DIM);
195
196                 if (pBitmapShare != null &&  pBitmapShareDim != null)
197                 {
198                         footerShare.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapShare);
199                         footerShare.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapShareDim);
200                 }
201
202                 r = pFooter->AddItem(footerShare);
203                 delete pBitmapShare;
204                 delete pBitmapShareDim;
205                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
206
207                 FooterItem footerDelete;
208                 r = footerDelete.Construct(ACTION_ID_FOOTER_DELETE);
209                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r));
210                 Bitmap* pBitmapDelete = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE);
211                 Bitmap* pBitmapDeleteDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_DELETE_DIM);
212
213                 if (pBitmapDelete != null && pBitmapDeleteDim != null)
214                 {
215                         footerDelete.SetIcon(FOOTER_ITEM_STATUS_NORMAL, pBitmapDelete);
216                         footerDelete.SetIcon(FOOTER_ITEM_STATUS_DISABLED, pBitmapDeleteDim);
217                 }
218
219                 r = pFooter->AddItem(footerDelete);
220                 delete pBitmapDelete;
221                 delete pBitmapDeleteDim;
222                 TryReturn(r == E_SUCCESS, r, "[%s] Unable to add item", GetErrorMessage(r));
223
224                 pFooter->SetBackButton();
225                 SetFormBackEventListener(this);
226
227                 SceneManager* pSceneManager = SceneManager::GetInstance();
228                 int checkedCount = 0;
229
230                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
231                 {
232                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
233                         if (pEditorPanel != null)
234                         {
235                                 checkedCount = pEditorPanel->GetItemCheckedCount();
236                         }
237                 }
238                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
239                 {
240                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
241                         if (pSelectionPanel != null)
242                         {
243                                 checkedCount = pSelectionPanel->GetItemCheckedCount();
244                         }
245                 }
246
247                 AppLogDebug("GetItemCheckedCount(%d)", checkedCount);
248
249                 if (__pContextMenuMore != null)
250                 {
251                         delete __pContextMenuMore;
252                         __pContextMenuMore = null;
253                 }
254
255                 __pContextMenuMore = new (std::nothrow) ContextMenu();
256                 __pContextMenuMore->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
257
258                 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MOVE"),
259                                 ACTION_ID_CONTEXT_MENU_MORE_MOVE);
260                 __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_COPY"),
261                                                 ACTION_ID_CONTEXT_MENU_MORE_COPY);
262
263                 if (checkedCount > 1)
264                 {
265                         __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_BUTTON_SLIDE_SHOW"),
266                                         ACTION_ID_CONTEXT_MENU_MORE_SLIDE_SHOW);
267                 }
268
269                 __pContextMenuMore->SetShowState(false);
270                 __pContextMenuMore->AddActionEventListener(*this);
271
272                 __pContextMenuShare = new (std::nothrow) ContextMenu();
273                 __pContextMenuShare->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
274                 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
275                                 ACTION_ID_CONTEXT_MENU_SHARE_MESSAGE);
276                 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
277                                 ACTION_ID_CONTEXT_MENU_SHARE_EMAIL);
278                 __pContextMenuShare->SetShowState(false);
279                 __pContextMenuShare->AddActionEventListener(*this);
280
281                 __pContextEditorMenuMove = new (std::nothrow) ContextMenu();
282                 __pContextEditorMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
283                 __pContextEditorMenuMove->AddActionEventListener(*this);
284
285                 __pContextSelectionMenuMove = new (std::nothrow) ContextMenu();
286                 __pContextSelectionMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
287                 __pContextSelectionMenuMove->AddActionEventListener(*this);
288
289                 if (__pContentDirectoryNameList != null)
290                 {
291                         delete __pContentDirectoryNameList;
292                         __pContentDirectoryNameList = null;
293                 }
294
295                 SetUpPopup();
296         }
297
298         pFooter->AddActionEventListener(*this);
299         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
300
301         return r;
302 }
303
304 String
305 FileListEditorForm::GetDirecotyNameFromFullPath(const String& fullPath)const
306 {
307         AppLogDebug("ENTER");
308         if (fullPath == null)
309         {
310                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
311
312                 return null;
313         }
314         String delim(DIRECTORY_SEPARATOR);
315         StringTokenizer st(fullPath,delim);
316         String token;
317         while (st.HasMoreTokens())
318         {
319                 st.GetNextToken(token);
320         }
321         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
322
323         return token;
324 }
325
326 result
327 FileListEditorForm::OnTerminating(void)
328 {
329         AppLogDebug("ENTER");
330
331         if (__pContextMenuMore != null)
332         {
333                 __pContextMenuMore->RemoveActionEventListener(*this);
334                 delete __pContextMenuMore;
335                 __pContextMenuMore = null;
336         }
337
338         if (__pContextMenuShare != null)
339         {
340                 __pContextMenuShare->RemoveActionEventListener(*this);
341                 delete __pContextMenuShare;
342                 __pContextMenuShare = null;
343         }
344
345         if (__pContextEditorMenuMove != null)
346         {
347                 __pContextEditorMenuMove->RemoveActionEventListener(*this);
348                 delete __pContextEditorMenuMove;
349                 __pContextEditorMenuMove = null;
350         }
351
352         if (__pContextSelectionMenuMove != null)
353         {
354                 __pContextSelectionMenuMove->RemoveActionEventListener(*this);
355                 delete __pContextSelectionMenuMove;
356                 __pContextSelectionMenuMove = null;
357         }
358
359         if (__pDeletePopup != null)
360         {
361                 delete __pDeletePopup;
362                 __pDeletePopup = null;
363         }
364         __overlayMsg = false;
365         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
366
367         return E_SUCCESS;
368 }
369
370 void
371 FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
372 {
373         AppLogDebug("ENTER(actionId=%d)", actionId);
374         SceneManager* pSceneManager = SceneManager::GetInstance();
375         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
376
377         switch (actionId)
378         {
379         case ACTION_ID_FILE_LIST_SELECT_ALL:
380                 SelectAllPressed();
381                 break;
382         case ACTION_ID_FOOTER_MORE:
383         {
384                 InitializeFooter();
385
386                 if (__pContextMenuMore->GetShowState() == false)
387                 {
388                         Rectangle rect = source.GetBounds();
389                         __morePosition = Point(rect.width/8,rect.y);
390                         __pContextMenuMore->SetAnchorPosition(Point(rect.width/8,rect.y));
391                         __pContextMenuMore->SetShowState(true);
392                         __pContextMenuMore->Show();
393                 }
394                 else
395                 {
396                         __pContextMenuMore->SetShowState(false);
397                 }
398                 break;
399         }
400         case ACTION_ID_FOOTER_SHARE:
401         {
402                 if (__pContextMenuShare->GetShowState() == false)
403                 {
404                         Rectangle rect = source.GetBounds();
405                         __pContextMenuShare->SetAnchorPosition(Point(rect.width/8*3 ,rect.y));
406                         __pContextMenuShare->SetShowState(true);
407                         __pContextMenuShare->Show();
408                 }
409                 else
410                 {
411                         __pContextMenuShare->SetShowState(false);
412                 }
413                 break;
414         }
415         case ACTION_ID_FOOTER_DELETE:
416         {
417                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
418                 {
419                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
420                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
421                         {
422                                 __pDeletePopup->SetShowState(true);
423                                 __pDeletePopup->Show();
424                                 __overlayMsg = true;
425                         }
426                 }
427                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
428                 {
429                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
430                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
431                         {
432                                 __pDeletePopup->SetShowState(true);
433                                 __pDeletePopup->Show();
434                                 __overlayMsg = true;
435                         }
436                 }
437                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
438                 {
439                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
440                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
441                         {
442                                 __pDeletePopup->SetShowState(true);
443                                 __pDeletePopup->Show();
444                                 __overlayMsg = true;
445                         }
446                 }
447                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
448                 {
449                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
450                         (pSceneManager->GetCurrentScene()->GetPanel());
451                         if (pSelectionPanel != null && pSelectionPanel->GetItemCheckedCount() > 0)
452                         {
453                                 __pDeletePopup->SetShowState(true);
454                                 __pDeletePopup->Show();
455                                 __overlayMsg = true;
456                         }
457                 }
458                 break;
459         }
460         case ACTION_ID_CONTEXT_MENU_MORE_EDIT:
461         {
462                 break;
463         }
464         case ACTION_ID_CONTEXT_MENU_MORE_ADD_TAG:
465         {
466                 break;
467         }
468         case ACTION_ID_CONTEXT_MENU_MORE_COPY:
469         case ACTION_ID_CONTEXT_MENU_MORE_MOVE:
470         {
471                 if (actionId == ACTION_ID_CONTEXT_MENU_MORE_MOVE)
472                 {
473                         __isCopyOperation = false;
474                 }
475                 else if (actionId == ACTION_ID_CONTEXT_MENU_MORE_COPY)
476                 {
477                         __isCopyOperation = true;
478                 }
479                 RefreshFolderList();
480                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
481                 {
482                         if (__pContextEditorMenuMove->GetShowState() == false)
483                         {
484                                 __pContextEditorMenuMove->SetAnchorPosition(__morePosition);
485                                 __pContextEditorMenuMove->SetShowState(true);
486                                 __pContextEditorMenuMove->Show();
487                         }
488                         else
489                         {
490                                 __pContextEditorMenuMove->SetShowState(false);
491                         }
492                 }
493                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
494                 {
495                         if (__pContextSelectionMenuMove->GetShowState() == false)
496                         {
497                                 __pContextSelectionMenuMove->SetAnchorPosition(__morePosition);
498                                 __pContextSelectionMenuMove->SetShowState(true);
499                                 __pContextSelectionMenuMove->Show();
500                         }
501                         else
502                         {
503                                 __pContextSelectionMenuMove->SetShowState(false);
504                         }
505                 }
506
507                 break;
508         }
509         case ACTION_ID_CONTEXT_MENU_MORE_SLIDE_SHOW:
510         {
511                 if (__pPopUp != null)
512                 {
513                         __pPopUp->SetShowState(true);
514                         __pPopUp->Show();
515                 }
516
517                 break;
518         }
519         case ACTION_ID_CONTEXT_MENU_SHARE_MESSAGE:
520         {
521                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
522                 {
523                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
524                         if (pEditorPanel != null)
525                         {
526                                 pEditorPanel->OnRequestMessage();
527                         }
528                 }
529                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
530                 {
531                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
532                         if (pEditorPanel != null)
533                         {
534                                 pEditorPanel->OnRequestMessage();
535                         }
536                 }
537                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
538                 {
539                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
540                         if (pEditorPanel != null)
541                         {
542                                 pEditorPanel->OnRequestMessage();
543                         }
544
545                 }
546                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
547                 {
548                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
549                         if (pSelectionPanel != null)
550                         {
551                                 pSelectionPanel->OnRequestMessage();
552                         }
553                 }
554                 break;
555         }
556         case ACTION_ID_CONTEXT_MENU_SHARE_EMAIL:
557         {
558                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
559                 {
560                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
561                         if (pEditorPanel != null)
562                         {
563                                 pEditorPanel->OnRequestEmail();
564                         }
565                 }
566                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
567                 {
568                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
569                         if (pEditorPanel != null)
570                         {
571                                 pEditorPanel->OnRequestEmail();
572                         }
573                 }
574                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
575                 {
576                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
577                         if (pEditorPanel != null)
578                         {
579                                 pEditorPanel->OnRequestEmail();
580                         }
581
582                 }
583                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
584                 {
585                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
586                         if (pSelectionPanel != null)
587                         {
588                                 pSelectionPanel->OnRequestEmail();
589                         }
590                 }
591                 break;
592         }
593         case ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM:
594         {
595                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
596                 {
597                         AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
598                         IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
599                         pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
600                         if(__isCopyOperation)
601                         {
602                                 pList->InsertAt(new (std::nothrow) Integer(FILE_COPY_ACTION), ALBUM_SECOND_ELEMENT);
603                         }
604                         else
605                         {
606                                 pList->InsertAt(new (std::nothrow) Integer(FILE_MOVE_ACTION), ALBUM_SECOND_ELEMENT);
607                         }
608                         pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
609                 }
610                 break;
611         }
612         case ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM:
613         {
614                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
615                 {
616                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
617                         (pSceneManager->GetCurrentScene()->GetPanel());
618                         IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
619                         pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
620                         if(__isCopyOperation)
621                         {
622                                 pList->InsertAt(new (std::nothrow) Integer(FILE_COPY_ACTION), ALBUM_SECOND_ELEMENT);
623                         }
624                         else
625                         {
626                                 pList->InsertAt(new (std::nothrow) Integer(FILE_MOVE_ACTION), ALBUM_SECOND_ELEMENT);
627                         }
628                         pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
629                 }
630                 break;
631         }
632         case ACTION_ID_DELETE_POPUP_DEL:
633         {
634                 __overlayMsg = false;
635                 __pDeletePopup->SetShowState(false);
636                 __pDeletePopup->Invalidate(true);
637
638                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
639                 {
640                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
641                         if (pEditorPanel != null)
642                         {
643                                 result r = pEditorPanel->OnRequestDelete();
644                                 if (IsFailed(r))
645                                 {
646                                         AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
647                                 }
648                         }
649                 }
650                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
651                 {
652                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
653                         if (pEditorPanel != null)
654                         {
655                                 pEditorPanel->OnRequestDelete();
656                         }
657                 }
658                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
659                 {
660                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>
661                         (pSceneManager->GetCurrentScene()->GetPanel());
662
663                         if (pEditorPanel != null)
664                         {
665                                 pEditorPanel->OnRequestDelete();
666                         }
667                 }
668                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
669                 {
670                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
671                         (pSceneManager->GetCurrentScene()->GetPanel());
672
673                         if (pSelectionPanel != null)
674                         {
675                                 result r = pSelectionPanel->OnRequestDelete();
676                                 if (IsFailed(r))
677                                 {
678                                         AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
679                                 }
680                         }
681                 }
682                 break;
683         }
684         case ACTION_ID_DELETE_POPUP_CANCEL:
685         {
686                 __overlayMsg = false;
687                 __pDeletePopup->SetShowState(false);
688                 __pDeletePopup->Invalidate(true);
689                 break;
690         }
691         case ACTION_ID_FOOTER_CONFIRM:
692         {
693                 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
694                 {
695                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
696                         if (pEditorPanel != null)
697                         {
698                                 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
699                         }
700                 }
701                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
702                 {
703                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
704                         if (pEditorPanel != null)
705                         {
706                                 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
707                         }
708                 }
709                 break;
710         }
711         default:
712         {
713                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
714                 {
715                         if ((ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
716                                         (actionId <= ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
717                         {
718                                 if (__pContentDirectoryList == null)
719                                 {
720
721                                         return;
722                                 }
723                                 if (__pContentDirectoryList->GetCount() > actionId - ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
724                                 {
725                                         String* pDirectory = static_cast<String*>
726                                         (__pContentDirectoryList->GetAt(actionId - ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
727
728                                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>
729                                         (pSceneManager->GetCurrentScene()->GetPanel());
730
731                                         if (pEditorPanel != null)
732                                         {
733                                                 delete __pFileMove;
734                                                 IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
735                                                 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
736                                                 __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
737                                                 if(__isCopyOperation)
738                                                 {
739                                                         AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
740                                                         __pFileMove->SetCopy();
741                                                 }
742
743                                                 result r = __pFileMove->StartTimer();
744                                                 if (IsFailed(r))
745                                                 {
746                                                         delete __pFileMove;
747                                                         __pFileMove = null;
748                                                         __isCopyOperation = false;
749                                                 }
750                                                 else
751                                                 {
752                                                         __overlayMsg = true;
753                                                 }
754                                         }
755                                 }
756                         }
757                 }
758                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
759                 {
760                         if ((ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START <= actionId) &&
761                                         (actionId <= ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM + 1000))
762                         {
763                                 if (__pContentDirectoryList == null)
764                                 {
765
766                                         return;
767                                 }
768                                 if (__pContentDirectoryList->GetCount() > actionId - ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START)
769                                 {
770                                         String* pDirectory = static_cast<String*>
771                                         (__pContentDirectoryList->GetAt(actionId - ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START));
772
773                                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
774                                                 (pSceneManager->GetCurrentScene()->GetPanel());
775
776                                         if (pSelectionPanel != null)
777                                         {
778                                                 delete __pFileMove;
779                                                 IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
780                                                 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
781                                                 __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
782                                                 if(__isCopyOperation)
783                                                 {
784                                                         AppLogDebug("Rash: Setting to Copy in FileListEditorForm");
785                                                         __pFileMove->SetCopy();
786                                                 }
787                                                 result r = __pFileMove->StartTimer();
788                                                 if (IsFailed(r))
789                                                 {
790                                                         delete __pFileMove;
791                                                         __pFileMove = null;
792                                                         __isCopyOperation = false;
793                                                 }
794                                                 else
795                                                 {
796                                                         __overlayMsg = true;
797                                                 }
798                                         }
799                                 }
800                         }
801                 }
802                 break;
803         }
804         }
805         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
806 }
807
808 void FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
809 {
810         Invalidate(true);
811 }
812
813 bool FileListEditorForm::GetOverlayStatus()
814 {
815         return __overlayMsg;
816 }
817
818 void FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
819 {
820         __overlayMsg = false;
821         __pPresentationModel->SetUpdateProgressStatus(false);
822         if (res != COMPLETE_SUCCESS)
823         {
824                 MessageBox messageBox;
825                 messageBox.Construct(L"", L"System error",
826                                 MSGBOX_STYLE_OK, 3000);
827                 int modalResult = 0;
828                 __overlayMsg = true;
829                 messageBox.ShowAndWait(modalResult);
830                 __overlayMsg = false;
831                 SceneManager* pSceneManager = SceneManager::GetInstance();
832                 AppAssert(pSceneManager);
833                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
834         }
835 }
836
837 void
838 FileListEditorForm::OnContentUpdated()
839 {
840         AppLogDebug("ENTER");
841
842         if (__overlayMsg == false)
843         {
844                 SceneManager* pSceneManager = SceneManager::GetInstance();
845                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
846         }
847         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
848 }
849
850 result
851 FileListEditorForm::SetUpPopup(void)
852 {
853         AppLogDebug("ENTER");
854         result r = E_SUCCESS;
855
856         if (__pDeletePopup != null)
857         {
858                 delete __pDeletePopup;
859                 __pDeletePopup = null;
860         }
861
862         __pDeletePopup = new (std::nothrow) Popup();
863         __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
864
865         Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
866
867         Label* pLabelText = new (std::nothrow) Label();
868         pLabelText->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
869                         ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
870         pLabelText->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
871         __pDeletePopup->AddControl(*pLabelText);
872
873         Button* pDeleteButton = new (std::nothrow) Button();
874         pDeleteButton->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
875                         ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
876         pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
877         pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
878         pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
879         pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL);
880         pDeleteButton->AddActionEventListener(*this);
881         __pDeletePopup->AddControl(*pDeleteButton);
882
883         Button* pButtonCancel = new (std::nothrow) Button();
884         pButtonCancel->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
885                         popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
886         pButtonCancel->SetActionId(ACTION_ID_DELETE_POPUP_CANCEL);
887         pButtonCancel->AddActionEventListener(*this);
888         __pDeletePopup->AddControl(*pButtonCancel);
889         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
890
891         return r;
892 }
893
894 void
895 FileListEditorForm::SetTitleText(const String& titleText)
896 {
897         AppLogDebug("ENTER");
898         Header* pHeader = GetHeader();
899         TryReturnVoid(pHeader != null, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
900         pHeader->SetTitleText(titleText);
901         pHeader->Invalidate(true);
902         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
903 }
904
905 void
906 FileListEditorForm::RefreshFolderList(void)
907 {
908         AppLogDebug("ENTER");
909         ContentDirectory contentDirectory;
910         IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
911         pContentTypeList->Add(CONTENT_TYPE_IMAGE);
912         pContentTypeList->Add(CONTENT_TYPE_VIDEO);
913         contentDirectory.Construct(*pContentTypeList);
914         delete pContentTypeList;
915
916         if (__pContentDirectoryList != null)
917         {
918                 delete __pContentDirectoryList;
919         }
920         __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
921         __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
922         String* pDirPath = null;
923         String* pDirName = null;
924
925         int loopCount = __pContentDirectoryList->GetCount();
926         for (int i = 0; i < loopCount; ++i)
927         {
928                 pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
929                 pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
930                 __pContentDirectoryNameList->Add(pDirName);
931         }
932         __pContextEditorMenuMove->RemoveAllItems();
933         __pContextEditorMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
934                         ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
935         __pContextSelectionMenuMove->RemoveAllItems();
936         __pContextSelectionMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
937                         ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM);
938
939         loopCount = __pContentDirectoryNameList->GetCount();
940         for (int i = 0; i < loopCount; ++i)
941         {
942                 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
943                 __pContextEditorMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
944                                 ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
945                 __pContextSelectionMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
946                                 ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START + i);
947         }
948         __pContextEditorMenuMove->SetShowState(false);
949         __pContextSelectionMenuMove->SetShowState(false);
950         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
951 }
952
953 void
954 FileListEditorForm::OnFormBackRequested(Form& source)
955 {
956         AppLogDebug("ENTER");
957
958         SceneManager* pSceneManager = SceneManager::GetInstance();
959         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
960
961         if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
962         {
963                 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
964                 {
965                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
966                 }
967                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
968                 {
969                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
970                 }
971         }
972         else
973         {
974                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
975                 {
976                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
977                 }
978                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
979                 {
980                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_IMAGE_LIST));
981                 }
982                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
983                 {
984                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_VIDEO_LIST));
985                 }
986                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
987                 {
988                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
989                                 (pSceneManager->GetCurrentScene()->GetPanel());
990                         if (pSelectionPanel != null)
991                         {
992                                 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
993                                 if (pList == null)
994                                 {
995                                         pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
996                                 }
997
998                                 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST_EDITOR), pList);
999                         }
1000                 }
1001                 else
1002                 {
1003                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
1004                 }
1005         }
1006         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1007 }
1008
1009 void
1010 FileListEditorForm::SetFooterButtonsState(bool enableState)
1011 {
1012         AppLogDebug("ENTER");
1013         Footer* pFooter = GetFooter();
1014         TryReturnVoid(pFooter != null, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
1015
1016         if (enableState == true)
1017         {
1018                 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
1019                 pFooter->SetItemEnabled(0, true);
1020                 pFooter->SetItemEnabled(1, true);
1021         }
1022         else
1023         {
1024                 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
1025                 pFooter->SetItemEnabled(0, false);
1026                 pFooter->SetItemEnabled(1, false);
1027         }
1028
1029         pFooter->RequestRedraw(true);
1030         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1031 }
1032
1033 result
1034 FileListEditorForm::MoveToAlbum(String& destDirectory)
1035 {
1036         AppLogDebug("ENTER");
1037         result r = E_FAILURE;
1038         String albumName = __pPresentationModel->ConvertToAlbumName(destDirectory);
1039         if (albumName != EMPTY_SPACE)
1040         {
1041                 IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1042                 pDirectoryList->Add(new (std::nothrow) String(destDirectory));
1043                 __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList);
1044                 __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL);
1045                 delete pDirectoryList;
1046
1047                 SceneManager* pSceneManager = SceneManager::GetInstance();
1048                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
1049                 r = E_SUCCESS;
1050         }
1051         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1052
1053         return r;
1054 }
1055
1056 void
1057 FileListEditorForm::SelectAllPressed(void)
1058 {
1059         SceneManager* pSceneManager = SceneManager::GetInstance();
1060         pSceneManager->GetCurrentScene();
1061
1062         if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1063         {
1064                 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1065                 if (pEditorPanel != null)
1066                 {
1067                         pEditorPanel->SelectAllPressed();
1068                 }
1069         }
1070         else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1071         {
1072                 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1073                 if (pEditorPanel != null)
1074                 {
1075                         pEditorPanel->SelectAllPressed();
1076                 }
1077         }
1078         else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1079         {
1080                 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1081                 if (pEditorPanel != null)
1082                 {
1083                         pEditorPanel->SelectAllPressed();
1084                 }
1085         }
1086         else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1087         {
1088                 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1089                 if (pEditorPanel != null)
1090                 {
1091                         pEditorPanel->SelectAllPressed();
1092                 }
1093         }
1094 }
1095
1096 void
1097 FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
1098 {
1099         if (__pPopUp != NULL)
1100         {
1101                 __pPopUp->SetShowState(false);
1102         }
1103
1104         SceneManager* pSceneManager = SceneManager::GetInstance();
1105
1106         if (index == 0)   // start slide show
1107         {
1108                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1109                 {
1110                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1111                         if (pEditorPanel != null)
1112                         {
1113                                 pEditorPanel->OnRequestSlideShow();
1114                         }
1115                 }
1116                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1117                 {
1118                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1119                                         (pSceneManager->GetCurrentScene()->GetPanel());
1120
1121                         if (pSelectionPanel != null)
1122                         {
1123                                 pSelectionPanel->OnRequestSlideShow();
1124                         }
1125                 }
1126         }
1127         else if (index == 1) // go to settingsForm
1128         {
1129                 SceneManager* pSceneManager = SceneManager::GetInstance();
1130                 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
1131
1132                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
1133         }
1134 }