def file_manager_open(self): if not self.manager: self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False) self.file_manager = MDFileManager( exit_manager=self.exit_manager, select_path=self.select_path) self.manager.add_widget(self.file_manager) self.file_manager.show('/') # output manager to the screen self.manager_open = True self.manager.open()
def open_file_manager(text_item, dialog): previous = False if text_item == 'List' else True self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False) self.file_manager = MDFileManager(exit_manager=self.exit_manager, select_path=self.select_path, previous=previous) self.manager.add_widget(self.file_manager) self.file_manager.show(self.user_data_dir) self.manager_open = True self.manager.open()
def file_manager_open(self): import os if not self.manager: self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False) self.file_manager = MDFileManager(exit_manager=self.exit_manager, select_path=self.select_path, ext=['.jpg', '.jpeg']) self.manager.add_widget(self.file_manager) self.file_manager.show(os.getcwd()) # output manager to the screen self.state.cwd = self.file_manager.current_path + "/" self.manager_open = True self.manager.open()
def file_manager_open(self): if not self.manager: self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False) self.file_manager = MDFileManager( exit_manager=self.exit_manager, select_path=self.select_path, search='all', ext=['.*']) self.manager.add_widget(self.file_manager) self.file_manager.show(HOME) self.manager_open = True self.manager.open()
def file_manager_open(self): """Opens the file manager window""" if not self.manager: self.manager = ModalView(size_hint=(1, 1), auto_dismiss=False) self.file_manager = MDFileManager(exit_manager=self.exit_manager, select_path=self.select_path) # Monkey patch file selection so that history is not erased def select_dir_or_file(path): """Called by tap on the name of the directory or file.""" if os.path.isfile(path): self.file_manager.select_path(path) return self.file_manager.current_path = path self.file_manager.show(path) self.file_manager.select_dir_or_file = select_dir_or_file self.manager.add_widget(self.file_manager) self.file_manager.show('/') # output manager to the screen self.manager_open = True self.manager.open()