Пример #1
0
    def setState(self, state='disabled'):
        World.LOG().info("MinuxTable.setState called ")
        if self.__plusButton != None:
            self.__plusButton.configure(state=state)

        for row in self.__widgets:
            for widget in row:
                if widget != None and widget.winfo_class() == 'TButton':
                    widget.configure(state=state)
Пример #2
0
    def clear(self):
        return
        World.LOG().info("MinuxTable.clear() called")
        for widget in self.__widgetFrame.grid_slaves():
            widget.grid_forget()
            widget.destroy()

        del self.__widgets[1:]
        del self.__data[:]
Пример #3
0
    def __init__(self, master, person):
        Toplevel.__init__(self, master)
        World.LOG().info("PersonDialog opening.")
        self.title(World.L("PersonDialog.TITLE"))
        self['bd'] = World.padSize()
        self.__person = person

        self.__createWidgets()
        self.__showItem()

        self.setModal()
Пример #4
0
    def __init__(self, master, appEntity, entity):
        Toplevel.__init__(self, master)
        World.LOG().info("ChooserDialog opening.")
        self.title(World.L("ChooserDialog.TITLE"))
        self['bd'] = World.padSize()
        self.__appEntity = appEntity
        self.__entity = entity

        self.__createWidgets()
        self.__fillListWithElements()
        self.__showItem()

        self.setModal()
Пример #5
0
    def editChild(self, childType, data):
        World.LOG().info("editChild called: " + childType + " " + str(data))

        if childType == self._rawMaterialContentType:
            if len(data) == 0:
                data = [0, 0, '', self._entity.id, '', '', '', '']
            content = RawMaterialContent.unserialize(data)
            content = self._editRawMaterialContent(content)
            if content.name != '':
                data = RawMaterialContent.serialize(content)
            else:
                data = []

            if content.markedForDeletion:
                data[1] = MinuxTable.ENTITY_IS_MARKED_FOR_DELETION

        return data
Пример #6
0
 def editChild(self, childType, data):
     World.LOG().info("editChild called: " + childType + " " + str(data))
     
     if childType == self._additiveGroupType:
         if len(data) == 0:
             data = [0, 0, '', 0, '']  
         ag = AdditiveGroup.unserialize(data)
         ag = self._editAdditiveGroup(ag)
         if ag.name != '': 
             data = AdditiveGroup.serialize(ag)
         else:
             data = []
         
         if ag.markedForDeletion:
             data[1] = ChooserTable.ENTITY_IS_MARKED_FOR_DELETION
            
     return data
Пример #7
0
    def editChild(self, childType, data):
        World.LOG().info("editChild called: " + childType + " " + str(data))

        if childType == self._personType:
            if len(data) == 0:
                data = [0, 0, '', self._entity.id, '', '', '', '']
            person = Person.unserialize(data)
            person = self._editPerson(person)
            if person.name != '':
                data = Person.serialize(person)
            else:
                data = []

            if person.markedForDeletion:
                data[1] = MinuxTable.ENTITY_IS_MARKED_FOR_DELETION

        return data
Пример #8
0
    def __init__(self, master):
        tkinter.Toplevel.__init__(self, master)
        World.LOG().info("Login process started.")
        self.protocol("WM_DELETE_WINDOW", master._onExit)
        self['bd'] = World.padSize()
             
        c = 0
        r = 0        
        
        titleLabel = Label(self, text=World.L("LoginDialog.TITLE"))
        titleLabel.grid(row=r, column=c, columnspan=2, 
                        padx=World.padSize(), pady=World.padSize())

        r += 1
        nameLabel = Label(self, text=World.L("USERNAME"))
        nameLabel.grid(row=r, column=c,
                       padx=World.smallPadSize(), pady=World.smallPadSize())
        c += 1
        self._nameEntry = Entry(self)
        self._nameEntry.grid(row=r, column=c,
                             padx=World.smallPadSize(), pady=World.smallPadSize())

        r += 1
        c = 0
        passwordLabel = Label(self, text=World.L("PASSWORD"))
        passwordLabel.grid(row=r, column=c,
                           padx=World.smallPadSize(), pady=World.smallPadSize())
        c += 1
        self._passwordEntry = Entry(self)
        self._passwordEntry.grid(row=r, column=c,
                                 padx=World.smallPadSize(), pady=World.smallPadSize())

        r += 1
        c = 0
        loginButton = Button(self, text=World.L('LOGIN'),
                             command=lambda: master._onSuccessfulLogin(self))
        loginButton.grid(row=r, column=c,
                         padx=World.smallPadSize(), pady=World.smallPadSize())
        c += 1
        exitButton = Button(self, text=World.L('EXIT'), command=master._onExit)
        exitButton.grid(row=r, column=c,
                        padx=World.smallPadSize(), pady=World.smallPadSize())
        
        self.center()
        self.resizable(False, False)
        self.setModal()
Пример #9
0
 def __init__(self):
     World.LOG().info("AbstractEntityManager constructor called")
     self._db = World.DBA()
     self._cursor = self._db.cursor
Пример #10
0
 def _editAdditiveGroup(self, ag):
     ChooserDialog(self, AdditiveGroup, ag) # ag contains only the name and id
     ag = AdditiveGroup.get(ag.id) # we should read the whole record
     self._entity.additive_group = ag
     World.LOG().debug("additive group choosen: " + str(ag.id))
     return ag
Пример #11
0
 def _onExit(self):
     World.DBA().closeConnection()
     World.LOG().info(
         "************** Application closed. Bye! **************\n")
     self.master.destroy()