From: srinivasa.mr Date: Wed, 5 Jun 2013 11:52:35 +0000 (+0900) Subject: Remove MessageBox and replace by Popup X-Git-Tag: 2.2_release~53^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=505676c93fc6a503589589d680b5032389595c8d;p=samples%2Fnative%2FMediaApp.git Remove MessageBox and replace by Popup Change-Id: I8c368bcfcc12210067cd0062133d59e41ca78f1b Signed-off-by: srinivasa.mr --- diff --git a/project/inc/MultiForm.h b/project/inc/MultiForm.h index dd53b5b..3ff0db5 100644 --- a/project/inc/MultiForm.h +++ b/project/inc/MultiForm.h @@ -76,12 +76,11 @@ public: virtual void OnScreenOff(void); virtual void OnDeviceStateChanged(Tizen::System::DeviceType deviceType, const Tizen::Base::String &state); void ShowErrorMessagePopup(String filePath, String Class, const char* pMethod, result r, const char* pSrcfileName, int lineNo, String errorMsg = L""); - void ClearErrorPopup(void); - bool GetErrorPopupState(void) const; - result ShowMessageBox(const char* pTitle, const char* pFormat, ...); + void ShowErrorMessagePopup(String title,unsigned int actionId, const char* pFormat, ...); void ShowMessagePopup(const char* pMessage, unsigned int actionId); void ShowMessagePopup(String title,String message, unsigned int actionId); - + void ClearErrorPopup(void); + bool GetErrorPopupState(void) const; protected: CONST_INT(ID_BUTTON_ERROR_POPUP_OK); diff --git a/project/src/Audio/AudioEqualizerForm.cpp b/project/src/Audio/AudioEqualizerForm.cpp index 5eafb82..cf2358c 100644 --- a/project/src/Audio/AudioEqualizerForm.cpp +++ b/project/src/Audio/AudioEqualizerForm.cpp @@ -635,7 +635,7 @@ AudioEqualizerForm::StartPlay() r = __pPlayer->Play(); if(IsFailed(r)) { - ShowMessageBox("Error", "Play failed\n(%s)", GetErrorMessage(r)); + ShowErrorMessagePopup("Error", ID_ERROR_POPUP, "Play failed\n(%s)", GetErrorMessage(r)); return; } ShowFooterItem(0, false); //ShowFooterItem(int index, bool show). index = 0 for Play and 1 for Stop button. diff --git a/project/src/Audio/AudioInOut.cpp b/project/src/Audio/AudioInOut.cpp index a3a4de3..e24bc77 100644 --- a/project/src/Audio/AudioInOut.cpp +++ b/project/src/Audio/AudioInOut.cpp @@ -665,12 +665,7 @@ AudioInOut::InitializeAudioOut() if (__recordedTime == 0) { AppLog("Clip Too short so reset"); - MessageBox msgBox; - int modalResult = 0; - msgBox.Construct("Warning", "Clip too short so reseting the application", MSGBOX_STYLE_NONE, 3000); - msgBox.ShowAndWait(modalResult); - AppLog("modal Result - %d", modalResult); - Draw(); + ShowMessagePopup("Warning", "Clip too short so application will reset", ID_ERROR_POPUP); return E_INVALID_ARG; } String maxTime; @@ -711,11 +706,7 @@ AudioInOut::InitializeAudioOut() else { AppLog("Clip Too short so reset"); - MessageBox msgBox; - int modalResult = 0; - msgBox.Construct("Warning", "Clip too short so reseting the applicaiton", MSGBOX_STYLE_NONE, 3000); - msgBox.ShowAndWait(modalResult); - AppLog("modal Result - %d", modalResult); + ShowMessagePopup("Warning", "Clip too short so application will reset", ID_ERROR_POPUP); return E_INVALID_ARG; } } diff --git a/project/src/Audio/TonePlayerForm.cpp b/project/src/Audio/TonePlayerForm.cpp index 99e1a50..fc818f1 100644 --- a/project/src/Audio/TonePlayerForm.cpp +++ b/project/src/Audio/TonePlayerForm.cpp @@ -337,7 +337,7 @@ TonePlayerForm::OnInitializing(void) //Tone list is constructed & added. //Tones A,B,C,D not added in UI so ignoring those enums. r = __toneList.Construct(toneCount + 1); - TryCatch(r == E_SUCCESS, ShowMessageBox("Error", "__toneList Construct failed\n(%s)", GetErrorMessage(r)), "__toneList Construct failed"); + TryCatch(r == E_SUCCESS, ShowErrorMessagePopup("Error", ID_POPUP_CLEAR, "__toneList Construct failed\n(%s)", GetErrorMessage(r)), "__toneList Construct failed"); __pTones = new (std::nothrow) Tone[toneCount + 1]; TryCatch(__pTones != null, r = E_OUT_OF_MEMORY, "__pTones could not be created\n(%s)", GetErrorMessage(r)); diff --git a/project/src/Codec/AudioDecoderForm.cpp b/project/src/Codec/AudioDecoderForm.cpp index a1a04c0..82a2f94 100644 --- a/project/src/Codec/AudioDecoderForm.cpp +++ b/project/src/Codec/AudioDecoderForm.cpp @@ -148,7 +148,7 @@ AudioDecoderForm::ShowError(result r, const char* pMethod, const char* pSrcfileN { pErrorString = reinterpret_cast (pByteBuffer->GetPointer()); } - ShowMessageBox( GetErrorMessage(r), pErrorString); + ShowErrorMessagePopup(GetErrorMessage(GetLastResult()), ID_ERROR_POPUP, pErrorString); __showErrorCalled = true; delete pByteBuffer; __inErrorState = false; @@ -618,7 +618,9 @@ AudioDecoderForm::OnActionPerformed(const Tizen::Ui::Control& source, int action } } break; - + case ID_ERROR_POPUP: + ClearErrorPopup(); + break; default: break; } diff --git a/project/src/Codec/AudioDecoderForm.h b/project/src/Codec/AudioDecoderForm.h index 898997b..f3eb8ca 100644 --- a/project/src/Codec/AudioDecoderForm.h +++ b/project/src/Codec/AudioDecoderForm.h @@ -117,6 +117,8 @@ private: PLAY_STATE_STOP, PLAY_STATE_ERROR }; + CONST_INT(ID_ERROR_POPUP); + Tizen::Ui::Controls::Progress* __pProgressBar; Tizen::Ui::Controls::EditArea* __pEditFileInformations; Tizen::Base::String __filename; diff --git a/project/src/Codec/AudioEncoderForm.cpp b/project/src/Codec/AudioEncoderForm.cpp index 6a25681..5adc4c0 100644 --- a/project/src/Codec/AudioEncoderForm.cpp +++ b/project/src/Codec/AudioEncoderForm.cpp @@ -177,7 +177,7 @@ AudioEncoderForm::ShowError(result r, const char* pMethod, const char* pSrcfileN { pErrorString = (char*) pByteBuffer->GetPointer(); } - ShowMessageBox((const char*) GetErrorMessage(r), (const char*) pErrorString); + ShowErrorMessagePopup(GetErrorMessage(r), ID_ERROR_POPUP, pErrorString); __showErrorCalled = true; if (pByteBuffer != null) { @@ -604,7 +604,9 @@ AudioEncoderForm::OnActionPerformed(const Tizen::Ui::Control& source, int action } } break; - + case ID_ERROR_POPUP: + ClearErrorPopup(); + break; default: break; } diff --git a/project/src/Codec/AudioEncoderForm.h b/project/src/Codec/AudioEncoderForm.h index e9e4a2c..ecdd38a 100644 --- a/project/src/Codec/AudioEncoderForm.h +++ b/project/src/Codec/AudioEncoderForm.h @@ -122,6 +122,7 @@ public: virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId); private: + CONST_INT(ID_ERROR_POPUP); enum PlayState { STATE_IDLE, diff --git a/project/src/Codec/VideoDecoderForm.cpp b/project/src/Codec/VideoDecoderForm.cpp index cd2443f..58d402b 100644 --- a/project/src/Codec/VideoDecoderForm.cpp +++ b/project/src/Codec/VideoDecoderForm.cpp @@ -271,7 +271,7 @@ VideoDecoderForm::ShowError(result r, const char* pMethod, const char* pSrcfileN { pErrorString = (char*) pByteBuffer->GetPointer(); } - ShowMessageBox((const char*) GetErrorMessage(r), (const char*) pErrorString); + ShowErrorMessagePopup(GetErrorMessage(r), ID_ERROR_POPUP, pErrorString); __showErrorCalled = true; delete pByteBuffer; __inErrorState = false; @@ -574,7 +574,9 @@ VideoDecoderForm::OnActionPerformed(const Tizen::Ui::Control& source, int action AppLog("VideoDecoderForm VIDEO NEXT is clicked! EXIT \n"); } break; - + case ID_ERROR_POPUP: + ClearErrorPopup(); + break; default: break; } diff --git a/project/src/Codec/VideoDecoderForm.h b/project/src/Codec/VideoDecoderForm.h index cf0beaf..a51ee34 100644 --- a/project/src/Codec/VideoDecoderForm.h +++ b/project/src/Codec/VideoDecoderForm.h @@ -109,6 +109,7 @@ public: virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId); private: + CONST_INT(ID_ERROR_POPUP); enum PlayState { PLAY_STATE_IDLE, diff --git a/project/src/Codec/VideoEncoderForm.cpp b/project/src/Codec/VideoEncoderForm.cpp index 2e27c1f..632577b 100644 --- a/project/src/Codec/VideoEncoderForm.cpp +++ b/project/src/Codec/VideoEncoderForm.cpp @@ -290,7 +290,7 @@ VideoEncoderForm::ShowError(result r, const char* pMethod, const char* pSrcfileN { pErrorString = (char*) pByteBuffer->GetPointer(); } - ShowMessageBox((const char*) GetErrorMessage(r), (const char*) pErrorString); + ShowErrorMessagePopup(GetErrorMessage(r), ID_ERROR_POPUP, pErrorString); __showErrorCalled = true; delete pByteBuffer; __inErrorState = false; @@ -663,7 +663,9 @@ VideoEncoderForm::OnActionPerformed(const Tizen::Ui::Control& source, int action AppLog("Codec Selection Button is clicked! EXIT \n"); } break; - + case ID_ERROR_POPUP: + ClearErrorPopup(); + break; default: break; } diff --git a/project/src/Codec/VideoEncoderForm.h b/project/src/Codec/VideoEncoderForm.h index 2fa13a7..12983e1 100644 --- a/project/src/Codec/VideoEncoderForm.h +++ b/project/src/Codec/VideoEncoderForm.h @@ -115,6 +115,7 @@ public: virtual void OnSceneDeactivated(const Tizen::Ui::Scenes::SceneId& currentSceneId, const Tizen::Ui::Scenes::SceneId& nextSceneId); private: + CONST_INT(ID_ERROR_POPUP); enum PlayState { STATE_IDLE, diff --git a/project/src/MultiForm.cpp b/project/src/MultiForm.cpp index d218040..6a51b6a 100644 --- a/project/src/MultiForm.cpp +++ b/project/src/MultiForm.cpp @@ -717,6 +717,122 @@ MultiForm::ShowMessagePopup(String title,String message, unsigned int actionId) } void +MultiForm::ShowErrorMessagePopup(String title,unsigned int actionId, const char* pFormat,...) +{ + int orientationStatus = 0; + Rectangle popupLableRect; + int xPos = 0; + int yPos = 0; + va_list ap; + char text[1024]; + String msg; + + va_start(ap, pFormat); + vsnprintf(text, sizeof(text), pFormat, ap); + va_end(ap); + msg = text; + + orientationStatus = GetOrientationStatus(); + + if (orientationStatus == ORIENTATION_STATUS_PORTRAIT || + orientationStatus == ORIENTATION_STATUS_PORTRAIT_REVERSE) + { + _pErrorMessagePopup = new (std::nothrow) Popup; + if (_pErrorMessagePopup == null) + { + goto FAIL; + } + _pErrorMessagePopup->Construct(true, Dimension(ERROR_MESSAGE_POPUP_WIDTH, ERROR_MESSAGE_POPUP_HEIGHT)); + _pErrorMessagePopup->SetTitleText(title); + + _pErrorMessagePopupLabel = new (std::nothrow) Label; + if (_pErrorMessagePopupLabel == null) + { + goto FAIL; + } + + popupLableRect = _pErrorMessagePopup->GetClientAreaBounds(); + + popupLableRect.x = 0; + popupLableRect.y = 0; + + _pErrorMessagePopupLabel->Construct(popupLableRect, L""); + _pErrorMessagePopup->AddControl(*_pErrorMessagePopupLabel); + + _pErrorMessagePopupBtn = new (std::nothrow) Button; + if (_pErrorMessagePopupBtn == null) + { + goto FAIL; + } + + xPos = (popupLableRect.width/2)-(ERROR_MESSAGE_POPUP_BUTTON_W/2); + yPos = (popupLableRect.height - ERROR_MESSAGE_POPUP_BUTTON_H - 20); + + _pErrorMessagePopupBtn->Construct(Rectangle(xPos, yPos, + ERROR_MESSAGE_POPUP_BUTTON_W, + ERROR_MESSAGE_POPUP_BUTTON_H), + L"Ok"); + _pErrorMessagePopupBtn->SetActionId(actionId); + _pErrorMessagePopupBtn->AddActionEventListener(*this); + _pErrorMessagePopup->AddControl(*_pErrorMessagePopupBtn); + + } + else + { + _pErrorMessagePopup = new (std::nothrow) Popup; + if (_pErrorMessagePopup == null) + { + goto FAIL; + } + _pErrorMessagePopup->Construct(true, Dimension(ERROR_MESSAGE_POPUP_LANDSCAPE_WIDTH, ERROR_MESSAGE_POPUP_LANDSCAPE_HEIGHT)); + _pErrorMessagePopup->SetTitleText(L"Error"); + + _pErrorMessagePopupLabel = new (std::nothrow) Label; + if (_pErrorMessagePopupLabel == null) + { + goto FAIL; + } + + popupLableRect = _pErrorMessagePopup->GetClientAreaBounds(); + + popupLableRect.x = 0; + popupLableRect.y = 0; + + _pErrorMessagePopupLabel->Construct(popupLableRect, L""); + _pErrorMessagePopup->AddControl(*_pErrorMessagePopupLabel); + + _pErrorMessagePopupBtn = new (std::nothrow) Button; + if (_pErrorMessagePopupBtn == null) + { + goto FAIL; + } + + xPos = (popupLableRect.width/2)-(ERROR_MESSAGE_POPUP_LANDSCAPE_BUTTON_W/2); + yPos = ERROR_MESSAGE_POPUP_LANDSCAPE_HEIGHT - ERROR_MESSAGE_POPUP_LANDSCAPE_BUTTON_H; + + yPos = (popupLableRect.height - ERROR_MESSAGE_POPUP_LANDSCAPE_BUTTON_H -20); + + _pErrorMessagePopupBtn->Construct(Rectangle(xPos, yPos, + ERROR_MESSAGE_POPUP_LANDSCAPE_BUTTON_W, + ERROR_MESSAGE_POPUP_LANDSCAPE_BUTTON_H), + L"Ok"); + _pErrorMessagePopupBtn->SetActionId(actionId); + _pErrorMessagePopupBtn->AddActionEventListener(*this); + _pErrorMessagePopup->AddControl(*_pErrorMessagePopupBtn); + } + + _pErrorMessagePopupLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT); + _pErrorMessagePopupLabel->SetTextConfig(ERROR_MESSAGE_POPUP_LABEL_TEXT_FONT, LABEL_TEXT_STYLE_NORMAL); + _pErrorMessagePopupLabel->SetText(msg); + _pErrorMessagePopupLabel->RequestRedraw(); + + _pErrorMessagePopup->Show(); + return; +FAIL: + AppLog("MessagePopup Show failed due to OUT_OF_MEMORY"); +} + +void MultiForm::ClearErrorPopup(void) { if (_pErrorMessagePopup != null) @@ -735,25 +851,6 @@ MultiForm::GetErrorPopupState(void) const return _inErrorState; } -result -MultiForm::ShowMessageBox(const char* pTitle, const char* pFormat, ...) -{ - MessageBox msgBox; - va_list ap; - char text[1024]; - String msg; - int ret; - - va_start(ap, pFormat); - vsnprintf(text, sizeof(text), pFormat, ap); - va_end(ap); - msg = text; - - msgBox.Construct(pTitle, msg, MSGBOX_STYLE_OK); - msgBox.ShowAndWait(ret); - return E_SUCCESS; -} - Tizen::Graphics::Rectangle MultiForm::GetClientBounds(Tizen::Ui::Control& ctrl) const { diff --git a/project/src/Player/CaptureVideoForm.cpp b/project/src/Player/CaptureVideoForm.cpp index 24f2ac7..6dfe821 100644 --- a/project/src/Player/CaptureVideoForm.cpp +++ b/project/src/Player/CaptureVideoForm.cpp @@ -382,7 +382,7 @@ CaptureVideoForm::OnActionPerformed(const Tizen::Ui::Control& source, int action void CaptureVideoForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collection::IList* pArgs) { - result r, ret = E_SUCCESS; + result r = E_SUCCESS; int index; AppLog("UserEvent:%d %x", requestId, pArgs); switch (requestId) @@ -404,9 +404,7 @@ CaptureVideoForm::OnUserEventReceivedN(RequestId requestId, Tizen::Base::Collect break; case ID_PLAYER_EOS: - __pLog->Log("\nEOS:%s", GetErrorMessage(ret)); - if (ret != E_SUCCESS) - ShowMessageBox("Error", "Player Error\n(%s)", GetErrorMessage(ret)); + __pLog->Log("EOS"); SendUserEvent(ID_RESET, 0); SAFE_DELETE(pArgs); @@ -662,7 +660,6 @@ CaptureVideoForm::OpenMediaContent(const Tizen::Base::String& path, bool async) CATCH: if (IsFailed(r)) { - //ShowErrorMessageBox(path, L"Media content open failed"); ShowMessagePopup(String(L"Error"), String("Media content open failed\n") + String(GetErrorMessage(r)), ID_ERROR_POPUP); } return r; diff --git a/project/src/Player/PlayerForm.cpp b/project/src/Player/PlayerForm.cpp index 5cadf4b..732bb69 100644 --- a/project/src/Player/PlayerForm.cpp +++ b/project/src/Player/PlayerForm.cpp @@ -30,20 +30,6 @@ using namespace Tizen::Graphics; #define MEDIA_PLAYER_SECTION_NAME L"MediaPlayer" -static const int ERROR_MESSAGE_POPUP_WIDTH = 400; -static const int ERROR_MESSAGE_POPUP_HEIGHT = 480; - -static const int ERROR_MESSAGE_POPUP_BUTTON_X = 150; -static const int ERROR_MESSAGE_POPUP_BUTTON_Y = 336; -static const int ERROR_MESSAGE_POPUP_BUTTON_W = 100; -static const int ERROR_MESSAGE_POPUP_BUTTON_H = 60; - -static const int ERROR_MESSAGE_POPUP_LABEL_X = 0; -static const int ERROR_MESSAGE_POPUP_LABEL_Y = 0; -static const int ERROR_MESSAGE_POPUP_LABEL_W = 395; -static const int ERROR_MESSAGE_POPUP_LABEL_H = 300; -static const int ERROR_MESSAGE_POPUP_LABEL_TEXT_FONT = 30; - static const int MIN_PERCENT_COUNT = 0; static const int PROGRESS_TIMER_DURATION = 250; static const int DEFAULT_VOLUME_LEVEL = 100; @@ -270,16 +256,6 @@ PlayerForm::Activate(void* pParam) return E_SUCCESS; } -void -PlayerForm::ShowErrorMessageBox(String strText1, String strText2) -{ - MessageBox messageBox; - messageBox.Construct(strText1, strText2, MSGBOX_STYLE_NONE, 2000); - int modalResult = 0; - messageBox.ShowAndWait(modalResult); - return; -} - result PlayerForm::GetFilePathFromConfig(void) { @@ -331,90 +307,6 @@ PlayerForm::GetFilePathFromConfig(void) } void -PlayerForm::ShowErrorMessagePopup(String Class, const char* method, result r, const char* srcfileName, int lineNo, String errorMsg) -{ - String errorMessage; - - if (__inErrorState == true) - { - AppLog("Already in the error state"); - return; - } - - __inErrorState = true; - AppLog("ShowErrorMessagePopup"); - __pPopupMessage = new (std::nothrow) Popup; - __pPopupMessage->Construct(true, Dimension(ERROR_MESSAGE_POPUP_WIDTH, ERROR_MESSAGE_POPUP_HEIGHT)); - __pPopupMessage->SetTitleText(L"Error"); - - __pErrorMessagePopupLabel = new (std::nothrow) Label; - __pErrorMessagePopupLabel->Construct(Rectangle(ERROR_MESSAGE_POPUP_LABEL_X, - ERROR_MESSAGE_POPUP_LABEL_Y, - ERROR_MESSAGE_POPUP_LABEL_W, - ERROR_MESSAGE_POPUP_LABEL_H), L""); - __pPopupMessage->AddControl(*__pErrorMessagePopupLabel); - - __pErrorMessagePopupBtn = new (std::nothrow) Button; - __pErrorMessagePopupBtn->Construct(Rectangle(ERROR_MESSAGE_POPUP_BUTTON_X, - ERROR_MESSAGE_POPUP_BUTTON_Y, - ERROR_MESSAGE_POPUP_BUTTON_W, - ERROR_MESSAGE_POPUP_BUTTON_H), - L"Ok"); - __pErrorMessagePopupBtn->SetActionId(ID_BUTTON_ERROR_POPUP_OK); - __pErrorMessagePopupBtn->AddActionEventListener(*this); - - __pPopupMessage->AddControl(*__pErrorMessagePopupBtn); - - __pPopupMessage->SetShowState(true); - - errorMessage.Append(L"Path:"); - errorMessage.Append(__relativePath); - errorMessage.Append('\n'); - errorMessage.Append(L"Class:"); - errorMessage.Append(Class); - errorMessage.Append('\n'); - errorMessage.Append(L"Method:"); - errorMessage.Append(method); - errorMessage.Append('\n'); - errorMessage.Append(L"Error:"); - if (errorMsg.GetLength()) - { - errorMessage.Append(errorMsg); - } - else - { - errorMessage.Append(GetErrorMessage(r)); - } - errorMessage.Append('\n'); - errorMessage.Append(L"File:"); - errorMessage.Append(srcfileName); - errorMessage.Append('\n'); - errorMessage.Append(L"Line:"); - errorMessage.Append(lineNo); - - __pErrorMessagePopupLabel->SetTextHorizontalAlignment(ALIGNMENT_LEFT); - __pErrorMessagePopupLabel->SetTextConfig(ERROR_MESSAGE_POPUP_LABEL_TEXT_FONT, LABEL_TEXT_STYLE_NORMAL); - __pErrorMessagePopupLabel->SetText(errorMessage); - __pErrorMessagePopupLabel->Draw(); - - r = __pPopupMessage->Show(); - AppLog("__pPopupMessage Show: %s", GetErrorMessage(r)); -} - -void -PlayerForm::ClearErrorMessagePopup(void) -{ - AppLog("Enter "); - if (__pPopupMessage != null) - { - __pPopupMessage->RemoveAllControls(); - __pPopupMessage->SetShowState(false); - SAFE_DELETE(__pPopupMessage); - } - __inErrorState = false; -} - -void PlayerForm::RefreshButtonTexts(void) { AppLog("Enter "); @@ -589,13 +481,13 @@ PlayerForm::TogglePlayPause(void) r = __pPlayer->Play(); if (r == E_DEVICE_BUSY) { - ShowMessageBox("Error", "Play failed\n(%s)\n%ls", GetErrorMessage(r), __filePath.GetPointer()); + ShowErrorMessagePopup("Error", ID_ERROR_POPUP, "Play failed\n(%s)\n%ls", GetErrorMessage(r), __filePath.GetPointer()); return; } if (IsFailed(r)) { ShowFooterItem(ID_PLAY - FOOTER_ITEM_BASE, false); - ShowMessageBox("Error", "Play failed\n(%s)\n%ls", GetErrorMessage(r), __filePath.GetPointer()); + ShowErrorMessagePopup("Error", ID_ERROR_POPUP, "Play failed\n(%s)\n%ls", GetErrorMessage(r), __filePath.GetPointer()); return; } @@ -769,7 +661,7 @@ PlayerForm::OnActionPerformed(const Tizen::Ui::Control& source, int actionId) break; case ID_BUTTON_ERROR_POPUP_OK: - ClearErrorMessagePopup(); + ClearErrorPopup(); Draw(); if ((__isPausedInMove == true) && (__pPlayer) && (__pPlayer->GetState() == PLAYER_STATE_PAUSED)) { @@ -834,7 +726,7 @@ PlayerForm::OpenSource(String path) if (IsFailed(r)) { AppLog("pPlayer->OpenFile has failed\n"); - ShowMessageBox("Error", "OpenUrl failed\n(%s)\n%ls", GetErrorMessage(r), __filePath.GetPointer()); + ShowErrorMessagePopup("Error", ID_ERROR_POPUP, "OpenUrl failed\n(%s)\n%ls", GetErrorMessage(r), mediaUri.ToString().GetPointer()); return r; } __isUrlContent = true; @@ -845,7 +737,7 @@ PlayerForm::OpenSource(String path) if (IsFailed(r)) { AppLog("pPlayer->OpenFile has failed\n"); - ShowMessageBox("Error", "OpenFile failed\n(%s)\n%ls", GetErrorMessage(r), __filePath.GetPointer()); + ShowErrorMessagePopup("Error", ID_ERROR_POPUP, "OpenFile failed\n(%s)\n%ls", GetErrorMessage(r),__filePath.GetPointer()); return r; } ShowFooterItem(ID_PLAY - FOOTER_ITEM_BASE, true); @@ -1020,7 +912,7 @@ PlayerForm::OnPlayerSeekCompleted(result r) ShowFooterItem(ID_PLAY - FOOTER_ITEM_BASE, true); if (r != E_SUCCESS) { - ShowErrorMessagePopup(L"PlayerForm", __FUNCTION__, r, __FILE__, __LINE__); + ShowErrorMessagePopup(L"Error", ID_ERROR_POPUP, "SeekTo failed with %s", GetErrorMessage(r)); } if ((__isPausedInMove == true) && (__pPlayer->GetState() == PLAYER_STATE_PAUSED)) { @@ -1247,7 +1139,7 @@ PlayerForm::OnAdjustmentValueChanged(const Tizen::Ui::Control& source, int adjus nCurPercent = __progressCnt; UpdateProgressBar(nCurPercent); } - ShowErrorMessagePopup(L"PlayerForm", __FUNCTION__, r, __FILE__, __LINE__); + ShowErrorMessagePopup(L"Error", ID_ERROR_POPUP, "SeekTo failed with %s", GetErrorMessage(r)); if (__configFileCount == 0) { ShowFooterItem(ID_PREV - FOOTER_ITEM_BASE, false); diff --git a/project/src/Player/PlayerForm.h b/project/src/Player/PlayerForm.h index c43a72b..16e4cb1 100644 --- a/project/src/Player/PlayerForm.h +++ b/project/src/Player/PlayerForm.h @@ -115,7 +115,6 @@ protected: Tizen::Graphics::Bitmap* GetBitmapN(const Tizen::Base::String& path, int W, int H); result ReCreatePlayer(void); result DrawAudioIcon(void); - void ShowErrorMessagePopup(String Class, const char* method, result r, const char* srcfileName, int lineNo, String errorMsg = L""); void ClearErrorMessagePopup(void); static const int FOOTER_ITEM_BASE = 1000; static const int ID_PREV = FOOTER_ITEM_BASE;