empathy r583 - trunk/libempathy-gtk



Author: xclaesse
Date: Sun Jan 20 00:04:43 2008
New Revision: 583
URL: http://svn.gnome.org/viewvc/empathy?rev=583&view=rev

Log:
Add a cancel button on the custom message diaog


Modified:
   trunk/libempathy-gtk/empathy-presence-chooser.c
   trunk/libempathy-gtk/empathy-presence-chooser.glade

Modified: trunk/libempathy-gtk/empathy-presence-chooser.c
==============================================================================
--- trunk/libempathy-gtk/empathy-presence-chooser.c	(original)
+++ trunk/libempathy-gtk/empathy-presence-chooser.c	Sun Jan 20 00:04:43 2008
@@ -901,16 +901,27 @@
 }
 
 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));
+
+		presence_chooser_set_state (state, text);
+	}
 
-	state = presence_chooser_dialog_get_selected (dialog);
-	text = gtk_entry_get_text (GTK_ENTRY (dialog->entry_message));
+	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 @@
 	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);

Modified: trunk/libempathy-gtk/empathy-presence-chooser.glade
==============================================================================
--- trunk/libempathy-gtk/empathy-presence-chooser.glade	(original)
+++ trunk/libempathy-gtk/empathy-presence-chooser.glade	Sun Jan 20 00:04:43 2008
@@ -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">



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]