Parcourir la source

wxGUI: fix decoration dialog
(merge from devbr6, https://trac.osgeo.org/grass/changeset/34873)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@34874 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa il y a 16 ans
Parent
commit
218a7d5992

+ 0 - 3
gui/wxpython/gui_modules/gdialogs.py

@@ -436,9 +436,6 @@ class DecorationDialog(wx.Dialog):
         if  self.name == 'legend':
             if params and not self.btnOK.IsEnabled():
                 self.btnOK.Enable()
-        
-            #self.SetTitle(_('Legend of raster map <%s>') % \
-            #              utils.GetLayerNameFromCmd(self.parent.MapWindow.overlays[self.ovlId]['cmd']))
             
 class TextLayerDialog(wx.Dialog):
     """

+ 3 - 3
gui/wxpython/gui_modules/mapdisp.py

@@ -2514,9 +2514,6 @@ class MapFrame(wx.Frame):
         @param page notebook page with layer tree
         @param Map instance of render.Map
         """
-
-        wx.Frame.__init__(self, parent, id, title, pos, size, style)
-
         self.gismanager = gismgr    # GIS Manager object
         self.Map        = Map       # instance of render.Map
         self.tree       = tree      # GIS Manager layer tree object
@@ -2537,6 +2534,9 @@ class MapFrame(wx.Frame):
             "sizenwse": wx.StockCursor(wx.CURSOR_SIZENWSE)
             }
 
+        wx.Frame.__init__(self, parent, id, title, pos, size, style)
+        self.SetName("MapWindow")
+
         #
         # set the size & system icon
         #

+ 5 - 1
gui/wxpython/gui_modules/menuform.py

@@ -828,8 +828,12 @@ class mainFrame(wx.Frame):
     def OnCancel(self, event):
         """Cancel button pressed"""
         self.MakeModal(False)
+        
         if self.get_dcmd and \
-                hasattr(self.parent, "GetPyData"):
+                self.parent and \
+                self.parent.GetName() in ('LayerManager',
+                                          'LayerTree',
+                                          'MapWindow'):
             # display decorations and 
             # pressing OK or cancel after setting layer properties
             if self.task.name in ['d.barscale','d.legend','d.histogram'] \

+ 1 - 0
gui/wxpython/gui_modules/wxgui_utils.py

@@ -69,6 +69,7 @@ class LayerTree(treemixin.DragAndDrop, CT.CustomTreeCtrl):
         self.items = []
         self.itemCounter = 0
         super(LayerTree, self).__init__(parent, id, pos, size, style=style, ctstyle=ctstyle)
+        self.SetName("LayerTree")
 
         ### SetAutoLayout() causes that no vertical scrollbar is displayed
         ### when some layers are not visible in layer tree

+ 1 - 0
gui/wxpython/wxgui.py

@@ -104,6 +104,7 @@ class GMFrame(wx.Frame):
         wx.Frame.__init__(self, parent=parent, id=id, size=(500, 400),
                           style=wx.DEFAULT_FRAME_STYLE)
         self.SetTitle(self.baseTitle)
+        self.SetName("LayerManager")
 
         self.SetIcon(wx.Icon(os.path.join(globalvar.ETCICONDIR, 'grass.ico'), wx.BITMAP_TYPE_ICO))