From 1a764046c102c940228c55b050b23d4f3aa4622f Mon Sep 17 00:00:00 2001 From: ! Freaku <92618708+Freaku17@users.noreply.github.com> Date: Fri, 8 Dec 2023 21:46:14 +0530 Subject: [PATCH 1/4] Update plugin_manager Fixes warning in 1.7.30: `set_main_menu_window() should be passed a 'from_window' value to help ensure proper UI behavior` --- plugin_manager.py | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index a75b9fe..080bae1 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1607,7 +1607,8 @@ class PluginManagerWindow(bui.Window): bui.containerwidget(edit=self._root_widget, transition=self._transition_out) bui.app.ui_v1.set_main_menu_window( - AllSettingsWindow(transition='in_left').get_root_widget()) + AllSettingsWindow(transition='in_left').get_root_widget(), + from_window=self._root_widget,) @contextlib.contextmanager def exception_handler(self): @@ -2392,8 +2393,8 @@ class NewAllSettingsWindow(bui.Window): ) assert bui.app.classic is not None bui.app.ui_v1.set_main_menu_window( - MainMenuWindow(transition='in_left').get_root_widget() - ) + MainMenuWindow(transition='in_left').get_root_widget(), + from_window=self._root_widget,) def _do_controllers(self) -> None: # pylint: disable=cyclic-import @@ -2405,8 +2406,8 @@ class NewAllSettingsWindow(bui.Window): bui.app.ui_v1.set_main_menu_window( ControlsSettingsWindow( origin_widget=self._controllers_button - ).get_root_widget() - ) + ).get_root_widget(), + from_window=self._root_widget,) def _do_graphics(self) -> None: # pylint: disable=cyclic-import @@ -2418,8 +2419,8 @@ class NewAllSettingsWindow(bui.Window): bui.app.ui_v1.set_main_menu_window( GraphicsSettingsWindow( origin_widget=self._graphics_button - ).get_root_widget() - ) + ).get_root_widget(), + from_window=self._root_widget,) def _do_audio(self) -> None: # pylint: disable=cyclic-import @@ -2431,8 +2432,8 @@ class NewAllSettingsWindow(bui.Window): bui.app.ui_v1.set_main_menu_window( AudioSettingsWindow( origin_widget=self._audio_button - ).get_root_widget() - ) + ).get_root_widget(), + from_window=self._root_widget,) def _do_advanced(self) -> None: # pylint: disable=cyclic-import @@ -2444,8 +2445,8 @@ class NewAllSettingsWindow(bui.Window): bui.app.ui_v1.set_main_menu_window( AdvancedSettingsWindow( origin_widget=self._advanced_button - ).get_root_widget() - ) + ).get_root_widget(), + from_window=self._root_widget,) def _do_modmanager(self) -> None: self._save_state() @@ -2453,8 +2454,8 @@ class NewAllSettingsWindow(bui.Window): bui.app.ui_v1.set_main_menu_window( PluginManagerWindow( origin_widget=self._modmgr_button - ).get_root_widget() - ) + ).get_root_widget(), + from_window=self._root_widget,) def _save_state(self) -> None: try: From 8ce09ea0a339b8b4003460a74eb2999280b6af13 Mon Sep 17 00:00:00 2001 From: Rikko Date: Fri, 8 Dec 2023 22:26:29 +0530 Subject: [PATCH 2/4] Make sure filter widget exists when looking for filter text --- plugin_manager.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin_manager.py b/plugin_manager.py index 080bae1..3567f00 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -1732,9 +1732,9 @@ class PluginManagerWindow(bui.Window): async def process_search_term(self): while True: await asyncio.sleep(0.2) - try: - filter_text = bui.textwidget(query=self._filter_widget) - except RuntimeError: + if self._filter_widget: + filter_text = bui.textwidget(parent=self._root_widget, query=self._filter_widget) + else: # Search filter widget got destroyed. No point checking for filter text anymore. return if self.selected_category is None: From 94abe80e3adbccfc47abc91d7d0b631852902722 Mon Sep 17 00:00:00 2001 From: Rikko Date: Fri, 8 Dec 2023 23:44:14 +0530 Subject: [PATCH 3/4] Fix a memory leak --- CHANGELOG.md | 5 +++++ index.json | 3 ++- plugin_manager.py | 18 ++++++++++-------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 771981d..4b2423f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ ## Plugin Manager (dd-mm-yyyy) +### 1.0.4 (08-12-2023) + +- Fix a few UI warnings related to 1.7.30. +- Fix a memory leak. + ### 1.0.3 (06-10-2023) - Add a compatibility layer for older builds for API deprecation changes that occured in https://github.com/efroemling/ballistica/blob/master/CHANGELOG.md#1727-build-21282-api-8-2023-08-30 diff --git a/index.json b/index.json index 96d4945..b7b3b17 100644 --- a/index.json +++ b/index.json @@ -1,6 +1,7 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { + "1.0.4": null, "1.0.3": { "api_version": 8, "commit_sha": "2a5ce50", @@ -128,4 +129,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} \ No newline at end of file +} diff --git a/plugin_manager.py b/plugin_manager.py index 3567f00..119d01d 100644 --- a/plugin_manager.py +++ b/plugin_manager.py @@ -30,7 +30,7 @@ from threading import Thread import logging -PLUGIN_MANAGER_VERSION = "1.0.3" +PLUGIN_MANAGER_VERSION = "1.0.4" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" # Current tag can be changed to "staging" or any other branch in # plugin manager repo for testing purpose. @@ -1604,6 +1604,7 @@ class PluginManagerWindow(bui.Window): def _back(self) -> None: from bauiv1lib.settings.allsettings import AllSettingsWindow + del self._last_filter_plugins bui.containerwidget(edit=self._root_widget, transition=self._transition_out) bui.app.ui_v1.set_main_menu_window( @@ -1724,7 +1725,7 @@ class PluginManagerWindow(bui.Window): autoselect=True, maxwidth=search_bar_maxwidth, description=filter_txt) - self._last_filter_text = None + self._last_filter_text = "" self._last_filter_plugins = [] loop.create_task(self.process_search_term()) @@ -1732,11 +1733,10 @@ class PluginManagerWindow(bui.Window): async def process_search_term(self): while True: await asyncio.sleep(0.2) - if self._filter_widget: - filter_text = bui.textwidget(parent=self._root_widget, query=self._filter_widget) - else: + if not self._filter_widget: # Search filter widget got destroyed. No point checking for filter text anymore. return + filter_text = bui.textwidget(parent=self._root_widget, query=self._filter_widget) if self.selected_category is None: continue try: @@ -1835,8 +1835,10 @@ class PluginManagerWindow(bui.Window): raise CategoryDoesNotExist(f"{category} does not exist.") if search_term: - def search_term_filterer(plugin): return self.search_term_filterer(plugin, search_term) - plugins = filter(search_term_filterer, category_plugins) + plugins = filter( + lambda plugin: self.search_term_filterer(plugin, search_term), + category_plugins, + ) else: plugins = category_plugins @@ -1918,7 +1920,7 @@ class PluginManagerWindow(bui.Window): for plugin in self._columnwidget.get_children(): plugin.delete() self.plugins_in_current_view.clear() - self._last_filter_text = None + self._last_filter_text = "" self._last_filter_plugins = [] async def refresh(self): From 1aa6484bbd820f5b99119f9073014cbadf986415 Mon Sep 17 00:00:00 2001 From: rikkolovescats Date: Fri, 8 Dec 2023 18:14:44 +0000 Subject: [PATCH 4/4] [ci] apply-version-metadata --- index.json | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/index.json b/index.json index b7b3b17..df80cfe 100644 --- a/index.json +++ b/index.json @@ -1,7 +1,12 @@ { "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "versions": { - "1.0.4": null, + "1.0.4": { + "api_version": 8, + "commit_sha": "94abe80", + "released_on": "08-12-2023", + "md5sum": "eae81ded9f9acee862c529ca6202cc72" + }, "1.0.3": { "api_version": 8, "commit_sha": "2a5ce50", @@ -129,4 +134,4 @@ "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugins/maps.json" ], "external_source_url": "https://github.com/{repository}/{content_type}/{tag}/category.json" -} +} \ No newline at end of file