[GRASS-SVN] r30923 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Thu Apr 10 06:49:06 EDT 2008
Author: martinl
Date: 2008-04-10 06:49:06 -0400 (Thu, 10 Apr 2008)
New Revision: 30923
Modified:
grass/trunk/gui/wxpython/gui_modules/gdialogs.py
Log:
wxGUI (decorations): bugfixing, related to r30922.
Modified: grass/trunk/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gdialogs.py 2008-04-10 10:34:06 UTC (rev 30922)
+++ grass/trunk/gui/wxpython/gui_modules/gdialogs.py 2008-04-10 10:49:06 UTC (rev 30923)
@@ -280,12 +280,19 @@
# create overlay if doesn't exist
self._CreateOverlay()
- if self.parent.MapWindow.overlays[self.ovlId]['params']:
- for p in self.parent.MapWindow.overlays[self.ovlId]['params']['params']:
- if p.get('name', '') == 'map' and p.get('value', '') != '':
- self.btnOK.Enable()
- self.SetTitle(_('Legend of raster map <%s>') % \
- utils.GetLayerNameFromCmd(self.parent.MapWindow.overlays[self.ovlId]['cmd']))
+ if len(self.parent.MapWindow.overlays[self.ovlId]['cmd']) > 1:
+ mapName = utils.GetLayerNameFromCmd(self.parent.MapWindow.overlays[self.ovlId]['cmd'])
+ if self.parent.MapWindow.overlays[self.ovlId]['propwin'] is None and mapName:
+ # build properties dialog
+ menuform.GUI().ParseCommand(cmd=self.cmd,
+ completed=(self.GetOptData, self.name, ''),
+ parentframe=self.parent, show=False)
+ if mapName:
+ # enable 'OK' button
+ self.btnOK.Enable()
+ # set title
+ self.SetTitle(_('Legend of raster map <%s>') % \
+ mapName)
def _CreateOverlay(self):
if not self.parent.Map.GetOverlay(self.ovlId):
@@ -300,11 +307,6 @@
'cmd' : self.cmd,
'coords': (10, 10),
'pdcType': 'image' }
-
- # build properties dialog
- menuform.GUI().ParseCommand(cmd=self.cmd,
- completed=(self.GetOptData, self.name, ''),
- parentframe=self.parent, show=False)
else:
self.parent.MapWindow.overlays[self.ovlId]['propwin'].get_dcmd = self.GetOptData
@@ -315,10 +317,16 @@
Sets option for decoration map overlays
"""
- if self.parent.MapWindow.overlays[self.ovlId]['propwin'].IsShown():
- self.parent.MapWindow.overlays[self.ovlId]['propwin'].SetFocus()
+ if self.parent.MapWindow.overlays[self.ovlId]['propwin'] is None:
+ # build properties dialog
+ menuform.GUI().ParseCommand(cmd=self.cmd,
+ completed=(self.GetOptData, self.name, ''),
+ parentframe=self.parent)
else:
- self.parent.MapWindow.overlays[self.ovlId]['propwin'].Show()
+ if self.parent.MapWindow.overlays[self.ovlId]['propwin'].IsShown():
+ self.parent.MapWindow.overlays[self.ovlId]['propwin'].SetFocus()
+ else:
+ self.parent.MapWindow.overlays[self.ovlId]['propwin'].Show()
def OnCancel(self, event):
"""Cancel dialog"""
More information about the grass-commit
mailing list