diff options
author | Sean Harmer <sean.harmer.qnx@kdab.com> | 2012-04-25 13:16:24 +0100 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-26 00:34:40 +0200 |
commit | 48768ab4337175791681d4452aef3745a51bf8a6 (patch) | |
tree | e92b7328e5d31fd19fd1894d1e61749d7a69c042 /src/plugins/platforms/qnx/qqnxbpseventfilter.cpp | |
parent | c4fbe872be1316f2fd65aa62863d6617cb129a3f (diff) |
QNX: Adding native file dialog support for Blackberry
This patch enables use of native file dialogs in the application
modal case.
The native file open dialog is reasonable but the native file save
dialog could do with some improvements to make it more usable.
Perhaps providing our own "native" dialog UI would be an option
once the widget style is finished.
Change-Id: If5fb7cf73d27e52db7bfa6d97d8f8fb7912960bb
Reviewed-by: Nicolas Arnaud-Cormos <nicolas@kdab.com>
Diffstat (limited to 'src/plugins/platforms/qnx/qqnxbpseventfilter.cpp')
-rw-r--r-- | src/plugins/platforms/qnx/qqnxbpseventfilter.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp index f5185e3eb7..fd1bfd333e 100644 --- a/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp +++ b/src/plugins/platforms/qnx/qqnxbpseventfilter.cpp @@ -41,6 +41,7 @@ #include "qqnxbpseventfilter.h" #include "qqnxnavigatoreventhandler.h" +#include "qqnxfiledialoghelper.h" #include "qqnxscreen.h" #include "qqnxscreeneventhandler.h" #include "qqnxvirtualkeyboardbps.h" @@ -110,6 +111,22 @@ void QQnxBpsEventFilter::unregisterForScreenEvents(QQnxScreen *screen) qWarning("QQNX: failed to unregister for screen events on screen %p", screen->nativeContext()); } +void QQnxBpsEventFilter::registerForDialogEvents(QQnxFileDialogHelper *dialog) +{ + if (dialog_request_events(0) != BPS_SUCCESS) + qWarning("QQNX: failed to register for dialog events"); + dialog_instance_t nativeDialog = dialog->nativeDialog(); + if (!m_dialogMapper.contains(nativeDialog)) + m_dialogMapper.insert(nativeDialog, dialog); +} + +void QQnxBpsEventFilter::unregisterForDialogEvents(QQnxFileDialogHelper *dialog) +{ + int count = m_dialogMapper.remove(dialog->nativeDialog()); + if (count == 0) + qWarning("QQNX: attempting to unregister dialog that was not registered"); +} + bool QQnxBpsEventFilter::dispatcherEventFilter(void *message) { qBpsEventFilterDebug() << Q_FUNC_INFO; @@ -131,6 +148,13 @@ bool QQnxBpsEventFilter::bpsEventFilter(bps_event_t *event) return m_screenEventHandler->handleEvent(screenEvent); } + if (eventDomain == dialog_get_domain()) { + dialog_instance_t nativeDialog = dialog_event_get_dialog_instance(event); + QQnxFileDialogHelper *dialog = m_dialogMapper.value(nativeDialog, 0); + if (dialog) + return dialog->handleEvent(event); + } + if (eventDomain == navigator_get_domain()) return handleNavigatorEvent(event); |