def __init__(self, parent_widget, *args, default_path='', default_populate=True, **kwargs): Box.__init__(self, parent_widget, *args, **kwargs) self.cancel_cb = None self.action_cb = None self.cb_dir_change = None self.threaded_fn = ThreadedFunction() # pylint: disable=c-extension-no-member self._timer = ecore.Timer(0.02, self.populate_file) # Watch key presses for ctrl+l to select entry parent_widget.elm_event_callback_add(self.cb_events) self.selected_dir = None self.show_hidden = False self.cur_dir = None self.focused_entry = None self.dir_only = False self.sort_reverse = False self.adding_hidden = False self.pending_files = deque() self.cur_subdirs = [] self.cur_files = [] # Mode should be 'save' or 'load' self.mode = 'save' self.home = os.path.expanduser('~') desktop = os.environ.get('XDG_DESKTOP_DIR') if desktop: self.desktop = desktop else: self.desktop = self.home + '/Desktop' self.root = '/' # Label+Entry for File Name self.filename_bx = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.filename_bx.horizontal = True self.filename_bx.show() file_label = Label(self, size_hint_weight=(0.15, EVAS_HINT_EXPAND), size_hint_align=FILL_HORIZ) file_label.text = 'Filename:' file_label.show() self.file_entry = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) self.file_entry.single_line_set(True) self.file_entry.scrollable_set(True) self.file_entry.callback_changed_user_add(self.cb_file_entry) self.file_entry.show() self.filename_bx.pack_end(file_label) self.filename_bx.pack_end(self.file_entry) sep = Separator(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) sep.horizontal_set(True) sep.show() # Label+Entry for File Path self.filepath_bx = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.filepath_bx.horizontal = True self.filepath_bx.show() file_label = Label(self, size_hint_weight=(0.15, EVAS_HINT_EXPAND), size_hint_align=FILL_HORIZ) file_label.text = 'Current Folder:' file_label.show() self.filepath_en = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) self.filepath_en.single_line_set(True) self.filepath_en.scrollable_set(True) self.filepath_en.callback_changed_user_add(self.cb_file_entry) self.filepath_en.callback_unfocused_add(self.cb_filepath_en) self.filepath_en.callback_activated_add(self.cb_filepath_en) # Wish this worked. Doesn't seem to do anything # Working now EFL 1.22 ? self.filepath_en.input_hint_set(ELM_INPUT_HINT_AUTO_COMPLETE) if default_path and os.path.isdir(default_path): start = default_path else: start = self.home self.filepath_en.show() self.filepath_bx.pack_end(file_label) self.filepath_bx.pack_end(self.filepath_en) self.autocomplete_hover = Hoversel(self, hover_parent=self) self.autocomplete_hover.callback_selected_add(self.cb_hover) self.autocomplete_hover.show() self.file_selector_bx = Panes(self, content_left_size=0.3, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.file_selector_bx.show() # Bookmarks Box contains: # # - Button - Up Arrow # - List - Home/Desktop/Root/GTK bookmarks # - Box # -- Button - Add Bookmark # -- Button - Remove Bookmark self.bookmark_bx = Box(self, size_hint_weight=(0.3, EVAS_HINT_EXPAND), size_hint_align=FILL_BOTH) self.bookmark_bx.show() up_ic = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, order_lookup=ELM_ICON_LOOKUP_THEME) up_ic.standard_set('arrow-up') up_ic.show() self.up_btn = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=up_ic) self.up_btn.text = 'Up' self.up_btn.callback_pressed_add(self.cb_up_btn) self.up_btn.show() self.bookmarks_lst = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.bookmarks_lst.callback_activated_add(self.cb_bookmarks_lst) self.bookmarks_lst.show() self.bookmark_modbox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.bookmark_modbox.horizontal = True self.bookmark_modbox.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set('list-add') con.show() self.add_btn = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=con) self.add_btn.callback_pressed_add(self.cb_add_btn) self.add_btn.disabled = True self.add_btn.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set('list-remove') con.show() self.rm_btn = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=con) self.rm_btn.callback_pressed_add(self.cb_remove) self.rm_btn.disabled = True self.rm_btn.show() self.bookmark_modbox.pack_end(self.add_btn) self.bookmark_modbox.pack_end(self.rm_btn) self.bookmark_bx.pack_end(self.up_btn) self.bookmark_bx.pack_end(self.bookmarks_lst) self.bookmark_bx.pack_end(self.bookmark_modbox) # Directory List self.file_list_bx = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.file_list_bx.show() self.file_sort_btn = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.file_sort_btn.text = u'⬆ Name' self.file_sort_btn.callback_pressed_add(self.cb_sort) self.file_sort_btn.show() self.file_lst = Genlist(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, homogeneous=True, mode=ELM_LIST_COMPRESS) self.file_lst.callback_activated_add(self.cb_file_lst) self.file_lst.show() self.preview = preview = Image(self) preview.size_hint_align = FILL_BOTH preview.show() self.file_list_bx.pack_end(self.file_sort_btn) self.file_list_bx.pack_end(self.file_lst) self.file_list_bx.pack_end(self.preview) self.file_selector_bx.part_content_set('left', self.bookmark_bx) self.file_selector_bx.part_content_set('right', self.file_list_bx) # Cancel and Save/Open button self.button_bx = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=(1.0, 0.5)) self.button_bx.horizontal = True self.button_bx.show() self.action_ic = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.action_ic.standard_set('document-save') self.action_ic.show() self.action_btn = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=self.action_ic) self.action_btn.text = 'Save ' self.action_btn.callback_pressed_add(self.cb_action_btn) self.action_btn.show() cancel_ic = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) cancel_ic.standard_set('application-exit') cancel_ic.show() self.cancel_btn = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=cancel_ic) self.cancel_btn.text = 'Cancel ' self.cancel_btn.callback_pressed_add(self.cb_cancel_btn) self.cancel_btn.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set('edit-find') con.show() self.hidden_btn = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=con) self.hidden_btn.text = 'Toggle Hidden ' self.hidden_btn.callback_pressed_add(self.cb_toggle_hidden) self.hidden_btn.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set('folder-new') con.show() self.create_dir_btn = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=con) self.create_dir_btn.text = 'Create Folder ' self.create_dir_btn.callback_pressed_add(self.cb_create_dir) self.create_dir_btn.show() self.button_bx.pack_end(self.create_dir_btn) self.button_bx.pack_end(self.hidden_btn) self.button_bx.pack_end(self.cancel_btn) self.button_bx.pack_end(self.action_btn) self.pack_end(self.filename_bx) self.pack_end(sep) self.pack_end(self.filepath_bx) self.pack_end(self.autocomplete_hover) self.pack_end(self.file_selector_bx) self.pack_end(self.button_bx) self.populate_bookmarks() self.create_popup = Popup(self) self.create_popup.part_text_set('title,text', 'Create Folder:') self.create_en = Entry(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.create_en.single_line_set(True) self.create_en.scrollable_set(True) self.create_en.show() self.create_popup.content = self.create_en bt0 = Button(self, text='Create') bt0.callback_clicked_add(self.cb_create_folder) self.create_popup.part_content_set('button1', bt0) bt1 = Button(self, text='Cancel') bt1.callback_clicked_add(self.cb_close_popup) self.create_popup.part_content_set('button2', bt1) self.recent = None # keeps pylint happy: if default_populate: self.populate_files(start)
def __init__(self, parent_widget, defaultPath="", defaultPopulate=True, *args, **kwargs): Box.__init__(self, parent_widget, *args, **kwargs) self.cancelCallback = None self.actionCallback = None self.directoryChangeCallback = None self.threadedFunction = ThreadedFunction() self._timer = ecore.Timer(0.02, self.populateFile) #Watch key presses for ctrl+l to select entry parent_widget.elm_event_callback_add(self.eventsCb) self.selectedFolder = None self.showHidden = False self.currentDirectory = None self.focusedEntry = None self.folderOnly = False self.sortReverse = False self.addingHidden = False self.pendingFiles = deque() self.currentSubFolders = [] self.currentFiles = [] #Mode should be "save" or "load" self.mode = "save" self.home = os.path.expanduser("~") self.root = "/" #Label+Entry for File Name self.filenameBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.filenameBox.horizontal = True self.filenameBox.show() fileLabel = Label(self, size_hint_weight=(0.15, EVAS_HINT_EXPAND), size_hint_align=FILL_HORIZ) fileLabel.text = "Filename:" fileLabel.show() self.fileEntry = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) self.fileEntry.single_line_set(True) self.fileEntry.scrollable_set(True) self.fileEntry.callback_changed_user_add(self.fileEntryChanged) self.fileEntry.show() self.filenameBox.pack_end(fileLabel) self.filenameBox.pack_end(self.fileEntry) sep = Separator(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) sep.horizontal_set(True) sep.show() #Label+Entry for File Path self.filepathBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.filepathBox.horizontal = True self.filepathBox.show() fileLabel = Label(self, size_hint_weight=(0.15, EVAS_HINT_EXPAND), size_hint_align=FILL_HORIZ) fileLabel.text = "Current Folder:" fileLabel.show() self.filepathEntry = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) self.filepathEntry.single_line_set(True) self.filepathEntry.scrollable_set(True) self.filepathEntry.callback_changed_user_add(self.fileEntryChanged) self.filepathEntry.callback_unfocused_add(self.filepathEditDone) self.filepathEntry.callback_activated_add(self.filepathEditDone) #Wish this worked. Doesn't seem to do anything #self.filepathEntry.input_hint_set(ELM_INPUT_HINT_AUTO_COMPLETE) if defaultPath and os.path.isdir(defaultPath): startPath = defaultPath else: startPath = self.home self.filepathEntry.show() self.filepathBox.pack_end(fileLabel) self.filepathBox.pack_end(self.filepathEntry) self.autocompleteHover = Hoversel(self, hover_parent=self) self.autocompleteHover.callback_selected_add(self.autocompleteSelected) #self.autocompleteHover.show() self.fileSelectorBox = Panes(self, content_left_size=0.3, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.fileSelectorBox.show() """Bookmarks Box contains: - Button - Up Arrow - List - Home/Root/GTK bookmarks - Box -- Button - Add Bookmark -- Button - Remove Bookmark""" self.bookmarkBox = Box(self, size_hint_weight=(0.3, EVAS_HINT_EXPAND), size_hint_align=FILL_BOTH) self.bookmarkBox.show() upIcon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) upIcon.standard_set("go-up") upIcon.show() self.upButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=upIcon) self.upButton.text = "Up" self.upButton.callback_pressed_add(self.upButtonPressed) self.upButton.show() self.bookmarksList = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.bookmarksList.callback_activated_add(self.bookmarkDoubleClicked) self.bookmarksList.show() self.bookmarkModBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.bookmarkModBox.horizontal = True self.bookmarkModBox.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("add") con.show() self.addButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=con) self.addButton.callback_pressed_add(self.addButtonPressed) self.addButton.disabled = True self.addButton.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("remove") con.show() self.removeButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=con) self.removeButton.callback_pressed_add(self.removeButtonPressed) self.removeButton.disabled = True self.removeButton.show() self.bookmarkModBox.pack_end(self.addButton) self.bookmarkModBox.pack_end(self.removeButton) self.bookmarkBox.pack_end(self.upButton) self.bookmarkBox.pack_end(self.bookmarksList) self.bookmarkBox.pack_end(self.bookmarkModBox) #Directory List self.fileListBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.fileListBox.show() self.fileSortButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.fileSortButton.text = u"⬆ Name" self.fileSortButton.callback_pressed_add(self.sortData) self.fileSortButton.show() self.fileList = Genlist(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, homogeneous=True, mode=ELM_LIST_COMPRESS) self.fileList.callback_activated_add(self.fileDoubleClicked) self.fileList.show() self.previewImage = previewImage = Image(self) #previewImage.size_hint_weight = EXPAND_BOTH previewImage.size_hint_align = FILL_BOTH previewImage.show() self.fileListBox.pack_end(self.fileSortButton) self.fileListBox.pack_end(self.fileList) self.fileListBox.pack_end(self.previewImage) self.fileSelectorBox.part_content_set("left", self.bookmarkBox) self.fileSelectorBox.part_content_set("right", self.fileListBox) #Cancel and Save/Open button self.buttonBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=(1.0, 0.5)) self.buttonBox.horizontal = True self.buttonBox.show() self.actionIcon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.actionIcon.standard_set("document-save") self.actionIcon.show() self.actionButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=self.actionIcon) self.actionButton.text = "Save " self.actionButton.callback_pressed_add(self.actionButtonPressed) self.actionButton.show() cancelIcon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) cancelIcon.standard_set("dialog-cancel") cancelIcon.show() self.cancelButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=cancelIcon) self.cancelButton.text = "Cancel " self.cancelButton.callback_pressed_add(self.cancelButtonPressed) self.cancelButton.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("gtk-find") con.show() self.toggleHiddenButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=con) self.toggleHiddenButton.text = "Toggle Hidden " self.toggleHiddenButton.callback_pressed_add( self.toggleHiddenButtonPressed) self.toggleHiddenButton.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("folder-new") con.show() self.createFolderButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=con) self.createFolderButton.text = "Create Folder " self.createFolderButton.callback_pressed_add( self.createFolderButtonPressed) self.createFolderButton.show() self.buttonBox.pack_end(self.createFolderButton) self.buttonBox.pack_end(self.toggleHiddenButton) self.buttonBox.pack_end(self.cancelButton) self.buttonBox.pack_end(self.actionButton) self.pack_end(self.filenameBox) self.pack_end(sep) self.pack_end(self.filepathBox) self.pack_end(self.autocompleteHover) self.pack_end(self.fileSelectorBox) self.pack_end(self.buttonBox) self.populateBookmarks() self.createPopup = Popup(self) self.createPopup.part_text_set("title,text", "Create Folder:") self.createEn = en = Entry(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) en.single_line_set(True) en.scrollable_set(True) en.show() self.createPopup.content = en bt = Button(self, text="Create") bt.callback_clicked_add(self.createFolder) self.createPopup.part_content_set("button1", bt) bt2 = Button(self, text="Cancel") bt2.callback_clicked_add(self.closePopup) self.createPopup.part_content_set("button2", bt2) if defaultPopulate: self.populateFiles(startPath)
def __init__(self, parent_widget, defaultPath="", defaultPopulate=True, *args, **kwargs): Box.__init__(self, parent_widget, *args, **kwargs) self.cancelCallback = None self.actionCallback = None self.directoryChangeCallback = None self.threadedFunction = ThreadedFunction() self._timer = ecore.Timer(0.02, self.populateFile) #Watch key presses for ctrl+l to select entry parent_widget.elm_event_callback_add(self.eventsCb) self.selectedFolder = None self.showHidden = False self.currentDirectory = None self.focusedEntry = None self.folderOnly = False self.sortReverse = False self.addingHidden = False self.pendingFiles = deque() self.currentSubFolders = [] self.currentFiles = [] #Mode should be "save" or "load" self.mode = "save" self.home = os.path.expanduser("~") self.root = "/" #Label+Entry for File Name self.filenameBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.filenameBox.horizontal = True self.filenameBox.show() fileLabel = Label(self, size_hint_weight=(0.15, EVAS_HINT_EXPAND), size_hint_align=FILL_HORIZ) fileLabel.text = "Filename:" fileLabel.show() self.fileEntry = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) self.fileEntry.single_line_set(True) self.fileEntry.scrollable_set(True) self.fileEntry.callback_changed_user_add(self.fileEntryChanged) self.fileEntry.show() self.filenameBox.pack_end(fileLabel) self.filenameBox.pack_end(self.fileEntry) sep = Separator(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) sep.horizontal_set(True) sep.show() #Label+Entry for File Path self.filepathBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.filepathBox.horizontal = True self.filepathBox.show() fileLabel = Label(self, size_hint_weight=(0.15, EVAS_HINT_EXPAND), size_hint_align=FILL_HORIZ) fileLabel.text = "Current Folder:" fileLabel.show() self.filepathEntry = Entry(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_HORIZ) self.filepathEntry.single_line_set(True) self.filepathEntry.scrollable_set(True) self.filepathEntry.callback_changed_user_add(self.fileEntryChanged) self.filepathEntry.callback_unfocused_add(self.filepathEditDone) self.filepathEntry.callback_activated_add(self.filepathEditDone) #Wish this worked. Doesn't seem to do anything #self.filepathEntry.input_hint_set(ELM_INPUT_HINT_AUTO_COMPLETE) if defaultPath and os.path.isdir(defaultPath): startPath = defaultPath else: startPath = self.home self.filepathEntry.show() self.filepathBox.pack_end(fileLabel) self.filepathBox.pack_end(self.filepathEntry) self.autocompleteHover = Hoversel(self, hover_parent=self) self.autocompleteHover.callback_selected_add(self.autocompleteSelected) #self.autocompleteHover.show() self.fileSelectorBox = Panes(self, content_left_size=0.3, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.fileSelectorBox.show() """Bookmarks Box contains: - Button - Up Arrow - List - Home/Root/GTK bookmarks - Box -- Button - Add Bookmark -- Button - Remove Bookmark""" self.bookmarkBox = Box(self, size_hint_weight=(0.3, EVAS_HINT_EXPAND), size_hint_align=FILL_BOTH) self.bookmarkBox.show() upIcon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) upIcon.standard_set("go-up") upIcon.show() self.upButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=upIcon) self.upButton.text = "Up" self.upButton.callback_pressed_add(self.upButtonPressed) self.upButton.show() self.bookmarksList = List(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.bookmarksList.callback_activated_add(self.bookmarkDoubleClicked) self.bookmarksList.show() self.bookmarkModBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.bookmarkModBox.horizontal = True self.bookmarkModBox.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("add") con.show() self.addButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=con) self.addButton.callback_pressed_add(self.addButtonPressed) self.addButton.disabled = True self.addButton.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("remove") con.show() self.removeButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ, content=con) self.removeButton.callback_pressed_add(self.removeButtonPressed) self.removeButton.disabled = True self.removeButton.show() self.bookmarkModBox.pack_end(self.addButton) self.bookmarkModBox.pack_end(self.removeButton) self.bookmarkBox.pack_end(self.upButton) self.bookmarkBox.pack_end(self.bookmarksList) self.bookmarkBox.pack_end(self.bookmarkModBox) #Directory List self.fileListBox = Box(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.fileListBox.show() self.fileSortButton = Button(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) self.fileSortButton.text = u"⬆ Name" self.fileSortButton.callback_pressed_add(self.sortData) self.fileSortButton.show() self.fileList = Genlist(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH, homogeneous=True, mode=ELM_LIST_COMPRESS) self.fileList.callback_activated_add(self.fileDoubleClicked) self.fileList.show() self.previewImage = previewImage = Image(self) #previewImage.size_hint_weight = EXPAND_BOTH previewImage.size_hint_align = FILL_BOTH previewImage.show() self.fileListBox.pack_end(self.fileSortButton) self.fileListBox.pack_end(self.fileList) self.fileListBox.pack_end(self.previewImage) self.fileSelectorBox.part_content_set("left", self.bookmarkBox) self.fileSelectorBox.part_content_set("right", self.fileListBox) #Cancel and Save/Open button self.buttonBox = Box(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=(1.0, 0.5)) self.buttonBox.horizontal = True self.buttonBox.show() self.actionIcon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) self.actionIcon.standard_set("document-save") self.actionIcon.show() self.actionButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=self.actionIcon) self.actionButton.text = "Save " self.actionButton.callback_pressed_add(self.actionButtonPressed) self.actionButton.show() cancelIcon = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) cancelIcon.standard_set("exit") cancelIcon.show() self.cancelButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=cancelIcon) self.cancelButton.text = "Cancel " self.cancelButton.callback_pressed_add(self.cancelButtonPressed) self.cancelButton.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("gtk-find") con.show() self.toggleHiddenButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=con) self.toggleHiddenButton.text = "Toggle Hidden " self.toggleHiddenButton.callback_pressed_add(self.toggleHiddenButtonPressed) self.toggleHiddenButton.show() con = Icon(self, size_hint_weight=EXPAND_BOTH, size_hint_align=FILL_BOTH) con.standard_set("folder-new") con.show() self.createFolderButton = Button(self, size_hint_weight=(0.0, 0.0), size_hint_align=(1.0, 0.5), content=con) self.createFolderButton.text = "Create Folder " self.createFolderButton.callback_pressed_add(self.createFolderButtonPressed) self.createFolderButton.show() self.buttonBox.pack_end(self.createFolderButton) self.buttonBox.pack_end(self.toggleHiddenButton) self.buttonBox.pack_end(self.cancelButton) self.buttonBox.pack_end(self.actionButton) self.pack_end(self.filenameBox) self.pack_end(sep) self.pack_end(self.filepathBox) self.pack_end(self.autocompleteHover) self.pack_end(self.fileSelectorBox) self.pack_end(self.buttonBox) self.populateBookmarks() self.createPopup = Popup(self) self.createPopup.part_text_set("title,text", "Create Folder:") self.createEn = en = Entry(self, size_hint_weight=EXPAND_HORIZ, size_hint_align=FILL_HORIZ) en.single_line_set(True) en.scrollable_set(True) en.show() self.createPopup.content = en bt = Button(self, text="Create") bt.callback_clicked_add(self.createFolder) self.createPopup.part_content_set("button1", bt) bt2 = Button(self, text="Cancel") bt2.callback_clicked_add(self.closePopup) self.createPopup.part_content_set("button2", bt2) if defaultPopulate: self.populateFiles(startPath)