aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@mail.utexas.edu>2005-10-13 11:14:12 +0800
committerPhilip Langdale <philipl@src.gnome.org>2005-10-13 11:14:12 +0800
commit54d95188256bc3a6504e949d8a6d85190401330e (patch)
tree6f8aba9ea3d03952e8232669c744fdf54e840374 /src
parent85939a287cbb2b9c789581ddc6d529dd24d2c870 (diff)
downloadgsoc2013-epiphany-54d95188256bc3a6504e949d8a6d85190401330e.tar
gsoc2013-epiphany-54d95188256bc3a6504e949d8a6d85190401330e.tar.gz
gsoc2013-epiphany-54d95188256bc3a6504e949d8a6d85190401330e.tar.bz2
gsoc2013-epiphany-54d95188256bc3a6504e949d8a6d85190401330e.tar.lz
gsoc2013-epiphany-54d95188256bc3a6504e949d8a6d85190401330e.tar.xz
gsoc2013-epiphany-54d95188256bc3a6504e949d8a6d85190401330e.tar.zst
gsoc2013-epiphany-54d95188256bc3a6504e949d8a6d85190401330e.zip
embed/ephy-embed.c . Add a method to copy the back/forward history from
2005-10-12 Philip Langdale <philipl@mail.utexas.edu> * embed/ephy-embed.c * embed/ephy-embed.h: (ephy_embed_shistory_copy). Add a method to copy the back/forward history from one embed to another. * embed/mozilla/EphyBrowser.cpp: * embed/mozilla/EphyBrowser.h: (EphyBrowser::CopySHistory) Implementation of history copying. * embed/mozilla/mozilla-embed.cpp: Implement ephy_embed_shistory_copy by calling into EphyBrowser. * src/ephy-navigation-action.c: (activate_back_or_forward_menu_item_cb). If a history menu item is middle-clicked on, open a new tab, copy the history over and then go to the relevant page in the history. * src/ephy-toolbar.c: (ephy_toolbar_set_window) Attach handler for "open-link" to back/forward actions.
Diffstat (limited to 'src')
-rw-r--r--src/ephy-navigation-action.c19
-rwxr-xr-xsrc/ephy-toolbar.c4
2 files changed, 23 insertions, 0 deletions
diff --git a/src/ephy-navigation-action.c b/src/ephy-navigation-action.c
index 8ad4a18f0..e1c0dfd2b 100644
--- a/src/ephy-navigation-action.c
+++ b/src/ephy-navigation-action.c
@@ -143,12 +143,31 @@ activate_back_or_forward_menu_item_cb (GtkWidget *menuitem,
{
EphyEmbed *embed;
int go_nth;
+ char *url;
embed = ephy_window_get_active_embed (action->priv->window);
g_return_if_fail (embed != NULL);
go_nth = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (menuitem), NTH_DATA_KEY));
+ url = g_object_get_data (G_OBJECT (menuitem), URL_DATA_KEY);
+ g_return_if_fail (url != NULL);
+
+ if (ephy_gui_is_middle_click ())
+ {
+ EphyEmbed *dest;
+ EphyTab *newTab;
+
+ newTab = ephy_link_open (EPHY_LINK (action), "about:blank", NULL,
+ EPHY_LINK_NEW_TAB);
+ g_return_if_fail (newTab != NULL);
+
+ dest = ephy_tab_get_embed (newTab);
+ g_return_if_fail (dest != NULL);
+
+ ephy_embed_shistory_copy (embed, dest, TRUE, TRUE, FALSE);
+ embed = dest;
+ }
ephy_embed_shistory_go_nth (embed, go_nth);
}
diff --git a/src/ephy-toolbar.c b/src/ephy-toolbar.c
index 7f2127d07..b74f397ea 100755
--- a/src/ephy-toolbar.c
+++ b/src/ephy-toolbar.c
@@ -276,6 +276,8 @@ ephy_toolbar_set_window (EphyToolbar *toolbar,
NULL);
g_signal_connect (action, "activate",
G_CALLBACK (window_cmd_go_back), priv->window);
+ g_signal_connect_swapped (action, "open-link",
+ G_CALLBACK (ephy_link_open), toolbar);
gtk_action_group_add_action (priv->action_group, action);
g_object_unref (action);
@@ -294,6 +296,8 @@ ephy_toolbar_set_window (EphyToolbar *toolbar,
NULL);
g_signal_connect (action, "activate",
G_CALLBACK (window_cmd_go_forward), priv->window);
+ g_signal_connect_swapped (action, "open-link",
+ G_CALLBACK (ephy_link_open), toolbar);
gtk_action_group_add_action (priv->action_group, action);
g_object_unref (action);