Sfoglia il codice sorgente

minor MS Windows wxGUI fixes
(merge from relbr64, https://trac.osgeo.org/grass/changeset/35584)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@35586 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 anni fa
parent
commit
f81bcd5056

+ 7 - 4
gui/wxpython/gis_set.py

@@ -201,7 +201,8 @@ class GRASSStartup(wx.Frame):
             # list of locations
             self.UpdateLocations(self.gisdbase)
             try:
-                self.lblocations.SetSelection(self.listOfLocations.index(location))
+                self.lblocations.SetSelection(self.listOfLocations.index(location),
+                                              force=True)
                 self.lblocations.EnsureVisible(self.listOfLocations.index(location))
             except ValueError:
                 print >> sys.stderr, _("ERROR: Location <%s> not found") % \
@@ -212,7 +213,8 @@ class GRASSStartup(wx.Frame):
             mapset = self._getRCValue("MAPSET")
             if mapset:
                 try:
-                    self.lbmapsets.SetSelection(self.listOfMapsets.index(mapset))
+                    self.lbmapsets.SetSelection(self.listOfMapsets.index(mapset),
+                                                force=True)
                     self.lbmapsets.EnsureVisible(self.listOfMapsets.index(mapset))
                 except ValueError:
                     self.lbmapsets.Clear()
@@ -778,8 +780,9 @@ class GListBox(wx.ListCtrl, listmix.ListCtrlAutoWidthMixin):
     def InsertItems(self, choices, pos, disabled=[]):
         self.__LoadData(choices, disabled)
 
-    def SetSelection(self, item):
-        if item != wx.NOT_FOUND and platform.system() != 'Windows':
+    def SetSelection(self, item, force = False):
+        if item != wx.NOT_FOUND and \
+                (platform.system() != 'Windows' or force):
             ### Windows -> FIXME
             self.SetItemState(item, wx.LIST_STATE_SELECTED, wx.LIST_STATE_SELECTED)
 	

+ 4 - 1
gui/wxpython/gui_modules/nviz_mapdisp.py

@@ -37,7 +37,10 @@ from goutput import wxCmdOutput
 from preferences import globalSettings as UserSettings
 
 sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
-import grass7_wxnviz as wxnviz
+try:
+    import grass7_wxnviz as wxnviz
+except ImportError:
+    pass
 
 wxUpdateProperties, EVT_UPDATE_PROP = NewEvent()
 wxUpdateView,       EVT_UPDATE_VIEW = NewEvent()

+ 4 - 1
gui/wxpython/gui_modules/nviz_tools.py

@@ -30,7 +30,10 @@ from nviz_mapdisp import wxUpdateView as wxUpdateView
 from nviz_mapdisp import wxUpdateProperties as wxUpdateProperties
 
 sys.path.append(os.path.join(globalvar.ETCWXDIR, "nviz"))
-import grass7_wxnviz as wxnviz
+try:
+   import grass7_wxnviz as wxnviz
+except ImportError:
+   pass
 
 class NvizToolWindow(wx.Frame):
     """Experimental window for Nviz tools