diff --git a/fr.oupson.FooTerm.json b/fr.oupson.FooTerm.json
index b4c7360..daa976b 100644
--- a/fr.oupson.FooTerm.json
+++ b/fr.oupson.FooTerm.json
@@ -12,7 +12,8 @@
"--share=ipc",
"--socket=fallback-x11",
"--device=dri",
- "--socket=wayland"
+ "--socket=wayland",
+ "--talk-name=org.freedesktop.secrets"
],
"build-options" : {
"append-path" : "/usr/lib/sdk/vala/bin",
diff --git a/src/model/Server.vala b/src/model/Server.vala
index dd39581..d5776ed 100644
--- a/src/model/Server.vala
+++ b/src/model/Server.vala
@@ -20,12 +20,14 @@
namespace Footerm.Model {
public class Server {
+ public int? id;
public string name;
public string hostname;
public ushort port;
public string username;
- public Server(string name, string hostname, ushort port, string username) {
+ public Server(int? id, string name, string hostname, ushort port, string username) {
+ this.id = id;
this.name = name;
this.hostname = hostname;
this.port = port;
diff --git a/src/newpane.vala b/src/newpane.vala
index 14719a6..275ac24 100644
--- a/src/newpane.vala
+++ b/src/newpane.vala
@@ -33,27 +33,38 @@ namespace Footerm {
[GtkChild]
private unowned Gtk.Button newpane_add_button;
- public signal void on_server_selected(Footerm.Model.Server server);
+ public signal void on_server_selected (Footerm.Model.Server server);
construct {
- this.new_server.on_new_server.connect((s) => {
- this.newpane_stack.set_visible_child(server_list.get_parent());
- var action_row = new Adw.ActionRow();
- action_row.set_title(s.hostname);
- action_row.set_activatable(true);
- action_row.activated.connect(() => {
- this.on_server_selected(s);
+ this.new_server.on_new_server.connect ((s) => {
+ this.newpane_stack.set_visible_child (server_list.get_parent ());
+ var action_row = new Adw.ActionRow ();
+ action_row.set_title (s.hostname);
+ action_row.set_activatable (true);
+ action_row.activated.connect (() => {
+ this.on_server_selected (s);
});
- server_list.add(action_row);
+ server_list.add (action_row);
});
this.newpane_add_button.clicked.connect (() => {
- this.newpane_stack.set_visible_child(new_server.get_parent());
+ this.newpane_stack.set_visible_child (new_server.get_parent ());
});
try {
- var config = Footerm.Services.Config.get_instance();
+ var config = Footerm.Services.Config.get_instance ();
+
+ var stored_server_list = config.get_server_list ();
+ foreach (var server in stored_server_list) {
+ var action_row = new Adw.ActionRow ();
+ action_row.set_title (server.name);
+ action_row.set_activatable (true);
+ action_row.activated.connect (() => {
+ this.on_server_selected (server);
+ });
+ server_list.add (action_row);
+ }
} catch (Error e) {
- GLib.warning("Failed to read server list : %s", e.message);
+ GLib.warning ("Failed to read server list : %s", e.message);
}
}
}
diff --git a/src/newserver.ui b/src/newserver.ui
index 0a12c76..aece224 100644
--- a/src/newserver.ui
+++ b/src/newserver.ui
@@ -9,6 +9,11 @@
vertical