summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2013-10-31 21:29:47 +0200
committerTor Lillqvist <tml@collabora.com>2013-11-01 00:22:30 +0200
commitec2ea6e6e087d13d484d0e4b938144d28c4395dd (patch)
tree925413f659234b2df7e445e2e5b11482f81f3b7c /vcl
parent139bd9b4402eb19a8de71cceb2ce3807cbb5dbf0 (diff)
Maybe Dialog::Execute() is one good place to call touch_ui_dialog_modal()
Change-Id: I5f1b9fd266d7920a947d3dfb6bcd584e3cc30b53
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/window/dialog.cxx60
1 files changed, 59 insertions, 1 deletions
diff --git a/vcl/source/window/dialog.cxx b/vcl/source/window/dialog.cxx
index e0cd445aae06..0298d5d650d7 100644
--- a/vcl/source/window/dialog.cxx
+++ b/vcl/source/window/dialog.cxx
@@ -17,6 +17,8 @@
* 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/util/PathSettings.hpp>
#include <comphelper/processfactory.hxx>
@@ -45,6 +47,10 @@
#include <vcl/unowrap.hxx>
#include <iostream>
+#if !HAVE_FEATURE_DESKTOP
+#include <touch/touch.h>
+#endif
+
// =======================================================================
static OString ImplGetDialogText( Dialog* pDialog )
@@ -884,6 +890,8 @@ void Dialog::ImplEndExecuteModal()
short Dialog::Execute()
{
+#if HAVE_FEATURE_DESKTOP
+
setDeferredProperties();
if ( !ImplStartExecuteModal() )
@@ -904,7 +912,7 @@ short Dialog::Execute()
while ( !aDelData.IsDead() && mbInExecute )
Application::Yield();
- ImplEndExecuteModal();
+ ImplEndExecutModal();
#ifdef DBG_UTIL
if( pDialogParent )
@@ -927,6 +935,56 @@ short Dialog::Execute()
long nRet = mpDialogImpl->mnResult;
mpDialogImpl->mnResult = -1;
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
}
// -----------------------------------------------------------------------