Browse Source

wxGUI: sync various small differences in trunk and release branch

git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@63938 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 years ago
parent
commit
1fb1ebe84e

+ 2 - 7
gui/wxpython/core/utils.py

@@ -1063,13 +1063,8 @@ def GetGEventAttribsForHandler(method, event):
 
 
 def GuiModuleMain(mainfn):
 def GuiModuleMain(mainfn):
     """Main function for g.gui.* modules
     """Main function for g.gui.* modules
-    
-    Note: os.fork() is supported only on Unix platforms
-    
-    .. todo::
-        Replace os.fork() by multiprocessing (?)
-    
-    :param mainfn: main function
+
+    os.fork removed in r62649 as fragile
     """
     """
     mainfn()
     mainfn()
 
 

+ 3 - 1
gui/wxpython/gui_core/goutput.py

@@ -226,7 +226,9 @@ class GConsoleWindow(wx.SplitterWindow):
         self.outputSizer.SetSizeHints(self)
         self.outputSizer.SetSizeHints(self)
         self.panelOutput.SetSizer(self.outputSizer)
         self.panelOutput.SetSizer(self.outputSizer)
         # eliminate gtk_widget_size_allocate() warnings
         # eliminate gtk_widget_size_allocate() warnings
-        self.outputSizer.SetVirtualSizeHints(self.panelOutput)
+        # avoid to use a deprecated method in wxPython >= 2.9
+        getattr(self.outputSizer, 'FitInside',
+                self.outputSizer.SetVirtualSizeHints)(self.panelOutput)
         
         
         if self._gcstyle & GC_PROMPT:
         if self._gcstyle & GC_PROMPT:
             promptSizer.Fit(self)
             promptSizer.Fit(self)

+ 12 - 0
gui/wxpython/gui_core/toolbars.py

@@ -324,6 +324,18 @@ class ToolSwitcher:
                 del self._groups[group][tb]
                 del self._groups[group][tb]
                 break
                 break
 
 
+    def IsToolInGroup(self, tool, group):
+        """Checks whether a tool is in a specified group.
+
+        :param tool: tool id
+        :param group: name of group (e.g. 'mouseUse')
+        """
+        for group in self._toolsGroups[tool]:
+            for tb in self._groups[group]:
+                if tb.FindById(tool):
+                    return True
+        return False
+
     def ToolChanged(self, tool):
     def ToolChanged(self, tool):
         """When any tool/button is pressed, other tools from group must be unchecked.
         """When any tool/button is pressed, other tools from group must be unchecked.
         
         

+ 0 - 2
gui/wxpython/iscatt/controllers.py

@@ -1109,5 +1109,3 @@ class IClassConnection:
         if res.split('\n')[0]:
         if res.split('\n')[0]:
             bands = res.split('\n')
             bands = res.split('\n')
             self.scatt_mgr.SetBands(bands)
             self.scatt_mgr.SetBands(bands)
-
-