[empathy] don't display the enable switch if account is restricted



commit aab7e0e7a78708663fd75baddfd7bd2b06251257
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Wed Apr 20 14:21:08 2011 +0200

    don't display the enable switch if account is restricted

 src/empathy-accounts-dialog.c |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c
index 8ad619b..734809f 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)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]