Use midori_browser_get_for_widget in the bookmark panel

This fixes opening bookmarks in the current tab.
This commit is contained in:
Enrico Tröger 2009-05-03 21:11:20 +02:00 committed by Christian Dywan
parent ae23ae0583
commit 606c629fa5

View file

@ -175,9 +175,9 @@ midori_bookmarks_delete_clicked_cb (GtkWidget* toolitem,
static void static void
midori_bookmarks_folder_clicked_cb (GtkWidget* toolitem) midori_bookmarks_folder_clicked_cb (GtkWidget* toolitem)
{ {
GtkWidget* browser = gtk_widget_get_toplevel (toolitem); MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (toolitem));
/* FIXME: Take selected folder into account */ /* FIXME: Take selected folder into account */
midori_browser_edit_bookmark_dialog_new (MIDORI_BROWSER (browser), midori_browser_edit_bookmark_dialog_new (browser,
NULL, TRUE, TRUE); NULL, TRUE, TRUE);
} }
@ -612,10 +612,8 @@ midori_bookmarks_row_activated_cb (GtkTreeView* treeview,
uri = katze_item_get_uri (item); uri = katze_item_get_uri (item);
if (uri && *uri) if (uri && *uri)
{ {
GtkWidget* browser; MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
midori_browser_set_current_uri (browser, uri);
browser = gtk_widget_get_toplevel (GTK_WIDGET (bookmarks));
midori_browser_set_current_uri (MIDORI_BROWSER (browser), uri);
} }
g_object_unref (item); g_object_unref (item);
@ -662,8 +660,8 @@ midori_bookmarks_open_activate_cb (GtkWidget* menuitem,
if (uri && *uri) if (uri && *uri)
{ {
GtkWidget* browser = gtk_widget_get_toplevel (GTK_WIDGET (bookmarks)); MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
midori_browser_set_current_uri (MIDORI_BROWSER (browser), uri); midori_browser_set_current_uri (browser, uri);
} }
} }
@ -727,7 +725,7 @@ midori_bookmarks_open_in_window_activate_cb (GtkWidget* menuitem,
if (uri && *uri) if (uri && *uri)
{ {
GtkWidget* browser = gtk_widget_get_toplevel (GTK_WIDGET (bookmarks)); MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
g_signal_emit_by_name (browser, "new-window", uri); g_signal_emit_by_name (browser, "new-window", uri);
} }
} }
@ -744,8 +742,8 @@ midori_bookmarks_edit_activate_cb (GtkWidget* menuitem,
if (!is_separator) if (!is_separator)
{ {
GtkWidget* browser = gtk_widget_get_toplevel (GTK_WIDGET (bookmarks)); MidoriBrowser* browser = midori_browser_get_for_widget (GTK_WIDGET (bookmarks));
midori_browser_edit_bookmark_dialog_new (MIDORI_BROWSER (browser), item, FALSE, FALSE); midori_browser_edit_bookmark_dialog_new (browser, item, FALSE, FALSE);
} }
} }