def on_edit_clicked(button, prop, label): editor = PropagationEditor(model=prop, parent=self.view.get_window()) if editor.start(commit=False) is not None: label.props.label = prop.get_summary() self._dirty = True self.parent_ref().refresh_sensitivity()
def add_propagation(self): """ Open the PropagationEditor and append the resulting propagation to self.model.propagations """ propagation = Propagation() propagation.plant = self.model editor = PropagationEditor(propagation, parent=self.view.get_window()) # open propagation editor with start(commit=False) so that the # propagation editor doesn't commit its changes since we'll be # doing our own commit later committed = editor.start(commit=False) if committed: box = self.create_propagation_box(committed) self.view.widgets.prop_tab_box.pack_start(box, expand=False, fill=True) self._dirty = True else: propagation.plant = None