diff options
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | src/bookmarks/ephy-bookmarksbar.c | 21 | ||||
-rw-r--r-- | src/bookmarks/ephy-topic-action.c | 17 |
3 files changed, 33 insertions, 13 deletions
@@ -1,3 +1,11 @@ +2004-06-30 Marco Pesenti Gritti <marco@gnome.org> + + * src/bookmarks/ephy-bookmarksbar.c: (open_in_tabs_cb): + * src/bookmarks/ephy-topic-action.c: (append_bookmarks_menu), + (open_in_tabs_activate_cb), (build_bookmarks_menu): + + Use a new window for "Open in Tabs" + 2004-06-30 Xan Lopez <xan@gnome.org> * embed/mozilla/MozDownload.cpp: diff --git a/src/bookmarks/ephy-bookmarksbar.c b/src/bookmarks/ephy-bookmarksbar.c index 249971491..3945ff1dd 100644 --- a/src/bookmarks/ephy-bookmarksbar.c +++ b/src/bookmarks/ephy-bookmarksbar.c @@ -100,13 +100,26 @@ ephy_bookmarksbar_get_type (void) static void open_in_tabs_cb (GtkAction *action, GList *uri_list, EphyBookmarksBar *toolbar) { - EphyWindow *window = toolbar->priv->window; EphyTab *tab; + EphyWindow *window; + GList *l = uri_list; + + g_return_if_fail (l != NULL); + + tab = ephy_shell_new_tab (ephy_shell, NULL, NULL, l->data, + EPHY_NEW_TAB_OPEN_PAGE); + g_return_if_fail (tab != NULL); - g_return_if_fail (EPHY_IS_WINDOW (window)); + window = EPHY_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tab))); + g_return_if_fail (window != NULL); - tab = ephy_window_get_active_tab (window); - ephy_window_load_in_tabs (window, tab, uri_list); + for (l = l->next; l != NULL; l = l->next) + { + ephy_shell_new_tab (ephy_shell, window, NULL, l->data, + EPHY_NEW_TAB_IN_EXISTING_WINDOW | + EPHY_NEW_TAB_OPEN_PAGE | + EPHY_NEW_TAB_APPEND_LAST); + } } static void diff --git a/src/bookmarks/ephy-topic-action.c b/src/bookmarks/ephy-topic-action.c index 7e6694539..2f0ac30f9 100644 --- a/src/bookmarks/ephy-topic-action.c +++ b/src/bookmarks/ephy-topic-action.c @@ -218,7 +218,7 @@ sort_bookmarks (gconstpointer a, gconstpointer b) #define MAX_LENGTH 32 -static gboolean +static guint append_bookmarks_menu (EphyTopicAction *action, GtkWidget *menu, EphyNode *node, gboolean show_empty) { EphyFaviconCache *cache; @@ -299,7 +299,7 @@ append_bookmarks_menu (EphyTopicAction *action, GtkWidget *menu, EphyNode *node, g_list_free (node_list); } - return TRUE; + return children->len; } static void @@ -312,33 +312,32 @@ open_in_tabs_activate_cb (GtkWidget *menu, EphyTopicAction *action) children = ephy_node_get_children (action->priv->topic_node); for (i = 0; i < children->len; i++) { - GnomeVFSURI *uri; const char *address; EphyNode *child; child = g_ptr_array_index (children, i); address = ephy_node_get_property_string (child, EPHY_NODE_BMK_PROP_LOCATION); - uri = gnome_vfs_uri_new (address); - uri_list = g_list_append (uri_list, uri); + uri_list = g_list_append (uri_list, g_strdup (address)); } g_signal_emit (action, ephy_topic_action_signals[OPEN_IN_TABS], 0, uri_list); - gnome_vfs_uri_list_free (uri_list); + g_list_foreach (uri_list, (GFunc)g_free, NULL); + g_list_free (uri_list); } static GtkWidget * build_bookmarks_menu (EphyTopicAction *action, EphyNode *node) { GtkWidget *menu; - gboolean empty; + guint n_bookmarks; menu = gtk_menu_new (); - empty = append_bookmarks_menu (action, menu, node, TRUE); + n_bookmarks = append_bookmarks_menu (action, menu, node, TRUE); - if (empty) + if (n_bookmarks > 1) { GtkWidget *item; |