[GRASS-SVN] r32481 - in grass/trunk/gui: icons/silk wxpython/gui_modules wxpython/icons/silk

svn_grass at osgeo.org svn_grass at osgeo.org
Sun Aug 3 06:06:45 EDT 2008


Author: martinl
Date: 2008-08-03 06:06:45 -0400 (Sun, 03 Aug 2008)
New Revision: 32481

Added:
   grass/trunk/gui/icons/silk/map_edit.png
Modified:
   grass/trunk/gui/wxpython/gui_modules/mapdisp.py
   grass/trunk/gui/wxpython/gui_modules/utils.py
   grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
   grass/trunk/gui/wxpython/icons/silk/__init__.py
Log:
wxGUI: some fixes related to the last changes in layer manager items, edit icon added for silk theme

Added: grass/trunk/gui/icons/silk/map_edit.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/silk/map_edit.png
___________________________________________________________________
Name: svn:mime-type
   + image/png

Modified: grass/trunk/gui/wxpython/gui_modules/mapdisp.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-08-03 09:46:40 UTC (rev 32480)
+++ grass/trunk/gui/wxpython/gui_modules/mapdisp.py	2008-08-03 10:06:45 UTC (rev 32481)
@@ -2162,7 +2162,7 @@
         zoomreg = {}
 
         layer = self.GetSelectedLayer()
-
+        
         if layer is None:
             return
 

Modified: grass/trunk/gui/wxpython/gui_modules/utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/utils.py	2008-08-03 09:46:40 UTC (rev 32480)
+++ grass/trunk/gui/wxpython/gui_modules/utils.py	2008-08-03 10:06:45 UTC (rev 32481)
@@ -68,6 +68,9 @@
     """
     mapname = ''
 
+    if len(dcmd) < 1:
+        return mapname
+    
     if 'd.grid' == dcmd[0]:
         mapname = 'grid'
     elif 'd.geodesic' in dcmd[0]:

Modified: grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-08-03 09:46:40 UTC (rev 32480)
+++ grass/trunk/gui/wxpython/gui_modules/wxgui_utils.py	2008-08-03 10:06:45 UTC (rev 32481)
@@ -470,7 +470,7 @@
             opacity_pct = int(new_opacity * 100)
             layername = self.GetItemText(self.layer_selected)
             layerbase = layername.split('(')[0].strip()
-            self.SetItemText(self.layer_selected, \
+            self.SetItemText(self.layer_selected,
                              layerbase + ' (opacity: ' + str(opacity_pct) + '%)')
             
             # redraw map if auto-rendering is enabled
@@ -528,7 +528,7 @@
             self.groupnode += 1
         else:
             btnbmp = Icons["layeropts"].GetBitmap((16,16))
-            ctrl = buttons.GenBitmapButton(self, id=wx.ID_ANY, bitmap=btnbmp)
+            ctrl = buttons.GenBitmapButton(self, id=wx.ID_ANY, bitmap=btnbmp, size=(24,24))
             ctrl.SetToolTipString(_("Click to edit layer settings"))
             self.Bind(wx.EVT_BUTTON, self.OnLayerContextMenu, ctrl)
         # add layer to the layer tree
@@ -622,7 +622,7 @@
 
         if ltype != 'group':
             if lopacity:
-                opacity = int(l_opacity * 100)
+                opacity = int(lopacity * 100)
             else:
                 opacity = 100
             
@@ -669,6 +669,8 @@
         # use predefined layer name if given
         if lname:
             if ltype != 'command':
+                if opacity:
+                    lname = lname + ' (opacity: ' + str(opacity) + '%)'
                 self.SetItemText(layer, lname)
             else:
                 ctrl.SetValue(lname)
@@ -1162,8 +1164,12 @@
                 opac = self.GetPyData(item)[0]['maplayer'].GetOpacity(float=True)
                 chk = self.IsItemChecked(item)
                 hidden = not self.IsVisible(item)
+        # determine layer name
+        layerName = utils.GetLayerNameFromCmd(cmdlist, fullyQualified=True)
+        if not layerName:
+            layerName = self.GetItemText(item)
         maplayer = self.Map.ChangeLayer(layer=self.GetPyData(item)[0]['maplayer'], type=type,
-                                        command=cmdlist, name=self.GetItemText(item),
+                                        command=cmdlist, name=layerName,
                                         l_active=chk, l_hidden=hidden, l_opacity=opac, l_render=False)
 
         self.GetPyData(item)[0]['maplayer'] = maplayer

Modified: grass/trunk/gui/wxpython/icons/silk/__init__.py
===================================================================
--- grass/trunk/gui/wxpython/icons/silk/__init__.py	2008-08-03 09:46:40 UTC (rev 32480)
+++ grass/trunk/gui/wxpython/icons/silk/__init__.py	2008-08-03 10:06:45 UTC (rev 32481)
@@ -79,6 +79,7 @@
     "addhis"     : 'his.png',
     "addthematic": 'thematic.png',
     "addchart"   : 'chart_bar.png',
+    "layeropts"  : 'map_edit.png',
     # profile analysis
     "transect"   : 'image_edit.png',
     "profiledraw"  : 'arrow_refresh.png',



More information about the grass-commit mailing list