[GRASS-SVN] r64980 - grass/trunk/gui/wxpython/animation

svn_grass at osgeo.org svn_grass at osgeo.org
Fri Apr 3 21:07:20 PDT 2015


Author: annakrat
Date: 2015-04-03 21:07:20 -0700 (Fri, 03 Apr 2015)
New Revision: 64980

Modified:
   grass/trunk/gui/wxpython/animation/dialogs.py
Log:
wxGUI/animation: fix speed dialog caused by granularirty problem (day vs days), do not restrict the animation speed

Modified: grass/trunk/gui/wxpython/animation/dialogs.py
===================================================================
--- grass/trunk/gui/wxpython/animation/dialogs.py	2015-04-02 22:26:20 UTC (rev 64979)
+++ grass/trunk/gui/wxpython/animation/dialogs.py	2015-04-04 04:07:20 UTC (rev 64980)
@@ -49,7 +49,7 @@
 
 class SpeedDialog(wx.Dialog):
     def __init__(self, parent, title=_("Adjust speed of animation"),
-                 temporalMode=None, minimumDuration=20, timeGranularity=None,
+                 temporalMode=None, minimumDuration=0, timeGranularity=None,
                  initialSpeed=200):
         wx.Dialog.__init__(self, parent=parent, id=wx.ID_ANY, title=title,
                            style=wx.DEFAULT_DIALOG_STYLE)
@@ -179,10 +179,11 @@
 
         if self.temporalMode == TemporalMode.TEMPORAL:
             unit = self.timeGranularity[1]
-            try:
-                index = timeUnits.index(unit)
-            except ValueError:
-                index = 0
+            index = 0
+            for i, timeUnit in enumerate(timeUnits):
+                if timeUnit.startswith(unit):
+                    index = i
+                    break
             choiceWidget.SetSelection(index)
         else:
             choiceWidget.SetSelection(0)
@@ -233,6 +234,7 @@
 
             value = self.spinDurationTemp.GetValue()
             ms = value * seconds2 / float(seconds1)
+            # minimumDuration set to 0, too restrictive
             if ms < self.minimumDuration:
                 GMessage(parent=self, message=_("Animation speed is too high."))
                 return



More information about the grass-commit mailing list