From 7eeb0b0cbad28ab062f8faa2adf44fea6e8eced7 Mon Sep 17 00:00:00 2001 From: Emmanouil Papadeas <35376950+OverloadedOrama@users.noreply.github.com> Date: Thu, 10 Oct 2024 00:40:51 +0300 Subject: [PATCH] Add a clear recently open file list option --- Translations/Translations.pot | 4 ++++ src/Preferences/PreferencesDialog.gd | 6 ++++++ src/Preferences/PreferencesDialog.tscn | 6 ++++++ 3 files changed, 16 insertions(+) diff --git a/Translations/Translations.pot b/Translations/Translations.pot index 4bde2c449..f5933fcb4 100644 --- a/Translations/Translations.pot +++ b/Translations/Translations.pot @@ -2498,6 +2498,10 @@ msgstr "" msgid "Remove all extensions" msgstr "" +#. Found in the preferences, under the Reset category. +msgid "Clear the recently opened file list" +msgstr "" + msgid "Lock aspect ratio" msgstr "" diff --git a/src/Preferences/PreferencesDialog.gd b/src/Preferences/PreferencesDialog.gd index 971aa0094..1d96dcdee 100644 --- a/src/Preferences/PreferencesDialog.gd +++ b/src/Preferences/PreferencesDialog.gd @@ -253,6 +253,7 @@ func _ready() -> void: startup.queue_free() right_side.get_node(^"Language").visible = true Global.open_last_project = false + %ClearRecentFiles.hide() if OS.get_name() == "Windows": tablet_driver_label.visible = true tablet_driver.visible = true @@ -465,5 +466,10 @@ func _on_reset_options_confirmation_confirmed() -> void: for extension in extensions_list: extensions_node.uninstall_extension(extension) Global.config_cache.erase_section("extensions") + # Clear recent files list + if %ClearRecentFiles.button_pressed: + Global.config_cache.erase_section_key("data", "last_project_path") + Global.config_cache.erase_section_key("data", "recent_projects") + Global.top_menu_container.recent_projects_submenu.clear() Global.config_cache.save(Global.CONFIG_PATH) diff --git a/src/Preferences/PreferencesDialog.tscn b/src/Preferences/PreferencesDialog.tscn index dbaf691f9..d7092aae4 100644 --- a/src/Preferences/PreferencesDialog.tscn +++ b/src/Preferences/PreferencesDialog.tscn @@ -1386,6 +1386,12 @@ layout_mode = 2 mouse_default_cursor_shape = 2 text = "Remove all extensions" +[node name="ClearRecentFiles" type="CheckBox" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Reset"] +unique_name_in_owner = true +layout_mode = 2 +mouse_default_cursor_shape = 2 +text = "Clear the recently opened file list" + [node name="ResetButton" type="Button" parent="HSplitContainer/VBoxContainer/ScrollContainer/RightSide/Reset"] layout_mode = 2 mouse_default_cursor_shape = 2