[banshee] Convert Banshee.Wikipedia to Banshee.WebBrowser
- From: Aaron Bockover <abock src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] Convert Banshee.Wikipedia to Banshee.WebBrowser
- Date: Fri, 9 Jul 2010 23:24:01 +0000 (UTC)
commit bdb3bcae5eef973a9cd402ecd43de8154b21d84a
Author: Aaron Bockover <abockover novell com>
Date: Fri Jul 9 19:23:57 2010 -0400
Convert Banshee.Wikipedia to Banshee.WebBrowser
Ossifer for the win.
build/build.environment.mk | 2 +-
build/m4/banshee/webkit.m4 | 13 -------------
configure.ac | 1 -
.../Banshee.WebBrowser/OssiferWebView.cs | 7 +++++++
.../Banshee.Wikipedia/Banshee.Wikipedia.csproj | 18 +++++++++---------
.../Banshee.Wikipedia/ContextPage.cs | 2 +-
.../Banshee.Wikipedia/WikipediaView.cs | 11 +++++------
src/Extensions/Banshee.Wikipedia/Makefile.am | 4 ++--
8 files changed, 25 insertions(+), 33 deletions(-)
---
diff --git a/build/build.environment.mk b/build/build.environment.mk
index d34c57e..82c1082 100644
--- a/build/build.environment.mk
+++ b/build/build.environment.mk
@@ -22,7 +22,6 @@ LINK_DBUS_NO_GLIB = $(NDESK_DBUS_LIBS)
LINK_TAGLIB = $(TAGLIB_SHARP_LIBS)
LINK_IPOD = $(IPODSHARP_LIBS)
LINK_BOO = $(BOO_LIBS)
-LINK_WEBKIT = $(WEBKIT_LIBS)
LINK_GDATA = $(GDATASHARP_LIBS)
LINK_MONOTORRENT_DBUS = $(MONOTORRENT_DBUS_LIBS)
LINK_MONO_ADDINS_DEPS = $(MONO_ADDINS_LIBS)
@@ -156,6 +155,7 @@ REF_EXTENSION_PODCASTING = $(LINK_MIGO_DEPS) $(LINK_BANSHEE_THICKCLIENT_DEPS)
REF_EXTENSION_AUDIOBOOK = $(LINK_BANSHEE_THICKCLIENT_DEPS)
REF_EXTENSION_SAMPLE = $(LINK_BANSHEE_THICKCLIENT_DEPS)
REF_EXTENSION_REMOTE_AUDIO = $(LINK_BANSHEE_THICKCLIENT_DEPS) $(LINK_MONO_ZEROCONF)
+REF_EXTENSION_WIKIPEDIA= $(LINK_BANSHEE_WEBBROWSER_DEPS)
# Backends
REF_BACKEND_GIO = $(LINK_BANSHEE_SERVICES_DEPS) $(LINK_GIO)
diff --git a/configure.ac b/configure.ac
index 47cab46..4d20a06 100644
--- a/configure.ac
+++ b/configure.ac
@@ -116,7 +116,6 @@ dnl Monodoc (optional through --disable-docs)
SHAMROCK_CHECK_MONODOC
dnl webkit (optional through --disable-webkit)
-BANSHEE_CHECK_WEBKIT
BANSHEE_CHECK_LIBWEBKIT
dnl gdata (optional through --disable-youtube)
diff --git a/src/Core/Banshee.WebBrowser/Banshee.WebBrowser/OssiferWebView.cs b/src/Core/Banshee.WebBrowser/Banshee.WebBrowser/OssiferWebView.cs
index 584ff65..b47b08f 100644
--- a/src/Core/Banshee.WebBrowser/Banshee.WebBrowser/OssiferWebView.cs
+++ b/src/Core/Banshee.WebBrowser/Banshee.WebBrowser/OssiferWebView.cs
@@ -49,6 +49,9 @@ namespace Banshee.WebBrowser
private Callbacks callbacks;
+ // FIXME: provide more complete events here to match the protected virtuals
+ public event EventHandler DocumentLoadFinished;
+
[DllImport (LIBOSSIFER)]
private static extern IntPtr ossifer_web_view_get_type ();
@@ -113,6 +116,10 @@ namespace Banshee.WebBrowser
protected virtual void OnDocumentLoadFinished (string uri)
{
+ var handler = DocumentLoadFinished;
+ if (handler != null) {
+ handler (this, EventArgs.Empty);
+ }
}
private void HandleDownloadStatusChanged (IntPtr ossifer, OssiferDownloadStatus status, IntPtr destinationUri)
diff --git a/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia.csproj b/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia.csproj
index 783e620..a4221fb 100644
--- a/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia.csproj
+++ b/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia.csproj
@@ -39,26 +39,26 @@
<Project>{B28354F0-BA87-44E8-989F-B864A3C7C09F}</Project>
<Name>Banshee.Services</Name>
</ProjectReference>
- <ProjectReference Include="..\..\..\hyena\src\Hyena.Data.Sqlite\Hyena.Data.Sqlite.csproj">
+ <ProjectReference Include="..\..\Core\Banshee.ThickClient\Banshee.ThickClient.csproj">
+ <Project>{AC839523-7BDF-4AB6-8115-E17921B96EC6}</Project>
+ <Name>Banshee.ThickClient</Name>
+ </ProjectReference>
+ <ProjectReference Include="..\..\Hyena\Hyena.Data.Sqlite\Hyena.Data.Sqlite.csproj">
<Project>{95374549-9553-4C1E-9D89-667755F90E13}</Project>
<Name>Hyena.Data.Sqlite</Name>
<Private>False</Private>
</ProjectReference>
- <ProjectReference Include="..\..\..\hyena\src\Hyena\Hyena.csproj">
+ <ProjectReference Include="..\..\Hyena\Hyena\Hyena.csproj">
<Project>{95374549-9553-4C1E-9D89-667755F90E12}</Project>
<Name>Hyena</Name>
</ProjectReference>
- <ProjectReference Include="..\..\Core\Banshee.ThickClient\Banshee.ThickClient.csproj">
- <Project>{AC839523-7BDF-4AB6-8115-E17921B96EC6}</Project>
- <Name>Banshee.ThickClient</Name>
+ <ProjectReference Include="..\..\Core\Banshee.WebBrowser\Banshee.WebBrowser.csproj">
+ <Project>{E7660EC3-6CBD-4809-93ED-B4B88E65D3D3}</Project>
+ <Name>Banshee.WebBrowser</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Reference Include="System" />
- <Reference Include="webkit-sharp">
- <SpecificVersion>False</SpecificVersion>
- <HintPath>..\..\..bin\webkit-sharp.dll</HintPath>
- </Reference>
<Reference Include="Mono.Posix">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..bin\Mono.Posix.dll</HintPath>
diff --git a/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/ContextPage.cs b/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/ContextPage.cs
index eda92e2..701873c 100644
--- a/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/ContextPage.cs
+++ b/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/ContextPage.cs
@@ -57,7 +57,7 @@ namespace Banshee.Wikipedia
get {
if (view == null) {
view = new WikipediaView ();
- view.view.LoadFinished += delegate { State = ContextState.Loaded; };
+ view.view.DocumentLoadFinished += delegate { State = ContextState.Loaded; };
view.ShowAll ();
}
return view;
diff --git a/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/WikipediaView.cs b/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/WikipediaView.cs
index 38ef651..82ec80e 100644
--- a/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/WikipediaView.cs
+++ b/src/Extensions/Banshee.Wikipedia/Banshee.Wikipedia/WikipediaView.cs
@@ -30,8 +30,6 @@ using System;
using Mono.Unix;
using Gtk;
-using WebKit;
-
using Hyena;
using Banshee.ServiceStack;
@@ -40,6 +38,8 @@ using Banshee.Collection;
using Banshee.Gui;
+using Banshee.WebBrowser;
+
namespace Banshee.Wikipedia
{
public class WikipediaView : Gtk.ScrolledWindow, IDisableKeybindings
@@ -47,11 +47,11 @@ namespace Banshee.Wikipedia
// Translators: this is used for looking up artist pages on Wikipedia; change to your wikipedia language if you want
private string url_format = Catalog.GetString ("http://en.wikipedia.org/wiki/{0}");
- internal WebKit.WebView view;
+ internal OssiferWebView view;
public WikipediaView ()
{
- view = new WebView ();
+ view = new OssiferWebView ();
Add (view);
}
@@ -75,8 +75,7 @@ namespace Banshee.Wikipedia
private void OpenUrl (string uri)
{
Hyena.Log.DebugFormat ("Opening {0}", uri);
- //Open (uri);
- view.ExecuteScript (String.Format ("document.location = \"{0}\";", uri));
+ view.LoadUri (uri);
}
}
}
diff --git a/src/Extensions/Banshee.Wikipedia/Makefile.am b/src/Extensions/Banshee.Wikipedia/Makefile.am
index ef706e7..0ee4d6a 100644
--- a/src/Extensions/Banshee.Wikipedia/Makefile.am
+++ b/src/Extensions/Banshee.Wikipedia/Makefile.am
@@ -1,6 +1,6 @@
ASSEMBLY = Banshee.Wikipedia
TARGET = library
-LINK = $(LINK_BANSHEE_THICKCLIENT_DEPS) $(LINK_WEBKIT)
+LINK = $(REF_EXTENSION_WIKIPEDIA)
INSTALL_DIR = $(EXTENSIONS_INSTALL_DIR)
SOURCES = \
@@ -9,7 +9,7 @@ SOURCES = \
RESOURCES = Banshee.Wikipedia.addin.xml
-if HAVE_WEBKIT
+if HAVE_LIBWEBKIT
include $(top_srcdir)/build/build.mk
else
EXTRA_DIST = $(SOURCES) $(RESOURCES) $(shell find $(srcdir)/ThemeIcons -type f)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]