From: HyukSoon Choi Date: Mon, 18 Mar 2013 05:31:09 +0000 (+0900) Subject: Modify share via message X-Git-Tag: accepted/tizen_2.1/20130425.023637~85 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a6511f836cde399889e6d1965a253fb9577f9f6f;p=apps%2Fosp%2FGallery.git Modify share via message Change-Id: I1d21a72d353d5a0926fb86f9c1db0e3d9645c2cb Signed-off-by: HyukSoon Choi --- diff --git a/inc/GlAlbumInfo.h b/inc/GlAlbumInfo.h index e4d1728..25a8508 100644 --- a/inc/GlAlbumInfo.h +++ b/inc/GlAlbumInfo.h @@ -52,9 +52,8 @@ public: void ClearAll(void); AlbumInfoType GetAlbumInfoType(void); - Tizen::Graphics::Bitmap* GetFolderThumnailBitmap(int index); - void AppendFolderThumnailBitmap(Tizen::Graphics::Bitmap* folderThumnailBitmap, int index); - int GetFolderThumnailBitmapCount(void) const; + Tizen::Graphics::Bitmap* GetFolderThumnailBitmap(void); + void SetFolderThumnailBitmap(Tizen::Graphics::Bitmap* folderThumnailBitmap); void ClearContentIdList(void); Tizen::Base::Collection::IList* GetContentIdListN(void) const; @@ -63,18 +62,12 @@ public: void AppendContentIdList(const Tizen::Base::Collection::ICollection& contentIdList); int GetContentIdCount(void) const; result RemoveContentIdAt(int index); - int GetEmptyBitmapIndex(void); - - Tizen::Base::String GetCreateDateString(void) const; - void SetCreateDateString(Tizen::Base::String& strMinimumDate, Tizen::Base::String& strMaximumDate); protected : Tizen::Base::String __albumName; Tizen::Base::Collection::IList* __pDirectoryFullPathList; Tizen::Base::Collection::IList* __pContentIdList; - Tizen::Base::String __createFileDateString; - int __folderThumnailBitmapCount; - Tizen::Graphics::Bitmap* __pFolderThumnailBitmap[7]; + Tizen::Graphics::Bitmap* __pFolderThumnailBitmap; }; #endif /* _GL_ALBUM_INFO_H_ */ diff --git a/inc/GlAlbumListPresentationModel.h b/inc/GlAlbumListPresentationModel.h index 2d00eee..c7603f5 100644 --- a/inc/GlAlbumListPresentationModel.h +++ b/inc/GlAlbumListPresentationModel.h @@ -77,13 +77,10 @@ private: static void CreateInstance(void); static void DestroyInstance(void); - void DrawPartialImage(Tizen::Graphics::Canvas& canvas, AlbumInfo* pAlbumInfo, int partialIndex, + void DrawPartialImage(Tizen::Graphics::Canvas& canvas, AlbumInfo* pAlbumInfo, const Tizen::Graphics::Rectangle& rectNew); void DrawFontImage(Tizen::Graphics::Canvas& canvas, AlbumInfo* pAlbumInfo, int index); - bool GetMinMaxDateTimeString(Tizen::Base::Collection::IList* pContentIdList, Tizen::Base::String& MinimumTime, - Tizen::Base::String& MaximumTime); - Tizen::Base::String GetDirectoryName(Tizen::Base::String& directoryPath); Tizen::Base::Collection::IList* GetContentIdListInDirectoryN(const Tizen::Base::String& directoryPath, Tizen::Content::ContentType contentType) const; diff --git a/inc/GlAlbumNameEditorForm.h b/inc/GlAlbumNameEditorForm.h index e45aa20..4500c7d 100644 --- a/inc/GlAlbumNameEditorForm.h +++ b/inc/GlAlbumNameEditorForm.h @@ -23,20 +23,24 @@ #define _GL_ALBUM_NAME_EDITOR_FORM_H_ #include +#include #include #include #include #include -#include -#include "GlTypes.h" + + +#include "GlBaseForm.h" #include "GlFileOpInvalidateListener.h" +#include "GlTypes.h" + class AlbumListPresentationModel; class FileListPresentationModel; class FileMoveTimer; class AlbumNameEditorForm - : public Tizen::Ui::Controls::Form + : public BaseForm , public Tizen::Ui::IActionEventListener , public Tizen::Ui::ITextEventListener , public Tizen::Ui::Controls::IFormBackEventListener @@ -65,7 +69,7 @@ public: //From IFileOpInvalidate void OnFileOpInvalidate(enum FileActionMode __actionId); - void OnFileOpComplete(enum FileActionMode __actionId, result); + void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes); private: Tizen::Ui::Controls::EditField* __pNameEditField; diff --git a/inc/GlAllListEditorPanel.h b/inc/GlAllListEditorPanel.h index 2c4c1f3..bedefc2 100644 --- a/inc/GlAllListEditorPanel.h +++ b/inc/GlAllListEditorPanel.h @@ -78,7 +78,7 @@ public: //From IFileOpInvalidate void OnFileOpInvalidate(enum FileActionMode __actionId); - void OnFileOpComplete(enum FileActionMode __actionId, result); + void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes); private: void ResetSelection(void); diff --git a/inc/GlAllListSelectionPanel.h b/inc/GlAllListSelectionPanel.h index 60ed5e6..65bbde0 100644 --- a/inc/GlAllListSelectionPanel.h +++ b/inc/GlAllListSelectionPanel.h @@ -77,7 +77,7 @@ class AllListSelectionPanel //From IFileOpInvalidate void OnFileOpInvalidate(enum FileActionMode __actionId); - void OnFileOpComplete(enum FileActionMode __actionId, result); + void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes); private: diff --git a/inc/GlBaseForm.h b/inc/GlBaseForm.h index bf1e199..35bf921 100644 --- a/inc/GlBaseForm.h +++ b/inc/GlBaseForm.h @@ -14,17 +14,27 @@ // limitations under the License. // -#include + #ifndef _GL_BASE_FORM_H_ #define _GL_BASE_FORM_H_ +#include + +class FileListPresentationModel; + class BaseForm : public Tizen::Ui::Controls::Form { public: virtual ~BaseForm(void){}; virtual void OnUpdateContentList(void){}; +protected: + Tizen::Base::Collection::IList* GetMoveFileIndexList(Tizen::Base::String&, + Tizen::Base::Collection::IList*, FileListPresentationModel*); + +protected: + bool __overlayMsg; }; diff --git a/inc/GlFileDeleteTimer.h b/inc/GlFileDeleteTimer.h index a19b26e..b1f31da 100644 --- a/inc/GlFileDeleteTimer.h +++ b/inc/GlFileDeleteTimer.h @@ -36,9 +36,9 @@ public : private: //From GlTimerBase Tizen::Base::Collection::IList * TimerStart(void); - void TimerExpired(const ContentId& contentId); - void TimerCancel(void); - void TimerComplete(int); + result TimerExpired(const ContentId& contentId); + void TimerCancel(int, enum FileActionCancelRes res); + void TimerComplete(int, enum FileActionCompleteRes res); private : Tizen::Base::Collection::IList* __pDeleteIndexList; diff --git a/inc/GlFileListEditorForm.h b/inc/GlFileListEditorForm.h index 08f67f8..ace5727 100644 --- a/inc/GlFileListEditorForm.h +++ b/inc/GlFileListEditorForm.h @@ -56,10 +56,10 @@ public: void SetFooterButtonsState(bool enableState); result MoveToAlbum(Tizen::Base::String& destDirectory); - bool GetFileMoveProgress(); + bool GetOverlayStatus(); //From IFileOpInvalidate void OnFileOpInvalidate(enum FileActionMode __actionId); - void OnFileOpComplete(enum FileActionMode __actionId, result); + void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes); private: result InitializeFooter(void); @@ -77,7 +77,6 @@ private: Tizen::Base::Collection::IList* __pContentDirectoryNameList; FileListPresentationModel* __pPresentationModel; FileMoveTimer* __pFileMove; - bool __moveInProgress; }; #endif /* _GL_FILE_LIST_EDITOR_FORM_H_ */ diff --git a/inc/GlFileMoveTimer.h b/inc/GlFileMoveTimer.h index ff38735..838cc1d 100644 --- a/inc/GlFileMoveTimer.h +++ b/inc/GlFileMoveTimer.h @@ -36,9 +36,9 @@ public : private: //From GlTimerBase Tizen::Base::Collection::IList * TimerStart(void); - void TimerExpired(const ContentId& contentId); - void TimerCancel(void); - void TimerComplete(int); + result TimerExpired(const ContentId& contentId); + void TimerCancel(int, enum FileActionCancelRes res); + void TimerComplete(int, enum FileActionCompleteRes res); private : Tizen::Base::Collection::IList* __pMoveIndexList; diff --git a/inc/GlFileOpInvalidateListener.h b/inc/GlFileOpInvalidateListener.h index 17a12d2..2fdd289 100644 --- a/inc/GlFileOpInvalidateListener.h +++ b/inc/GlFileOpInvalidateListener.h @@ -28,8 +28,8 @@ class IFileOpInvalidateListener { public: virtual ~IFileOpInvalidateListener(void) {} - virtual void OnFileOpInvalidate(enum FileActionMode __actionId) = 0; - virtual void OnFileOpComplete(enum FileActionMode __actionId, result res) = 0; + virtual void OnFileOpInvalidate(enum FileActionMode ) = 0; + virtual void OnFileOpComplete(enum FileActionMode , enum FileActionCompleteRes ) = 0; }; diff --git a/inc/GlImageListEditorPanel.h b/inc/GlImageListEditorPanel.h index 7b770b7..3fb65e4 100644 --- a/inc/GlImageListEditorPanel.h +++ b/inc/GlImageListEditorPanel.h @@ -78,7 +78,7 @@ public: //From IFileOpInvalidate void OnFileOpInvalidate(enum FileActionMode __actionId); - void OnFileOpComplete(enum FileActionMode __actionId, result); + void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes); private: Tizen::Base::Collection::IList* GetItemCheckedIndexList(void) const; diff --git a/inc/GlTimerBase.h b/inc/GlTimerBase.h index fb950df..0795d3a 100644 --- a/inc/GlTimerBase.h +++ b/inc/GlTimerBase.h @@ -52,14 +52,14 @@ class GlTimerBase protected: virtual Tizen::Base::Collection::IList * TimerStart(void) = 0; - virtual void TimerExpired(const ContentId&) = 0; - virtual void TimerCancel(void) = 0; - virtual void TimerComplete(int) = 0; + virtual result TimerExpired(const ContentId&) = 0; + virtual void TimerCancel(int, enum FileActionCancelRes res) = 0; + virtual void TimerComplete(int, enum FileActionCompleteRes res) = 0; private: - void OnOpComplete(void); - void OnOpCancelled(void); + void OnOpComplete(enum FileActionCompleteRes); + void OnOpCancelled(enum FileActionCancelRes res); private: diff --git a/inc/GlTypes.h b/inc/GlTypes.h index 5b5b0dc..97778df 100644 --- a/inc/GlTypes.h +++ b/inc/GlTypes.h @@ -112,6 +112,19 @@ enum FileActionMode FILE_RENAME_ACTION }; +enum FileActionCancelRes +{ + CANCEL_USER, + CANCEL_SYS_ERROR +}; + +enum FileActionCompleteRes +{ + COMPLETE_SUCCESS, + COMPLETE_SYS_PARTIAL, + COMPLETE_SYS_FAILURE +}; + extern const wchar_t* IDL_FORM_ALBUM_LIST; extern const wchar_t* IDL_FORM_FILE_LIST; extern const wchar_t* IDL_FORM_SETTING_MAIN; @@ -177,6 +190,7 @@ extern const wchar_t* APPCONTROL_DATA_VIDEO; extern const wchar_t* APPCONTROL_DATA_SINGLE; extern const wchar_t* APPCONTROL_DATA_MULTIPLE; extern const wchar_t* APPCONTROL_DATA_SLIDE_SHOW; +extern const wchar_t* APPCONTROL_DATA_MMS; extern const wchar_t* APPCONTROL_DATA_SELECTION_MODE; extern const wchar_t* APPCONTROL_RESULT_KEY_LEGACY_RESULT; @@ -221,6 +235,7 @@ extern const wchar_t* IDB_CONTROLBAR_CAMERA; extern const wchar_t* IDB_CONTROLBAR_DELETE; extern const wchar_t* IDB_CONTROLBAR_DELETE_DIM; extern const wchar_t* IDB_CONTROLBAR_MORE; +extern const wchar_t* IDB_CONTROLBAR_MORE_DISABLED; extern const wchar_t* IDB_CONTROLBAR_SHARE; extern const wchar_t* IDB_CONTROLBAR_SHARE_DIM; extern const wchar_t* IDB_LISTVIEW_EMPTY; diff --git a/inc/GlVideoListEditorPanel.h b/inc/GlVideoListEditorPanel.h index 37a6906..a703eb4 100644 --- a/inc/GlVideoListEditorPanel.h +++ b/inc/GlVideoListEditorPanel.h @@ -80,7 +80,7 @@ public: //From IFileOpInvalidate void OnFileOpInvalidate(enum FileActionMode __actionId); - void OnFileOpComplete(enum FileActionMode __actionId, result); + void OnFileOpComplete(enum FileActionMode __actionId, enum FileActionCompleteRes); private: Tizen::Base::Collection::IList* GetItemCheckedIndexList(void) const; diff --git a/res/screen-density-xhigh/00_icon_more_dim.png b/res/screen-density-xhigh/00_icon_more_dim.png new file mode 100644 index 0000000..cd80dce Binary files /dev/null and b/res/screen-density-xhigh/00_icon_more_dim.png differ diff --git a/res/screen-density-xhigh/00_icon_more_press.png b/res/screen-density-xhigh/00_icon_more_press.png new file mode 100644 index 0000000..2e0c742 Binary files /dev/null and b/res/screen-density-xhigh/00_icon_more_press.png differ diff --git a/src/GlAlbumInfo.cpp b/src/GlAlbumInfo.cpp index fbac422..61863df 100644 --- a/src/GlAlbumInfo.cpp +++ b/src/GlAlbumInfo.cpp @@ -27,18 +27,11 @@ using namespace Tizen::Base::Collection; using namespace Tizen::Content; using namespace Tizen::Graphics; -static const int FORMAT_BUFFER_SIZE = 256; - AlbumInfo::AlbumInfo(void) - : __albumName(EMPTY_SPACE) - , __pDirectoryFullPathList(null) + : __pDirectoryFullPathList(null) , __pContentIdList(null) - , __folderThumnailBitmapCount(0) + , __pFolderThumnailBitmap(null) { - for (int i = 0; i < FOLDER_BITMAP_MAX; ++i) - { - __pFolderThumnailBitmap[i] = null; - } } AlbumInfo::~AlbumInfo(void) @@ -53,12 +46,9 @@ AlbumInfo::~AlbumInfo(void) delete __pContentIdList; } - for (int i = 0; i < FOLDER_BITMAP_MAX; ++i) + if (__pFolderThumnailBitmap != null) { - if (__pFolderThumnailBitmap[i] != null) - { - delete __pFolderThumnailBitmap[i]; - } + delete __pFolderThumnailBitmap; } } @@ -216,14 +206,12 @@ AlbumInfo::Construct(void) __pDirectoryFullPathList = new (std::nothrow) ArrayList(SingleObjectDeleter); __pContentIdList = new (std::nothrow) ArrayList(SingleObjectDeleter); result r = E_SUCCESS; - if (GetLastResult() == E_SUCCESS && __pDirectoryFullPathList != null && __pContentIdList != null) - { - r = E_SUCCESS; - } - else + if (GetLastResult() != E_SUCCESS || __pDirectoryFullPathList == null || __pContentIdList == null) { delete __pDirectoryFullPathList; + __pDirectoryFullPathList = null; delete __pContentIdList; + __pContentIdList = null; r = E_FAILURE; } @@ -339,17 +327,6 @@ AlbumInfo::AppendContentIdList(const ICollection& contentIdList) __pContentIdList->Add(pItem); } delete pEnum; - pEnum = null; - - int thumnailCount = __pContentIdList->GetCount(); - if (thumnailCount >= FOLDER_BITMAP_MAX) - { - __folderThumnailBitmapCount = FOLDER_BITMAP_MAX; - } - else - { - __folderThumnailBitmapCount = thumnailCount; - } } void @@ -394,77 +371,16 @@ AlbumInfo::RemoveContentIdAt(int index) return r; } -int -AlbumInfo::GetFolderThumnailBitmapCount(void) const -{ - return __folderThumnailBitmapCount; -} - void -AlbumInfo::AppendFolderThumnailBitmap(Bitmap* FolderThumnailBitmap, int index) +AlbumInfo::SetFolderThumnailBitmap(Bitmap* pFolderThumnailBitmap) { - if (index >= FOLDER_BITMAP_MAX) - { - return; - } - - __pFolderThumnailBitmap[index] = FolderThumnailBitmap; + __pFolderThumnailBitmap = pFolderThumnailBitmap; } Bitmap* -AlbumInfo::GetFolderThumnailBitmap(int index) -{ - if (index >= FOLDER_BITMAP_MAX) - { - return null; - } - - return __pFolderThumnailBitmap[index]; -} - -int -AlbumInfo::GetEmptyBitmapIndex(void) -{ - int empty = FOLDER_BITMAP_MAX; - - for (int i = 0; i < __folderThumnailBitmapCount; ++i) - { - if (i >= FOLDER_BITMAP_MAX) - { - break; - } - - if (__pFolderThumnailBitmap[i] == null) - { - empty = i; - break; - } - } - return empty; -} - -String -AlbumInfo::GetCreateDateString(void) const -{ - return __createFileDateString; -} - -void -AlbumInfo::SetCreateDateString(String& strMinimumDate, String& strMaximumDate) +AlbumInfo::GetFolderThumnailBitmap() { - String resultTime; - - if (strMinimumDate == strMaximumDate) - { - resultTime.Format(FORMAT_BUFFER_SIZE, L"%ls", strMaximumDate.GetPointer()); - } - else - { - resultTime.Format(FORMAT_BUFFER_SIZE, L"%ls - %ls", strMinimumDate.GetPointer(), - strMaximumDate.GetPointer()); - } - - __createFileDateString = resultTime; + return __pFolderThumnailBitmap; } AlbumInfoType diff --git a/src/GlAlbumListEditorForm.cpp b/src/GlAlbumListEditorForm.cpp index 0c94dc4..cc4da10 100644 --- a/src/GlAlbumListEditorForm.cpp +++ b/src/GlAlbumListEditorForm.cpp @@ -40,6 +40,9 @@ using namespace Tizen::Ui::Scenes; static const unsigned int COLOR_SELECT_COUNT_LABEL = Color32<68, 68, 68>::Value; static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value; +static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value; +static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value; +static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value; static const int W_FOLDER_SIZE = 334; static const int H_FOLDER_SIZE = 334; @@ -81,6 +84,7 @@ AlbumListEditorForm::AlbumListEditorForm() , __pPresentationModel(null) { AppLogDebug("ENTER"); + __overlayMsg = false; AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -351,6 +355,9 @@ AlbumListEditorForm::InitializePopup(void) pDeleteButton->Construct( Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_BODY_DELETE")); + pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL); + pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED); + pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT); pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL); pDeleteButton->AddActionEventListener(*this); @@ -419,11 +426,11 @@ AlbumListEditorForm::CreateItem(int index) IList* pAlbumInfoList = __pPresentationModel->GetAlbumInfoList(); AlbumInfo* pAlbumInfo = static_cast(pAlbumInfoList->GetAt(index)); - int emptyIndex = pAlbumInfo->GetEmptyBitmapIndex(); - if (emptyIndex != FOLDER_BITMAP_MAX) + Bitmap* pAlbumBitmap = pAlbumInfo->GetFolderThumnailBitmap(); + if (pAlbumBitmap == null) { - __pPresentationModel->RequestThumbnail(index, emptyIndex); + __pPresentationModel->RequestThumbnail(index, 0); } pBitmap = __pPresentationModel->CreateMergeBitmapN(index); @@ -455,7 +462,6 @@ AlbumListEditorForm::CreateItem(int index) if (pBitmap != null) { delete pBitmap; - pBitmap = null; } AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); @@ -812,6 +818,8 @@ AlbumListEditorForm::OnRequestMessage(void) HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter); pDataList->Construct(); + pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), + new (std::nothrow) String(APPCONTROL_DATA_MMS)); pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText)); diff --git a/src/GlAlbumListForm.cpp b/src/GlAlbumListForm.cpp index 456fe02..ec11af7 100644 --- a/src/GlAlbumListForm.cpp +++ b/src/GlAlbumListForm.cpp @@ -50,6 +50,7 @@ AlbumListForm::AlbumListForm(void) , __pPresentationModel(null) { AppLogDebug("ENTER"); + __overlayMsg = false; AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -259,13 +260,12 @@ AlbumListForm::CreateItem(int index) AlbumInfo* pAlbumInfo = static_cast(pAlbumInfoList->GetAt(index)); if (pAlbumInfo != null) { - int emptyIndex = pAlbumInfo->GetEmptyBitmapIndex(); + Bitmap* pAlbumBitmap = pAlbumInfo->GetFolderThumnailBitmap(); - if (emptyIndex != FOLDER_BITMAP_MAX) + if (pAlbumBitmap == null) { - __pPresentationModel->RequestThumbnail(index, emptyIndex); + __pPresentationModel->RequestThumbnail(index, 0); } - AppLogDebug("index(%d), emptyIndex(%d)", index, emptyIndex); pBitmap = __pPresentationModel->CreateMergeBitmapN(index); @@ -274,7 +274,6 @@ AlbumListForm::CreateItem(int index) IconListViewItem* pIconListview = new (std::nothrow) IconListViewItem(); pIconListview->Construct(*pBitmap); delete pBitmap; - pBitmap = null; AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult())); return pIconListview; diff --git a/src/GlAlbumListPresentationModel.cpp b/src/GlAlbumListPresentationModel.cpp index 175ba82..e4217b0 100644 --- a/src/GlAlbumListPresentationModel.cpp +++ b/src/GlAlbumListPresentationModel.cpp @@ -77,15 +77,6 @@ static const int COMPARE_COLOR_NUMBER_3 = 3; static const int DOUBLE_NUMBER = 2; static const int TRIPLE_NUMBER = 3; -static const int EXCEPTION_NUMBER_0 = 0; -static const int EXCEPTION_NUMBER_1 = 1; -static const int EXCEPTION_NUMBER_2 = 2; - -static const int MAX_NUMBER_X = 3; -static const int MAX_NUMBER_Y = 3; - -static const int MAX_THUMNAIL_COUNT_IN_ALBUM = 7; - AlbumListPresentationModel* AlbumListPresentationModel::__pPresentationModelInstance = null; ArrayList* AlbumListPresentationModel::__pPresentationModelListener = null; ThumbnailProvider* AlbumListPresentationModel::__pThumbnailProvider = null; @@ -267,10 +258,9 @@ AlbumListPresentationModel::CallAlbumChangedEvent(void) } void -AlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo* pAlbumInfo, int partialIndex, - const Rectangle& rectNew) +AlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo* pAlbumInfo, const Rectangle& rectNew) { - AppLogDebug("ENTER partialIndex(%d)", partialIndex); + AppLogDebug("ENTER"); if (&canvas == null || __pFolderBackgroundBitmap == null || pAlbumInfo == null) { AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult())); @@ -280,194 +270,14 @@ AlbumListPresentationModel::DrawPartialImage(Canvas& canvas, AlbumInfo* pAlbumIn Dimension dimSet(ICON_SIZE, ICON_SIZE); canvas.DrawBitmap(rectNew, *__pFolderBackgroundBitmap); - int startIndex = 0; - - switch (partialIndex) - { - case 0: - break; - case 1: - { - Bitmap* pBitmap1 = pAlbumInfo->GetFolderThumnailBitmap(startIndex); - if (pBitmap1 != null) - { - Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP, - ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER, - ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER); - canvas.DrawBitmap(rectFirst, *pBitmap1); - } - break; - } - case 2: - { - Bitmap* pBitmap1 = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - Bitmap* pBitmap2 = pAlbumInfo->GetFolderThumnailBitmap(startIndex); - if (pBitmap1 != null && pBitmap2 != null) - { - Rectangle rectFirst(ICON_CAP+FOLDER_CAP, - ICON_CAP * DOUBLE_NUMBER + ICON_SIZE, - ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER, - ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * DOUBLE_NUMBER); - Rectangle rectSecond(ICON_CAP * TRIPLE_NUMBER + FOLDER_CAP + ICON_SIZE * DOUBLE_NUMBER, - ICON_CAP, ICON_SIZE, ICON_SIZE); - canvas.DrawBitmap(rectFirst, *pBitmap1); - canvas.DrawBitmap(rectSecond, *pBitmap2); - } - break; - } - case 3: - { - Bitmap* pBitmap1 = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - Bitmap* pBitmap2 = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - Bitmap* pBitmap3 = pAlbumInfo->GetFolderThumnailBitmap(startIndex); - if (pBitmap1 != null && pBitmap2 != null && pBitmap3 != null) - { - Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP * DOUBLE_NUMBER + ICON_SIZE, - ICON_CAP + ICON_SIZE * DOUBLE_NUMBER, ICON_CAP + ICON_SIZE * DOUBLE_NUMBER); - Rectangle rectSecond(ICON_CAP * TRIPLE_NUMBER + FOLDER_CAP + ICON_SIZE * DOUBLE_NUMBER, - ICON_CAP * DOUBLE_NUMBER + ICON_SIZE, ICON_SIZE, ICON_CAP + ICON_SIZE * DOUBLE_NUMBER); - Rectangle rectThird(ICON_CAP * TRIPLE_NUMBER + FOLDER_CAP + ICON_SIZE * DOUBLE_NUMBER, ICON_CAP, - ICON_SIZE, ICON_SIZE); - canvas.DrawBitmap(rectFirst, *pBitmap1); - canvas.DrawBitmap(rectSecond, *pBitmap2); - canvas.DrawBitmap(rectThird, *pBitmap3); - } - break; - } - case 4: - { - Bitmap* pBitmap1 = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - Bitmap* pBitmap = null; - if (pBitmap1 != null) - { - Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP * DOUBLE_NUMBER + ICON_SIZE, - ICON_CAP + ICON_SIZE * DOUBLE_NUMBER, ICON_CAP + ICON_SIZE * DOUBLE_NUMBER); - canvas.DrawBitmap(rectFirst, *pBitmap1); - - for (int y = 0; y < MAX_NUMBER_Y; ++y) - { - for (int x = 0; x < MAX_NUMBER_X; ++x) - { - if ((y == EXCEPTION_NUMBER_0 || y == EXCEPTION_NUMBER_1 || y == EXCEPTION_NUMBER_2) - && (x == EXCEPTION_NUMBER_0 || x == EXCEPTION_NUMBER_1)) - { - continue; - } - - int xPoint = (ICON_CAP * (x + 1)) + FOLDER_CAP + (dimSet.width * x); - int yPoint = (ICON_CAP * (y + 1)) + (dimSet.height * y); - - pBitmap = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - if (pBitmap != null) - { - Rectangle rect(xPoint,yPoint,dimSet.width,dimSet.height); - canvas.DrawBitmap(rect, *pBitmap); - } - } - } - } - break; - } - case 5: - { - Bitmap* pBitmap1 = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - Bitmap* pBitmap2 = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - Bitmap* pBitmap = null; - - if (pBitmap1 != null && pBitmap2 != null) - { - Rectangle rectFirst(ICON_CAP + FOLDER_CAP, - ICON_CAP * DOUBLE_NUMBER + ICON_SIZE, ICON_CAP + ICON_SIZE * DOUBLE_NUMBER, dimSet.height); - Rectangle rectSecond(ICON_CAP + FOLDER_CAP, ICON_CAP * TRIPLE_NUMBER + ICON_SIZE * DOUBLE_NUMBER, - ICON_CAP + ICON_SIZE * DOUBLE_NUMBER, dimSet.height); - canvas.DrawBitmap(rectFirst, *pBitmap1); - canvas.DrawBitmap(rectSecond, *pBitmap2); - - for (int y = 0; y < MAX_NUMBER_Y; ++y) - { - for (int x = 0; x < MAX_NUMBER_X; ++x) - { - if ((y == EXCEPTION_NUMBER_0 || y == EXCEPTION_NUMBER_1 || y == EXCEPTION_NUMBER_2) - && (x == EXCEPTION_NUMBER_0 || x == EXCEPTION_NUMBER_1)) - { - continue; - } - - int xPoint = (ICON_CAP * (x + 1)) + FOLDER_CAP + (dimSet.width * x); - int yPoint = (ICON_CAP * (y + 1)) + (dimSet.height * y); - pBitmap = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - if (pBitmap != null) - { - Rectangle rect(xPoint,yPoint,dimSet.width,dimSet.height); - canvas.DrawBitmap(rect, *pBitmap); - } - } - } - } - break; - } - case 6: + Bitmap* pBitmap = pAlbumInfo->GetFolderThumnailBitmap(); + if (pBitmap != null) { - Bitmap* pBitmap1 = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - Bitmap* pBitmap = null; - if (pBitmap1 != null) - { - Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP * DOUBLE_NUMBER + ICON_SIZE, - ICON_CAP + ICON_SIZE * DOUBLE_NUMBER, dimSet.height); - canvas.DrawBitmap(rectFirst, *pBitmap1); - - for (int y = 0; y < MAX_NUMBER_Y; ++y) - { - for (int x = 0; x < MAX_NUMBER_X; ++x) - { - if ((y == EXCEPTION_NUMBER_0 || y == EXCEPTION_NUMBER_1) - && (x == EXCEPTION_NUMBER_0 || x == EXCEPTION_NUMBER_1)) - { - continue; - } - - int xPoint = (ICON_CAP * (x + 1)) + FOLDER_CAP + (dimSet.width * x); - int yPoint = (ICON_CAP * (y + 1)) + (dimSet.height * y); - - pBitmap = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - if (pBitmap != null) - { - Rectangle rect(xPoint,yPoint,dimSet.width,dimSet.height); - canvas.DrawBitmap(rect, *pBitmap); - } - } - } - } - break; - } - case 7: - { - Bitmap* pBitmap = null; - for (int y = 0; y < MAX_NUMBER_Y; ++y) - { - for (int x = 0; x < MAX_NUMBER_X; ++x) - { - if (y == EXCEPTION_NUMBER_0 && (x == EXCEPTION_NUMBER_0 || x == EXCEPTION_NUMBER_1)) - { - continue; - } - - int xPoint = (ICON_CAP * (x + 1)) + FOLDER_CAP + (dimSet.width * x); - int yPoint = (ICON_CAP * (y + 1)) + (dimSet.height * y); - - pBitmap = pAlbumInfo->GetFolderThumnailBitmap(startIndex++); - if (pBitmap != null) - { - Rectangle rect(xPoint,yPoint,dimSet.width,dimSet.height); - canvas.DrawBitmap(rect, *pBitmap); - } - } - } - break; - } - default: - break; + Rectangle rectFirst(ICON_CAP+FOLDER_CAP, ICON_CAP, + ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER, + ICON_CAP * DOUBLE_NUMBER + ICON_SIZE * TRIPLE_NUMBER); + canvas.DrawBitmap(rectFirst, *pBitmap); } AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -483,9 +293,6 @@ AlbumListPresentationModel::DrawFontImage(Canvas& canvas, AlbumInfo* pAlbumInfo, return; } - String dateString; - dateString = pAlbumInfo->GetCreateDateString(); - String strCnt; int allContentCount = pAlbumInfo->GetContentIdCount(); strCnt.Format(FORMAT_BUFFER_SIZE, L"%d", allContentCount); @@ -544,7 +351,6 @@ AlbumListPresentationModel::DrawFontImage(Canvas& canvas, AlbumInfo* pAlbumInfo, pointText = Point(ICON_CAP + FOLDER_CAP, ICON_CAP + FONT_SIZE_FOLDER_NAME); canvas.SetFont(ftDate); canvas.SetForegroundColor(Color::GetColor(COLOR_ID_GREY)); - canvas.DrawText(pointText, dateString, MAX_FONT_LENGTH); pointText = Point((ICON_SIZE * DOUBLE_NUMBER + ICON_CAP) - ((FONT_SIZE_FOLDER_COUNT / DOUBLE_NUMBER) * strCnt.GetLength() + GAP_FONT), ICON_CAP + FONT_SIZE_FOLDER_NAME + FONT_SIZE_FOLDER_DATE); @@ -571,18 +377,6 @@ AlbumListPresentationModel::CreateMergeBitmapN(int index) } AlbumInfo* pAlbumInfo = static_cast(__pAlbumInfoList->GetAt(index)); - int paticalCount = 0; - if (pAlbumInfo != null) - { - paticalCount = pAlbumInfo->GetFolderThumnailBitmapCount(); - } - - if (paticalCount == 0) - { - AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult())); - - return null; - } Bitmap* pBitmapNew = new (std::nothrow) Bitmap(); BufferInfo bufferinfo; @@ -609,7 +403,7 @@ AlbumListPresentationModel::CreateMergeBitmapN(int index) return null; } - DrawPartialImage(canvas, pAlbumInfo, paticalCount, rectNew); + DrawPartialImage(canvas, pAlbumInfo, rectNew); DrawFontImage(canvas, pAlbumInfo, index); @@ -619,67 +413,6 @@ AlbumListPresentationModel::CreateMergeBitmapN(int index) return pBitmapNew; } -bool -AlbumListPresentationModel::GetMinMaxDateTimeString(IList* pContentIdList, String& MinimumTime, String& MaximumTime) -{ - AppLogDebug("ENTER"); - int fileCount = pContentIdList->GetCount(); - - if (fileCount == 0) - { - MinimumTime = EMPTY_SPACE; - MaximumTime = EMPTY_SPACE; - AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult())); - - return false; - } - - DateTime dateMin, dateMax; - ContentManager contentManager; - result r = contentManager.Construct(); - if (r == E_SUCCESS) - { - for (int count = 0; count < fileCount; ++count) - { - ContentId* pContentId = static_cast(pContentIdList->GetAt(count)); - ContentInfo* pContentInfo = contentManager.GetContentInfoN(*pContentId); - - if (pContentInfo == null) - { - MinimumTime = EMPTY_SPACE; - MaximumTime = EMPTY_SPACE; - AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult())); - - return false; - } - - DateTime dateFileTime = pContentInfo->GetDateTime(); - - if (count == 0) - { - dateMin = dateFileTime; - dateMax = dateFileTime; - continue; - } - - if (DateTime::Compare(dateMax, dateFileTime) > 0) - { - dateMax = dateFileTime; - } - - if (DateTime::Compare(dateMin, dateFileTime) < 0) - { - dateMin = dateFileTime; - } - } - MinimumTime.Format(FORMAT_BUFFER_SIZE, L"%04d.%d", dateMin.GetYear(), dateMin.GetMonth()); - MaximumTime.Format(FORMAT_BUFFER_SIZE, L"%04d.%d", dateMax.GetYear(), dateMax.GetMonth()); - } - AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); - - return true; -} - result AlbumListPresentationModel::StartAppControl( const String& providerId, const String& operationId, const IMap* pDataList, IAppControlResponseListener* pListener) @@ -930,78 +663,49 @@ AlbumListPresentationModel::InitializeAlbumInfoList(const ContentType& contentTy if (pAlbumInfo != null && pAlbumInfo->GetContentIdCount() > 0) { - String strMaximumDate; - String strMinimumDate; - GetMinMaxDateTimeString(pAlbumInfo->GetContentIdListN(), strMinimumDate, strMaximumDate); - pAlbumInfo->SetCreateDateString(strMinimumDate, strMaximumDate); __pAlbumInfoList->Add(pAlbumInfo); - pAlbumInfo = null; } else { delete pAlbumInfo; - pAlbumInfo = null; } } int insertIndex = 0; if (pAllAlbumInfo->GetContentIdCount() > 0) { - String strMaximumDate; - String strMinimumDate; - GetMinMaxDateTimeString(pAllAlbumInfo->GetContentIdListN(), strMinimumDate, strMaximumDate); - pAllAlbumInfo->SetCreateDateString(strMinimumDate, strMaximumDate); __pAlbumInfoList->InsertAt((Object&)*pAllAlbumInfo, insertIndex++); - pAllAlbumInfo = null; } else { delete pAllAlbumInfo; - pAllAlbumInfo = null; } if (pCameraAlbumInfo->GetContentIdCount() > 0) { - String strMaximumDate; - String strMinimumDate; - GetMinMaxDateTimeString(pCameraAlbumInfo->GetContentIdListN(), strMinimumDate, strMaximumDate); - pCameraAlbumInfo->SetCreateDateString(strMinimumDate, strMaximumDate); __pAlbumInfoList->InsertAt((Object&)*pCameraAlbumInfo, insertIndex++); } else { delete pCameraAlbumInfo; - pCameraAlbumInfo = null; } if (pDownloadAlbumInfo->GetContentIdCount() > 0) { - String strMaximumDate; - String strMinimumDate; - String dateString; - GetMinMaxDateTimeString(pDownloadAlbumInfo->GetContentIdListN(), strMinimumDate, strMaximumDate); - pDownloadAlbumInfo->SetCreateDateString(strMinimumDate, strMaximumDate); __pAlbumInfoList->InsertAt((Object&)*pDownloadAlbumInfo, insertIndex++); } else { delete pDownloadAlbumInfo; - pDownloadAlbumInfo = null; } if (pNoNameAlbumInfo->GetContentIdCount() > 0) { - String strMaximumDate; - String strMinimumDate; - String dateString; - GetMinMaxDateTimeString(pNoNameAlbumInfo->GetContentIdListN(), strMinimumDate, strMaximumDate); - pNoNameAlbumInfo->SetCreateDateString(strMinimumDate, strMaximumDate); __pAlbumInfoList->InsertAt((Object&)*pNoNameAlbumInfo, insertIndex++); } else { delete pNoNameAlbumInfo; - pNoNameAlbumInfo = null; } delete pEnum; @@ -1247,9 +951,9 @@ AlbumListPresentationModel::OnThumbnailReceivedN(IEventArg& eventArg) if (contentId == pAlbumInfo->GetContentId(i)) { - if (pAlbumInfo->GetFolderThumnailBitmap(i) == null) + if (pAlbumInfo->GetFolderThumnailBitmap() == null) { - pAlbumInfo->AppendFolderThumnailBitmap(pThumbnailInfo->GetBitmapN(), i); + pAlbumInfo->SetFolderThumnailBitmap(pThumbnailInfo->GetBitmapN()); pUpdateFolderIndex->Add(new (std::nothrow) Integer(x)); } } @@ -1270,21 +974,10 @@ AlbumListPresentationModel::OnThumbnailReceivedN(IEventArg& eventArg) { Integer *index = (Integer*)pUpdateFolderIndex->GetAt(k); int folderIndex = index->ToInt(); - - AlbumInfo* pAlbumInfo = static_cast(__pAlbumInfoList->GetAt(folderIndex)); - int emptyIndex = pAlbumInfo->GetEmptyBitmapIndex(); - if (emptyIndex == FOLDER_BITMAP_MAX) - { - pListener->OnThumbnailDecoded(folderIndex); - } - else - { - RequestThumbnail(folderIndex, emptyIndex); - } + pListener->OnThumbnailDecoded(folderIndex); } } delete pEnum; - pEnum = null; } delete pUpdateFolderIndex; @@ -1317,20 +1010,13 @@ AlbumListPresentationModel::CancelThumbnailRequest(const int folderIndex) AlbumInfo* pAlbumInfo = static_cast(__pAlbumInfoList->GetAt(folderIndex)); if (pAlbumInfo != null) { - int loopCount = pAlbumInfo->GetFolderThumnailBitmapCount(); - ContentId contentId; - if (loopCount > MAX_THUMNAIL_COUNT_IN_ALBUM) - { - loopCount = MAX_THUMNAIL_COUNT_IN_ALBUM; - } - - __pThumbnailProvider->CancelThumbnailRequest(contentId, __pThumbnailEvent); - + /* for (int i = 0; i < loopCount ; ++i) { contentId = pAlbumInfo->GetContentId(i); __pThumbnailProvider->CancelThumbnailRequest(contentId, __pThumbnailEvent); } + */ } } AppLogDebug("EXIT"); diff --git a/src/GlAlbumNameEditorForm.cpp b/src/GlAlbumNameEditorForm.cpp index 66a7410..461ce26 100644 --- a/src/GlAlbumNameEditorForm.cpp +++ b/src/GlAlbumNameEditorForm.cpp @@ -47,16 +47,17 @@ static const unsigned int COLOR_NAME_EDIT_FIELD = Color32<255, 255, 255>::Value; static const int ALBUM_MAX_LENGTH = 255; AlbumNameEditorForm::AlbumNameEditorForm() - : __pNameEditField(null) - , __folderIndex(0) - , __albumNameEditorMode(ALBUM_NAME_EDITOR_MODE_RENAME) - , __pMessageBox(null) - , __pPresentationModel(null) - , __pFilePresentationModel(null) - , __pMoveIndexList(null) - ,__pFileMove(null) +: __pNameEditField(null) +, __folderIndex(0) +, __albumNameEditorMode(ALBUM_NAME_EDITOR_MODE_RENAME) +, __pMessageBox(null) +, __pPresentationModel(null) +, __pFilePresentationModel(null) +, __pMoveIndexList(null) +,__pFileMove(null) { AppLogDebug("ENTER"); + __overlayMsg = false; AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -99,7 +100,9 @@ AlbumNameEditorForm::OnTextValueChanged(const Control& source) __pMessageBox = new (std::nothrow) MessageBox(); __pMessageBox->Construct(L"", L"Donot use invalid character '/'", MSGBOX_STYLE_NONE, 3000); int modalResult = 0; + __overlayMsg = true; __pMessageBox->ShowAndWait(modalResult); + __overlayMsg = false; delete __pMessageBox; __pMessageBox = null; } @@ -183,9 +186,17 @@ void AlbumNameEditorForm::OnFileOpInvalidate(enum FileActionMode actionId) Invalidate(true); } -void AlbumNameEditorForm::OnFileOpComplete(enum FileActionMode actionId, result res) +void AlbumNameEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res) { - + __overlayMsg = false; + if (res != COMPLETE_SUCCESS) + { + __pNameEditField->SetText(__nameEditFieldPreText); + __pNameEditField->HideKeypad(); + __pNameEditField->Draw(); + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoBackward(BackwardSceneTransition(__callerSceneId)); + } } void @@ -243,6 +254,7 @@ AlbumNameEditorForm::OnActionPerformed(const Control& source, int actionId) } delete __pFileMove; + GetMoveFileIndexList(pPath, __pMoveIndexList, __pFilePresentationModel); __pFileMove = new FileMoveTimer(pPath, __pMoveIndexList, __pFilePresentationModel, this ); @@ -252,6 +264,14 @@ AlbumNameEditorForm::OnActionPerformed(const Control& source, int actionId) { delete __pFileMove; __pFileMove = null; + __pNameEditField->SetText(__nameEditFieldPreText); + __pNameEditField->HideKeypad(); + __pNameEditField->Draw(); + pSceneManager->GoBackward(BackwardSceneTransition(__callerSceneId)); + } + else + { + __overlayMsg = true; } AppLogDebug("MoveToContentFileList content failed (%s)", GetErrorMessage(r)); diff --git a/src/GlAllListEditorPanel.cpp b/src/GlAllListEditorPanel.cpp index 2738073..c95bf20 100644 --- a/src/GlAllListEditorPanel.cpp +++ b/src/GlAllListEditorPanel.cpp @@ -43,10 +43,10 @@ static const int H_SELECTALL_REGION = 112; static const int H_COUNT_LABEL = 48; static const int H_COUNT_LABEL_BUTTON = 42; static const int W_COUNT_LABEL_BUTTON = 42; -static const int H_CONTENT_MARGIN = 24; -static const int W_CONTENT_MARGIN = 14; -static const int W_CONTENT_SPACE = 20; -static const int H_CONTENT_SPACE = 24; +static const int H_CONTENT_MARGIN = 9; +static const int W_CONTENT_MARGIN = 6; +static const int W_CONTENT_SPACE = 6; +static const int H_CONTENT_SPACE = 6; static const int LENGTH_COUNT_LABEL = 256; static const unsigned int COLOR_COUNT_LABEL = Color32<68, 68, 68>::Value; static const unsigned int COLOR_SELECT_COUNT_FONT = Color32<255, 255, 255>::Value; @@ -132,7 +132,7 @@ AllListEditorPanel::OnInitializing(void) __pContentIconListView->SetItemSpacing(W_CONTENT_SPACE, H_CONTENT_SPACE); __pContentIconListView->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE); __pContentIconListView->SetItemProvider(*this); - __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_RIGHT); + __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT); __pContentIconListView->AddIconListViewItemEventListener(*this); __pContentIconListView->SetTouchAnimationEnabled(false); AddControl(*__pContentIconListView); @@ -200,7 +200,7 @@ AllListEditorPanel::OnUpdateContentList() TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.", GetErrorMessage(GetLastResult())); - if ( pFileListEditorForm->GetFileMoveProgress() == false && __deleteInProgress == false ) + if ( pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false ) { SceneManager* pSceneManager = SceneManager::GetInstance(); pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST)); @@ -563,7 +563,7 @@ void AllListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId) pFileListEditorForm->Invalidate(true); } -void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, result res) +void AllListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res) { __pCheckButton->SetSelected(false); __deleteInProgress = false; @@ -627,6 +627,7 @@ AllListEditorPanel::OnRequestMessage(void) HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter); pDataList->Construct(); + pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS)); pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText)); __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE, diff --git a/src/GlAllListPanel.cpp b/src/GlAllListPanel.cpp index 78ba548..623a1c0 100644 --- a/src/GlAllListPanel.cpp +++ b/src/GlAllListPanel.cpp @@ -40,10 +40,10 @@ using namespace Tizen::Ui::Scenes; static const Rectangle RECT_INITIAL (0, 0, 10, 10); static const int W_CLIENT = 720; -static const int H_CONTENT_MARGIN = 24; -static const int W_CONTENT_MARGIN = 14; -static const int W_CONTENT_SPACE = 20; -static const int H_CONTENT_SPACE = 24; +static const int H_CONTENT_MARGIN = 9; +static const int W_CONTENT_MARGIN = 6; +static const int W_CONTENT_SPACE = 6; +static const int H_CONTENT_SPACE = 6; AllListPanel::AllListPanel() : __pContentIconListView(null) diff --git a/src/GlAllListSelectionPanel.cpp b/src/GlAllListSelectionPanel.cpp index 73d591c..5e02573 100644 --- a/src/GlAllListSelectionPanel.cpp +++ b/src/GlAllListSelectionPanel.cpp @@ -40,10 +40,10 @@ using namespace Tizen::Ui::Controls; using namespace Tizen::Ui::Scenes; static const int LENGTH_COUNT_LABEL = 256; -static const int H_CONTENT_MARGIN = 24; -static const int W_CONTENT_MARGIN = 14; -static const int W_CONTENT_SPACE = 20; -static const int H_CONTENT_SPACE = 24; +static const int H_CONTENT_MARGIN = 9; +static const int W_CONTENT_MARGIN = 6; +static const int W_CONTENT_SPACE = 6; +static const int H_CONTENT_SPACE = 6; static const Color COLOR_THUMBNAIL_DIM (Color::GetColor(COLOR_ID_BLACK)); static const int ALPHA_THUMBNAIL_DIM = 70; @@ -109,7 +109,7 @@ AllListSelectionPanel::OnInitializing(void) __pContentIconListView->SetItemSpacing(W_CONTENT_SPACE, H_CONTENT_SPACE); __pContentIconListView->SetItemBorderStyle(ICON_LIST_VIEW_ITEM_BORDER_STYLE_NONE); __pContentIconListView->SetItemProvider(*this); - __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_RIGHT); + __pContentIconListView->SetCheckBoxPosition(ICON_LIST_VIEW_CHECK_BOX_POSITION_TOP_LEFT); __pContentIconListView->AddIconListViewItemEventListener(*this); __pContentIconListView->SetTouchAnimationEnabled(false); AddControl(*__pContentIconListView); @@ -125,7 +125,13 @@ void AllListSelectionPanel::OnUpdateContentList() { AppLogDebug("ENTER"); - if ( __deleteInProgress == false ) + SceneManager* pSceneManager = SceneManager::GetInstance(); + FileListEditorForm* pFileListEditorForm = + dynamic_cast(pSceneManager->GetCurrentScene()->GetForm()); + TryReturnVoid(pFileListEditorForm != null, "[%s] fail to get SceneManager.", + GetErrorMessage(GetLastResult())); + + if ( pFileListEditorForm->GetOverlayStatus() == false && __deleteInProgress == false ) { SceneManager* pSceneManager = SceneManager::GetInstance(); pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST)); @@ -482,7 +488,7 @@ void AllListSelectionPanel::OnFileOpInvalidate(enum FileActionMode actionId) pFileListEditorForm->Invalidate(true); } -void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, result res) +void AllListSelectionPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res) { __deleteInProgress = false; SceneManager* pSceneManager = SceneManager::GetInstance(); @@ -550,6 +556,7 @@ AllListSelectionPanel::OnRequestMessage(void) } HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter); pDataList->Construct(); + pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS)); pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText)); __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE, diff --git a/src/GlBaseForm.cpp b/src/GlBaseForm.cpp new file mode 100644 index 0000000..fe2d430 --- /dev/null +++ b/src/GlBaseForm.cpp @@ -0,0 +1,110 @@ +// +// Copyright (c) 2012 Samsung Electronics Co., Ltd. +// +// Licensed under the Flora License, Version 1.0 (the License); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://floralicense.org/license/ +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an AS IS BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +/** + * @file GlBaseForm.cpp + * @brief This is the implementation file for GlBaseForm class. + */ + +#include +#include +#include +#include + +#include "GlFileListPresentationModel.h" +#include "GlBaseForm.h" + +using namespace Tizen::Base; +using namespace Tizen::Base::Collection; +using namespace Tizen::Ui::Controls; +using namespace Tizen::Base::Utility; + + +IList* BaseForm::GetMoveFileIndexList(String& moveDir, IList* pMoveIndexList, + FileListPresentationModel* pPresentationModel) +{ + + if (&moveDir == null || moveDir.IsEmpty()) + { + AppLogDebug("EXIT 1(%s)", GetErrorMessage(GetLastResult())); + return null; + } + + if (pMoveIndexList == null || pMoveIndexList->GetCount() <= 0) + { + AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult())); + return null; + } + + IList* pCollisionList = pPresentationModel->GetCollisionIndexListN(*pMoveIndexList, moveDir); + + if (pCollisionList != null) + { + int loopCount = pCollisionList->GetCount(); + for (int i = 0; i < loopCount; ++i) + { + String* pCollisionString = const_cast(static_cast(pCollisionList->GetAt(i))); + String tmpString; + + if (pCollisionString != null) + { + tmpString = (*pCollisionString); + } + + String delim(MULTI_ITEM_SEPARATOR); + StringTokenizer st(tmpString, delim); + String token; + + int collisionIndex; + String fileNmae; + + if (st.HasMoreTokens() == true) + { + st.GetNextToken(token); + Integer::Parse(token, collisionIndex); + + if (st.HasMoreTokens() == true) + { + st.GetNextToken(fileNmae); + } + + MessageBox messageBox; + messageBox.Construct(L"", fileNmae + ResourceManager::GetString(L"IDS_MEDIABR_POP_ALREADY_EXISTS_OVERWRITE_Q"), + MSGBOX_STYLE_YESNO, 0); + int modalResult = 0; + __overlayMsg = true; + messageBox.ShowAndWait(modalResult); + __overlayMsg = false; + + if (modalResult == MSGBOX_RESULT_NO) + { + int innerLoopCount = pMoveIndexList->GetCount(); + for (int j = 0; j < innerLoopCount; ++j) + { + if(collisionIndex == (const_cast(static_cast + (pMoveIndexList->GetAt(j))))->ToInt()) + { + pMoveIndexList->RemoveAt(j, true); + --j; + --innerLoopCount; + } + } + } + } + } + } + return pMoveIndexList; +} diff --git a/src/GlCommonUtil.cpp b/src/GlCommonUtil.cpp index 862d300..07637f2 100644 --- a/src/GlCommonUtil.cpp +++ b/src/GlCommonUtil.cpp @@ -30,8 +30,8 @@ using namespace Tizen::Base; using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; -static const int W_DEFAULT_THUMBNAIL = 158; -static const int H_DEFAULT_THUMBNAIL = 158; +static const int W_DEFAULT_THUMBNAIL = 351; +static const int H_DEFAULT_THUMBNAIL = 261; static const int BASE_STANDARD = 1000; static const int FORMAT_TIME = 10; static const String DATETIME_FORMAT = L"%02d:%02d"; diff --git a/src/GlFileDeleteTimer.cpp b/src/GlFileDeleteTimer.cpp index 6726c30..b76c559 100644 --- a/src/GlFileDeleteTimer.cpp +++ b/src/GlFileDeleteTimer.cpp @@ -40,8 +40,9 @@ using namespace Tizen::Ui::Scenes; -FileDeleteTimer::FileDeleteTimer(Tizen::Base::Collection::IList* pDelList, FileListPresentationModel* pPM - , IFileOpInvalidateListener* invalidate) +FileDeleteTimer::FileDeleteTimer(Tizen::Base::Collection::IList* pDelList + , FileListPresentationModel* pPM + , IFileOpInvalidateListener* invalidate) : GlTimerBase(invalidate, FILE_DELETE_ACTION) , __pDeleteIndexList(pDelList) , __pPresentationModel(pPM) @@ -53,24 +54,20 @@ FileDeleteTimer::~FileDeleteTimer(void) delete __pDeleteIndexList; } -IList* -FileDeleteTimer::TimerStart(void) +IList * FileDeleteTimer::TimerStart(void) { return __pPresentationModel->GetContentIdListN(*__pDeleteIndexList); } - -void -FileDeleteTimer::TimerExpired(const ContentId& contentId) +result FileDeleteTimer::TimerExpired(const ContentId& contentId) { - __pPresentationModel->DeleteContentFile(contentId); + return __pPresentationModel->DeleteContentFile(contentId); } - -void -FileDeleteTimer::TimerCancel(void) +void FileDeleteTimer::TimerCancel(int, enum FileActionCancelRes res) { -} -void -FileDeleteTimer::TimerComplete(int) +} +void FileDeleteTimer::TimerComplete(int, enum FileActionCompleteRes res) { + } + diff --git a/src/GlFileListEditorForm.cpp b/src/GlFileListEditorForm.cpp index 7fcc0b2..79d8d3b 100644 --- a/src/GlFileListEditorForm.cpp +++ b/src/GlFileListEditorForm.cpp @@ -48,6 +48,10 @@ static const int H_DELETE_LABEL = 180; static const int Y_DELETE_BUTTON = 180; static const int H_DELETE_BUTTON = 80; +static const unsigned int COLOR_DELETE_BUTTON_NORMAL = Color32<208, 82, 82>::Value; +static const unsigned int COLOR_DELETE_BUTTON_PRESSED = Color32<194, 71, 71>::Value; +static const unsigned int COLOR_DELETE_BUTTON_TEXT = Color32<248, 246, 239>::Value; + FileListEditorForm::FileListEditorForm(void) : __pContextMenuMore(null) , __pContextMenuShare(null) @@ -59,9 +63,9 @@ FileListEditorForm::FileListEditorForm(void) , __pContentDirectoryNameList(null) , __pPresentationModel(null) , __pFileMove(null) - ,__moveInProgress(false) { AppLogDebug("ENTER"); + __overlayMsg = false; AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -149,12 +153,18 @@ FileListEditorForm::InitializeFooter(void) ButtonItem footerMore; footerMore.Construct(BUTTON_ITEM_STYLE_ICON, ACTION_ID_FOOTER_MORE); Bitmap* pBitmapMore = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE); - if (pBitmapMore != null) + Bitmap* pBitmapMoreDim = ResourceManager::GetBitmapN(IDB_CONTROLBAR_MORE_DISABLED); + + if (pBitmapMore != null && pBitmapMoreDim != NULL ) { footerMore.SetIcon(BUTTON_ITEM_STATUS_NORMAL, pBitmapMore); + footerMore.SetIcon(BUTTON_ITEM_STATUS_DISABLED, pBitmapMoreDim); } pFooter->SetButton(BUTTON_POSITION_LEFT,footerMore); + delete pBitmapMore; + delete pBitmapMoreDim; + FooterItem footerShare; r = footerShare.Construct(ACTION_ID_FOOTER_SHARE); TryReturn(r == E_SUCCESS, r, "[%s] Unable to construct footer item", GetErrorMessage(r)); @@ -327,6 +337,7 @@ FileListEditorForm::OnTerminating(void) delete __pDeletePopup; __pDeletePopup = null; } + __overlayMsg = false; AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); return E_SUCCESS; @@ -384,6 +395,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) { __pDeletePopup->SetShowState(true); __pDeletePopup->Show(); + __overlayMsg = true; } } else if (pSceneManager->GetCurrentSceneId() == IDSCN_IMAGE_LIST_EDITOR) @@ -393,6 +405,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) { __pDeletePopup->SetShowState(true); __pDeletePopup->Show(); + __overlayMsg = true; } } else if (pSceneManager->GetCurrentSceneId() == IDSCN_VIDEO_LIST_EDITOR) @@ -402,6 +415,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) { __pDeletePopup->SetShowState(true); __pDeletePopup->Show(); + __overlayMsg = true; } } if (pSceneManager->GetCurrentSceneId() == IDSCN_ALL_LIST_SELECTION) @@ -412,6 +426,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) { __pDeletePopup->SetShowState(true); __pDeletePopup->Show(); + __overlayMsg = true; } } break; @@ -575,6 +590,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) } case ACTION_ID_DELETE_POPUP_DEL: { + __overlayMsg = false; __pDeletePopup->SetShowState(false); __pDeletePopup->Invalidate(true); @@ -627,6 +643,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) } case ACTION_ID_DELETE_POPUP_CANCEL: { + __overlayMsg = false; __pDeletePopup->SetShowState(false); __pDeletePopup->Invalidate(true); break; @@ -674,16 +691,19 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) if (pEditorPanel != null) { delete __pFileMove; - __pFileMove = new FileMoveTimer(*pDirectory, pEditorPanel->GetItemCheckedIndexListN(), + IList* pItemIndexList = pEditorPanel->GetItemCheckedIndexListN(); + GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel); + __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this ); result r = __pFileMove->StartTimer(); if (IsFailed(r)) { delete __pFileMove; __pFileMove = null; - } else + } + else { - __moveInProgress = true; + __overlayMsg = true; } } } @@ -710,7 +730,9 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) if (pSelectionPanel != null) { delete __pFileMove; - __pFileMove = new FileMoveTimer(*pDirectory, pSelectionPanel->GetItemCheckedIndexListN(), + IList* pItemIndexList = pSelectionPanel->GetItemCheckedIndexListN(); + GetMoveFileIndexList(*pDirectory, pItemIndexList, __pPresentationModel); + __pFileMove = new FileMoveTimer(*pDirectory, pItemIndexList, __pPresentationModel, this ); result r = __pFileMove->StartTimer(); if (IsFailed(r)) @@ -720,7 +742,7 @@ FileListEditorForm::OnActionPerformed(const Control& source, int actionId) } else { - __moveInProgress = true; + __overlayMsg = true; } } } @@ -738,22 +760,38 @@ void FileListEditorForm::OnFileOpInvalidate(enum FileActionMode actionId) Invalidate(true); } -bool FileListEditorForm::GetFileMoveProgress() +bool FileListEditorForm::GetOverlayStatus() { - return __moveInProgress; + return __overlayMsg; } -void FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, result res) +void FileListEditorForm::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res) { - __moveInProgress = false; + __overlayMsg = false; + if (res != COMPLETE_SUCCESS) + { + MessageBox messageBox; + messageBox.Construct(L"", L"System error", + MSGBOX_STYLE_OK, 3000); + int modalResult = 0; + __overlayMsg = true; + messageBox.ShowAndWait(modalResult); + __overlayMsg = false; + SceneManager* pSceneManager = SceneManager::GetInstance(); + AppAssert(pSceneManager); + pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST)); + } } void FileListEditorForm::OnUpdateContentList() { AppLogDebug("ENTER"); - SceneManager* pSceneManager = SceneManager::GetInstance(); - pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST)); + if (__overlayMsg == false) + { + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST)); + } AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } @@ -780,12 +818,15 @@ FileListEditorForm::SetUpPopup(void) pLabelText->SetTextHorizontalAlignment(ALIGNMENT_CENTER); __pDeletePopup->AddControl(*pLabelText); - Button* pButtonDel = new (std::nothrow) Button(); - pButtonDel->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), + Button* pDeleteButton = new (std::nothrow) Button(); + pDeleteButton->Construct(Rectangle(0, Y_DELETE_BUTTON, popupClientBounds.width / 2 - GAP_W_POPUP_ITEM, H_DELETE_BUTTON), ResourceManager::GetString(L"IDS_COM_BODY_DELETE")); - pButtonDel->SetActionId(ACTION_ID_DELETE_POPUP_DEL); - pButtonDel->AddActionEventListener(*this); - __pDeletePopup->AddControl(*pButtonDel); + pDeleteButton->SetColor(BUTTON_STATUS_NORMAL, COLOR_DELETE_BUTTON_NORMAL); + pDeleteButton->SetColor(BUTTON_STATUS_PRESSED, COLOR_DELETE_BUTTON_PRESSED); + pDeleteButton->SetTextColor(COLOR_DELETE_BUTTON_TEXT); + pDeleteButton->SetActionId(ACTION_ID_DELETE_POPUP_DEL); + pDeleteButton->AddActionEventListener(*this); + __pDeletePopup->AddControl(*pDeleteButton); Button* pButtonCancel = new (std::nothrow) Button(); pButtonCancel->Construct(Rectangle(popupClientBounds.width / 2 + GAP_W_POPUP_ITEM, Y_DELETE_BUTTON, diff --git a/src/GlFileListForm.cpp b/src/GlFileListForm.cpp index c8ccbec..5838609 100644 --- a/src/GlFileListForm.cpp +++ b/src/GlFileListForm.cpp @@ -40,6 +40,7 @@ FileListForm::FileListForm(void) , __pPresentationModel(null) { AppLogDebug("ENTER"); + __overlayMsg = false; AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); } diff --git a/src/GlFileListPresentationModel.cpp b/src/GlFileListPresentationModel.cpp index 5ed5a9c..4b7bd9d 100644 --- a/src/GlFileListPresentationModel.cpp +++ b/src/GlFileListPresentationModel.cpp @@ -48,22 +48,22 @@ static const int SIZE_CONUNT_PER_PAGE = 3000; static const int SIZE_ICON_LIST_CACHE = 50; static const int W_DURATION_TEXT = 44; static const int H_DURATION_TEXT = 4; -static const int W_DURATION = 158; -static const int H_DURATION = 38; -static const int W_DEFAULT_THUMBNAIL = 158; -static const int H_DEFAULT_THUMBNAIL = 158; -static const int W_WIDE_THUMBNAIL = 172; -static const int H_WIDE_THUMBNAIL = 128; +static const int W_DURATION = 351; +static const int H_DURATION = 41; +static const int W_DEFAULT_THUMBNAIL = 351; +static const int H_DEFAULT_THUMBNAIL = 260; +static const int W_WIDE_THUMBNAIL = 351; +static const int H_WIDE_THUMBNAIL = 220; static const int W_PLAY_FG = 64; static const int H_PLAY_FG = 64; -static const int GAP_W_PLAY_FG = 47; -static const int GAP_H_PLAY_FG = 27; -static const int GAP_H_DURATION = 27+64+28; +static const int GAP_W_PLAY_FG = (W_DEFAULT_THUMBNAIL - W_PLAY_FG)/2 ; +static const int GAP_H_PLAY_FG = (H_DEFAULT_THUMBNAIL - H_PLAY_FG)/2; +static const int GAP_H_DURATION = H_DEFAULT_THUMBNAIL - H_DURATION; static const int ALPHA_DURATION = 70; static const int FONT_SIZE_DURATION = 28; -static const Dimension DIMENSION_REAL_ICON (162,164); -static const Rectangle RECTANGLE_THUMBNAIL_OFFSET_POSION (1, 1, 156, 158); -static const Rectangle RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION (1, 1, 168, 124); +static const Dimension DIMENSION_REAL_ICON (358,260); +static const Rectangle RECTANGLE_THUMBNAIL_OFFSET_POSION (1, 1, 351,260 ); +static const Rectangle RECTANGLE_VIDEO_THUMBNAIL_OFFSET_POSION (1, 1, 351, 220); static const Color COLOR_DURATION_BG (Color::GetColor(COLOR_ID_BLACK)); static const Color COLOR_TEXT_OUTLINE (Color::GetColor(COLOR_ID_WHITE)); @@ -540,7 +540,7 @@ void FileListPresentationModel::CancelThumbnailRequest(const int index) { AppLogDebug("ENTER : index(%d)", index); - ContentInfo* pContentInfo = null; + /*ContentInfo* pContentInfo = null; if (__pContentInfoList != null && index < __pContentInfoList->GetCount()) { @@ -551,7 +551,7 @@ FileListPresentationModel::CancelThumbnailRequest(const int index) return; } __pThumbnailProvider->CancelThumbnailRequest(pContentInfo->GetContentId(), __pThumbnailEvent); - } + }*/ AppLogDebug("EXIT"); } @@ -905,8 +905,6 @@ FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const S File::Remove(destPath); } - result r = E_SUCCESS; - if (pContentInfo->GetContentType() == CONTENT_TYPE_IMAGE) { @@ -914,15 +912,18 @@ FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const S if (r == E_SUCCESS) { ContentManager cntManager; - result rt = cntManager.Construct(); - if (rt == E_SUCCESS) + r = cntManager.Construct(); + if (r == E_SUCCESS) { ImageContentInfo contentInfo; - rt = contentInfo.Construct(&destPath); - if (rt == E_SUCCESS) + r = contentInfo.Construct(&destPath); + if (r == E_SUCCESS) { cntManager.CreateContent(contentInfo); - cntManager.DeleteContent(contentId); + r = GetLastResult(); + TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r)); + r = cntManager.DeleteContent(contentId); + TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r)); } } } @@ -934,18 +935,22 @@ FileListPresentationModel::MoveToContentFile(const ContentId& contentId, const S if (r == E_SUCCESS) { ContentManager cntManager; - result rt = cntManager.Construct(); - if (rt == E_SUCCESS) + r = cntManager.Construct(); + if (r == E_SUCCESS) { VideoContentInfo contentInfo; - rt = contentInfo.Construct(&destPath); + r = contentInfo.Construct(&destPath); { cntManager.CreateContent(contentInfo); - cntManager.DeleteContent(contentId); + r = GetLastResult(); + TryCatch(!IsFailed(r),,"CreateContent::the value is %s",GetErrorMessage(r)); + r = cntManager.DeleteContent(contentId); + TryCatch(!IsFailed(r),,"DeleteContent::the value is %s",GetErrorMessage(r)); } } } } + CATCH: delete pContentInfo; pContentInfo = null; } diff --git a/src/GlFileMoveTimer.cpp b/src/GlFileMoveTimer.cpp index 537643a..ca79e3c 100644 --- a/src/GlFileMoveTimer.cpp +++ b/src/GlFileMoveTimer.cpp @@ -37,22 +37,22 @@ using namespace Tizen::Ui; using namespace Tizen::Ui::Controls; using namespace Tizen::Ui::Scenes; -FileMoveTimer::FileMoveTimer(String& destDirectory, IList* list , FileListPresentationModel* presentationModel +FileMoveTimer::FileMoveTimer(String& destDirectory, IList* list + , FileListPresentationModel* presentationModel , IFileOpInvalidateListener* pInvalidate) - : GlTimerBase(pInvalidate, FILE_MOVE_ACTION) - , __pMoveIndexList(list) - ,__moveToDir(destDirectory) - ,__pPresentationModel(presentationModel) + : GlTimerBase(pInvalidate, FILE_MOVE_ACTION) + , __pMoveIndexList(list) + ,__moveToDir(destDirectory) + ,__pPresentationModel(presentationModel) + { } - FileMoveTimer::~FileMoveTimer(void) { delete __pMoveIndexList; } -IList* -FileMoveTimer::TimerStart(void) +IList * FileMoveTimer::TimerStart(void) { AppLogDebug("ENTER"); if (&__moveToDir == null || __moveToDir.IsEmpty()) @@ -66,64 +66,6 @@ FileMoveTimer::TimerStart(void) AppLogDebug("EXIT 2(%s)", GetErrorMessage(GetLastResult())); return null; } - - IList* pCollisionList = __pPresentationModel->GetCollisionIndexListN(*__pMoveIndexList, __moveToDir); - - if (pCollisionList != null) - { - int loopCount = pCollisionList->GetCount(); - for (int i = 0; i < loopCount; ++i) - { - String* pCollisionString = const_cast(static_cast(pCollisionList->GetAt(i))); - String tmpString; - - if (pCollisionString != null) - { - tmpString = (*pCollisionString); - } - - String delim(MULTI_ITEM_SEPARATOR); - StringTokenizer st(tmpString, delim); - String token; - - int collisionIndex; - String fileNmae; - - if (st.HasMoreTokens() == true) - { - st.GetNextToken(token); - Integer::Parse(token, collisionIndex); - - if (st.HasMoreTokens() == true) - { - st.GetNextToken(fileNmae); - } - - MessageBox messageBox; - messageBox.Construct(L"", fileNmae + ResourceManager::GetString(L"IDS_MEDIABR_POP_ALREADY_EXISTS_OVERWRITE_Q"), - MSGBOX_STYLE_YESNO, 0); - int modalResult = 0; - messageBox.ShowAndWait(modalResult); - - if (modalResult == MSGBOX_RESULT_NO) - { - int innerLoopCount = __pMoveIndexList->GetCount(); - for (int j = 0; j < innerLoopCount; ++j) - { - if(collisionIndex == (const_cast(static_cast - (__pMoveIndexList->GetAt(j))))->ToInt()) - { - __pMoveIndexList->RemoveAt(j, true); - --j; - --innerLoopCount; - } - } - } - } - } - delete pCollisionList; - } - if ( __pMoveIndexList->GetCount() > 0 ) { if (File::IsFileExist(__moveToDir) == false) @@ -132,29 +74,43 @@ FileMoveTimer::TimerStart(void) } AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult())); return __pPresentationModel->GetContentIdListN(*__pMoveIndexList); - } else { return null; } + } -void -FileMoveTimer::TimerExpired(const ContentId& contentId) +result FileMoveTimer::TimerExpired(const ContentId& contentId) { AppLogDebug("ENTER"); - __pPresentationModel->MoveToContentFile(contentId, __moveToDir); - AppLogDebug("EXIT"); + return __pPresentationModel->MoveToContentFile(contentId, __moveToDir); } -void -FileMoveTimer::TimerCancel(void) +void FileMoveTimer::TimerCancel(int, enum FileActionCancelRes res) { + AppLogDebug("ENTER"); + if( res == CANCEL_USER ) + { + String albumName = __pPresentationModel->ConvertToAlbumName(__moveToDir); + + if (albumName != EMPTY_SPACE) + { + IList* pDirectoryList = new (std::nothrow) ArrayList(SingleObjectDeleter); + pDirectoryList->Add(new (std::nothrow) String(__moveToDir)); + __pPresentationModel->SetCurrentAlbumInfo(albumName, *pDirectoryList); + __pPresentationModel->SetCurrentAlbumContentType(CONTENT_TYPE_ALL); + delete pDirectoryList; + + SceneManager* pSceneManager = SceneManager::GetInstance(); + pSceneManager->GoForward(ForwardSceneTransition(IDSCN_ALL_LIST)); + } + } + AppLogDebug("EXIt"); } -void -FileMoveTimer::TimerComplete(int) +void FileMoveTimer::TimerComplete(int, enum FileActionCompleteRes res) { AppLogDebug("ENTER"); String albumName = __pPresentationModel->ConvertToAlbumName(__moveToDir); @@ -172,3 +128,4 @@ FileMoveTimer::TimerComplete(int) } AppLogDebug("EXIt"); } + diff --git a/src/GlImageListEditorPanel.cpp b/src/GlImageListEditorPanel.cpp index ca3dd27..e8aad62 100644 --- a/src/GlImageListEditorPanel.cpp +++ b/src/GlImageListEditorPanel.cpp @@ -603,7 +603,7 @@ void ImageListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId) pFileListEditorForm->Invalidate(true); } -void ImageListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, result res) +void ImageListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res) { if ( actionId == FILE_DELETE_ACTION ) { @@ -659,8 +659,8 @@ ImageListEditorPanel::OnRequestMessage(void) HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter); pDataList->Construct(); - pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), - new (std::nothrow) String(combineText)); + pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS)); + pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText)); __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE, pDataList, null); diff --git a/src/GlTimerBase.cpp b/src/GlTimerBase.cpp index 8a86fc3..52474c7 100644 --- a/src/GlTimerBase.cpp +++ b/src/GlTimerBase.cpp @@ -27,17 +27,22 @@ using namespace Tizen::Ui; -GlTimerBase::GlTimerBase(IFileOpInvalidateListener* invalidateListener, enum FileActionMode actionId) +GlTimerBase::GlTimerBase(IFileOpInvalidateListener* invalidateListener, + enum FileActionMode actionId) : __pInvalidate(invalidateListener) , __actionId(actionId) { + } GlTimerBase::~GlTimerBase(void) { AppLogDebug("ENTER"); __pInvalidate = null; - __moveTimer.Cancel(); + if (__pContentIdList != null && __pContentIdList->GetCount() > 0 ) + { + __moveTimer.Cancel(); + } delete __pContentIdList; AppLogDebug("ENTER"); } @@ -65,7 +70,7 @@ void GlTimerBase::CancelTimer(void) { AppLogDebug("ENTER"); __moveTimer.Cancel(); - OnOpCancelled(); + OnOpCancelled(CANCEL_USER); __moveToCount = 0; AppLogDebug("EXIT"); } @@ -82,7 +87,13 @@ void GlTimerBase::OnTimerExpired(Timer& timer) ContentId* pContentId = static_cast(__pContentIdList->GetAt(__moveToCount)); if (pContentId != null) { - TimerExpired(*pContentId); + result r = TimerExpired(*pContentId); + if ( IsFailed(r) ) + { + AppLogDebug("OnTimerExpired EXIT(%s)", GetErrorMessage(r)); + OnOpCancelled(CANCEL_SYS_ERROR); + return; + } } __moveToCount++; __pMoveProBar->IncProgress( __moveToCount ); @@ -95,7 +106,7 @@ void GlTimerBase::OnTimerExpired(Timer& timer) else { __moveTimer.Cancel(); - OnOpComplete(); + OnOpComplete(COMPLETE_SUCCESS); __moveToCount = 0; } } @@ -117,34 +128,56 @@ GlTimerBase::OnActionPerformed(const Control& source, int actionId) } } -void GlTimerBase::OnOpCancelled(void) + +void GlTimerBase::OnOpCancelled(enum FileActionCancelRes res) { AppLogDebug("ENTER"); + __pMoveProBar->HideFileProgressingPopup(); + if (__pInvalidate) + { + __pInvalidate->OnFileOpInvalidate(__actionId); + } if (__moveToCount > 0) { - OnOpComplete(); + if (__pInvalidate) + { + if ( res != CANCEL_USER) + { + __pInvalidate->OnFileOpComplete(__actionId, COMPLETE_SYS_PARTIAL); + } + else + { + __pInvalidate->OnFileOpComplete(__actionId, COMPLETE_SUCCESS); + } + } } else { - __pMoveProBar->HideFileProgressingPopup(); if (__pInvalidate) { - __pInvalidate->OnFileOpInvalidate(__actionId); - __pInvalidate->OnFileOpComplete(__actionId, true); + if ( res != CANCEL_USER) + { + __pInvalidate->OnFileOpComplete(__actionId, COMPLETE_SYS_FAILURE); + } + else + { + __pInvalidate->OnFileOpComplete(__actionId, COMPLETE_SUCCESS); + } } } + TimerCancel(__moveToCount, res); AppLogDebug("EXIT"); } -void GlTimerBase::OnOpComplete(void) +void GlTimerBase::OnOpComplete(enum FileActionCompleteRes res) { AppLogDebug("ENTER"); __pMoveProBar->HideFileProgressingPopup(); if (__pInvalidate) { __pInvalidate->OnFileOpInvalidate(__actionId); - __pInvalidate->OnFileOpComplete(__actionId, true); + __pInvalidate->OnFileOpComplete(__actionId, res); } - TimerComplete(__moveToCount); + TimerComplete(__moveToCount, res); AppLogDebug("EXIT"); } diff --git a/src/GlTypes.cpp b/src/GlTypes.cpp index fb672d8..5867308 100644 --- a/src/GlTypes.cpp +++ b/src/GlTypes.cpp @@ -89,11 +89,12 @@ const wchar_t* APPCONTROL_DATA_VIDEO = L"video"; const wchar_t* APPCONTROL_DATA_SINGLE = L"single"; const wchar_t* APPCONTROL_DATA_MULTIPLE = L"multiple"; const wchar_t* APPCONTROL_DATA_SLIDE_SHOW = L"slideshow"; +const wchar_t* APPCONTROL_DATA_MMS = L"MMS"; const wchar_t* APPCONTROL_DATA_SELECTION_MODE = L"http://tizen.org/appcontrol/data/selection/mode"; const wchar_t* APPCONTROL_RESULT_KEY_LEGACY_RESULT = L"http://tizen.org/appcontrol/data/legacyresult"; -const Dimension DIMENSION_DEFAULT_THUMBNAIL = Dimension(158,158); +const Dimension DIMENSION_DEFAULT_THUMBNAIL = Dimension(351,261); const int FOLDER_BITMAP_MAX = 7; const wchar_t* EMPTY_SPACE = L""; @@ -132,6 +133,7 @@ const wchar_t* IDB_CONTROLBAR_CAMERA = L"T01_controlbar_icon_camera.png"; const wchar_t* IDB_CONTROLBAR_DELETE = L"T01_controlbar_icon_delete.png"; const wchar_t* IDB_CONTROLBAR_DELETE_DIM = L"T01_toolbar_icon_delete_dim_web.png"; const wchar_t* IDB_CONTROLBAR_MORE = L"T01_controlbar_icon_more.png"; +const wchar_t* IDB_CONTROLBAR_MORE_DISABLED = L"00_icon_more_dim.png"; const wchar_t* IDB_CONTROLBAR_SHARE = L"T01_controlbar_icon_share02.png"; const wchar_t* IDB_CONTROLBAR_SHARE_DIM = L"T01_toolbar_icon_share_dim_web.png"; const wchar_t* IDB_LISTVIEW_EMPTY = L"T01_Nocontents_picture.png"; diff --git a/src/GlVideoListEditorPanel.cpp b/src/GlVideoListEditorPanel.cpp index 5bbcb2b..83a3965 100644 --- a/src/GlVideoListEditorPanel.cpp +++ b/src/GlVideoListEditorPanel.cpp @@ -736,7 +736,7 @@ void VideoListEditorPanel::OnFileOpInvalidate(enum FileActionMode actionId) pFileListEditorForm->Invalidate(true); } -void VideoListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, result res) +void VideoListEditorPanel::OnFileOpComplete(enum FileActionMode actionId, enum FileActionCompleteRes res) { if ( actionId == FILE_DELETE_ACTION ) { @@ -790,8 +790,8 @@ VideoListEditorPanel::OnRequestMessage(void) HashMap* pDataList = new (std::nothrow) HashMap(SingleObjectDeleter); pDataList->Construct(); - pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), - new (std::nothrow) String(combineText)); + pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_TYPE), new (std::nothrow) String(APPCONTROL_DATA_MMS)); + pDataList->Add(new (std::nothrow) String(APPCONTROL_KEY_ATTACHMENTS), new (std::nothrow) String(combineText)); __pPresentationModel->StartAppControl(APPCONTROL_PROVIDER_ID_MESSAGE, APPCONTROL_OPERATION_ID_COMPOSE, pDataList, null);