Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save iamutkarshtiwari/e012d1f59aab316e43fc44ca24eb15ba to your computer and use it in GitHub Desktop.
Save iamutkarshtiwari/e012d1f59aab316e43fc44ca24eb15ba to your computer and use it in GitHub Desktop.
class StopButton(ToolButton):
def __init__(self, activity, **kwargs):
ToolButton.__init__(self, 'activity-stop', **kwargs)
self.props.tooltip = _('Stop')
self.props.accelerator = '<Ctrl>Q'
self.connect('clicked', self.__stop_button_clicked_cb, activity)
def __stop_button_clicked_cb(self, button, activity):
self._set_alert(activity)
def _set_alert(self, activity):
alert = SaveAsAlert()
alert.props.title = _('Save As')
message = _('Would you like to save the instance ?')
alert.props.msg = message
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment