Merge pull request #204 from Freaku17/main

Fix warning in 1.7.30
This commit is contained in:
rikkolovescats 2023-12-08 23:49:32 +05:30 committed by GitHub
commit 7d2c0bf4f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 21 deletions

View file

@ -1,5 +1,10 @@
## Plugin Manager (dd-mm-yyyy) ## 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) ### 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 - 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

View file

@ -1,6 +1,12 @@
{ {
"plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py", "plugin_manager_url": "https://github.com/bombsquad-community/plugin-manager/{content_type}/{tag}/plugin_manager.py",
"versions": { "versions": {
"1.0.4": {
"api_version": 8,
"commit_sha": "94abe80",
"released_on": "08-12-2023",
"md5sum": "eae81ded9f9acee862c529ca6202cc72"
},
"1.0.3": { "1.0.3": {
"api_version": 8, "api_version": 8,
"commit_sha": "2a5ce50", "commit_sha": "2a5ce50",

View file

@ -30,7 +30,7 @@ from threading import Thread
import logging import logging
PLUGIN_MANAGER_VERSION = "1.0.3" PLUGIN_MANAGER_VERSION = "1.0.4"
REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager" REPOSITORY_URL = "https://github.com/bombsquad-community/plugin-manager"
# Current tag can be changed to "staging" or any other branch in # Current tag can be changed to "staging" or any other branch in
# plugin manager repo for testing purpose. # plugin manager repo for testing purpose.
@ -1604,10 +1604,12 @@ class PluginManagerWindow(bui.Window):
def _back(self) -> None: def _back(self) -> None:
from bauiv1lib.settings.allsettings import AllSettingsWindow from bauiv1lib.settings.allsettings import AllSettingsWindow
del self._last_filter_plugins
bui.containerwidget(edit=self._root_widget, bui.containerwidget(edit=self._root_widget,
transition=self._transition_out) transition=self._transition_out)
bui.app.ui_v1.set_main_menu_window( 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 @contextlib.contextmanager
def exception_handler(self): def exception_handler(self):
@ -1723,7 +1725,7 @@ class PluginManagerWindow(bui.Window):
autoselect=True, autoselect=True,
maxwidth=search_bar_maxwidth, maxwidth=search_bar_maxwidth,
description=filter_txt) description=filter_txt)
self._last_filter_text = None self._last_filter_text = ""
self._last_filter_plugins = [] self._last_filter_plugins = []
loop.create_task(self.process_search_term()) loop.create_task(self.process_search_term())
@ -1731,11 +1733,10 @@ class PluginManagerWindow(bui.Window):
async def process_search_term(self): async def process_search_term(self):
while True: while True:
await asyncio.sleep(0.2) await asyncio.sleep(0.2)
try: if not self._filter_widget:
filter_text = bui.textwidget(query=self._filter_widget)
except RuntimeError:
# Search filter widget got destroyed. No point checking for filter text anymore. # Search filter widget got destroyed. No point checking for filter text anymore.
return return
filter_text = bui.textwidget(parent=self._root_widget, query=self._filter_widget)
if self.selected_category is None: if self.selected_category is None:
continue continue
try: try:
@ -1834,8 +1835,10 @@ class PluginManagerWindow(bui.Window):
raise CategoryDoesNotExist(f"{category} does not exist.") raise CategoryDoesNotExist(f"{category} does not exist.")
if search_term: if search_term:
def search_term_filterer(plugin): return self.search_term_filterer(plugin, search_term) plugins = filter(
plugins = filter(search_term_filterer, category_plugins) lambda plugin: self.search_term_filterer(plugin, search_term),
category_plugins,
)
else: else:
plugins = category_plugins plugins = category_plugins
@ -1917,7 +1920,7 @@ class PluginManagerWindow(bui.Window):
for plugin in self._columnwidget.get_children(): for plugin in self._columnwidget.get_children():
plugin.delete() plugin.delete()
self.plugins_in_current_view.clear() self.plugins_in_current_view.clear()
self._last_filter_text = None self._last_filter_text = ""
self._last_filter_plugins = [] self._last_filter_plugins = []
async def refresh(self): async def refresh(self):
@ -2392,8 +2395,8 @@ class NewAllSettingsWindow(bui.Window):
) )
assert bui.app.classic is not None assert bui.app.classic is not None
bui.app.ui_v1.set_main_menu_window( 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: def _do_controllers(self) -> None:
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
@ -2405,8 +2408,8 @@ class NewAllSettingsWindow(bui.Window):
bui.app.ui_v1.set_main_menu_window( bui.app.ui_v1.set_main_menu_window(
ControlsSettingsWindow( ControlsSettingsWindow(
origin_widget=self._controllers_button origin_widget=self._controllers_button
).get_root_widget() ).get_root_widget(),
) from_window=self._root_widget,)
def _do_graphics(self) -> None: def _do_graphics(self) -> None:
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
@ -2418,8 +2421,8 @@ class NewAllSettingsWindow(bui.Window):
bui.app.ui_v1.set_main_menu_window( bui.app.ui_v1.set_main_menu_window(
GraphicsSettingsWindow( GraphicsSettingsWindow(
origin_widget=self._graphics_button origin_widget=self._graphics_button
).get_root_widget() ).get_root_widget(),
) from_window=self._root_widget,)
def _do_audio(self) -> None: def _do_audio(self) -> None:
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
@ -2431,8 +2434,8 @@ class NewAllSettingsWindow(bui.Window):
bui.app.ui_v1.set_main_menu_window( bui.app.ui_v1.set_main_menu_window(
AudioSettingsWindow( AudioSettingsWindow(
origin_widget=self._audio_button origin_widget=self._audio_button
).get_root_widget() ).get_root_widget(),
) from_window=self._root_widget,)
def _do_advanced(self) -> None: def _do_advanced(self) -> None:
# pylint: disable=cyclic-import # pylint: disable=cyclic-import
@ -2444,8 +2447,8 @@ class NewAllSettingsWindow(bui.Window):
bui.app.ui_v1.set_main_menu_window( bui.app.ui_v1.set_main_menu_window(
AdvancedSettingsWindow( AdvancedSettingsWindow(
origin_widget=self._advanced_button origin_widget=self._advanced_button
).get_root_widget() ).get_root_widget(),
) from_window=self._root_widget,)
def _do_modmanager(self) -> None: def _do_modmanager(self) -> None:
self._save_state() self._save_state()
@ -2453,8 +2456,8 @@ class NewAllSettingsWindow(bui.Window):
bui.app.ui_v1.set_main_menu_window( bui.app.ui_v1.set_main_menu_window(
PluginManagerWindow( PluginManagerWindow(
origin_widget=self._modmgr_button origin_widget=self._modmgr_button
).get_root_widget() ).get_root_widget(),
) from_window=self._root_widget,)
def _save_state(self) -> None: def _save_state(self) -> None:
try: try: