[banshee] [Bookmarks] Move into Core



commit a15a237adf8c4e25c27c30a64ca3fede4c697322
Author: Gabriel Burt <gabriel burt gmail com>
Date:   Fri May 14 19:19:04 2010 -0700

    [Bookmarks] Move into Core
    
    Is no longer an extension.  The Bookmarks class (and provider) is in
    Banshee.Services, and the UI is in ThickClient.  This will allow us to
    use the Bookmarks within Audiobooks and elsewhere.

 Banshee.sln                                        |    7 --
 build/build.environment.mk                         |    1 -
 po/POTFILES.in                                     |    4 +-
 .../Banshee.Collection.Database}/Bookmark.cs       |   15 +---
 src/Core/Banshee.Services/Banshee.Services.csproj  |    1 +
 src/Core/Banshee.Services/Makefile.am              |    1 +
 .../Banshee.ThickClient/Banshee.Gui}/BookmarkUI.cs |    6 +-
 .../Banshee.Gui}/BookmarksService.cs               |    3 +-
 .../Banshee.Gui/CommonServices.cs                  |    1 +
 .../Banshee.ThickClient/Banshee.ThickClient.csproj |    2 +
 src/Core/Banshee.ThickClient/Makefile.am           |    2 +
 .../Resources/BookmarksMenu.xml                    |    0
 .../Banshee.Bookmarks/Banshee.Bookmarks.addin.xml  |   22 ----
 .../Banshee.Bookmarks/Banshee.Bookmarks.csproj     |  105 --------------------
 src/Extensions/Banshee.Bookmarks/Makefile.am       |   16 ---
 src/Extensions/Makefile.am                         |    1 -
 16 files changed, 15 insertions(+), 172 deletions(-)
---
diff --git a/Banshee.sln b/Banshee.sln
index b39c422..109b007 100644
--- a/Banshee.sln
+++ b/Banshee.sln
@@ -92,8 +92,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.Wikipedia", "src\Ex
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.NowPlaying", "src\Extensions\Banshee.NowPlaying\Banshee.NowPlaying.csproj", "{16FB0D3A-53FA-4B8E-B02B-4AF66E87829A}"
 EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.Bookmarks", "src\Extensions\Banshee.Bookmarks\Banshee.Bookmarks.csproj", "{0130499B-8A93-4CD9-8F3C-593B231609C7}"
-EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.AudioCd", "src\Extensions\Banshee.AudioCd\Banshee.AudioCd.csproj", "{F38B53BA-8F85-4DC6-9B94-029C1CF96F24}"
 EndProject
 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Banshee.LibraryWatcher", "src\Extensions\Banshee.LibraryWatcher\Banshee.LibraryWatcher.csproj", "{49CA3F27-0BB6-428d-8B3A-20232493652E}"
@@ -159,10 +157,6 @@ Global
 		{0092BF81-ECAB-4D0C-8691-6D19FB7E04A1}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{0092BF81-ECAB-4D0C-8691-6D19FB7E04A1}.Windows|Any CPU.ActiveCfg = Windows|Any CPU
 		{0092BF81-ECAB-4D0C-8691-6D19FB7E04A1}.Windows|Any CPU.Build.0 = Windows|Any CPU
-		{0130499B-8A93-4CD9-8F3C-593B231609C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
-		{0130499B-8A93-4CD9-8F3C-593B231609C7}.Debug|Any CPU.Build.0 = Debug|Any CPU
-		{0130499B-8A93-4CD9-8F3C-593B231609C7}.Windows|Any CPU.ActiveCfg = Windows|Any CPU
-		{0130499B-8A93-4CD9-8F3C-593B231609C7}.Windows|Any CPU.Build.0 = Windows|Any CPU
 		{01818BD5-9A0C-4C89-84FB-08D0E968778F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
 		{01818BD5-9A0C-4C89-84FB-08D0E968778F}.Debug|Any CPU.Build.0 = Debug|Any CPU
 		{01818BD5-9A0C-4C89-84FB-08D0E968778F}.Windows|Any CPU.ActiveCfg = Windows|Any CPU
@@ -428,7 +422,6 @@ Global
 		{02FD8195-9796-4AF5-A9D2-D310721963F4} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{BF5D1722-269B-452E-B577-AEBA0CB894BA} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{16FB0D3A-53FA-4B8E-B02B-4AF66E87829A} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
-		{0130499B-8A93-4CD9-8F3C-593B231609C7} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{F38B53BA-8F85-4DC6-9B94-029C1CF96F24} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{49CA3F27-0BB6-428d-8B3A-20232493652E} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
 		{FCC1AE87-E10B-4B47-8ADE-D5F447E48518} = {4DD1DE63-F20B-4FC3-8FDA-F0BDF4183722}
diff --git a/build/build.environment.mk b/build/build.environment.mk
index 593b3ea..5a607f7 100644
--- a/build/build.environment.mk
+++ b/build/build.environment.mk
@@ -118,7 +118,6 @@ REF_DAP_KARMA = $(LINK_DAP_DEPS) $(LINK_KARMA_DEPS)
 
 # Extensions
 REF_EXTENSION_AUDIOCD = $(LINK_BANSHEE_THICKCLIENT_DEPS) $(LINK_MUSICBRAINZ_DEPS)
-REF_EXTENSION_BOOKMARKS = $(LINK_BANSHEE_THICKCLIENT_DEPS)
 REF_EXTENSION_BOOSCRIPT = $(LINK_BANSHEE_THICKCLIENT_DEPS) $(LINK_BOO)
 REF_EXTENSION_BPM = $(LINK_BANSHEE_THICKCLIENT_DEPS)
 REF_EXTENSION_COVERART = $(LINK_BANSHEE_THICKCLIENT_DEPS)
diff --git a/po/POTFILES.in b/po/POTFILES.in
index e2b637a..37a96cf 100644
--- a/po/POTFILES.in
+++ b/po/POTFILES.in
@@ -37,6 +37,7 @@ src/Core/Banshee.Core/Banshee.Base/FileNamePattern.cs
 src/Core/Banshee.Core/Banshee.Collection/AlbumInfo.cs
 src/Core/Banshee.Core/Banshee.Collection/ArtistInfo.cs
 src/Core/Banshee.Core/Banshee.Collection/TrackInfo.cs
+src/Core/Banshee.Services/Banshee.Collection.Database/Bookmark.cs
 src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumInfo.cs
 src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseAlbumListModel.cs
 src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseArtistInfo.cs
@@ -96,6 +97,7 @@ src/Core/Banshee.ThickClient/Banshee.Collection.Gui/TrackListView.cs
 src/Core/Banshee.ThickClient/Banshee.ContextPane/ContextPane.cs
 src/Core/Banshee.ThickClient/Banshee.Equalizer.Gui/EqualizerWindow.cs
 src/Core/Banshee.ThickClient/Banshee.Gui/BaseClientWindow.cs
+src/Core/Banshee.ThickClient/Banshee.Gui/BookmarkUI.cs
 src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/AboutDialog.cs
 src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/ConfirmShutdownDialog.cs
 src/Core/Banshee.ThickClient/Banshee.Gui.Dialogs/DefaultApplicationHelperDialog.cs
@@ -181,8 +183,6 @@ src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdDiscModel.cs
 src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdRipper.cs
 src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdService.cs
 src/Extensions/Banshee.AudioCd/Banshee.AudioCd/AudioCdSource.cs
-src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks.addin.xml
-src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/BookmarksService.cs
 src/Extensions/Banshee.BooScript/Banshee.BooScript.addin.xml
 src/Extensions/Banshee.Bpm/Banshee.Bpm.addin.xml
 src/Extensions/Banshee.Bpm/Banshee.Bpm/BpmDetectJob.cs
diff --git a/src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/Bookmark.cs b/src/Core/Banshee.Services/Banshee.Collection.Database/Bookmark.cs
similarity index 93%
rename from src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/Bookmark.cs
rename to src/Core/Banshee.Services/Banshee.Collection.Database/Bookmark.cs
index 2a65f6f..914cbd3 100644
--- a/src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/Bookmark.cs
+++ b/src/Core/Banshee.Services/Banshee.Collection.Database/Bookmark.cs
@@ -31,7 +31,6 @@ using System.Data;
 using System.Linq;
 using System.Collections.Generic;
 
-using Gtk;
 using Mono.Unix;
 
 using Hyena;
@@ -39,12 +38,10 @@ using Hyena.Data.Sqlite;
 
 using Banshee.Base;
 using Banshee.Collection;
-using Banshee.Collection.Database;
 using Banshee.MediaEngine;
-using Banshee.Gui;
 using Banshee.ServiceStack;
 
-namespace Banshee.Bookmarks
+namespace Banshee.Collection.Database
 {
     public class Bookmark
     {
@@ -143,15 +140,7 @@ namespace Banshee.Bookmarks
 
         public void Remove ()
         {
-            try {
-                Provider.Delete (this);
-
-                if (BookmarkUI.Instantiated) {
-                    BookmarkUI.Instance.RemoveBookmark (this);
-                }
-            } catch (Exception e) {
-                Log.Exception ("Error Removing Bookmark", e);
-            }
+            Provider.Delete (this);
         }
 
         // Translators: This is used to generate bookmark names. {0} is track title, {1} is minutes
diff --git a/src/Core/Banshee.Services/Banshee.Services.csproj b/src/Core/Banshee.Services/Banshee.Services.csproj
index cc5edea..2636301 100644
--- a/src/Core/Banshee.Services/Banshee.Services.csproj
+++ b/src/Core/Banshee.Services/Banshee.Services.csproj
@@ -90,6 +90,7 @@
   <ItemGroup>
     <Compile Include="Banshee.Database\BansheeDbConnection.cs" />
     <Compile Include="Banshee.Database\BansheeDbFormatMigrator.cs" />
+    <Compile Include="Banshee.Collection.Database\Bookmark.cs" />
     <Compile Include="Banshee.Collection.Database\DatabaseAlbumListModel.cs" />
     <Compile Include="Banshee.Collection.Database\DatabaseArtistListModel.cs" />
     <Compile Include="Banshee.Collection.Database\DatabaseTrackInfo.cs" />
diff --git a/src/Core/Banshee.Services/Makefile.am b/src/Core/Banshee.Services/Makefile.am
index 428adad..89c6189 100644
--- a/src/Core/Banshee.Services/Makefile.am
+++ b/src/Core/Banshee.Services/Makefile.am
@@ -4,6 +4,7 @@ LINK = $(REF_BANSHEE_SERVICES)
 
 SOURCES =  \
 	Banshee.Base/RateLimiter.cs \
+	Banshee.Collection.Database/Bookmark.cs \
 	Banshee.Collection.Database/CachedList.cs \
 	Banshee.Collection.Database/DatabaseAlbumInfo.cs \
 	Banshee.Collection.Database/DatabaseAlbumListModel.cs \
diff --git a/src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/BookmarkUI.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/BookmarkUI.cs
similarity index 98%
rename from src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/BookmarkUI.cs
rename to src/Core/Banshee.ThickClient/Banshee.Gui/BookmarkUI.cs
index e66eafd..c967224 100644
--- a/src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/BookmarkUI.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/BookmarkUI.cs
@@ -39,10 +39,9 @@ using Banshee.Base;
 using Banshee.Collection;
 using Banshee.Collection.Database;
 using Banshee.MediaEngine;
-using Banshee.Gui;
 using Banshee.ServiceStack;
 
-namespace Banshee.Bookmarks
+namespace Banshee.Gui
 {
     public class BookmarkUI
     {
@@ -173,6 +172,7 @@ namespace Banshee.Bookmarks
             rem.Image = new Image (Stock.Remove, IconSize.Menu);
             rem.Activated += delegate {
                 bookmark.Remove ();
+                RemoveBookmark (bookmark);
             };
             remove_menu.Append (rem);
             remove_items[bookmark] = rem;
@@ -181,7 +181,7 @@ namespace Banshee.Bookmarks
             bookmark_menu.ShowAll ();
         }
 
-        public void RemoveBookmark (Bookmark bookmark)
+        private void RemoveBookmark (Bookmark bookmark)
         {
             if (!remove_items.ContainsKey (bookmark))
                 return;
diff --git a/src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/BookmarksService.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/BookmarksService.cs
similarity index 97%
rename from src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/BookmarksService.cs
rename to src/Core/Banshee.ThickClient/Banshee.Gui/BookmarksService.cs
index 25486fd..e28f42b 100644
--- a/src/Extensions/Banshee.Bookmarks/Banshee.Bookmarks/BookmarksService.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/BookmarksService.cs
@@ -39,10 +39,9 @@ using Banshee.Base;
 using Banshee.Collection;
 using Banshee.Collection.Database;
 using Banshee.MediaEngine;
-using Banshee.Gui;
 using Banshee.ServiceStack;
 
-namespace Banshee.Bookmarks
+namespace Banshee.Gui
 {
     public class BookmarksService : IExtensionService, IDisposable
     {
diff --git a/src/Core/Banshee.ThickClient/Banshee.Gui/CommonServices.cs b/src/Core/Banshee.ThickClient/Banshee.Gui/CommonServices.cs
index 6f336b3..238093f 100644
--- a/src/Core/Banshee.ThickClient/Banshee.Gui/CommonServices.cs
+++ b/src/Core/Banshee.ThickClient/Banshee.Gui/CommonServices.cs
@@ -39,6 +39,7 @@ namespace Banshee.Gui
             ServiceManager.RegisterService <Banshee.Gui.GtkElementsService> ();
             ServiceManager.RegisterService <Banshee.Gui.InterfaceActionService> ();
             ServiceManager.RegisterService <Banshee.Collection.Gui.ArtworkManager> ();
+            ServiceManager.RegisterService <Banshee.Gui.BookmarksService> ();
         }
     }
 }
diff --git a/src/Core/Banshee.ThickClient/Banshee.ThickClient.csproj b/src/Core/Banshee.ThickClient/Banshee.ThickClient.csproj
index 618346e..26482ec 100644
--- a/src/Core/Banshee.ThickClient/Banshee.ThickClient.csproj
+++ b/src/Core/Banshee.ThickClient/Banshee.ThickClient.csproj
@@ -150,6 +150,8 @@
     <Compile Include="Banshee.Gui.Widgets\UserJobTile.cs" />
     <Compile Include="Banshee.Gui.Widgets\UserJobTileHost.cs" />
     <Compile Include="Banshee.Gui\CommonServices.cs" />
+    <Compile Include="Banshee.Gui\BookmarksService.cs" />
+    <Compile Include="Banshee.Gui\BookmarkUI.cs" />
     <Compile Include="Banshee.Gui\GtkBaseClient.cs" />
     <Compile Include="Banshee.Gui.Dialogs\SeekDialog.cs" />
     <Compile Include="Banshee.Library.Gui\FileImportSource.cs" />
diff --git a/src/Core/Banshee.ThickClient/Makefile.am b/src/Core/Banshee.ThickClient/Makefile.am
index cf36e00..1f1b999 100644
--- a/src/Core/Banshee.ThickClient/Makefile.am
+++ b/src/Core/Banshee.ThickClient/Makefile.am
@@ -106,6 +106,8 @@ SOURCES =  \
 	Banshee.Gui/BansheeDbFormatMigratorMonitor.cs \
 	Banshee.Gui/BansheeIconFactory.cs \
 	Banshee.Gui/BaseClientWindow.cs \
+	Banshee.Gui/BookmarksService.cs \
+	Banshee.Gui/BookmarkUI.cs \
 	Banshee.Gui/CommonServices.cs \
 	Banshee.Gui/GlobalActions.cs \
 	Banshee.Gui/GtkBaseClient.cs \
diff --git a/src/Extensions/Banshee.Bookmarks/Resources/BookmarksMenu.xml b/src/Core/Banshee.ThickClient/Resources/BookmarksMenu.xml
similarity index 100%
rename from src/Extensions/Banshee.Bookmarks/Resources/BookmarksMenu.xml
rename to src/Core/Banshee.ThickClient/Resources/BookmarksMenu.xml
diff --git a/src/Extensions/Makefile.am b/src/Extensions/Makefile.am
index 23ed398..ceb9e9c 100644
--- a/src/Extensions/Makefile.am
+++ b/src/Extensions/Makefile.am
@@ -1,7 +1,6 @@
 SUBDIRS = \
 	Banshee.Audiobook \
 	Banshee.AudioCd \
-	Banshee.Bookmarks \
 	Banshee.BooScript \
 	Banshee.Bpm \
 	Banshee.CoverArt \



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