Beispiel #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)
Beispiel #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()
Beispiel #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()
Beispiel #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()
Beispiel #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)
Beispiel #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)
Beispiel #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()
Beispiel #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!')
Beispiel #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)
Beispiel #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!')
Beispiel #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()
Beispiel #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)  
Beispiel #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()
Beispiel #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)
Beispiel #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_())
Beispiel #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)
Beispiel #17
0
 def openVisit(self):
     from mainwindowtabs.visittab import VisitTab
     Tabmanager.openTab(VisitTab, self.visit)
Beispiel #18
0
 def openMainMenu(self):
     Tabmanager.openTab(tabCreator=MainMenuTab)
Beispiel #19
0
 def newAnimal(self):
     from mainwindowtabs.animaltab import AnimalTab
     Tabmanager.openTab(tabCreator=AnimalTab)
Beispiel #20
0
 def newVisit(self):
     from mainwindowtabs.visittab import VisitTab
     Tabmanager.openTab(tabCreator=VisitTab)
Beispiel #21
0
 def newItemCreator(self):
     from mainwindowtabs.itemcreatortab import ItemCreatorTab
     Tabmanager.openTab(tabCreator=ItemCreatorTab)
Beispiel #22
0
 def closeTab(self):  #SLOT
     logDEBUG(self, 'GenericTab FUNCTIO: closeTab')
     if self.canCloseTab():
         Tabmanager.closeTab(tab=self)
Beispiel #23
0
 def openMainMenu(self):
     Tabmanager.openTab(tabCreator=MainMenuTab)
Beispiel #24
0
 def newVisit(self):
     from mainwindowtabs.visittab import VisitTab
     Tabmanager.openTab(tabCreator=VisitTab)
Beispiel #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)
Beispiel #26
0
 def newOperationCreator(self):
     from mainwindowtabs.operationbasecreatortab import OperationBaseCreatorTab
     Tabmanager.openTab(tabCreator=OperationBaseCreatorTab)
Beispiel #27
0
 def newAnimal(self):
     from mainwindowtabs.animaltab import AnimalTab
     Tabmanager.openTab(tabCreator=AnimalTab)
Beispiel #28
0
 def newVet(self):
     from mainwindowtabs.vettab import VetTab
     Tabmanager.openTab(tabCreator=VetTab)
Beispiel #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()
Beispiel #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()
Beispiel #31
0
 def newVet(self):
     from mainwindowtabs.vettab import VetTab
     Tabmanager.openTab(tabCreator=VetTab)
Beispiel #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)
Beispiel #33
0
 def newItemCreator(self):
     from mainwindowtabs.itemcreatortab import ItemCreatorTab
     Tabmanager.openTab(tabCreator=ItemCreatorTab)
Beispiel #34
0
 def newOwner(self):
     from mainwindowtabs.ownertab import OwnerTab
     Tabmanager.openTab(tabCreator=OwnerTab)
Beispiel #35
0
 def newSearch(self):
     from mainwindowtabs.searchtab import SearchTab
     Tabmanager.openTab(tabCreator=SearchTab)
Beispiel #36
0
 def newOperationCreator(self):
     from mainwindowtabs.operationbasecreatortab import OperationBaseCreatorTab
     Tabmanager.openTab(tabCreator=OperationBaseCreatorTab)
Beispiel #37
0
 def newOwner(self):
     from mainwindowtabs.ownertab import OwnerTab
     Tabmanager.openTab(tabCreator=OwnerTab)
Beispiel #38
0
 def newSearch(self):
     from mainwindowtabs.searchtab import SearchTab
     Tabmanager.openTab(tabCreator=SearchTab)