@@ -61,7 +61,20 @@ public class Maya.View.CalendarView : Gtk.Box {
6161 };
6262 error_bar. get_content_area (). add (error_label);
6363
64- var info_bar = new Calendar .Widgets .ConnectivityInfoBar ();
64+ var info_label = new Gtk .Label (" <b>%s </b> %s " . printf (
65+ _(" Network Not Available." ),
66+ _(" Connect to the Internet to see additional details and new events from online calendars." )
67+ )) {
68+ use_markup = true ,
69+ wrap = true
70+ };
71+
72+ var info_bar = new Gtk .InfoBar () {
73+ message_type = WARNING ,
74+ revealed = false
75+ };
76+ info_bar. get_content_area (). add (info_label);
77+ info_bar. add_button (_(" Network Settings…" ), Gtk . ResponseType . ACCEPT );
6578
6679 var application_instance = ((Gtk . Application ) GLib . Application . get_default ());
6780
@@ -142,6 +155,22 @@ public class Maya.View.CalendarView : Gtk.Box {
142155 add (stack );
143156 show_all ();
144157
158+ var network_monitor = GLib.NetworkMonitor.get_default ();
159+ network_monitor.network_changed.connect (() => {
160+ info_bar. revealed = ! (
161+ network_monitor. get_network_available () &&
162+ network_monitor. get_connectivity () == FULL
163+ );
164+ });
165+
166+ info_bar.response.connect (() => {
167+ try {
168+ AppInfo . launch_default_for_uri (" settings://network" , null );
169+ } catch (GLib . Error e) {
170+ critical (e. message);
171+ }
172+ });
173+
145174 error_bar.response.connect ((id ) => error_bar.set_revealed (false ));
146175
147176 Calendar.EventStore.get_default ().error_received.connect ((message ) => {
0 commit comments