Merge branch '12813-e' of https://github.com/quozl/sugar-toolkit-gtk3
This commit is contained in:
commit
d2e1793108
@ -402,16 +402,20 @@ class TimeoutAlert(Alert):
|
|||||||
self.add_button(Gtk.ResponseType.OK, _('Continue'), self._timeout_text)
|
self.add_button(Gtk.ResponseType.OK, _('Continue'), self._timeout_text)
|
||||||
self._timeout_text.show()
|
self._timeout_text.show()
|
||||||
|
|
||||||
GLib.timeout_add_seconds(1, self.__timeout)
|
self._timeout_sid = GLib.timeout_add(1000, self.__timeout)
|
||||||
|
|
||||||
def __timeout(self):
|
def __timeout(self):
|
||||||
self._timeout -= 1
|
self._timeout -= 1
|
||||||
self._timeout_text.set_text(self._timeout)
|
self._timeout_text.set_text(self._timeout)
|
||||||
if self._timeout == 0:
|
if self._timeout == 0:
|
||||||
self._response(Gtk.ResponseType.OK)
|
Alert._response(self, Gtk.ResponseType.OK)
|
||||||
return False
|
return False
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def _response(self, *args):
|
||||||
|
GLib.source_remove(self._timeout_sid)
|
||||||
|
Alert._response(self, *args)
|
||||||
|
|
||||||
|
|
||||||
class NotifyAlert(Alert):
|
class NotifyAlert(Alert):
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user