#define _IV_IMAGE_NAME_EDITOR_FORM_H_
#include <FUi.h>
+#include <IvFileUpdateEventListener.h>
class ImageViewerPresentationModel;
class ImageNameEditorForm
- : public Tizen::Ui::Controls::Form
+ : public IFileUpdateEventListener
+ , public Tizen::Ui::Controls::Form
, public Tizen::Ui::Controls::IFormBackEventListener
, public Tizen::Ui::IActionEventListener
, public Tizen::Ui::IOrientationEventListener
virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId,
const Tizen::Ui::Scenes::SceneId& nextSceneId);
+ virtual void OnFormFileEventOccuered(const int index, const unsigned long eventId);
+
private:
int __currentIndex;
int __modalMsgBoxResult;
destFilePath.Insert(count, destFilePath.GetLength() - index - 1);
}
}
- r = pCropBuffer->EncodeToFile(destFilePath, IMG_FORMAT_JPG, true, 100);
+ r = pCropBuffer->EncodeToFile(destFilePath, IMG_FORMAT_JPG, true, 100);
ContentManager::ScanFile(destFilePath);
Contact* pContact = null;
AddressbookManager* pAddressbookManager = AddressbookManager::GetInstance();
Addressbook* pAddressbook = null;
pAddressbook = pAddressbookManager->GetAddressbookN(DEFAULT_ADDRESSBOOK_ID);
- pContact = pAddressbook->GetContactN(__contentId);
- pContact->SetThumbnail(destFilePath);
- pAddressbook->UpdateContact(*pContact);
-
- delete pContact;
- delete pAddressbook;
+ if (pAddressbook != null)
+ {
+ pContact = pAddressbook->GetContactN(__contentId);
+ if (pContact != null)
+ {
+ pContact->SetThumbnail(destFilePath);
+ pAddressbook->UpdateContact(*pContact);
+ delete pContact;
+ }
+ delete pAddressbook;
+ }
delete pCropBuffer;
ArrayList* pList = new (std::nothrow) ArrayList(SingleObjectDeleter);
__pNameEditField->SetText(__nameEditFieldText);
__nameEditFieldTempText = __nameEditFieldText;
__pNameEditField->AddActionEventListener(*this);
-
+ __pPresentationModel->AddFileUpdateListener(this);
AppLogDebug("EXIT(%s)", GetErrorMessage(GetLastResult()));
return E_SUCCESS;
{
case IDA_BUTTON_EDITFIELD_SAVE:
inputString = __nameEditFieldText;
- inputString.Trim();
if (__nameEditFieldPreText == inputString)
{
pSceneManager->GoBackward(BackwardSceneTransition());
}
+
+void
+ImageNameEditorForm::OnFormFileEventOccuered(const int index, const unsigned long eventId)
+{
+ SceneManager* pSceneManager = SceneManager::GetInstance();
+ pSceneManager->GoBackward(BackwardSceneTransition());
+}