aboutsummaryrefslogtreecommitdiffstats
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
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
-rw-r--r--libempathy-gtk/empathy-presence-chooser.c27
-rw-r--r--libempathy-gtk/empathy-presence-chooser.glade21
2 files changed, 36 insertions, 12 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);
diff --git a/libempathy-gtk/empathy-presence-chooser.glade b/libempathy-gtk/empathy-presence-chooser.glade
index 9433d2651..a3a26a156 100644
--- a/libempathy-gtk/empathy-presence-chooser.glade
+++ b/libempathy-gtk/empathy-presence-chooser.glade
@@ -5,6 +5,7 @@
<requires lib="gnome"/>
<widget class="GtkDialog" id="custom_message_dialog">
+ <property name="border_width">5</property>
<property name="visible">True</property>
<property name="title" translatable="yes">Custom message</property>
<property name="type">GTK_WINDOW_TOPLEVEL</property>
@@ -20,7 +21,6 @@
<property name="focus_on_map">True</property>
<property name="urgency_hint">False</property>
<property name="has_separator">False</property>
- <property name="border_width">5</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="dialog-vbox6">
@@ -38,11 +38,24 @@
<property name="visible">True</property>
<property name="can_default">True</property>
<property name="can_focus">True</property>
- <property name="label">gtk-close</property>
+ <property name="label">gtk-cancel</property>
+ <property name="use_stock">True</property>
+ <property name="relief">GTK_RELIEF_NORMAL</property>
+ <property name="focus_on_click">True</property>
+ <property name="response_id">-6</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkButton" id="button1">
+ <property name="visible">True</property>
+ <property name="can_default">True</property>
+ <property name="can_focus">True</property>
+ <property name="label">gtk-apply</property>
<property name="use_stock">True</property>
<property name="relief">GTK_RELIEF_NORMAL</property>
<property name="focus_on_click">True</property>
- <property name="response_id">-7</property>
+ <property name="response_id">-10</property>
</widget>
</child>
</widget>
@@ -56,13 +69,13 @@
<child>
<widget class="GtkTable" id="table1">
+ <property name="border_width">5</property>
<property name="visible">True</property>
<property name="n_rows">3</property>
<property name="n_columns">2</property>
<property name="homogeneous">False</property>
<property name="row_spacing">6</property>
<property name="column_spacing">6</property>
- <property name="border_width">5</property>
<child>
<widget class="GtkLabel" id="label471">