]> git.0d.be Git - empathy.git/commitdiff
ft-manager: add a 'Close' button (#646084)
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 7 Apr 2011 11:11:30 +0000 (13:11 +0200)
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Thu, 7 Apr 2011 12:07:20 +0000 (14:07 +0200)
src/empathy-ft-manager.c
src/empathy-ft-manager.ui

index 3ef95db4aca5f7ca365d63b5e58fa6fa3b94ae78..edb470cbbbec3c3e0494675aed453a5291133f7d 100644 (file)
@@ -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 */
index c21e56bd94623cddf9a64223d9862e8cbd217008..803d010bc61bd933c60ea1eaf1bd5851d3b7c37d 100644 (file)
                 <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>