From fbce68e65c37e7f004bdfd6cfeb59e7ea2a67b07 Mon Sep 17 00:00:00 2001 From: Felix Kaser Date: Tue, 8 Dec 2009 20:01:03 +0100 Subject: set infobar message to no network connection if the account is disconnected and there is no internet connection at all. --- src/empathy-accounts-dialog.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src') diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 49c65f071..dbdbd92d1 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -37,6 +37,7 @@ #include #include +#include #include #include @@ -181,10 +182,13 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, guint status; guint reason; guint presence; + EmpathyConnectivity *connectivity; status = tp_account_get_connection_status (account, &reason); presence = tp_account_get_current_presence (account, NULL, NULL); + connectivity = empathy_connectivity_dup_singleton (); + gtk_image_set_from_icon_name (GTK_IMAGE (priv->image_status), empathy_icon_name_for_presence (presence), GTK_ICON_SIZE_SMALL_TOOLBAR); @@ -226,6 +230,9 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, GTK_MESSAGE_ERROR); } + if (!empathy_connectivity_is_online (connectivity)) + message = _("Offline - No Network Connection"); + ephy_spinner_stop (EPHY_SPINNER (priv->throbber)); gtk_widget_show (priv->image_status); gtk_widget_hide (priv->throbber); @@ -253,6 +260,8 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, gtk_label_set_text (GTK_LABEL (priv->label_status), message); gtk_widget_show (priv->label_status); gtk_widget_show (priv->infobar); + + g_object_unref (connectivity); } static void -- cgit v1.2.3