From d1576b8556b86b7eb0ade9c80e2747cfeb44f0c3 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Fri, 30 Mar 2012 13:08:31 +0200 Subject: empathy-accounts: disable 'Enable' menu entry if not supported https://bugzilla.gnome.org/show_bug.cgi?id=673141 --- src/empathy-accounts-dialog.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/src/empathy-accounts-dialog.c b/src/empathy-accounts-dialog.c index c21db2bc7..b776e1640 100644 --- a/src/empathy-accounts-dialog.c +++ b/src/empathy-accounts-dialog.c @@ -1771,16 +1771,24 @@ accounts_dialog_treeview_button_press_event_cb (GtkTreeView *view, gtk_menu_shell_append (GTK_MENU_SHELL (menu), item_enable); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item_disable); - if (tp_account_is_enabled (account)) + if (account_can_be_enabled (account)) { - tp_g_signal_connect_object (item_disable, "activate", - G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0); - gtk_widget_set_sensitive (item_enable, FALSE); + if (tp_account_is_enabled (account)) + { + tp_g_signal_connect_object (item_disable, "activate", + G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0); + gtk_widget_set_sensitive (item_enable, FALSE); + } + else + { + tp_g_signal_connect_object (item_enable, "activate", + G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0); + gtk_widget_set_sensitive (item_disable, FALSE); + } } else { - tp_g_signal_connect_object (item_enable, "activate", - G_CALLBACK (accounts_dialog_treeview_enabled_cb), account, 0); + gtk_widget_set_sensitive (item_enable, FALSE); gtk_widget_set_sensitive (item_disable, FALSE); } -- cgit v1.2.3