[tomboy] Use gtk_show_uri instead of gnome_show_url, and bump required gtk+



commit 6d920974b5db07840a18aa194320f16ca2f755c0
Author: Sandy Armstrong <sanfordarmstrong gmail com>
Date:   Fri Jul 24 10:30:56 2009 -0700

    Use gtk_show_uri instead of gnome_show_url, and bump required gtk+
    version from 2.10 to 2.14. Fixes bug #580422.
    
    Borrow gtk_show_uri binding from gtk-sharp-beans project
    (thanks to Setphane Delcroix for the code).

 Tomboy.mdp                       |    1 +
 Tomboy/GnomeApplication.cs       |    2 +-
 Tomboy/Makefile.am               |    3 +-
 Tomboy/gtk-sharp-beans/Global.cs |   46 ++++++++++++++++++++++++++++++++++++++
 configure.in                     |    2 +-
 5 files changed, 51 insertions(+), 3 deletions(-)
---
diff --git a/Tomboy.mdp b/Tomboy.mdp
index 7247e15..20565d7 100644
--- a/Tomboy.mdp
+++ b/Tomboy.mdp
@@ -184,6 +184,7 @@
     <File name="Tomboy/Addins/WebSyncService/OAuth/Mono.Rocks/Check.cs" subtype="Code" buildaction="Compile" />
     <File name="Tomboy/Addins/WebSyncService/OAuth/Mono.Rocks/IEnumerable.cs" subtype="Code" buildaction="Compile" />
     <File name="Tomboy/Addins/WebSyncService/Api/RootInfo.cs" subtype="Code" buildaction="Compile" />
+    <File name="Tomboy/gtk-sharp-beans/Global.cs" subtype="Code" buildaction="Compile" />
   </Contents>
   <References>
     <ProjectReference type="Gac" localcopy="True" refto="gdk-sharp, Version=2.12.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f" />
diff --git a/Tomboy/GnomeApplication.cs b/Tomboy/GnomeApplication.cs
index 0040f50..5a44c66 100644
--- a/Tomboy/GnomeApplication.cs
+++ b/Tomboy/GnomeApplication.cs
@@ -144,7 +144,7 @@ namespace Tomboy
 		
 		public void OpenUrl (string url)
 		{
-			Gnome.Url.Show (url);
+			GtkBeans.Global.ShowUri (null, url);
 		}
 		
 		public void DisplayHelp (string filename, string link_id, Gdk.Screen screen)
diff --git a/Tomboy/Makefile.am b/Tomboy/Makefile.am
index 5f328d9..16a0a46 100644
--- a/Tomboy/Makefile.am
+++ b/Tomboy/Makefile.am
@@ -49,7 +49,8 @@ GNOME_CSFILES =					\
 	$(srcdir)/GConfPreferencesClient.cs	\
 	$(srcdir)/GnomeApplication.cs		\
 	$(srcdir)/GnomeFactory.cs		\
-	$(srcdir)/XKeybinder.cs
+	$(srcdir)/XKeybinder.cs			\
+	$(srcdir)/gtk-sharp-beans/*.cs
 
 PANELAPPLET_CSFILES =			\
 	$(srcdir)/panelapplet/*.cs
diff --git a/Tomboy/gtk-sharp-beans/Global.cs b/Tomboy/gtk-sharp-beans/Global.cs
new file mode 100644
index 0000000..09e065a
--- /dev/null
+++ b/Tomboy/gtk-sharp-beans/Global.cs
@@ -0,0 +1,46 @@
+// GtkBeans.Global.cs
+//
+// Author(s):
+//      Stephane Delcroix <stephane delcroix org>
+//
+// Copyright (c) 2009 Novell, Inc.
+//
+// This program is free software; you can redistribute it and/or
+// modify it under the terms of version 2 of the Lesser GNU General 
+// Public License as published by the Free Software Foundation.
+//
+// This program is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this program; if not, write to the
+// Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+// Boston, MA 02111-1307, USA.
+
+using System;
+using System.Collections;
+using System.Runtime.InteropServices;
+
+namespace GtkBeans {
+	public static class Global {
+		[DllImport("libgtk-win32-2.0-0.dll")]
+		static extern unsafe bool gtk_show_uri(IntPtr screen, IntPtr uri, uint timestamp, out IntPtr error);
+
+		public static unsafe bool ShowUri(Gdk.Screen screen, string uri, uint timestamp) {
+			IntPtr native_uri = GLib.Marshaller.StringToPtrGStrdup (uri);
+			IntPtr error = IntPtr.Zero;
+			bool raw_ret = gtk_show_uri(screen == null ? IntPtr.Zero : screen.Handle, native_uri, timestamp, out error);
+			bool ret = raw_ret;
+			GLib.Marshaller.Free (native_uri);
+			if (error != IntPtr.Zero) throw new GLib.GException (error);
+			return ret;
+		}
+
+		public static bool ShowUri (Gdk.Screen screen, string uri)
+		{
+			return ShowUri (screen, uri, Gdk.EventHelper.GetTime (new Gdk.Event(IntPtr.Zero)));
+		}
+	}
+}
diff --git a/configure.in b/configure.in
index fec57a9..0c631df 100644
--- a/configure.in
+++ b/configure.in
@@ -50,7 +50,7 @@ PKG_CHECK_MODULES(MONO, mono >= $MONO_MINIMUM_VERSION)
 # Gdk and Atk are needed for libtrayicon
 #
 GDK20_MINIMUM_VERSION=2.6.0
-GTK20_MINIMUM_VERSION=2.10.0
+GTK20_MINIMUM_VERSION=2.14.0
 ATK_MINIMUM_VERSION=1.2.4
 
 PKG_CHECK_MODULES(LIBTOMBOY, 



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