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 337798 - Showing help on win32 is disabled
Showing help on win32 is disabled
Status: RESOLVED FIXED
Product: ekiga
Classification: Applications
Component: general
GIT master
Other Windows
: Normal normal
: ---
Assigned To: Snark
Ekiga maintainers
Depends on:
Blocks:
 
 
Reported: 2006-04-09 12:53 UTC by Snark
Modified: 2006-04-17 18:21 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Michael Rickmann's solution (2.27 KB, patch)
2006-04-09 12:54 UTC, Snark
none Details | Review
enable help for Win32 (1.99 KB, patch)
2006-04-14 15:38 UTC, Michael Rickmann
none Details | Review
unrolled win32 help patch (2.14 KB, patch)
2006-04-15 05:11 UTC, Michael Rickmann
none Details | Review
win32 help with long locale directory names (1.69 KB, patch)
2006-04-17 11:28 UTC, Michael Rickmann
none Details | Review

Description Snark 2006-04-09 12:53:52 UTC
In fact it is enabled only when not DISABLE_GNOME.
Comment 1 Snark 2006-04-09 12:54:26 UTC
Created attachment 63018 [details] [review]
Michael Rickmann's solution
Comment 2 Snark 2006-04-09 14:44:16 UTC
I like the part of the patch which goes around the gnome_help_display call ; the part for the menu entries doesn't look right : it should basically just move the #ifndef DISABLE_GNOME some lines down, from just above the help entry to just below it (and above the about entry).
Comment 3 Michael Rickmann 2006-04-09 19:38:43 UTC
In the menu entries part I have rearranged things into first "contents" then "about" handled independantly by the #if s. This was necessary in order to keep things short and to consider DISABLE_GNOME && !WIN32 cases as well.
Regards
Michael
Comment 4 Michael Rickmann 2006-04-14 15:37:24 UTC
I changed that patch as you suggested. DISABLE_GNOME && !WIN32 seems not very common and if somebody tries with that combination he will just have an empty help_cb signal function.
Regards
Michael
Comment 5 Michael Rickmann 2006-04-14 15:38:35 UTC
Created attachment 63476 [details] [review]
enable help for Win32
Comment 6 Snark 2006-04-14 15:53:08 UTC
Could you explain why you try the same thing twice ? I would think that if it fails the first time, then we just abandon...
Comment 7 Michael Rickmann 2006-04-14 17:01:28 UTC
Oh yes. Help will not be available in all languages. I thought it may be cute to install always locale C. So the first time the routine tries to find help in the locale returned by Glib. If it fails, it tries to open DATADIR\help\C\index.xhtml. We do not have an en-locale directory in ekiga-cvs. So for all English speakers the routine will succeed with the second trial.
Regards
Michael
Comment 8 Snark 2006-04-14 18:36:41 UTC
I'd rather have twice the same code with a clear :
<first try>
if (fail)
  <second try>
than that unclear for loop.

Also, if the first try fails:
1. don't you leak the first locale ?
2. don't you free the static "C" locale ?
Comment 9 Michael Rickmann 2006-04-15 05:10:09 UTC
I agree, it was too twisted. A new version follows, everything unrolled.
Regards Michael
Comment 10 Michael Rickmann 2006-04-15 05:11:26 UTC
Created attachment 63537 [details] [review]
unrolled win32 help patch
Comment 11 Snark 2006-04-15 05:38:14 UTC
I like this one, applying with a little modification : I'll do the memory management like this:
1)
index_path = ...;
hinst = ...;
g_free (index_path);
(no need to keep index_path longer than that)
2) use g_free (locale); just after the use of locale too.

Closing the bug on a last question : we take only two chars for the locale ; are we sure it will be enough ?
Comment 12 Michael Rickmann 2006-04-17 11:26:03 UTC
Oh you have already applied the patch to CVS. There is still an error in it. The string returned by g_win32_getlocale is not g_free ed. Sorry for having been so slow. I have been away for two days.
The more I have been thinking about your final question the more I think that we should account for fully qualified locale directories. In Ekiga's locale directory, there are already contributions using full locale and the manual is not that old yet. When you think of China, there may be quite a lot of users who need a long locale to distinguish between simplified (zh_CN) and traditional Chineese (zh_HK, zh_TW). Things are more complicated than I originally thought. Glib and the environment set by the Gtk+ installer or by the user play a role.
g_win32_getlocale (in Glib's gwin32.c) first checks the environment variables LC_ALL, LC_MESSAGES and LANG. If it finds something it is returned immediately without any further checking. This is the case on my XP Home laptop where "LANG" is set to "de". It was set during installation of Gtk+ runtime. If g_win32_getlocale does not find a language environment it calls GetThreadLocale () and constructs a Posix like locale. The returned string may be of the form "en" or "en_CA" depending on what GetThreadLocale returns and which language subidentifiers have been defined by Microsoft. In a few cases g_win32_getlocale uses 3 letter first language parts when defined by MS.
I have written a new help_cb which allows for long locales. Sorry that the patch is a bit difficult to read now as it reverses the old one.
Regards
Michael
Comment 13 Michael Rickmann 2006-04-17 11:28:18 UTC
Created attachment 63690 [details] [review]
win32 help with long locale directory names
Comment 14 Snark 2006-04-17 15:11:22 UTC
Eh... I though g_win32_getlocale was returning a const... my bad!

About the new patch: do we really have to put the second if in the first if ? Can't we just leave them one after the other ?

Something like :
if I have a locale
  try with it
if the try failed and I have a short locale
  try with the short locale
if the try failed
  try with the C locale
?
Comment 15 Michael Rickmann 2006-04-17 16:40:03 UTC
We can have it sequentially as you said. It works.
Comment 16 Snark 2006-04-17 18:21:50 UTC
I applied your patch, put it sequentially then committed. Thanks again!