return;
}
-static ModestWindow*
+static ModestWindow*
modest_hildon2_window_mgr_get_main_window (ModestWindowMgr *self, gboolean show)
{
- ModestHildon2WindowMgrPrivate *priv;
- ModestWindow *result;
-
- g_return_val_if_fail (MODEST_IS_HILDON2_WINDOW_MGR (self), NULL);
- priv = MODEST_HILDON2_WINDOW_MGR_GET_PRIVATE (self);
-
- /* TODO: make this return NULL always */
-
- result = MODEST_WINDOW_MGR_CLASS (parent_class)->get_main_window (self, FALSE);
- /* create the main window, if it hasn't been created yet */
- if (!result && show) {
- /* modest_window_mgr_register_window will set priv->main_window */
- result = modest_main_window_new ();
- /* We have to remove all other windows */
- if (!modest_window_mgr_close_all_windows (self)) {
- gtk_widget_destroy (GTK_WIDGET (result));
- return NULL;
- }
- if (!modest_window_mgr_register_window (self, result, NULL)) {
- gtk_widget_destroy (GTK_WIDGET (result));
- return NULL;
- }
- MODEST_DEBUG_BLOCK(
- g_debug ("%s: created main window: %p\n", __FUNCTION__, result);
- );
- }
- if (show) {
- gtk_widget_show_all (GTK_WIDGET (result));
- gtk_window_present (GTK_WINDOW (result));
- }
-
- return result;
+ return NULL;
}
static gint
HildonURIAction *action;
gboolean result = FALSE;
GSList *actions, *iter = NULL;
-
+
g_return_val_if_fail (uri, FALSE);
if (!uri)
return FALSE;
/* don't try to activate file: uri's -- they might confuse the user,
* and/or might have security implications */
if (!g_str_has_prefix (uri, "file:")) {
-
+
actions = hildon_uri_get_actions_by_uri (uri, -1, NULL);
-
+
for (iter = actions; iter; iter = g_slist_next (iter)) {
action = (HildonURIAction*) iter->data;
if (action && strcmp (hildon_uri_action_get_service (action),
break;
}
}
-
+
/* if we could not open it with email, try something else */
if (!result)
- result = checked_hildon_uri_open (uri, NULL);
- }
-
+ result = checked_hildon_uri_open (uri, NULL);
+ }
+
if (!result) {
ModestWindow *parent =
- modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(), FALSE);
+ modest_window_mgr_get_current_top (modest_runtime_get_window_mgr());
hildon_banner_show_information (parent ? GTK_WIDGET(parent): NULL, NULL,
_("mcen_ib_unsupported_link"));
g_debug ("%s: cannot open uri '%s'", __FUNCTION__,uri);
- }
-
+ }
+
return result;
}
if (strcmp (action_name, hildon_uri_action_get_name (action))==0) {
if (!checked_hildon_uri_open (popup_info->uri, action)) {
ModestWindow *parent =
- modest_window_mgr_get_main_window (modest_runtime_get_window_mgr(), FALSE);
+ modest_window_mgr_get_current_top (modest_runtime_get_window_mgr());
hildon_banner_show_information (parent ? GTK_WIDGET(parent): NULL, NULL,
_("mcen_ib_unsupported_link"));
}