diff --git a/src/application.vala b/src/application.vala index 3aa7312..c905d12 100644 --- a/src/application.vala +++ b/src/application.vala @@ -60,15 +60,6 @@ public class Allesapp.Application : Adw.Application { private void on_preferences_action () { message ("app.preferences action activated"); - - var session = new Soup.Session (); - var msg = new Soup.Message ("GET", "http://ip4.clerie.de"); - - var input_stream = session.send (msg); - var data_input_stream = new DataInputStream (input_stream); - - message (data_input_stream.read_line_utf8()); - } } diff --git a/src/window.ui b/src/window.ui index 13e04aa..4ac620f 100644 --- a/src/window.ui +++ b/src/window.ui @@ -1,50 +1,69 @@ - + + - + + + +
- _Preferences app.preferences + _Preferences - _Keyboard Shortcuts win.show-help-overlay + _Keyboard Shortcuts - _About Allesapp app.about + _About Allesapp
+ + diff --git a/src/window.vala b/src/window.vala index ce97903..6eb11b2 100644 --- a/src/window.vala +++ b/src/window.vala @@ -21,9 +21,22 @@ [GtkTemplate (ui = "/de/clerie/allesapp/window.ui")] public class Allesapp.Window : Adw.ApplicationWindow { [GtkChild] - private unowned Gtk.Label label; + private unowned Gtk.Label my_ip_address_label; public Window (Gtk.Application app) { Object (application: app); } + + [GtkCallback] + private void on_fetch_my_ip_address () { + + var session = new Soup.Session (); + var msg = new Soup.Message ("GET", "http://ip6.clerie.de"); + + var input_stream = session.send (msg); + var data_input_stream = new DataInputStream (input_stream); + + my_ip_address_label.set_label (data_input_stream.read_line_utf8()); + + } }