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 135345 - Help Menu item does not work
Help Menu item does not work
Status: RESOLVED FIXED
Product: conglomerate
Classification: Other
Component: Code
CVS
Other Linux
: Normal normal
: 0.8.0
Assigned To: conglomerate list
conglomerate list
: 128544 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2004-02-25 01:04 UTC by Toshio Kuratomi
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: 2.3/2.4


Attachments
Patch to allow Help Button to work (1.41 KB, patch)
2004-02-25 01:06 UTC, Toshio Kuratomi
none Details | Review
Patch changing PKGDATADIR references to DATADIR (pixmaps need fixing in addition to this.) (13.77 KB, patch)
2004-03-03 01:37 UTC, Toshio Kuratomi
none Details | Review
Complete pkgdatadir->datadir patch (16.09 KB, patch)
2004-03-03 16:29 UTC, Toshio Kuratomi
none Details | Review
only changes in src directory version of the patch (11.09 KB, patch)
2004-03-05 14:16 UTC, Geert Stappers
none Details | Review

Description Toshio Kuratomi 2004-02-25 01:04:15 UTC
When I try to use the help menu item nothing happens.  Running strace on
conglomerate shows that the program is unable to find the help files.  This
in turn is because gnome_program_init is required to set up some file paths
before gnome_help_display will work right.
Comment 1 Toshio Kuratomi 2004-02-25 01:06:24 UTC
Created attachment 24743 [details] [review]
Patch to allow Help Button to work
Comment 2 Toshio Kuratomi 2004-02-25 01:11:15 UTC
The patch is small, but I haven't tested it for bad interactions with
other code (argument parsing or finding program directories are two
things that need to be verified to work correctly.)

The patch touches src/Makefile.am so you'd need to run the auto* tools
again afterwards.

There may also be a better way to do this than the make defines I
create in src/Makefile.am.  Since there already were path related
define's there, it seemed to fit but it could probably go in configure
instead (Not sure about that.  Just an idea if you don't like the way
the patch works.)
Comment 3 David Malcolm 2004-02-25 02:47:19 UTC
The call to gnome_program_init should be happening in src/cong-app.c
(function cong_app_new) rather than in main

Please can you rework your patch accordingly.  

I tried to do this, but it didn't work for me - help files are in
/usr/local/share/conglomerate/doc/C, but I get the error message:
WARNING **: Unable to find the help files in either
/usr/local/share/conglomerate/gnome/help/conglomerate/ or
/usr/share/gnome/help/.  Please check your installation
Comment 4 Geert Stappers 2004-02-25 08:17:27 UTC
From bugreport 128544:

I think got lost on the DATADIR to PKGDATADIR switch. ( bug 121676 )
Comment 5 Geert Stappers 2004-02-25 08:20:43 UTC
*** Bug 128544 has been marked as a duplicate of this bug. ***
Comment 6 Toshio Kuratomi 2004-02-26 02:22:39 UTC
Hmmm... Trying to rework my patch into cong-app.c in the cvs version
instead of 0.7.11 and I'm having a bunch of problems.  It may take me
a couple days to figure out why I was able to get the original working
but not this combination of things.
Comment 7 Toshio Kuratomi 2004-02-29 20:34:12 UTC
Okay.  I have had no luck getting my patch workable in cong-app.c  But
I've been looking around the libgnome documentation and I think that
I've spotted a basic misunderstanding.  I think that
GNOME_PARAM_APP_DATADIR takes a directory that's the top level of a
hierarchy that mirrors GNOME_PARAM_GNOME_DATADIR.  So it should be
assigned to DATADIR (as in /usr/share or /usr/local/share), not
PKGDATADIR.  Your code can then create a subdirectory under DATADIR
(pkgdatadir) and place the files you want in there.

I've looked over bug #121676 and think that the patch that went in
there is wrong WRT this premise.  It should be reverted except for this:
--- conglomerate-0.7.4.orig/pixmaps/Makefile.am
+++ conglomerate-0.7.4/pixmaps/Makefile.am
@@ -1,11 +1,9 @@
+## desk top icon
 dtidir = $(datadir)/pixmaps
 dti_DATA = conglomerate-icon-16.png
 
-##appiconsdir = $(pkgdatadir)/icons
-##appiconsdir = $(datadir)/conglomerate/icons
-## this is work in progress by GSt
 # application icons
-appiconsdir = $(datadir)/pixmaps
+appiconsdir = $(datadir)/conglomerate/pixmaps
 appicons_DATA = \
 	cong-docbook-set-16.png \
 	cong-docbook-book-16.png \

Please note that all Makefile.am entries in that patch should work as
either $(datadir)/conglomerate or $(pkgdatadir) -- I lean towards
$(datadir)/coglomerate as it is one less variable to depend on being
defined right.

I can work up a patch based on this instead of my earlier attempt but
I'd like someone to confirm that my core premise is correct (and clue
me in if there's going to be other possible breakage).  I read the
libgnome::gnome-program section and browsed some other projects on
cvs.gnome.org to come to this conclusion.
Comment 8 Geert Stappers 2004-03-02 12:46:31 UTC
I have seen the update.
Comment 9 Toshio Kuratomi 2004-03-03 01:35:51 UTC
Went ahead and started patching the code to work with DATADIR instead
of PKGDATADIR again.  I have something that works with everything
except pixmaps.  I'll upload it as a "what I have so far patch."

My problem with pixmaps is this:  I think the non-desktop-icon pixmaps
belong in @DATADIR@/pixmaps/conglomerate rather than
@DATADIR/conglomerate/pixmaps.  I can implement either one (Either
gnome_file_lookup GNOME_FILE_DOMAIN_PIXMAP conglomerate/image.png or
gnome_file_lookup GNOME_FILE_DOMAIN_DATADIR
conglomerate/pixmap/image.png) so in a way it's a value judgement.  My
research into it is:
1) on my Fedora Core system, 5 gnome programs place files into
/usr/share/<APP>/pixmaps while 19 (merging all gnome-games into one
package) place them in /usr/share/pixmaps/<APP>.
2) GNOME_FILE_DOMAIN_PIXMAP points to DATADIR/pixmaps for a reason.

Anyhow, I'm going to start work on making things work that way and
then submit a new in toto patch unless someone shouts please implement
it the other way 'round.
Comment 10 Toshio Kuratomi 2004-03-03 01:37:50 UTC
Created attachment 25070 [details] [review]
Patch changing PKGDATADIR references to DATADIR (pixmaps need fixing in addition to this.)
Comment 11 Geert Stappers 2004-03-03 07:59:51 UTC
Seen the patch.
However, I have other ideas about fixing this problem.
I have scheduled some time for it on thursday march 4.
Comment 12 Toshio Kuratomi 2004-03-03 16:29:17 UTC
Created attachment 25106 [details] [review]
Complete pkgdatadir->datadir patch
Comment 13 Toshio Kuratomi 2004-03-03 16:35:29 UTC
Great!  I'll cvs update sometime next week and try it out. 

(Finished my patch up last night so I uploaded it just for completeness.)
Comment 14 Geert Stappers 2004-03-04 13:38:57 UTC
Created bug 136178 for the DATADIR/conglomerate/pixmaps/ or
DATADIR/pixmaps/conglomerate/ question.
Comment 15 Geert Stappers 2004-03-04 22:42:54 UTC
from /usr/include/libgnome-2.0/libgnome/gnome-program.h
comes this:
/* If you have your auto* define PREFIX, SYSCONFDIR, DATADIR and LIBDIR,
 * Use this macro in your init code. */
#define GNOME_PROGRAM_STANDARD_PROPERTIES \
        GNOME_PARAM_APP_PREFIX, PREFIX,         \
        GNOME_PARAM_APP_SYSCONFDIR, SYSCONFDIR, \
        GNOME_PARAM_APP_DATADIR, DATADIR,       \
        GNOME_PARAM_APP_LIBDIR, LIBDIR
 
now I understand why reverting the PKGDATA change.

However the problem is missing help.
Next step the line
        gnome_help_display("conglomerate.xml", NULL, &error);
from cong-menus.c
Comment 16 Toshio Kuratomi 2004-03-05 02:10:56 UTC
Don't know how much you've already sunk your hands into the code, but
the answer to missing help files is obtainable via strace.

gnome_file_locate and gnome_help_display check two directories for
their files.  The values in GNOME_FILE_DOMAIN_*
GNOME_FILE_DOMAIN_APP_*.  I think that GNOME_FILE_DOMAIN_* is set in
the gnome library files to point to the gnome installation so there's
no changing it.  GNOME_FILE_DOMAIN_APP_* is derived from
GNOME_PARAM_APP_DATADIR.

When GNOME_PARAM_DATADIR is set to @DATADIR@/conglomerate (aka
PKGDATADIR) the gnome library decides to search for the app specific
files in the path DATADIR/conglomerate/gnome/help/conglomerate/.  This
is the wrong place for help files to be.  They should be in (and
conglomerate installs them to) DATADIR/gnome/help/conglomerate.

Setting GNOME_PARAM_APP_DATADIR = DATADIR makes the library search the
correct directory.  I used the gnome standard macro
GNOME_PROGRAM_STANDARD_PROPERTIES to achieve this.  In setting
GNOME_PARAM_APP_DATADIR correctly, I had to revert the
PKGDATADIR=>DATADIR changes.

As I found, there are a few programs which put pixmaps into
DATADIR/PROGRAM/pixmaps, but by and large they seem to go into
DATADIR/pixmaps/PROGRAM.  This follows logically from the setting of
GNOME_FILE_DOMAIN_APP_PIXMAPS so it makes sense in two different ways.
 Not hard to change, if you're attached to DATADIR/PROGRAM/PIXMAPS,
though.  Instead of using gnome_locate_file with
FILE_DOMAIN_APP_PIXMAPS, use FILE_DOMAIN_APP_DATADIR.  I think it's
non-standard, but there are some other programs doing that.  [As
opposed to none for locating help in a non-standard place.]

PS -- strace also told me that gnome_help_display tries to use its
first argument as a directory even though the libgnome documentation
says 'filename'.  It's able to cope because it strips the extension
off the argument and tries again after it fails to find a directory
named conglomerate.xml.  It's more efficient to use 'conglomerate'
rather than 'conglomerate.xml' but I'm not sure if it's a programming
or documentation bug. (Posted to libgnome bugzilla as Bug #136242)
Comment 17 Geert Stappers 2004-03-05 14:16:05 UTC
Created attachment 25210 [details] [review]
only changes in src directory version of the patch
Comment 18 Geert Stappers 2004-03-05 14:22:12 UTC
I still don't know how the gnome_help_display functions works,
but it works with the patch that is based on Toshio Kuramoti's work.