Created
April 7, 2016 18:50
-
-
Save iamutkarshtiwari/4fc7ea695a5e6e36fff102d2fe2da688 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cancel_icon = Icon(icon_name='dialog-cancel') | |
cancel_label = _('Continue download') | |
alert.add_button(Gtk.ResponseType.CANCEL, cancel_label, | |
cancel_icon) | |
stop_icon = Icon(icon_name='dialog-ok') | |
alert.add_button(Gtk.ResponseType.OK, _('Stop'), stop_icon) | |
stop_icon.show() | |
activity.add_alert(alert) | |
alert.connect('response', self.__response_cb, activity) | |
alert.show() | |
activity.present() | |
def __response_cb(self, alert, response_id, activity): | |
activity.remove_alert(alert) | |
if response_id is Gtk.ResponseType.CANCEL: | |
activity.close() | |
elif response_id == Gtk.ResponseType.OK: | |
activity.close() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment