aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-presence-chooser.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-01-20 08:04:43 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-01-20 08:04:43 +0800
commit5919562b17c2cf695a406ac15d80809bda067a6d (patch)
tree7a0a4b96be866b95ee164d9f13f2b17b4b21371a /libempathy-gtk/empathy-presence-chooser.c
parent64db73006368921233856be5bd167e785f4b4964 (diff)
downloadgsoc2013-empathy-5919562b17c2cf695a406ac15d80809bda067a6d.tar
gsoc2013-empathy-5919562b17c2cf695a406ac15d80809bda067a6d.tar.gz
gsoc2013-empathy-5919562b17c2cf695a406ac15d80809bda067a6d.tar.bz2
gsoc2013-empathy-5919562b17c2cf695a406ac15d80809bda067a6d.tar.lz
gsoc2013-empathy-5919562b17c2cf695a406ac15d80809bda067a6d.tar.xz
gsoc2013-empathy-5919562b17c2cf695a406ac15d80809bda067a6d.tar.zst
gsoc2013-empathy-5919562b17c2cf695a406ac15d80809bda067a6d.zip
Add a cancel button on the custom message diaog
svn path=/trunk/; revision=583
Diffstat (limited to 'libempathy-gtk/empathy-presence-chooser.c')
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c27
1 files changed, 19 insertions, 8 deletions
diff --git a/libempathy-gtk/empathy-presence-chooser.c b/libempathy-gtk/empathy-presence-chooser.c
index a8b69e02f..17a627389 100644
--- a/libempathy-gtk/empathy-presence-chooser.c
+++ b/libempathy-gtk/empathy-presence-chooser.c
@@ -901,16 +901,27 @@ presence_chooser_dialog_setup (CustomMessageDialog *dialog)
}
static void
-presence_chooser_dialog_destroy_cb (GtkWidget *widget,
- CustomMessageDialog *dialog)
+presence_chooser_dialog_response_cb (GtkWidget *widget,
+ gint response,
+ CustomMessageDialog *dialog)
{
- McPresence state;
- const gchar *text;
+ if (response == GTK_RESPONSE_APPLY) {
+ McPresence state;
+ const gchar *text;
- state = presence_chooser_dialog_get_selected (dialog);
- text = gtk_entry_get_text (GTK_ENTRY (dialog->entry_message));
+ state = presence_chooser_dialog_get_selected (dialog);
+ text = gtk_entry_get_text (GTK_ENTRY (dialog->entry_message));
+
+ presence_chooser_set_state (state, text);
+ }
+
+ gtk_widget_destroy (widget);
+}
- presence_chooser_set_state (state, text);
+static void
+presence_chooser_dialog_destroy_cb (GtkWidget *widget,
+ CustomMessageDialog *dialog)
+{
g_free (dialog);
message_dialog = NULL;
@@ -938,7 +949,7 @@ presence_chooser_dialog_show (void)
empathy_glade_connect (glade,
message_dialog,
"custom_message_dialog", "destroy", presence_chooser_dialog_destroy_cb,
- "custom_message_dialog", "response", gtk_widget_destroy,
+ "custom_message_dialog", "response", presence_chooser_dialog_response_cb,
"combobox_status", "changed", presence_chooser_dialog_status_changed_cb,
"checkbutton_save", "toggled", presence_chooser_dialog_save_toggled_cb,
NULL);