[GRASS-SVN] r49218 - in grass/trunk/gui/wxpython: . gui_modules
svn_grass at osgeo.org
svn_grass at osgeo.org
Mon Nov 14 02:58:29 EST 2011
Author: martinl
Date: 2011-11-13 23:58:29 -0800 (Sun, 13 Nov 2011)
New Revision: 49218
Modified:
grass/trunk/gui/wxpython/gui_modules/dbm.py
grass/trunk/gui/wxpython/gui_modules/gdialogs.py
grass/trunk/gui/wxpython/gui_modules/gselect.py
grass/trunk/gui/wxpython/wxpythonlib.dox
Log:
wxGUI: various import-oriented fixes
Modified: grass/trunk/gui/wxpython/gui_modules/dbm.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/dbm.py 2011-11-14 07:57:15 UTC (rev 49217)
+++ grass/trunk/gui/wxpython/gui_modules/dbm.py 2011-11-14 07:58:29 UTC (rev 49218)
@@ -1248,7 +1248,9 @@
list = self.FindWindowById(self.layerPage[self.layer]['data'])
cats = map(int, list.GetSelectedItems())
- digitToolbar = self.mapdisplay.toolbars['vdigit']
+ digitToolbar = None
+ if 'vdigit' in self.mapdisplay.toolbars:
+ digitToolbar = self.mapdisplay.toolbars['vdigit']
if digitToolbar and digitToolbar.GetLayer() and \
digitToolbar.GetLayer().GetName() == self.vectorName:
Modified: grass/trunk/gui/wxpython/gui_modules/gdialogs.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gdialogs.py 2011-11-14 07:57:15 UTC (rev 49217)
+++ grass/trunk/gui/wxpython/gui_modules/gdialogs.py 2011-11-14 07:58:29 UTC (rev 49218)
@@ -1993,7 +1993,7 @@
if len(columns) == 3:
width = (65, 200)
else:
- width = (65, 200, 90)
+ width = (65, 180, 110)
for i in range(len(width)):
self.SetColumnWidth(col = i, width = width[i])
@@ -2007,14 +2007,15 @@
return
self.DeleteAllItems()
-
for item in data:
index = self.InsertStringItem(sys.maxint, str(item[0]))
for i in range(1, len(item)):
self.SetStringItem(index, i, "%s" % str(item[i]))
- # check by default
- ### self.CheckItem(index, True)
+ # check by default only on one item
+ if len(data) == 1:
+ self.CheckItem(index, True)
+
def OnPopupMenu(self, event):
"""!Show popup menu"""
if self.GetItemCount() < 1:
Modified: grass/trunk/gui/wxpython/gui_modules/gselect.py
===================================================================
--- grass/trunk/gui/wxpython/gui_modules/gselect.py 2011-11-14 07:57:15 UTC (rev 49217)
+++ grass/trunk/gui/wxpython/gui_modules/gselect.py 2011-11-14 07:58:29 UTC (rev 49218)
@@ -560,14 +560,11 @@
def _CheckDBConnection(self):
"""!Check DB connection"""
nuldev = file(os.devnull, 'w+')
- self.layers = grass.vector_db(map=self.map, stderr=nuldev)
+ self.layers = grass.vector_db(map = self.map, stderr = nuldev)
nuldev.close()
- if (len(self.layers.keys()) == 0):
- return False
-
- return True
-
+ return bool(len(self.layers.keys()) > 0)
+
def _DescribeTables(self):
"""!Describe linked tables"""
for layer in self.layers.keys():
@@ -1484,13 +1481,6 @@
win.SetValue('')
win.Show()
- if sel in (self.sourceMap['file'],
- self.sourceMap['dir']):
- if not self.ogr:
- self.OnSetFormat(event = None, format = 'GeoTIFF')
- else:
- self.OnSetFormat(event = None, format = 'ESRI Shapefile')
-
if sel == self.sourceMap['native']: # native
win.Enable(False)
self.format.Enable(False)
@@ -1506,6 +1496,13 @@
if self.parent.GetName() == 'MultiImportDialog':
self.parent.list.DeleteAllItems()
+ if sel in (self.sourceMap['file'],
+ self.sourceMap['dir']):
+ if not self.ogr:
+ self.OnSetFormat(event = None, format = 'GeoTIFF')
+ else:
+ self.OnSetFormat(event = None, format = 'ESRI Shapefile')
+
if sel == self.sourceMap['dir'] and not self.dest:
if not self.extension.IsShown():
self.extensionText.Show()
Modified: grass/trunk/gui/wxpython/wxpythonlib.dox
===================================================================
--- grass/trunk/gui/wxpython/wxpythonlib.dox 2011-11-14 07:57:15 UTC (rev 49217)
+++ grass/trunk/gui/wxpython/wxpythonlib.dox 2011-11-14 07:58:29 UTC (rev 49218)
@@ -1,4 +1,4 @@
-/*! \page wxpythonlib GRASS WxPython-based Graphical User Interface
+/*! \page wxpythonlib GRASS wxPython-based GUI
The GUI (Graphical User Interface) is written in the Python
programming language using <a
More information about the grass-commit
mailing list