Index: src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconPlugin.cs
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconPlugin.cs,v
retrieving revision 1.5
diff -u -r1.5 NotificationAreaIconPlugin.cs
--- src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconPlugin.cs	14 Apr 2006 15:47:34 -0000	1.5
+++ src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconPlugin.cs	17 Apr 2006 18:17:52 -0000
@@ -39,6 +39,7 @@
 using Banshee.Base;
 using Banshee.MediaEngine;
 using Banshee.Widgets;
+using Banshee.Sources;
 using Mono.Unix;
 
 namespace Banshee.Plugins.NotificationAreaIcon {
@@ -66,6 +67,8 @@
         private EventBox event_box;
         private NotificationArea notif_area;
         private Menu menu;
+        private MenuItem rating_menu_item = null;
+        private ActionGroup actions;
         private uint ui_manager_id;
 
         private TrackInfoPopup popup;
@@ -78,11 +81,12 @@
         protected override void PluginInitialize() {
             Init();
 
-            ui_manager_id = Globals.ActionManager.UI.AddUiFromResource("NotificationAreaIconMenu.xml");        
-            menu = (Menu) Globals.ActionManager.UI.GetWidget("/NotificationAreaIconMenu");
-            menu.ShowAll();
-        
-            popup = new TrackInfoPopup();
+            ui_manager_id = Globals.ActionManager.UI.AddUiFromResource("NotificationAreaIconMenu.xml");
+
+            InstallInterfaceActions();
+            SetupRatingMenu();
+
+	    popup = new TrackInfoPopup();
             PlayerEngineCore.EventChanged += OnPlayerEngineEventChanged;
 
             // When we're already playing fill the TrackInfoPopup with the current track
@@ -99,6 +103,8 @@
             }
             PlayerEngineCore.EventChanged -= OnPlayerEngineEventChanged;
             Globals.ActionManager.UI.RemoveUi(ui_manager_id);
+            Globals.ActionManager.UI.RemoveActionGroup(actions);
+            actions = null;
         }
 
         protected override void InterfaceInitialize() {
@@ -121,6 +127,56 @@
             notif_area.ShowAll();
         }
 
+	private void InstallInterfaceActions()
+        {
+            actions = new ActionGroup("NotificationAreaIcon");
+            
+            actions.Add(new ActionEntry [] {
+            new ActionEntry("NotificationAreaIconRate", null,
+                    Catalog.GetString("Rating"), null,
+                    Catalog.GetString("Set rating for currently playing song"), null),
+            });
+            
+            Globals.ActionManager.UI.InsertActionGroup(actions, 0);
+
+        }
+
+	private void SetupRatingMenu() {
+            menu = (Menu) Globals.ActionManager.UI.GetWidget("/NotificationAreaIconMenu");
+	    rating_menu_item = Globals.ActionManager.GetWidget("/NotificationAreaIconMenu/Rating") as MenuItem;
+	
+            //fixme: duplicate code from PlayerInterface.cs
+            Menu ratingMenu = new Menu();
+            MenuItem clearItem = new MenuItem(Catalog.GetString("Clear"));
+            clearItem.Name = "0";
+            clearItem.Activated += OnItemRatingActivated;
+            
+            ratingMenu.Append(clearItem);
+            ratingMenu.Append(new SeparatorMenuItem());
+             
+            for(int i = 0; i < 5; i++) {
+            	MenuItem item = new MenuItem();
+                HBox box = new HBox();
+                box.Spacing = 3;
+                
+               for(int j = 0; j < i + 1; j++) {
+                   box.PackStart(new Gtk.Image(Gdk.Pixbuf.LoadFromResource("star.png")), false, false, 0);
+               }
+                
+                item.Add(box);
+                item.Name = String.Format("{0}", i + 1);
+                item.Activated += OnItemRatingActivated;
+                ratingMenu.Append(item);
+            }
+            
+            rating_menu_item.Submenu = ratingMenu;
+
+            menu.ShowAll();
+            ratingMenu.ShowAll();
+
+            ToggleRatingMenuSensitive();
+	}
+
         private void OnDestroyEvent(object o, DestroyEventArgs args) {
             Init();
         }
@@ -153,6 +209,20 @@
             }
         }
 
+        private void OnItemRatingActivated(object o, EventArgs args)
+        {
+            uint rating = Convert.ToUInt32((o as Widget).Name);
+            PlayerEngineCore.CurrentTrack.Rating = rating;
+        }
+
+        private void ToggleRatingMenuSensitive() {
+            if (PlayerEngineCore.CurrentTrack != null && (SourceManager.ActiveSource is LibrarySource || SourceManager.ActiveSource is PlaylistSource)) {
+                Globals.ActionManager["NotificationAreaIconRate"].Sensitive = true;
+            } else {
+                Globals.ActionManager["NotificationAreaIconRate"].Sensitive = false;
+            }
+        }
+
         private void PositionMenu(Menu menu, out int x, out int y, out bool push_in) {
             PositionWidget(menu, out x, out y, 0);
             push_in = true;
@@ -251,6 +321,7 @@
                     break;
                 case PlayerEngineEvent.StartOfStream:
                     FillPopup();
+                    ToggleRatingMenuSensitive();
                     break;
                 case PlayerEngineEvent.EndOfStream:
                     // only hide the popup when we don't play again after 250ms
@@ -260,6 +331,8 @@
                             popup.Position = 0;
                             can_show_popup = false;
                             popup.Hide();
+
+                            ToggleRatingMenuSensitive();
                          }
                          return false;
                     });
Index: src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconMenu.xml
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconMenu.xml,v
retrieving revision 1.1
diff -u -r1.1 NotificationAreaIconMenu.xml
--- src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconMenu.xml	13 Mar 2006 06:17:00 -0000	1.1
+++ src/Banshee.Plugins/NotificationAreaIcon/NotificationAreaIconMenu.xml	17 Apr 2006 18:17:52 -0000
@@ -3,6 +3,8 @@
         <menuitem name="PlayPause" action="PlayPauseAction" />
         <menuitem name="Previous" action="PreviousAction" />
         <menuitem name="Next" action="NextAction" />
+        <separator />
+        <menuitem name="Rating" action="NotificationAreaIconRate" />
         <!--<separator />
         <menuitem name="RepeatNone" action="RepeatNoneAction" />
         <menuitem name="RepeatAll" action="RepeatAllAction" />
Index: src/Banshee.Plugins/NotificationAreaIcon/Makefile.am
===================================================================
RCS file: /cvs/gnome/banshee/src/Banshee.Plugins/NotificationAreaIcon/Makefile.am,v
retrieving revision 1.2
diff -u -r1.2 Makefile.am
--- src/Banshee.Plugins/NotificationAreaIcon/Makefile.am	15 Mar 2006 17:43:42 -0000	1.2
+++ src/Banshee.Plugins/NotificationAreaIcon/Makefile.am	17 Apr 2006 18:17:52 -0000
@@ -22,9 +22,9 @@
 @INTLTOOL_SCHEMAS_RULE@
 
 $(ASSEMBLY): $(ASSEMBLY_SOURCES) $(MENU_RESOURCE)
-	$(MCS) $(MCS_FLAGS) -target:library  -out:$@ $(ASSEMBLY_SOURCES) -r:$(top_builddir)/src/Banshee.Base/Banshee.Base.dll -r:$(top_builddir)/src/Banshee.Widgets/Banshee.Widgets.dll $(PKG_REFERENCES) -resource:$(srcdir)/$(MENU_RESOURCE),$(MENU_RESOURCE)
+	$(MCS) $(MCS_FLAGS) -target:library  -out:$@ $(ASSEMBLY_SOURCES) -r:$(top_builddir)/src/Banshee.Base/Banshee.Base.dll -r:$(top_builddir)/src/Banshee.Widgets/Banshee.Widgets.dll $(PKG_REFERENCES) -resource:$(srcdir)/$(MENU_RESOURCE),$(MENU_RESOURCE) -resource:$(top_builddir)/data/images/star.png,star.png
 
-EXTRA_DIST = $(ASSEMBLY_SOURCES) $(ASSEMBLY).config.in $(schema_in_files) $(MENU_RESOURCE)
+EXTRA_DIST = $(ASSEMBLY_SOURCES) $(ASSEMBLY).config.in $(schema_in_files) $(MENU_RESOURCE) star.png
 
 CLEANFILES = $(ASSEMBLY) *.dll *.exe
 DISTCLEANFILES = *.mdb $(schema_DATA)
