def addItem(self, list): """Called by the add button to insert a new job""" pd = ValidatedDialog(self, "New forward model job", "Select a job:", self.available_jobs, True) if pd.exec_(): self.addToList(list, pd.getName()) self.forwardModelChanged()
def addItem(self, list): """Called by the add button to insert a new run template""" uniqueNames = [] for index in range(list.count()): uniqueNames.append(str(list.item(index).text())) pd = ValidatedDialog(self, "New run template", "Enter name of new run template:", uniqueNames) if pd.exec_(): self.addToList(list, pd.getName()) self.runTemplateChanged()
def addItem(self, list): """Called by the add button to insert a new job""" uniqueNames = [] for index in range(list.count()): uniqueNames.append(str(list.item(index).text())) pd = ValidatedDialog(self, "New job", "Enter name of new job:", uniqueNames) if pd.exec_(): new_job = self.addToList(list, pd.getName()) self.updateContent(new_job, operation=self.INSERT) self.modelEmit("jobListChanged()")
def __init__(self, parent, types, uniqueNames): """Creates a new dialog that validates uniqueness against the provided list""" ValidatedDialog.__init__(self, parent, 'Create new parameter', "Select type and enter name of parameter:", uniqueNames) self.paramCombo = QtGui.QComboBox(self) keys = types.keys() keys.sort() for key in keys: self.paramCombo.addItem(types[key], key.name) self.layout.insertRow(2, "Type:", self.paramCombo)
def addItem(self, list): """Called by the add button to insert a new job""" uniqueNames = [] for index in range(list.count()): uniqueNames.append(str(list.item(index).text())) pd = ValidatedDialog(self, "New job", "Enter name of new job:", uniqueNames) if pd.exec_(): new_job = self.addToList(list, pd.getName()) self.updateContent(new_job, operation=self.INSERT) self.modelEmit('jobListChanged()')