[banshee/better-now-playing] [NowPlaying] Only show buttons when in the now playing source
- From: Alex Launi <alexlauni src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee/better-now-playing] [NowPlaying] Only show buttons when in the now playing source
- Date: Fri, 28 May 2010 16:49:29 +0000 (UTC)
commit 0d1254ce99c570b7b4f5048a95bfeb2f535e8397
Author: Alex Launi <alex launi gmail com>
Date: Mon May 24 20:55:06 2010 -0400
[NowPlaying] Only show buttons when in the now playing source
Only show the context buttons when the Now Playing source is
the active source. Set Visible to false when not so.
.../Banshee.NowPlaying/NowPlayingSource.cs | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs
index 562b4b0..5a9e0cc 100644
--- a/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs
+++ b/src/Extensions/Banshee.NowPlaying/Banshee.NowPlaying/NowPlayingSource.cs
@@ -66,6 +66,7 @@ namespace Banshee.NowPlaying
Properties.SetString ("ActiveSourceUIResource", "ActiveSourceUI.xml");
ServiceManager.SourceManager.AddSource (this);
+ ServiceManager.SourceManager.ActiveSourceChanged += OnActiveSourceChanged;
ServiceManager.PlaybackController.Transition += OnPlaybackControllerTransition;
ServiceManager.PlaybackController.TrackStarted += OnPlaybackControllerTrackStarted;
@@ -73,6 +74,7 @@ namespace Banshee.NowPlaying
ServiceManager.PlayerEngine.ConnectEvent (OnCreateVideoWindow, PlayerEvent.PrepareVideoWindow);
Actions = new Actions ();
+ Actions.Visible = ServiceManager.SourceManager.ActiveSource == this;
ui_manager = ((InterfaceActionService) ServiceManager.Get<InterfaceActionService> ()).UIManager;
ui_manager.AddUiFromString (string.Format (button_xml, "StandardNpOpen"));
@@ -80,6 +82,11 @@ namespace Banshee.NowPlaying
ui_manager.AddUiFromString (string.Format (button_xml, "WikipediaOpen"));
}
+ void OnActiveSourceChanged (SourceEventArgs args)
+ {
+ Actions.Visible = args.Source == this;
+ }
+
private void OnCreateVideoWindow (PlayerEventArgs args)
{
ServiceManager.PlayerEngine.DisconnectEvent (OnCreateVideoWindow);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]