1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
3 * Copyright (C) 2005-2007 Imendio AB
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
15 * You should have received a copy of the GNU General Public
16 * License along with this program; if not, write to the
17 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 * Boston, MA 02111-1307, USA.
20 * Authors: Richard Hult <richard@imendio.com>
21 * Martyn Russell <martyn@imendio.com>
22 * Xavier Claessens <xclaesse@gmail.com>
30 #include <glib/gi18n-lib.h>
32 #include <glade/glade.h>
34 #include <telepathy-glib/util.h>
35 #include <libmissioncontrol/mc-enum-types.h>
37 #include <libempathy/empathy-idle.h>
38 #include <libempathy/empathy-utils.h>
39 #include <libempathy/empathy-status-presets.h>
41 #include "empathy-ui-utils.h"
42 #include "empathy-images.h"
43 #include "empathy-presence-chooser.h"
45 /* Flashing delay for icons (milliseconds). */
46 #define FLASH_TIMEOUT 500
48 #define GET_PRIV(obj) EMPATHY_GET_PRIV (obj, EmpathyPresenceChooser)
52 int block_set_editing;
56 McPresence flash_state_1;
57 McPresence flash_state_2;
58 guint flash_timeout_id;
59 } EmpathyPresenceChooserPriv;
63 GtkWidget *checkbutton_save;
64 GtkWidget *comboboxentry_message;
65 GtkWidget *entry_message;
66 GtkWidget *combobox_status;
67 GtkTreeModel *model_status;
68 } CustomMessageDialog;
77 static CustomMessageDialog *message_dialog = NULL;
78 /* States to be listed in the menu.
79 * Each state has a boolean telling if it can have custom message */
80 static guint states[] = {MC_PRESENCE_AVAILABLE, TRUE,
81 MC_PRESENCE_DO_NOT_DISTURB, TRUE,
82 MC_PRESENCE_AWAY, TRUE,
83 MC_PRESENCE_HIDDEN, FALSE,
84 MC_PRESENCE_OFFLINE, FALSE};
86 static void presence_chooser_finalize (GObject *object);
87 static void presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser);
88 static gboolean presence_chooser_flash_timeout_cb (EmpathyPresenceChooser *chooser);
89 static void presence_chooser_flash_start (EmpathyPresenceChooser *chooser,
92 static void presence_chooser_flash_stop (EmpathyPresenceChooser *chooser,
94 static void presence_chooser_menu_add_item (GtkWidget *menu,
97 static void presence_chooser_noncustom_activate_cb (GtkWidget *item,
99 static void presence_chooser_set_state (McPresence state,
100 const gchar *status);
101 static void presence_chooser_custom_activate_cb (GtkWidget *item,
103 static void presence_chooser_dialog_show (void);
105 G_DEFINE_TYPE (EmpathyPresenceChooser, empathy_presence_chooser, GTK_TYPE_COMBO_BOX_ENTRY);
108 empathy_presence_chooser_class_init (EmpathyPresenceChooserClass *klass)
110 GObjectClass *object_class = G_OBJECT_CLASS (klass);
112 object_class->finalize = presence_chooser_finalize;
114 g_type_class_add_private (object_class, sizeof (EmpathyPresenceChooserPriv));
134 static GtkTreeModel *
137 GtkListStore *store = gtk_list_store_new (N_COLUMNS,
138 G_TYPE_STRING, /* COL_STATE_ICON_NAME */
139 MC_TYPE_PRESENCE, /* COL_STATE */
140 G_TYPE_STRING, /* COL_STATUS_TEXT */
141 G_TYPE_STRING, /* COL_DISPLAY_MARKUP */
142 G_TYPE_INT); /* COL_TYPE */
147 for (i = 0; i < G_N_ELEMENTS (states); i += 2) {
150 const char *status = empathy_presence_get_default_message (states[i]);
151 const char *icon_name = empathy_icon_name_for_presence (states[i]);
153 gtk_list_store_append (store, &iter);
154 gtk_list_store_set (store, &iter,
155 COL_STATE_ICON_NAME, icon_name,
156 COL_STATE, states[i],
157 COL_STATUS_TEXT, status,
158 COL_DISPLAY_MARKUP, status,
159 COL_TYPE, ENTRY_TYPE_BUILTIN,
163 /* Set custom messages if wanted */
164 list = empathy_status_presets_get (states[i], 5);
165 for (l = list; l; l = l->next) {
166 gtk_list_store_append (store, &iter);
167 gtk_list_store_set (store, &iter,
168 COL_STATE_ICON_NAME, icon_name,
169 COL_STATE, states[i],
170 COL_STATUS_TEXT, l->data,
171 COL_DISPLAY_MARKUP, l->data,
172 COL_TYPE, ENTRY_TYPE_SAVED,
177 gtk_list_store_append (store, &iter);
178 gtk_list_store_set (store, &iter,
179 COL_STATE_ICON_NAME, icon_name,
180 COL_STATE, states[i],
182 COL_DISPLAY_MARKUP, "<i>Custom Message...</i>",
183 COL_TYPE, ENTRY_TYPE_CUSTOM,
189 return GTK_TREE_MODEL (store);
193 popup_shown_cb (GObject *self, GParamSpec *pspec, gpointer user_data)
196 g_object_get (self, "popup-shown", &shown, NULL);
200 g_print ("popup shown\n");
202 GtkTreeModel *model = create_model ();
204 gtk_combo_box_set_model (GTK_COMBO_BOX (self), GTK_TREE_MODEL (model));
206 g_object_unref (model);
210 set_status_editing (EmpathyPresenceChooser *self, gboolean editing)
212 EmpathyPresenceChooserPriv *priv = GET_PRIV (self);
213 GtkWidget *entry = gtk_bin_get_child (GTK_BIN (self));
215 if (priv->block_set_editing) return;
219 gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
220 GTK_ENTRY_ICON_SECONDARY,
222 gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
223 GTK_ENTRY_ICON_SECONDARY,
225 // FIXME - is this nice?
226 gtk_entry_set_icon_sensitive (GTK_ENTRY (entry),
227 GTK_ENTRY_ICON_PRIMARY,
232 gtk_entry_set_icon_from_stock (GTK_ENTRY (entry),
233 GTK_ENTRY_ICON_SECONDARY,
235 gtk_entry_set_icon_tooltip_text (GTK_ENTRY (entry),
236 GTK_ENTRY_ICON_SECONDARY,
239 gtk_entry_set_icon_sensitive (GTK_ENTRY (entry),
240 GTK_ENTRY_ICON_PRIMARY,
243 // FIXME - move the focus somewhere
245 /* update the status with MC */
246 const char *status = gtk_entry_get_text (GTK_ENTRY (entry));
247 empathy_idle_set_presence (priv->idle, priv->state, status);
252 ui_set_custom_state (EmpathyPresenceChooser *self,
256 EmpathyPresenceChooserPriv *priv = GET_PRIV (self);
257 GtkWidget *entry = gtk_bin_get_child (GTK_BIN (self));
258 const char *icon_name;
260 priv->block_set_editing++;
262 icon_name = empathy_icon_name_for_presence (state);
263 gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
264 GTK_ENTRY_ICON_PRIMARY,
266 gtk_entry_set_text (GTK_ENTRY (entry), status);
268 priv->block_set_editing--;
272 entry_icon_release_cb (EmpathyPresenceChooser *self,
273 GtkEntryIconPosition icon_pos,
277 set_status_editing (self, FALSE);
281 entry_activate_cb (EmpathyPresenceChooser *self,
284 g_print ("ACTIVATE! (form of a dragon)\n");
286 set_status_editing (self, FALSE);
290 changed_cb (GtkComboBox *self, gpointer user_data)
292 EmpathyPresenceChooserPriv *priv = GET_PRIV (self);
293 g_print ("Changed\n");
299 GtkTreeModel *model = gtk_combo_box_get_model (self);
300 if (!gtk_combo_box_get_active_iter (self, &iter))
302 /* the combo is being edited to a custom entry */
303 set_status_editing (EMPATHY_PRESENCE_CHOOSER (self), TRUE);
307 gtk_tree_model_get (model, &iter,
308 COL_STATE_ICON_NAME, &icon_name,
309 COL_STATE, &priv->state,
313 GtkWidget *entry = gtk_bin_get_child (GTK_BIN (self));
314 gtk_entry_set_icon_from_icon_name (GTK_ENTRY (entry),
315 GTK_ENTRY_ICON_PRIMARY,
318 if (type == ENTRY_TYPE_CUSTOM)
321 gtk_widget_grab_focus (entry);
322 set_status_editing (EMPATHY_PRESENCE_CHOOSER (self), TRUE);
327 /* just in case we were setting a new status when
328 * things were changed */
329 set_status_editing (EMPATHY_PRESENCE_CHOOSER (self), FALSE);
331 gtk_tree_model_get (model, &iter,
332 COL_STATUS_TEXT, &status,
335 empathy_idle_set_presence (priv->idle, priv->state, status);
344 empathy_presence_chooser_init (EmpathyPresenceChooser *chooser)
347 //GtkWidget *alignment;
348 EmpathyPresenceChooserPriv *priv = G_TYPE_INSTANCE_GET_PRIVATE (chooser,
349 EMPATHY_TYPE_PRESENCE_CHOOSER, EmpathyPresenceChooserPriv);
352 chooser->priv = priv;
354 GtkTreeModel *model = create_model ();
356 gtk_combo_box_set_model (GTK_COMBO_BOX (chooser), GTK_TREE_MODEL (model));
357 gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (chooser), COL_STATUS_TEXT);
359 GtkWidget *entry = gtk_bin_get_child (GTK_BIN (chooser));
360 gtk_entry_set_icon_activatable (GTK_ENTRY (entry),
361 GTK_ENTRY_ICON_PRIMARY, FALSE);
362 g_signal_connect_object (entry, "icon-release",
363 G_CALLBACK (entry_icon_release_cb), chooser,
365 g_signal_connect_object (entry, "activate",
366 G_CALLBACK (entry_activate_cb), chooser,
369 GtkCellRenderer *renderer;
370 gtk_cell_layout_clear (GTK_CELL_LAYOUT (chooser));
372 renderer = gtk_cell_renderer_pixbuf_new ();
373 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser), renderer, FALSE);
374 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (chooser), renderer,
375 "icon-name", COL_STATE_ICON_NAME,
377 g_object_set (renderer, "stock-size", GTK_ICON_SIZE_MENU, NULL);
379 renderer = gtk_cell_renderer_text_new ();
380 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (chooser), renderer, TRUE);
381 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (chooser), renderer,
382 "markup", COL_DISPLAY_MARKUP,
385 g_object_unref (model);
387 g_signal_connect (chooser, "notify::popup-shown",
388 G_CALLBACK (popup_shown_cb), NULL);
389 g_signal_connect (chooser, "changed",
390 G_CALLBACK (changed_cb), NULL);
392 priv->idle = empathy_idle_dup_singleton ();
393 presence_chooser_presence_changed_cb (chooser);
394 g_signal_connect_swapped (priv->idle, "notify",
395 G_CALLBACK (presence_chooser_presence_changed_cb),
400 presence_chooser_finalize (GObject *object)
402 EmpathyPresenceChooserPriv *priv;
404 priv = GET_PRIV (object);
406 if (priv->flash_timeout_id) {
407 g_source_remove (priv->flash_timeout_id);
410 g_signal_handlers_disconnect_by_func (priv->idle,
411 presence_chooser_presence_changed_cb,
413 g_object_unref (priv->idle);
415 G_OBJECT_CLASS (empathy_presence_chooser_parent_class)->finalize (object);
419 empathy_presence_chooser_new (void)
423 chooser = g_object_new (EMPATHY_TYPE_PRESENCE_CHOOSER, NULL);
429 presence_chooser_presence_changed_cb (EmpathyPresenceChooser *chooser)
431 EmpathyPresenceChooserPriv *priv;
433 McPresence flash_state;
436 g_print (" > presence_chooser_presence_changed_cb\n");
438 priv = GET_PRIV (chooser);
440 state = empathy_idle_get_state (priv->idle);
441 status = empathy_idle_get_status (priv->idle);
442 flash_state = empathy_idle_get_flash_state (priv->idle);
444 g_print ("status = %s\n", status);
446 // FIXME - we need to either find an entry in the model or add one
447 GtkTreeModel *model = gtk_combo_box_get_model (GTK_COMBO_BOX (chooser));
449 gboolean valid, match_state = FALSE, match = FALSE;
450 for (valid = gtk_tree_model_get_iter_first (model, &iter);
452 valid = gtk_tree_model_iter_next (model, &iter))
458 gtk_tree_model_get (model, &iter,
463 if (m_type == ENTRY_TYPE_CUSTOM)
467 else if (!match_state && state == m_state)
469 /* we are now in the section that can contain our
473 else if (match_state && state != m_state)
475 /* we have passed the section that can contain our
480 gtk_tree_model_get (model, &iter,
481 COL_STATUS_TEXT, &m_status,
484 match = !strcmp (status, m_status);
494 g_print ("GOT MATCH\n");
495 gtk_combo_box_set_active_iter (GTK_COMBO_BOX (chooser), &iter);
499 g_print ("NO MATCH\n");
500 // FIXME - do we insert the match into the menu?
501 ui_set_custom_state (chooser, state, status);
504 if (flash_state != MC_PRESENCE_UNSET) {
505 presence_chooser_flash_start (chooser, state, flash_state);
507 presence_chooser_flash_stop (chooser, state);
512 presence_chooser_flash_timeout_cb (EmpathyPresenceChooser *chooser)
515 EmpathyPresenceChooserPriv *priv;
517 static gboolean on = FALSE;
519 priv = GET_PRIV (chooser);
522 state = priv->flash_state_1;
524 state = priv->flash_state_2;
527 gtk_image_set_from_icon_name (GTK_IMAGE (priv->image),
528 empathy_icon_name_for_presence (state),
537 presence_chooser_flash_start (EmpathyPresenceChooser *chooser,
541 EmpathyPresenceChooserPriv *priv;
543 g_return_if_fail (EMPATHY_IS_PRESENCE_CHOOSER (chooser));
545 priv = GET_PRIV (chooser);
547 priv->flash_state_1 = state_1;
548 priv->flash_state_2 = state_2;
550 if (!priv->flash_timeout_id) {
551 priv->flash_timeout_id = g_timeout_add (FLASH_TIMEOUT,
552 (GSourceFunc) presence_chooser_flash_timeout_cb,
558 presence_chooser_flash_stop (EmpathyPresenceChooser *chooser,
561 EmpathyPresenceChooserPriv *priv;
563 g_return_if_fail (EMPATHY_IS_PRESENCE_CHOOSER (chooser));
565 priv = GET_PRIV (chooser);
567 if (priv->flash_timeout_id) {
568 g_source_remove (priv->flash_timeout_id);
569 priv->flash_timeout_id = 0;
573 gtk_image_set_from_icon_name (GTK_IMAGE (priv->image),
574 empathy_icon_name_for_presence (state),
578 // FIXME - what does this do?
579 // priv->last_state = state;
583 empathy_presence_chooser_create_menu (void)
591 menu = gtk_menu_new ();
593 for (i = 0; i < G_N_ELEMENTS (states); i += 2) {
596 status = empathy_presence_get_default_message (states[i]);
597 presence_chooser_menu_add_item (menu,
602 /* Set custom messages if wanted */
603 list = empathy_status_presets_get (states[i], 5);
604 for (l = list; l; l = l->next) {
605 presence_chooser_menu_add_item (menu,
615 item = gtk_menu_item_new ();
616 gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
617 gtk_widget_show (item);
619 /* Custom messages */
620 item = gtk_image_menu_item_new_with_label (_("Custom messages..."));
621 image = gtk_image_new_from_stock (GTK_STOCK_EDIT, GTK_ICON_SIZE_MENU);
622 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
623 gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
624 gtk_widget_show (image);
625 gtk_widget_show (item);
627 g_signal_connect (item,
629 G_CALLBACK (presence_chooser_custom_activate_cb),
636 presence_chooser_menu_add_item (GtkWidget *menu,
642 const gchar *icon_name;
644 item = gtk_image_menu_item_new_with_label (str);
645 icon_name = empathy_icon_name_for_presence (state);
647 g_signal_connect (item, "activate",
648 G_CALLBACK (presence_chooser_noncustom_activate_cb),
651 image = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_MENU);
652 gtk_widget_show (image);
654 gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (item), image);
655 gtk_widget_show (item);
657 g_object_set_data_full (G_OBJECT (item),
658 "status", g_strdup (str),
659 (GDestroyNotify) g_free);
661 g_object_set_data (G_OBJECT (item), "state", GINT_TO_POINTER (state));
663 gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
667 presence_chooser_noncustom_activate_cb (GtkWidget *item,
673 status = g_object_get_data (G_OBJECT (item), "status");
674 state = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "state"));
676 presence_chooser_set_state (state, status);
680 presence_chooser_set_state (McPresence state,
685 idle = empathy_idle_dup_singleton ();
686 empathy_idle_set_presence (idle, state, status);
687 g_object_unref (idle);
691 presence_chooser_custom_activate_cb (GtkWidget *item,
694 presence_chooser_dialog_show ();
698 presence_chooser_dialog_get_selected (CustomMessageDialog *dialog)
702 McPresence presence = LAST_MC_PRESENCE;
704 model = gtk_combo_box_get_model (GTK_COMBO_BOX (dialog->combobox_status));
705 if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (dialog->combobox_status), &iter)) {
706 gtk_tree_model_get (model, &iter,
707 COL_PRESENCE, &presence,
715 presence_chooser_dialog_status_changed_cb (GtkWidget *widget,
716 CustomMessageDialog *dialog)
720 McPresence presence = LAST_MC_PRESENCE;
723 presence = presence_chooser_dialog_get_selected (dialog);
725 store = gtk_list_store_new (1, G_TYPE_STRING);
726 messages = empathy_status_presets_get (presence, -1);
727 for (l = messages; l; l = l->next) {
728 gtk_list_store_append (store, &iter);
729 gtk_list_store_set (store, &iter, 0, l->data, -1);
732 gtk_entry_set_text (GTK_ENTRY (dialog->entry_message),
733 messages ? messages->data : "");
735 g_list_free (messages);
737 gtk_combo_box_set_model (GTK_COMBO_BOX (dialog->comboboxentry_message),
738 GTK_TREE_MODEL (store));
740 g_object_unref (store);
744 presence_chooser_dialog_message_changed_cb (GtkWidget *widget,
745 CustomMessageDialog *dialog)
750 gboolean found = FALSE;
752 presence = presence_chooser_dialog_get_selected (dialog);
753 text = gtk_entry_get_text (GTK_ENTRY (dialog->entry_message));
755 messages = empathy_status_presets_get (presence, -1);
756 for (l = messages; l; l = l->next) {
757 if (!tp_strdiff (text, l->data)) {
762 g_list_free (messages);
764 gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (dialog->checkbutton_save),
769 presence_chooser_dialog_save_toggled_cb (GtkWidget *widget,
770 CustomMessageDialog *dialog)
776 active = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->checkbutton_save));
777 state = presence_chooser_dialog_get_selected (dialog);
778 text = gtk_entry_get_text (GTK_ENTRY (dialog->entry_message));
781 empathy_status_presets_set_last (state, text);
783 empathy_status_presets_remove (state, text);
788 presence_chooser_dialog_setup (CustomMessageDialog *dialog)
791 GtkCellRenderer *renderer;
795 store = gtk_list_store_new (COL_COUNT,
796 G_TYPE_STRING, /* Icon name */
797 G_TYPE_STRING, /* Label */
798 MC_TYPE_PRESENCE); /* Presence */
799 gtk_combo_box_set_model (GTK_COMBO_BOX (dialog->combobox_status),
800 GTK_TREE_MODEL (store));
802 renderer = gtk_cell_renderer_pixbuf_new ();
803 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (dialog->combobox_status), renderer, FALSE);
804 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (dialog->combobox_status), renderer,
805 "icon-name", COL_ICON,
807 g_object_set (renderer, "stock-size", GTK_ICON_SIZE_BUTTON, NULL);
809 renderer = gtk_cell_renderer_text_new ();
810 gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (dialog->combobox_status), renderer, TRUE);
811 gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (dialog->combobox_status), renderer,
815 for (i = 0; i < G_N_ELEMENTS (states); i += 2) {
820 gtk_list_store_append (store, &iter);
821 gtk_list_store_set (store, &iter,
822 COL_ICON, empathy_icon_name_for_presence (states[i]),
823 COL_LABEL, empathy_presence_get_default_message (states[i]),
824 COL_PRESENCE, states[i],
828 gtk_combo_box_set_active (GTK_COMBO_BOX (dialog->combobox_status), 0);
832 presence_chooser_dialog_response_cb (GtkWidget *widget,
834 CustomMessageDialog *dialog)
836 if (response == GTK_RESPONSE_APPLY) {
840 state = presence_chooser_dialog_get_selected (dialog);
841 text = gtk_entry_get_text (GTK_ENTRY (dialog->entry_message));
843 presence_chooser_set_state (state, text);
846 gtk_widget_destroy (widget);
850 presence_chooser_dialog_destroy_cb (GtkWidget *widget,
851 CustomMessageDialog *dialog)
855 message_dialog = NULL;
859 presence_chooser_dialog_show (void)
864 if (message_dialog) {
865 gtk_window_present (GTK_WINDOW (message_dialog->dialog));
869 message_dialog = g_new0 (CustomMessageDialog, 1);
871 filename = empathy_file_lookup ("empathy-presence-chooser.glade",
873 glade = empathy_glade_get_file (filename,
874 "custom_message_dialog",
876 "custom_message_dialog", &message_dialog->dialog,
877 "checkbutton_save", &message_dialog->checkbutton_save,
878 "comboboxentry_message", &message_dialog->comboboxentry_message,
879 "combobox_status", &message_dialog->combobox_status,
883 empathy_glade_connect (glade,
885 "custom_message_dialog", "destroy", presence_chooser_dialog_destroy_cb,
886 "custom_message_dialog", "response", presence_chooser_dialog_response_cb,
887 "combobox_status", "changed", presence_chooser_dialog_status_changed_cb,
888 "checkbutton_save", "toggled", presence_chooser_dialog_save_toggled_cb,
891 g_object_unref (glade);
893 /* Setup the message combobox */
894 message_dialog->entry_message = GTK_BIN (message_dialog->comboboxentry_message)->child;
895 gtk_entry_set_activates_default (GTK_ENTRY (message_dialog->entry_message), TRUE);
896 gtk_entry_set_width_chars (GTK_ENTRY (message_dialog->entry_message), 25);
897 g_signal_connect (message_dialog->entry_message, "changed",
898 G_CALLBACK (presence_chooser_dialog_message_changed_cb),
901 presence_chooser_dialog_setup (message_dialog);
903 gtk_combo_box_entry_set_text_column (GTK_COMBO_BOX_ENTRY (message_dialog->comboboxentry_message), 0);
905 /* FIXME: Set transian for a window ? */
907 gtk_widget_show_all (message_dialog->dialog);