[empathy/gnome-2-34] Log window: grey out accounts without logs



commit c81fdc0417476ab122cd3d555095577269c3dd58
Author: Emilio Pozuelo Monfort <emilio pozuelo collabora co uk>
Date:   Wed Mar 16 13:35:28 2011 +0000

    Log window: grey out accounts without logs

 libempathy-gtk/empathy-log-window.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
---
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c
index 5e1cc4b..79e14d4 100644
--- a/libempathy-gtk/empathy-log-window.c
+++ b/libempathy-gtk/empathy-log-window.c
@@ -123,6 +123,12 @@ static void     log_window_entry_chats_activate_cb         (GtkWidget        *en
 static void     log_window_delete_menu_clicked_cb          (GtkMenuItem      *menuitem,
 							    EmpathyLogWindow *window);
 
+static void
+empathy_account_chooser_filter_has_logs (TpAccount *account,
+					 EmpathyAccountChooserFilterResultCallback callback,
+					 gpointer callback_data,
+					 gpointer user_data);
+
 enum {
 	COL_FIND_ACCOUNT_ICON,
 	COL_FIND_ACCOUNT_NAME,
@@ -299,6 +305,7 @@ empathy_log_window_show (TpAccount  *account,
 	/* Account chooser for chats */
 	window->account_chooser_chats = empathy_account_chooser_new ();
 	account_chooser = EMPATHY_ACCOUNT_CHOOSER (window->account_chooser_chats);
+	empathy_account_chooser_set_filter (account_chooser, empathy_account_chooser_filter_has_logs, NULL);
 
 	gtk_box_pack_start (GTK_BOX (window->hbox_chats),
 			    window->account_chooser_chats,
@@ -1438,6 +1445,10 @@ log_window_logger_clear_account_cb (TpProxy *proxy,
 	 * has been deleted */
 	empathy_chat_view_clear (window->chatview_chats);
 	log_window_chats_populate (window);
+
+	/* Re-filter the account chooser so the accounts without logs get greyed out */
+	empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (window->account_chooser_chats),
+					    empathy_account_chooser_filter_has_logs, NULL);
 }
 
 static void



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