banshee r3278 - in trunk/banshee: . src/Clients/Nereid/Nereid src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Banshee.Gui.Widgets src/Extensions/Banshee.NotificationArea src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea src/Extensions/Banshee.NotificationArea/Notifications



Author: abock
Date: Wed Feb 20 00:50:22 2008
New Revision: 3278
URL: http://svn.gnome.org/viewvc/banshee?rev=3278&view=rev

Log:
2008-02-19  Aaron Bockover  <abock gnome org>

    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs:
    Ported the show/hide TrackInfoPopup/tooltip when the mouse cursor is over
    the notification area icon

    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs:
    Ported the TrackInfoPopup/tooltip to use the new TrackInfoDisplay

    * src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs:
    Implemented proper managed resource disposing and set the current track
    on size allocation

    * src/Clients/Nereid/Nereid/PlayerInterface.cs: Set the title of the window
    to the track information

    * src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs: Added
    a TitleChanged event and an UpdateTitle abstract method

    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs:
    Set the tooltip to the primary window's title, track it when it changes

    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/INotificationAreaBox.cs:
    * src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs:
    Added a proxy method for player engine events

    * src/Extensions/Banshee.NotificationArea/Notifications/Notification.cs:
    Do not crash when Widget is null



Added:
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
   trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea.mdp
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/INotificationAreaBox.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am
   trunk/banshee/src/Extensions/Banshee.NotificationArea/Notifications/Notification.cs

Modified: trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs
==============================================================================
--- trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	(original)
+++ trunk/banshee/src/Clients/Nereid/Nereid/PlayerInterface.cs	Wed Feb 20 00:50:22 2008
@@ -29,6 +29,7 @@
 
 using System;
 using System.Collections.Generic;
+using Mono.Unix;
 using Gtk;
 
 using Hyena.Gui;
@@ -66,7 +67,7 @@
         private ObjectListSourceContents object_view;
         private Label status_label;
         
-        public PlayerInterface () : base ("Banshee Music Player")
+        public PlayerInterface () : base (Catalog.GetString ("Banshee Media Player"))
         {
         }
         
@@ -84,6 +85,21 @@
             Show ();
         }
         
+        protected override void UpdateTitle ()
+        {
+            TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;
+            if (track != null) {
+                // Translators: this is the window title when a track is playing
+                //              {0} is the track title, {1} is the artist name
+                Title = String.Format (Catalog.GetString ("{0} ({1})"), 
+                    track.DisplayTrackTitle, track.DisplayArtistName);
+            } else {
+                Title = Catalog.GetString ("Banshee Media Player");
+            }
+            
+            OnTitleChanged ();
+        }
+        
 #region System Overrides 
         
         public override void Dispose ()
@@ -222,7 +238,8 @@
         {
             // Service events
             ServiceManager.SourceManager.ActiveSourceChanged += OnActiveSourceChanged;
-
+            ServiceManager.PlayerEngine.EventChanged += OnPlayerEngineEventChanged;
+            
             ActionService.TrackActions ["SearchForSameArtistAction"].Activated += OnProgrammaticSearch;
             ActionService.TrackActions ["SearchForSameAlbumAction"].Activated += OnProgrammaticSearch;
 
@@ -304,6 +321,17 @@
             view_container.SearchEntry.Ready = true;
         }
         
+        private void OnPlayerEngineEventChanged (object o, PlayerEngineEventArgs args) 
+        {
+            switch (args.Event) {
+                case PlayerEngineEvent.StartOfStream:
+                case PlayerEngineEvent.TrackInfoUpdated:
+                case PlayerEngineEvent.EndOfStream:
+                    UpdateTitle ();
+                    break;
+            }
+        }
+        
 #endregion
 
 #region UI Event Handlers

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui.Widgets/TrackInfoDisplay.cs	Wed Feb 20 00:50:22 2008
@@ -67,6 +67,10 @@
         private bool in_popup;
         private bool in_thumbnail_region;
         
+        protected TrackInfoDisplay (IntPtr native) : base (native)
+        {
+        }
+        
         public TrackInfoDisplay ()
         {
             stage.Iteration += OnStageIteration;
@@ -77,6 +81,15 @@
             
             ServiceManager.PlayerEngine.EventChanged += OnPlayerEngineEventChanged;
         }
+        
+        public override void Dispose ()
+        {
+            ServiceManager.PlayerEngine.EventChanged -= OnPlayerEngineEventChanged;
+            stage.Iteration -= OnStageIteration;
+            HidePopup ();
+            
+            base.Dispose ();
+        }
 
 #region Widget Window Management
         
@@ -129,6 +142,10 @@
                 GdkWindow.MoveResize (allocation);
             }
             
+            if (current_track == null) {
+                LoadCurrentTrack ();
+            }
+            
             QueueDraw ();
         }
         
@@ -216,6 +233,10 @@
         
         protected override bool OnExposeEvent (Gdk.EventExpose evnt)
         {
+            if (!Visible) {
+                return true;
+            }
+        
             Cairo.Context cr = Gdk.CairoHelper.Create (evnt.Window);
         
             foreach (Gdk.Rectangle rect in evnt.Region.GetRectangles ()) {
@@ -364,31 +385,37 @@
         private void OnPlayerEngineEventChanged (object o, PlayerEngineEventArgs args)
         {
             if (args.Event == PlayerEngineEvent.StartOfStream || args.Event == PlayerEngineEvent.TrackInfoUpdated) {
-                TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;
-                
-                if (track == current_track) {
-                    return;
-                } else if (track == null) {
-                    incoming_track = null;
-                    incoming_pixbuf = null;
-                    return;
-                }
-                
-                incoming_track = track;
-                
-                Gdk.Pixbuf pixbuf = artwork_manager.LookupScale (track.ArtistAlbumId, Allocation.Height);
-                if (pixbuf == null) {
-                    if (missing_pixbuf == null) {
-                        missing_pixbuf = IconThemeUtils.LoadIcon (32, "audio-x-generic");
-                    }
-                    incoming_pixbuf = missing_pixbuf;
-                } else {
-                    incoming_pixbuf = pixbuf;
-                }
-                
-                if (stage.Actor == null) {
-                    stage.Reset ();
+                LoadCurrentTrack ();
+            }
+        }
+        
+        private void LoadCurrentTrack ()
+        {
+            TrackInfo track = ServiceManager.PlayerEngine.CurrentTrack;
+
+            if (track == current_track) {
+                return;
+            } else if (track == null) {
+                incoming_track = null;
+                incoming_pixbuf = null;
+                return;
+            }
+
+            incoming_track = track;
+
+            Gdk.Pixbuf pixbuf = artwork_manager.LookupScale (track.ArtistAlbumId, Allocation.Height);
+            
+            if (pixbuf == null) {
+                if (missing_pixbuf == null) {
+                    missing_pixbuf = IconThemeUtils.LoadIcon (32, "audio-x-generic");
                 }
+                incoming_pixbuf = missing_pixbuf;
+            } else {
+                incoming_pixbuf = pixbuf;
+            }
+            
+            if (stage.Actor == null) {
+                stage.Reset ();
             }
         }
         

Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs	(original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs	Wed Feb 20 00:50:22 2008
@@ -45,6 +45,8 @@
         protected InterfaceActionService ActionService {
             get { return action_service; }
         }
+        
+        public event EventHandler TitleChanged;
     
         public BaseClientWindow (string title) : base (title)
         {
@@ -166,6 +168,16 @@
             return base.OnWindowStateEvent (evnt);
         }
         
+        protected virtual void OnTitleChanged ()
+        {
+            EventHandler handler = TitleChanged;
+            if (handler != null) {
+                handler (this, EventArgs.Empty);
+            }
+        }
+        
+        protected abstract void UpdateTitle ();
+        
         public static readonly SchemaEntry<int> WidthSchema = new SchemaEntry<int>(
             "player_window", "width",
             1024,

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea.mdp
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea.mdp	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea.mdp	Wed Feb 20 00:50:22 2008
@@ -17,6 +17,7 @@
     <File name="Banshee.NotificationArea/GtkNotificationAreaBox.cs" subtype="Code" buildaction="Compile" />
     <File name="Notifications/Notification.cs" subtype="Code" buildaction="Compile" />
     <File name="Notifications/Notifications.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.NotificationArea/TrackInfoPopup.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="True" refto="Banshee.Core" />

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/GtkNotificationAreaBox.cs	Wed Feb 20 00:50:22 2008
@@ -31,6 +31,8 @@
 using Gtk;
 
 using Banshee.Gui;
+using Banshee.ServiceStack;
+using Banshee.MediaEngine;
 
 namespace Banshee.NotificationArea
 {
@@ -52,14 +54,21 @@
             get { return null; }
         }
         
-        public GtkNotificationAreaBox ()
+        public GtkNotificationAreaBox (BaseClientWindow window)
         {
             IconName = "music-player-banshee";
+            
+            Tooltip = window.Title;
+            window.TitleChanged += delegate { Tooltip = window.Title; };
         }
         
         public void PositionMenu (Menu menu, out int x, out int y, out bool push_in)
         {
             StatusIcon.PositionMenu (menu, out x, out y, out push_in, Handle);
         }
+        
+        public void PlayerEngineEventChanged (PlayerEngineEventArgs args)
+        {
+        }
     }
 }

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/INotificationAreaBox.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/INotificationAreaBox.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/INotificationAreaBox.cs	Wed Feb 20 00:50:22 2008
@@ -29,6 +29,8 @@
 using System;
 using Gtk;
 
+using Banshee.MediaEngine;
+
 namespace Banshee.NotificationArea
 {
     public interface INotificationAreaBox : IDisposable
@@ -38,6 +40,7 @@
         event PopupMenuHandler PopupMenuEvent;
         
         void PositionMenu (Menu menu, out int x, out int y, out bool push_in);
+        void PlayerEngineEventChanged (PlayerEngineEventArgs args);
         
         Widget Widget { get; }
     }

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs	Wed Feb 20 00:50:22 2008
@@ -142,6 +142,10 @@
         
         public void Dispose ()
         {
+            if (current_nf != null) {
+                current_nf.Close ();
+            }
+                
             if (notif_area != null) {
                 notif_area.Dispose ();
                 notif_area = null;
@@ -168,7 +172,7 @@
             }
             
             if (notif_area == null) {
-                notif_area = new GtkNotificationAreaBox ();
+                notif_area = new GtkNotificationAreaBox (elements_service.PrimaryWindow);
             }
             
             notif_area.Disconnected += OnNotificationAreaDisconnected;
@@ -272,6 +276,8 @@
                     ToggleRatingMenuSensitive ();
                     break;
             }
+            
+            notif_area.PlayerEngineEventChanged (args);
         }
         
         private void OnItemRatingActivated (object o, EventArgs args)

Added: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/TrackInfoPopup.cs	Wed Feb 20 00:50:22 2008
@@ -0,0 +1,75 @@
+//
+// TrackInfoPopup.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2005-2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+using System;
+using Gtk;
+
+using Banshee.Base;
+using Banshee.Gui.Widgets;
+using Banshee.Widgets;
+using Banshee.ServiceStack;
+using Banshee.Gui;
+using Hyena;
+
+namespace Banshee.NotificationArea
+{
+    public class TrackInfoPopup : Gtk.Window
+    {
+        private uint position;
+        private uint duration;
+        private TrackInfoDisplay header;
+        private HBox header_box = new HBox ();
+    
+        public TrackInfoPopup () : base (Gtk.WindowType.Popup)
+        {
+            BorderWidth = 4;
+            AppPaintable = true;
+            Resizable = false;
+            
+            header = new TrackInfoDisplay ();
+            header.SetSizeRequest (300, 46);
+            header_box.PackStart (header, true, true, 0);
+            header.Show ();
+            
+            Add (header_box);
+            header_box.Show ();
+        }
+        
+        public override void Dispose ()
+        {
+            header.Dispose ();
+            base.Dispose ();
+        }
+        
+        protected override bool OnExposeEvent(Gdk.EventExpose evnt)
+        {
+            Gtk.Style.PaintFlatBox (Style, GdkWindow, StateType.Normal, ShadowType.Out, evnt.Area, this, "tooltip", 
+                0, 0, Allocation.Width, Allocation.Height);
+            return base.OnExposeEvent (evnt);
+        }
+    }
+}

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/X11NotificationAreaBox.cs	Wed Feb 20 00:50:22 2008
@@ -43,6 +43,10 @@
         private EventBox event_box;
         private Image image;
         
+        private TrackInfoPopup popup;
+        private bool can_show_popup = false;
+        private bool cursor_over_trayicon = false;
+        
         public event EventHandler Disconnected;
         public event EventHandler Activated;
         public event PopupMenuHandler PopupMenuEvent;
@@ -90,6 +94,46 @@
             return on_bottom;
         }
         
+        private void HidePopup () 
+        {
+            if (popup == null) {
+                return;
+            }
+            
+            popup.Hide ();
+            popup.Dispose ();
+            popup = null;
+        }
+        
+        private void ShowPopup () 
+        {
+            if (popup != null) {
+                return;
+            }
+            
+            popup = new TrackInfoPopup ();
+            PositionPopup ();
+            popup.Show ();
+        }
+        
+        private void PositionPopup () 
+        {
+            int x, y;
+            Gtk.Requisition event_box_req = event_box.SizeRequest ();
+            Gtk.Requisition popup_req = popup.SizeRequest ();
+            
+            PositionWidget (popup, out x, out y, 5);
+            
+            x = x - (popup_req.Width / 2) + (event_box_req.Width / 2);     
+            if (x + popup_req.Width >= event_box.Screen.Width) { 
+                x = event_box.Screen.Width - popup_req.Width - 5;
+            } else if (x < 5) {
+                x = 5;
+            }
+            
+            popup.Move (x, y);
+        }
+        
         private void OnButtonPressEvent (object o, ButtonPressEventArgs args)
         {
             if (args.Event.Type != Gdk.EventType.ButtonPress) {
@@ -148,62 +192,43 @@
         
         private void OnEnterNotifyEvent(object o, EnterNotifyEventArgs args) 
         {
-            /*cursor_over_trayicon = true;
-            if(can_show_popup) {
+            cursor_over_trayicon = true;
+            if (can_show_popup) {
                 // only show the popup when the cursor is still over the
                 // tray icon after 500ms
-                GLib.Timeout.Add(500, delegate {
-                    if ((cursor_over_trayicon) && (can_show_popup)) {
-                        ShowPopup();
+                GLib.Timeout.Add (500, delegate {
+                    if (cursor_over_trayicon && can_show_popup) {
+                        ShowPopup ();
                     }
                     return false;
                 });
-            }*/
+            }
         }
         
         private void OnLeaveNotifyEvent(object o, LeaveNotifyEventArgs args) 
         {
-            // cursor_over_trayicon = false;
-            // HidePopup();
+            cursor_over_trayicon = false;
+            HidePopup ();
         }
         
-        private void OnPlayerEngineEventChanged (object o, PlayerEngineEventArgs args) 
+        public void PlayerEngineEventChanged (PlayerEngineEventArgs args) 
         {
-            /*switch (args.Event) {
-                case PlayerEngineEvent.Iterate:
-                    if(PlayerEngineCore.CurrentTrack != null) {
-                        popup.Duration = (uint)PlayerEngineCore.CurrentTrack.Duration.TotalSeconds;
-                        popup.Position = PlayerEngineCore.Position;
-
-                        if (current_track != PlayerEngineCore.CurrentTrack) {
-                            current_track = PlayerEngineCore.CurrentTrack;
-                            ShowNotification();
-                        }
-                    } else {
-                        popup.Duration = 0;
-                        popup.Position = 0;
-                    }
-                    break;
+            switch (args.Event) {
                 case PlayerEngineEvent.StartOfStream:
-                case PlayerEngineEvent.TrackInfoUpdated:
-                    ToggleRatingMenuSensitive();
-                    FillPopup();
-                    ShowNotification();
+                    can_show_popup = true;
                     break;
+                    
                 case PlayerEngineEvent.EndOfStream:
                     // only hide the popup when we don't play again after 250ms
-                    GLib.Timeout.Add(250, delegate {
-                        if (PlayerEngineCore.CurrentState != PlayerEngineState.Playing) {
-                            ToggleRatingMenuSensitive();
-                            popup.Duration = 0;
-                            popup.Position = 0;
+                    GLib.Timeout.Add (250, delegate {
+                        if (ServiceManager.PlayerEngine.CurrentState != PlayerEngineState.Playing) {
                             can_show_popup = false;
-                            popup.Hide();
+                            HidePopup ();
                          }
                          return false;
                     });
                     break;
-            }*/
+            }
         }
         
         protected virtual void OnActivated ()
@@ -233,76 +258,5 @@
             
             return result;
         }
-        
-        /*
-        private TrackInfoPopup popup;
-        private bool can_show_popup = false;
-        private bool cursor_over_trayicon = false;
-
-
-        private void HidePopup() 
-        {
-            popup.Hide();
-        }
-        
-        private void ShowPopup() 
-        {
-            PositionPopup();
-            popup.Show();
-        }
-        
-        private void PositionPopup() 
-        {
-            int x, y;
-            Gtk.Requisition event_box_req = event_box.SizeRequest();
-            Gtk.Requisition popup_req = popup.SizeRequest();
-            
-            PositionWidget(popup, out x, out y, 5);
-            
-            x = x - (popup_req.Width / 2) + (event_box_req.Width / 2);     
-            if(x + popup_req.Width >= event_box.Screen.Width) { 
-                x = event_box.Screen.Width - popup_req.Width - 5;
-            } else if(x < 5) {
-                x = 5;
-            }
-            
-            popup.Move(x, y);
-        }
-
-        private void FillPopup() 
-        {
-            can_show_popup = true;
-            popup.Artist = PlayerEngineCore.CurrentTrack.DisplayArtistName;
-            popup.Album = PlayerEngineCore.CurrentTrack.AlbumTitle;
-            popup.TrackTitle = PlayerEngineCore.CurrentTrack.DisplayTrackTitle;
-            try {
-                popup.CoverArtFileName = PlayerEngineCore.CurrentTrack.CoverArtFileName;
-            } catch {
-            }
-            popup.QueueDraw();
-            if (!popup.Visible) {
-                PositionPopup();
-            }
-        }
-        
-        /*
-                protected override void InterfaceInitialize() 
-        {
-
-            
-            popup = new TrackInfoPopup();
-            PlayerEngineCore.EventChanged += OnPlayerEngineEventChanged;
-
-            // When we're already playing fill the TrackInfoPopup with the current track
-            if (PlayerEngineCore.CurrentState == PlayerEngineState.Playing) {
-                FillPopup();
-            }
-
-            // Forcefully load this value
-            show_notifications = ShowNotifications;
-            elements_service.MainWindow.KeyPressEvent += OnKeyPressEvent;
-        }
-        
-        */
     }
 }

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Makefile.am	Wed Feb 20 00:50:22 2008
@@ -6,6 +6,7 @@
 	Banshee.NotificationArea/GtkNotificationAreaBox.cs \
 	Banshee.NotificationArea/INotificationAreaBox.cs \
 	Banshee.NotificationArea/NotificationAreaService.cs \
+	Banshee.NotificationArea/TrackInfoPopup.cs \
 	Banshee.NotificationArea/X11NotificationArea.cs \
 	Banshee.NotificationArea/X11NotificationAreaBox.cs \
 	Notifications/Notification.cs \

Modified: trunk/banshee/src/Extensions/Banshee.NotificationArea/Notifications/Notification.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.NotificationArea/Notifications/Notification.cs	(original)
+++ trunk/banshee/src/Extensions/Banshee.NotificationArea/Notifications/Notification.cs	Wed Feb 20 00:50:22 2008
@@ -213,6 +213,10 @@
 
 		public void AttachToWidget (Gtk.Widget widget) {
 			int x, y;
+			
+			if (widget == null) {
+			    return;
+			}
 
 			widget.GdkWindow.GetOrigin (out x, out y);
 



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