def on_MassAddButton_clicked(self): available_mass_nodes=self.syst.get_available_mass_nodes() if len(available_mass_nodes)==0: QMessageBox.warning(self, "Error","No more available nodes for masses") return MassDlg=MassDialog(available_mass_nodes) if MassDlg.exec_(): index1,value1=MassDlg.retrieve_data() node=available_mass_nodes[index1] self.syst.addMass(node,value1) self.MassTableRowCount=self.MassTableRowCount+1 self.MassTable.setRowCount(self.MassTableRowCount) self.setMassTableData(self.MassTableRowCount-1, value1, node)
def on_MassEditButton_clicked(self): if self.MassTable.hasFocus(): if self.MassTableRowCount==0: return row=self.MassTable.currentRow() node,value1=self.getMassTableData(row) available_mass_nodes=self.syst.get_available_mass_nodes() available_mass_nodes.append(node-1) available_mass_nodes.sort() node_no=available_mass_nodes.index(node-1) MassDlg=MassDialog(available_mass_nodes,value1=value1,current_node=node_no) if MassDlg.exec_(): index1,value1=MassDlg.retrieve_data() self.syst.addMass(node-1,delete_flag=1) node=available_mass_nodes[index1] self.syst.addMass(node,value1) self.setMassTableData(row,value1,node)