Exemplo n.º 1
0
    def __init__(self, parent, impDatamodel, selection, psize):
        """Initiate
        
        Arguments
        parent -- the parent tkinter item
        impDatamodel -- the database to display
        selection -- list to which selected items will be added
        psize -- size of previewed images and videos
        
        """
        DataModelBrowser.__init__(self, parent, impDatamodel)
        
        self._impdm = impDatamodel
        self._selection = selection
        self._psize = psize

        self.grid(row = 0, column = 0)
        controlframe = Frame(self._gbselected)
        controlframe.grid()#(row = 1, column = 1, sticky = W + N)
        b = Button(controlframe, text = lang[lng.txtPlay] + '...', command = self._ehPlay)
        self._btnPlay = b
        b.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = W + N)

        control = Frame(self)
        control.grid(row = 1, column = 1, sticky = E)
        b = Button(control, text = lang[lng.txtCancel], command = self._ehCancel)
        b.grid(row = 0, column = 0, padx = 10, pady = 10)
        b = Button(control, text = lang[lng.txtImport], command = self._ehImport)
        self._btnImport = b
        b.grid(row = 0, column = 1, padx = 10, pady = 10)
        
        self._populateListbox()
Exemplo n.º 2
0
    def __init__(self, parent, datamodel, edittabslideshow, edittabvideo, notebook, wdir, psize):
        """Initiate
        
        Arguments
        parent -- parent tkinter item
        datamodel -- the database to manage
        edittabslideshow -- edit tab for slideshows
        edittabvideo -- edit tab for videos
        notebook -- the Notebook where the tabs are located
        wdir -- the working directory
        psize -- size of previewed images and videos
        
        """
        DataModelBrowser.__init__(self, parent, datamodel)
        
        self._edittabslideshow = edittabslideshow
        self._edittabvideo = edittabvideo
        self._notebook = notebook
        self._wdir = wdir
        self._psize = psize
        
        controlframe = Frame(self._gbselected)
        controlframe.grid()#(row = 1, column = 1, sticky = W + N)
        b = Button(controlframe, text = lang[lng.txtEdit], command = self._ehEdit)
        self._btnEdit = b
        b.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = W + N)
        b = Button(controlframe, text = lang[lng.txtPlay] + '...', command = self._ehPlay)
        self._btnPlay = b
        b.grid(row = 0, column = 2, padx = 5, pady = 5, sticky = W + N)
        
        controlframe = Frame(self._gbselection)
        controlframe.grid()#(row = 1, column = 1, sticky = W + N)
        b = Button(controlframe, text = lang[lng.txtDelete], command = self._ehDelete)
        self._btnDelete = b
        b.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = W + N)
        b = Button(controlframe, text = lang[lng.txtExport] + '...', command = self._ehExport, state = DISABLED)
        self._btnExport = b
        b.grid(row = 0, column = 1, padx = 5, pady = 5, sticky = W + N)

        controlframe = Frame(self._gbdb)
        controlframe.grid()#(row = 1, column = 1, sticky = W + N)
        b = Button(controlframe, text = lang[lng.txtImport] + '...', command = self._ehImport)
        self._btnImport = b
        b.grid(row = 0, column = 0, padx = 5, pady = 5, sticky = W + N)
        
        #Add callback to make sure the list box is updated when an item is saved
        edittabslideshow.clbSave = self._populateListbox
        self._populateListbox()
Exemplo n.º 3
0
 def _getSelectedItem(self, updateGui = False):
     """Return the first selected item and optionally update the GUI
     
     Argument
     updateGui -- if true, the GUI will be updated with information 
                  about the current selection
     
     """
     result = DataModelBrowser._getSelectedItem(self, updateGui)
     self._updateGuiState(result is not None)
     return result