From ba4fbab831b09bd66fca8136333db384b44ff6c1 Mon Sep 17 00:00:00 2001 From: Lucas Fryzek Date: Sun, 6 Oct 2024 00:39:55 +0100 Subject: chat: Add support for file upload --- src/preferences.py | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/preferences.py') diff --git a/src/preferences.py b/src/preferences.py index d864012..1a87e29 100644 --- a/src/preferences.py +++ b/src/preferences.py @@ -39,6 +39,8 @@ class WeegtkPreferences(Adw.PreferencesDialog): ssh_key_path = "" + upload_url = Gtk.Template.Child() + def __init__(self, **kwargs): super().__init__(**kwargs) @@ -53,6 +55,8 @@ class WeegtkPreferences(Adw.PreferencesDialog): self.ssh_username.set_text(self.config["ssh"]["username"]) self.set_ssh_key(self.config["ssh"]["key"]) + self.upload_url.set_text(self.config["upload"]["url"]) + self.install_action("ssh_key.open", None, self.ssh_key_open) def read_preferences(self): @@ -65,6 +69,8 @@ class WeegtkPreferences(Adw.PreferencesDialog): self.config["ssh"]["username"] = self.ssh_username.get_text() self.config["ssh"]["key"] = self.ssh_key_path + self.config["upload"]["url"] = self.upload_url.get_text() + def set_ssh_key(self, key_path): self.ssh_key_path = key_path short_name = os.path.basename(key_path) -- cgit