fix(ui): don't reload preview after applying macros

This commit is contained in:
Travis Abendshien
2025-08-15 19:05:37 -07:00
parent 1110f64ff5
commit 7cf769c5ed
2 changed files with 5 additions and 5 deletions

View File

@@ -1099,13 +1099,13 @@ class QtDriver(DriverMixin, QObject):
yield 0
def run_macros(self, macro_name: str, entry_ids: list[int]):
"""Run a specific Macro on a group of given entry_ids."""
"""Run a Macro on a list of entires."""
for entry_id in entry_ids:
self.run_macro(macro_name, entry_id)
self.main_window.preview_panel.update_preview()
self.main_window.preview_panel.refresh_selection(update_preview=False)
def run_macro(self, macro_name: str, entry_id: int):
"""Run a specific Macro on an Entry given a Macro name."""
"""Run a Macro on a single entry."""
if not self.lib.library_dir:
logger.error("[QtDriver] Can't run macro when no library is open!")
return

View File

@@ -133,9 +133,9 @@ class PreviewPanelView(QWidget):
def _set_selection_callback(self):
raise NotImplementedError()
def update_preview(self):
def refresh_selection(self, update_preview: bool = True):
"""Refresh the panel's widgets to use current library data."""
self.set_selection(self._selected)
self.set_selection(self._selected, update_preview)
def set_selection(self, selected: list[int] | None = None, update_preview: bool = True):
"""Render the panel widgets with the newest data from the Library.