+/**
+ * This function checks if a modal dialog should be activated
+ * instead of other UI components on a DBus request, and if yes, starts the request
+ * @return TRUE if a modal dialog is about to be acitvated
+ * @note This function should be used before activating any Modest UI element on DBus request
+ */
+static gboolean
+modest_dbus_check_present_modal ()
+{
+ GtkWindow *dialog;
+
+ /* Check if there is already a dialog or note open */
+ dialog = modest_window_mgr_get_modal (modest_runtime_get_window_mgr());
+ if (dialog) {
+ g_idle_add (on_idle_present_modal, dialog);
+ }
+
+ return (NULL != dialog);
+}