瀏覽代碼

wxGUI: launch Timeline Tool directly from menu

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@61385 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová 10 年之前
父節點
當前提交
8e4b583d72
共有 3 個文件被更改,包括 18 次插入3 次删除
  1. 10 0
      gui/wxpython/lmgr/frame.py
  2. 1 3
      gui/wxpython/xml/toolboxes.xml
  3. 7 0
      gui/wxpython/xml/wxgui_items.xml

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

@@ -1560,6 +1560,16 @@ class GMFrame(wx.Frame):
                 layerList.AddLayer(layer)
                 frame.SetAnimations([layerList, None, None, None])
 
+    def OnTimelineTool(self, event=None, cmd=None):
+        """Launch Timeline Tool"""
+        try:
+            from timeline.frame import TimelineFrame
+        except ImportError:
+            GError(parent=self, message=_("Unable to start Timeline Tool."))
+            return
+        frame = TimelineFrame(None)
+        frame.Show()
+
     def OnHistogram(self, event):
         """Init histogram display canvas and tools
         """

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

@@ -1978,9 +1978,7 @@
     <label>GUI tools</label>
     <items>
       <wxgui-item name="AnimationTool"/>
-      <module-item name="g.gui.timeline">
-        <label>Plot temporal extents</label>
-      </module-item>
+      <wxgui-item name="TimelineTool"/>
       <module-item name="g.gui.tplot">
         <label>Plot temporal values</label>
       </module-item>

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

@@ -28,6 +28,13 @@
     <description>Launch animation tool.</description>
     <keywords>general,gui,display</keywords>
   </wxgui-item>
+  <wxgui-item name="TimelineTool">
+    <label>Timeline tool</label>
+    <handler>OnTimelineTool</handler>
+    <related-module>g.gui.timeline</related-module>
+    <description>Plot temporal extents.</description>
+    <keywords>general,gui,temporal</keywords>
+  </wxgui-item>
   <wxgui-item name="CartographicComposer">
     <label>Cartographic Composer</label>
     <handler>OnPsMap</handler>