bool GetErrorPopupState(void) const;
result ShowMessageBox(const char* pTitle, const char* pFormat, ...);
void ShowMessagePopup(const char* pMessage, unsigned int actionId);
+ void ShowMessagePopup(String title,String message, unsigned int actionId);
protected:
CONST_INT(ID_BUTTON_ERROR_POPUP_OK);
AppLog("MessagePopup Show failed due to OUT_OF_MEMORY");
}
+
+void
+MultiForm::ShowMessagePopup(String title,String message, unsigned int actionId)
+{
+ int orientationStatus = 0;
+ Rectangle popupLableRect;
+ int xPos = 0;
+ int yPos = 0;
+
+ 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(message);
+ _pErrorMessagePopupLabel->RequestRedraw();
+
+ _pErrorMessagePopup->Show();
+ return;
+ FAIL:
+ AppLog("MessagePopup Show failed due to OUT_OF_MEMORY");
+}
+
void
MultiForm::ClearErrorPopup(void)
{
return E_SUCCESS;
}
-void
-MultiPlayForm::ShowErrorMessageBox(String strText1, String strText2)
-{
- MessageBox messageBox;
- messageBox.Construct(strText1, strText2, MSGBOX_STYLE_NONE, 2000);
- int modalResult = 0;
- messageBox.ShowAndWait(modalResult);
- return;
-}
-
result
MultiPlayForm::GetFilePathFromConfigAndOpen()
{
if (IsFailed(r))
{
AppLog(" Construct has failed r = %d", GetErrorMessage(r));
- ShowErrorMessageBox(strTemp, L"Player construct Failed");
+ ShowMessagePopup(String(L"Error"), String(L"Player Construct failed"), ID_ERROR_POPUP);
__nTotalPlayCount = __nTotalPlayCount - 1;
__pListMenu->SetItemChecked(index, false);
__pListMenu->RequestRedraw();
if (IsFailed(r))
{
AppLog(" OpenFile has failed r = %d", GetErrorMessage(r));
- ShowErrorMessageBox(strTemp, L"Open Failed");
+ ShowMessagePopup(String(L"Error"), String(L"OpenFile failed"), ID_ERROR_POPUP);
SAFE_DELETE(__pPlayer[nCurPlayerVal]);
return r;
}
if (IsFailed(r))
{
AppLog("Play has failed r = %d", GetErrorMessage(r));
- ShowErrorMessageBox(strTemp, L"Play Failed");
+ ShowMessagePopup(String(L"Error"), String(L"Play Failed"), ID_ERROR_POPUP);
SAFE_DELETE(__pPlayer[nCurPlayerVal]);
return r;
}
case ID_RESUME:
ResumePlayback();
break;
+ case ID_ERROR_POPUP:
+ __isWarningShown = false;
+ ClearErrorPopup();
+ Draw();
+ break;
+ default:
+ break;
}
}
if (!__isWarningShown)
{
__isWarningShown = true;
- ShowMessageBox("Info", "Press Resume to Resume playback");
+ ShowMessagePopup(String(L"Info"), String(L"Press Resume to Resume playback"), ID_ERROR_POPUP);
+ RemoveFooterItem(INDEX_RESUME);
AddFooterItem(L"Resume", ID_RESUME);
SetFooterItem(INDEX_RESUME, L"Resume", ID_RESUME);
}
r = pPobj->Play();
if (r == E_DEVICE_BUSY)
{
- ShowErrorMessageBox(L"Warning", L"Device is Busy, try again later");
+ ShowMessagePopup(String(L"Warning"), String(L"Device is Busy, try again later"), ID_ERROR_POPUP);
__isWarningShown = false;
return;
}
else if (r != E_SUCCESS)
{
- String strTemp = _pConfig->GetContentPath(MULTI_PLAY_SECTION_NAME, "srcfile%d", index);
- ShowErrorMessageBox(strTemp, L"Play Failed");
+ ShowMessagePopup(String(L"Error"),String(L"Play Failed"), ID_ERROR_POPUP);
__isWarningShown = false;
return;
}
AppLog("checked enter __nTotalPlayCount = %d", __nTotalPlayCount);
if (__nTotalPlayCount > MAX_PLAY_COUNT)
{
- ShowErrorMessageBox(L"Max Play count of 10 reached", L"");
+ ShowMessagePopup(String("Warning"), String("Max Play count of 10 reached"), ID_ERROR_POPUP);
__nTotalPlayCount = __nTotalPlayCount - 1;
__pListMenu->SetItemChecked(index, false);
__pListMenu->RequestRedraw();
void OnPlayerInterrupted(void);
void OnPlayerReleased(void);
void OnPlayerAudioFocusChanged(void);
- void ShowErrorMessageBox(String strText1, String strText2);
// Called when the application's frame moves to the top of the screen.
virtual void OnForeground(void);
CONST_INT(ID_RESUME);
static const int INDEX_RESET = 0;
static const int INDEX_RESUME = 1;
+ static const int ID_ERROR_POPUP = 0x3142;
Tizen::Ui::Controls::ListView* __pListMenu;
Player* __pPlayer[MAX_PLAY_COUNT];
Tizen::Base::Collection::HashMap __playerIdMap;