Example #1
0
 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)
Example #2
0
 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()
Example #3
0
 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()
Example #4
0
 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()
Example #5
0
 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)
Example #6
0
    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)
Example #7
0
 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()
Example #8
0
 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!')
Example #9
0
 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)
Example #10
0
 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!')
Example #11
0
 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()
Example #12
0
    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)  
Example #13
0
 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()
Example #14
0
 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)
Example #15
0
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_())
Example #16
0
    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)
Example #17
0
 def openVisit(self):
     from mainwindowtabs.visittab import VisitTab
     Tabmanager.openTab(VisitTab, self.visit)
Example #18
0
 def openMainMenu(self):
     Tabmanager.openTab(tabCreator=MainMenuTab)
Example #19
0
 def newAnimal(self):
     from mainwindowtabs.animaltab import AnimalTab
     Tabmanager.openTab(tabCreator=AnimalTab)
Example #20
0
 def newVisit(self):
     from mainwindowtabs.visittab import VisitTab
     Tabmanager.openTab(tabCreator=VisitTab)
Example #21
0
 def newItemCreator(self):
     from mainwindowtabs.itemcreatortab import ItemCreatorTab
     Tabmanager.openTab(tabCreator=ItemCreatorTab)
Example #22
0
 def closeTab(self):  #SLOT
     logDEBUG(self, 'GenericTab FUNCTIO: closeTab')
     if self.canCloseTab():
         Tabmanager.closeTab(tab=self)
Example #23
0
 def openMainMenu(self):
     Tabmanager.openTab(tabCreator=MainMenuTab)
Example #24
0
 def newVisit(self):
     from mainwindowtabs.visittab import VisitTab
     Tabmanager.openTab(tabCreator=VisitTab)
Example #25
0
 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)
Example #26
0
 def newOperationCreator(self):
     from mainwindowtabs.operationbasecreatortab import OperationBaseCreatorTab
     Tabmanager.openTab(tabCreator=OperationBaseCreatorTab)
Example #27
0
 def newAnimal(self):
     from mainwindowtabs.animaltab import AnimalTab
     Tabmanager.openTab(tabCreator=AnimalTab)
Example #28
0
 def newVet(self):
     from mainwindowtabs.vettab import VetTab
     Tabmanager.openTab(tabCreator=VetTab)
Example #29
0
 def createNewItem(self):
     if hasattr(self.tabcreator, "getType"):
         Tabmanager.openTab(tabCreator=self.tabcreator, returnTab=self)
     else:
         creator = self.tabcreator(parent=self)
         creator.show()
Example #30
0
 def createNewItem(self):
     if hasattr(self.tabcreator, "getType"):
         Tabmanager.openTab(tabCreator=self.tabcreator, returnTab=self)
     else:
         creator = self.tabcreator(parent=self)
         creator.show()
Example #31
0
 def newVet(self):
     from mainwindowtabs.vettab import VetTab
     Tabmanager.openTab(tabCreator=VetTab)
Example #32
0
 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)
Example #33
0
 def newItemCreator(self):
     from mainwindowtabs.itemcreatortab import ItemCreatorTab
     Tabmanager.openTab(tabCreator=ItemCreatorTab)
Example #34
0
 def newOwner(self):
     from mainwindowtabs.ownertab import OwnerTab
     Tabmanager.openTab(tabCreator=OwnerTab)
Example #35
0
 def newSearch(self):
     from mainwindowtabs.searchtab import SearchTab
     Tabmanager.openTab(tabCreator=SearchTab)
Example #36
0
 def newOperationCreator(self):
     from mainwindowtabs.operationbasecreatortab import OperationBaseCreatorTab
     Tabmanager.openTab(tabCreator=OperationBaseCreatorTab)
Example #37
0
 def newOwner(self):
     from mainwindowtabs.ownertab import OwnerTab
     Tabmanager.openTab(tabCreator=OwnerTab)
Example #38
0
 def newSearch(self):
     from mainwindowtabs.searchtab import SearchTab
     Tabmanager.openTab(tabCreator=SearchTab)