def saveNewItem(self): specie = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex()) if specie != None: SqlHandler.addItem(self.session, SqlHandler.Color(self.ui.lineEdit.text(), specie.id)) if self.parent().specieName() == specie.name: self.parent().setColor(self.ui.lineEdit.text()) self.closeDialog()
def saveNewItem(self): item = SqlHandler.WeightControl(animal_id=self.item.id, weight=self.priceSelector.value()) SqlHandler.addItem(self.session, item) print('WeightControl saveNweItem, ', item) self.parent().addAskedItem(item) self.closeDialog()
def saveNewItem(self): postoffice = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex()) if postoffice != None: SqlHandler.addItem( self.session, SqlHandler.PostNumber(postoffice.id, self.ui.lineEdit.text())) self.parent().setPostNumber(self.ui.lineEdit.text()) self.closeDialog()
def saveNewItem(self): specie = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex()) if specie != None: SqlHandler.addItem( self.session, SqlHandler.Color(self.ui.lineEdit.text(), specie.id)) if self.parent().specieName() == specie.name: self.parent().setColor(self.ui.lineEdit.text()) self.closeDialog()
def saveDialog(self): if self.animalsearch.getCurrentItem() != None: if self.item != None: self.item.update() self.parent().update() self.closeDialog() else: self.item = SqlHandler.PhoneRecipie(self.animalsearch.getCurrentItem(), self.recipieMedicineTreeWidget.getItemsFromList()) self.item.update(self.getData()) SqlHandler.addItem(self.session, self.item) self.parent().update() self.closeDialog()
def saveNewItem(self): tmp = SqlHandler.SummaryText(self.ui.lineEdit.text(), self.textEdit.toPlainText()) if(tmp): SqlHandler.addItem(self.session, tmp) try: self.parent().addAskedItem(tmp) except: logERROR(self,"Failed to add text to parent!") self.closeDialog() else: popErrorMessage(g_error_msg_dict['summary_name_used'])
def saveDialog(self): if self.animalsearch.getCurrentItem() != None: if self.item != None: self.item.update() self.parent().update() self.closeDialog() else: self.item = SqlHandler.PhoneRecipie( self.animalsearch.getCurrentItem(), self.recipieMedicineTreeWidget.getItemsFromList()) self.item.update(self.getData()) SqlHandler.addItem(self.session, self.item) self.parent().update() self.closeDialog()
def saveNewItem(self): tmp = SqlHandler.SummaryText(self.ui.lineEdit.text(), self.textEdit.toPlainText()) if (tmp): SqlHandler.addItem(self.session, tmp) try: self.parent().addAskedItem(tmp) except: logERROR(self, "Failed to add text to parent!") self.closeDialog() else: popErrorMessage(g_error_msg_dict['summary_name_used'])
def saveTab(self): logDEBUG(self, 'GenericTab FUNCTIO: SaveTab') #check if tab is valid if self.saveAble(): #check if there is items if self.item == None: #here self.item can be set because newToSaved will handle it self.item = self.makeItem() SqlHandler.addItem(self.session, self.item) self.update() Tabmanager.newToSaved(self) else: self.item.update(self.getData()) SqlHandler.commitSession(self.session) else: from models.translationtables import g_save_error_message self.errorMessage(g_save_error_message)
def saveAndCloseTab(self): logDEBUG(self, 'GenericTab FUNCTIO: saveAndCloseTab') tmp_item = None if self.saveAble(): if self.item == None: self.item = self.makeItem() SqlHandler.addItem(self.session, self.item) else: if self.hasChanged(): #update item if it has changes self.item.update(self.getData()) SqlHandler.commitSession(self.session) else: pass #logDEBUG(self,'No') self.closeTab() else: from models.translationtables import g_save_error_message self.errorMessage(g_save_error_message)
def saveNewItem(self): item = SqlHandler.WeightControl(animal_id = self.item.id, weight=self.priceSelector.value()) SqlHandler.addItem(self.session, item) print('WeightControl saveNweItem, ', item) self.parent().addAskedItem(item) self.closeDialog()
def saveDialog(self): if self.hasChangedAndSaveAble(): self.updateItem() SqlHandler.addItem(self.session, self.item)
def saveNewItem(self): postoffice = self.ui.comboBox.itemData(self.ui.comboBox.currentIndex()) if postoffice != None: SqlHandler.addItem(self.session, SqlHandler.PostNumber(postoffice.id,self.ui.lineEdit.text())) self.parent().setPostNumber(self.ui.lineEdit.text()) self.closeDialog()
def saveNewItem(self): SqlHandler.addItem(self.session, SqlHandler.PostOffice(self.ui.lineEdit.text())) #Will always be updated self.parent().setPostOffice(self.ui.lineEdit.text()) self.closeDialog()
def saveNewItem(self): _sex = SqlHandler.Sex(self.ui.lineEdit.text()) SqlHandler.addItem(self.session, _sex) #Will always be updated self.parent().setSex(self.ui.lineEdit.text()) self.closeDialog()