def openSummary(self): from mainwindowtabs.summarytab import SummaryTab Tabmanager.openTab(tabCreator=SummaryTab, newItem={'owner' : self.ownerserachline.getCurrentItem(), 'visitanimal' : self.animalTreeWidget.getSelectedItem(), 'text':self.ui.treatmentTextEdit.toPlainText()}, returnTab=self)
def openItem(self): creator = self.ui.typeComboBox.itemData(self.ui.typeComboBox.currentIndex()) currentItem = self.mainSearchLineEdit.getCurrentItem() if currentItem != None: if hasattr(creator, "getType"): Tabmanager.openTab(tabCreator=creator, newItem=currentItem) else: ItemCreatorDialog(parent=self, item=self.mainSearchLineEdit.getCurrentItem()).show()
def openItem(self): tree_item = self.ui.treeWidget.currentItem() if tree_item != None: if hasattr(self.tabcreator, "getType"): item = tree_item.data(0,0) Tabmanager.openTab(tabCreator=self.tabcreator, newItem=item.animal) else: creator = self.tabcreator(parent=self) creator.show()
def openItem(self): tree_item = self.ui.treeWidget.currentItem() if tree_item != None: if hasattr(self.tabcreator, "getType"): item = tree_item.data(0, 0) Tabmanager.openTab(tabCreator=self.tabcreator, newItem=item.animal) else: creator = self.tabcreator(parent=self) creator.show()
def __init__(self, parent=None): #määritetään pääikkunan layoutti QMainWindow.__init__(self, parent=parent) self.ui = Ui_MainWindow() self.ui.setupUi(self) self.configureMainWindow() self.createConnections() Tabmanager.initialize(self.ui.tabWidget)
def openItem(self): creator = self.ui.typeComboBox.itemData( self.ui.typeComboBox.currentIndex()) currentItem = self.mainSearchLineEdit.getCurrentItem() if currentItem != None: if hasattr(creator, "getType"): Tabmanager.openTab(tabCreator=creator, newItem=currentItem) else: ItemCreatorDialog( parent=self, item=self.mainSearchLineEdit.getCurrentItem()).show()
def openBill(self): if self.saveAble(): self.setEndTime() self.saveTab() from mainwindowtabs.billTab import BillTab bill = SqlHandler.getBill(self.session, self.item) if bill != None: Tabmanager.openTab(tabCreator=BillTab, newItem=bill) else: Tabmanager.openTab(tabCreator=BillTab, newItem=self.item) else: self.errorMessage('Omistajaa ei ole asetettu!')
def openSummary(self): from mainwindowtabs.summarytab import SummaryTab Tabmanager.openTab(tabCreator=SummaryTab, newItem={ 'owner': self.ownerserachline.getCurrentItem(), 'visitanimal': self.animalTreeWidget.getSelectedItem(), 'text': self.ui.treatmentTextEdit.toPlainText() }, returnTab=self)
def openItem(self): #TODO: Make this more generic tree_item = self.ui.treeWidget.currentItem() if tree_item != None: item = tree_item.data(0,0) if hasattr(self.tabcreator, "getType"): Tabmanager.openTab(tabCreator=self.tabcreator, newItem=item, returnTab=self) else: if self.ownDialog != None: if self.dialogitem != None: temp = self.ownDialog(parent=self, item=self.dialogitem) else: temp = self.ownDialog(parent=self) temp.show()
def openNewVisit(self): #check that we can save owner if self.saveAble(): #save it to its current state self.saveTab() owner = self.item animal = self.animalTreeWidget.getSelectedItem() from mainwindowtabs.visittab import VisitTab Tabmanager.openTab(tabCreator=VisitTab,newItem={"owner":owner ,"animal":animal}, returnTab=self) else: from models.translationtables import g_save_error_message self.errorMessage(g_save_error_message)
def openItem(self): #TODO: Make this more generic tree_item = self.ui.treeWidget.currentItem() if tree_item != None: item = tree_item.data(0, 0) if hasattr(self.tabcreator, "getType"): Tabmanager.openTab(tabCreator=self.tabcreator, newItem=item, returnTab=self) else: if self.ownDialog != None: if self.dialogitem != None: temp = self.ownDialog(parent=self, item=self.dialogitem) else: temp = self.ownDialog(parent=self) temp.show()
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 main(): #you can change databasename at models.__init__ #status = False #if SqlHandler.usesLite(): status = True #os.path.exists(getDBName()) app = QtGui.QApplication(sys.argv) #try: if not SqlHandler.initialize(): print(g_error_msg_dict['database_init']) return if LoginDialog().exec_() == QtGui.QDialog.Accepted: vet_app = MainWindow() Tabmanager.openTab(tabCreator=MainMenuTab) vet_app.showMaximized() sys.exit(app.exec_())
def openNewVisit(self): #check that we can save owner if self.saveAble(): #save it to its current state self.saveTab() owner = self.item animal = self.animalTreeWidget.getSelectedItem() from mainwindowtabs.visittab import VisitTab Tabmanager.openTab(tabCreator=VisitTab, newItem={ "owner": owner, "animal": animal }, returnTab=self) else: from models.translationtables import g_save_error_message self.errorMessage(g_save_error_message)
def openVisit(self): from mainwindowtabs.visittab import VisitTab Tabmanager.openTab(VisitTab, self.visit)
def openMainMenu(self): Tabmanager.openTab(tabCreator=MainMenuTab)
def newAnimal(self): from mainwindowtabs.animaltab import AnimalTab Tabmanager.openTab(tabCreator=AnimalTab)
def newVisit(self): from mainwindowtabs.visittab import VisitTab Tabmanager.openTab(tabCreator=VisitTab)
def newItemCreator(self): from mainwindowtabs.itemcreatortab import ItemCreatorTab Tabmanager.openTab(tabCreator=ItemCreatorTab)
def closeTab(self): #SLOT logDEBUG(self, 'GenericTab FUNCTIO: closeTab') if self.canCloseTab(): Tabmanager.closeTab(tab=self)
def openItem(self): print("LastOperationTreeWidget openItem") tree_item = self.ui.treeWidget.currentItem() if tree_item != None: visit = tree_item.data(0,0) Tabmanager.openTab(tabCreator=self.tabcreator, newItem=visit)
def newOperationCreator(self): from mainwindowtabs.operationbasecreatortab import OperationBaseCreatorTab Tabmanager.openTab(tabCreator=OperationBaseCreatorTab)
def newVet(self): from mainwindowtabs.vettab import VetTab Tabmanager.openTab(tabCreator=VetTab)
def createNewItem(self): if hasattr(self.tabcreator, "getType"): Tabmanager.openTab(tabCreator=self.tabcreator, returnTab=self) else: creator = self.tabcreator(parent=self) creator.show()
def openItem(self): print("LastOperationTreeWidget openItem") tree_item = self.ui.treeWidget.currentItem() if tree_item != None: visit = tree_item.data(0, 0) Tabmanager.openTab(tabCreator=self.tabcreator, newItem=visit)
def newOwner(self): from mainwindowtabs.ownertab import OwnerTab Tabmanager.openTab(tabCreator=OwnerTab)
def newSearch(self): from mainwindowtabs.searchtab import SearchTab Tabmanager.openTab(tabCreator=SearchTab)