1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2006-2007 Imendio AB
4 * Copyright (C) 2007-2008 Collabora Ltd.
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation; either version 2 of the
9 * License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
16 * You should have received a copy of the GNU General Public
17 * License along with this program; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
19 * Boston, MA 02110-1301 USA
21 * Authors: Martyn Russell <martyn@imendio.com>
22 * Xavier Claessens <xclaesse@gmail.com>
32 #include <glib/gi18n.h>
33 #include <glib/gprintf.h>
35 #include <telepathy-glib/interfaces.h>
37 #include <libempathy/empathy-tp-roomlist.h>
38 #include <libempathy/empathy-chatroom.h>
39 #include <libempathy/empathy-utils.h>
40 #include <libempathy/empathy-dispatcher.h>
42 #include <libempathy-gtk/empathy-account-chooser.h>
43 #include <libempathy-gtk/empathy-ui-utils.h>
45 #include "empathy-new-chatroom-dialog.h"
47 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
48 #include <libempathy/empathy-debug.h>
51 EmpathyTpRoomlist *room_list;
52 /* Currently selected account */
54 /* Signal id of the "status-changed" signal connected on the currently
56 gulong status_changed_id;
59 GtkWidget *vbox_widgets;
60 GtkWidget *table_info;
61 GtkWidget *label_account;
62 GtkWidget *account_chooser;
63 GtkWidget *label_server;
64 GtkWidget *entry_server;
65 GtkWidget *label_room;
66 GtkWidget *entry_room;
67 GtkWidget *expander_browse;
68 GtkWidget *hbox_expander;
72 GtkWidget *button_join;
73 GtkWidget *label_error_message;
74 GtkWidget *viewport_error;
75 } EmpathyNewChatroomDialog;
88 static void new_chatroom_dialog_response_cb (GtkWidget *widget,
90 EmpathyNewChatroomDialog *dialog);
91 static void new_chatroom_dialog_destroy_cb (GtkWidget *widget,
92 EmpathyNewChatroomDialog *dialog);
93 static void new_chatroom_dialog_model_setup (EmpathyNewChatroomDialog *dialog);
94 static void new_chatroom_dialog_model_add_columns (EmpathyNewChatroomDialog *dialog);
95 static void new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog);
96 static void new_chatroom_dialog_account_changed_cb (GtkComboBox *combobox,
97 EmpathyNewChatroomDialog *dialog);
98 static void new_chatroom_dialog_roomlist_destroy_cb (EmpathyTpRoomlist *room_list,
99 EmpathyNewChatroomDialog *dialog);
100 static void new_chatroom_dialog_new_room_cb (EmpathyTpRoomlist *room_list,
101 EmpathyChatroom *chatroom,
102 EmpathyNewChatroomDialog *dialog);
103 static void new_chatroom_dialog_listing_cb (EmpathyTpRoomlist *room_list,
105 EmpathyNewChatroomDialog *dialog);
106 static void start_listing_error_cb (EmpathyTpRoomlist *room_list,
108 EmpathyNewChatroomDialog *dialog);
109 static void stop_listing_error_cb (EmpathyTpRoomlist *room_list,
111 EmpathyNewChatroomDialog *dialog);
112 static void new_chatroom_dialog_model_clear (EmpathyNewChatroomDialog *dialog);
113 static void new_chatroom_dialog_model_row_activated_cb (GtkTreeView *tree_view,
115 GtkTreeViewColumn *column,
116 EmpathyNewChatroomDialog *dialog);
117 static void new_chatroom_dialog_model_selection_changed (GtkTreeSelection *selection,
118 EmpathyNewChatroomDialog *dialog);
119 static void new_chatroom_dialog_join (EmpathyNewChatroomDialog *dialog);
120 static void new_chatroom_dialog_entry_changed_cb (GtkWidget *entry,
121 EmpathyNewChatroomDialog *dialog);
122 static void new_chatroom_dialog_browse_start (EmpathyNewChatroomDialog *dialog);
123 static void new_chatroom_dialog_browse_stop (EmpathyNewChatroomDialog *dialog);
124 static void new_chatroom_dialog_entry_server_activate_cb (GtkWidget *widget,
125 EmpathyNewChatroomDialog *dialog);
126 static void new_chatroom_dialog_expander_browse_activate_cb (GtkWidget *widget,
127 EmpathyNewChatroomDialog *dialog);
128 static gboolean new_chatroom_dialog_entry_server_focus_out_cb (GtkWidget *widget,
129 GdkEventFocus *event,
130 EmpathyNewChatroomDialog *dialog);
131 static void new_chatroom_dialog_button_close_error_clicked_cb (GtkButton *button,
132 EmpathyNewChatroomDialog *dialog);
134 static EmpathyNewChatroomDialog *dialog_p = NULL;
137 * empathy_account_chooser_filter_supports_multichat:
138 * @account: a #TpAccount
139 * @user_data: user data or %NULL
141 * An #EmpathyAccountChooserFilterFunc that returns accounts that both
142 * support multiuser text chat and are connected.
144 * Return value: TRUE if @account both supports muc and is connected
147 empathy_account_chooser_filter_supports_multichat (TpAccount *account,
150 TpConnection *connection;
151 EmpathyDispatcher *dispatcher;
154 if (tp_account_get_connection_status (account, NULL) !=
155 TP_CONNECTION_STATUS_CONNECTED)
158 /* check if CM supports multiuser text chat */
159 connection = tp_account_get_connection (account);
160 if (connection == NULL)
163 dispatcher = empathy_dispatcher_dup_singleton ();
165 classes = empathy_dispatcher_find_requestable_channel_classes
166 (dispatcher, connection, TP_IFACE_CHANNEL_TYPE_TEXT,
167 TP_HANDLE_TYPE_ROOM, NULL);
169 g_object_unref (dispatcher);
174 g_list_free (classes);
179 empathy_new_chatroom_dialog_show (GtkWindow *parent)
181 EmpathyNewChatroomDialog *dialog;
183 GtkSizeGroup *size_group;
187 gtk_window_present (GTK_WINDOW (dialog_p->window));
191 dialog_p = dialog = g_new0 (EmpathyNewChatroomDialog, 1);
193 filename = empathy_file_lookup ("empathy-new-chatroom-dialog.ui", "src");
194 gui = empathy_builder_get_file (filename,
195 "new_chatroom_dialog", &dialog->window,
196 "table_info", &dialog->table_info,
197 "label_account", &dialog->label_account,
198 "label_server", &dialog->label_server,
199 "label_room", &dialog->label_room,
200 "entry_server", &dialog->entry_server,
201 "entry_room", &dialog->entry_room,
202 "treeview", &dialog->treeview,
203 "button_join", &dialog->button_join,
204 "expander_browse", &dialog->expander_browse,
205 "hbox_expander", &dialog->hbox_expander,
206 "label_error_message", &dialog->label_error_message,
207 "viewport_error", &dialog->viewport_error,
211 empathy_builder_connect (gui, dialog,
212 "new_chatroom_dialog", "response", new_chatroom_dialog_response_cb,
213 "new_chatroom_dialog", "destroy", new_chatroom_dialog_destroy_cb,
214 "entry_server", "changed", new_chatroom_dialog_entry_changed_cb,
215 "entry_server", "activate", new_chatroom_dialog_entry_server_activate_cb,
216 "entry_server", "focus-out-event", new_chatroom_dialog_entry_server_focus_out_cb,
217 "entry_room", "changed", new_chatroom_dialog_entry_changed_cb,
218 "expander_browse", "activate", new_chatroom_dialog_expander_browse_activate_cb,
219 "button_close_error", "clicked", new_chatroom_dialog_button_close_error_clicked_cb,
222 g_object_unref (gui);
224 g_object_add_weak_pointer (G_OBJECT (dialog->window), (gpointer) &dialog_p);
226 /* Label alignment */
227 size_group = gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL);
229 gtk_size_group_add_widget (size_group, dialog->label_account);
230 gtk_size_group_add_widget (size_group, dialog->label_server);
231 gtk_size_group_add_widget (size_group, dialog->label_room);
233 g_object_unref (size_group);
235 /* Set up chatrooms treeview */
236 new_chatroom_dialog_model_setup (dialog);
239 dialog->throbber = gtk_spinner_new ();
240 gtk_box_pack_start (GTK_BOX (dialog->hbox_expander), dialog->throbber,
243 /* Account chooser for custom */
244 dialog->account_chooser = empathy_account_chooser_new ();
245 empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser),
246 empathy_account_chooser_filter_supports_multichat,
248 gtk_table_attach_defaults (GTK_TABLE (dialog->table_info),
249 dialog->account_chooser,
251 gtk_widget_show (dialog->account_chooser);
253 g_signal_connect (GTK_COMBO_BOX (dialog->account_chooser), "changed",
254 G_CALLBACK (new_chatroom_dialog_account_changed_cb),
256 new_chatroom_dialog_account_changed_cb (GTK_COMBO_BOX (dialog->account_chooser),
260 gtk_window_set_transient_for (GTK_WINDOW (dialog->window),
261 GTK_WINDOW (parent));
264 gtk_widget_show (dialog->window);
268 new_chatroom_dialog_response_cb (GtkWidget *widget,
270 EmpathyNewChatroomDialog *dialog)
272 if (response == GTK_RESPONSE_OK) {
273 new_chatroom_dialog_join (dialog);
276 gtk_widget_destroy (widget);
280 new_chatroom_dialog_destroy_cb (GtkWidget *widget,
281 EmpathyNewChatroomDialog *dialog)
283 if (dialog->room_list) {
284 g_object_unref (dialog->room_list);
286 g_object_unref (dialog->model);
288 if (dialog->account != NULL) {
289 g_signal_handler_disconnect (dialog->account, dialog->status_changed_id);
290 g_object_unref (dialog->account);
297 new_chatroom_dialog_model_setup (EmpathyNewChatroomDialog *dialog)
301 GtkTreeSelection *selection;
304 view = GTK_TREE_VIEW (dialog->treeview);
306 g_signal_connect (view, "row-activated",
307 G_CALLBACK (new_chatroom_dialog_model_row_activated_cb),
311 store = gtk_list_store_new (COL_COUNT,
312 G_TYPE_STRING, /* Invite */
313 G_TYPE_STRING, /* Password */
314 G_TYPE_STRING, /* Name */
315 G_TYPE_STRING, /* Room */
316 G_TYPE_STRING, /* Member count */
317 G_TYPE_INT, /* Member count int */
318 G_TYPE_STRING); /* Tool tip */
320 dialog->model = GTK_TREE_MODEL (store);
321 gtk_tree_view_set_model (view, dialog->model);
322 gtk_tree_view_set_tooltip_column (view, COL_TOOLTIP);
323 gtk_tree_view_set_search_column (view, COL_NAME);
326 selection = gtk_tree_view_get_selection (view);
327 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store),
328 COL_NAME, GTK_SORT_ASCENDING);
330 g_signal_connect (selection, "changed",
331 G_CALLBACK (new_chatroom_dialog_model_selection_changed),
335 new_chatroom_dialog_model_add_columns (dialog);
339 new_chatroom_dialog_model_add_columns (EmpathyNewChatroomDialog *dialog)
342 GtkTreeViewColumn *column;
343 GtkCellRenderer *cell;
346 gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
348 view = GTK_TREE_VIEW (dialog->treeview);
350 cell = gtk_cell_renderer_pixbuf_new ();
354 "stock-size", GTK_ICON_SIZE_MENU,
356 column = gtk_tree_view_column_new_with_attributes (NULL,
358 "stock-id", COL_INVITE_ONLY,
361 gtk_tree_view_column_set_sort_column_id (column, COL_INVITE_ONLY);
362 gtk_tree_view_append_column (view, column);
364 column = gtk_tree_view_column_new_with_attributes (NULL,
366 "stock-id", COL_NEED_PASSWORD,
369 gtk_tree_view_column_set_sort_column_id (column, COL_NEED_PASSWORD);
370 gtk_tree_view_append_column (view, column);
372 cell = gtk_cell_renderer_text_new ();
376 "ellipsize", PANGO_ELLIPSIZE_END,
379 column = gtk_tree_view_column_new_with_attributes (_("Chat Room"),
384 gtk_tree_view_column_set_sort_column_id (column, COL_NAME);
385 gtk_tree_view_column_set_expand (column, TRUE);
386 gtk_tree_view_append_column (view, column);
388 cell = gtk_cell_renderer_text_new ();
392 "ellipsize", PANGO_ELLIPSIZE_END,
393 "alignment", PANGO_ALIGN_RIGHT,
395 column = gtk_tree_view_column_new_with_attributes (_("Members"),
400 gtk_tree_view_column_set_sort_column_id (column, COL_MEMBERS_INT);
401 gtk_tree_view_append_column (view, column);
405 update_join_button_sensitivity (EmpathyNewChatroomDialog *dialog)
408 gboolean sensitive = FALSE;
411 room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
412 if (EMP_STR_EMPTY (room))
415 if (dialog->account == NULL)
418 if (tp_account_get_connection_status (dialog->account, NULL) !=
419 TP_CONNECTION_STATUS_CONNECTED)
425 gtk_widget_set_sensitive (dialog->button_join, sensitive);
429 new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog *dialog)
431 EmpathyAccountChooser *account_chooser;
432 const gchar *protocol;
434 account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
436 if (dialog->account == NULL)
439 protocol = tp_account_get_protocol (dialog->account);
441 gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), "");
443 /* hardcode here known protocols */
444 if (strcmp (protocol, "jabber") == 0) {
445 gtk_widget_set_sensitive (dialog->entry_server, TRUE);
447 else if (strcmp (protocol, "local-xmpp") == 0) {
448 gtk_widget_set_sensitive (dialog->entry_server, FALSE);
450 else if (strcmp (protocol, "irc") == 0) {
451 gtk_widget_set_sensitive (dialog->entry_server, FALSE);
454 gtk_widget_set_sensitive (dialog->entry_server, TRUE);
457 update_join_button_sensitivity (dialog);
459 /* Final set up of the dialog */
460 gtk_widget_grab_focus (dialog->entry_room);
464 account_status_changed_cb (TpAccount *account,
468 gchar *dbus_error_name,
470 EmpathyNewChatroomDialog *self)
472 update_join_button_sensitivity (self);
476 new_chatroom_dialog_account_changed_cb (GtkComboBox *combobox,
477 EmpathyNewChatroomDialog *dialog)
479 EmpathyAccountChooser *account_chooser;
480 gboolean listing = FALSE;
481 gboolean expanded = FALSE;
482 TpConnection *connection;
483 EmpathyDispatcher *dispatcher;
484 GList *classes = NULL;
486 if (dialog->room_list) {
487 g_object_unref (dialog->room_list);
488 dialog->room_list = NULL;
491 gtk_spinner_stop (GTK_SPINNER (dialog->throbber));
492 gtk_widget_hide (dialog->throbber);
493 new_chatroom_dialog_model_clear (dialog);
495 if (dialog->account != NULL) {
496 g_signal_handler_disconnect (dialog->account, dialog->status_changed_id);
497 g_object_unref (dialog->account);
500 account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
501 dialog->account = empathy_account_chooser_dup_account (account_chooser);
502 connection = empathy_account_chooser_get_connection (account_chooser);
503 if (dialog->account == NULL)
506 dialog->status_changed_id = g_signal_connect (dialog->account,
507 "status-changed", G_CALLBACK (account_status_changed_cb), dialog);
509 dispatcher = empathy_dispatcher_dup_singleton ();
511 if (connection != NULL) {
512 classes = empathy_dispatcher_find_requestable_channel_classes (dispatcher,
513 connection, TP_IFACE_CHANNEL_TYPE_ROOM_LIST,
514 TP_HANDLE_TYPE_NONE, NULL);
517 if (classes != NULL) {
518 /* Roomlist channels are supported */
519 dialog->room_list = empathy_tp_roomlist_new (dialog->account);
520 g_list_free (classes);
523 dialog->room_list = NULL;
526 g_object_unref (dispatcher);
528 if (dialog->room_list) {
529 g_signal_connect (dialog->room_list, "destroy",
530 G_CALLBACK (new_chatroom_dialog_roomlist_destroy_cb),
532 g_signal_connect (dialog->room_list, "new-room",
533 G_CALLBACK (new_chatroom_dialog_new_room_cb),
535 g_signal_connect (dialog->room_list, "notify::is-listing",
536 G_CALLBACK (new_chatroom_dialog_listing_cb),
538 g_signal_connect (dialog->room_list, "error::start",
539 G_CALLBACK (start_listing_error_cb),
541 g_signal_connect (dialog->room_list, "error::stop",
542 G_CALLBACK (stop_listing_error_cb),
545 expanded = gtk_expander_get_expanded (GTK_EXPANDER (dialog->expander_browse));
547 gtk_widget_hide (dialog->viewport_error);
548 gtk_widget_set_sensitive (dialog->treeview, TRUE);
549 new_chatroom_dialog_browse_start (dialog);
552 listing = empathy_tp_roomlist_is_listing (dialog->room_list);
554 gtk_spinner_start (GTK_SPINNER (dialog->throbber));
555 gtk_widget_show (dialog->throbber);
559 gtk_widget_set_sensitive (dialog->expander_browse, dialog->room_list != NULL);
562 new_chatroom_dialog_update_widgets (dialog);
566 new_chatroom_dialog_button_close_error_clicked_cb (GtkButton *button,
567 EmpathyNewChatroomDialog *dialog)
569 gtk_widget_hide (dialog->viewport_error);
573 new_chatroom_dialog_roomlist_destroy_cb (EmpathyTpRoomlist *room_list,
574 EmpathyNewChatroomDialog *dialog)
576 g_object_unref (dialog->room_list);
577 dialog->room_list = NULL;
581 new_chatroom_dialog_new_room_cb (EmpathyTpRoomlist *room_list,
582 EmpathyChatroom *chatroom,
583 EmpathyNewChatroomDialog *dialog)
586 GtkTreeSelection *selection;
591 const gchar *need_password;
592 const gchar *invite_only;
594 DEBUG ("New chatroom listed: %s (%s)",
595 empathy_chatroom_get_name (chatroom),
596 empathy_chatroom_get_room (chatroom));
599 view = GTK_TREE_VIEW (dialog->treeview);
600 selection = gtk_tree_view_get_selection (view);
601 store = GTK_LIST_STORE (dialog->model);
602 members = g_strdup_printf ("%d", empathy_chatroom_get_members_count (chatroom));
603 /* Translators: Room/Join's roomlist tooltip. Parameters are a channel name,
604 yes/no, yes/no and a number. */
605 tooltip = g_strdup_printf (_("<b>%s</b>\nInvite required: %s\nPassword required: %s\nMembers: %s"),
606 empathy_chatroom_get_name (chatroom),
607 empathy_chatroom_get_invite_only (chatroom) ? _("Yes") : _("No"),
608 empathy_chatroom_get_need_password (chatroom) ? _("Yes") : _("No"),
610 invite_only = (empathy_chatroom_get_invite_only (chatroom) ?
611 GTK_STOCK_INDEX : NULL);
612 need_password = (empathy_chatroom_get_need_password (chatroom) ?
613 GTK_STOCK_DIALOG_AUTHENTICATION : NULL);
615 gtk_list_store_append (store, &iter);
616 gtk_list_store_set (store, &iter,
617 COL_NEED_PASSWORD, need_password,
618 COL_INVITE_ONLY, invite_only,
619 COL_NAME, empathy_chatroom_get_name (chatroom),
620 COL_ROOM, empathy_chatroom_get_room (chatroom),
621 COL_MEMBERS, members,
622 COL_MEMBERS_INT, empathy_chatroom_get_members_count (chatroom),
623 COL_TOOLTIP, tooltip,
631 start_listing_error_cb (EmpathyTpRoomlist *room_list,
633 EmpathyNewChatroomDialog *dialog)
635 gtk_label_set_text (GTK_LABEL (dialog->label_error_message), _("Could not start room listing"));
636 gtk_widget_show_all (dialog->viewport_error);
637 gtk_widget_set_sensitive (dialog->treeview, FALSE);
641 stop_listing_error_cb (EmpathyTpRoomlist *room_list,
643 EmpathyNewChatroomDialog *dialog)
645 gtk_label_set_text (GTK_LABEL (dialog->label_error_message), _("Could not stop room listing"));
646 gtk_widget_show_all (dialog->viewport_error);
647 gtk_widget_set_sensitive (dialog->treeview, FALSE);
651 new_chatroom_dialog_listing_cb (EmpathyTpRoomlist *room_list,
653 EmpathyNewChatroomDialog *dialog)
657 listing = empathy_tp_roomlist_is_listing (room_list);
659 /* Update the throbber */
661 gtk_spinner_start (GTK_SPINNER (dialog->throbber));
662 gtk_widget_show (dialog->throbber);
664 gtk_spinner_stop (GTK_SPINNER (dialog->throbber));
665 gtk_widget_hide (dialog->throbber);
670 new_chatroom_dialog_model_clear (EmpathyNewChatroomDialog *dialog)
674 store = GTK_LIST_STORE (dialog->model);
675 gtk_list_store_clear (store);
679 new_chatroom_dialog_model_row_activated_cb (GtkTreeView *tree_view,
681 GtkTreeViewColumn *column,
682 EmpathyNewChatroomDialog *dialog)
684 gtk_widget_activate (dialog->button_join);
688 new_chatroom_dialog_model_selection_changed (GtkTreeSelection *selection,
689 EmpathyNewChatroomDialog *dialog)
694 gchar *server = NULL;
696 if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
700 gtk_tree_model_get (model, &iter, COL_ROOM, &room, -1);
701 server = strstr (room, "@");
707 gtk_entry_set_text (GTK_ENTRY (dialog->entry_server), server ? server : "");
708 gtk_entry_set_text (GTK_ENTRY (dialog->entry_room), room ? room : "");
714 new_chatroom_dialog_join (EmpathyNewChatroomDialog *dialog)
716 EmpathyAccountChooser *account_chooser;
717 TpConnection *connection;
719 const gchar *server = NULL;
720 gchar *room_name = NULL;
722 room = gtk_entry_get_text (GTK_ENTRY (dialog->entry_room));
723 server = gtk_entry_get_text (GTK_ENTRY (dialog->entry_server));
725 account_chooser = EMPATHY_ACCOUNT_CHOOSER (dialog->account_chooser);
726 connection = empathy_account_chooser_get_connection (account_chooser);
728 if (!EMP_STR_EMPTY (server)) {
729 room_name = g_strconcat (room, "@", server, NULL);
731 room_name = g_strdup (room);
734 g_strstrip (room_name);
736 DEBUG ("Requesting channel for '%s'", room_name);
737 empathy_dispatcher_join_muc (connection, room_name,
738 gtk_get_current_event_time (), NULL, NULL);
744 new_chatroom_dialog_entry_changed_cb (GtkWidget *entry,
745 EmpathyNewChatroomDialog *dialog)
747 if (entry == dialog->entry_room) {
748 update_join_button_sensitivity (dialog);
750 /* FIXME: Select the room in the list */
755 new_chatroom_dialog_browse_start (EmpathyNewChatroomDialog *dialog)
757 new_chatroom_dialog_model_clear (dialog);
758 if (dialog->room_list) {
759 empathy_tp_roomlist_start (dialog->room_list);
764 new_chatroom_dialog_browse_stop (EmpathyNewChatroomDialog *dialog)
766 if (dialog->room_list) {
767 empathy_tp_roomlist_stop (dialog->room_list);
772 new_chatroom_dialog_entry_server_activate_cb (GtkWidget *widget,
773 EmpathyNewChatroomDialog *dialog)
775 new_chatroom_dialog_browse_start (dialog);
779 new_chatroom_dialog_expander_browse_activate_cb (GtkWidget *widget,
780 EmpathyNewChatroomDialog *dialog)
784 expanded = gtk_expander_get_expanded (GTK_EXPANDER (widget));
786 new_chatroom_dialog_browse_stop (dialog);
787 gtk_window_set_resizable (GTK_WINDOW (dialog->window), FALSE);
789 gtk_widget_hide (dialog->viewport_error);
790 gtk_widget_set_sensitive (dialog->treeview, TRUE);
791 new_chatroom_dialog_browse_start (dialog);
792 gtk_window_set_resizable (GTK_WINDOW (dialog->window), TRUE);
797 new_chatroom_dialog_entry_server_focus_out_cb (GtkWidget *widget,
798 GdkEventFocus *event,
799 EmpathyNewChatroomDialog *dialog)
803 expanded = gtk_expander_get_expanded (GTK_EXPANDER (dialog->expander_browse));
805 new_chatroom_dialog_browse_start (dialog);