[baobab/import-export] Add a 'close window' action
- From: Stefano Facchini <sfacchini src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [baobab/import-export] Add a 'close window' action
- Date: Sun, 9 Sep 2012 14:11:37 +0000 (UTC)
commit e84901a1673eb3b122f044211e2ce15cf27d3da6
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 ce59e91..2b74c35 100644
--- a/src/baobab-main-window.ui
+++ b/src/baobab-main-window.ui
@@ -437,5 +437,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 c4d3d43..4ee88c3 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]