-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Load child WebModule named via the new subModule Zone property - For the child, restrict Node search to its Zone - For the parent, exclude child's Node from search - For the child, don't respond to Marker or Zone gestures unless caret is in Zone - Add new Rule Type "globalMarker" which can be triggered from anywhere, with priority given to children - Menu actions target the WebModule at caret position - Menu "Edit WebModule" presents when suitable a list of options from caret to root
- Loading branch information
1 parent
f95bde3
commit f6b68eb
Showing
12 changed files
with
235 additions
and
110 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,7 +22,7 @@ | |
"""Web Access GUI.""" | ||
|
||
|
||
__version__ = "2024.08.25" | ||
__version__ = "2024.08.26" | ||
__authors__ = ( | ||
"Julien Cochuyt <[email protected]>", | ||
"André-Abush Clause <[email protected]>", | ||
|
@@ -33,6 +33,7 @@ | |
import wx | ||
|
||
import addonHandler | ||
import config | ||
import gui | ||
|
||
from ... import webAccess | ||
|
@@ -80,7 +81,20 @@ def __init__(self, context): | |
_("&New web module...")) | ||
self.Bind(wx.EVT_MENU, self.onWebModuleCreate, item) | ||
|
||
if webModule: | ||
stack = context.get("webModuleStackAtCaret", []).copy() | ||
if stack: | ||
subMenu = wx.Menu() | ||
while stack: | ||
mod = stack.pop(0) | ||
handler = lambda evt, webModule=mod: self.onWebModuleEdit(evt, webModule=webModule) | ||
item = subMenu.Append(wx.ID_ANY, mod.name) | ||
subMenu.Bind(wx.EVT_MENU, handler, item) | ||
self.AppendSubMenu( | ||
subMenu, | ||
# Translators: Web Access menu item label. | ||
_("Edit &web module") | ||
) | ||
elif webModule: | ||
item = self.Append( | ||
wx.ID_ANY, | ||
# Translators: Web Access menu item label. | ||
|
@@ -97,6 +111,16 @@ def __init__(self, context): | |
|
||
self.AppendSeparator() | ||
|
||
if config.conf["webAccess"]["devMode"]: | ||
item = self.Append( | ||
wx.ID_ANY, | ||
# Translators: Web Access menu item label. | ||
_("&Element description...") | ||
) | ||
self.Bind(wx.EVT_MENU, self.onElementDescription, item) | ||
|
||
self.AppendSeparator() | ||
|
||
item = self.AppendCheckItem( | ||
wx.ID_ANY, | ||
# Translators: Web Access menu item label. | ||
|
@@ -110,6 +134,11 @@ def show(self): | |
gui.mainFrame.PopupMenu(self) | ||
gui.mainFrame.postPopup() | ||
|
||
@guarded | ||
def onElementDescription(self, evt): | ||
from .elementDescription import showElementDescriptionDialog | ||
showElementDescriptionDialog() | ||
|
||
@guarded | ||
def onRuleCreate(self, evt): | ||
self.context["new"] = True | ||
|
@@ -122,13 +151,14 @@ def onRulesManager(self, evt): | |
show(self.context, gui.mainFrame) | ||
|
||
@guarded | ||
def onWebModuleCreate(self, evt): | ||
self.context["new"] = True | ||
from .webModuleEditor import show | ||
show(self.context, gui.mainFrame) | ||
def onSubModuleEdit(self, evt, webModule): | ||
from logHandler import log | ||
log.info(f"onSubModuleEdit: {dir(evt)}") | ||
|
||
@guarded | ||
def onWebModuleEdit(self, evt): | ||
def onWebModuleEdit(self, evt, webModule=None): | ||
if webModule is not None: | ||
self.context["webModule"] = webModule | ||
from .webModuleEditor import show | ||
show(self.context) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.