summaryrefslogtreecommitdiff
path: root/src/caja-window.c
diff options
context:
space:
mode:
authorErik Bročko <[email protected]>2020-11-11 16:43:52 +0100
committerGitHub <[email protected]>2020-11-11 16:43:52 +0100
commita67e47448d5534302f0efe588942e761881f28bc (patch)
treed9b3a958b0948301f93f9b0f5dc86ac5e9080ea6 /src/caja-window.c
parent40f061c638ae125fc6a4170807fa890362050e0f (diff)
downloadcaja-a67e47448d5534302f0efe588942e761881f28bc.tar.bz2
caja-a67e47448d5534302f0efe588942e761881f28bc.tar.xz
Duplicate tabs using the scroll wheel (#1456)
* middle-clicking the reload button duplicates tab
Diffstat (limited to 'src/caja-window.c')
-rw-r--r--src/caja-window.c30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/caja-window.c b/src/caja-window.c
index 42d43e82..640932c2 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -272,6 +272,12 @@ caja_window_go_up_signal (CajaWindow *window, gboolean close_behind)
return TRUE;
}
+static void
+caja_window_reload_signal (CajaWindow *window)
+{
+ caja_window_reload (window, FALSE);
+}
+
void
caja_window_new_tab (CajaWindow *window)
{
@@ -477,6 +483,28 @@ caja_window_sync_allow_stop (CajaWindow *window,
}
void
+caja_window_reload (CajaWindow *window, gboolean new_tab)
+{
+ CajaWindowSlot *slot;
+
+ g_assert (CAJA_IS_WINDOW (window));
+
+ slot = window->details->active_pane->active_slot;
+
+ if (new_tab && slot->location != NULL)
+ {
+ caja_window_slot_open_location_full (slot, slot->location,
+ CAJA_WINDOW_OPEN_ACCORDING_TO_MODE,
+ CAJA_WINDOW_OPEN_FLAG_NEW_TAB,
+ NULL, NULL, NULL);
+ }
+ else
+ {
+ caja_window_slot_reload (slot);
+ }
+}
+
+void
caja_window_allow_reload (CajaWindow *window, gboolean allow)
{
GtkAction *action;
@@ -2220,6 +2248,6 @@ caja_window_class_init (CajaWindowClass *class)
"prompt-for-location", 1,
G_TYPE_STRING, "/");
- class->reload = caja_window_reload;
+ class->reload = caja_window_reload_signal;
class->go_up = caja_window_go_up_signal;
}