add browse-peers action and use it instead of button clicked signal
think about just use GtkLinkButton instead of overcomplicated xdg-open call
This commit is contained in:
parent
9512c02bff
commit
49f9364445
@ -65,12 +65,6 @@ namespace Yggtk {
|
|||||||
Process.spawn_command_line_sync ("yggdrasil -genconf -json", out yggconf);
|
Process.spawn_command_line_sync ("yggdrasil -genconf -json", out yggconf);
|
||||||
parse (yggconf, peer_ip_entry);
|
parse (yggconf, peer_ip_entry);
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
Process.spawn_command_line_sync (
|
|
||||||
"xdg-open https://github.com/yggdrasil-network/public-peers"
|
|
||||||
);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
|
@ -57,6 +57,10 @@ namespace Yggtk {
|
|||||||
SimpleAction set_service_state_action = new SimpleAction ("set-service-state", VariantType.BOOLEAN);
|
SimpleAction set_service_state_action = new SimpleAction ("set-service-state", VariantType.BOOLEAN);
|
||||||
set_service_state_action.activate.connect (set_service_state);
|
set_service_state_action.activate.connect (set_service_state);
|
||||||
add_action (set_service_state_action);
|
add_action (set_service_state_action);
|
||||||
|
|
||||||
|
SimpleAction browse_peers_action = new SimpleAction ("browse-peers", null);
|
||||||
|
browse_peers_action.activate.connect (browse_peers);
|
||||||
|
add_action (browse_peers_action);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void set_service_state (SimpleAction action, Variant? state) {
|
private void set_service_state (SimpleAction action, Variant? state) {
|
||||||
@ -127,6 +131,16 @@ namespace Yggtk {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void browse_peers () {
|
||||||
|
try {
|
||||||
|
Process.spawn_command_line_sync (
|
||||||
|
"xdg-open https://github.com/yggdrasil-network/public-peers"
|
||||||
|
);
|
||||||
|
} catch (SpawnError e) {
|
||||||
|
stderr.printf ("Unable to open link with xdg-open: %s\n", e.message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override void activate () {
|
protected override void activate () {
|
||||||
if (window == null) {
|
if (window == null) {
|
||||||
window = new AppWindow (this);
|
window = new AppWindow (this);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user