aboutsummaryrefslogtreecommitdiffstats
path: root/src/ephy-shell.c
diff options
context:
space:
mode:
authorClaudio Saavedra <csaavedra@igalia.com>2013-01-28 19:18:41 +0800
committerClaudio Saavedra <csaavedra@igalia.com>2013-02-08 06:01:59 +0800
commitbe7b9d45477bd6762979f2046f41b713b2eefffe (patch)
treeb5d526040a6e67a153ac2eb24a5188741394e42b /src/ephy-shell.c
parent180ad78567be78007ac26fe5b73b0a2a28c0eb1f (diff)
downloadgsoc2013-epiphany-be7b9d45477bd6762979f2046f41b713b2eefffe.tar
gsoc2013-epiphany-be7b9d45477bd6762979f2046f41b713b2eefffe.tar.gz
gsoc2013-epiphany-be7b9d45477bd6762979f2046f41b713b2eefffe.tar.bz2
gsoc2013-epiphany-be7b9d45477bd6762979f2046f41b713b2eefffe.tar.lz
gsoc2013-epiphany-be7b9d45477bd6762979f2046f41b713b2eefffe.tar.xz
gsoc2013-epiphany-be7b9d45477bd6762979f2046f41b713b2eefffe.tar.zst
gsoc2013-epiphany-be7b9d45477bd6762979f2046f41b713b2eefffe.zip
ephy-shell: add application menu item for reopening closed tabs
https://bugzilla.gnome.org/show_bug.cgi?id=128184
Diffstat (limited to 'src/ephy-shell.c')
-rw-r--r--src/ephy-shell.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/ephy-shell.c b/src/ephy-shell.c
index f08097422..6da0900a5 100644
--- a/src/ephy-shell.c
+++ b/src/ephy-shell.c
@@ -152,6 +152,14 @@ new_incognito_window (GSimpleAction *action,
}
static void
+reopen_closed_tab (GSimpleAction *action,
+ GVariant *parameter,
+ gpointer user_data)
+{
+ window_cmd_undo_close_tab (NULL, NULL);
+}
+
+static void
show_bookmarks (GSimpleAction *action,
GVariant *parameter,
gpointer user_data)
@@ -214,6 +222,10 @@ static GActionEntry app_entries[] = {
{ "quit", quit_application, NULL, NULL, NULL },
};
+static GActionEntry app_normal_mode_entries[] = {
+ { "reopen-closed-tab", reopen_closed_tab, NULL, NULL, NULL },
+};
+
static void
ephy_shell_startup (GApplication* application)
{
@@ -231,6 +243,18 @@ ephy_shell_startup (GApplication* application)
app_entries, G_N_ELEMENTS (app_entries),
application);
+ if (mode != EPHY_EMBED_SHELL_MODE_INCOGNITO) {
+ g_action_map_add_action_entries (G_ACTION_MAP (application),
+ app_normal_mode_entries, G_N_ELEMENTS (app_normal_mode_entries),
+ application);
+ g_object_bind_property (G_OBJECT (ephy_shell_get_session (EPHY_SHELL (application))),
+ "can-undo-tab-closed",
+ g_action_map_lookup_action (G_ACTION_MAP (application),
+ "reopen-closed-tab"),
+ "enabled",
+ G_BINDING_SYNC_CREATE);
+ }
+
builder = gtk_builder_new ();
gtk_builder_add_from_resource (builder,
"/org/gnome/epiphany/epiphany-application-menu.ui",