[gitg/vala] Added close window menu item
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gitg/vala] Added close window menu item
- Date: Wed, 18 Jul 2012 15:39:45 +0000 (UTC)
commit f409e4c2a2c9603e4face1984493cc76cc0c6bfb
Author: Jesse van den Kieboom <jesse vandenkieboom epfl ch>
Date: Wed Jul 18 17:38:14 2012 +0200
Added close window menu item
gitg/gitg-application.vala | 11 +++++++++++
gitg/resources/ui/gitg-menus.ui | 7 +++++++
2 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/gitg/gitg-application.vala b/gitg/gitg-application.vala
index 8bdd0d0..0dc1a3a 100644
--- a/gitg/gitg-application.vala
+++ b/gitg/gitg-application.vala
@@ -221,6 +221,16 @@ public class Application : Gtk.Application
}
}
+ private void on_win_close_activated()
+ {
+ unowned List<Gtk.Window> wnds = get_windows();
+
+ if (wnds != null)
+ {
+ wnds.data.destroy();
+ }
+ }
+
private void on_preferences_activated()
{
unowned List<Gtk.Window> wnds = get_windows();
@@ -252,6 +262,7 @@ public class Application : Gtk.Application
{"help", on_app_help_activated},
{"about", on_app_about_activated},
{"quit", on_app_quit_activated},
+ {"winclose", on_win_close_activated},
{"preferences", on_preferences_activated}
};
diff --git a/gitg/resources/ui/gitg-menus.ui b/gitg/resources/ui/gitg-menus.ui
index 4cd366a..febe4a3 100644
--- a/gitg/resources/ui/gitg-menus.ui
+++ b/gitg/resources/ui/gitg-menus.ui
@@ -35,5 +35,12 @@
</section>
</menu>
<menu id="win-menu">
+ <section>
+ <item>
+ <attribute name="label" translatable="yes">_Close</attribute>
+ <attribute name="action">app.winclose</attribute>
+ <attribute name="accel"><Primary>w</attribute>
+ </item>
+ </section>
</menu>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]