Skip to content

Commit

Permalink
gui: Add typing for layer manager lmgr argument when using single window
Browse files Browse the repository at this point in the history
The runtime type can also be lmgr.frame.GMFrame, for both mapdisp.frame.MapPanel and nviz.mapwindow.GLWindow when using single window mode
  • Loading branch information
echoix committed Dec 27, 2024
1 parent 8f12791 commit 2caf671
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 4 deletions.
5 changes: 3 additions & 2 deletions gui/wxpython/mapdisp/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@
from grass.pydispatch.signal import Signal

if TYPE_CHECKING:
from main_window.frame import GMFrame
import main_window.frame
import lmgr.frame


class MapPanel(SingleMapPanel, MainPageBase):
Expand All @@ -83,7 +84,7 @@ def __init__(
toolbars=["map"],
statusbar=True,
tree=None,
lmgr: GMFrame | None = None,
lmgr: main_window.frame.GMFrame | lmgr.frame.GMFrame | None = None,
Map=None,
auimgr=None,
dockable=False,
Expand Down
12 changes: 10 additions & 2 deletions gui/wxpython/nviz/mapwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@
from core.giface import Notification

if TYPE_CHECKING:
from main_window.frame import GMFrame
import main_window.frame
import lmgr.frame

wxUpdateProperties, EVT_UPDATE_PROP = NewEvent()
wxUpdateView, EVT_UPDATE_VIEW = NewEvent()
Expand Down Expand Up @@ -81,7 +82,14 @@ class GLWindow(MapWindowBase, glcanvas.GLCanvas):
"""OpenGL canvas for Map Display Window"""

def __init__(
self, parent, giface, frame, Map, tree, lmgr: GMFrame, id=wx.ID_ANY
self,
parent,
giface,
frame,
Map,
tree,
lmgr: main_window.frame.GMFrame | lmgr.frame.GMFrame,
id=wx.ID_ANY,
) -> None:
"""All parameters except for id are mandatory. The todo is to remove
them completely."""
Expand Down

0 comments on commit 2caf671

Please sign in to comment.