Now About Social Code
aboutsummaryrefslogtreecommitdiff
path: root/src/preferences.py
diff options
context:
space:
mode:
authorLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-10-06 17:34:29 +0100
committerLucas Fryzek <lucas.fryzek@fryzekconcepts.com>2024-10-06 17:34:29 +0100
commitdb10dc4fdd656b25442c63eb02ea30931eee300e (patch)
tree9b2a4e835d6d52b48c0e7fb9bcb83884999ee1da /src/preferences.py
parent0dc8409b168b293e9566dc5a35bded510fbd043d (diff)
window: Add interface for connecting and disconnecting
Diffstat (limited to 'src/preferences.py')
-rw-r--r--src/preferences.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/preferences.py b/src/preferences.py
index 1a87e29..8e6d150 100644
--- a/src/preferences.py
+++ b/src/preferences.py
@@ -28,6 +28,7 @@ import os
class WeegtkPreferences(Adw.PreferencesDialog):
__gtype_name__ = 'WeegtkPreferences'
+ autoconnect = Gtk.Template.Child()
hostname = Gtk.Template.Child()
port = Gtk.Template.Child()
password = Gtk.Template.Child()
@@ -46,6 +47,7 @@ class WeegtkPreferences(Adw.PreferencesDialog):
self.config = config.read()
+ self.autoconnect.set_active(config.str_to_bool(self.config["relay"]["autoconnect"]))
self.hostname.set_text(self.config["relay"]["hostname"])
self.port.set_text(self.config["relay"]["port"])
self.password.set_text(self.config["relay"]["password"])
@@ -60,6 +62,7 @@ class WeegtkPreferences(Adw.PreferencesDialog):
self.install_action("ssh_key.open", None, self.ssh_key_open)
def read_preferences(self):
+ self.config["relay"]["autoconnect"] = str(self.autoconnect.get_active())
self.config["relay"]["hostname"] = self.hostname.get_text()
self.config["relay"]["port"] = self.port.get_text()
self.config["relay"]["password"] = self.password.get_text()