banshee r3429 - in trunk/banshee: . build build/m4/banshee src/Backends/Banshee.Gnome src/Backends/Banshee.Gnome/Banshee.Gnome src/Backends/Banshee.Gnome/Banshee.GnomeBackend src/Core/Banshee.Services/Banshee.Collection.Database src/Core/Banshee.Services/Banshee.Web



Author: abock
Date: Wed Mar 12 20:55:01 2008
New Revision: 3429
URL: http://svn.gnome.org/viewvc/banshee?rev=3429&view=rev

Log:
2008-03-12  Aaron Bockover  <abock gnome org>

    * src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GnomeService.cs:
    Added an all-singing, all-dancing GNOME entry service; currently this
    just hooks up Gnome.Url.Show (gnome-open) to Banshee.Web.Browser;
    ideally Process.Start would work properly, but it's got some issues,
    even though it does use xdg-open (which gnome-open should use);
    gnome-open is also a bit more backwards compatible and may be necessary
    on SLED, for instance; phew.

    * src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs:
    Fixed the playback indication for database tracks (BGO #520503)

    * src/Core/Banshee.Services/Banshee.Web/Browser.cs: Implemented an
    OpenHandler to allow extensions to override the default way of opening
    a link in a browser

    * src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs:
    Renamed namespace from Banshee.Gnome to Banshee.GnomeBackend since there
    is a possibility of conflicts with the standard Gnome namespace

    * build/build.rules.mk: Add some rules to filter out duplicate references
    that will be passed to the compiler due to the dependency chain in the
    build environment; makes debugging easier even though the compiler would
    filter this out by itself; also put hard target dependencies on assemblies
    that are referenced in bin/; hopefully will help some occasional build
    problems



Added:
   trunk/banshee/build/m4/banshee/gnome-sharp.m4
   trunk/banshee/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/
      - copied from r3427, /trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome/
   trunk/banshee/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GnomeService.cs
Removed:
   trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome/
Modified:
   trunk/banshee/ChangeLog
   trunk/banshee/build/build.environment.mk
   trunk/banshee/build/build.rules.mk
   trunk/banshee/configure.ac
   trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml
   trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.mdp
   trunk/banshee/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
   trunk/banshee/src/Backends/Banshee.Gnome/Makefile.am
   trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
   trunk/banshee/src/Core/Banshee.Services/Banshee.Web/Browser.cs

Modified: trunk/banshee/build/build.environment.mk
==============================================================================
--- trunk/banshee/build/build.environment.mk	(original)
+++ trunk/banshee/build/build.environment.mk	Wed Mar 12 20:55:01 2008
@@ -17,6 +17,7 @@
 LINK_GLIB = $(GLIBSHARP_LIBS)
 LINK_GTK = $(GTKSHARP_LIBS)
 LINK_GCONF = $(GCONFSHARP_LIBS)
+LINK_GNOME = $(GNOMESHARP_LIBS)
 LINK_DBUS = $(NDESK_DBUS_LIBS)
 LINK_TAGLIB = $(TAGLIB_SHARP_LIBS)
 
@@ -113,7 +114,7 @@
 LINK_DAP_DAPCORE_DEPS = $(REF_DAP_DAPCORE) $(LINK_DAP_DAPCORE)
 
 # Backends
-REF_BACKEND_GNOME = $(LINK_BANSHEE_CORE_DEPS) $(LINK_GCONF)
+REF_BACKEND_GNOME = $(LINK_BANSHEE_SERVICES_DEPS) $(LINK_GCONF) $(LINK_GNOME)
 REF_BACKEND_GSTREAMER = $(LINK_BANSHEE_SERVICES_DEPS) $(LINK_GLIB)
 REF_BACKEND_UNIX = $(LINK_BANSHEE_CORE_DEPS) $(LINK_MONO_POSIX)
 

Modified: trunk/banshee/build/build.rules.mk
==============================================================================
--- trunk/banshee/build/build.rules.mk	(original)
+++ trunk/banshee/build/build.rules.mk	Wed Mar 12 20:55:01 2008
@@ -10,6 +10,10 @@
 
 INSTALL_DIR_RESOLVED = $(firstword $(subst , $(DEFAULT_INSTALL_DIR), $(INSTALL_DIR)))
 
+FILTER_LINK_PIPE = tr [:space:] \\n | sort | uniq
+FILTERED_LINK = $(shell echo "$(LINK)" | $(FILTER_LINK_PIPE))
+DEP_LINK = $(shell echo "$(LINK)" | $(FILTER_LINK_PIPE) | sed s,-r:,,g | grep '$(top_builddir)/bin/')
+
 OUTPUT_FILES = \
 	$(ASSEMBLY_FILE) \
 	$(ASSEMBLY_FILE).mdb
@@ -19,7 +23,10 @@
 
 all: $(ASSEMBLY_FILE)
 
-$(ASSEMBLY_FILE): $(SOURCES_BUILD) $(RESOURCES_EXPANDED)
+build-debug:
+	@echo $(DEP_LINK)
+
+$(ASSEMBLY_FILE): $(SOURCES_BUILD) $(RESOURCES_EXPANDED) $(DEP_LINK)
 	@mkdir -p $(top_builddir)/bin
 	@colors=no; \
 	case $$TERM in \
@@ -33,7 +40,7 @@
 	test "x$$colors" = "xyes" && \
 		echo -e "\033[1mCompiling $(notdir $@)...\033[0m" || \
 		echo "Compiling $(notdir $@)...";
-	@test "x$(HAVE_MONO_1_2_4)" = "xyes" && warn="-warnaserror"; test "x$(HAVE_GTK_2_10)" = "xyes" && gtk_210="-define:HAVE_GTK_2_10"; $(BUILD) -target:$(TARGET) -out:$@ $$warn $$gtk_210 $(LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD)
+	@test "x$(HAVE_MONO_1_2_4)" = "xyes" && warn="-warnaserror"; test "x$(HAVE_GTK_2_10)" = "xyes" && gtk_210="-define:HAVE_GTK_2_10"; $(BUILD) -target:$(TARGET) -out:$@ $$warn $$gtk_210 $(FILTERED_LINK) $(RESOURCES_BUILD) $(SOURCES_BUILD) 
 	@if [ -e $(notdir $  config) ]; then \
 		cp $(notdir $  config) $(top_builddir)/bin; \
 	fi;

Added: trunk/banshee/build/m4/banshee/gnome-sharp.m4
==============================================================================
--- (empty file)
+++ trunk/banshee/build/m4/banshee/gnome-sharp.m4	Wed Mar 12 20:55:01 2008
@@ -0,0 +1,13 @@
+AC_DEFUN([BANSHEE_CHECK_GNOME_SHARP],
+[
+	GNOMESHARP_REQUIRED=2.8
+
+	PKG_CHECK_MODULES(GCONFSHARP,
+		gconf-sharp-2.0 >= $GNOMESHARP_REQUIRED)
+	AC_SUBST(GCONFSHARP_LIBS)
+
+	PKG_CHECK_MODULES(GNOMESHARP,
+		gnome-sharp-2.0 >= $GNOMESHARP_REQUIRED)
+	AC_SUBST(GNOMESHARP_LIBS)
+])
+

Modified: trunk/banshee/configure.ac
==============================================================================
--- trunk/banshee/configure.ac	(original)
+++ trunk/banshee/configure.ac	Wed Mar 12 20:55:01 2008
@@ -74,11 +74,11 @@
 
 dnl Required dependencies (managed/core)
 BANSHEE_CHECK_GTK_SHARP
-PKG_CHECK_MODULES(SQLITE, sqlite3 >= 3.2)
+BANSHEE_CHECK_GNOME_SHARP
+
+PKG_CHECK_MODULES(SQLITE, sqlite3 >= 3.4)
 
 dnl GConf
-PKG_CHECK_MODULES(GCONFSHARP, gconf-sharp-2.0 >= 2.7)
-AC_SUBST(GCONFSHARP_LIBS)
 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
 AM_GCONF_SOURCE_2
 

Modified: trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml
==============================================================================
--- trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml	(original)
+++ trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.addin.xml	Wed Mar 12 20:55:01 2008
@@ -6,17 +6,22 @@
     copyright="Â 2008 Novell Inc. Licensed under the MIT X11 license."
     name="GNOME Providers"
     category="Platform"
-    description="Backend providers for the GNOME platform. Includes GConf and GIO support."
+    description="Backend providers for the GNOME platform. Includes GConf general GNOME integration."
     author="Aaron Bockover"
     url="http://banshee-project.org/";
     defaultEnabled="true">
 
   <Dependencies>
     <Addin id="Banshee.Core" version="1.0"/>
+    <Addin id="Banshee.Services" version="1.0"/>
   </Dependencies>
+  
+  <Extension path="/Banshee/ServiceManager/Service">
+    <Service class="Banshee.GnomeBackend.GnomeService"/>
+  </Extension>
 
   <Extension path="/Banshee/Platform/ConfigurationClient">
-    <ConfigurationClient class="Banshee.Gnome.GConfConfigurationClient"/>
+    <ConfigurationClient class="Banshee.GnomeBackend.GConfConfigurationClient"/>
   </Extension>
 
 </Addin>

Modified: trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.mdp
==============================================================================
--- trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.mdp	(original)
+++ trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome.mdp	Wed Mar 12 20:55:01 2008
@@ -8,14 +8,16 @@
     </Configuration>
   </Configurations>
   <Contents>
+    <File name="Banshee.GnomeBackend/GConfConfigurationClient.cs" subtype="Code" buildaction="Compile" />
+    <File name="Banshee.GnomeBackend/GnomeService.cs" subtype="Code" buildaction="Compile" />
     <File name="Banshee.Gnome.addin.xml" subtype="Code" buildaction="EmbedAsResource" />
-    <File name="Banshee.Gnome/GConfConfigurationClient.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Project" localcopy="True" refto="Banshee.Core" />
     <ProjectReference type="Project" localcopy="True" refto="Banshee.Services" />
     <ProjectReference type="Project" localcopy="True" refto="Hyena" />
     <ProjectReference type="Gac" localcopy="True" refto="System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
+    <ProjectReference type="Gac" localcopy="True" refto="gnome-sharp, Version=2.16.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
   </References>
   <MonoDevelop.Autotools.MakefileInfo IntegrationEnabled="True" RelativeMakefileName="./Makefile.am">
     <BuildFilesVar Sync="True" Name="SOURCES" />

Modified: trunk/banshee/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs
==============================================================================
--- /trunk/banshee/src/Backends/Banshee.Gnome/Banshee.Gnome/GConfConfigurationClient.cs	(original)
+++ trunk/banshee/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GConfConfigurationClient.cs	Wed Mar 12 20:55:01 2008
@@ -35,7 +35,7 @@
 using Banshee.Base;
 using Banshee.Configuration;
 
-namespace Banshee.Gnome
+namespace Banshee.GnomeBackend
 {
     public class GConfConfigurationClient : IConfigurationClient
     {

Added: trunk/banshee/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GnomeService.cs
==============================================================================
--- (empty file)
+++ trunk/banshee/src/Backends/Banshee.Gnome/Banshee.GnomeBackend/GnomeService.cs	Wed Mar 12 20:55:01 2008
@@ -0,0 +1,65 @@
+//
+// GnomeService.cs
+//
+// Author:
+//   Aaron Bockover <abockover novell com>
+//
+// Copyright (C) 2008 Novell, Inc.
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+//
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+
+using Banshee.ServiceStack;
+using Banshee.Web;
+
+namespace Banshee.GnomeBackend
+{
+    public class GnomeService : IExtensionService, IDisposable 
+    {
+        public GnomeService ()
+        {
+        }
+        
+        public void Initialize ()
+        {
+            if (Browser.OpenHandler != null) {
+                Browser.OpenHandler = OpenUrl;
+            }
+        }
+        
+        public void Dispose ()
+        {
+            if (Browser.OpenHandler == OpenUrl) {
+                Browser.OpenHandler = null;
+            }
+        }
+        
+        private bool OpenUrl (string url)
+        {
+            return Gnome.Url.Show (url);;
+        }
+        
+        string IService.ServiceName {
+            get { return "GnomeService"; }
+        }
+    }
+}

Modified: trunk/banshee/src/Backends/Banshee.Gnome/Makefile.am
==============================================================================
--- trunk/banshee/src/Backends/Banshee.Gnome/Makefile.am	(original)
+++ trunk/banshee/src/Backends/Banshee.Gnome/Makefile.am	Wed Mar 12 20:55:01 2008
@@ -3,7 +3,9 @@
 LINK = $(REF_BACKEND_GNOME)
 INSTALL_DIR = $(BACKENDS_INSTALL_DIR)
 
-SOURCES = Banshee.Gnome/GConfConfigurationClient.cs
+SOURCES =  \
+	Banshee.GnomeBackend/GConfConfigurationClient.cs \
+	Banshee.GnomeBackend/GnomeService.cs
 
 RESOURCES = Banshee.Gnome.addin.xml
 

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Collection.Database/DatabaseTrackInfo.cs	Wed Mar 12 20:55:01 2008
@@ -76,17 +76,8 @@
             }
             
             DatabaseTrackInfo db_track = (DatabaseTrackInfo)track;
-            
-            if (db_track.TrackId == TrackId) {
-                /*if (db_track.Source == Source) {
-                    Console.WriteLine ("{0}, {1}", db_track.Source, Source);
-                    return this == db_track;
-                }
-                
-                */ return true;
-            }
-            
-            return false;
+            return db_track.TrackId == TrackId && db_track.CacheModelId == CacheModelId && 
+                db_track.CacheEntryId == CacheEntryId;
         }
         
         public override void Save ()

Modified: trunk/banshee/src/Core/Banshee.Services/Banshee.Web/Browser.cs
==============================================================================
--- trunk/banshee/src/Core/Banshee.Services/Banshee.Web/Browser.cs	(original)
+++ trunk/banshee/src/Core/Banshee.Services/Banshee.Web/Browser.cs	Wed Mar 12 20:55:01 2008
@@ -28,6 +28,7 @@
 //
 
 using System;
+using System.Diagnostics;
 using Mono.Unix;
 
 using Hyena;
@@ -38,19 +39,30 @@
 {
     public class Browser
     {
+        public delegate bool OpenUrlHandler (string uri);
+        
+        private static OpenUrlHandler open_handler = null;
+        public static OpenUrlHandler OpenHandler {
+            get { return open_handler; }
+            set { open_handler = value; }
+        }
+    
         public static bool Open (string url)
         {
             try {
-                System.Diagnostics.Process.Start (
-                    System.Uri.EscapeUriString (url)
-                );
+                url = Uri.EscapeUriString (url);
+                if (open_handler != null) {
+                    return open_handler (url);
+                } else {
+                    Process.Start (url);
+                    return true;
+                }
             } catch(Exception e) {
                 Log.Warning (Catalog.GetString ("Could not launch URL"),
                     String.Format (Catalog.GetString ("{0} could not be opened: {1}\n\n " + 
                         "Check your 'Preferred Applications' settings."), url, e.Message), true);
+                return false;
             }
-            
-            return false;
         }
 
         public static readonly string UserAgent = String.Format ("Banshee {0} (http://banshee-project.org/";, 



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