From c2d1f5442baf257e56984f16003737e7b01d0b63 Mon Sep 17 00:00:00 2001 From: C-Achard Date: Wed, 14 Jan 2026 16:04:54 +0100 Subject: [PATCH] Update napari plugin activation in launch_napari Replaces the menu action trigger for activating the 'napari-deeplabcut' plugin with a direct call to add the 'Keypoint controls' dock widget. Safer and required to use new plugin code from https://github.com/DeepLabCut/napari-deeplabcut/pull/153 --- deeplabcut/gui/widgets.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/deeplabcut/gui/widgets.py b/deeplabcut/gui/widgets.py index 95d1cf9988..085fdd1682 100644 --- a/deeplabcut/gui/widgets.py +++ b/deeplabcut/gui/widgets.py @@ -38,10 +38,10 @@ def launch_napari(files=None, plugin="napari-deeplabcut", stack=False): viewer = napari.Viewer() if plugin == "napari-deeplabcut": # Automatically activate the napari-deeplabcut plugin - for action in viewer.window.plugins_menu.actions(): - if "deeplabcut" in action.text(): - action.trigger() - break + _, _ = viewer.window.add_plugin_dock_widget( + "napari-deeplabcut", + "Keypoint controls", + ) if files is not None: viewer.open(files, plugin=plugin, stack=stack) return viewer