gnochm - A CHM file viewer for Gnome Version 0.9.11 Copyright (C) 2003-2007 Rubens Ramos <rubensr@users.sourceforge.net> Please report bugs or suggestions for improvements to the above address or follow the instructions at: http://gnochm.sourceforge.net ---------------------------------------------------------------------------- INTRODUCTION Gnochm is a CHM file viewer for Gnome systems. Features are: * Support for external ms-its links * Full text search support * Bookmarks * Configurable support for HTTP links * Integrated with Gnome2: - Registers itself to open CHM files (freedesktop and older scheme). - Accepts Drag-n-Drop from Nautilus. - Uses Gnome help system. - Preferences stored in GConf. - Uses popt to parse command line parameters - Gnome session support * Support for multiple languages (cs,de,el,es,fr,hu,it,ja,pl,pt_BR,ru,sv,tr,zh_CN,zh_TW) * Support to open multiple files at once * Displays HTML page source ---------------------------------------------------------------------------- REQUIREMENTS - PyCHM (or python-chm) (>= 0.8.4) - Python (>= 2.2.1) Also, python must have gettext and locale modules - pygtk2 (>= 1.99.12) - pygtk2-libglade (>= 1.99.12) - gnome-python2 (>= 1.99.11) - gnome-python2-gtkhtml2 (>= 1.99.11) - gnome-python2-gconf (>= 1.99.11) - gnome-python2-bonobo (>= 1.99.11) - Optional shared-mime-info from www.freedesktop.org ---------------------------------------------------------------------------- INSTALLING * From source: First things first - if you want to be able to access the user's guide from Yelp (the Gnome help system), you need to know where your scrollkeeper content list files are located. To do this, I did: $ locate scrollkeeper_cl | grep C And you should see at least one entry. In RedHat 8, the base directory used by scrollkeeper for the files is '/var/lib'. Second: if you want to see an entry for gnochm (at least in redhat) in the main panel menu, you will also need to use 'prefix' in your configuration parameters (see below). So, if you want a new entry for gnochm in the menu, and if you also want to be able to see gnochm documentation from the Yelp, then you can type something like this (this is what I do on my system, Fedora Core 2): $ ./configure --prefix=/usr --localstatedir=/var/lib But if you don't care about it, you can just do: $ ./configure And finally, to build and install gnochm: $ make $ su root <enter root password> $ make install For more specific information about the 'configure' script, refer to the INSTALL file included in this package. * Installing from source without root access Because gnochm uses gconf to store user preferences, you need to configure it to install its data files in your local directory. So first of all, check that gconf is globally configured to search in users directories for data by making sure the file /etc/gconf/2/path has references to $(HOME) in it. If it doesnt, then you need to ask your systems admin to update this file for you before you can proceed with the installation. With the gconf stuff sorted out, you will need to use "configure" in a way similar to this: ./configure --prefix=/home/<username>/<destination> --localstatedir=/home/<username>/<destination>/lib --with-gconf-source="xml::/home/<username>/.gconf" --with-gconf-schema-file-dir=/home/<username>/.gconf Just remember to substitute <username> with your username and <destination> with the directory where the gnochm binary, and all other configuration files will be installed. The "--localstatedir" option is used to store the documentation file, so you will probably need to make sure scrollkeeper is able to find files there (so you may need to check the scrollkeeper documentation on how to do it - which again may require root access). * Binary RPMs If you already have an older version of gnochm installed, it would be good to get rid of it first: $ rpm -e gnochm To install the gnochm RPM, download the file, and then type: $ rpm -i gnochm-X.X.X.yyy.rpm * Source RPMs $ rpm -i gnochm-X.X.X.src.rpm $ rpmbuild -ba /usr/src/redhat/SPECS/gnochm.spec $ rpm -i /usr/src/redhat/RPMS/gnochm-X.X.X.yyy.rpm ---------------------------------------------------------------------------- TROUBLESHOOTING * Chinese characters are not displayed properly! There are two issues are involved in this problem, but first, make sure you run gnochm with the "-d" flag and have a look in ~/.gnochm/gnochm.log to see that at least one of the "encoding" or "lcid" in your file are correct. Some dodgy chms do not have proper encodings in them. If the encoding is correct, then: 1) The contents pane does not show the proper characters - Try installing the cjkpython support for Chinese located in http://cjkpython.i18n.org. 2) The HTML window shows some rubbish! - This problem seems to be in the gtkhtml2 widget, and bug report #154428 has been raised to fix this. * TypeError: color_parse() argument 1 must be string, not None Note that some people indicated that logging out/in or even rebooting their computer solved their problem, so it's a good idea to try that before following the instructions below. The symptoms of this problem are that after installation, root can run GnoCHM, but other users get something similar to the above error. This is a problem with gconf that happens when the root user has a certain umask. You can verify if this is the case by checking the permissions on /etc/gconf/gconf.xml.defaults/apps/gnochm The directory above should have permissions to read/execute for all users. To solve this issue: 1. Uninstall gnochm 2. Make sure the file /etc/gconf/schemas/gnochm.schema does not exist. Delete it if necessary. 3. Make sure the directory /etc/gconf/gconf.xml.defaults/apps/gnochm does not exist. Delete it if necessary. 4. Logged as root, update your umask: umask 0022 5. Do not log out yet. Reinstall gnochm Things should work after this. This problem has been sent to the GConf team, and the bug report #145041 has been raised on http://bugzilla.gnome.org * GnoCHM crashes every time I follow a HTML link! This is a bug in gtkhtml2 (libtgkhtml2 to be more precise), and is present since around 2.4.0 (2.0.1 is known to work). At the time of writing (19 apr 2004) this bug HAS JUST BEEN FIXED in CVS, and will be part of a future release of gtkhtml2. For more details, check bug #135489 in http://bugzilla.gnome.org. So you can either try the CVS code, use the patch attached to the bug report, or get a version of gtkhtml2 >= 2.6.1. Gtkhtml2 sources are available at the Gnome ftp site: http://ftp.gnome.org/pub/GNOME/sources/libgtkhtml * ImportError: could not import bonobo.ui This occurs when gnome-python has not been compiled with all of the modules that gnochm needs. Some of the modules (notably the one above) in gnome-python require that the orbit bindings for python are installed. They are called pyorbit now, and older versions are called orbit-python. * ImportError: could not import <name> Gnochm (actually python) could not find the modules it needs to run. Modules can be installed in a variety of places. One way to see where python looks for modules is by doing: $ python >>> import sys >>> sys.path This last command will print a list of directories, and your module should be in one of them. If it isn't, then you can add more directories to the search path by setting the environment variable PYTHONPATH: In a csh-like shell: $ setenv PYTHONPATH /path/to/some/files:$PYTHONPATH or, in a sh-like shell: $ export PYTHONPATH=/path/to/some/files:$PYTHONPATH * Arghhh! something else going wrong! In certain cases, tweaking the gnochm configuration directly may help. For the adventurous/experienced people out there, it is possible to configure gnochm manually by using gconf-editor: 1. open gconf-editor (from the command-line, usually) 2. Navigate to /apps/gnochm/preferences 3. All gnochm preferences are stored here. The configuration stuff is located in ~/.gnochm, so if you think something is wrong with the configuration, this is the directory to look at. ---------------------------------------------------------------------------- TECHNICAL DETAILS GnoCHM is implemented in Python, using the PyGTk2 and the Python-Gnome bindings. It is supposed to be highly integrated with Gnome2. GnoCHM depends on PyCHM, a package that provides python wrappers to the CHMLIB written by Jed Wing. If you intend to hack this code, you probably want to look into gnochm.py.in, which contains the 'real' implementation. The glade files are in the 'glade' directory, and the manuals are in the 'help' directory. The 'po' directory contains the i18n messages, and the 'data' directory contains miscellaneous system configuration files that are installed with the tool. GnoCHM uses python gettext and some other functions in gtk.glade to allow i18n. The translatable strings are saved in the '.c' files in the 'glade' directory. ---------------------------------------------------------------------------- KNOWN BUGS * Follow anchors properly (shlv.chm) Sometimes, when an anchor is clicked, gtkhtml2 refuses to jump to it; This is apparently a GtkHTML2 bug, and it is in bugzilla. * Funny characters appear in msconfig.chm (and others?) I have no idea why this happens. * mmwhiteb.chm -> fail to open some gif files (weird directory). There is some weird way the search path is used in some files. * Tooltips do not appear for toolbar This is a bug in old versions of libglade - but it works on Fedora Core 2. * Menu and Toolbar detach option cannot be configured via the system configuration tool! Yes - and that is because libglade is not registering the dock items to listen to the desktop gconf values - I wrote most of the code in python, but the bindings I am using lack one of the APIs from bonobodockitem (it is private) to change the dock item behaviour. ---------------------------------------------------------------------------- ENHANCEMENTS Things I would like to improve in gnochm: * Save Geometry There are two issues here. The first is saving the application state between sessions. There is support for this in Gnome and in PyGTK now, but adding this would make future versions of gnochm unusable in older versions of pygtk...so I am not sure how unhappy users would become... The second issue is saving the application state while in a session. There is no support for this in gnome, and all of the information I could find says that this should be done automatically by the window manager, and not by the application. However, I could not make this work using metacity yet. If you know how to do this properly, let me know. * Searching in the index tab tree view could be improved - there are entries that should not be there sometimes (AddRef()...) and because it is setup as a TreeView, searching is done in ALL items, not only in the main index ones. * Bookmarks could be better - once the UI moves to a new page, the entry in the bookmarks tab could be filled with the current page title. This has to be obtained somehow using one of those index files in the CHM archive, it would require some changes to PyCHM too. * Support Gtkhtml2 when following HTTP links Use gtkhtml2 when HTTP links are clicked. This adds some complexity to the code that handles the links. * Notifications of time-consuming activities could be better When opening a large file, or searching through a large set of matches, things take a while. Using a progress bar could be a good idea. Right now, all I do is disable events, show "loading" or "searching, please wait" and hope for the best. * Printing CHM files This is not supported by the gtkhtml2 widget yet. * Handle "mailto" links properly (i.e. send email) Hmmm - really superfluous * Implement find (i.e. search for text in the page) This would be really nice, but first I need to know how to search for text in the gtkhtml2 widget. * Handle "merge" tags properly in topics file Some of the CHM files I tested required this - when this tag is used it is expected that the contents tree will be merged with another file's contents tree. * Transform it into a Nautilus viewer Not sure if this would be really useful. ---------------------------------------------------------------------------- ACKNOWLEDGEMENTS Icons/Logo by Kostia <pan1@takas.lt> Belarusian translation by Ihar Hrachyshka Chinese translation by Carlos Liu Czech translation by Zbynek Mrkvicka German translation by Daniel Schindler. Greek translation by Antonis Papaderos Hungarian translation by Garami Gábor Italian translation and patches by Alessandro Gatti Japanese translation by Tadashi Jokagi Polish translation by MichaŠKastelik Portuguese (BR) updates by Alan Kelon Russian translation by Alexandre Prokoudine, Vitaly Lipatov, Basil Shubin Spanish translation by Antonio Garcia Marin Swedish translation by Daniel Nylander Turkish translation by Sertac O. YILDIZ Traditional Chinese Taiwan by Chao, Wei-Lun Vietnamese by Huttic Mime patch by Dag Wieers and Mariusz Smykula Thanks to: * James Henstrige - for writing the python bindings * Christian Reis - for maintaining the PyGTK FAQ/Web site * Jed Wing - for developing CHMLIB * Pabs - for the excellent CHM documentation * People at #pygtk - Thanks for the help, guys! * Padraig O'Briain - for helping with the gtkhtml2 problem Patches, bug reports and help testing: Paolo Borelli, David Breakey, Ed Catmur, Joseph Churchill, Ahmed El-Mahmoudy, Zoltan Filyo, Alessandro Gatti, Ow Mun Heng, Raphael Higino, Jan Horacek, Ismael Juma, Alan Kelon, Carlos Liu, Eugenia Loli-Queru, Darius Mazeika, Jiri Pejchal, Renato Ramonda, Jody Ricker, Pablo Rodriguez, Fabio Silva, JD Smith, Alex Tarkovsky, Scott Tsai, Cheuksan Edward Wang, Glenn Washburn, Ralgh Young, Nan Zou ---------------------------------------------------------------------------- LICENSE gnochm is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. 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 General Public License for more details. You should have received a copy of the GNU 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 ---------------------------------------------------------------------------- $Id: README,v 1.52 2007/09/15 12:20:23 rubensr Exp $