Kaydet (Commit) ec2ea6e6 authored tarafından Tor Lillqvist's avatar Tor Lillqvist

Maybe Dialog::Execute() is one good place to call touch_ui_dialog_modal()

Change-Id: I5f1b9fd266d7920a947d3dfb6bcd584e3cc30b53
üst 139bd9b4
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 . * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ */
#include <config_features.h>
#include <com/sun/star/beans/XPropertySet.hpp> #include <com/sun/star/beans/XPropertySet.hpp>
#include <com/sun/star/util/PathSettings.hpp> #include <com/sun/star/util/PathSettings.hpp>
#include <comphelper/processfactory.hxx> #include <comphelper/processfactory.hxx>
...@@ -45,6 +47,10 @@ ...@@ -45,6 +47,10 @@
#include <vcl/unowrap.hxx> #include <vcl/unowrap.hxx>
#include <iostream> #include <iostream>
#if !HAVE_FEATURE_DESKTOP
#include <touch/touch.h>
#endif
// ======================================================================= // =======================================================================
static OString ImplGetDialogText( Dialog* pDialog ) static OString ImplGetDialogText( Dialog* pDialog )
...@@ -884,6 +890,8 @@ void Dialog::ImplEndExecuteModal() ...@@ -884,6 +890,8 @@ void Dialog::ImplEndExecuteModal()
short Dialog::Execute() short Dialog::Execute()
{ {
#if HAVE_FEATURE_DESKTOP
setDeferredProperties(); setDeferredProperties();
if ( !ImplStartExecuteModal() ) if ( !ImplStartExecuteModal() )
...@@ -904,7 +912,7 @@ short Dialog::Execute() ...@@ -904,7 +912,7 @@ short Dialog::Execute()
while ( !aDelData.IsDead() && mbInExecute ) while ( !aDelData.IsDead() && mbInExecute )
Application::Yield(); Application::Yield();
ImplEndExecuteModal(); ImplEndExecutModal();
#ifdef DBG_UTIL #ifdef DBG_UTIL
if( pDialogParent ) if( pDialogParent )
...@@ -927,6 +935,56 @@ short Dialog::Execute() ...@@ -927,6 +935,56 @@ short Dialog::Execute()
long nRet = mpDialogImpl->mnResult; long nRet = mpDialogImpl->mnResult;
mpDialogImpl->mnResult = -1; mpDialogImpl->mnResult = -1;
return (short)nRet; return (short)nRet;
#else
MLODialogKind kind;
switch (GetType())
{
case WINDOW_MESSBOX:
kind = MLODialogMessage;
break;
case WINDOW_INFOBOX:
kind = MLODialogInformation;
break;
case WINDOW_WARNINGBOX:
kind = MLODialogWarning;
break;
case WINDOW_ERRORBOX:
kind = MLODialogError;
break;
case WINDOW_QUERYBOX:
kind = MLODialogQuery;
break;
default:
SAL_WARN("vcl", "Dialog::Execute: Unhandled window type %d" << GetType());
kind = MLODialogInformation;
break;
}
MLODialogResult result = touch_ui_dialog_modal(kind, ImplGetDialogText(this).getStr());
switch (result)
{
case MLODialogOK:
return RET_OK;
case MLODialogCancel:
return RET_CANCEL;
case MLODialogNo:
return RET_NO;
case MLODialogYes:
return RET_YES;
case MLODialogRetry:
return RET_RETRY;
case MLODialogIgnore:
return RET_IGNORE;
default:
SAL_WARN("vcl", "Dialog::Execute: Unhandled dialog result %d" << result);
return RET_OK;
}
#endif
} }
// ----------------------------------------------------------------------- // -----------------------------------------------------------------------
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment