diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-07-13 21:41:33 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2010-08-12 16:50:46 +0800 |
commit | 67372f1ad852b29b7c8c638a7bae397b6be3098c (patch) | |
tree | 43d76a3904e4bdf94dfe762f16dd6ea1ac02ab22 /libempathy-gtk/empathy-log-window.c | |
parent | 99c59741441d9b10df00b2c63f5a119de9cfc5f2 (diff) | |
download | gsoc2013-empathy-67372f1ad852b29b7c8c638a7bae397b6be3098c.tar gsoc2013-empathy-67372f1ad852b29b7c8c638a7bae397b6be3098c.tar.gz gsoc2013-empathy-67372f1ad852b29b7c8c638a7bae397b6be3098c.tar.bz2 gsoc2013-empathy-67372f1ad852b29b7c8c638a7bae397b6be3098c.tar.lz gsoc2013-empathy-67372f1ad852b29b7c8c638a7bae397b6be3098c.tar.xz gsoc2013-empathy-67372f1ad852b29b7c8c638a7bae397b6be3098c.tar.zst gsoc2013-empathy-67372f1ad852b29b7c8c638a7bae397b6be3098c.zip |
factor out select_account_once_ready
Diffstat (limited to 'libempathy-gtk/empathy-log-window.c')
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 34 |
1 files changed, 22 insertions, 12 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index fcbc6e22a..7ea7bf187 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -186,6 +186,26 @@ account_chooser_ready_cb (EmpathyAccountChooser *chooser, window->selected_chat_id, window->selected_is_chatroom); } +static void +select_account_once_ready (EmpathyLogWindow *self, + TpAccount *account, + const gchar *chat_id, + gboolean is_chatroom) +{ + EmpathyAccountChooser *account_chooser = EMPATHY_ACCOUNT_CHOOSER (self->account_chooser_chats); + + self->selected_account = account; + self->selected_chat_id = g_strdup (chat_id); + self->selected_is_chatroom = is_chatroom; + + if (empathy_account_chooser_is_ready (account_chooser)) + account_chooser_ready_cb (account_chooser, self); + else + /* Chat will be selected once the account chooser is ready */ + g_signal_connect (account_chooser, "ready", + G_CALLBACK (account_chooser_ready_cb), self); +} + GtkWidget * empathy_log_window_show (TpAccount *account, const gchar *chat_id, @@ -295,18 +315,8 @@ empathy_log_window_show (TpAccount *account, log_window_chats_setup (window); log_window_chats_populate (window); - if (account && chat_id) { - window->selected_account = account; - window->selected_chat_id = g_strdup (chat_id); - window->selected_is_chatroom = is_chatroom; - - if (empathy_account_chooser_is_ready (account_chooser)) - account_chooser_ready_cb (account_chooser, window); - else - /* Chat will be selected once the account chooser is ready */ - g_signal_connect (account_chooser, "ready", - G_CALLBACK (account_chooser_ready_cb), window); - } + if (account && chat_id) + select_account_once_ready (window, account, chat_id, is_chatroom); if (parent) { gtk_window_set_transient_for (GTK_WINDOW (window->window), |