banshee r3068 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Playlist src/Core/Banshee.Services/Banshee.SmartPlaylist src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Resources
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3068 - in trunk/banshee: . src/Core/Banshee.Services/Banshee.Playlist src/Core/Banshee.Services/Banshee.SmartPlaylist src/Core/Banshee.ThickClient/Banshee.Gui src/Core/Banshee.ThickClient/Resources
- Date: Mon, 28 Jan 2008 21:34:33 +0000 (GMT)
Author: gburt
Date: Mon Jan 28 21:34:33 2008
New Revision: 3068
URL: http://svn.gnome.org/viewvc/banshee?rev=3068&view=rev
Log:
2008-01-28 Gabriel Burt <gabriel burt gmail com>
* src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs:
* src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs:
Implement IUnmapableSource again so Delete Playlist options show up.
* src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs:
* src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml: Add
NewSmartPlaylistFromSearch action. Doesn't yet do anything.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs
trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs
trunk/banshee/src/Core/Banshee.ThickClient/Banshee.Gui/SourceActions.cs
trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Playlist/PlaylistSource.cs Mon Jan 28 21:34:33 2008
@@ -47,7 +47,7 @@
namespace Banshee.Playlist
{
- public class PlaylistSource : AbstractPlaylistSource
+ public class PlaylistSource : AbstractPlaylistSource, IUnmapableSource
{
private static HyenaSqliteCommand add_track_command;
private static HyenaSqliteCommand remove_track_command;
Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs (original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.SmartPlaylist/SmartPlaylistSource.cs Mon Jan 28 21:34:33 2008
@@ -59,7 +59,7 @@
}
}
- public class SmartPlaylistSource : AbstractPlaylistSource
+ public class SmartPlaylistSource : AbstractPlaylistSource, IUnmapableSource
{
private static string generic_name = Catalog.GetString ("Smart Playlist");
private static string properties_label = Catalog.GetString ("Edit Smart Playlist");
@@ -194,6 +194,7 @@
Properties.SetString ("IconName", "source-smart-playlist");
Properties.SetString ("SourcePropertiesActionLabel", properties_label);
+ Properties.SetString ("UnmapSourceActionLabel", Catalog.GetString ("Delete Smart Playlist"));
//Globals.Library.TrackRemoved += OnLibraryTrackRemoved;
@@ -274,6 +275,34 @@
#endregion
+#region IUnmapableSource Implementation
+
+ public bool Unmap ()
+ {
+ if (DbId != null) {
+ ServiceManager.DbConnection.Execute (new HyenaSqliteCommand (@"
+ BEGIN TRANSACTION;
+ DELETE FROM CoreSmartPlaylists WHERE SmartPlaylistID = ?;
+ DELETE FROM CoreSmartPlaylistEntries WHERE SmartPlaylistID = ?;
+ COMMIT TRANSACTION",
+ DbId, DbId
+ ));
+ }
+
+ Remove ();
+ return true;
+ }
+
+ public bool CanUnmap {
+ get { return true; }
+ }
+
+ public bool ConfirmBeforeUnmap {
+ get { return true; }
+ }
+
+#endregion
+
private string PrependCondition (string with)
{
return String.IsNullOrEmpty (ConditionSql) ? " " : String.Format ("{0} ({1})", with, ConditionSql);
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 Mon Jan 28 21:34:33 2008
@@ -64,6 +64,10 @@
Catalog.GetString ("New _Smart Playlist"), null,
Catalog.GetString ("Create a new smart playlist"), OnNewSmartPlaylist),
+ new ActionEntry ("NewSmartPlaylistFromSearchAction", null,
+ Catalog.GetString ("New _Smart Playlist _From Search"), null,
+ Catalog.GetString ("Create a new smart playlist from the current search"), OnNewSmartPlaylistFromSearch),
+
new ActionEntry("SourceContextMenuAction", null,
String.Empty, null, null, OnSourceContextMenu),
@@ -130,6 +134,20 @@
//SourceView.BeginRenameSource (playlist);
}
+ private void OnNewSmartPlaylistFromSearch (object o, EventArgs args)
+ {
+ //Editor ed = new Editor ();
+ //ed.RunDialog ();
+
+ /*Editor ed = new Editor ();
+ ed.SetQueryFromSearch ();
+ ed.RunDialog ();*/
+
+ // TODO should begin editing the name after making it, but this changed
+ // the ActiveSource to the new playlist and we don't want that.
+ //SourceView.BeginRenameSource (playlist);
+ }
+
private void OnSourceContextMenu (object o, EventArgs args)
{
UpdateActions ();
Modified: trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml
==============================================================================
--- trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml (original)
+++ trunk/banshee/src/Core/Banshee.ThickClient/Resources/core-ui-actions-layout.xml Mon Jan 28 21:34:33 2008
@@ -12,6 +12,7 @@
<menu name="MusicMenu" action="MusicMenuAction">
<menuitem name="NewPlaylist" action="NewPlaylistAction" />
<menuitem name="NewSmartPlaylist" action="NewSmartPlaylistAction" />
+ <menuitem name="NewSmartPlaylistFromSearch" action="NewSmartPlaylistFromSearchAction" />
<separator />
<menuitem name="ImportMusic" action="ImportMusicAction" />
<menuitem name="OpenLocation" action="OpenLocationAction" />
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]