update ui file

This commit is contained in:
Nikolay Brovko 2020-01-28 03:32:36 +03:00
parent 8faac1c8f3
commit 9512c02bff
No known key found for this signature in database
GPG key ID: 32258A3DEC9B6F07
4 changed files with 184 additions and 125 deletions

View file

@ -17,17 +17,17 @@ using Gtk;
namespace Yggtk {
[GtkTemplate (ui = "/org/yggtk/yggtk/ui/main.ui")]
[GtkTemplate (ui = "/org/yggtk/yggtk/ui/app-window.ui")]
public class AppWindow : ApplicationWindow {
[GtkChild]
private Gtk.Switch service_state_switch;
[GtkChild]
private Gtk.Button browse_button;
private Gtk.Button browse_peers_button;
[GtkChild]
private Gtk.Entry ip_entry;
private Gtk.Entry peer_ip_entry;
[GtkCallback]
private bool on_service_state_switch_state_set (bool state) {
@ -43,27 +43,27 @@ namespace Yggtk {
Object(application: application);
ip_entry.notify["text"].connect (() => {
peer_ip_entry.notify["text"].connect (() => {
if (ip_entry.text != "") {
if (peer_ip_entry.text != "") {
browse_button.label = "OK";
browse_peers_button.label = "OK";
} else {
browse_button.label = "Browse";
browse_peers_button.label = "Browse";
}
});
browse_button.clicked.connect (() => {
browse_peers_button.clicked.connect (() => {
if (browse_button.label == "OK") {
if (browse_peers_button.label == "OK") {
string yggconf;
Process.spawn_command_line_sync ("yggdrasil -genconf -json", out yggconf);
parse (yggconf, ip_entry);
parse (yggconf, peer_ip_entry);
} else {