banshee r4038 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient/Banshee.Gui src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r4038 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Sources src/Core/Banshee.ThickClient/Banshee.Gui src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data
- Date: Fri, 30 May 2008 07:20:47 +0000 (UTC)
Author: gburt
Date: Fri May 30 07:20:47 2008
New Revision: 4038
URL: http://svn.gnome.org/viewvc/banshee?rev=4038&view=rev
Log:
2008-05-30 Gabriel Burt <gabriel burt gmail com>
* src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs: Add property
defining whether we support playlists or not.
* src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs:
For now, at least, we don't support playlists.
* src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs:
Show the Add to Play Queue option if the source is a db source, not just
if it's a library source.
* src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs:
* src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs: Hide
playlist-related actions unless the primary source SupportsPlaylists.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Sources/PrimarySource.cs Fri May 30 07:20:47 2008
@@ -118,6 +118,12 @@
}
}
+ private bool supports_playlists = true;
+ public bool SupportsPlaylists {
+ get { return supports_playlists; }
+ protected set { supports_playlists = value; }
+ }
+
public ErrorSource ErrorSource {
get {
if (error_source == null) {
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs Fri May 30 07:20:47 2008
@@ -326,12 +326,17 @@
IUnmapableSource unmapable = source as IUnmapableSource;
IImportSource import_source = source as IImportSource;
SmartPlaylistSource smart_playlist = source as SmartPlaylistSource;
+ PrimarySource primary_source = source as PrimarySource ?? source.Parent as PrimarySource;
+
UpdateAction ("UnmapSourceAction", unmapable != null, unmapable != null && unmapable.CanUnmap, source);
UpdateAction ("RenameSourceAction", source.CanRename, true, null);
UpdateAction ("ImportSourceAction", import_source != null, import_source != null && import_source.CanImport, source);
UpdateAction ("ExportPlaylistAction", source is AbstractPlaylistSource, true, source);
UpdateAction ("SourcePropertiesAction", source.HasProperties, true, source);
UpdateAction ("RefreshSmartPlaylistAction", smart_playlist != null && smart_playlist.CanRefresh, true, source);
+
+ UpdateAction ("NewPlaylistAction", primary_source != null && primary_source.SupportsPlaylists, true, source);
+ UpdateAction ("NewSmartPlaylistAction", primary_source != null && primary_source.SupportsPlaylists, true, source);
/*UpdateAction ("NewSmartPlaylistFromSearchAction", (source is LibrarySource || source.Parent is LibrarySource),
!String.IsNullOrEmpty (source.FilterQuery), source);*/
last_source = source;
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/TrackActions.cs Fri May 30 07:20:47 2008
@@ -200,6 +200,7 @@
{
Source source = ServiceManager.SourceManager.ActiveSource;
bool in_database = source is DatabaseSource;
+ PrimarySource primary_source = source as PrimarySource ?? source.Parent as PrimarySource;
Hyena.Collections.Selection selection = (source is ITrackModelSource) ? (source as ITrackModelSource).TrackModel.Selection : null;
@@ -226,7 +227,8 @@
UpdateAction ("TrackPropertiesAction", in_database, has_selection, null);
UpdateAction ("RateTracksAction", in_database, has_selection, null);
- UpdateAction ("AddToPlaylistAction", in_database, has_selection, null);
+
+ UpdateAction ("AddToPlaylistAction", in_database && primary_source != null && primary_source.SupportsPlaylists, has_selection, null);
}
}
}
Modified: trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.PlayQueue/Banshee.PlayQueue/PlayQueueSource.cs Fri May 30 07:20:47 2008
@@ -222,10 +222,10 @@
}
Source source = ServiceManager.SourceManager.ActiveSource;
- bool in_library = (source != null && source.Parent is LibrarySource) || source is LibrarySource;
+ bool in_db = (source != null && source.Parent is DatabaseSource) || source is DatabaseSource;
uia_service.GlobalActions.UpdateAction ("ClearPlayQueueAction", true, Count > 0);
- uia_service.TrackActions.UpdateAction ("AddToPlayQueueAction", in_library, true);
+ uia_service.TrackActions.UpdateAction ("AddToPlayQueueAction", in_db, true);
}
void IBasicPlaybackController.First ()
Modified: trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs
==============================================================================
--- trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs (original)
+++ trunk/banshee/src/Extensions/Banshee.Podcasting/Banshee.Podcasting.Data/PodcastSource.cs Fri May 30 07:20:47 2008
@@ -96,6 +96,9 @@
{
this.baseDirectory = baseDirectory;
+ // For now..
+ SupportsPlaylists = false;
+
Properties.SetString ("Icon.Name", "podcast");
Properties.SetString ("ActiveSourceUIResource", "ActiveSourceUI.xml");
Properties.SetString ("GtkActionPath", "/PodcastSourcePopup");
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]