[GRASS-SVN] r33114 - grass/trunk/gui/wxpython/gui_modules

svn_grass at osgeo.org svn_grass at osgeo.org
Wed Aug 27 05:30:37 EDT 2008


Author: martinl
Date: 2008-08-27 05:30:37 -0400 (Wed, 27 Aug 2008)
New Revision: 33114

Modified:
   grass/trunk/gui/wxpython/gui_modules/preferences.py
   grass/trunk/gui/wxpython/gui_modules/render.py
Log:
wxGUI: add support for png driver (cairo is default)

Modified: grass/trunk/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/preferences.py	2008-08-27 09:13:34 UTC (rev 33113)
+++ grass/trunk/gui/wxpython/gui_modules/preferences.py	2008-08-27 09:30:37 UTC (rev 33114)
@@ -87,9 +87,9 @@
                 'displayFont' : {
                     'value' : ''
                     },
-                # 'driver': {
-                #    'type': 'default'
-                #    },
+                'driver': {
+                    'type': 'cairo'
+                    },
                 'compResolution' : {
                     'enabled' : False
                     },
@@ -506,7 +506,7 @@
         self.internalSettings['cmd']['verbosity']['choices'] = ('grassenv',
                                                                 'verbose',
                                                                 'quiet')
-#        self.internalSettings['display']['driver']['choices'] = ['default']
+        self.internalSettings['display']['driver']['choices'] = ['cairo', 'png']
         self.internalSettings['display']['statusbarMode']['choices'] = globalvar.MAP_DISPLAY_STATUSBAR_MODE
 
         self.internalSettings['nviz']['view'] = {}
@@ -972,29 +972,23 @@
         #
         # display driver
         #
-        #         row = 0
-        #         gridSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
-        #                                          label=_("Display driver:")),
-        #                       flag=wx.ALIGN_LEFT |
-        #                       wx.ALIGN_CENTER_VERTICAL,
-        #                       pos=(row, 0))
-        #         listOfDrivers = self.settings.Get(group='display', key='driver', subkey='choices', internal=True)
-        #         # check if cairo is available
-        #         if 'cairo' not in listOfDrivers:
-        #             for line in gcmd.Command(['d.mon', '-l']).ReadStdOutput():
-        #                 if 'cairo' in line:
-        #                     listOfDrivers.append('cairo')
-        #                     break
-        #         driver = wx.Choice(parent=panel, id=wx.ID_ANY, size=(150, -1),
-        #                            choices=listOfDrivers,
-        #                            name="GetStringSelection")
-        #         driver.SetStringSelection(self.settings.Get(group='display', key='driver', subkey='type'))
-        #         self.winId['display:driver:type'] = driver.GetId()
+        row = 0
+        gridSizer.Add(item=wx.StaticText(parent=panel, id=wx.ID_ANY,
+                                         label=_("Display driver:")),
+                      flag=wx.ALIGN_LEFT |
+                      wx.ALIGN_CENTER_VERTICAL,
+                      pos=(row, 0))
+        listOfDrivers = self.settings.Get(group='display', key='driver', subkey='choices', internal=True)
+        driver = wx.Choice(parent=panel, id=wx.ID_ANY, size=(150, -1),
+                           choices=listOfDrivers,
+                           name="GetStringSelection")
+        driver.SetStringSelection(self.settings.Get(group='display', key='driver', subkey='type'))
+        self.winId['display:driver:type'] = driver.GetId()
         
-        #         gridSizer.Add(item=driver,
-        #                       flag=wx.ALIGN_RIGHT,
-        #                       pos=(row, 1))
-
+        gridSizer.Add(item=driver,
+                      flag=wx.ALIGN_RIGHT,
+                      pos=(row, 1))
+        
         #
         # Statusbar mode
         #

Modified: grass/trunk/gui/wxpython/gui_modules/render.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/render.py	2008-08-27 09:13:34 UTC (rev 33113)
+++ grass/trunk/gui/wxpython/gui_modules/render.py	2008-08-27 09:30:37 UTC (rev 33114)
@@ -850,7 +850,13 @@
 	os.environ["GRASS_PNG_AUTO_WRITE"] = "TRUE"
 	os.environ["GRASS_COMPRESSION"] = "0"
 	os.environ["GRASS_TRUECOLOR"] = "TRUE"
-	os.environ["GRASS_RENDER_IMMEDIATE"] = "TRUE"
+        driver = UserSettings.Get(group='display', key='driver', subkey='type')
+        if driver == 'cairo':
+            os.environ["GRASS_RENDER_IMMEDIATE"] = "cairo"
+        elif driver == 'png':
+            os.environ["GRASS_RENDER_IMMEDIATE"] = "png"
+        else:
+            os.environ["GRASS_RENDER_IMMEDIATE"] = "TRUE"
         
         self._renderLayers(force, mapWindow, maps, masks, opacities)
             



More information about the grass-commit mailing list