def event_button_solverSetupAdd(self, widget, data=None): print "RunConfig::event_button_solverSetupAdd()" (typ,name,response) = self.getTypeAndNameDialog_currentBase(AcdOptiSolverSetup.getTypes(), "Select solver type") if response == gtk.RESPONSE_OK: try: newSS_name = AcdOptiSolverSetup.createNew(typ, self.runConfig.folder, name) except AcdOptiException_solverSetup_createFail_nameTaken as e: mDia = gtk.MessageDialog(self.getBaseWindow(), gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, "Name '" + e.args[1] + "' already in use") mDia.run() mDia.destroy() return self.runConfig.solverSetups.append(AcdOptiSolverSetup(newSS_name,self.runConfig)) self.runConfig.write() self.updateDisplay()
def event_cellRenderer_value_edited(self, cell, path, new_text, user_data=None): print "SolverSetup::event_cellRenderer_value_edited(), path='" + str(path) + "', new_text='" + new_text + "'" #Get the underlying DataDict object data = self.__dynamicTableTree[path][-1] #Check that the new input is valid problem = AcdOptiSolverSetup.isInputInvalid(data, new_text) if problem: print "Invalid data, problem='" + problem + "'" return #Store it to the underlying structure data.setValSingle("value", new_text) #Update the display self.__dynamicTableTree[path][2] = new_text