[baobab/import-export: 8/9] Add a 'close window' action



commit 3489081b8bc8709325ba3831717f560cd1c7851c
Author: Stefano Facchini <stefano facchini gmail com>
Date:   Sun Sep 9 16:05:21 2012 +0200

    Add a 'close window' action

 src/baobab-main-window.ui |    7 +++++++
 src/baobab-window.vala    |    7 ++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/baobab-main-window.ui b/src/baobab-main-window.ui
index 61b584b..29da6af 100644
--- a/src/baobab-main-window.ui
+++ b/src/baobab-main-window.ui
@@ -435,5 +435,12 @@
         <attribute name="accel">&lt;Primary&gt;s</attribute>
       </item>
     </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Close</attribute>
+        <attribute name="action">win.close</attribute>
+        <attribute name="accel">&lt;Primary&gt;w</attribute>
+      </item>
+    </section>
   </menu>
 </interface>
diff --git a/src/baobab-window.vala b/src/baobab-window.vala
index a6c8a7d..6f868e6 100644
--- a/src/baobab-window.vala
+++ b/src/baobab-window.vala
@@ -63,7 +63,8 @@ namespace Baobab {
             { "save-report", on_save_report },
             { "load-report", on_load_report },
             { "help", on_help_activate },
-            { "about", on_about_activate }
+            { "about", on_about_activate },
+            { "close", on_close_activate }
         };
 
         protected struct ActionState {
@@ -376,6 +377,10 @@ namespace Baobab {
                                    null);
         }
 
+        void on_close_activate () {
+            this.destroy ();
+        }
+
         void on_chart_item_activated (Chart chart, Gtk.TreeIter iter) {
             var path = active_location.scanner.get_path (iter);
 



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