Index: configure.in =================================================================== RCS file: /cvs/gnome/beagle/configure.in,v retrieving revision 1.247 diff -u -1 -2 -r1.247 configure.in --- configure.in 31 May 2006 22:22:33 -0000 1.247 +++ configure.in 11 Jun 2006 02:26:42 -0000 @@ -215,24 +215,33 @@ AC_SUBST(LIBTRAYICON_LIBS) fi dnl ---------------------------------------------- dnl "Open With" Menu (Requires GTK 2.8) PKG_CHECK_MODULES(OPEN_WITH, [ gtk-sharp-2.0 >= 2.8 ],OPEN_WITH=yes,OPEN_WITH=no) AM_CONDITIONAL(ENABLE_OPEN_WITH, test "x$OPEN_WITH" != "xno") + +dnl ---------------------------------------------- + +dnl Banshee Import Support + PKG_CHECK_MODULES(BANSHEE_IMPORT, +[ + banshee >= 0.11 +],BANSHEE_IMPORT=yes,BANSHEE_IMPORT=no) +AM_CONDITIONAL(ENABLE_BANSHEE, test "x$BANSHEE_IMPORT" != "xno") dnl ---------------------------------------------- dnl evolution support AC_ARG_ENABLE([evolution], AC_HELP_STRING([--disable-evolution], [Disable evolution support (default auto)]), enable_evo=$enableval, enable_evo_sharp=auto) EVO_SHARP_PREFIX=`$PKG_CONFIG --variable=prefix evolution-sharp` @@ -683,20 +692,21 @@ Mozilla Extension? yes Epiphany Extension? ${enable_epiphany_extension} Local SqliteClient? ${use_local_sqlite} Sqlite version: ${SQLITE_MAJ_VER}.x Enable WebServices no (WebServices are deprecated) Enable libbeagle ${enable_libbeagle} Enable python bindings ${have_python} Enable beagle-search GUI ${enable_gui} Enable \"Open With\" menu ${OPEN_WITH} + Banshee Import ${BANSHEE_IMPORT} " echo if test "x$enable_epiphany_extension" = "xyes"; then echo "NOTE: The Beagle Epiphany Extension Is Totally Insecure!" echo " Use it at your own risk!" echo fi Index: ./search/Makefile.am =================================================================== RCS file: /cvs/gnome/beagle/search/Makefile.am,v retrieving revision 1.17 diff -u -1 -2 -r1.17 Makefile.am --- ./search/Makefile.am 31 May 2006 22:22:34 -0000 1.17 +++ ./search/Makefile.am 11 Jun 2006 02:26:42 -0000 @@ -1,23 +1,27 @@ CSC = mcs -debug CSFLAGS = -target:exe if ENABLE_DESKTOP_LAUNCH CSFLAGS += -define:ENABLE_DESKTOP_LAUNCH endif if ENABLE_OPEN_WITH CSFLAGS += -define:ENABLE_OPEN_WITH endif +if ENABLE_BANSHEE +CSFLAGS += -define:ENABLE_BANSHEE +endif + pkglib_DATA = Search.exe Search.exe.mdb BIN_WRAPPERS = beagle-search beagle-search: beagle-search.in sed -e "s:@pkglibdir@:${pkglibdir}:" < $(srcdir)/beagle-search.in > beagle-search chmod a+x beagle-search CSFILES = \ $(srcdir)/Category.cs \ $(srcdir)/ConversationCategory.cs \ $(srcdir)/Entry.cs \ Index: ./search/Tiles/Audio.cs =================================================================== RCS file: /cvs/gnome/beagle/search/Tiles/Audio.cs,v retrieving revision 1.6 diff -u -1 -2 -r1.6 Audio.cs --- ./search/Tiles/Audio.cs 20 May 2006 15:53:01 -0000 1.6 +++ ./search/Tiles/Audio.cs 11 Jun 2006 02:26:42 -0000 @@ -1,15 +1,17 @@ using System; using Mono.Unix; +using Beagle.Util; + namespace Search.Tiles { public class AudioActivator : TileActivator { public AudioActivator () : base () { AddSupportedFlavor (new HitFlavor (null, "File", "audio/*")); AddSupportedFlavor (new HitFlavor (null, "File", "application/ogg")); // FIXME: What about videos? } public override Tile BuildTile (Beagle.Hit hit, Beagle.Query query) { @@ -23,22 +25,31 @@ { Group = TileGroup.Audio; // FIXME: Show album art if any. Needs implementation in Beagle.Util string title = Hit.GetFirstProperty ("fixme:title"); if (title != null && title != "") Title = title; string artist = Hit.GetFirstProperty ("fixme:artist"); if (artist != null && artist != "") Description = artist; - - //AddAction (new TileAction (Catalog.GetString ("Add to Library"), AddToLibrary)); +#if ENABLE_BANSHEE + AddAction (new TileAction (Catalog.GetString ("Add to Library"), AddToLibrary)); +#endif } // FIXME: Check if Banshee exists and supports this? public void AddToLibrary () { + string path = Hit.FileInfo.FullName; + SafeProcess p = new SafeProcess (); + p.Arguments = new string [] { "banshee-import", path }; + try { + p.Start (); + } catch (Exception e) { + Console.WriteLine ( String.Format ("Cannot import file: {0}", path) ); + } } } }