comparison cagou/plugins/plugin_transfer_file.kv @ 279:aea973de55d9

transfer (file): use native file chooser on desktop: native file chooser is nicer and often more powerful than Kivy FileChooser. Kivy FileChooser is still activable with an option, for platforms where native file chooser is not easy/possible to use. Kivy FileChooser is used on Android. downloads_dir is now used as starting path on Android.
author Goffi <goffi@goffi.org>
date Wed, 20 Mar 2019 09:29:44 +0100
parents cd99f70ea592
children 1b835bcfa663
comparison
equal deleted inserted replaced
278:444ba439530f 279:aea973de55d9
16 16
17 #:import expanduser os.path.expanduser 17 #:import expanduser os.path.expanduser
18 #:import platform kivy.utils.platform 18 #:import platform kivy.utils.platform
19 19
20 20
21 <FileTransmitter>: 21 <FileChooserBox>:
22 orientation: "vertical" 22 orientation: "vertical"
23 FileChooserListView: 23 FileChooserListView:
24 id: filechooser 24 id: filechooser
25 rootpath: "/" if platform == 'android' else expanduser('~') 25 path: root.default_path
26 Button: 26 Button:
27 text: "choose" 27 text: "choose"
28 size_hint: 1, None 28 size_hint: 1, None
29 height: dp(50) 29 height: dp(50)
30 on_release: root.onTransmitOK(filechooser) 30 on_release: root.callback(filechooser.selection)
31 Button: 31 Button:
32 text: "cancel" 32 text: "cancel"
33 size_hint: 1, None 33 size_hint: 1, None
34 height: dp(50) 34 height: dp(50)
35 on_release: root.cancel_cb(root) 35 on_release: root.cancel_cb()