[GRASS-SVN] r39859 - grass/trunk/gui/wxpython/gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 30 01:14:00 EST 2009
Author: cmbarton
Date: 2009-11-30 01:13:59 -0500 (Mon, 30 Nov 2009)
New Revision: 39859
Modified:
grass/trunk/gui/wxpython/gui_modules/goutput.py
grass/trunk/gui/wxpython/gui_modules/preferences.py
Log:
Fix bug that hits first time users of GRASS lacking a .grasswx6 file. Backport from develbranch_6 r39857 & r39858
Modified: grass/trunk/gui/wxpython/gui_modules/goutput.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/goutput.py 2009-11-30 06:11:39 UTC (rev 39858)
+++ grass/trunk/gui/wxpython/gui_modules/goutput.py 2009-11-30 06:13:59 UTC (rev 39859)
@@ -790,30 +790,31 @@
settings = preferences.Settings()
- self.typeface = settings.Get(group='display', key='outputfont', subkey='type')
- if self.typeface == "": self.typeface = "Courier New"
+ typeface = settings.Get(group='display', key='outputfont', subkey='type')
+ if typeface == "": typeface = "Courier New"
- self.typesize = float(settings.Get(group='display', key='outputfont', subkey='size'))
- if self.typesize == None or self.typesize <= 0: self.typesize = 10
+ typesize = settings.Get(group='display', key='outputfont', subkey='size')
+ if typesize == None or typesize <= 0: typesize = 10
+ typesize = float(typesize)
self.StyleDefault = 0
- self.StyleDefaultSpec = "face:%s,size:%d,fore:#000000,back:#FFFFFF" % (self.typeface, self.typesize)
+ self.StyleDefaultSpec = "face:%s,size:%d,fore:#000000,back:#FFFFFF" % (typeface, typesize)
self.StyleCommand = 1
- self.StyleCommandSpec = "face:%s,size:%d,,fore:#000000,back:#bcbcbc" % (self.typeface, self.typesize)
+ self.StyleCommandSpec = "face:%s,size:%d,,fore:#000000,back:#bcbcbc" % (typeface, typesize)
self.StyleOutput = 2
- self.StyleOutputSpec = "face:%s,size:%d,,fore:#000000,back:#FFFFFF" % (self.typeface, self.typesize)
+ self.StyleOutputSpec = "face:%s,size:%d,,fore:#000000,back:#FFFFFF" % (typeface, typesize)
# fatal error
self.StyleError = 3
- self.StyleErrorSpec = "face:%s,size:%d,,fore:#7F0000,back:#FFFFFF" % (self.typeface, self.typesize)
+ self.StyleErrorSpec = "face:%s,size:%d,,fore:#7F0000,back:#FFFFFF" % (typeface, typesize)
# warning
self.StyleWarning = 4
- self.StyleWarningSpec = "face:%s,size:%d,,fore:#0000FF,back:#FFFFFF" % (self.typeface, self.typesize)
+ self.StyleWarningSpec = "face:%s,size:%d,,fore:#0000FF,back:#FFFFFF" % (typeface, typesize)
# message
self.StyleMessage = 5
- self.StyleMessageSpec = "face:%s,size:%d,,fore:#000000,back:#FFFFFF" % (self.typeface, self.typesize)
+ self.StyleMessageSpec = "face:%s,size:%d,,fore:#000000,back:#FFFFFF" % (typeface, typesize)
# unknown
self.StyleUnknown = 6
- self.StyleUnknownSpec = "face:%s,size:%d,,fore:#000000,back:#FFFFFF" % (self.typeface, self.typesize)
+ self.StyleUnknownSpec = "face:%s,size:%d,,fore:#000000,back:#FFFFFF" % (typeface, typesize)
# default and clear => init
self.StyleSetSpec(wx.stc.STC_STYLE_DEFAULT, self.StyleDefaultSpec)
Modified: grass/trunk/gui/wxpython/gui_modules/preferences.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/preferences.py 2009-11-30 06:11:39 UTC (rev 39858)
+++ grass/trunk/gui/wxpython/gui_modules/preferences.py 2009-11-30 06:13:59 UTC (rev 39859)
@@ -1778,8 +1778,9 @@
type = self.settings.Get(group='display', key='outputfont', subkey='type')
- size = float(self.settings.Get(group='display', key='outputfont', subkey='size'))
- if size == None or size == 0: size = 9
+ size = self.settings.Get(group='display', key='outputfont', subkey='size')
+ if size == None or size == 0: size = 10
+ size = float(size)
data = wx.FontData()
data.EnableEffects(True)
@@ -1793,7 +1794,7 @@
self.settings.Set(group='display', value=font.GetFaceName(),
key='outputfont', subkey='type')
- self.settings.Set(group='display', value=str(font.GetPointSize()),
+ self.settings.Set(group='display', value=font.GetPointSize(),
key='outputfont', subkey='size')
dlg.Destroy()
More information about the grass-commit
mailing list