Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
174 commits
Select commit Hold shift + click to select a range
7a7f14c
feat: use app-model WIP
tlambert03 Jul 3, 2022
8241dc2
partially fixed circ imports
tlambert03 Jul 3, 2022
6fec004
bring back some menus with lazy import
tlambert03 Jul 3, 2022
00ca1a6
wip
tlambert03 Jul 5, 2022
7073aa3
incorporate changes from app-model and ino
tlambert03 Jul 6, 2022
2c12cb7
remove old code
tlambert03 Jul 6, 2022
6e93b9b
remove more
tlambert03 Jul 6, 2022
197268a
add app-model dep
tlambert03 Jul 6, 2022
29d7e1b
remove module from typecheck
tlambert03 Jul 6, 2022
d81a277
Merge branch 'main' into use-app-model
tlambert03 Jul 6, 2022
9e42378
small changes
tlambert03 Jul 6, 2022
eb0958c
Merge branch 'main' into use-app-model
tlambert03 Jul 8, 2022
6ee215b
Merge branch 'main' into use-app-model
tlambert03 Jul 13, 2022
cd41480
remove not gc.collect assertion
tlambert03 Jul 13, 2022
adf237f
reduce test code
tlambert03 Jul 13, 2022
3f8978c
add comments about context objects
tlambert03 Jul 13, 2022
27a495f
add in-n-out to deps
tlambert03 Jul 13, 2022
168e890
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 13, 2022
b0c742e
fix test
tlambert03 Jul 13, 2022
5832656
Merge branch 'use-app-model' of https://github.com/tlambert03/napari …
tlambert03 Jul 13, 2022
0cbad81
bump in-n-out min ver
tlambert03 Jul 14, 2022
86ab609
Merge branch 'main' into use-app-model
tlambert03 Jul 14, 2022
8a6bd5b
refactor: add constants module, add test for menu building
tlambert03 Jul 14, 2022
34fb5cb
add __all__ to constants
tlambert03 Jul 14, 2022
94aa8fd
add some tests
tlambert03 Jul 14, 2022
26b54ce
add more comments
tlambert03 Jul 14, 2022
543e411
bump app-model
tlambert03 Jul 14, 2022
dca809f
add internal documentation
tlambert03 Jul 14, 2022
dc5cd29
add motivations and vision
tlambert03 Jul 14, 2022
f496c4c
bump version, raise synchronous errors
tlambert03 Jul 16, 2022
9bee5d6
Merge branch 'main' into use-app-model
tlambert03 Jul 18, 2022
3f94e6f
Merge branch 'main' into use-app-model
tlambert03 Jul 18, 2022
c344b99
Merge branch 'main' into use-app-model
tlambert03 Jul 19, 2022
4020d12
comment navigation global
tlambert03 Jul 20, 2022
022c353
Merge branch 'main' into use-app-model
tlambert03 Jul 23, 2022
64e578f
lenient test
tlambert03 Jul 23, 2022
dedae8c
Update docs/guides/app_model.md
tlambert03 Jul 23, 2022
ee62f69
Update napari/_app/actions/_layer_actions.py
tlambert03 Jul 23, 2022
b144796
Update napari/_qt/widgets/_tests/test_qt_extension2reader.py
tlambert03 Jul 24, 2022
a7aa93c
Merge branch 'main' into use-app-model
tlambert03 Jul 24, 2022
e4e0541
rename module
tlambert03 Jul 24, 2022
941a55c
use get_app getter
tlambert03 Jul 24, 2022
6b712f1
bump appmodel
tlambert03 Jul 24, 2022
846bb01
fix comment
tlambert03 Jul 24, 2022
300aa7d
add comment
tlambert03 Jul 24, 2022
d891e7f
move layer actions constants
tlambert03 Jul 24, 2022
d3b0f9c
clarify expression
tlambert03 Jul 24, 2022
2f46b67
update docs
tlambert03 Jul 24, 2022
4346ce6
add tests
tlambert03 Jul 24, 2022
886dcf0
Merge branch 'main' into use-app-model
tlambert03 Jul 26, 2022
c98e847
stub out file actions
tlambert03 Jul 26, 2022
96bfbb2
wip
tlambert03 Jul 26, 2022
951bb07
mostly working file menu
tlambert03 Jul 26, 2022
7a78461
fix token
tlambert03 Jul 26, 2022
08cf2fd
Merge branch 'main' into use-app-model
tlambert03 Jul 29, 2022
9845504
update docs
tlambert03 Jul 29, 2022
8acf813
add comment to layer actions
tlambert03 Jul 29, 2022
2bd8231
add comment to named tuple
tlambert03 Jul 29, 2022
242f63c
more comments for nathan
tlambert03 Jul 29, 2022
9e3e248
add comment
tlambert03 Jul 29, 2022
83a36b0
Merge branch 'use-app-model' into appmodel-file-menu
tlambert03 Jul 29, 2022
69596c6
Merge branch 'main' into appmodel-file-menu
tlambert03 Aug 1, 2022
d2b7f9d
Merge branch 'main' into appmodel-file-menu
tlambert03 Aug 3, 2022
2182101
add shortcut
lucyleeow Oct 4, 2022
3399e95
use Q_FILE_ACTIONS
lucyleeow Oct 5, 2022
3eb254f
merge main
lucyleeow Oct 7, 2022
0c01046
update rebuild_samples_menu to build app-model actions
lucyleeow Oct 7, 2022
5decbc2
build samples menu in npe2
lucyleeow Oct 20, 2022
2baafb9
remove comment
lucyleeow Oct 20, 2022
285f1da
add comment
lucyleeow Oct 20, 2022
a0afb62
amend comment
lucyleeow Oct 20, 2022
4b08472
merge main
lucyleeow Oct 20, 2022
4a334dd
fix mypy error
lucyleeow Oct 20, 2022
272b201
separate npe1 and npe2 sample menu building
lucyleeow Oct 21, 2022
97d52ff
remove args in add_sample
lucyleeow Oct 21, 2022
92c7863
wip action id
lucyleeow Oct 25, 2022
22de88c
add _get_sample_data_id
lucyleeow Oct 25, 2022
b4a2c98
try fix mypy action id
lucyleeow Oct 26, 2022
ff0b917
fix mypy in manifest to actions
lucyleeow Oct 26, 2022
6a68aee
merge main
lucyleeow May 30, 2023
6d7c3c3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] May 30, 2023
ad748ba
use display name as per 5366
lucyleeow May 30, 2023
365797b
move show_shortcuts
lucyleeow Jun 2, 2023
0916ca9
update pref keybinding
lucyleeow Jun 5, 2023
c467ca1
Merge branch 'main' into appmodel-file-menu
lucyleeow Jun 5, 2023
6510c8d
move open with plugin, add window to commands
lucyleeow Jun 5, 2023
f306858
use display name for npe2 samples
lucyleeow Jun 5, 2023
671f103
use menugroup
lucyleeow Jun 5, 2023
549deb8
fix enablement
lucyleeow Jun 7, 2023
c1678bc
fix when bundle
lucyleeow Jun 7, 2023
5eb3be8
fix typo command id
lucyleeow Jun 8, 2023
183927c
rm file_menu.py
lucyleeow Jun 8, 2023
0f0dc07
Merge branch 'main' into appmodel-file-menu
lucyleeow Jun 8, 2023
2316b45
first attempt - working layerlist context
lucyleeow Jun 13, 2023
2ae7e2e
clean up adding layer context
lucyleeow Jun 14, 2023
d58d193
add save selected layers
lucyleeow Jun 14, 2023
09682cf
use ctrl alt s for save all layers
lucyleeow Jun 14, 2023
b3b0b55
clean up
lucyleeow Jun 14, 2023
b560920
fix save selected layers
lucyleeow Jun 26, 2023
a299f75
Merge branch 'main' into appmodel-file-menu
lucyleeow Jun 26, 2023
6e9cfe5
dont use running_as_bundled_app
lucyleeow Jun 27, 2023
45f3498
Merge branch 'main' into appmodel-file-menu
lucyleeow Jun 30, 2023
5ef5da0
connect npe2 samples menu to plugin deactivate, fix npe1 samples menu
lucyleeow Jun 30, 2023
ad79b46
remove old NapariMenu file menu in window teardown
lucyleeow Jun 30, 2023
95fa95e
typos
lucyleeow Jun 30, 2023
99f32c1
amend variable names
lucyleeow Jul 3, 2023
8202572
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jul 3, 2023
b7e87f8
fix display name use;
lucyleeow Jul 3, 2023
8a0b559
add npe2 sample menu test
lucyleeow Jul 3, 2023
2dbbe2b
fix typing
lucyleeow Jul 3, 2023
2525e2c
Merge branch 'main' into appmodel-file-menu
lucyleeow Jul 3, 2023
02603e4
use register_actions
lucyleeow Jul 3, 2023
a8c41cd
ammend return types
lucyleeow Jul 3, 2023
af824b1
format, update comment
lucyleeow Jul 4, 2023
23ac6c5
fix typo conftest
lucyleeow Jul 4, 2023
dd70d27
carry through _open_preferences_dialog name/location change
lucyleeow Jul 5, 2023
b3061f6
update _pref_dialog location in test
lucyleeow Jul 5, 2023
bf0ca5f
update multi sample test after sample menu changes
lucyleeow Jul 5, 2023
b5c1f05
typo
lucyleeow Jul 5, 2023
1e8c5e0
update comment
lucyleeow Jul 5, 2023
b3c2bd9
update read test, use handle_gui_reading
lucyleeow Jul 6, 2023
33a1913
add test for sample menu
lucyleeow Jul 6, 2023
440b5ad
remove sample menu test from test_smaple_data
lucyleeow Jul 6, 2023
77f66b3
clear cache in fixture, fix test menus
lucyleeow Jul 8, 2023
8e4856d
Merge branch 'main' into appmodel-file-menu
lucyleeow Jul 9, 2023
5a7a02c
try moving qt import in npe2
lucyleeow Jul 10, 2023
4671be6
update note in mock app fixture
lucyleeow Jul 10, 2023
b6acf9a
clear cache in note in mock app fixture
lucyleeow Jul 10, 2023
31f04e3
amend wording in mock app
lucyleeow Jul 10, 2023
5a28f14
[skip ci] try skip
lucyleeow Jul 10, 2023
2aee0a3
empty trigger ci
lucyleeow Jul 10, 2023
603bfe4
improve manifest to actions
lucyleeow Jul 11, 2023
44d29d8
fix handle_gui_reading
lucyleeow Jul 11, 2023
5477835
use getatttr
lucyleeow Jul 13, 2023
42d519b
Merge branch 'main' into appmodel-file-menu
lucyleeow Jul 13, 2023
aec9ac3
use new close/quit from 4820
lucyleeow Jul 14, 2023
1c16bd6
revert getattr as attr can be None
lucyleeow Jul 14, 2023
fdc1fcb
type checking
lucyleeow Jul 14, 2023
43ccced
type checking
lucyleeow Jul 14, 2023
c615592
amend mf iterating in npe2
lucyleeow Jul 14, 2023
64bae52
add update enabled test
lucyleeow Jul 14, 2023
c1878e1
comment
lucyleeow Jul 14, 2023
c02f576
review
lucyleeow Jul 17, 2023
9fdec0e
try remove lambda in update enabled
lucyleeow Jul 17, 2023
0a8ba18
revert update enabled
lucyleeow Jul 17, 2023
1935ddd
test save actions updated
lucyleeow Jul 17, 2023
5b3b8c3
amend fun name to _update_menu_state
lucyleeow Jul 17, 2023
b827a44
carry through fun name change to _update_menu_state
lucyleeow Jul 17, 2023
5c6b30e
add test for _update_menu_state
lucyleeow Jul 17, 2023
5ad66b4
add disconnect
lucyleeow Jul 17, 2023
2457634
revert disconnect
lucyleeow Jul 18, 2023
91a4038
empty CI
lucyleeow Jul 25, 2023
a307cdc
merge main
lucyleeow Aug 2, 2023
f87b8b0
amend new test_open_sample_data_shows_all_readers test for app model
lucyleeow Aug 2, 2023
23ceb41
use qt viewer provider
lucyleeow Aug 2, 2023
a7a67f4
Merge branch 'main' into appmodel-file-menu
lucyleeow Aug 2, 2023
172f1ea
Merge branch 'main' into appmodel-file-menu
lucyleeow Aug 4, 2023
1c990cc
try fix qt viewer leak, destroy action
lucyleeow Aug 7, 2023
81bcde2
check clear instances
lucyleeow Aug 7, 2023
150df7f
try action destroy
lucyleeow Aug 7, 2023
f695e7a
just clear qtviewer
lucyleeow Aug 7, 2023
6bfacc8
try fix viewer leak: setdata None
lucyleeow Aug 7, 2023
1b6dc8b
check test sample
lucyleeow Aug 7, 2023
4687549
revert clear qtviewer
lucyleeow Aug 8, 2023
9d0cb1a
Merge branch 'main' into appmodel-file-menu
lucyleeow Aug 8, 2023
df3139c
fix test
lucyleeow Aug 9, 2023
19967ef
make test more unit
lucyleeow Aug 9, 2023
984433a
Merge branch 'main' into appmodel-file-menu
lucyleeow Aug 9, 2023
6d70692
review
lucyleeow Aug 14, 2023
188dd6c
mv test file
lucyleeow Aug 20, 2023
e6cf923
merge main
lucyleeow Aug 25, 2023
d453507
Merge branch 'main' into appmodel-file-menu
lucyleeow Aug 30, 2023
33ab757
move back test_file_menu
lucyleeow Aug 30, 2023
729b2c9
Merge branch 'main' into appmodel-file-menu
DragaDoncila Sep 3, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions napari/_app_model/_submenus.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,24 @@
enablement=LLSCK.active_layer_is_image_3d,
),
),
(
MenuId.MENUBAR_FILE,
SubmenuItem(
submenu=MenuId.FILE_OPEN_WITH_PLUGIN,
title=trans._('Open with Plugin'),
group=MenuGroup.NAVIGATION,
order=99,
),
),
(
MenuId.MENUBAR_FILE,
SubmenuItem(
submenu=MenuId.FILE_SAMPLES,
title=trans._('Open Sample'),
group=MenuGroup.NAVIGATION,
order=100,
Comment thread
DragaDoncila marked this conversation as resolved.
),
),
(
MenuId.MENUBAR_VIEW,
SubmenuItem(submenu=MenuId.VIEW_AXES, title=trans._('Axes')),
Expand Down
8 changes: 6 additions & 2 deletions napari/_app_model/actions/_view_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from app_model.types import Action, ToggleRule

from napari._app_model.actions._toggle_action import ViewerToggleAction
from napari._app_model.constants import CommandId, MenuId
from napari._app_model.constants import CommandId, MenuGroup, MenuId
from napari.settings import get_settings

VIEW_ACTIONS: List[Action] = []
Expand Down Expand Up @@ -53,7 +53,11 @@ def _get_current_tooltip_visibility():
id=CommandId.TOGGLE_LAYER_TOOLTIPS,
title=CommandId.TOGGLE_LAYER_TOOLTIPS.title,
menus=[
{'id': MenuId.MENUBAR_VIEW, 'group': '1_render', 'order': 10}
{
'id': MenuId.MENUBAR_VIEW,
'group': MenuGroup.RENDER,
'order': 10,
}
],
callback=_tooltip_visibility_toggle,
toggled=ToggleRule(get_current=_get_current_tooltip_visibility),
Expand Down
37 changes: 37 additions & 0 deletions napari/_app_model/constants/_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,25 @@
# fmt: off
class CommandId(str, Enum):
"""Id representing a napari command."""
# File menubar
DLG_OPEN_FILES = 'napari:window:file:open_files_dialog'
DLG_OPEN_FILES_AS_STACK = 'napari:window:file:open_files_as_stack_dialog'
DLG_OPEN_FOLDER = 'napari:window:file:open_folder_dialog'
DLG_OPEN_FILES_WITH_PLUGIN = 'napari:window:file:_open_files_with_plugin'
DLG_OPEN_FILES_AS_STACK_WITH_PLUGIN = 'napari:window:file:_open_files_as_stack_with_plugin'
DLG_OPEN_FOLDER_WITH_PLUGIN = 'napari:window:file:_open_folder_with_plugin'
DLG_SHOW_PREFERENCES = 'napari:window:file:show_preferences_dialog'
DLG_SAVE_LAYERS = 'napari:window:file:save_layers_dialog'
# `DLG_SAVE_SELECTED_LAYERS` uses the same callback as `DLG_SAVE_LAYERS`,
# just with different kwarg
DLG_SAVE_SELECTED_LAYERS = 'napari:window:file:save_layers_dialog:selected'
DLG_SAVE_CANVAS_SCREENSHOT = 'napari:window:file:save_canvas_screenshot_dialog'
DLG_SAVE_VIEWER_SCREENSHOT = 'napari:window:file:save_viewer_screenshot_dialog'
COPY_CANVAS_SCREENSHOT = 'napari:window:file:copy_canvas_screenshot'
COPY_VIEWER_SCREENSHOT = 'napari:window:file:copy_viewer_screenshot'
DLG_CLOSE = 'napari:window:file:close_dialog'
DLG_QUIT = 'napari:window:file:quit_dialog'
RESTART = 'napari:window:file:restart'

# View menubar
TOGGLE_FULLSCREEN = 'napari:window:view:toggle_fullscreen'
Expand Down Expand Up @@ -92,6 +111,24 @@ class _i(NamedTuple):


_COMMAND_INFO = {
# File menubar
CommandId.DLG_OPEN_FILES: _i(trans._('Open File(s)...')),
CommandId.DLG_OPEN_FILES_AS_STACK: _i(trans._('Open Files as Stack...')),
CommandId.DLG_OPEN_FOLDER: _i(trans._('Open Folder...')),
CommandId.DLG_OPEN_FILES_WITH_PLUGIN: _i(trans._('Open File(s)...')),
CommandId.DLG_OPEN_FILES_AS_STACK_WITH_PLUGIN: _i(trans._('Open Files as Stack...')),
CommandId.DLG_OPEN_FOLDER_WITH_PLUGIN: _i(trans._('Open Folder...')),
CommandId.DLG_SHOW_PREFERENCES: _i(trans._('Preferences')),
CommandId.DLG_SAVE_LAYERS: _i(trans._('Save All Layers...')),
CommandId.DLG_SAVE_SELECTED_LAYERS: _i(trans._('Save Selected Layers...')),
CommandId.DLG_SAVE_CANVAS_SCREENSHOT: _i(trans._('Save Screenshot...')),
CommandId.DLG_SAVE_VIEWER_SCREENSHOT: _i(trans._('Save Screenshot with Viewer...')),
CommandId.COPY_CANVAS_SCREENSHOT: _i(trans._('Copy Screenshot to Clipboard')),
CommandId.COPY_VIEWER_SCREENSHOT: _i(trans._('Copy Screenshot with Viewer to Clipboard')),
CommandId.DLG_CLOSE: _i(trans._('Close Window')),
CommandId.DLG_QUIT: _i(trans._('Exit')),
CommandId.RESTART: _i(trans._('Restart')),

# View menubar
CommandId.TOGGLE_FULLSCREEN: _i(trans._('Toggle Full Screen')),
CommandId.TOGGLE_MENUBAR: _i(trans._('Toggle Menubar Visibility')),
Expand Down
7 changes: 7 additions & 0 deletions napari/_app_model/constants/_menus.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
class MenuId(str, Enum):
"""Id representing a menu somewhere in napari."""

MENUBAR_FILE = 'napari/file'
FILE_OPEN_WITH_PLUGIN = 'napari/file/open_with_plugin'
FILE_SAMPLES = 'napari/file/samples'

MENUBAR_VIEW = 'napari/view'
VIEW_AXES = 'napari/view/axes'
VIEW_SCALEBAR = 'napari/view/scalebar'
Expand All @@ -35,6 +39,9 @@ def __str__(self) -> str:
class MenuGroup:
NAVIGATION = 'navigation' # always the first group in any menu
RENDER = '1_render'
PREFERENCES = '2_preferences'
SAVE = '3_save'
CLOSE = '4_close'

class LAYERLIST_CONTEXT:
CONVERSION = '1_conversion'
Expand Down
75 changes: 56 additions & 19 deletions napari/_qt/_qapp_model/_tests/test_qapp_model_menus.py
Original file line number Diff line number Diff line change
@@ -1,28 +1,65 @@
from unittest.mock import MagicMock

import numpy as np
import pytest
from app_model.types import Action

from napari import viewer
from napari._app_model import constants, get_app
from napari._app_model import get_app
from napari._app_model.constants import MenuId
from napari._app_model.context import LayerListContextKeys as LLCK
from napari._qt._qapp_model import build_qmodel_menu
from napari._qt._qapp_model.qactions import init_qactions
from napari._qt.qt_main_window import Window
from napari.layers import Image


@pytest.mark.parametrize('menu_id', list(constants.MenuId))
def test_build_qmodel_menu(qtbot, menu_id):
"""Test that we can build qmenus for all registered menu IDs"""
# `builtins` required so there are samples registered, so samples menu exists
@pytest.mark.parametrize('menu_id', list(MenuId))
def test_build_qmodel_menu(builtins, make_napari_viewer, qtbot, menu_id):
"""Test that we can build qmenus for all registered menu IDs."""
app = get_app()

mock = MagicMock()
with app.injection_store.register(
providers={viewer.Viewer: lambda: mock, Window: lambda: mock}
):
Comment on lines -18 to -20
Copy link
Copy Markdown
Contributor

@lucyleeow lucyleeow Jul 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Injection not needed because we register providers in init_qactions, similar to suggestion here: https://github.com/napari/napari/pull/4977/files#r1013731145

init_qactions.cache_clear()
init_qactions()
# Configures `app`, registers actions and initializes plugins
make_napari_viewer()

menu = build_qmodel_menu(menu_id)
qtbot.addWidget(menu)

# `>=` because separator bars count as actions
assert len(menu.actions()) >= len(app.menus.get_menu(menu_id))


def test_update_menu_state_context(make_napari_viewer):
"""Test `_update_menu_state` correctly updates enabled/visible state."""
app = get_app()
viewer = make_napari_viewer()

action = Action(
id='dummy_id',
title='dummy title',
callback=lambda: None,
menus=[{'id': MenuId.MENUBAR_FILE, 'when': (LLCK.num_layers > 0)}],
enablement=(LLCK.num_layers == 2),
)
app.register_action(action)

dummy_action = viewer.window.file_menu.findAction('dummy_id')

assert 'dummy_id' in app.commands
assert len(viewer.layers) == 0
# `dummy_action` should be disabled & not visible as num layers == 0
viewer.window._update_menu_state('file_menu')
assert not dummy_action.isVisible()
assert not dummy_action.isEnabled()

menu = build_qmodel_menu(menu_id)
qtbot.addWidget(menu)
layer_a = Image(np.random.random((10, 10)))
viewer.layers.append(layer_a)
assert len(viewer.layers) == 1
viewer.window._update_menu_state('file_menu')
# `dummy_action` should be visible but not enabled after adding layer
assert dummy_action.isVisible()
assert not dummy_action.isEnabled()

# `>=` because separator bars count as actions
assert len(menu.actions()) >= len(app.menus.get_menu(menu_id))
layer_b = Image(np.random.random((10, 10)))
viewer.layers.append(layer_b)
assert len(viewer.layers) == 2
# `dummy_action` should be enabled and visible after adding second layer
viewer.window._update_menu_state('file_menu')
assert dummy_action.isVisible()
assert dummy_action.isEnabled()
4 changes: 2 additions & 2 deletions napari/_qt/_qapp_model/qactions/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ def init_qactions() -> None:
"""

from napari._app_model import get_app
from napari._qt._qapp_model.qactions._file import Q_FILE_ACTIONS
from napari._qt._qapp_model.qactions._help import Q_HELP_ACTIONS
from napari._qt._qapp_model.qactions._view import Q_VIEW_ACTIONS
from napari._qt.qt_main_window import Window, _QtMainWindow
Expand Down Expand Up @@ -51,5 +52,4 @@ def _provide_qt_viewer() -> Optional[QtViewer]:
return None

# register actions
for action in chain(Q_VIEW_ACTIONS, Q_HELP_ACTIONS):
app.register_action(action)
app.register_actions(chain(Q_FILE_ACTIONS, Q_HELP_ACTIONS, Q_VIEW_ACTIONS))
Loading