From 664b85418e65dfb469c87a11d72fdb147f5d2f15 Mon Sep 17 00:00:00 2001 From: Witold Filipczyk Date: Fri, 11 Aug 2023 16:06:05 +0200 Subject: [PATCH] [menu] Added "Remove temporary files" menu entry. --- src/config/actions-main.inc | 1 + src/dialogs/menu.c | 1 + src/viewer/action.cpp | 4 ++++ 3 files changed, 6 insertions(+) diff --git a/src/config/actions-main.inc b/src/config/actions-main.inc index f59417dc0..98991b897 100644 --- a/src/config/actions-main.inc +++ b/src/config/actions-main.inc @@ -14,6 +14,7 @@ ACTION_(MAIN, "backspace-prefix", BACKSPACE_PREFIX, N__("Backspace the last ente ACTION_(MAIN, "bookmark-manager", BOOKMARK_MANAGER, N__("Open bookmark manager"), 0), ACTION_(MAIN, "cache-manager", CACHE_MANAGER, N__("Open cache manager"), 0), ACTION_(MAIN, "cache-minimize", CACHE_MINIMIZE, N__("Free unused cache entries"), 0), +ACTION_(MAIN, "clean-temporary-files", CLEAN_TEMPORARY_FILES, N__("Remove temporary files"), 0), ACTION_(MAIN, "cookie-manager", COOKIE_MANAGER, N__("Open cookie manager"), 0), ACTION_(MAIN, "cookies-load", COOKIES_LOAD, N__("Reload cookies file"), ACTION_RESTRICT_ANONYMOUS), ACTION_(MAIN, "copy-clipboard", COPY_CLIPBOARD, N__("Copy text to clipboard"), ACTION_REQUIRE_VIEW_STATE | ACTION_REQUIRE_LOCATION), diff --git a/src/dialogs/menu.c b/src/dialogs/menu.c index 94afd8ec8..961004d5a 100644 --- a/src/dialogs/menu.c +++ b/src/dialogs/menu.c @@ -333,6 +333,7 @@ static struct menu_item file_menu22[] = { BAR_MENU_ITEM, INIT_MENU_ACTION(N_("~Kill background connections"), ACT_MAIN_KILL_BACKGROUNDED_CONNECTIONS), INIT_MENU_ACTION(N_("Flush all ~caches"), ACT_MAIN_CACHE_MINIMIZE), + INIT_MENU_ACTION(N_("Re~move temporary files"), ACT_MAIN_CLEAN_TEMPORARY_FILES), INIT_MENU_ACTION(N_("Resource ~info"), ACT_MAIN_RESOURCE_INFO), BAR_MENU_ITEM, }; diff --git a/src/viewer/action.cpp b/src/viewer/action.cpp index 28a452255..4de4fbbd7 100644 --- a/src/viewer/action.cpp +++ b/src/viewer/action.cpp @@ -155,6 +155,10 @@ do_action(struct session *ses, main_action_T action_id, int verbose) shrink_memory(1); break; + case ACT_MAIN_CLEAN_TEMPORARY_FILES: + clean_temporary_files(); + break; + case ACT_MAIN_COOKIES_LOAD: #ifdef CONFIG_COOKIES if (!get_opt_bool("cookies.save", NULL)) break;