diff --git a/po/POTFILES b/po/POTFILES
index 6cf0912c3..c0d385471 100644
--- a/po/POTFILES
+++ b/po/POTFILES
@@ -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
diff --git a/src/Grid/CalendarView.vala b/src/Grid/CalendarView.vala
index 90a4a2085..270fad5ec 100644
--- a/src/Grid/CalendarView.vala
+++ b/src/Grid/CalendarView.vala
@@ -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 ("%s %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 ());
@@ -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) => {
diff --git a/src/Widgets/ConnectivityInfoBar.vala b/src/Widgets/ConnectivityInfoBar.vala
deleted file mode 100644
index cdafb84f6..000000000
--- a/src/Widgets/ConnectivityInfoBar.vala
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright 2020 elementary, Inc. (https://elementary.io)
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see .
- *
- * Authored by: Fabio Zaramella
- */
-
-public class Calendar.Widgets.ConnectivityInfoBar : Gtk.InfoBar {
- public ConnectivityInfoBar () {
- Object (
- message_type: Gtk.MessageType.WARNING,
- revealed : false,
- show_close_button : false
- );
- }
-
- construct {
- unowned string title = _("Network Not Available.");
- unowned string details = _("Connect to the Internet to see additional details and new events from online calendars.");
-
- var info_label = new Gtk.Label ("%s %s".printf (title, details)) {
- use_markup = true,
- wrap = true
- };
-
- get_content_area ().add (info_label);
- add_button (_("Network Settingsā¦"), Gtk.ResponseType.ACCEPT);
-
- var network_monitor = GLib.NetworkMonitor.get_default ();
- network_monitor.network_changed.connect (() => {
- bool available = network_monitor.get_network_available ();
-
- if (available && network_monitor.get_connectivity () == GLib.NetworkConnectivity.FULL) {
- set_revealed (false);
- } else {
- set_revealed (true);
- }
- });
-
- response.connect ((response_id) => {
- try {
- AppInfo.launch_default_for_uri ("settings://network", null);
- } catch (GLib.Error e) {
- critical (e.message);
- }
- });
- }
-}
diff --git a/src/meson.build b/src/meson.build
index 481cd818d..f99d0d443 100644
--- a/src/meson.build
+++ b/src/meson.build
@@ -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 = [