aboutsummaryrefslogtreecommitdiff
path: root/main/src/windows/preferences_window/preferences_window.vala
diff options
context:
space:
mode:
authoreerielili <lionel@les-miquelots.net>2024-08-25 13:32:38 +0000
committerGitHub <noreply@github.com>2024-08-25 13:32:38 +0000
commit45755727db79a2935376d24e7bde7eadb0f2f7ca (patch)
tree73715da99c9d980079df6f2d561822364655e04d /main/src/windows/preferences_window/preferences_window.vala
parent62cdea3a5e701c04f3a7fd9d6b5f48e28fef1f72 (diff)
parent51252f74c94c17d56aa75534652bdc5d43a504cb (diff)
downloaddino-45755727db79a2935376d24e7bde7eadb0f2f7ca.tar.gz
dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.zip
Merge branch 'master' into add-yourselfadd-yourself
Diffstat (limited to 'main/src/windows/preferences_window/preferences_window.vala')
-rw-r--r--main/src/windows/preferences_window/preferences_window.vala31
1 files changed, 31 insertions, 0 deletions
diff --git a/main/src/windows/preferences_window/preferences_window.vala b/main/src/windows/preferences_window/preferences_window.vala
new file mode 100644
index 00000000..e34261e9
--- /dev/null
+++ b/main/src/windows/preferences_window/preferences_window.vala
@@ -0,0 +1,31 @@
+using Gdk;
+using Dino.Entities;
+using Xmpp;
+using Xmpp.Xep;
+using Gee;
+using Gtk;
+
+[GtkTemplate (ui = "/im/dino/Dino/preferences_window.ui")]
+public class Dino.Ui.PreferencesWindow : Adw.PreferencesWindow {
+ [GtkChild] public unowned Dino.Ui.PreferencesWindowAccounts accounts_page;
+ [GtkChild] public unowned Dino.Ui.PreferencesWindowEncryption encryption_page;
+ [GtkChild] public unowned Dino.Ui.GeneralPreferencesPage general_page;
+ public Dino.Ui.AccountPreferencesSubpage account_page = new Dino.Ui.AccountPreferencesSubpage();
+
+ [GtkChild] public unowned ViewModel.PreferencesWindow model { get; }
+
+ construct {
+ this.default_height = 500;
+ this.default_width = 700;
+ this.can_navigate_back = true; // remove once we require Adw > 1.4
+ this.bind_property("model", accounts_page, "model", BindingFlags.SYNC_CREATE);
+ this.bind_property("model", account_page, "model", BindingFlags.SYNC_CREATE);
+ this.bind_property("model", encryption_page, "model", BindingFlags.SYNC_CREATE);
+
+ accounts_page.account_chosen.connect((account) => {
+ model.selected_account = model.account_details[account];
+ this.present_subpage(account_page);
+// this.present_subpage(new Adw.NavigationPage(account_page, "Account: %s".printf(account.bare_jid.to_string())));
+ });
+ }
+} \ No newline at end of file