diff options
author | Felix Kaser <f.kaser@gmx.net> | 2009-12-03 06:55:08 +0800 |
---|---|---|
committer | Felix Kaser <f.kaser@gmx.net> | 2009-12-15 20:52:43 +0800 |
commit | fe04111c230ccccc78fd14153cf3faa059f495a8 (patch) | |
tree | 1bf4b4ffbaac0520ed5770cf4fddc627d45e0eec /src/empathy-accounts-dialog.c | |
parent | 0346b097ed20b5617d6b2cf4c0e0dc498e7b1516 (diff) | |
download | gsoc2013-empathy-fe04111c230ccccc78fd14153cf3faa059f495a8.tar gsoc2013-empathy-fe04111c230ccccc78fd14153cf3faa059f495a8.tar.gz gsoc2013-empathy-fe04111c230ccccc78fd14153cf3faa059f495a8.tar.bz2 gsoc2013-empathy-fe04111c230ccccc78fd14153cf3faa059f495a8.tar.lz gsoc2013-empathy-fe04111c230ccccc78fd14153cf3faa059f495a8.tar.xz gsoc2013-empathy-fe04111c230ccccc78fd14153cf3faa059f495a8.tar.zst gsoc2013-empathy-fe04111c230ccccc78fd14153cf3faa059f495a8.zip |
show the infobar when not connected
fixes bug #599153
Diffstat (limited to 'src/empathy-accounts-dialog.c')
-rw-r--r-- | src/empathy-accounts-dialog.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 9bad1d9b7..5b68226a8 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -170,6 +170,38 @@ accounts_dialog_update_name_label (EmpathyAccountsDialog *dialog, } static void +accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, + guint status) +{ + EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); + + /* don't show the infobar if account is connected */ + if (status == TP_CONNECTION_STATUS_CONNECTED) + { + gtk_widget_hide (priv->infobar); + return; + } + + switch (status) + { + case TP_CONNECTION_STATUS_CONNECTING: + gtk_label_set_text (GTK_LABEL (priv->label_status), + _("Connecting...")); + break; + case TP_CONNECTION_STATUS_DISCONNECTED: + gtk_label_set_text (GTK_LABEL (priv->label_status), + _("Disconnected - REASON")); + break; + default: + gtk_label_set_text (GTK_LABEL (priv->label_status), + _("Unknown Status")); + } + + gtk_widget_show (priv->label_status); + gtk_widget_show (priv->infobar); +} + +static void empathy_account_dialog_widget_cancelled_cb ( EmpathyAccountWidget *widget_object, EmpathyAccountsDialog *dialog) @@ -275,6 +307,10 @@ account_dialog_create_settings_widget (EmpathyAccountsDialog *dialog, accounts_dialog_update_name_label (dialog, empathy_account_settings_get_display_name (settings)); + + accounts_dialog_update_status_infobar (dialog, + tp_account_get_connection_status ( + empathy_account_settings_get_account (settings), NULL)); } static void @@ -1131,6 +1167,9 @@ accounts_dialog_connection_changed_cb (TpAccount *account, gboolean found; EmpathyAccountsDialogPriv *priv = GET_PRIV (dialog); + /* Update the status-infobar in the details view*/ + accounts_dialog_update_status_infobar (dialog, current); + /* Update the status in the model */ model = gtk_tree_view_get_model (GTK_TREE_VIEW (priv->treeview)); |