diff options
author | nathansmithsmith <nathansmith7@mailfence.com> | 2023-11-09 20:53:10 +0000 |
---|---|---|
committer | nathansmithsmith <nathansmith7@mailfence.com> | 2023-11-09 20:53:10 +0000 |
commit | 40b98d98f8dcc7b8a6da46e825d667989a436c67 (patch) | |
tree | 140e3dcd1d2897feaa9527e756a0d103266ba9a4 /src/model/youload_file_chooser.py | |
parent | c01b36209a12fe7b19ee4ba8a3a467697d9bbf5f (diff) | |
download | youload-40b98d98f8dcc7b8a6da46e825d667989a436c67.tar.gz youload-40b98d98f8dcc7b8a6da46e825d667989a436c67.tar.bz2 youload-40b98d98f8dcc7b8a6da46e825d667989a436c67.zip |
Added download types
Diffstat (limited to 'src/model/youload_file_chooser.py')
-rw-r--r-- | src/model/youload_file_chooser.py | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/model/youload_file_chooser.py b/src/model/youload_file_chooser.py deleted file mode 100644 index ab37a2d..0000000 --- a/src/model/youload_file_chooser.py +++ /dev/null @@ -1,53 +0,0 @@ -from kivy.uix.popup import Popup -from kivy.uix.button import Button -from kivy.uix.boxlayout import BoxLayout -from kivy.uix.filechooser import FileChooserListView -from kivy.uix.textinput import TextInput -from pathlib import Path -import os - -class YouloadFileChooser(Popup): - - def __init__(self, **kwargs): - super(YouloadFileChooser, self).__init__(**kwargs) - - layout = BoxLayout(orientation='vertical') - - self.title = "Find folder" - - self.dirselect = True - - # Path input. - self.path_input = TextInput(text=str(Path.home()), multiline=False, size_hint=(0.9, 1.0)) - self.path_input.bind(text=self.uid_path_input) - - # Close button. - close_button = Button(text="Close", size_hint=(0.1, 1.0)) - close_button.bind(on_press=self.close_button_cb) - - top_bar_layout = BoxLayout(size_hint=(1.0, 0.1)) - top_bar_layout.add_widget(self.path_input) - top_bar_layout.add_widget(close_button) - - # File chooser. - self.file_chooser = FileChooserListView(size_hint=(1.0, 0.9)) - self.file_chooser.path = str(Path.home()) - - layout.add_widget(top_bar_layout) - layout.add_widget(self.file_chooser) - self.add_widget(layout) - - def set_app(self, app): - self.app = app - - def close_button_cb(self, instance): - self.app.folder_display.text = self.get_folder() - self.parent.remove_widget(self) - - def uid_path_input(self, instance, value): - if os.path.exists(value): - self.file_chooser.path = value - - def get_folder(self): - return self.file_chooser.path - |