@@ -127,10 +127,20 @@ This is because command id's may currently only be registered once, and associat
127
127
128
128
### ` Action ` s in napari
129
129
130
- In napari, non-Qt ` Action ` s are defined in
131
- [ ` napari/_app_model/actions ` ] ( https://github.com/napari/napari/tree/main/napari/_app_model/actions )
132
- while Qt ` Action ` s are defined in
133
- [ ` napari/_qt/_qapp_model/qactions ` ] ( https://github.com/napari/napari/tree/main/napari/_qt/_qapp_model/qactions ) .
130
+ In napari, menu bar actions are defined in
131
+ [ ` napari/_qt/_qapp_model/qactions ` ] ( https://github.com/napari/napari/tree/main/napari/_qt/_qapp_model/qactions ) ,
132
+ with one file per menu.
133
+ While not all menu bar actions strictly require Qt, they are defined for the purpose
134
+ of living in a menu and are thus considered 'GUI' actions.
135
+ This also ensures that there is only one file defining both actions and their
136
+ submenus.
137
+ Note if we move to supporting more GUI backends, we may want to move these out of
138
+ ` _qt/ ` to a shared ` gui/ ` folder, depending on implementation.
139
+
140
+ The layer context menu actions do not require a GUI (they only require the ` layerlist ` )
141
+ and thus live in
142
+ [ ` napari/_app_model/actions ` ] ( https://github.com/napari/napari/tree/main/napari/_app_model/actions ) .
143
+
134
144
Non-Qt ` Action ` s get registered with ` app ` during
135
145
initialization of the napari ` app ` , in ` NapariApplication ` 's
136
146
{meth}` ~napari._app_model._app.NapariApplication.__init__ ` . Qt ` Action ` s
@@ -455,18 +465,17 @@ ways will not work:
455
465
456
466
# ## Providers and processors in napari
457
467
458
- Non- Qt providers and processors are defined in
459
- [`napari/ _app_model/ injection` ](https:// github.com/ napari/ napari/ tree/ main/ napari/ _app_model/ injection).
460
- Qt providers and processors are defined in
468
+ Currently there are only GUI related providers and processors.
469
+ They are defined in
461
470
[`napari/ _qt/ _qapp_model/ injection` ](https:// github.com/ napari/ napari/ tree/ main/ napari/ _qt/ _qapp_model/ injection).
471
+ They are registered in {func}`~ napari._qt._qapp_model.qactions.init_qactions` ,
472
+ which gets called during initialization of `_QtMainWindow` . This is the same as
473
+ [registration of `Action` s](app- model- actions- napari).
462
474
463
- Non- Qt providers and processors are registered in the `app` `Store` during
475
+ In future we intend to have non- GUI providers that will supply layer objects.
476
+ They would be registered in the `app` `Store` during
464
477
initialization of the napari `app` , in `NapariApplication` ' s
465
478
{meth}`~ napari._app_model._app.NapariApplication.__init__ ` .
466
- Qt providers and processors are registered in
467
- {func}`~ napari._qt._qapp_model.qactions.init_qactions` , which gets called during
468
- initialization of `_QtMainWindow` . This is the same as
469
- [registration of `Action` s](app- model- actions- napari).
470
479
471
480
(app- model- testing)=
472
481
0 commit comments