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)
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[:]
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()
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()
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
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
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
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()
def __init__(self): World.LOG().info("AbstractEntityManager constructor called") self._db = World.DBA() self._cursor = self._db.cursor
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
def _onExit(self): World.DBA().closeConnection() World.LOG().info( "************** Application closed. Bye! **************\n") self.master.destroy()