|
@@ -349,6 +349,9 @@ class GMFrame(wx.Frame):
|
|
|
self.goutput.showNotification.connect(
|
|
|
lambda message: self.SetStatusText(message)
|
|
|
)
|
|
|
+ self.goutput.contentChanged.connect(
|
|
|
+ lambda notification: self._focusPage(notification)
|
|
|
+ )
|
|
|
|
|
|
self._gconsole.mapCreated.connect(self.OnMapCreated)
|
|
|
self._gconsole.Bind(
|
|
@@ -947,6 +950,23 @@ class GMFrame(wx.Frame):
|
|
|
)
|
|
|
self.mapnotebook.DeletePage(pgnum_dict["mapnotebook"])
|
|
|
|
|
|
+ def _focusPage(self, notification):
|
|
|
+ """Focus the 'Console' notebook page according to event notification."""
|
|
|
+ if (
|
|
|
+ notification == Notification.HIGHLIGHT
|
|
|
+ or notification == Notification.MAKE_VISIBLE
|
|
|
+ or notification == Notification.RAISE_WINDOW
|
|
|
+ ):
|
|
|
+ self.FocusPage("Console")
|
|
|
+
|
|
|
+ def FocusPage(self, page_text):
|
|
|
+ """Focus the page if part of any of aui notebooks"""
|
|
|
+ notebooks = self._auimgr.GetNotebooks()
|
|
|
+ for notebook in notebooks:
|
|
|
+ for i in range(notebook.GetPageCount()):
|
|
|
+ if notebook.GetPageText(i) == page_text:
|
|
|
+ notebook.SetSelection(i)
|
|
|
+
|
|
|
def RunSpecialCmd(self, command):
|
|
|
"""Run command from command line, check for GUI wrappers"""
|
|
|
if re.compile(r"^d\..*").search(command[0]):
|