aboutsummaryrefslogtreecommitdiffstats
path: root/src/bookmarks/ephy-bookmark-action.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-bookmark-action.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-bookmark-action.c')
-rw-r--r--src/bookmarks/ephy-bookmark-action.c32
1 files changed, 27 insertions, 5 deletions
diff --git a/src/bookmarks/ephy-bookmark-action.c b/src/bookmarks/ephy-bookmark-action.c
index 21b094bae..2b44f1a5a 100644
--- a/src/bookmarks/ephy-bookmark-action.c
+++ b/src/bookmarks/ephy-bookmark-action.c
@@ -27,6 +27,7 @@
#include <gtk/gtktoolitem.h>
#include "ephy-bookmark-action.h"
+#include "ephy-marshal.h"
#include "ephy-dnd.h"
#include "ephy-bookmarksbar.h"
#include "ephy-bookmarks.h"
@@ -34,6 +35,7 @@
#include "ephy-shell.h"
#include "ephy-string.h"
#include "ephy-debug.h"
+#include "ephy-gui.h"
#include <string.h>
@@ -75,7 +77,8 @@ enum
enum
{
- GO_LOCATION,
+ OPEN,
+ OPEN_IN_TAB,
LAST_SIGNAL
};
@@ -342,7 +345,14 @@ activate_cb (GtkWidget *widget, GtkAction *action)
}
}
- g_signal_emit (action, signals[GO_LOCATION], 0, location);
+ if (ephy_gui_is_middle_click ())
+ {
+ g_signal_emit (action, signals[OPEN_IN_TAB], 0, location, FALSE);
+ }
+ else
+ {
+ g_signal_emit (action, signals[OPEN], 0, location);
+ }
g_free (location);
g_free (text);
@@ -580,17 +590,29 @@ ephy_bookmark_action_class_init (EphyBookmarkActionClass *class)
object_class->set_property = ephy_bookmark_action_set_property;
object_class->get_property = ephy_bookmark_action_get_property;
- signals[GO_LOCATION] =
- g_signal_new ("go_location",
+ signals[OPEN] =
+ g_signal_new ("open",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EphyBookmarkActionClass, go_location),
+ G_STRUCT_OFFSET (EphyBookmarkActionClass, open),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE,
1,
G_TYPE_STRING);
+ signals[OPEN_IN_TAB] =
+ g_signal_new ("open_in_tab",
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EphyBookmarkActionClass, open_in_tab),
+ NULL, NULL,
+ ephy_marshal_VOID__STRING_BOOLEAN,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_STRING,
+ G_TYPE_BOOLEAN);
+
g_object_class_install_property (object_class,
PROP_BOOKMARK_ID,
g_param_spec_int ("bookmark_id",