Save error value and show the error popup in videorecorder
authorrahul varna <rahul.varna@samsung.com>
Fri, 21 Jun 2013 06:51:44 +0000 (12:21 +0530)
committerrahul varna <rahul.varna@samsung.com>
Fri, 21 Jun 2013 06:51:44 +0000 (12:21 +0530)
Signed-off-by: rahul varna <rahul.varna@samsung.com>
project/src/Recorder/AudioRecorderForm.cpp
project/src/Recorder/VideoRecorderForm.cpp

index 3f31404..0d9e022 100644 (file)
@@ -297,7 +297,12 @@ AudioRecorderForm::AudioRecorderForm(void)
 
 AudioRecorderForm::~AudioRecorderForm(void)
 {
-       SAFE_DELETE(__pContextMenu);
+       if (__pContextMenu)
+       {
+               __pContextMenu->RemoveAllItems();
+               delete __pContextMenu;
+               __pContextMenu = null;
+       }
        SAFE_DELETE(__pPopupMessage);
        SAFE_DELETE(__pPopupQuality);
        SAFE_DELETE(__pPopupCodec);
@@ -429,7 +434,12 @@ AudioRecorderForm::OnInitializing(void)
        return r;
 
 CATCH:
-       SAFE_DELETE(__pContextMenu);
+       if (__pContextMenu)
+       {
+               __pContextMenu->RemoveAllItems();
+               delete __pContextMenu;
+               __pContextMenu = null;
+       }
        SAFE_DELETE(__pAudioRecorder);
        SAFE_DELETE(__pTimer);
        return r;
index 1ba7bde..869fcfe 100644 (file)
@@ -607,6 +607,7 @@ VideoRecorderForm::AddButton(Button** pButtonCtrl, String text, int actionId, Po
        *pButtonCtrl = pCtrl;
        return r;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        SAFE_DELETE(pCtrl);
        return r;
 }
@@ -1000,6 +1001,7 @@ VideoRecorderForm::AddListView(ListView** pListView, Popup* pPopup, int id)
        *pListView = pCtrl;
        return r;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        if (pCtrl != null)
        {
                delete pCtrl;
@@ -1182,6 +1184,7 @@ VideoRecorderForm::CreateItem(int index, int itemWidth)
        return pItem;
 
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        if (pItem != null)
        {
                delete pItem;
@@ -1779,6 +1782,7 @@ VideoRecorderForm::InitCameraRecorder(void)
 
        return r;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        __pVideoRecorder->Cancel();
        __pVideoRecorder->Close();
        return r;
@@ -3013,6 +3017,7 @@ VideoRecorderForm::OnListViewItemStateChanged(Tizen::Ui::Controls::ListView& sou
 
        return;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        if (&source == __pListViewRecordingResolution)
        {
                __pListViewRecordingResolution->Draw();
@@ -4057,6 +4062,7 @@ VideoRecorderForm::CreateVideoCodec(void)
 
        return true;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        DeletePopup(&__pPopupVideoCodec);
        AppLog("%s", GetErrorMessage(r));
        return false;
@@ -4124,6 +4130,7 @@ VideoRecorderForm::CreateAudioCodec(void)
 
        return true;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        DeletePopup(&__pPopupAudioCodec);
        SAFE_DELETE_ARRAYLIST(__pSettingItemArrayList);
        AppLog("%s", GetErrorMessage(r));
@@ -4187,6 +4194,7 @@ VideoRecorderForm::CreateFlip(void)
 
        return true;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        DeletePopup(&__pPopupFlip);
        SAFE_DELETE_ARRAYLIST(__pSettingItemArrayList);
        AppLog("%s", GetErrorMessage(r));
@@ -4260,6 +4268,7 @@ VideoRecorderForm::CreateFileFormat(void)
 
        return true;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        DeletePopup(&__pPopupFileFormat);
        SAFE_DELETE_ARRAYLIST(__pSettingItemArrayList);
        AppLog("%s", GetErrorMessage(r));
@@ -5083,6 +5092,7 @@ VideoRecorderForm::OnAdjustmentValueChanged(const Tizen::Ui::Control& source, in
 
        return;
 CATCH:
+       __cameraError = CAMERA_ERROR_DEVICE_INTERRUPTED;
        AppLog("VideoRecorderForm::OnAdjustmentValueChanged() failed");
        return;
 }
@@ -5809,13 +5819,14 @@ VideoRecorderForm::GetIndexFromValue(Tizen::Base::Collection::IList* pList, Tize
 void
 VideoRecorderForm::ShowFooterItems(void)
 {
-       result r = E_SUCCESS;
+       Footer* pFooter = null;
        EnableFooterItem(ID_SETTING, true);
        EnableFooterItem(ID_TOGGLE_CAMERA_TYPE, true);
        EnableFooterItem(ID_START, true);
-       r = GetFooter()->SetBackButtonEnabled(true);
-       TryReturn(r == E_SUCCESS, ShowError(r, METHOD_FILE_LINENO), "[%s] pFooter->SetBackButtonEnabled", GetErrorMessage(r));
-
-       GetFooter()->Draw();
-       return;
+       pFooter = GetFooter();
+       if (pFooter != null)
+       {
+               pFooter->SetBackButtonEnabled(true);
+               pFooter->Draw();
+       }
 }