[GRASS-SVN] r64981 - grass/branches/releasebranch_7_0/gui/wxpython/animation
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Apr 3 21:09:28 PDT 2015
Author: annakrat
Date: 2015-04-03 21:09:28 -0700 (Fri, 03 Apr 2015)
New Revision: 64981
Modified:
grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py
Log:
wxGUI/animation: fix speed dialog problem caused by granularity problem (day vs days), do not restrict the animation speed (merge from trunk, r64980)
Modified: grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py
===================================================================
--- grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py 2015-04-04 04:07:20 UTC (rev 64980)
+++ grass/branches/releasebranch_7_0/gui/wxpython/animation/dialogs.py 2015-04-04 04:09:28 UTC (rev 64981)
@@ -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