aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorFelix Kaser <f.kaser@gmx.net>2009-12-09 02:41:57 +0800
committerFelix Kaser <f.kaser@gmx.net>2009-12-15 20:52:45 +0800
commit0a39af61f6bab052ead17918ab372e0cbb8eab3c (patch)
treee50fc40b24b58e367e4821b60d48cda633212ff6 /src
parent78eed901305de30ff164012604045bacf5cc38b6 (diff)
downloadgsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar
gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.gz
gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.bz2
gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.lz
gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.xz
gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.tar.zst
gsoc2013-empathy-0a39af61f6bab052ead17918ab372e0cbb8eab3c.zip
refactor friendly status reason messages
the friendly status reason can be asked from empathy-utils
Diffstat (limited to 'src')
-rw-r--r--src/empathy-accounts-dialog.c62
-rw-r--r--src/empathy-main-window.c45
2 files changed, 13 insertions, 94 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 016e8b6c3..49c65f071 100644
--- a/src/empathy-accounts-dialog.c
+++ b/src/empathy-accounts-dialog.c
@@ -212,57 +212,19 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
gtk_widget_hide (priv->throbber);
break;
case TP_CONNECTION_STATUS_DISCONNECTED:
- switch (reason)
+ message = g_strdup_printf (_("Offline - %s"),
+ empathy_status_reason_get_default_message (reason));
+
+ if (reason == TP_CONNECTION_STATUS_REASON_REQUESTED)
{
- case TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED:
- message = _("Disconnected - No error specified");
- break;
- case TP_CONNECTION_STATUS_REASON_REQUESTED:
- message = _("Disconnected - Requested");
- break;
- case TP_CONNECTION_STATUS_REASON_NETWORK_ERROR:
- message = _("Disconnected - Network error");
- break;
- case TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED:
- message = _("Disconnected - Authentication failed");
- break;
- case TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR:
- message = _("Disconnected - Encryption error");
- break;
- case TP_CONNECTION_STATUS_REASON_NAME_IN_USE:
- message = _("Disconnected - Name in use");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED:
- message = _("Disconnected - Certificate not provided");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_UNTRUSTED:
- message = _("Disconnected - Certificate untrusted");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_EXPIRED:
- message = _("Disconnected - Certificate expired");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED:
- message = _("Disconnected - Certificate not activated");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH:
- message = _("Disconnected - Certificate hostname mismatch");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH:
- message = _("Disconnected - Certificate fingerprint mismatch");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_SELF_SIGNED:
- message = _("Disconnected - Certificate self-signed");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR:
- message = _("Disconnected - Certificate error");
- break;
- default:
- message = _("Disconnected - Unknown reason");
- break;
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
+ GTK_MESSAGE_WARNING);
+ }
+ else
+ {
+ gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
+ GTK_MESSAGE_ERROR);
}
-
- gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
- GTK_MESSAGE_ERROR);
ephy_spinner_stop (EPHY_SPINNER (priv->throbber));
gtk_widget_show (priv->image_status);
@@ -280,7 +242,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog,
}
else
{
- message = _("Disconnected - Account disabled");
+ message = _("Offline - Account disabled");
gtk_info_bar_set_message_type (GTK_INFO_BAR (priv->infobar),
GTK_MESSAGE_WARNING);
ephy_spinner_stop (EPHY_SPINNER (priv->throbber));
diff --git a/src/empathy-main-window.c b/src/empathy-main-window.c
index 44eeff3ac..447e25b48 100644
--- a/src/empathy-main-window.c
+++ b/src/empathy-main-window.c
@@ -519,50 +519,7 @@ main_window_connection_changed_cb (TpAccount *account,
reason != TP_CONNECTION_STATUS_REASON_REQUESTED) {
const gchar *message;
- switch (reason) {
- case TP_CONNECTION_STATUS_REASON_NONE_SPECIFIED:
- message = _("No error specified");
- break;
- case TP_CONNECTION_STATUS_REASON_NETWORK_ERROR:
- message = _("Network error");
- break;
- case TP_CONNECTION_STATUS_REASON_AUTHENTICATION_FAILED:
- message = _("Authentication failed");
- break;
- case TP_CONNECTION_STATUS_REASON_ENCRYPTION_ERROR:
- message = _("Encryption error");
- break;
- case TP_CONNECTION_STATUS_REASON_NAME_IN_USE:
- message = _("Name in use");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_NOT_PROVIDED:
- message = _("Certificate not provided");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_UNTRUSTED:
- message = _("Certificate untrusted");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_EXPIRED:
- message = _("Certificate expired");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_NOT_ACTIVATED:
- message = _("Certificate not activated");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_HOSTNAME_MISMATCH:
- message = _("Certificate hostname mismatch");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_FINGERPRINT_MISMATCH:
- message = _("Certificate fingerprint mismatch");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_SELF_SIGNED:
- message = _("Certificate self-signed");
- break;
- case TP_CONNECTION_STATUS_REASON_CERT_OTHER_ERROR:
- message = _("Certificate error");
- break;
- default:
- message = _("Unknown error");
- break;
- }
+ message = empathy_status_reason_get_default_message (reason);
main_window_error_display (window, account, message);
}