Skip to content

Commit a431a26

Browse files
committed
Error if unable to connect to geoclue. Fixes #15
1 parent dbd4d73 commit a431a26

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/MainWindow.vala

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,13 @@ public class MainWindow : Gtk.Dialog {
8585
spinner.halign = Gtk.Align.CENTER;
8686
spinner.vexpand = true;
8787

88+
var alert_label = new Gtk.Label ("Unable to Get Location");
89+
8890
stack = new Gtk.Stack ();
8991
stack.vhomogeneous = true;
9092
stack.add (spinner);
9193
stack.add_named (grid, "weather");
94+
stack.add_named (alert_label, "alert");
9295

9396
var content_box = get_content_area () as Gtk.Box;
9497
content_box.border_width = 0;
@@ -159,6 +162,7 @@ public class MainWindow : Gtk.Dialog {
159162
on_location_updated (simple.location.latitude, simple.location.longitude);
160163
} catch (Error e) {
161164
warning ("Failed to connect to GeoClue2 service: %s", e.message);
165+
stack.visible_child_name = "alert";
162166
return;
163167
}
164168
}

0 commit comments

Comments
 (0)