def get_editor_with_selected_item(self, edit_name, selected_item): frm = None # First handle special cases where forms need more than simply being created if edit_name == "Pollutants": edit_these = [] if self.project and self.project.pollutants: if not isinstance(self.project.pollutants.value, basestring): if isinstance(self.project.pollutants.value, list): for value in self.project.pollutants.value: if value.name == selected_item: edit_these.append(value) frm = frmGenericPropertyEditor(self, edit_these, "SWMM Pollutant Editor") elif edit_name == "Aquifers": # do all of these for now, will want to restrict to only selected one frm = self.make_editor_from_tree(edit_name, self.tree_top_items) # the following items will respond to a click on a conduit form, not the tree diagram elif edit_name == "Conduits": frm = frmCrossSection(self) # the following items will respond to a click on a node form, not the tree diagram # elif edit_name == "Outfalls" or edit_name == "Dividers" or edit_name == "Storage Units": # frm = frmInflows(self) else: # General-purpose case finds most editors from tree information frm = self.make_editor_from_tree(edit_name, self.tree_top_items) frm.set_from(self.project, selected_item) return frm
def local_show(): editor = frmCrossSection(self._main_form) editor.set_link(self.project, str(self.tblGeneric.item(0, column).text())) editor.setWindowModality(QtCore.Qt.ApplicationModal) editor.show() self.refresh_column = column
def local_show(): frm = frmCrossSection(self, defaults=defaults) frm.setWindowTitle("Define Default Conduit Geometry") #frm.set_from(self.project, "") frm.setWindowModality(QtCore.Qt.ApplicationModal) frm.show() self.refresh_column = column self.parameter_changed = True