[banshee] NotificationArea: update actions when pausing too (bgo#733515)
- From: Andrés Aragoneses <aaragoneses src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] NotificationArea: update actions when pausing too (bgo#733515)
- Date: Tue, 22 Jul 2014 00:27:21 +0000 (UTC)
commit 0b1474846079f120438563b229994f0789c4077e
Author: Samuel Gyger <samuel gyger at>
Date: Tue Jul 22 02:17:57 2014 +0200
NotificationArea: update actions when pausing too (bgo#733515)
Signed-off-by: Andrés G. Aragoneses <knocte gmail com>
.../NotificationAreaService.cs | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
index dc6c0f0..3e47a55 100644
--- a/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
+++ b/src/Extensions/Banshee.NotificationArea/Banshee.NotificationArea/NotificationAreaService.cs
@@ -388,6 +388,9 @@ namespace Banshee.NotificationArea
ToggleRatingMenuSensitive ();
ShowTrackNotification ();
break;
+ case PlayerEvent.StateChange:
+ UpdateActions ();
+ break;
case PlayerEvent.EndOfStream:
current_track = null;
ToggleRatingMenuSensitive ();
@@ -491,8 +494,6 @@ namespace Banshee.NotificationArea
current_nf.Urgency = Urgency.Low;
current_nf.Timeout = 4500;
- UpdateActions ();
-
if (image == null) {
current_nf.RemoveHint ("image-path");
} else {
@@ -511,7 +512,13 @@ namespace Banshee.NotificationArea
private void UpdateActions ()
{
- if (!current_track.IsLive && ActionsSupported &&
interface_action_service.PlaybackActions["NextAction"].Sensitive) {
+ if (!ActionsSupported || current_nf == null || current_track == null) {
+ return;
+ }
+
+ if (!current_track.IsLive && interface_action_service.PlaybackActions["NextAction"].Sensitive) {
+ current_nf.ClearActions ();
+
if (ActionIconsSupported) {
current_nf.AddHint ("action-icons", true);
@@ -519,7 +526,7 @@ namespace Banshee.NotificationArea
current_nf.AddAction ("media-skip-backward",
Catalog.GetString("Previous"), OnPreviousTrack);
- bool is_playing = ServiceManager.PlayerEngine.IsPlaying ();
+ bool is_playing = ServiceManager.PlayerEngine.IsPlaying () &&
ServiceManager.PlayerEngine.CurrentState != PlayerState.Paused;
current_nf.AddAction (is_playing ? "media-playback-pause" : "media-playback-start",
interface_action_service.PlaybackActions["PlayPauseAction"].Label,
OnPlayPause);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]