close DurationEditorDialog on ENTER key
authorAndrey Skvortsov <andrej.skvortzov@gmail.com>
Thu, 22 Jun 2017 15:55:26 +0300
changeset 1702 bbb2c38969ca
parent 1701 8337f6c169d0
child 1703 ba0dde7f047a
close DurationEditorDialog on ENTER key
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")),