Skip to content

Commit

Permalink
wxGUI: update statusbar when projection settings checkbox has been to…
Browse files Browse the repository at this point in the history
…ggled (OSGeo#2178)
  • Loading branch information
lindakarlovska authored and neteler committed Nov 7, 2023
1 parent c0d7703 commit 68ec8e1
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 24 deletions.
5 changes: 1 addition & 4 deletions gui/wxpython/gcp/mapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from gui_core.mapdisp import SingleMapPanel
from gui_core.wrap import Menu
from mapwin.buffered import BufferedMapWindow
from mapwin.base import MapWindowProperties

import mapdisp.statusbar as sb
import gcp.statusbar as sbgcp
Expand Down Expand Up @@ -78,9 +77,7 @@ def __init__(
)

self._giface = giface
# properties are shared in other objects, so defining here
self.mapWindowProperties = MapWindowProperties()
self.mapWindowProperties.setValuesFromUserSettings()

self.mapWindowProperties.alignExtent = True

#
Expand Down
9 changes: 9 additions & 0 deletions gui/wxpython/gui_core/mapdisp.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
from gui_core.toolbars import ToolSwitcher
from gui_core.wrap import NewId
from mapdisp import statusbar as sb
from mapwin.base import MapWindowProperties

from grass.script import core as grass

Expand Down Expand Up @@ -87,6 +88,14 @@ def __init__(
self.toolbars = {}
self.iconsize = (16, 16)

# properties are shared in other objects, so defining here
self.mapWindowProperties = MapWindowProperties()
self.mapWindowProperties.setValuesFromUserSettings()
# update statusbar when user-defined projection changed
self.mapWindowProperties.useDefinedProjectionChanged.connect(
self.StatusbarUpdate
)

#
# Fancy gui
#
Expand Down
4 changes: 1 addition & 3 deletions gui/wxpython/iclass/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
from core.gcmd import RunCommand, GMessage, GError
from gui_core.dialogs import SetOpacityDialog
from gui_core.wrap import Menu
from mapwin.base import MapWindowProperties
from dbmgr.vinfo import VectorDBInfo

from iclass.digit import IClassVDigitWindow, IClassVDigit
Expand Down Expand Up @@ -113,8 +112,7 @@ def __init__(
else:
self.giface = StandaloneMapDisplayGrassInterface(self)
self.tree = None
self.mapWindowProperties = MapWindowProperties()
self.mapWindowProperties.setValuesFromUserSettings()

# show computation region by defaut
self.mapWindowProperties.showRegion = True

Expand Down
5 changes: 1 addition & 4 deletions gui/wxpython/image2target/ii2t_mapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
from gui_core.mapdisp import SingleMapPanel
from gui_core.wrap import Menu
from mapwin.buffered import BufferedMapWindow
from mapwin.base import MapWindowProperties

import mapdisp.statusbar as sb
import gcp.statusbar as sbgcp
Expand Down Expand Up @@ -78,9 +77,7 @@ def __init__(
)

self._giface = giface
# properties are shared in other objects, so defining here
self.mapWindowProperties = MapWindowProperties()
self.mapWindowProperties.setValuesFromUserSettings()

self.mapWindowProperties.alignExtent = True

#
Expand Down
5 changes: 0 additions & 5 deletions gui/wxpython/mapdisp/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@
from core.debug import Debug
from core.settings import UserSettings
from gui_core.mapdisp import SingleMapPanel, FrameMixin
from mapwin.base import MapWindowProperties
from gui_core.query import QueryDialog, PrepareQueryResults
from mapwin.buffered import BufferedMapWindow
from mapwin.decorations import (
Expand Down Expand Up @@ -130,10 +129,6 @@ def __init__(
# Emitted when closing display by closing its window.
self.closingVNETDialog = Signal("MapPanel.closingVNETDialog")

# properties are shared in other objects, so defining here
self.mapWindowProperties = MapWindowProperties()
self.mapWindowProperties.setValuesFromUserSettings()

#
# Add toolbars
#
Expand Down
3 changes: 0 additions & 3 deletions gui/wxpython/mapswipe/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from gui_core.mapdisp import DoubleMapPanel, FrameMixin
from gui_core.dialogs import GetImageHandlers
from gui_core.wrap import Slider
from mapwin.base import MapWindowProperties
from core.render import Map
from mapdisp import statusbar as sb
from core.debug import Debug
Expand Down Expand Up @@ -68,8 +67,6 @@ def __init__(
self.sliderH = Slider(self, id=wx.ID_ANY, style=wx.SL_HORIZONTAL)
self.sliderV = Slider(self, id=wx.ID_ANY, style=wx.SL_VERTICAL)

self.mapWindowProperties = MapWindowProperties()
self.mapWindowProperties.setValuesFromUserSettings()
self.mapWindowProperties.autoRenderChanged.connect(self.OnAutoRenderChanged)
self.firstMapWindow = SwipeBufferedWindow(
parent=self.splitter,
Expand Down
4 changes: 3 additions & 1 deletion gui/wxpython/mapwin/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ def useDefinedProjection(self):

@useDefinedProjection.setter
def useDefinedProjection(self, value):
self._useDefinedProjection = value
if value != self._useDefinedProjection:
self._useDefinedProjection = value
self.useDefinedProjectionChanged.emit(value=value)

@property
def epsg(self):
Expand Down
5 changes: 1 addition & 4 deletions gui/wxpython/photo2image/ip2i_mapdisplay.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from gui_core.mapdisp import SingleMapPanel
from gui_core.wrap import Menu
from mapwin.buffered import BufferedMapWindow
from mapwin.base import MapWindowProperties

import mapdisp.statusbar as sb
import gcp.statusbar as sbgcp
Expand Down Expand Up @@ -72,9 +71,7 @@ def __init__(
)

self._giface = giface
# properties are shared in other objects, so defining here
self.mapWindowProperties = MapWindowProperties()
self.mapWindowProperties.setValuesFromUserSettings()

self.mapWindowProperties.alignExtent = True

#
Expand Down

0 comments on commit 68ec8e1

Please sign in to comment.