def __init__(self, app): gtk.VBox.__init__(self) EventSource.__init__(self) self.operation = None self.app = app self.events = EventCallbacksList()
def __init__(self, parameter): EventSource.__init__(self) self._parameter = parameter self._src_name_changed_events = EventCallbacksList() self._real_attached = 0 self._sources = [None] * self._parameter.minimum
def __init__(self): EventSource.__init__(self) self.events = EventCallbacksList() self.arguments = [Argument(param) for param in self.parameters] for argument in self.arguments: self.events.set_callback(argument, "argument-changed", self._cb_argument_changed) self.events.set_callback(argument, "select-argument", lambda p, i: self.select_argument(p, i), argument) self.selected_argument = (None, None) self._state = "ready" if self.all_sources_filled() else "incomplete"
def __init__(self, argument): gtk.Table.__init__(self, 1, 4, False) EventSource.__init__(self) self.entries = [] self.set_border_width(2) self.argument = argument self.events = EventCallbacksList() self.events.set_callback(self.argument, "argument-changed", self._cb_argument_changed) self.events.set_callback(self.argument, "source-name-changed", self._cb_source_name_changed) # initialize view self._cb_argument_changed()
def __init__(self, repository, app): gtk.VBox.__init__(self) EventSource.__init__(self) self.repository = repository self.events = EventCallbacksList() self.events.set_callback(self.repository, "source-added", self._cb_source_added) self.events.set_callback(self.repository, "source-removed", self._cb_source_removed) self.app = app self.sources_views = {} # (source, source_view) sources = self.repository.get_sources() for source in sources: self._cb_source_added(source)
def __init__(self, app): gtk.VBox.__init__(self) self.__objects_with_callbacks = [] self.app = app self.loaded_operations = [] self.events = EventCallbacksList() # repository of loaded sources self.events.set_callback(app.sources_repository, "source-removed", self._cb_detach_source_from_all_operations) # full view of selected operation self.full_view = OperationFullView(self.app) self.__objects_with_callbacks.append(self.full_view) self.events.set_callback(self.full_view, "filter-sources", self._cb_filter_sources) self.events.set_callback(self.full_view, "operation-finished", self._cb_operation_finished) self.events.set_callback(self.full_view, "detach-source", self._cb_detach_source) # toolbar toolbar = gtk.HBox(False) toolbar.set_border_width(5) button = gtk.Button("Load source") button.connect("clicked", lambda w: self._cb_load()) toolbar.pack_start(button, False, False) button = gtk.Button("Disable filter") button.connect("clicked", lambda w: self._cb_filter_off()) toolbar.pack_start(button, False, False) self.pack_start(toolbar, False, False) # sources vbox = gtk.VBox(False) vbox.set_size_request(80, -1) self.sources_title = gtk.Label() self.sources_title.set_markup("Sources:") haling = gtk.Alignment(0, 0, 0, 0) haling.set_padding(0, 5, 2, 0) haling.add(self.sources_title) vbox.pack_start(haling, False, False) self.sources_view = SourcesRepositoryView(app.sources_repository, self.app) self.__objects_with_callbacks.append(self.sources_view) self.events.set_callback(self.sources_view, "attach-source", self._cb_attach_source) self.events.set_callback(self.sources_view, "source-data-changed", self._cb_source_data_changed) scw = gtk.ScrolledWindow() scw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scw.add_with_viewport(self.sources_view) vbox.pack_start(scw, True, True) paned1 = gtk.HPaned() paned1.pack1(vbox, resize=True) # list of operation's views vbox = gtk.VBox(False) label = gtk.Label("Operations:") haling = gtk.Alignment(0, 0, 0, 0) haling.set_padding(0, 5, 2, 0) haling.add(label) vbox.pack_start(haling, False, False) operations = self._load_operations() vbox.pack_start(operations) paned2 = gtk.VPaned() paned2.pack1(vbox, resize=True) # full action view (selected action) scw = gtk.ScrolledWindow() scw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) scw.set_size_request(-1, 30) scw.add_with_viewport(self.full_view) paned2.pack2(scw) paned1.pack2(paned2, resize=True) self.pack_start(paned1) self.show_all()