summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nautilus-window.c5
-rw-r--r--src/resources/ui/nautilus-window.ui4
2 files changed, 9 insertions, 0 deletions
diff --git a/src/nautilus-window.c b/src/nautilus-window.c
index eaa297db2..e0b235013 100644
--- a/src/nautilus-window.c
+++ b/src/nautilus-window.c
@@ -488,6 +488,7 @@ tab_view_setup_menu_cb (AdwTabView *tab_view,
{
GAction *move_tab_left_action;
GAction *move_tab_right_action;
+ GAction *restore_tab_action;
int position, n_pages;
window->menu_page = page;
@@ -504,11 +505,15 @@ tab_view_setup_menu_cb (AdwTabView *tab_view,
"tab-move-left");
move_tab_right_action = g_action_map_lookup_action (G_ACTION_MAP (window),
"tab-move-right");
+ restore_tab_action = g_action_map_lookup_action (G_ACTION_MAP (window),
+ "restore-tab");
g_simple_action_set_enabled (G_SIMPLE_ACTION (move_tab_left_action),
page == NULL || position > 0);
g_simple_action_set_enabled (G_SIMPLE_ACTION (move_tab_right_action),
page == NULL || position < n_pages - 1);
+ g_simple_action_set_enabled (G_SIMPLE_ACTION (restore_tab_action),
+ g_queue_get_length (window->tab_data_queue) > 0);
}
static void
diff --git a/src/resources/ui/nautilus-window.ui b/src/resources/ui/nautilus-window.ui
index e7ae95809..5dd2e4b88 100644
--- a/src/resources/ui/nautilus-window.ui
+++ b/src/resources/ui/nautilus-window.ui
@@ -7,6 +7,10 @@
<attribute name="label" translatable="yes">_New Tab</attribute>
<attribute name="action">win.new-tab</attribute>
</item>
+ <item>
+ <attribute name="label" translatable="yes">Re_store Closed Tab</attribute>
+ <attribute name="action">win.restore-tab</attribute>
+ </item>
</section>
<section>
<item>