def pb_Mascotas_Clicked(self): self.table_Clientes.setCurrentCell(self.table_Clientes.currentRow(), 2) item = self.table_Clientes.currentItem() cliente = Funciones.get_cliente(self.__clientes, int(item.text().strip())) mascotas_cliente = Funciones.get_mascotas_cliente(self.__mascotas, cliente) table_mascotas = TableMascotas(mascotas_cliente, self.__clientes, self.__paseadores) table_mascotas.exec_()
def __init__(self, clientes, paseadores, mascotas, cliente = None, parent = None): QtGui.QDialog.__init__(self,parent) self.setupUi(self) self.__cliente = cliente self.__clientes = clientes self.__paseadores = paseadores self.__mascotas = mascotas self.__mascotas_alta = [] if (self.__cliente!=None): self.lineEdit_Nombre.setText(cliente.get_Nombre()) self.lineEdit_Apellido.setText(cliente.get_Apellido()) self.lineEdit_Direccion.setText(cliente.get_Direccion()) self.lineEdit_DNI.setText(str(cliente.get_Dni())) self.lineEdit_Telefono.setText(str(cliente.get_Telefono())) self.lineEdit_DNI.setEnabled(False) dic_mascotas_cliente = Funciones.get_mascotas_cliente(self.__mascotas, self.__cliente) list_mascotas_cliente = dic_mascotas_cliente.values() for value in list_mascotas_cliente: self.combo_Mascotas.addItem(value.get_Nombre(), value.get_Codigo()) self.combo_Mascotas.setEnabled(True) self.pb_Add_Mascota.setEnabled(True) self.pb_Aceptar.clicked.connect(self.pb_Aceptar_Clicked) self.pb_Add_Mascota.clicked.connect(self.pb_Add_Mascota_Clicked) self.lineEdit_DNI.editingFinished.connect(self.enable_Combo)