const gchar* uri = midori_view_get_display_uri (MIDORI_VIEW (view));
if (gtk_window_get_focus (GTK_WINDOW (browser)) == widget)
_action_location_submit_uri (action, uri, FALSE, browser);
- else if (g_object_get_data (G_OBJECT (view), "news-feeds"))
- sokoke_spawn_program (browser->news_aggregator, uri, TRUE);
+ else if ((uri = g_object_get_data (G_OBJECT (view), "news-feeds")))
+ {
+ if (browser->news_aggregator && *browser->news_aggregator)
+ sokoke_spawn_program (browser->news_aggregator, uri, TRUE);
+ else
+ {
+ GtkWidget* dialog = gtk_message_dialog_new (
+ GTK_WINDOW (browser), 0, GTK_MESSAGE_INFO,
+ GTK_BUTTONS_OK, "%s", _("New feed"));
+ gtk_message_dialog_format_secondary_text (
+ GTK_MESSAGE_DIALOG (dialog), "%s", uri);
+ gtk_widget_show (dialog);
+ g_signal_connect_swapped (dialog, "response",
+ G_CALLBACK (gtk_widget_destroy), dialog);
+ }
+ }
else
_action_location_submit_uri (action, uri, FALSE, browser);
}
g_object_notify (G_OBJECT (view), "progress");
midori_view_update_load_status (view, MIDORI_LOAD_FINISHED);
- if (view->news_aggregator && *view->news_aggregator)
+ if (1)
{
JSContextRef js_context = webkit_web_frame_get_global_context (web_frame);
/* This snippet joins the available news feeds into a string like this:
"feeds (document.getElementsByTagName ('link'))", NULL);
gchar** items = g_strsplit (value, ",", 0);
guint i = 0;
+ gchar* default_uri = NULL;
katze_array_clear (view->news_feeds);
if (items != NULL)
NULL);
katze_array_add_item (view->news_feeds, item);
g_object_unref (item);
+ if (!default_uri)
+ default_uri = g_strdup (parts ? *parts : NULL);
g_strfreev (parts);
i++;
}
g_strfreev (items);
- g_object_set_data (G_OBJECT (view), "news-feeds",
- value && *value ? (void*)1 : (void*)0);
+ g_object_set_data_full (G_OBJECT (view), "news-feeds", default_uri, g_free);
g_free (value);
/* Ensure load-status is notified again, whether it changed or not */
g_object_notify (G_OBJECT (view), "load-status");