Right now the file chooser opens the very root as the default location but i want it to skip that and open as default the internal storage (sdcard) and the user can go down from there.
this is a snipped of my code so far The class:
class LoadDialog(FloatLayout):
load = ObjectProperty(None)
cancel = ObjectProperty(None)
The definition in the kv file
<LoadDialog>:
BoxLayout:
size: root.size
pos: root.pos
orientation: "vertical"
FileChooserListView:
id: filechooser
BoxLayout:
size_hint_y: None
height: 30
Button:
text: "Cancel"
on_release: root.cancel()
Button:
text: "Load"
on_release: root.load(filechooser.path, filechooser.selection)
The actual load code:
def show_load(self):
content = LoadDialog(load=self.load, cancel=self.dismiss_popup)
self._popup = Popup(title="Load file", content=content,
size_hint=(0.9, 0.9))
self._popup.open()
def load(self, path, filename):
wimg = os.path.join(path, filename[0])
self.image_source = wimg
self.dismiss_popup()
So basically the user should not have to go up 1 directory to get to the sdcard, should already be there. Worst case scenario is filtering all the other folders there except the ones that contain the word sdcard.