aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmarksbar.c
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@gnome.org>2004-07-02 17:03:42 +0800
committerMarco Pesenti Gritti <marco@src.gnome.org>2004-07-02 17:03:42 +0800
commit6dadef323fb59daefac69200014b1d5f238a911a (patch)
treef44b28f70a91dee49b95ebbc8d5c7a86a7ea9f3c /src/bookmarks/ephy-bookmarksbar.c
parent5788200966658bf840916954af8718426d33c177 (diff)
downloadgsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar
gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.gz
gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.bz2
gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.lz
gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.xz
gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.tar.zst
gsoc2013-epiphany-6dadef323fb59daefac69200014b1d5f238a911a.zip
Move in the bookmarks dir.
2004-07-02 Marco Pesenti Gritti <marco@gnome.org> * src/bookmarks/ephy-favorites-menu.c: * src/bookmarks/ephy-favorites-menu.h: Move in the bookmarks dir. * lib/ephy-gui.c: (ephy_gui_select_row_by_key), (ephy_gui_is_middle_click): * lib/ephy-gui.h: Add a function to check if menus was activated by a middle or a ctrl+click (which is equivalent in epiphany) * lib/ephy-marshal.list: * src/Makefile.am: * src/bookmarks/Makefile.am: * src/bookmarks/ephy-bookmark-action.c: (activate_cb), (ephy_bookmark_action_class_init): * src/bookmarks/ephy-bookmark-action.h: * src/bookmarks/ephy-bookmarks-menu.c: (open_bookmark_cb), (create_menu): * src/bookmarks/ephy-bookmarksbar.c: (bookmark_open_in_tab_cb), (bookmark_open_cb), (ephy_bookmarksbar_action_request): * src/bookmarks/ephy-topic-action.c: (menu_activate_cb), (ephy_topic_action_class_init): * src/bookmarks/ephy-topic-action.h: Add signals to open bookmarks in new window/tab. I'll need them for context menus. Use them for middle/ctrl click.
Diffstat (limited to 'src/bookmarks/ephy-bookmarksbar.c')
-rw-r--r--src/bookmarks/ephy-bookmarksbar.c56
1 files changed, 17 insertions, 39 deletions
diff --git a/src/bookmarks/ephy-bookmarksbar.c b/src/bookmarks/ephy-bookmarksbar.c
index 3945ff1dd..3d3bfd72e 100644
--- a/src/bookmarks/ephy-bookmarksbar.c
+++ b/src/bookmarks/ephy-bookmarksbar.c
@@ -123,48 +123,24 @@ open_in_tabs_cb (GtkAction *action, GList *uri_list, EphyBookmarksBar *toolbar)
}
static void
-go_location_cb (GtkAction *action, char *location, EphyBookmarksBar *toolbar)
+bookmark_open_in_tab_cb (GtkAction *action, char *location,
+ gboolean new_window, EphyBookmarksBar *toolbar)
{
- EphyWindow *window = toolbar->priv->window;
- GdkEvent *event;
- gboolean new_tab = FALSE;
+ EphyNewTabFlags flags = EPHY_NEW_TAB_OPEN_PAGE;
- g_return_if_fail (window != NULL);
-
- event = gtk_get_current_event ();
- if (event != NULL)
+ if (!new_window)
{
- if (event->type == GDK_BUTTON_RELEASE)
- {
- guint modifiers, button, state;
-
- modifiers = gtk_accelerator_get_default_mod_mask ();
- button = event->button.button;
- state = event->button.state;
-
- /* middle-click or control-click */
- if ((button == 1 && ((state & modifiers) == GDK_CONTROL_MASK)) ||
- (button == 2))
- {
- new_tab = TRUE;
- }
- }
-
- gdk_event_free (event);
+ flags |= EPHY_NEW_TAB_IN_EXISTING_WINDOW;
}
- if (new_tab)
- {
- ephy_shell_new_tab (ephy_shell, window,
- ephy_window_get_active_tab (window),
- location,
- EPHY_NEW_TAB_OPEN_PAGE |
- EPHY_NEW_TAB_IN_EXISTING_WINDOW);
- }
- else
- {
- ephy_window_load_url (window, location);
- }
+ ephy_shell_new_tab (ephy_shell, toolbar->priv->window, NULL,
+ location, flags);
+}
+
+static void
+bookmark_open_cb (GtkAction *action, char *location, EphyBookmarksBar *toolbar)
+{
+ ephy_window_load_url (toolbar->priv->window, location);
}
static gboolean
@@ -267,8 +243,10 @@ ephy_bookmarksbar_action_request (EggEditableToolbar *eggtoolbar,
g_return_if_fail (action != NULL);
- g_signal_connect (action, "go_location",
- G_CALLBACK (go_location_cb), toolbar);
+ g_signal_connect (action, "open",
+ G_CALLBACK (bookmark_open_cb), toolbar);
+ g_signal_connect (action, "open_in_tab",
+ G_CALLBACK (bookmark_open_in_tab_cb), toolbar);
gtk_action_group_add_action (toolbar->priv->action_group, action);
g_object_unref (action);