From aab7e0e7a78708663fd75baddfd7bd2b06251257 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Wed, 20 Apr 2011 14:21:08 +0200 Subject: don't display the enable switch if account is restricted --- src/empathy-accounts-dialog.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index 8ad619bf7..734809f80 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -275,6 +275,7 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, TpAccount *selected_account; gboolean account_enabled; gboolean creating_account; + TpStorageRestrictionFlags storage_restrictions = 0; view = GTK_TREE_VIEW (priv->treeview); selection = gtk_tree_view_get_selection (view); @@ -309,6 +310,8 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, * (else no icon is shown in infobar)*/ if (!account_enabled) presence = TP_CONNECTION_PRESENCE_TYPE_OFFLINE; + + storage_restrictions = tp_account_get_storage_restrictions (account); } else { @@ -329,6 +332,10 @@ accounts_dialog_update_status_infobar (EmpathyAccountsDialog *dialog, g_signal_handlers_unblock_by_func (priv->enabled_switch, accounts_dialog_enable_switch_active_cb, dialog); + /* Display the Enable switch if account supports it */ + gtk_widget_set_visible (priv->enabled_switch, + !(storage_restrictions & TP_STORAGE_RESTRICTION_FLAG_CANNOT_SET_ENABLED)); + if (account_enabled) { switch (status) -- cgit v1.2.3