diff options
author | Stefano Facchini <stefano.facchini@gmail.com> | 2012-09-09 16:05:21 +0200 |
---|---|---|
committer | Stefano Facchini <stefano.facchini@gmail.com> | 2012-09-11 18:54:38 +0200 |
commit | 3489081b8bc8709325ba3831717f560cd1c7851c (patch) | |
tree | eb71348e4e24eea4094c54d6513ab03998bfc91a | |
parent | b99b0850e97451eccb46a7ccb4d945b5ff1dd1fd (diff) | |
download | baobab-3489081b8bc8709325ba3831717f560cd1c7851c.tar.gz |
Add a 'close window' action
-rw-r--r-- | src/baobab-main-window.ui | 7 | ||||
-rw-r--r-- | 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"><Primary>s</attribute> </item> </section> + <section> + <item> + <attribute name="label" translatable="yes">_Close</attribute> + <attribute name="action">win.close</attribute> + <attribute name="accel"><Primary>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); |