Ver código fonte

wxGUI: fix launching tplot tool from the menu

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@64292 15284696-431f-4ddb-bdfa-cd5b030d7da7
Martin Landa 10 anos atrás
pai
commit
46d675b656

+ 10 - 0
gui/wxpython/lmgr/frame.py

@@ -1624,6 +1624,16 @@ class GMFrame(wx.Frame):
         frame = TimelineFrame(None)
         frame.Show()
 
+    def OnTplotTool(self, event=None, cmd=None):
+        """Launch Temporal Plot Tool"""
+        try:
+            from tplot.frame import TplotFrame
+        except ImportError:
+            GError(parent=self, message=_("Unable to start Temporal Plot Tool."))
+            return
+        frame = TplotFrame(None)
+        frame.Show()
+          
     def OnHistogram(self, event):
         """Init histogram display canvas and tools
         """

+ 1 - 3
gui/wxpython/xml/toolboxes.xml

@@ -1945,9 +1945,7 @@
     <items>
       <wxgui-item name="AnimationTool"/>
       <wxgui-item name="TimelineTool"/>
-      <module-item name="g.gui.tplot">
-        <label>Plot temporal values</label>
-      </module-item>
+      <wxgui-item name="TplotTool"/>
     </items>
   </toolbox>
   <toolbox name="GuiTools">

+ 7 - 0
gui/wxpython/xml/wxgui_items.xml

@@ -35,6 +35,13 @@
     <description>Plot temporal extents.</description>
     <keywords>general,gui,temporal</keywords>
   </wxgui-item>
+  <wxgui-item name="TplotTool">
+    <label>Temporal plot tool</label>
+    <handler>OnTplotTool</handler>
+    <related-module>g.gui.tplot</related-module>
+    <description>Plot temporal values.</description>
+    <keywords>general,gui,temporal</keywords>
+  </wxgui-item>
   <wxgui-item name="CartographicComposer">
     <label>Cartographic Composer</label>
     <handler>OnPsMap</handler>