solving refresh on update content error
[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 {
68         AppLogDebug("ENTER");
69         __overlayMsg = false;
70         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
71 }
72
73 FileListEditorForm::~FileListEditorForm(void)
74 {
75         AppLogDebug("ENTER");
76         if (__pContentDirectoryList != null)
77         {
78                 delete __pContentDirectoryList;
79         }
80         if (__pContentDirectoryNameList != null)
81         {
82                 delete __pContentDirectoryNameList;
83         }
84         delete __pFileMove;
85         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
86 }
87
88 result
89 FileListEditorForm::Initialize(void)
90 {
91         AppLogDebug("ENTER");
92         result r = Construct(FORM_STYLE_NORMAL | FORM_STYLE_INDICATOR | FORM_STYLE_HEADER | FORM_STYLE_FOOTER);
93         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
94
95         return r;
96 }
97
98 result
99 FileListEditorForm::OnInitializing(void)
100 {
101         AppLogDebug("ENTER");
102         Header* pHeader = GetHeader();
103         TryReturn(pHeader != null, E_FAILURE, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
104
105         __pPopUp = new (std::nothrow) SlideShowPopUp();
106
107         if (__pPopUp != null)
108         {
109                 __pPopUp->Initialize();
110                 __pPopUp->SetEventListner(this);
111                 AddControl(*__pPopUp);
112         }
113
114         __pPresentationModel = FileListPresentationModel::GetInstance();
115         __pPresentationModel->ClearThumbnailRequests();
116         __pPresentationModel->AddContentEventListener(this);
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
261                 if (checkedCount > 1)
262                 {
263                         __pContextMenuMore->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_BUTTON_SLIDE_SHOW"),
264                                         ACTION_ID_CONTEXT_MENU_MORE_SLIDE_SHOW);
265                 }
266
267                 __pContextMenuMore->SetShowState(false);
268                 __pContextMenuMore->AddActionEventListener(*this);
269
270                 __pContextMenuShare = new (std::nothrow) ContextMenu();
271                 __pContextMenuShare->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
272                 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_MESSAGE"),
273                                 ACTION_ID_CONTEXT_MENU_SHARE_MESSAGE);
274                 __pContextMenuShare->AddItem(ResourceManager::GetString(L"IDS_COM_BODY_EMAIL"),
275                                 ACTION_ID_CONTEXT_MENU_SHARE_EMAIL);
276                 __pContextMenuShare->SetShowState(false);
277                 __pContextMenuShare->AddActionEventListener(*this);
278
279                 __pContextEditorMenuMove = new (std::nothrow) ContextMenu();
280                 __pContextEditorMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
281                 __pContextEditorMenuMove->AddActionEventListener(*this);
282
283                 __pContextSelectionMenuMove = new (std::nothrow) ContextMenu();
284                 __pContextSelectionMenuMove->Construct(Point(0, 0), CONTEXT_MENU_STYLE_LIST);
285                 __pContextSelectionMenuMove->AddActionEventListener(*this);
286
287                 if (__pContentDirectoryNameList != null)
288                 {
289                         delete __pContentDirectoryNameList;
290                         __pContentDirectoryNameList = null;
291                 }
292
293                 SetUpPopup();
294         }
295
296         pFooter->AddActionEventListener(*this);
297         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
298
299         return r;
300 }
301
302 String
303 FileListEditorForm::GetDirecotyNameFromFullPath(const String& fullPath)const
304 {
305         AppLogDebug("ENTER");
306         if (fullPath == null)
307         {
308                 AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult()));
309
310                 return null;
311         }
312         String delim(DIRECTORY_SEPARATOR);
313         StringTokenizer st(fullPath,delim);
314         String token;
315         while (st.HasMoreTokens())
316         {
317                 st.GetNextToken(token);
318         }
319         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
320
321         return token;
322 }
323
324 result
325 FileListEditorForm::OnTerminating(void)
326 {
327         AppLogDebug("ENTER");
328
329         __pPresentationModel->RemoveContentEventListener(this);
330         if (__pContextMenuMore != null)
331         {
332                 __pContextMenuMore->RemoveActionEventListener(*this);
333                 delete __pContextMenuMore;
334                 __pContextMenuMore = null;
335         }
336
337         if (__pContextMenuShare != null)
338         {
339                 __pContextMenuShare->RemoveActionEventListener(*this);
340                 delete __pContextMenuShare;
341                 __pContextMenuShare = null;
342         }
343
344         if (__pContextEditorMenuMove != null)
345         {
346                 __pContextEditorMenuMove->RemoveActionEventListener(*this);
347                 delete __pContextEditorMenuMove;
348                 __pContextEditorMenuMove = null;
349         }
350
351         if (__pContextSelectionMenuMove != null)
352         {
353                 __pContextSelectionMenuMove->RemoveActionEventListener(*this);
354                 delete __pContextSelectionMenuMove;
355                 __pContextSelectionMenuMove = null;
356         }
357
358         if (__pDeletePopup != null)
359         {
360                 delete __pDeletePopup;
361                 __pDeletePopup = null;
362         }
363         __overlayMsg = false;
364         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
365
366         return E_SUCCESS;
367 }
368
369 void
370 FileListEditorForm::OnActionPerformed(const Control& source, int actionId)
371 {
372         AppLogDebug("ENTER(actionId=%d)", actionId);
373         SceneManager* pSceneManager = SceneManager::GetInstance();
374         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
375
376         switch (actionId)
377         {
378         case ACTION_ID_FILE_LIST_SELECT_ALL:
379                 SelectAllPressed();
380                 break;
381         case ACTION_ID_FOOTER_MORE:
382         {
383                 InitializeFooter();
384
385                 if (__pContextMenuMore->GetShowState() == false)
386                 {
387                         Rectangle rect = source.GetBounds();
388                         __morePosition = Point(rect.width/8,rect.y);
389                         __pContextMenuMore->SetAnchorPosition(Point(rect.width/8,rect.y));
390                         __pContextMenuMore->SetShowState(true);
391                         __pContextMenuMore->Show();
392                 }
393                 else
394                 {
395                         __pContextMenuMore->SetShowState(false);
396                 }
397                 break;
398         }
399         case ACTION_ID_FOOTER_SHARE:
400         {
401                 if (__pContextMenuShare->GetShowState() == false)
402                 {
403                         Rectangle rect = source.GetBounds();
404                         __pContextMenuShare->SetAnchorPosition(Point(rect.width/8*3 ,rect.y));
405                         __pContextMenuShare->SetShowState(true);
406                         __pContextMenuShare->Show();
407                 }
408                 else
409                 {
410                         __pContextMenuShare->SetShowState(false);
411                 }
412                 break;
413         }
414         case ACTION_ID_FOOTER_DELETE:
415         {
416                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
417                 {
418                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
419                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
420                         {
421                                 __pDeletePopup->SetShowState(true);
422                                 __pDeletePopup->Show();
423                                 __overlayMsg = true;
424                         }
425                 }
426                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
427                 {
428                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
429                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
430                         {
431                                 __pDeletePopup->SetShowState(true);
432                                 __pDeletePopup->Show();
433                                 __overlayMsg = true;
434                         }
435                 }
436                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
437                 {
438                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
439                         if (pEditorPanel != null && pEditorPanel->GetItemCheckedCount() > 0)
440                         {
441                                 __pDeletePopup->SetShowState(true);
442                                 __pDeletePopup->Show();
443                                 __overlayMsg = true;
444                         }
445                 }
446                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
447                 {
448                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
449                         (pSceneManager->GetCurrentScene()->GetPanel());
450                         if (pSelectionPanel != null && pSelectionPanel->GetItemCheckedCount() > 0)
451                         {
452                                 __pDeletePopup->SetShowState(true);
453                                 __pDeletePopup->Show();
454                                 __overlayMsg = true;
455                         }
456                 }
457                 break;
458         }
459         case ACTION_ID_CONTEXT_MENU_MORE_EDIT:
460         {
461                 break;
462         }
463         case ACTION_ID_CONTEXT_MENU_MORE_ADD_TAG:
464         {
465                 break;
466         }
467         case ACTION_ID_CONTEXT_MENU_MORE_MOVE:
468         {
469                 RefreshFolderList();
470                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
471                 {
472                         if (__pContextEditorMenuMove->GetShowState() == false)
473                         {
474                                 __pContextEditorMenuMove->SetAnchorPosition(__morePosition);
475                                 __pContextEditorMenuMove->SetShowState(true);
476                                 __pContextEditorMenuMove->Show();
477                         }
478                         else
479                         {
480                                 __pContextEditorMenuMove->SetShowState(false);
481                         }
482                 }
483                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
484                 {
485                         if (__pContextSelectionMenuMove->GetShowState() == false)
486                         {
487                                 __pContextSelectionMenuMove->SetAnchorPosition(__morePosition);
488                                 __pContextSelectionMenuMove->SetShowState(true);
489                                 __pContextSelectionMenuMove->Show();
490                         }
491                         else
492                         {
493                                 __pContextSelectionMenuMove->SetShowState(false);
494                         }
495                 }
496
497                 break;
498         }
499         case ACTION_ID_CONTEXT_MENU_MORE_SLIDE_SHOW:
500         {
501                 if (__pPopUp != null)
502                 {
503                         __pPopUp->SetShowState(true);
504                         __pPopUp->Show();
505                 }
506
507                 break;
508         }
509         case ACTION_ID_CONTEXT_MENU_SHARE_MESSAGE:
510         {
511                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
512                 {
513                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
514                         if (pEditorPanel != null)
515                         {
516                                 pEditorPanel->OnRequestMessage();
517                         }
518                 }
519                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
520                 {
521                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
522                         if (pEditorPanel != null)
523                         {
524                                 pEditorPanel->OnRequestMessage();
525                         }
526                 }
527                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
528                 {
529                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
530                         if (pEditorPanel != null)
531                         {
532                                 pEditorPanel->OnRequestMessage();
533                         }
534
535                 }
536                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
537                 {
538                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
539                         if (pSelectionPanel != null)
540                         {
541                                 pSelectionPanel->OnRequestMessage();
542                         }
543                 }
544                 break;
545         }
546         case ACTION_ID_CONTEXT_MENU_SHARE_EMAIL:
547         {
548                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
549                 {
550                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
551                         if (pEditorPanel != null)
552                         {
553                                 pEditorPanel->OnRequestEmail();
554                         }
555                 }
556                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
557                 {
558                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
559                         if (pEditorPanel != null)
560                         {
561                                 pEditorPanel->OnRequestEmail();
562                         }
563                 }
564                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
565                 {
566                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
567                         if (pEditorPanel != null)
568                         {
569                                 pEditorPanel->OnRequestEmail();
570                         }
571
572                 }
573                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
574                 {
575                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
576                         if (pSelectionPanel != null)
577                         {
578                                 pSelectionPanel->OnRequestEmail();
579                         }
580                 }
581                 break;
582         }
583         case ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM:
584         {
585                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
586                 {
587                         AllListEditorPanel* pListEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
588                         IList* pList = pListEditorPanel->GetItemCheckedIndexListN();
589                         pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
590                         pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
591                 }
592                 break;
593         }
594         case ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM:
595         {
596                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
597                 {
598                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
599                         (pSceneManager->GetCurrentScene()->GetPanel());
600                         IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
601                         pList->InsertAt(new (std::nothrow) Integer(ALBUM_CREATE), ALBUM_FIRST_ELEMENT);
602                         pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALBUM_NAME_EDITOR), pList);
603                 }
604                 break;
605         }
606         case ACTION_ID_DELETE_POPUP_DEL:
607         {
608                 __overlayMsg = false;
609                 __pDeletePopup->SetShowState(false);
610                 __pDeletePopup->Invalidate(true);
611
612                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
613                 {
614                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
615                         if (pEditorPanel != null)
616                         {
617                                 result r = pEditorPanel->OnRequestDelete();
618                                 if (IsFailed(r))
619                                 {
620                                         AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
621                                 }
622                         }
623                 }
624                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
625                 {
626                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
627                         if (pEditorPanel != null)
628                         {
629                                 pEditorPanel->OnRequestDelete();
630                         }
631                 }
632                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
633                 {
634                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>
635                         (pSceneManager->GetCurrentScene()->GetPanel());
636
637                         if (pEditorPanel != null)
638                         {
639                                 pEditorPanel->OnRequestDelete();
640                         }
641                 }
642                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
643                 {
644                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
645                         (pSceneManager->GetCurrentScene()->GetPanel());
646
647                         if (pSelectionPanel != null)
648                         {
649                                 result r = pSelectionPanel->OnRequestDelete();
650                                 if (IsFailed(r))
651                                 {
652                                         AppLogDebug("OnRequestDelete failed with %s", GetErrorMessage(r));
653                                 }
654                         }
655                 }
656                 break;
657         }
658         case ACTION_ID_DELETE_POPUP_CANCEL:
659         {
660                 __overlayMsg = false;
661                 __pDeletePopup->SetShowState(false);
662                 __pDeletePopup->Invalidate(true);
663                 break;
664         }
665         case ACTION_ID_FOOTER_CONFIRM:
666         {
667                 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
668                 {
669                         ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
670                         if (pEditorPanel != null)
671                         {
672                                 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
673                         }
674                 }
675                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
676                 {
677                         VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
678                         if (pEditorPanel != null)
679                         {
680                                 pEditorPanel->OnRequestAppExitWithMultipleSelectionAppControlResult();
681                         }
682                 }
683                 break;
684         }
685         default:
686         {
687                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
688                 {
689                         if ((ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START <= actionId) &&
690                                         (actionId <= ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM + 1000))
691                         {
692                                 if (__pContentDirectoryList == null)
693                                 {
694
695                                         return;
696                                 }
697                                 if (__pContentDirectoryList->GetCount() > actionId - ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START)
698                                 {
699                                         String* pDirectory = static_cast<String*>
700                                         (__pContentDirectoryList->GetAt(actionId - ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START));
701
702                                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>
703                                         (pSceneManager->GetCurrentScene()->GetPanel());
704
705                                         if (pEditorPanel != null)
706                                         {
707                                                 delete __pFileMove;
708                                                 IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN();
709                                                 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
710                                                 __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
711                                                 __pPresentationModel->SetUpdateProgressStatus(true);
712                                                 result r = __pFileMove->StartTimer();
713                                                 if (IsFailed(r))
714                                                 {
715                                                         delete __pFileMove;
716                                                         __pFileMove = null;
717                                                 }
718                                                 else
719                                                 {
720                                                         __overlayMsg = true;
721                                                 }
722                                         }
723                                 }
724                         }
725                 }
726                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
727                 {
728                         if ((ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START <= actionId) &&
729                                         (actionId <= ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM + 1000))
730                         {
731                                 if (__pContentDirectoryList == null)
732                                 {
733
734                                         return;
735                                 }
736                                 if (__pContentDirectoryList->GetCount() > actionId - ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START)
737                                 {
738                                         String* pDirectory = static_cast<String*>
739                                         (__pContentDirectoryList->GetAt(actionId - ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START));
740
741                                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
742                                                 (pSceneManager->GetCurrentScene()->GetPanel());
743
744                                         if (pSelectionPanel != null)
745                                         {
746                                                 delete __pFileMove;
747                                                 IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
748                                                 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
749                                                 __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
750                                                 __pPresentationModel->SetUpdateProgressStatus(true);
751                                                 result r = __pFileMove->StartTimer();
752                                                 if (IsFailed(r))
753                                                 {
754                                                         delete __pFileMove;
755                                                         __pFileMove = null;
756                                                 }
757                                                 else
758                                                 {
759                                                         __overlayMsg = true;
760                                                 }
761                                         }
762                                 }
763                         }
764                 }
765                 break;
766         }
767         }
768         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
769 }
770
771 void FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
772 {
773         Invalidate(true);
774 }
775
776 bool FileListEditorForm::GetOverlayStatus()
777 {
778         return __overlayMsg;
779 }
780
781 void FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
782 {
783         __overlayMsg = false;
784         __pPresentationModel->SetUpdateProgressStatus(false);
785         if (res != COMPLETE_SUCCESS)
786         {
787                 MessageBox messageBox;
788                 messageBox.Construct(L"", L"System error",
789                                 MSGBOX_STYLE_OK, 3000);
790                 int modalResult = 0;
791                 __overlayMsg = true;
792                 messageBox.ShowAndWait(modalResult);
793                 __overlayMsg = false;
794                 SceneManager* pSceneManager = SceneManager::GetInstance();
795                 AppAssert(pSceneManager);
796                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
797         }
798 }
799
800 void
801 FileListEditorForm::OnContentUpdated()
802 {
803         AppLogDebug("ENTER");
804
805         if (__overlayMsg == false)
806         {
807                 SceneManager* pSceneManager = SceneManager::GetInstance();
808                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
809         }
810         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
811 }
812
813 result
814 FileListEditorForm::SetUpPopup(void)
815 {
816         AppLogDebug("ENTER");
817         result r = E_SUCCESS;
818
819         if (__pDeletePopup != null)
820         {
821                 delete __pDeletePopup;
822                 __pDeletePopup = null;
823         }
824
825         __pDeletePopup = new (std::nothrow) Popup();
826         __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
827
828         Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
829
830         Label* pLabelText = new (std::nothrow) Label();
831         pLabelText->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
832                         ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
833         pLabelText->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
834         __pDeletePopup->AddControl(*pLabelText);
835
836         Button* pDeleteButton = new (std::nothrow) Button();
837         pDeleteButton->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
838                         ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
839         pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
840         pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
841         pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
842         pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL);
843         pDeleteButton->AddActionEventListener(*this);
844         __pDeletePopup->AddControl(*pDeleteButton);
845
846         Button* pButtonCancel = new (std::nothrow) Button();
847         pButtonCancel->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
848                         popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
849         pButtonCancel->SetActionId(ACTION_ID_DELETE_POPUP_CANCEL);
850         pButtonCancel->AddActionEventListener(*this);
851         __pDeletePopup->AddControl(*pButtonCancel);
852         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
853
854         return r;
855 }
856
857 void
858 FileListEditorForm::SetTitleText(const String& titleText)
859 {
860         AppLogDebug("ENTER");
861         Header* pHeader = GetHeader();
862         TryReturnVoid(pHeader != null, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
863         pHeader->SetTitleText(titleText);
864         pHeader->Invalidate(true);
865         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
866 }
867
868 void
869 FileListEditorForm::RefreshFolderList(void)
870 {
871         AppLogDebug("ENTER");
872         ContentDirectory contentDirectory;
873         IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
874         pContentTypeList->Add(CONTENT_TYPE_IMAGE);
875         pContentTypeList->Add(CONTENT_TYPE_VIDEO);
876         contentDirectory.Construct(*pContentTypeList);
877         delete pContentTypeList;
878
879         if (__pContentDirectoryList != null)
880         {
881                 delete __pContentDirectoryList;
882         }
883         __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
884         __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
885         String* pDirPath = null;
886         String* pDirName = null;
887
888         int loopCount = __pContentDirectoryList->GetCount();
889         for (int i = 0; i < loopCount; ++i)
890         {
891                 pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
892                 pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
893                 __pContentDirectoryNameList->Add(pDirName);
894         }
895         __pContextEditorMenuMove->RemoveAllItems();
896         __pContextEditorMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
897                         ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
898         __pContextSelectionMenuMove->RemoveAllItems();
899         __pContextSelectionMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
900                         ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM);
901
902         loopCount = __pContentDirectoryNameList->GetCount();
903         for (int i = 0; i < loopCount; ++i)
904         {
905                 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
906                 __pContextEditorMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
907                                 ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
908                 __pContextSelectionMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
909                                 ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START + i);
910         }
911         __pContextEditorMenuMove->SetShowState(false);
912         __pContextSelectionMenuMove->SetShowState(false);
913         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
914 }
915
916 void
917 FileListEditorForm::OnFormBackRequested(Form& source)
918 {
919         AppLogDebug("ENTER");
920
921         SceneManager* pSceneManager = SceneManager::GetInstance();
922         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
923
924         if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
925         {
926                 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
927                 {
928                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
929                 }
930                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
931                 {
932                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
933                 }
934         }
935         else
936         {
937                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
938                 {
939                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
940                 }
941                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
942                 {
943                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_IMAGE_LIST));
944                 }
945                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
946                 {
947                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_VIDEO_LIST));
948                 }
949                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
950                 {
951                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
952                                 (pSceneManager->GetCurrentScene()->GetPanel());
953                         if (pSelectionPanel != null)
954                         {
955                                 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
956                                 if (pList == null)
957                                 {
958                                         pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
959                                 }
960
961                                 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST_EDITOR), pList);
962                         }
963                 }
964                 else
965                 {
966                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
967                 }
968         }
969         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
970 }
971
972 void
973 FileListEditorForm::SetFooterButtonsState(bool enableState)
974 {
975         AppLogDebug("ENTER");
976         Footer* pFooter = GetFooter();
977         TryReturnVoid(pFooter != null, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
978
979         if (enableState == true)
980         {
981                 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
982                 pFooter->SetItemEnabled(0, true);
983                 pFooter->SetItemEnabled(1, true);
984         }
985         else
986         {
987                 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
988                 pFooter->SetItemEnabled(0, false);
989                 pFooter->SetItemEnabled(1, false);
990         }
991
992         pFooter->RequestRedraw(true);
993         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
994 }
995
996 result
997 FileListEditorForm::MoveToAlbum(String& destDirectory)
998 {
999         AppLogDebug("ENTER");
1000         result r = E_FAILURE;
1001         String albumName = __pPresentationModel->ConvertToAlbumName(destDirectory);
1002         if (albumName != EMPTY_SPACE)
1003         {
1004                 IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1005                 pDirectoryList->Add(new (std::nothrow) String(destDirectory));
1006                 __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList);
1007                 __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL);
1008                 delete pDirectoryList;
1009
1010                 SceneManager* pSceneManager = SceneManager::GetInstance();
1011                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
1012                 r = E_SUCCESS;
1013         }
1014         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1015
1016         return r;
1017 }
1018
1019 void
1020 FileListEditorForm::SelectAllPressed(void)
1021 {
1022         SceneManager* pSceneManager = SceneManager::GetInstance();
1023         pSceneManager->GetCurrentScene();
1024
1025         if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1026         {
1027                 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1028                 if (pEditorPanel != null)
1029                 {
1030                         pEditorPanel->SelectAllPressed();
1031                 }
1032         }
1033         else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1034         {
1035                 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1036                 if (pEditorPanel != null)
1037                 {
1038                         pEditorPanel->SelectAllPressed();
1039                 }
1040         }
1041         else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1042         {
1043                 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1044                 if (pEditorPanel != null)
1045                 {
1046                         pEditorPanel->SelectAllPressed();
1047                 }
1048         }
1049         else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1050         {
1051                 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1052                 if (pEditorPanel != null)
1053                 {
1054                         pEditorPanel->SelectAllPressed();
1055                 }
1056         }
1057 }
1058
1059 void
1060 FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
1061 {
1062         if (__pPopUp != NULL)
1063         {
1064                 __pPopUp->SetShowState(false);
1065         }
1066
1067         SceneManager* pSceneManager = SceneManager::GetInstance();
1068
1069         if (index == 0)   // start slide show
1070         {
1071                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1072                 {
1073                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1074                         if (pEditorPanel != null)
1075                         {
1076                                 pEditorPanel->OnRequestSlideShow();
1077                         }
1078                 }
1079                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1080                 {
1081                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1082                                         (pSceneManager->GetCurrentScene()->GetPanel());
1083
1084                         if (pSelectionPanel != null)
1085                         {
1086                                 pSelectionPanel->OnRequestSlideShow();
1087                         }
1088                 }
1089         }
1090         else if (index == 1) // go to settingsForm
1091         {
1092                 SceneManager* pSceneManager = SceneManager::GetInstance();
1093                 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
1094
1095                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
1096         }
1097 }