[banshee] SoundMenu: Add menu item for Close action



commit 249b8bd4ab7587a75a27379c588b65d05499e220
Author: Bertrand Lorentz <bertrand lorentz gmail com>
Date:   Mon Jan 10 22:04:41 2011 +0100

    SoundMenu: Add menu item for Close action
    
    The Media > Close menu item was supposed to be available, but the UI was
    never added.

 .../Banshee.SoundMenu/SoundMenuService.cs          |   14 +++++++++++++-
 1 files changed, 13 insertions(+), 1 deletions(-)
---
diff --git a/src/Extensions/Banshee.SoundMenu/Banshee.SoundMenu/SoundMenuService.cs b/src/Extensions/Banshee.SoundMenu/Banshee.SoundMenu/SoundMenuService.cs
index cae9b52..5d9c2db 100644
--- a/src/Extensions/Banshee.SoundMenu/Banshee.SoundMenu/SoundMenuService.cs
+++ b/src/Extensions/Banshee.SoundMenu/Banshee.SoundMenu/SoundMenuService.cs
@@ -59,6 +59,7 @@ namespace Banshee.SoundMenu
         private string notify_last_artist;
         private string notify_last_title;
         private Server server;
+        private uint ui_manager_id;
 
         private const int icon_size = 42;
 
@@ -111,7 +112,17 @@ namespace Banshee.SoundMenu
                     Catalog.GetString ("_Close"), "<Control>W",
                     Catalog.GetString ("Close"), CloseWindow)
             });
-
+            ui_manager_id = interface_action_service.UIManager.AddUiFromString (@"
+              <ui>
+                <menubar name=""MainMenu"">
+                  <menu name=""MediaMenu"" action=""MediaMenuAction"">
+                    <placeholder name=""ClosePlaceholder"">
+                    <menuitem name=""Close"" action=""CloseAction""/>
+                    </placeholder>
+                  </menu>
+                </menubar>
+              </ui>
+            ");
 
             InstallPreferences ();
             server = Server.RefDefault ();
@@ -149,6 +160,7 @@ namespace Banshee.SoundMenu
 
             elements_service.PrimaryWindowClose = null;
 
+            interface_action_service.UIManager.RemoveUi (ui_manager_id);
             Gtk.Action close_action = interface_action_service.GlobalActions["CloseAction"];
             if (close_action != null) {
                 interface_action_service.GlobalActions.Remove (close_action);



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