Use proper signal name for calendar widgets changed event
issue11736 review423931003
This commit is contained in:
1 parent
6cdb8c6a56
commit
33f58dc0f5
1 file changed
+6
-3
@@ -17,6 +17,7 @@ _ = gettext.gettext
|
||||
|
||||
|
||||
class Date(Widget):
|
||||
_changed_signal = 'date-changed'
|
||||
|
||||
def __init__(self, view, attrs, _entry=DateEntry):
|
||||
super(Date, self).__init__(view, attrs)
|
||||
@@ -27,7 +28,7 @@ class Date(Widget):
|
||||
self.real_entry.connect('key_press_event', self.sig_key_press)
|
||||
self.real_entry.connect('activate', self.sig_activate)
|
||||
self.real_entry.connect('changed', lambda _: self.send_modified())
|
||||
self.entry.connect('date-changed', self.changed)
|
||||
self.entry.connect(self._changed_signal, self.changed)
|
||||
self.widget.pack_start(self.entry, expand=False, fill=False, padding=0)
|
||||
|
||||
@property
|
||||
@@ -90,9 +91,10 @@ class Date(Widget):
|
||||
|
||||
|
||||
class Time(Date):
|
||||
_changed_signal = 'time-changed'
|
||||
|
||||
def __init__(self, view, attrs):
|
||||
super(Time, self).__init__(view, attrs, _entry=TimeEntry)
|
||||
self.entry.connect('time-changed', self.changed)
|
||||
|
||||
def _set_editable(self, value):
|
||||
self.entry.set_sensitive(value)
|
||||
@@ -119,6 +121,8 @@ class Time(Date):
|
||||
|
||||
|
||||
class DateTime(Date):
|
||||
_changed_signal = 'datetime-changed'
|
||||
|
||||
def __init__(self, view, attrs):
|
||||
Widget.__init__(self, view, attrs)
|
||||
|
||||
@@ -132,7 +136,6 @@ class DateTime(Date):
|
||||
child.connect('key_press_event', self.sig_key_press)
|
||||
child.connect('activate', self.sig_activate)
|
||||
child.connect('changed', lambda _: self.send_modified())
|
||||
self.entry.connect('datetime-changed', self.changed)
|
||||
self.widget.pack_start(self.entry, expand=False, fill=False, padding=0)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in new issue
Block a user