Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion po/POTFILES
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ src/SourceDialog/SourceDialog.vala
src/TodayEventMonitor.vala
src/Widgets/AgendaEventRow.vala
src/Widgets/CalendarChooser.vala
src/Widgets/ConnectivityInfoBar.vala
src/Widgets/DateSwitcher.vala
src/Widgets/DateTimePicker.vala
src/Widgets/DynamicSpinner.vala
Expand Down
31 changes: 30 additions & 1 deletion src/Grid/CalendarView.vala
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,20 @@ public class Maya.View.CalendarView : Gtk.Box {
};
error_bar.get_content_area ().add (error_label);

var info_bar = new Calendar.Widgets.ConnectivityInfoBar ();
var info_label = new Gtk.Label ("<b>%s</b> %s".printf (
_("Network Not Available."),
_("Connect to the Internet to see additional details and new events from online calendars.")
)) {
use_markup = true,
wrap = true
};

var info_bar = new Gtk.InfoBar () {
message_type = WARNING,
revealed = false
};
info_bar.get_content_area ().add (info_label);
info_bar.add_button (_("Network Settings…"), Gtk.ResponseType.ACCEPT);

var application_instance = ((Gtk.Application) GLib.Application.get_default ());

Expand Down Expand Up @@ -142,6 +155,22 @@ public class Maya.View.CalendarView : Gtk.Box {
add (stack);
show_all ();

var network_monitor = GLib.NetworkMonitor.get_default ();
network_monitor.network_changed.connect (() => {
info_bar.revealed = !(
network_monitor.get_network_available () &&
network_monitor.get_connectivity () == FULL
);
});

info_bar.response.connect (() => {
try {
AppInfo.launch_default_for_uri ("settings://network", null);
} catch (GLib.Error e) {
critical (e.message);
}
});

error_bar.response.connect ((id) => error_bar.set_revealed (false));

Calendar.EventStore.get_default ().error_received.connect ((message) => {
Expand Down
60 changes: 0 additions & 60 deletions src/Widgets/ConnectivityInfoBar.vala

This file was deleted.

3 changes: 1 addition & 2 deletions src/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ calendar_files = files(
'Widgets/DynamicSpinner.vala',
'Widgets/EventMenu.vala',
'Widgets/SourcePopover.vala',
'Widgets/SourceRow.vala',
'Widgets/ConnectivityInfoBar.vala'
'Widgets/SourceRow.vala'
)

calendar_deps = [
Expand Down