Re: Request for UI break for Tomboy
- From: Alex Graveley <alex beatniksoftware com>
- To: Vincent Untz <vuntz gnome org>
- Cc: release-team gnome org, gnome-i18n gnome org
- Subject: Re: Request for UI break for Tomboy
- Date: Mon, 04 Sep 2006 00:41:23 -0700
This probably doesn't help things any, but what the hell...
So as per Shaun's suggestion of detecting gtkspell at runtime, attached
is a patch to dynamically enable gtkspell and display the related
preference based on the availability of the library. It is more
dangerous than the previous patch, but is probably what will be
committed in the long term after the freeze.
This also makes the docs situation better as we can note that the option
won't be available until users install gtkspell.
-Alex
Vincent Untz wrote:
Le dimanche 03 septembre 2006, à 23:38, Alex Graveley a écrit :
Uhh sure thing, but this means that GNOME 2.16 will have a hard
dependency on gtkspell via Tomboy. Is this alright?
I prefer the hard dependency (even if it's wrong) than some new bug.
Just my opinion, of course :-)
Vincent
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/tomboy/ChangeLog,v
retrieving revision 1.289
diff -u -b -r1.289 ChangeLog
--- ChangeLog 3 Sep 2006 01:05:56 -0000 1.289
+++ ChangeLog 4 Sep 2006 07:34:14 -0000
@@ -1,3 +1,16 @@
+2006-09-04 Alex Graveley <alex beatniksoftware com>
+
+ * configure.in: Remove hard gtkspell dependency, as it is now
+ detected at runtime.
+
+ * Tomboy/PluginManager.cs: Catch exceptions thrown during plugin
+ creation, such as the one NoteSpellChecker may throw.
+
+ * Tomboy/Preferences.cs: Show spell check option if
+ NoteSpellChecker.GtkSpellAvailable.
+
+ * Tomboy/Watchers.cs: Detect gtkspell availability at runtime.
+
2006-09-02 Brent Smith <gnome nextreality net>
* help/C/figures/tomboy-new-note.png:
Index: configure.in
===================================================================
RCS file: /cvs/gnome/tomboy/configure.in,v
retrieving revision 1.98
diff -u -b -r1.98 configure.in
--- configure.in 31 Aug 2006 17:41:54 -0000 1.98
+++ configure.in 4 Sep 2006 07:34:14 -0000
@@ -81,10 +81,9 @@
AC_SUBST(PANELAPPLET_SERVER_DIR)
#
-# Check for GtkSpell here, as we call into it from C#.
+# Check for recent GtkSpell here. Prior versions require bug workarounds.
# http://gtkspell.sourceforge.net/
#
-PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0)
PKG_CHECK_MODULES(GTKSPELL, gtkspell-2.0 >= 2.0.9, FIXED_GTKSPELL="yes", FIXED_GTKSPELL="no")
AM_CONDITIONAL(FIXED_GTKSPELL, test "$FIXED_GTKSPELL" = "yes")
Index: Tomboy/Watchers.cs
===================================================================
RCS file: /cvs/gnome/tomboy/Tomboy/Watchers.cs,v
retrieving revision 1.50
diff -u -b -r1.50 Watchers.cs
--- Tomboy/Watchers.cs 9 Aug 2006 06:17:11 -0000 1.50
+++ Tomboy/Watchers.cs 4 Sep 2006 07:34:14 -0000
@@ -190,6 +190,9 @@
{
IntPtr obj_ptr = IntPtr.Zero;
+ static bool gtkspell_available_tested;
+ static bool gtkspell_available_result;
+
[DllImport ("libgtkspell")]
static extern IntPtr gtkspell_new_attach (IntPtr text_view,
string locale,
@@ -197,6 +200,39 @@
[DllImport ("libgtkspell")]
static extern void gtkspell_detach (IntPtr obj);
+
+ static bool DetectGtkSpellAvailable()
+ {
+ try {
+ Gtk.TextView test_view = new Gtk.TextView ();
+ IntPtr test_ptr = gtkspell_new_attach (test_view.Handle,
+ null,
+ IntPtr.Zero);
+ if (test_ptr != IntPtr.Zero)
+ gtkspell_detach (test_ptr);
+ return true;
+ } catch (Exception e) {
+ return false;
+ }
+ }
+
+ public static bool GtkSpellAvailable
+ {
+ get {
+ if (!gtkspell_available_tested) {
+ gtkspell_available_result = DetectGtkSpellAvailable ();
+ gtkspell_available_tested = true;
+ }
+ return gtkspell_available_result;
+ }
+ }
+
+ public NoteSpellChecker ()
+ {
+ if (!GtkSpellAvailable) {
+ throw new Exception();
+ }
+ }
protected override void Initialize ()
{
Index: Tomboy/Preferences.cs
===================================================================
RCS file: /cvs/gnome/tomboy/Tomboy/Preferences.cs,v
retrieving revision 1.9
diff -u -b -r1.9 Preferences.cs
--- Tomboy/Preferences.cs 28 Aug 2006 03:14:07 -0000 1.9
+++ Tomboy/Preferences.cs 4 Sep 2006 07:34:14 -0000
@@ -179,18 +179,23 @@
// Spell checking...
- check = MakeCheckButton (Catalog.GetString ("_Spell check while typing"));
+ if (NoteSpellChecker.GtkSpellAvailable) {
+ check = MakeCheckButton (
+ Catalog.GetString ("_Spell check while typing"));
options_list.PackStart (check, false, false, 0);
- peditor = new PropertyEditorToggleButton (Preferences.ENABLE_SPELLCHECKING,
+ peditor = new PropertyEditorToggleButton (
+ Preferences.ENABLE_SPELLCHECKING,
check);
SetupPropertyEditor (peditor);
- label = MakeTipLabel (Catalog.GetString ("Misspellings will be underlined " +
+ label = MakeTipLabel (
+ Catalog.GetString ("Misspellings will be underlined " +
"in red, and correct spelling " +
"suggestions shown in the right-click " +
"menu."));
options_list.PackStart (label, false, false, 0);
+ }
// WikiWords...
@@ -221,7 +226,7 @@
align = new Gtk.Alignment (0.5f, 0.5f, 0.4f, 1.0f);
align.Show ();
- options_list.PackStart (align, true, true, 0);
+ options_list.PackStart (align, false, false, 0);
font_button = MakeFontButton ();
font_button.Sensitive = check.Active;
Index: Tomboy/PluginManager.cs
===================================================================
RCS file: /cvs/gnome/tomboy/Tomboy/PluginManager.cs,v
retrieving revision 1.16
diff -u -b -r1.16 PluginManager.cs
--- Tomboy/PluginManager.cs 27 Jul 2006 08:27:22 -0000 1.16
+++ Tomboy/PluginManager.cs 4 Sep 2006 07:34:15 -0000
@@ -206,10 +206,15 @@
ArrayList note_plugins = new ArrayList ();
foreach (Type type in plugin_types) {
- NotePlugin plugin = (NotePlugin) Activator.CreateInstance (type);
+ try {
+ NotePlugin plugin = (NotePlugin)
+ Activator.CreateInstance (type);
if (plugin != null) {
plugin.Initialize (note);
note_plugins.Add (plugin);
+ }
+ } catch (Exception e) {
+ // Do nothing
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]