0a2071915969fabee832e5b0d0a295e92c1b2e2b
[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                                                 result r = __pFileMove->StartTimer();
712                                                 if (IsFailed(r))
713                                                 {
714                                                         delete __pFileMove;
715                                                         __pFileMove = null;
716                                                 }
717                                                 else
718                                                 {
719                                                         __overlayMsg = true;
720                                                 }
721                                         }
722                                 }
723                         }
724                 }
725                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
726                 {
727                         if ((ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START <= actionId) &&
728                                         (actionId <= ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM + 1000))
729                         {
730                                 if (__pContentDirectoryList == null)
731                                 {
732
733                                         return;
734                                 }
735                                 if (__pContentDirectoryList->GetCount() > actionId - ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START)
736                                 {
737                                         String* pDirectory = static_cast<String*>
738                                         (__pContentDirectoryList->GetAt(actionId - ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START));
739
740                                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
741                                                 (pSceneManager->GetCurrentScene()->GetPanel());
742
743                                         if (pSelectionPanel != null)
744                                         {
745                                                 delete __pFileMove;
746                                                 IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN();
747                                                 GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel);
748                                                 __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this);
749                                                 result r = __pFileMove->StartTimer();
750                                                 if (IsFailed(r))
751                                                 {
752                                                         delete __pFileMove;
753                                                         __pFileMove = null;
754                                                 }
755                                                 else
756                                                 {
757                                                         __overlayMsg = true;
758                                                 }
759                                         }
760                                 }
761                         }
762                 }
763                 break;
764         }
765         }
766         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
767 }
768
769 void FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId)
770 {
771         Invalidate(true);
772 }
773
774 bool FileListEditorForm::GetOverlayStatus()
775 {
776         return __overlayMsg;
777 }
778
779 void FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res)
780 {
781         __overlayMsg = false;
782         if (res != COMPLETE_SUCCESS)
783         {
784                 MessageBox messageBox;
785                 messageBox.Construct(L"", L"System error",
786                                 MSGBOX_STYLE_OK, 3000);
787                 int modalResult = 0;
788                 __overlayMsg = true;
789                 messageBox.ShowAndWait(modalResult);
790                 __overlayMsg = false;
791                 SceneManager* pSceneManager = SceneManager::GetInstance();
792                 AppAssert(pSceneManager);
793                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
794         }
795 }
796
797 void
798 FileListEditorForm::OnContentUpdated()
799 {
800         AppLogDebug("ENTER");
801         if (__overlayMsg == false)
802         {
803                 SceneManager* pSceneManager = SceneManager::GetInstance();
804                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
805         }
806         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
807 }
808
809 result
810 FileListEditorForm::SetUpPopup(void)
811 {
812         AppLogDebug("ENTER");
813         result r = E_SUCCESS;
814
815         if (__pDeletePopup != null)
816         {
817                 delete __pDeletePopup;
818                 __pDeletePopup = null;
819         }
820
821         __pDeletePopup = new (std::nothrow) Popup();
822         __pDeletePopup->Construct(false, Dimension(W_DELETE_POPUP, H_DELETE_POPUP));
823
824         Rectangle popupClientBounds = __pDeletePopup->GetClientAreaBounds();
825
826         Label* pLabelText = new (std::nothrow) Label();
827         pLabelText->Construct(Rectangle(0, 0, popupClientBounds.width, H_DELETE_LABEL),
828                         ResourceManager::GetString(L"IDS_COM_POP_DELETE_Q"));
829         pLabelText->SetTextHorizontalAlignment(ALIGNMENT_CENTER);
830         __pDeletePopup->AddControl(*pLabelText);
831
832         Button* pDeleteButton = new (std::nothrow) Button();
833         pDeleteButton->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON),
834                         ResourceManager::GetString(L"IDS_COM_BODY_DELETE"));
835         pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL);
836         pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED);
837         pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT);
838         pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL);
839         pDeleteButton->AddActionEventListener(*this);
840         __pDeletePopup->AddControl(*pDeleteButton);
841
842         Button* pButtonCancel = new (std::nothrow) Button();
843         pButtonCancel->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON,
844                         popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_POP_CANCEL"));
845         pButtonCancel->SetActionId(ACTION_ID_DELETE_POPUP_CANCEL);
846         pButtonCancel->AddActionEventListener(*this);
847         __pDeletePopup->AddControl(*pButtonCancel);
848         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
849
850         return r;
851 }
852
853 void
854 FileListEditorForm::SetTitleText(const String& titleText)
855 {
856         AppLogDebug("ENTER");
857         Header* pHeader = GetHeader();
858         TryReturnVoid(pHeader != null, "[%s] fail to get the header.", GetErrorMessage(GetLastResult()));
859         pHeader->SetTitleText(titleText);
860         pHeader->Invalidate(true);
861         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
862 }
863
864 void
865 FileListEditorForm::RefreshFolderList(void)
866 {
867         AppLogDebug("ENTER");
868         ContentDirectory contentDirectory;
869         IListT<ContentType>* pContentTypeList = new (std::nothrow) ArrayListT<ContentType>();
870         pContentTypeList->Add(CONTENT_TYPE_IMAGE);
871         pContentTypeList->Add(CONTENT_TYPE_VIDEO);
872         contentDirectory.Construct(*pContentTypeList);
873         delete pContentTypeList;
874
875         if (__pContentDirectoryList != null)
876         {
877                 delete __pContentDirectoryList;
878         }
879         __pContentDirectoryList = contentDirectory.GetContentDirectoryPathListN(SORT_ORDER_NONE);
880         __pContentDirectoryNameList = new (std::nothrow) ArrayList(SingleObjectDeleter);
881         String* pDirPath = null;
882         String* pDirName = null;
883
884         int loopCount = __pContentDirectoryList->GetCount();
885         for (int i = 0; i < loopCount; ++i)
886         {
887                 pDirPath = static_cast<String*>(__pContentDirectoryList->GetAt(i));
888                 pDirName = new (std::nothrow) String(GetDirecotyNameFromFullPath(*pDirPath));
889                 __pContentDirectoryNameList->Add(pDirName);
890         }
891         __pContextEditorMenuMove->RemoveAllItems();
892         __pContextEditorMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
893                         ACTION_ID_CONTEXTMENU_EDITOR_MOVE_CREATE_ALBUM);
894         __pContextSelectionMenuMove->RemoveAllItems();
895         __pContextSelectionMenuMove->AddItem(ResourceManager::GetString(L"IDS_MEDIABR_OPT_CREATE_ALBUM"),
896                         ACTION_ID_CONTEXTMENU_SELECTION_MOVE_CREATE_ALBUM);
897
898         loopCount = __pContentDirectoryNameList->GetCount();
899         for (int i = 0; i < loopCount; ++i)
900         {
901                 pDirName = static_cast<String*>(__pContentDirectoryNameList->GetAt(i));
902                 __pContextEditorMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
903                                 ACTION_ID_CONTEXTMENU_EDITOR_MOVE_ALBUM_ARRAY_START + i);
904                 __pContextSelectionMenuMove->AddItem(*(new (std::nothrow) String(*pDirName)),
905                                 ACTION_ID_CONTEXTMENU_SELECTION_MOVE_ALBUM_ARRAY_START + i);
906         }
907         __pContextEditorMenuMove->SetShowState(false);
908         __pContextSelectionMenuMove->SetShowState(false);
909         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
910 }
911
912 void
913 FileListEditorForm::OnFormBackRequested(Form& source)
914 {
915         AppLogDebug("ENTER");
916
917         SceneManager* pSceneManager = SceneManager::GetInstance();
918         TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult()));
919
920         if (__pPresentationModel->GetAppControlMode() == APP_CONTROL_MODE_PICK)
921         {
922                 if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
923                 {
924                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
925                 }
926                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
927                 {
928                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALBUM_LIST));
929                 }
930         }
931         else
932         {
933                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
934                 {
935                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
936                 }
937                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
938                 {
939                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_IMAGE_LIST));
940                 }
941                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
942                 {
943                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_VIDEO_LIST));
944                 }
945                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
946                 {
947                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
948                                 (pSceneManager->GetCurrentScene()->GetPanel());
949                         if (pSelectionPanel != null)
950                         {
951                                 IList* pList = pSelectionPanel->GetItemCheckedIndexListN();
952                                 if (pList == null)
953                                 {
954                                         pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
955                                 }
956
957                                 pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST_EDITOR), pList);
958                         }
959                 }
960                 else
961                 {
962                         pSceneManager->GoBackward(BackwardSceneTransition(IDSCN_ALL_LIST));
963                 }
964         }
965         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
966 }
967
968 void
969 FileListEditorForm::SetFooterButtonsState(bool enableState)
970 {
971         AppLogDebug("ENTER");
972         Footer* pFooter = GetFooter();
973         TryReturnVoid(pFooter != null, "[%s] fail to get the footer.", GetErrorMessage(GetLastResult()));
974
975         if (enableState == true)
976         {
977                 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, true);
978                 pFooter->SetItemEnabled(0, true);
979                 pFooter->SetItemEnabled(1, true);
980         }
981         else
982         {
983                 pFooter->SetButtonEnabled(BUTTON_POSITION_LEFT, false);
984                 pFooter->SetItemEnabled(0, false);
985                 pFooter->SetItemEnabled(1, false);
986         }
987
988         pFooter->RequestRedraw(true);
989         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
990 }
991
992 result
993 FileListEditorForm::MoveToAlbum(String& destDirectory)
994 {
995         AppLogDebug("ENTER");
996         result r = E_FAILURE;
997         String albumName = __pPresentationModel->ConvertToAlbumName(destDirectory);
998         if (albumName != EMPTY_SPACE)
999         {
1000                 IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter);
1001                 pDirectoryList->Add(new (std::nothrow) String(destDirectory));
1002                 __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList);
1003                 __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL);
1004                 delete pDirectoryList;
1005
1006                 SceneManager* pSceneManager = SceneManager::GetInstance();
1007                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST));
1008                 r = E_SUCCESS;
1009         }
1010         AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
1011
1012         return r;
1013 }
1014
1015 void
1016 FileListEditorForm::SelectAllPressed(void)
1017 {
1018         SceneManager* pSceneManager = SceneManager::GetInstance();
1019         pSceneManager->GetCurrentScene();
1020
1021         if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1022         {
1023                 AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1024                 if (pEditorPanel != null)
1025                 {
1026                         pEditorPanel->SelectAllPressed();
1027                 }
1028         }
1029         else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR)
1030         {
1031                 ImageListEditorPanel* pEditorPanel = dynamic_cast<ImageListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1032                 if (pEditorPanel != null)
1033                 {
1034                         pEditorPanel->SelectAllPressed();
1035                 }
1036         }
1037         else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR)
1038         {
1039                 VideoListEditorPanel* pEditorPanel = dynamic_cast<VideoListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1040                 if (pEditorPanel != null)
1041                 {
1042                         pEditorPanel->SelectAllPressed();
1043                 }
1044         }
1045         else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1046         {
1047                 AllListSelectionPanel* pEditorPanel = dynamic_cast<AllListSelectionPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1048                 if (pEditorPanel != null)
1049                 {
1050                         pEditorPanel->SelectAllPressed();
1051                 }
1052         }
1053 }
1054
1055 void
1056 FileListEditorForm::OnSlideSettingPopUpItemSelected(int index)
1057 {
1058
1059         if ( __pPopUp != NULL)
1060         {
1061                 __pPopUp->SetShowState(false);
1062         }
1063
1064         SceneManager* pSceneManager = SceneManager::GetInstance();
1065
1066         if (index == 0)   // start slide show
1067         {
1068                 if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_EDITOR)
1069                 {
1070                         AllListEditorPanel* pEditorPanel = dynamic_cast<AllListEditorPanel*>(pSceneManager->GetCurrentScene()->GetPanel());
1071                         if (pEditorPanel != null)
1072                         {
1073                                 pEditorPanel->OnRequestSlideShow();
1074                         }
1075                 }
1076                 else if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION)
1077                 {
1078                         AllListSelectionPanel* pSelectionPanel = dynamic_cast<AllListSelectionPanel*>
1079                                         (pSceneManager->GetCurrentScene()->GetPanel());
1080
1081                         if (pSelectionPanel != null)
1082                         {
1083                                 pSelectionPanel->OnRequestSlideShow();
1084                         }
1085                 }
1086
1087         }
1088         else if (index == 1) // go to settingsForm
1089         {
1090                 SceneManager* pSceneManager = SceneManager::GetInstance();
1091                 TryReturnVoid(pSceneManager != null, "[%s] fail to get SceneManager", GetErrorMessage(GetLastResult()));
1092
1093                 pSceneManager->GoForward(ForwardSceneTransition(IDSCN_SETTING_MAIN));
1094
1095         }
1096 }
1097