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 <libempathy/empathy-tp-roomlist.h>
36 #include <libempathy/empathy-chatroom.h>
37 #include <libempathy/empathy-utils.h>
38 #include <libempathy/empathy-dispatcher.h>
40 #include <libempathy-gtk/empathy-account-chooser.h>
41 #include <libempathy-gtk/empathy-ui-utils.h>
43 #include "empathy-new-chatroom-dialog.h"
44 #include "ephy-spinner.h"
46 #define DEBUG_FLAG EMPATHY_DEBUG_OTHER
47 #include <libempathy/empathy-debug.h>
50 EmpathyTpRoomlist
*room_list
;
51 /* Currently selected account */
53 /* Signal id of the "status-changed" signal connected on the currently
55 gulong status_changed_id
;
58 GtkWidget
*vbox_widgets
;
59 GtkWidget
*table_info
;
60 GtkWidget
*label_account
;
61 GtkWidget
*account_chooser
;
62 GtkWidget
*label_server
;
63 GtkWidget
*entry_server
;
64 GtkWidget
*label_room
;
65 GtkWidget
*entry_room
;
66 GtkWidget
*expander_browse
;
70 GtkWidget
*button_join
;
71 GtkWidget
*label_error_message
;
72 GtkWidget
*viewport_error
;
73 } EmpathyNewChatroomDialog
;
86 static void new_chatroom_dialog_response_cb (GtkWidget
*widget
,
88 EmpathyNewChatroomDialog
*dialog
);
89 static void new_chatroom_dialog_destroy_cb (GtkWidget
*widget
,
90 EmpathyNewChatroomDialog
*dialog
);
91 static void new_chatroom_dialog_model_setup (EmpathyNewChatroomDialog
*dialog
);
92 static void new_chatroom_dialog_model_add_columns (EmpathyNewChatroomDialog
*dialog
);
93 static void new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog
*dialog
);
94 static void new_chatroom_dialog_account_changed_cb (GtkComboBox
*combobox
,
95 EmpathyNewChatroomDialog
*dialog
);
96 static void new_chatroom_dialog_roomlist_destroy_cb (EmpathyTpRoomlist
*room_list
,
97 EmpathyNewChatroomDialog
*dialog
);
98 static void new_chatroom_dialog_new_room_cb (EmpathyTpRoomlist
*room_list
,
99 EmpathyChatroom
*chatroom
,
100 EmpathyNewChatroomDialog
*dialog
);
101 static void new_chatroom_dialog_listing_cb (EmpathyTpRoomlist
*room_list
,
103 EmpathyNewChatroomDialog
*dialog
);
104 static void start_listing_error_cb (EmpathyTpRoomlist
*room_list
,
106 EmpathyNewChatroomDialog
*dialog
);
107 static void stop_listing_error_cb (EmpathyTpRoomlist
*room_list
,
109 EmpathyNewChatroomDialog
*dialog
);
110 static void new_chatroom_dialog_model_clear (EmpathyNewChatroomDialog
*dialog
);
111 static void new_chatroom_dialog_model_row_activated_cb (GtkTreeView
*tree_view
,
113 GtkTreeViewColumn
*column
,
114 EmpathyNewChatroomDialog
*dialog
);
115 static void new_chatroom_dialog_model_selection_changed (GtkTreeSelection
*selection
,
116 EmpathyNewChatroomDialog
*dialog
);
117 static void new_chatroom_dialog_join (EmpathyNewChatroomDialog
*dialog
);
118 static void new_chatroom_dialog_entry_changed_cb (GtkWidget
*entry
,
119 EmpathyNewChatroomDialog
*dialog
);
120 static void new_chatroom_dialog_browse_start (EmpathyNewChatroomDialog
*dialog
);
121 static void new_chatroom_dialog_browse_stop (EmpathyNewChatroomDialog
*dialog
);
122 static void new_chatroom_dialog_entry_server_activate_cb (GtkWidget
*widget
,
123 EmpathyNewChatroomDialog
*dialog
);
124 static void new_chatroom_dialog_expander_browse_activate_cb (GtkWidget
*widget
,
125 EmpathyNewChatroomDialog
*dialog
);
126 static gboolean
new_chatroom_dialog_entry_server_focus_out_cb (GtkWidget
*widget
,
127 GdkEventFocus
*event
,
128 EmpathyNewChatroomDialog
*dialog
);
129 static void new_chatroom_dialog_button_close_error_clicked_cb (GtkButton
*button
,
130 EmpathyNewChatroomDialog
*dialog
);
132 static EmpathyNewChatroomDialog
*dialog_p
= NULL
;
135 empathy_new_chatroom_dialog_show (GtkWindow
*parent
)
137 EmpathyNewChatroomDialog
*dialog
;
139 GtkSizeGroup
*size_group
;
143 gtk_window_present (GTK_WINDOW (dialog_p
->window
));
147 dialog_p
= dialog
= g_new0 (EmpathyNewChatroomDialog
, 1);
149 filename
= empathy_file_lookup ("empathy-new-chatroom-dialog.ui", "src");
150 gui
= empathy_builder_get_file (filename
,
151 "new_chatroom_dialog", &dialog
->window
,
152 "table_info", &dialog
->table_info
,
153 "label_account", &dialog
->label_account
,
154 "label_server", &dialog
->label_server
,
155 "label_room", &dialog
->label_room
,
156 "entry_server", &dialog
->entry_server
,
157 "entry_room", &dialog
->entry_room
,
158 "treeview", &dialog
->treeview
,
159 "button_join", &dialog
->button_join
,
160 "expander_browse", &dialog
->expander_browse
,
161 "label_error_message", &dialog
->label_error_message
,
162 "viewport_error", &dialog
->viewport_error
,
166 empathy_builder_connect (gui
, dialog
,
167 "new_chatroom_dialog", "response", new_chatroom_dialog_response_cb
,
168 "new_chatroom_dialog", "destroy", new_chatroom_dialog_destroy_cb
,
169 "entry_server", "changed", new_chatroom_dialog_entry_changed_cb
,
170 "entry_server", "activate", new_chatroom_dialog_entry_server_activate_cb
,
171 "entry_server", "focus-out-event", new_chatroom_dialog_entry_server_focus_out_cb
,
172 "entry_room", "changed", new_chatroom_dialog_entry_changed_cb
,
173 "expander_browse", "activate", new_chatroom_dialog_expander_browse_activate_cb
,
174 "button_close_error", "clicked", new_chatroom_dialog_button_close_error_clicked_cb
,
177 g_object_unref (gui
);
179 g_object_add_weak_pointer (G_OBJECT (dialog
->window
), (gpointer
) &dialog_p
);
181 /* Label alignment */
182 size_group
= gtk_size_group_new (GTK_SIZE_GROUP_HORIZONTAL
);
184 gtk_size_group_add_widget (size_group
, dialog
->label_account
);
185 gtk_size_group_add_widget (size_group
, dialog
->label_server
);
186 gtk_size_group_add_widget (size_group
, dialog
->label_room
);
188 g_object_unref (size_group
);
190 /* Set up chatrooms treeview */
191 new_chatroom_dialog_model_setup (dialog
);
194 dialog
->throbber
= ephy_spinner_new ();
195 ephy_spinner_set_size (EPHY_SPINNER (dialog
->throbber
), GTK_ICON_SIZE_LARGE_TOOLBAR
);
196 gtk_widget_show (dialog
->throbber
);
197 gtk_table_attach (GTK_TABLE (dialog
->table_info
),
202 /* Account chooser for custom */
203 dialog
->account_chooser
= empathy_account_chooser_new ();
204 empathy_account_chooser_set_filter (EMPATHY_ACCOUNT_CHOOSER (dialog
->account_chooser
),
205 empathy_account_chooser_filter_is_connected
,
207 gtk_table_attach_defaults (GTK_TABLE (dialog
->table_info
),
208 dialog
->account_chooser
,
210 gtk_widget_show (dialog
->account_chooser
);
212 g_signal_connect (GTK_COMBO_BOX (dialog
->account_chooser
), "changed",
213 G_CALLBACK (new_chatroom_dialog_account_changed_cb
),
215 new_chatroom_dialog_account_changed_cb (GTK_COMBO_BOX (dialog
->account_chooser
),
219 gtk_window_set_transient_for (GTK_WINDOW (dialog
->window
),
220 GTK_WINDOW (parent
));
223 gtk_widget_show (dialog
->window
);
227 new_chatroom_dialog_response_cb (GtkWidget
*widget
,
229 EmpathyNewChatroomDialog
*dialog
)
231 if (response
== GTK_RESPONSE_OK
) {
232 new_chatroom_dialog_join (dialog
);
235 gtk_widget_destroy (widget
);
239 new_chatroom_dialog_destroy_cb (GtkWidget
*widget
,
240 EmpathyNewChatroomDialog
*dialog
)
242 if (dialog
->room_list
) {
243 g_object_unref (dialog
->room_list
);
245 g_object_unref (dialog
->model
);
247 if (dialog
->account
!= NULL
) {
248 g_signal_handler_disconnect (dialog
->account
, dialog
->status_changed_id
);
249 g_object_unref (dialog
->account
);
256 new_chatroom_dialog_model_setup (EmpathyNewChatroomDialog
*dialog
)
260 GtkTreeSelection
*selection
;
263 view
= GTK_TREE_VIEW (dialog
->treeview
);
265 g_signal_connect (view
, "row-activated",
266 G_CALLBACK (new_chatroom_dialog_model_row_activated_cb
),
270 store
= gtk_list_store_new (COL_COUNT
,
271 G_TYPE_STRING
, /* Invite */
272 G_TYPE_STRING
, /* Password */
273 G_TYPE_STRING
, /* Name */
274 G_TYPE_STRING
, /* Room */
275 G_TYPE_STRING
, /* Member count */
276 G_TYPE_INT
, /* Member count int */
277 G_TYPE_STRING
); /* Tool tip */
279 dialog
->model
= GTK_TREE_MODEL (store
);
280 gtk_tree_view_set_model (view
, dialog
->model
);
281 gtk_tree_view_set_tooltip_column (view
, COL_TOOLTIP
);
282 gtk_tree_view_set_search_column (view
, COL_NAME
);
285 selection
= gtk_tree_view_get_selection (view
);
286 gtk_tree_sortable_set_sort_column_id (GTK_TREE_SORTABLE (store
),
287 COL_NAME
, GTK_SORT_ASCENDING
);
289 g_signal_connect (selection
, "changed",
290 G_CALLBACK (new_chatroom_dialog_model_selection_changed
),
294 new_chatroom_dialog_model_add_columns (dialog
);
298 new_chatroom_dialog_model_add_columns (EmpathyNewChatroomDialog
*dialog
)
301 GtkTreeViewColumn
*column
;
302 GtkCellRenderer
*cell
;
305 gtk_icon_size_lookup (GTK_ICON_SIZE_MENU
, &width
, &height
);
307 view
= GTK_TREE_VIEW (dialog
->treeview
);
309 cell
= gtk_cell_renderer_pixbuf_new ();
313 "stock-size", GTK_ICON_SIZE_MENU
,
315 column
= gtk_tree_view_column_new_with_attributes (NULL
,
317 "stock-id", COL_INVITE_ONLY
,
320 gtk_tree_view_column_set_sort_column_id (column
, COL_INVITE_ONLY
);
321 gtk_tree_view_append_column (view
, column
);
323 column
= gtk_tree_view_column_new_with_attributes (NULL
,
325 "stock-id", COL_NEED_PASSWORD
,
328 gtk_tree_view_column_set_sort_column_id (column
, COL_NEED_PASSWORD
);
329 gtk_tree_view_append_column (view
, column
);
331 cell
= gtk_cell_renderer_text_new ();
335 "ellipsize", PANGO_ELLIPSIZE_END
,
338 column
= gtk_tree_view_column_new_with_attributes (_("Chat Room"),
343 gtk_tree_view_column_set_sort_column_id (column
, COL_NAME
);
344 gtk_tree_view_column_set_expand (column
, TRUE
);
345 gtk_tree_view_append_column (view
, column
);
347 cell
= gtk_cell_renderer_text_new ();
351 "ellipsize", PANGO_ELLIPSIZE_END
,
352 "alignment", PANGO_ALIGN_RIGHT
,
354 column
= gtk_tree_view_column_new_with_attributes (_("Members"),
359 gtk_tree_view_column_set_sort_column_id (column
, COL_MEMBERS_INT
);
360 gtk_tree_view_append_column (view
, column
);
364 update_join_button_sensitivity (EmpathyNewChatroomDialog
*dialog
)
367 gboolean sensitive
= FALSE
;
370 room
= gtk_entry_get_text (GTK_ENTRY (dialog
->entry_room
));
371 if (EMP_STR_EMPTY (room
))
374 if (dialog
->account
== NULL
)
377 if (tp_account_get_connection_status (dialog
->account
, NULL
) !=
378 TP_CONNECTION_STATUS_CONNECTED
)
384 gtk_widget_set_sensitive (dialog
->button_join
, sensitive
);
388 new_chatroom_dialog_update_widgets (EmpathyNewChatroomDialog
*dialog
)
390 EmpathyAccountChooser
*account_chooser
;
391 const gchar
*protocol
;
393 account_chooser
= EMPATHY_ACCOUNT_CHOOSER (dialog
->account_chooser
);
395 if (dialog
->account
== NULL
)
398 protocol
= tp_account_get_protocol (dialog
->account
);
400 gtk_entry_set_text (GTK_ENTRY (dialog
->entry_server
), "");
402 /* hardcode here known protocols */
403 if (strcmp (protocol
, "jabber") == 0) {
404 gtk_widget_set_sensitive (dialog
->entry_server
, TRUE
);
406 else if (strcmp (protocol
, "local-xmpp") == 0) {
407 gtk_widget_set_sensitive (dialog
->entry_server
, FALSE
);
409 else if (strcmp (protocol
, "irc") == 0) {
410 gtk_widget_set_sensitive (dialog
->entry_server
, FALSE
);
413 gtk_widget_set_sensitive (dialog
->entry_server
, TRUE
);
416 update_join_button_sensitivity (dialog
);
418 /* Final set up of the dialog */
419 gtk_widget_grab_focus (dialog
->entry_room
);
423 account_status_changed_cb (TpAccount
*account
,
427 gchar
*dbus_error_name
,
429 EmpathyNewChatroomDialog
*self
)
431 update_join_button_sensitivity (self
);
435 new_chatroom_dialog_account_changed_cb (GtkComboBox
*combobox
,
436 EmpathyNewChatroomDialog
*dialog
)
438 EmpathyAccountChooser
*account_chooser
;
439 gboolean listing
= FALSE
;
440 gboolean expanded
= FALSE
;
442 if (dialog
->room_list
) {
443 g_object_unref (dialog
->room_list
);
444 dialog
->room_list
= NULL
;
447 ephy_spinner_stop (EPHY_SPINNER (dialog
->throbber
));
448 new_chatroom_dialog_model_clear (dialog
);
450 if (dialog
->account
!= NULL
) {
451 g_signal_handler_disconnect (dialog
->account
, dialog
->status_changed_id
);
452 g_object_unref (dialog
->account
);
455 account_chooser
= EMPATHY_ACCOUNT_CHOOSER (dialog
->account_chooser
);
456 dialog
->account
= empathy_account_chooser_dup_account (account_chooser
);
457 if (dialog
->account
== NULL
)
460 dialog
->status_changed_id
= g_signal_connect (dialog
->account
,
461 "status-changed", G_CALLBACK (account_status_changed_cb
), dialog
);
463 dialog
->room_list
= empathy_tp_roomlist_new (dialog
->account
);
465 if (dialog
->room_list
) {
466 g_signal_connect (dialog
->room_list
, "destroy",
467 G_CALLBACK (new_chatroom_dialog_roomlist_destroy_cb
),
469 g_signal_connect (dialog
->room_list
, "new-room",
470 G_CALLBACK (new_chatroom_dialog_new_room_cb
),
472 g_signal_connect (dialog
->room_list
, "notify::is-listing",
473 G_CALLBACK (new_chatroom_dialog_listing_cb
),
475 g_signal_connect (dialog
->room_list
, "error::start",
476 G_CALLBACK (start_listing_error_cb
),
478 g_signal_connect (dialog
->room_list
, "error::stop",
479 G_CALLBACK (stop_listing_error_cb
),
482 expanded
= gtk_expander_get_expanded (GTK_EXPANDER (dialog
->expander_browse
));
484 gtk_widget_hide (dialog
->viewport_error
);
485 gtk_widget_set_sensitive (dialog
->treeview
, TRUE
);
486 new_chatroom_dialog_browse_start (dialog
);
489 listing
= empathy_tp_roomlist_is_listing (dialog
->room_list
);
491 ephy_spinner_start (EPHY_SPINNER (dialog
->throbber
));
496 new_chatroom_dialog_update_widgets (dialog
);
500 new_chatroom_dialog_button_close_error_clicked_cb (GtkButton
*button
,
501 EmpathyNewChatroomDialog
*dialog
)
503 gtk_widget_hide (dialog
->viewport_error
);
507 new_chatroom_dialog_roomlist_destroy_cb (EmpathyTpRoomlist
*room_list
,
508 EmpathyNewChatroomDialog
*dialog
)
510 g_object_unref (dialog
->room_list
);
511 dialog
->room_list
= NULL
;
515 new_chatroom_dialog_new_room_cb (EmpathyTpRoomlist
*room_list
,
516 EmpathyChatroom
*chatroom
,
517 EmpathyNewChatroomDialog
*dialog
)
520 GtkTreeSelection
*selection
;
525 const gchar
*need_password
;
526 const gchar
*invite_only
;
528 DEBUG ("New chatroom listed: %s (%s)",
529 empathy_chatroom_get_name (chatroom
),
530 empathy_chatroom_get_room (chatroom
));
533 view
= GTK_TREE_VIEW (dialog
->treeview
);
534 selection
= gtk_tree_view_get_selection (view
);
535 store
= GTK_LIST_STORE (dialog
->model
);
536 members
= g_strdup_printf ("%d", empathy_chatroom_get_members_count (chatroom
));
537 tooltip
= g_strdup_printf (C_("Room/Join's roomlist tooltip. Parameters"
538 "are a channel name, yes/no, yes/no and a number.",
539 "<b>%s</b>\nInvite required: %s\nPassword required: %s\nMembers: %s"),
540 empathy_chatroom_get_name (chatroom
),
541 empathy_chatroom_get_invite_only (chatroom
) ? _("Yes") : _("No"),
542 empathy_chatroom_get_need_password (chatroom
) ? _("Yes") : _("No"),
544 invite_only
= (empathy_chatroom_get_invite_only (chatroom
) ?
545 GTK_STOCK_INDEX
: NULL
);
546 need_password
= (empathy_chatroom_get_need_password (chatroom
) ?
547 GTK_STOCK_DIALOG_AUTHENTICATION
: NULL
);
549 gtk_list_store_append (store
, &iter
);
550 gtk_list_store_set (store
, &iter
,
551 COL_NEED_PASSWORD
, need_password
,
552 COL_INVITE_ONLY
, invite_only
,
553 COL_NAME
, empathy_chatroom_get_name (chatroom
),
554 COL_ROOM
, empathy_chatroom_get_room (chatroom
),
555 COL_MEMBERS
, members
,
556 COL_MEMBERS_INT
, empathy_chatroom_get_members_count (chatroom
),
557 COL_TOOLTIP
, tooltip
,
565 start_listing_error_cb (EmpathyTpRoomlist
*room_list
,
567 EmpathyNewChatroomDialog
*dialog
)
569 gtk_label_set_text (GTK_LABEL (dialog
->label_error_message
), _("Could not start room listing"));
570 gtk_widget_show_all (dialog
->viewport_error
);
571 gtk_widget_set_sensitive (dialog
->treeview
, FALSE
);
575 stop_listing_error_cb (EmpathyTpRoomlist
*room_list
,
577 EmpathyNewChatroomDialog
*dialog
)
579 gtk_label_set_text (GTK_LABEL (dialog
->label_error_message
), _("Could not stop room listing"));
580 gtk_widget_show_all (dialog
->viewport_error
);
581 gtk_widget_set_sensitive (dialog
->treeview
, FALSE
);
585 new_chatroom_dialog_listing_cb (EmpathyTpRoomlist
*room_list
,
587 EmpathyNewChatroomDialog
*dialog
)
591 listing
= empathy_tp_roomlist_is_listing (room_list
);
593 /* Update the throbber */
595 ephy_spinner_start (EPHY_SPINNER (dialog
->throbber
));
597 ephy_spinner_stop (EPHY_SPINNER (dialog
->throbber
));
602 new_chatroom_dialog_model_clear (EmpathyNewChatroomDialog
*dialog
)
606 store
= GTK_LIST_STORE (dialog
->model
);
607 gtk_list_store_clear (store
);
611 new_chatroom_dialog_model_row_activated_cb (GtkTreeView
*tree_view
,
613 GtkTreeViewColumn
*column
,
614 EmpathyNewChatroomDialog
*dialog
)
616 gtk_widget_activate (dialog
->button_join
);
620 new_chatroom_dialog_model_selection_changed (GtkTreeSelection
*selection
,
621 EmpathyNewChatroomDialog
*dialog
)
626 gchar
*server
= NULL
;
628 if (!gtk_tree_selection_get_selected (selection
, &model
, &iter
)) {
632 gtk_tree_model_get (model
, &iter
, COL_ROOM
, &room
, -1);
633 server
= strstr (room
, "@");
639 gtk_entry_set_text (GTK_ENTRY (dialog
->entry_server
), server
? server
: "");
640 gtk_entry_set_text (GTK_ENTRY (dialog
->entry_room
), room
? room
: "");
646 new_chatroom_dialog_join (EmpathyNewChatroomDialog
*dialog
)
648 EmpathyAccountChooser
*account_chooser
;
649 TpConnection
*connection
;
651 const gchar
*server
= NULL
;
652 gchar
*room_name
= NULL
;
654 room
= gtk_entry_get_text (GTK_ENTRY (dialog
->entry_room
));
655 server
= gtk_entry_get_text (GTK_ENTRY (dialog
->entry_server
));
657 account_chooser
= EMPATHY_ACCOUNT_CHOOSER (dialog
->account_chooser
);
658 connection
= empathy_account_chooser_get_connection (account_chooser
);
660 if (!EMP_STR_EMPTY (server
)) {
661 room_name
= g_strconcat (room
, "@", server
, NULL
);
663 room_name
= g_strdup (room
);
666 DEBUG ("Requesting channel for '%s'", room_name
);
667 empathy_dispatcher_join_muc (connection
, room_name
, NULL
, NULL
);
673 new_chatroom_dialog_entry_changed_cb (GtkWidget
*entry
,
674 EmpathyNewChatroomDialog
*dialog
)
676 if (entry
== dialog
->entry_room
) {
677 update_join_button_sensitivity (dialog
);
679 /* FIXME: Select the room in the list */
684 new_chatroom_dialog_browse_start (EmpathyNewChatroomDialog
*dialog
)
686 new_chatroom_dialog_model_clear (dialog
);
687 if (dialog
->room_list
) {
688 empathy_tp_roomlist_start (dialog
->room_list
);
693 new_chatroom_dialog_browse_stop (EmpathyNewChatroomDialog
*dialog
)
695 if (dialog
->room_list
) {
696 empathy_tp_roomlist_stop (dialog
->room_list
);
701 new_chatroom_dialog_entry_server_activate_cb (GtkWidget
*widget
,
702 EmpathyNewChatroomDialog
*dialog
)
704 new_chatroom_dialog_browse_start (dialog
);
708 new_chatroom_dialog_expander_browse_activate_cb (GtkWidget
*widget
,
709 EmpathyNewChatroomDialog
*dialog
)
713 expanded
= gtk_expander_get_expanded (GTK_EXPANDER (widget
));
715 new_chatroom_dialog_browse_stop (dialog
);
716 gtk_window_set_resizable (GTK_WINDOW (dialog
->window
), FALSE
);
718 gtk_widget_hide (dialog
->viewport_error
);
719 gtk_widget_set_sensitive (dialog
->treeview
, TRUE
);
720 new_chatroom_dialog_browse_start (dialog
);
721 gtk_window_set_resizable (GTK_WINDOW (dialog
->window
), TRUE
);
726 new_chatroom_dialog_entry_server_focus_out_cb (GtkWidget
*widget
,
727 GdkEventFocus
*event
,
728 EmpathyNewChatroomDialog
*dialog
)
732 expanded
= gtk_expander_get_expanded (GTK_EXPANDER (dialog
->expander_browse
));
734 new_chatroom_dialog_browse_start (dialog
);