[GRASS-SVN] r43052 - in grass/trunk/gui: icons/grass2 wxpython wxpython/gui_modules wxpython/icons

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 11 17:18:41 EDT 2010


Author: martinl
Date: 2010-08-11 21:18:41 +0000 (Wed, 11 Aug 2010)
New Revision: 43052

Added:
   grass/trunk/gui/icons/grass2/modeler-main.png
   grass/trunk/gui/icons/grass2/modeler-variables.png
Modified:
   grass/trunk/gui/wxpython/gui_modules/gmodeler.py
   grass/trunk/gui/wxpython/gui_modules/toolbars.py
   grass/trunk/gui/wxpython/icons/grass2_icons.py
   grass/trunk/gui/wxpython/icons/grass_icons.py
   grass/trunk/gui/wxpython/icons/icon.py
   grass/trunk/gui/wxpython/icons/silk_icons.py
   grass/trunk/gui/wxpython/wxgui.py
Log:
wxGUI: add new modeler icons (thanks to Robert Szczepanek)


Added: grass/trunk/gui/icons/grass2/modeler-main.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/modeler-main.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Added: grass/trunk/gui/icons/grass2/modeler-variables.png
===================================================================
(Binary files differ)


Property changes on: grass/trunk/gui/icons/grass2/modeler-variables.png
___________________________________________________________________
Added: svn:mime-type
   + application/octet-stream

Modified: grass/trunk/gui/wxpython/gui_modules/gmodeler.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-08-11 20:14:21 UTC (rev 43051)
+++ grass/trunk/gui/wxpython/gui_modules/gmodeler.py	2010-08-11 21:18:41 UTC (rev 43052)
@@ -615,6 +615,10 @@
         else:
             self.SetTitle(self.baseTitle)
         
+    def OnVariables(self, event):
+        """!Switch to variables page"""
+        self.notebook.SetSelection(2)
+        
     def OnRemoveItem(self, event):
         """!Remove shape
         """

Modified: grass/trunk/gui/wxpython/gui_modules/toolbars.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/toolbars.py	2010-08-11 20:14:21 UTC (rev 43051)
+++ grass/trunk/gui/wxpython/gui_modules/toolbars.py	2010-08-11 21:18:41 UTC (rev 43052)
@@ -81,7 +81,6 @@
         if label:
             Debug.msg(3, "CreateTool(): tool=%d, label=%s bitmap=%s" % \
                   (tool, label, bitmap))
-            
             toolWin = self.AddLabelTool(tool, label, bitmap,
                                         bmpDisabled, kind,
                                         shortHelp, longHelp)
@@ -1632,6 +1631,9 @@
              wx.ITEM_NORMAL, Icons['modelRun'].GetLabel(), Icons['modelRun'].GetDesc(),
              self.parent.OnRunModel),
             ('', '', '', '', '', '', ''),
+            (self.variables, "variables", Icons["modelVariables"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["modelVariables"].GetLabel(), Icons["modelVariables"].GetDesc(),
+             self.parent.OnVariables),
             (self.settings, "settings", Icons["modelSettings"].GetBitmap(),
              wx.ITEM_NORMAL, Icons["modelSettings"].GetLabel(), Icons["modelSettings"].GetDesc(),
              self.parent.OnPreferences),
@@ -1698,7 +1700,7 @@
         
         # realize the toolbar
         self.Realize()
-        
+
     def ToolbarData(self):
         """!Toolbar data"""
         self.newdisplay = wx.NewId()
@@ -1716,6 +1718,7 @@
         self.delcmd = wx.NewId()
         self.attribute = wx.NewId()
         self.preferences = wx.NewId()
+        self.modeler = wx.NewId() 
         
         # tool, label, bitmap, kind, shortHelp, longHelp, handler
         return (
@@ -1765,6 +1768,9 @@
              wx.ITEM_NORMAL, Icons["attrtable"].GetLabel(), Icons["attrtable"].GetDesc(),
              self.parent.OnShowAttributeTable),
             ('', '', '', '', '', '', ''),
+            (self.modeler, 'modeler', Icons["modeler"].GetBitmap(),
+             wx.ITEM_NORMAL, Icons["modeler"].GetLabel(), Icons["modeler"].GetDesc(),
+             self.parent.OnGModeler),
             (self.preferences, 'preferences', Icons["settings"].GetBitmap(),
              wx.ITEM_NORMAL, Icons["settings"].GetLabel(), Icons["settings"].GetDesc(),
              self.parent.OnPreferences)

Modified: grass/trunk/gui/wxpython/icons/grass2_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/grass2_icons.py	2010-08-11 20:14:21 UTC (rev 43051)
+++ grass/trunk/gui/wxpython/icons/grass2_icons.py	2010-08-11 21:18:41 UTC (rev 43052)
@@ -86,6 +86,7 @@
     "addthematic": 'layer-vector-thematic-add.png',
     "addchart"   : 'layer-vector-chart-add.png',
     "layeropts"  : 'options.png',
+    "modeler"    : 'modeler-main.png',
     # profile analysis
     "transect"     : 'layer-raster-profile.png',
     "profiledraw"  : 'show.png',
@@ -107,6 +108,7 @@
     "imageSave"      : 'image-export.png',
     "pythonSave"     : 'python-export.png',
     "modelProperties" : 'options.png',
+    "modelVariables" : 'modeler-variables.png',
     # various
     "settings"       : 'settings.png',
     'redraw'         : 'redraw.png',

Modified: grass/trunk/gui/wxpython/icons/grass_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/grass_icons.py	2010-08-11 20:14:21 UTC (rev 43051)
+++ grass/trunk/gui/wxpython/icons/grass_icons.py	2010-08-11 21:18:41 UTC (rev 43052)
@@ -79,6 +79,7 @@
     "addbarscale": 'module-d.barscale.gif',
     "addlegend"  : 'module-d.legend.gif',
     "quit"       : 'gui-exit.gif',
+    "modeler"    : wx.ART_ERROR,
     # analyze raster
     "analyze"    : 'gui-rastanalyze.gif',
     "measure"    : 'gui-measure.gif',
@@ -109,6 +110,7 @@
     "imageSave"      : wx.ART_ERROR,
     "pythonSave"     : wx.ART_ERROR,
     "modelProperties" : wx.ART_ERROR,
+    "modelVariables" : wx.ART_ERROR,
     # various
     "settings"       : 'edit-color.gif',
     "redraw"         : 'gui-display.gif',

Modified: grass/trunk/gui/wxpython/icons/icon.py
===================================================================
--- grass/trunk/gui/wxpython/icons/icon.py	2010-08-11 20:14:21 UTC (rev 43051)
+++ grass/trunk/gui/wxpython/icons/icon.py	2010-08-11 21:18:41 UTC (rev 43052)
@@ -81,10 +81,9 @@
     sys.exit(1)
 
 class MetaIcon:
+    """!Handle icon metadata (image path, tooltip, ...)
     """
-    Handle icon metadata (image path, tooltip, ...)
-    """
-    def __init__(self, img, label, desc=None):
+    def __init__(self, img, label, desc = None):
         self.imagepath = img
         if not self.imagepath:
             self.type = 'unknown'
@@ -93,41 +92,41 @@
                 self.type = 'wx'
             else:
                 self.type = 'img'
-
+        
         self.label = label
-
+        
         if desc:
             self.description = desc
         else:
             self.description = ''
-
+        
     def __str__(self):
         """!Debugging"""
         return "label=%s, img=%s, type=%s" % (self.label, self.imagepath, self.type)
 
-    def GetBitmap(self, size=None):
+    def GetBitmap(self, size = None):
         """!Get bitmap"""
         bmp = None
-
+        
         if self.type == 'wx':
-            bmp = wx.ArtProvider.GetBitmap(id=self.imagepath, client=wx.ART_TOOLBAR, size=size)
+            bmp = wx.ArtProvider.GetBitmap(id = self.imagepath, client = wx.ART_TOOLBAR, size = size)
         elif self.type == 'img':
             if os.path.isfile(self.imagepath) and os.path.getsize(self.imagepath):
                 if size and len(size) == 2:
-                    image = wx.Image (name=self.imagepath)
-                    image.Rescale (size[0], size[1])
+                    image = wx.Image(name = self.imagepath)
+                    image.Rescale(size[0], size[1])
                     bmp = image.ConvertToBitmap()
                 elif self.imagepath:
-                    bmp = wx.Bitmap (name=self.imagepath)
-
+                    bmp = wx.Bitmap(name = self.imagepath)
+        
         return bmp
-
+    
     def GetLabel(self):
         return self.label
-
+    
     def GetDesc(self):
         return self.description
-
+    
     def GetImageName(self):
         return os.path.basename(self.imagepath)
 
@@ -343,6 +342,8 @@
                           label=_("Quit 3D view mode"),
                           desc=_("Switch back to 2D view mode")),
     # modeler
+    "modeler" : MetaIcon (img=Icons["modeler"],
+                          label=_("Start Graphical Modeler")),
     "modelNew" : MetaIcon (img=Icons["fileNew"],
                            label=_("Create new model (Ctrl+N)")),
     "modelOpen" : MetaIcon (img=Icons["fileOpen"],
@@ -367,7 +368,7 @@
                                 label=_("Show modeler settings")),
     "modelProperties" : MetaIcon (img=Icons["modelProperties"],
                                   label=_("Show model properties")),
-    "modelVariables" : MetaIcon (img=Icons["modelProperties"],
+    "modelVariables" : MetaIcon (img=Icons["modelVariables"],
                                  label=_("Manage model variables")),
     "modelRedraw" : MetaIcon (img=Icons["redraw"],
                               label=_("Redraw model canvas")),

Modified: grass/trunk/gui/wxpython/icons/silk_icons.py
===================================================================
--- grass/trunk/gui/wxpython/icons/silk_icons.py	2010-08-11 20:14:21 UTC (rev 43051)
+++ grass/trunk/gui/wxpython/icons/silk_icons.py	2010-08-11 21:18:41 UTC (rev 43052)
@@ -89,6 +89,7 @@
     "addthematic": 'thematic.png',
     "addchart"   : 'chart_bar.png',
     "layeropts"  : 'map_edit.png',
+    "modeler"    : wx.ART_ERROR,
     # profile analysis
     "transect"   : 'image_edit.png',
     "profiledraw"  : 'arrow_refresh.png',
@@ -111,6 +112,7 @@
     "imageSave"      : wx.ART_ERROR,
     "pythonSave"     : wx.ART_ERROR,
     "modelProperties" : wx.ART_ERROR,
+    "modelVariables" : wx.ART_ERROR,
     # various
     "settings"     : 'color_swatch.png',
     "redraw"       : 'arrow_refresh.png',

Modified: grass/trunk/gui/wxpython/wxgui.py
===================================================================
--- grass/trunk/gui/wxpython/wxgui.py	2010-08-11 20:14:21 UTC (rev 43051)
+++ grass/trunk/gui/wxpython/wxgui.py	2010-08-11 21:18:41 UTC (rev 43052)
@@ -100,7 +100,7 @@
     """
     def __init__(self, parent, id = wx.ID_ANY, title = _("GRASS GIS Layer Manager"),
                  workspace = None,
-                 size = (575, 450), style = wx.DEFAULT_FRAME_STYLE, **kwargs):
+                 size = (600, 450), style = wx.DEFAULT_FRAME_STYLE, **kwargs):
         self.parent    = parent
         self.baseTitle = title
         self.iconsize  = (16, 16)



More information about the grass-commit mailing list