[empathy] ft-manager: add a 'Close' button (#646084)



commit ceb451e3260ee114562f9f31324d1cd2206ba971
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date:   Thu Apr 7 13:11:30 2011 +0200

    ft-manager: add a 'Close' button (#646084)

 src/empathy-ft-manager.c  |    9 ++++++++-
 src/empathy-ft-manager.ui |   13 +++++++++++++
 2 files changed, 21 insertions(+), 1 deletions(-)
---
diff --git a/src/empathy-ft-manager.c b/src/empathy-ft-manager.c
index 3ef95db..edb470c 100644
--- a/src/empathy-ft-manager.c
+++ b/src/empathy-ft-manager.c
@@ -71,7 +71,8 @@ enum
 {
   RESPONSE_OPEN  = 1,
   RESPONSE_STOP  = 2,
-  RESPONSE_CLEAR = 3
+  RESPONSE_CLEAR = 3,
+  RESPONSE_CLOSE = 4
 };
 
 G_DEFINE_TYPE (EmpathyFTManager, empathy_ft_manager, G_TYPE_OBJECT);
@@ -894,6 +895,8 @@ ft_manager_response_cb (GtkWidget *widget,
                         gint response,
                         EmpathyFTManager *manager)
 {
+  EmpathyFTManagerPriv *priv = GET_PRIV (manager);
+
   switch (response)
     {
       case RESPONSE_CLEAR:
@@ -905,6 +908,10 @@ ft_manager_response_cb (GtkWidget *widget,
       case RESPONSE_STOP:
         ft_manager_stop (manager);
         break;
+      case RESPONSE_CLOSE:
+        if (!close_window (manager))
+          gtk_widget_destroy (priv->window);
+        break;
       case GTK_RESPONSE_NONE:
       case GTK_RESPONSE_DELETE_EVENT:
         /* Do nothing */
diff --git a/src/empathy-ft-manager.ui b/src/empathy-ft-manager.ui
index c21e56b..803d010 100644
--- a/src/empathy-ft-manager.ui
+++ b/src/empathy-ft-manager.ui
@@ -73,6 +73,18 @@
                 <property name="position">2</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkButton" id="close_button">
+                <property name="visible">True</property>
+                <property name="can_focus">True</property>
+                <property name="can_default">True</property>
+                <property name="label">gtk-close</property>
+                <property name="use_stock">True</property>
+              </object>
+              <packing>
+                <property name="position">3</property>
+              </packing>
+            </child>
           </object>
           <packing>
             <property name="expand">False</property>
@@ -85,6 +97,7 @@
       <action-widget response="3">clear_button</action-widget>
       <action-widget response="1">open_button</action-widget>
       <action-widget response="2">abort_button</action-widget>
+      <action-widget response="4">close_button</action-widget>
     </action-widgets>
   </object>
 </interface>



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