Skip to content

Commit cf3ca8d

Browse files
authored
Merge pull request metabrainz#2920 from zas/select_plugin_after_install
Select the plugin that was just installed (in the plugin list widget)
2 parents d70f0aa + 7d1194e commit cf3ca8d

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

picard/ui/options/plugins.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -390,6 +390,9 @@ def _on_plugin_installed(self, plugin_id):
390390
# Now load and refresh the plugin list with updates available
391391
self.load() # This will call set_updates() with the current updates dict
392392

393+
# Select the plugin that was just installed in the plugin list
394+
self.plugin_list.select_plugin(plugin)
395+
393396
self._show_status(_('Plugin "{name}" installed successfully').format(name=plugin_id))
394397
# Refresh the options dialog to show new plugin option pages
395398
if getattr(self, 'dialog', None):

picard/ui/widgets/pluginlistwidget.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,13 @@ def _show_plugin_info(self, plugin):
761761
dialog = PluginInfoDialog(plugin, self)
762762
dialog.exec()
763763

764+
def select_plugin(self, plugin):
765+
"""Select a plugin in the plugin list"""
766+
for i in range(self.tree_widget.topLevelItemCount()):
767+
item = self.tree_widget.topLevelItem(i)
768+
if plugin == item.data(COLUMN_ENABLED, QtCore.Qt.ItemDataRole.UserRole):
769+
self.tree_widget.setCurrentItem(item)
770+
764771

765772
class UninstallPluginDialog(QtWidgets.QMessageBox):
766773
"""Dialog for uninstalling plugins with purge option."""

0 commit comments

Comments
 (0)