diff options
author | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-04-25 17:35:23 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2011-06-09 19:34:54 +0800 |
commit | 62f5ed896ad09c54be054f6872a69b905db3b8c7 (patch) | |
tree | 80a92fe60ea4ae92909b2715fa219cd386f962f7 | |
parent | 4a8794ffe8898d4ddf25bff8a360c36ec8a4d9aa (diff) | |
download | gsoc2013-empathy-62f5ed896ad09c54be054f6872a69b905db3b8c7.tar gsoc2013-empathy-62f5ed896ad09c54be054f6872a69b905db3b8c7.tar.gz gsoc2013-empathy-62f5ed896ad09c54be054f6872a69b905db3b8c7.tar.bz2 gsoc2013-empathy-62f5ed896ad09c54be054f6872a69b905db3b8c7.tar.lz gsoc2013-empathy-62f5ed896ad09c54be054f6872a69b905db3b8c7.tar.xz gsoc2013-empathy-62f5ed896ad09c54be054f6872a69b905db3b8c7.tar.zst gsoc2013-empathy-62f5ed896ad09c54be054f6872a69b905db3b8c7.zip |
Populate from 'Anyone' when changing the account
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index aa4162448..669e78fbe 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -1464,10 +1464,6 @@ log_manager_got_entities_cb (GObject *manager, } } - /* Select 'Anyone' by default */ - if (gtk_tree_model_get_iter_first (model, &iter)) - gtk_tree_selection_select_iter (selection, &iter); - /* Unblock signals */ g_signal_handlers_unblock_by_func (selection, log_window_who_changed_cb, @@ -1494,6 +1490,24 @@ g_print ("get_entities_for_account\n"); } static void +select_first_entity (TplActionChain *chain, gpointer user_data) +{ + GtkTreeView *view; + GtkTreeModel *model; + GtkTreeSelection *selection; + GtkTreeIter iter; + + view = GTK_TREE_VIEW (log_window->treeview_who); + model = gtk_tree_view_get_model (view); + selection = gtk_tree_view_get_selection (view); + + if (gtk_tree_model_get_iter_first (model, &iter)) + gtk_tree_selection_select_iter (selection, &iter); + + _tpl_action_chain_continue (log_window->chain); +} + +static void log_window_who_populate (EmpathyLogWindow *window) { EmpathyAccountChooser *account_chooser; @@ -1560,6 +1574,7 @@ log_window_who_populate (EmpathyLogWindow *window) g_list_free (accounts); } + _tpl_action_chain_append (window->chain, select_first_entity, NULL); _tpl_action_chain_start (window->chain); } |