After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 613523 - Added autocorrection exceptions are not immediately shown
Added autocorrection exceptions are not immediately shown
Status: RESOLVED FIXED
Product: Gnumeric
Classification: Applications
Component: GUI
git master
Other Linux
: Normal normal
: ---
Assigned To: Andreas J. Guelzow
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2010-03-21 20:31 UTC by Konstantin Tokarev
Modified: 2010-03-25 12:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
first patch (6.83 KB, patch)
2010-03-23 22:07 UTC, Andreas J. Guelzow
needs-work Details | Review
improved patch (6.86 KB, patch)
2010-03-23 22:39 UTC, Andreas J. Guelzow
committed Details | Review
Patch for notification (6.60 KB, patch)
2010-03-24 18:59 UTC, Morten Welinder
none Details | Review

Description Konstantin Tokarev 2010-03-21 20:31:06 UTC
I can't disable correction of two capital letters. Corresponding checkbox is unchecked every time, but correction works. If I check this checkbox, the next time it's unchecked again, but nothing changes. I've added exception (Exception didn't appear in window first time, but after next open it appeared), nothing changes
Comment 1 Andreas J. Guelzow 2010-03-22 05:37:55 UTC
Are you running gconf?
Comment 2 Konstantin Tokarev 2010-03-22 09:41:33 UTC
No. I've configured Goffice --without-gconf and Gnumeric --without-gnome
Comment 3 Andreas J. Guelzow 2010-03-22 12:56:34 UTC
Are your other preferences saved and used?
Comment 4 Morten Welinder 2010-03-22 15:22:56 UTC
We should kill --without-gnome.  It's pointless nowadays.
Comment 5 Konstantin Tokarev 2010-03-22 21:50:41 UTC
Some preferences (Files, Fonts, Undo) work, some (Autocorrection, Copy) don't
Comment 6 Andreas J. Guelzow 2010-03-23 04:18:06 UTC
With respect to autocorrection there seems to be quite a bit of dead code in autocorrect.c plus some possible duplication.

Nevertheless everything seems to work fine with gconf. 

When you say that some preferences such as "copy" don't work, is it correct that you mean that "Prefer CLIPBOARD over PRIMARY" doesn't stick? It may be simpler to figure out that problem before looking at the added problems with autocorrect (and since the latter works for gconf, fixing the former may make the latter work too.)
Comment 7 Andreas J. Guelzow 2010-03-23 05:42:29 UTC
I can replicate this with a goffice build with --without-gconf.

.gnumericrc only has a [StringLists] section.
Comment 8 Andreas J. Guelzow 2010-03-23 06:19:20 UTC
On first glance it seems that therer is an inconsistency with default values:

The "Prefer CLIPBOARD over PRIMARY" initially shows at not selected. When selecting it since go_conf_load_bool already returns 1 (the default value) it does not change any settings.

Clicking on the checked box on the other hand does not even make it that far since go_conf_get_bool in bool_pref_widget_to_conf returns 0, so there seems to have been no change.
Comment 9 Konstantin Tokarev 2010-03-23 21:30:11 UTC
What should I do? Do I need to install gnome dev dependencies and configure with it, or Gnumeric is planned to work with my current flags after bugfix?
Comment 10 Andreas J. Guelzow 2010-03-23 21:38:32 UTC
I consider what you are seeing a bug. I don't know at this time how invasive a fix will be so we might not be able to fix in the current stable series.

We know that it works with gconf.

When I have a proposed patch I will attach it to this report. But there are not promises that this will happen with in a week or two. It is more likely that I will not get to it until mid April.
Comment 11 Konstantin Tokarev 2010-03-23 21:39:31 UTC
Thanks, I can wait :)
Comment 12 Andreas J. Guelzow 2010-03-23 22:07:26 UTC
Created attachment 156927 [details] [review]
first patch

This patch fixes the boolean (true/false) preferences under --without-gconf.

Note that with this patch you still need to stop and restart gnumeric after changing the autocorrect setting for gnumeric to pick up the changed value.
Comment 13 Andreas J. Guelzow 2010-03-23 22:15:08 UTC
Review of attachment 156927 [details] [review]:

this patch needs work since with gconf the sense of the setting is reverted between simultaneous instances with open preference windows.
Comment 14 Andreas J. Guelzow 2010-03-23 22:39:50 UTC
Created attachment 156931 [details] [review]
improved patch

The problem with the last patch was that the notifications of a preference change may arrive at the preference dialog before it is changed in the main configuration settings. So we do have to obtain the info directly from goffice.

This patch now works with and without gconf.
Comment 15 Andreas J. Guelzow 2010-03-23 22:57:21 UTC
Note that enabling/disabling of autocorrection does work if goffice is compiled with gconf since the autocorrect engine also establishes notification. But that is really unnecessary duplication of code. The autocorrect engine should just access the main preference configuration.
Comment 16 Andreas J. Guelzow 2010-03-24 04:23:17 UTC
I have committed another patch that allows you to switch autocorrection on and off without restarting gnumeric. 

While adding exceptions works, the newly added items are not shown in the preference dialog until the dialog is reopened.
Comment 17 Konstantin Tokarev 2010-03-24 09:02:29 UTC
Now exception list works only after restart
Comment 18 Andreas J. Guelzow 2010-03-24 12:55:41 UTC
Konstantin: I believe your "Now" of comment 17 refers to the situation before my last patch, that was committed directly.
Comment 19 Konstantin Tokarev 2010-03-24 13:03:42 UTC
I've made git pull just before writing that comment. Autocorrection can be switched without restart, exception list can be changed, but changes are applied after restart
Comment 20 Andreas J. Guelzow 2010-03-24 13:46:35 UTC
Strange. I can add items to the exception list and they are effective immediately.
Comment 21 Andreas J. Guelzow 2010-03-24 15:21:25 UTC
I am not sure what I think I saw earlier. I can now replicate your observation of comment #17. (This is a consequence of goffice not providing notification on changes with --without-gconf.)
Comment 22 Morten Welinder 2010-03-24 17:47:48 UTC
I can hack up intra-process notification quite easily.
Comment 23 Andreas J. Guelzow 2010-03-24 17:56:25 UTC
I think we should fix goffice to provide the requested notifications even --without-gconf. At least when the changes originate within our process itself that should be very easy.
Comment 24 Konstantin Tokarev 2010-03-24 18:21:43 UTC
IMHO, there's unneeded entity here. In your case, dialog sends properties to gconf and application reads them, but it'll be much more reasonable to send data directly and then use some storage mechanism (gconf or .rc) to save them
Comment 25 Morten Welinder 2010-03-24 18:59:31 UTC
Created attachment 157009 [details] [review]
Patch for notification

Needs testing
Comment 26 Konstantin Tokarev 2010-03-24 21:48:59 UTC
No,it still requires restart. And list isn't updated on the fly
Comment 27 Andreas J. Guelzow 2010-03-24 22:07:12 UTC
Konstantin, regarding your comment #24: there are several related issues here since ideally the dialog also updates when a different gnumeric process changes the preferences. That's the reason for having these notifications. The dialog has to receive notification on change and it is simpler just to have one mechanism rather than two.

Morten: I'll test tonight.

Both: In any case, there are some obvious (to me) changes that should be made to the preference dialog that will address the reload necessity.
Comment 28 Andreas J. Guelzow 2010-03-25 04:57:03 UTC
Adding or deleting exceptions should not require restart anymore.
Comment 29 Andreas J. Guelzow 2010-03-25 07:10:37 UTC
Review of attachment 157009 [details] [review]:

This patch looks good to me. It does show uncover some strange behaviour  but that seems to be not the fault of this patch, for example bug #613869.
Comment 30 Konstantin Tokarev 2010-03-25 11:23:55 UTC
It works!
Comment 31 Morten Welinder 2010-03-25 12:21:35 UTC
This problem has been fixed in our software repository. The fix will go into the next software release. Thank you for your bug report.