From 45d43a0b18e8c2172c0dedf198f3d76885a6f051 Mon Sep 17 00:00:00 2001 From: "chitta.rs" Date: Thu, 2 May 2013 16:03:08 +0530 Subject: [PATCH] NABI_SE issues fixed Change-Id: Ic1e60d650ab32b9a928a62848a02e491de9ef4bb --- inc/MfSubBaseFileManageForm.h | 6 ++++++ src/MfCategorySearch.cpp | 18 ++++++++++++++++++ src/MfCreateFolderForm.cpp | 8 +++++--- src/MfFileManageForm.cpp | 9 +++++++++ src/MfSubBaseFileManageForm.cpp | 24 ++++++++++++++++++++++-- src/MfSubFolderFileListForm.cpp | 9 +++++++++ 6 files changed, 69 insertions(+), 5 deletions(-) diff --git a/inc/MfSubBaseFileManageForm.h b/inc/MfSubBaseFileManageForm.h index 386b923..8d4bd2d 100644 --- a/inc/MfSubBaseFileManageForm.h +++ b/inc/MfSubBaseFileManageForm.h @@ -44,6 +44,7 @@ class SubBaseFileManageForm : public BaseForm + , public Tizen::Io::IFileEventListener /* , public Tizen::Ui::Controls::IIconListViewItemEventListener , public Tizen::Ui::Controls::IScrollEventListener*/ { @@ -191,6 +192,10 @@ protected: void SortArrayList(Tizen::Base::Collection::ArrayList* pArrList); void ToggleFooter(void); + + //IFileEventListener + virtual void OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId); + protected: int _fileCount; int _folderCount; @@ -257,6 +262,7 @@ protected: Tizen::Ui::Controls::Popup* _pDeleteConfirmationPopUp; Tizen::Ui::Controls::Popup* _pFileProgressingPopup; Tizen::Ui::Controls::Progress* _pAnimationProgress; + Tizen::Io::FileEventManager* _pFileEventManager; }; #endif //_MF_FILE_MANAGE_FORM_H_ diff --git a/src/MfCategorySearch.cpp b/src/MfCategorySearch.cpp index f403b2c..a7b5ba2 100644 --- a/src/MfCategorySearch.cpp +++ b/src/MfCategorySearch.cpp @@ -776,6 +776,24 @@ CategorySearch::OnIconListViewItemStateChanged(Tizen::Ui::Controls::IconListView { _pathOfSelectedFile = pDirStr->GetFullFilePath(); + if (_pFileEventManager != null) + { + _pFileEventManager->RemovePath(_pathOfSelectedFile); + delete _pFileEventManager; + _pFileEventManager = null; + } + + + _pFileEventManager = new (std::nothrow)FileEventManager(); + _pFileEventManager->Construct(*this); + + String FileName = pDirStr->GetFileName() + "." + pDirStr->GetFileExtension(); + String parentDirectoryOfSelectedFile = L""; + _pathOfSelectedFile.SubString(0, _pathOfSelectedFile.GetLength() - FileName.GetLength() , parentDirectoryOfSelectedFile); + _fileEventPath = parentDirectoryOfSelectedFile; + _pFileEventManager->AddPath(parentDirectoryOfSelectedFile, FILE_EVENT_TYPE_CREATE | FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_MOVED_TO | FILE_EVENT_TYPE_MOVED_FROM); + + pCustomAppControl = CustomAppControl::GetInstance(); if (pCustomAppControl != null) diff --git a/src/MfCreateFolderForm.cpp b/src/MfCreateFolderForm.cpp index 7d320ef..3995be6 100644 --- a/src/MfCreateFolderForm.cpp +++ b/src/MfCreateFolderForm.cpp @@ -699,7 +699,6 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) int textToCheck = 0; - MessageBox messageBox; Utf8Encoding utf8; @@ -751,6 +750,8 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) { if (currentText.StartsWith(".", 0)) { + MessageBox messageBox; + String invalidCharacterString; String validString; AppResource::GetInstance()->GetString(L"IDS_COM_POP_INVALID_CHARACTERS", invalidCharacterString); @@ -794,6 +795,7 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) { if(specialCharacters.Contains(currentInput[i])) { + MessageBox messageBox; String invalidCharacterString; AppResource::GetInstance()->GetString(L"IDS_COM_POP_INVALID_CHARACTERS", invalidCharacterString); messageBox.Construct(L"", invalidCharacterString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND); @@ -809,6 +811,7 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) AppLogDebug("input length and temp legth is %d %d",inputLength,tempLength); if (inputLength >= tempLength) { + MessageBox messageBox; String maxCharacterString; String currentInputCharacter; int checkByteCount = 0; @@ -816,7 +819,7 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) int currentCharacter = 0; AppResource::GetInstance()->GetString(L"IDS_COM_POP_MAXIMUM_NUMBER_OF_CHARACTERS_REACHED", maxCharacterString); messageBox.Construct(L"", maxCharacterString, MSGBOX_STYLE_NONE, ID_MESSAGE_BOX_TIMEOUT_ONE_SECOND); - messageBox.ShowAndWait(modalResult); + r = messageBox.ShowAndWait(modalResult); currentText = __pEditFieldFolderName->GetText(); for (currentCharacter=0;checkByteCount < tempLength;currentCharacter++) @@ -834,7 +837,6 @@ CreateFolderForm::OnTextValueChanged(const Tizen::Ui::Control& source) } r = __pEditFieldFolderName->GetText().SubString(0,lengthOfFinalString,currentInput); - AppLogDebug("current input is %S",currentInput.GetPointer()); r = __pEditFieldFolderName->SetText(currentInput); __pEditFieldFolderName->ShowKeypad(); return; diff --git a/src/MfFileManageForm.cpp b/src/MfFileManageForm.cpp index e6962cb..ce4d17f 100644 --- a/src/MfFileManageForm.cpp +++ b/src/MfFileManageForm.cpp @@ -33,6 +33,7 @@ using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; +using namespace Tizen::Io; using namespace Tizen::Locales; using namespace Tizen::System; using namespace Tizen::Ui; @@ -315,6 +316,14 @@ FileManageForm::OnSceneActivatedN(const Tizen::Ui::Scenes::SceneId& previousScen __bCheckNullArgs = false; } } + + if(_pFileEventManager == null) + { + _pFileEventManager = new (std::nothrow)FileEventManager(); + _pFileEventManager->Construct(*this); + } + AppLogDebug("current path is %ls",FolderNavigationPresentationModel::GetCurrentPath().GetPointer()); + r = _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE | FILE_EVENT_TYPE_MOVED_FROM); AppLogDebug("Exit %s", GetErrorMessage(r)); return; diff --git a/src/MfSubBaseFileManageForm.cpp b/src/MfSubBaseFileManageForm.cpp index 1512c5e..2a04af6 100644 --- a/src/MfSubBaseFileManageForm.cpp +++ b/src/MfSubBaseFileManageForm.cpp @@ -33,6 +33,7 @@ using namespace Tizen::Base; using namespace Tizen::Base::Collection; using namespace Tizen::Base::Runtime; using namespace Tizen::Graphics; +using namespace Tizen::Io; using namespace Tizen::Locales; using namespace Tizen::System; using namespace Tizen::Ui; @@ -72,12 +73,14 @@ SubBaseFileManageForm::SubBaseFileManageForm(void) , _pDeleteConfirmationPopUp(null) , _pFileProgressingPopup(null) , _pAnimationProgress(null) + ,_pFileEventManager(null) { _fileCount = 0; _fileProcessedCount = 0; _folderCount = 0; _renameItemIndex = 0; _editOrShare = FILE_MANAGE_EDIT; + } SubBaseFileManageForm::~SubBaseFileManageForm(void) @@ -130,6 +133,11 @@ SubBaseFileManageForm::~SubBaseFileManageForm(void) { delete _pBaseItemProvider; } + if(_pFileEventManager != null) + { + delete _pFileEventManager; + _pFileEventManager = null; + } AppLogDebug("Exit %s", GetErrorMessage(GetLastResult())); } @@ -197,6 +205,8 @@ SubBaseFileManageForm::SubBaseOnActionPerformed(const Tizen::Ui::Control& source { if (_pFileManager->GetCheckedListCount() > 0) { + _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath()); + AppLogDebug("remove path result %s",GetErrorMessage(GetLastResult())); SetFooterVisibility(DISABLE_FOOTER_ITEM); ShowFileProgressingPopup(); DeleteFile(); @@ -566,6 +576,9 @@ SubBaseFileManageForm::SubBaseOnListViewItemStateChanged(ListView& listView, int listView.SetItemChecked(index, false); } + _pFileEventManager->RemovePath(FolderNavigationPresentationModel::GetCurrentPath()); + delete _pFileEventManager; + _pFileEventManager = null; LoadRenameForm(index); return; @@ -1338,7 +1351,7 @@ SubBaseFileManageForm::SubBaseOnNotificationReceived(Tizen::Base::Collection::Ar case FILE_MANAGING_RESULT_DELETING_SUCCESS: { HideFileProgressingPopup(); - + _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE); if (_pFileManager != null) _pFileManager->ClearCheckedList(); @@ -1364,7 +1377,7 @@ SubBaseFileManageForm::SubBaseOnNotificationReceived(Tizen::Base::Collection::Ar case FILE_MANAGING_RESULT_DELETING_FAILED: { HideFileProgressingPopup(); - + _pFileEventManager->AddPath(FolderNavigationPresentationModel::GetCurrentPath(),FILE_EVENT_TYPE_DELETE); String deleteFailed; AppResource* pAppResource = null; pAppResource = Application::GetInstance()->GetAppResource(); @@ -1753,3 +1766,10 @@ SubBaseFileManageForm::ToggleFooter(void) } _pFooter->Invalidate(true); } + +void +SubBaseFileManageForm::OnFileEventOccured(const unsigned long events,const Tizen::Base::String & path, const unsigned int eventId) +{ + AppLogDebug("Enter %ld",events); + SceneManager::GetInstance()->GoBackward(BackwardSceneTransition(SCENE_TRANSITION_ANIMATION_TYPE_RIGHT)); +} diff --git a/src/MfSubFolderFileListForm.cpp b/src/MfSubFolderFileListForm.cpp index c2fe438..f85f35f 100644 --- a/src/MfSubFolderFileListForm.cpp +++ b/src/MfSubFolderFileListForm.cpp @@ -48,6 +48,13 @@ SubFolderFileListForm::SubFolderFileListForm(void) SubFolderFileListForm::~SubFolderFileListForm(void) { DeviceManager::RemoveDeviceEventListener(DEVICE_TYPE_STORAGE_CARD,*this); + if(_pFileEventManager != null) + { + _pFileEventManager->RemovePath(__currentDirectoryPath); + delete _pFileEventManager; + _pFileEventManager = null; + } + if (__pHomeButton != null) { delete __pHomeButton; @@ -696,6 +703,8 @@ SubFolderFileListForm::OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& curr if(_pFileEventManager != null) { _pFileEventManager->RemovePath(__currentDirectoryPath); + delete _pFileEventManager; + _pFileEventManager = null; } } -- 2.7.4