# HG changeset patch
# User Andrey Skvortsov <andrej.skvortzov@gmail.com>
# Date 1498136126 -10800
# Node ID bbb2c38969caae9770da75fdb2379b16af7c11a9
# Parent  8337f6c169d09b4d7e83d22e7113e77be84bb92a
close DurationEditorDialog on ENTER key

diff -r 8337f6c169d0 -r bbb2c38969ca dialogs/DurationEditorDialog.py
--- a/dialogs/DurationEditorDialog.py	Wed Jun 21 17:08:52 2017 +0300
+++ b/dialogs/DurationEditorDialog.py	Thu Jun 22 15:55:26 2017 +0300
@@ -122,6 +122,7 @@
                 message.ShowModal()
                 message.Destroy()
             event.Skip()
+            self.OnCloseDialog()
         return OnValueChanged
 
     def GetDuration(self):
@@ -147,6 +148,9 @@
         return duration
     
     def OnOK(self, event):
+        self.OnCloseDialog()
+
+    def OnCloseDialog(self):
         errors = []
         for control, name in [(self.Days, _("days")), (self.Hours, _("hours")), 
                               (self.Minutes, _("minutes")), (self.Seconds, _("seconds")),