Save As - track stop buttons in Activity instance

Track the stop buttons for the activity, so that they can be set
insensitive or not in a later patch.

Our API allows for more than one stop button, though the use of more
than one is very rare.
This commit is contained in:
James Cameron 2017-06-01 13:15:21 +10:00
parent b1d1129759
commit 6bcd664289
2 changed files with 5 additions and 0 deletions

View File

@ -448,6 +448,10 @@ class Activity(Window, Gtk.Container):
bundle = get_bundle_instance(get_bundle_path())
self.set_icon_from_file(bundle.get_icon())
self._stop_buttons = []
def add_stop_button(self, button):
self._stop_buttons.append(button)
def run_main_loop(self):
Gtk.main()

View File

@ -86,6 +86,7 @@ class StopButton(ToolButton):
self.props.tooltip = _('Stop')
self.props.accelerator = '<Ctrl>Q'
self.connect('clicked', self.__stop_button_clicked_cb, activity)
activity.add_stop_button(self)
def __stop_button_clicked_cb(self, button, activity):
activity.close()