https://gramps-project.org/wiki/api.php?action=feedcontributions&user=SergeNoiraud&feedformat=atomGramps - User contributions [en]2024-03-28T13:08:56ZUser contributionsMediaWiki 1.31.3https://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=46228GEPS 029: GTK3-GObject introspection Conversion2013-07-14T13:13:35Z<p>SergeNoiraud: /* Solved or workaround */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
<br />
=== Ubuntu 12.10 (Linux Mint 14) ===<br />
<br />
On Ubuntu 12.10 (as of December 1, 2012), or Linux Mint 14 (as of December 24, 2012), you need only ('''replace python with python3 if you want to run the python 3 version!'''):<br />
<br />
sudo apt-get install python-dev libglib2.0-dev libcairo2-dev<br />
sudo apt-get install python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
sudo apt-get install gir1.2-freedesktop python-gi python-gobject python-gi-cairo<br />
sudo apt-get install gir1.2-pango-1.0 libgtkspell-3-0 python-gtkspell<br />
sudo apt-get install python-pyicu<br />
<br />
Old note ''The removal of python-gnome2 (and anything that relies on it) is necessary apparently because some "selectors" have not yet been converted. The right thing to do here is to fix the selectors rather than removing the package.'''<br />
<br />
You can also run Gramps 4.0+ in [[GEPS_031:_Python_3_support#Ubuntu_12.10|Python 3]] first Install the Python BSDDB interface and check that it [[Install_latest_BSDDB#Python_BSDDB_interface|works]]<br />
sudo apt-get install python3-bsddb3<br />
<br />
<br />
You will probably want these optional packages:<br />
<br />
sudo apt-get install python-pygoocanvas gir1.2-goocanvas-2.0-9<br />
<br />
For additional functionality, install these:<br />
<br />
sudo apt-get install python-pyexiv2<br />
<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.4.2-2. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.4.2-2_i386.deb<br />
<br />
=== GTK 3 theme ===<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. <br />
* Try gtk3-engines-oxygen.<br />
* install [http://www.webupd8.org/2012/09/customize-gtk3-gtk2-theme-colors-using.html GTK Theme Preferences]<br />
<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
* Elementary theme and warnings<br />
<br />
[[Image:Elementary_theme.png|thumb|431px|center|Default GTK3 elementary engine under Elementary OS]]<br />
<br />
If you see some warnings[https://bugs.launchpad.net/egtk/+bug/999277] by running Gramps with Elementary theme:<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:217:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:218:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:250:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:251:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:277:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:151:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:152:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: content-view.css:92:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
then the best solution is maybe to try to fix it by yourself,<br />
/usr/share/themes/elementary/gtk-3.0/<br />
<br />
GtkSwitch {<br />
- text-shadow: 0 1 alpha (#fff, 0.4);<br />
+ text-shadow: 0 1px alpha (#fff, 0.4);<br />
- icon-shadow: 0 1 alpha (#fff, 0.4);<br />
+ icon-shadow: 0 1px alpha (#fff, 0.4);<br />
..<br />
<br />
and to provide a patch for this theme! <br />
http://bazaar.launchpad.net/~elementary-design/egtk/egtk-2a/files/head:/gtk-3.0/<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, you need [http://gtkspell.sourceforge.net/ gtkspell3 3.0]. <br />
<br />
(In Ubuntu 12.10, the libgtkspell-3-0 package is not suitable [https://bugs.launchpad.net/ubuntu/+source/gtkspell3/+bug/1114403] as it is API incompatible with the official release 3.0.0, released on 2012-11-12 )<br />
<br />
If the package is not in your distributions packages, you need to compile the spell check. For this, obtain the GtkSpell3 3.0 or later source code, and extract the code to a directory, eg gtkspell3, and go into this directory using the terminal.<br />
<br />
Before continuing, remove any old version of gtkspell v3 you might have installed before!<br />
<br />
Now obtain the packages needed to compile this code. <br />
<br />
Install the program 'hg' to get the code.<br />
sudo apt-get install mercurial<br />
<br />
Download the Gtkspell code with:<br />
hg clone <nowiki>http://hg.code.sf.net/p/gtkspell/code</nowiki> gtkspell-code<br />
<br />
You may need to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. By copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
<br />
[[File:Gtkspell working on gramps40.png|thumb|300px|Gtkspell working on gramps40 - You can tell because it does not recognise the word Gramps in the welcome Gramplet]]<br />
{{-}}<br />
<br />
==== Install your Dictionary ====<br />
If your language is missing from the list of dictionaries to spellcheck against you can install them.<br />
<br />
eg: For Australian English:<br />
sudo apt-get install myspell-en-au<br />
<br />
You can check that the language installed correctly by running<br />
enchant-lsmod -list-dicts<br />
<br />
The result should list all the language dictionaries installed and include the one you installed <br />
eg:<br />
en_AU (myspell)<br />
<br />
==== Old install method ====<br />
we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision [http://sourceforge.net/p/gramps/code/20130/tree/trunk/src/gui/spell.py 20130].<br />
<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The [[Gramps_4.0_Wiki_Manual_-_Categories#Geography_Category|Geography]] requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it from the repository listed below:<br />
<br />
==== Download from the home site ====<br />
<br />
http://nzjrs.github.io/osm-gps-map/<br />
<br />
Download the tar source and do :<br />
tar zxvf osm-gps-map-1.0.1.tar.gz<br />
cd osm-gps-map-1.0.1<br />
<br />
==== Download from github ====<br />
<br />
You can also continue to use git to get the last development version :<br />
<br />
git clone git://github.com/nzjrs/osm-gps-map.git<br />
cd osm-gps-map<br />
<br />
As we can have some new patches, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
==== How to compile osm-gps-map ====<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 and gobject-introspection devel packages:<br />
sudo apt-get install gtk+-3.0-dev libgirepository1.0-dev<br />
<br />
and some other stuff like:<br />
sudo apt-get install gnome-common gtk-doc-tools<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Using the latter, you can start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python Gramps.py<br />
<br />
or<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python -c 'from gramps.grampsapp import main; main()'<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
=== GExiv2 for Image metadata ===<br />
<br />
As at 9 Mar 2013 Fedora 18 only has a libgexiv2-0.4.1-3.fc18.i686.rpm. and<br />
version 0.5 (released October 2012) is needed in order to have the Python<br />
bindings for GExiv2.<br />
<br />
The GExiv2 maintainer's homepage is: redmine.yorba.org/projects/gexiv2/wiki<br />
which points to the latest sources, and tells you how to compile it.<br />
<br />
But to compile a Fedora 18 GExiv2 library, you need to have installed both<br />
exiv2-devel-0.23-3.fc18.i686.rpm and exiv2-libs-0.23-3.fc18.i686.rpm also.<br />
And you also need (unless you already have the /usr/bin/g-ir-scanner program)<br />
gobject-introspection-devel-1.34.2-1.fc18.i686.rpm too -- but that requires<br />
pkgconfig (which I already had) and also libffi-devel-3.0.10-3.fc18.i686.rpm<br />
for it to be happy.<br />
<br />
The 0.5 GExiv2 sources are in www.yorba.org/download/gexiv2/0.5. There you<br />
can download "libgexiv2-0.5.0.tar.xz" (not .bz2 or .gz) -- which will again<br />
only be necessary if Fedora has not yet updated its official RPM (to 0.5).<br />
<br />
Then, make a temporary directory and copy libgexiv2-0.5.0.tar.xz into it.<br />
Then "cd" into that directory and say "tar xpfJ libgexiv2-0.5.0.tar.xz".<br />
Then "cd" into the "libgexiv2-0.5.0" it made, and type:<br />
./configure --enable-introspection --prefix=/usr<br />
make<br />
(with the "/usr" being needed to override the "/usr/local" default)<br />
<br />
Then say (as root):<br />
make install<br />
<br />
Since I already had Python3 installed on that F18, along with the Python2<br />
which came with the F18, the "make install" put GExiv2.py into both the<br />
python2.7 and python3.3 site-packages/gi/overrides directories, thus enabling<br />
it on both. If you only have one Python it will put it only there.<br />
<br />
As a test, in both (for me) "python" and "python3" say:<br />
from gi.repository import GExiv2 <br />
<br />
Let's not tell users that they should install self-built software into /usr. They shouldn't, and neither should you.<br />
Either /usr/local or /opt are better choices and more-or-less standard practice. To make the library findable one<br />
should either add the directory of choice to /etc/ld.so.conf and run ldconfig(8) or add it to $LD_LIBRARY_PATH in one's profile.<br />
<br />
<br />
FWIW it seems a bit simpler with Linux Mint Debian Update 6<br />
(Cinnamon)<br />
<br />
libexiv, etc, etc............. are already installed or can<br />
be installed via synaptic.<br />
<br />
Then<br />
git clone git://git.yorba.org/gexiv2" to get gexiv2 0.5;<br />
going into gexiv2/ and running<br />
./configure --enable-introspection<br />
make<br />
(as root) make install"<br />
installs in usr/local<br />
And<br />
python3<br />
from gi.repository import GExiv2"<br />
tests OK.<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : missing tiles : osm-gps-map problem.<br />
(Gramps.py:4515): OsmGpsMap-WARNING **: Error getting missing tile<br />
* Geography : for all other problems, use last version with git pull.<br />
* GraphView : GooCanvas and dash lines : https://bugzilla.gnome.org/show_bug.cgi?id=703592<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others. '''Solved''' : git pull the latest version. You must remove all libosmgps* from /usr/local/lib before make install<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ... '''Solved''' GTK3 available<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug #{{bug|6042}} - resolved<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug #{{bug|5972}} - resolved<br />
<pre> TypeError: Error when calling the metaclass bases<br />
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases</pre><br />
* Gtk.ColorSelectionDialog has no more colorsel attribute : it's replaced by get_color_selection() - see bug #{{bug|6917}} - resolved<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree built with debugging CFLAGS (-g -O0). At a minimum, in addition to Python itself, you'll need symbols for Gtk+ (libgtk-3.0.so and libgdk-3.0.so), PyGObject, and GLib.<br />
<br />
To see the python stack:<br />
(gdb) pystack<br />
<br />
This works with gdb7 as-is; for earlier versions, you need to install [http://svn.python.org/view/*checkout*/python/trunk/Misc/gdbinit?revision=77484 gdbinit] as .gdbinit in your home directory before starting gdb.<br />
On some systems (MacOS X in particular), the structure PyStringObject isn't exported in the debug symbols, so if you get the error <br />
No symbol "PyStringObject" in current context.<br />
then you need to tell gdb<br />
add-symbol-file /path/to/Python-build-dir/Objects/stringobject.o<br />
which will be possible only if you've built Python from source.<br />
<br />
<br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=46205GEPS 029: GTK3-GObject introspection Conversion2013-07-04T21:34:10Z<p>SergeNoiraud: /* Open */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
<br />
=== Ubuntu 12.10 (Linux Mint 14) ===<br />
<br />
On Ubuntu 12.10 (as of December 1, 2012), or Linux Mint 14 (as of December 24, 2012), you need only ('''replace python with python3 if you want to run the python 3 version!'''):<br />
<br />
sudo apt-get install python-dev libglib2.0-dev libcairo2-dev<br />
sudo apt-get install python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
sudo apt-get install gir1.2-freedesktop python-gi python-gobject python-gi-cairo<br />
sudo apt-get install gir1.2-pango-1.0 libgtkspell-3-0 python-gtkspell<br />
sudo apt-get install python-pyicu<br />
<br />
Old note ''The removal of python-gnome2 (and anything that relies on it) is necessary apparently because some "selectors" have not yet been converted. The right thing to do here is to fix the selectors rather than removing the package.'''<br />
<br />
You can also run Gramps 4.0+ in [[GEPS_031:_Python_3_support#Ubuntu_12.10|Python 3]] first Install the Python BSDDB interface and check that it [[Install_latest_BSDDB#Python_BSDDB_interface|works]]<br />
sudo apt-get install python3-bsddb3<br />
<br />
<br />
You will probably want these optional packages:<br />
<br />
sudo apt-get install python-pygoocanvas gir1.2-goocanvas-2.0-9<br />
<br />
For additional functionality, install these:<br />
<br />
sudo apt-get install python-pyexiv2<br />
<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.4.2-2. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.4.2-2_i386.deb<br />
<br />
=== GTK 3 theme ===<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. <br />
* Try gtk3-engines-oxygen.<br />
* install [http://www.webupd8.org/2012/09/customize-gtk3-gtk2-theme-colors-using.html GTK Theme Preferences]<br />
<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
* Elementary theme and warnings<br />
<br />
[[Image:Elementary_theme.png|thumb|431px|center|Default GTK3 elementary engine under Elementary OS]]<br />
<br />
If you see some warnings[https://bugs.launchpad.net/egtk/+bug/999277] by running Gramps with Elementary theme:<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:217:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:218:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:250:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:251:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:277:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:151:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:152:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: content-view.css:92:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
then the best solution is maybe to try to fix it by yourself,<br />
/usr/share/themes/elementary/gtk-3.0/<br />
<br />
GtkSwitch {<br />
- text-shadow: 0 1 alpha (#fff, 0.4);<br />
+ text-shadow: 0 1px alpha (#fff, 0.4);<br />
- icon-shadow: 0 1 alpha (#fff, 0.4);<br />
+ icon-shadow: 0 1px alpha (#fff, 0.4);<br />
..<br />
<br />
and to provide a patch for this theme! <br />
http://bazaar.launchpad.net/~elementary-design/egtk/egtk-2a/files/head:/gtk-3.0/<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, you need [http://gtkspell.sourceforge.net/ gtkspell3 3.0]. <br />
<br />
(In Ubuntu 12.10, the libgtkspell-3-0 package is not suitable [https://bugs.launchpad.net/ubuntu/+source/gtkspell3/+bug/1114403] as it is API incompatible with the official release 3.0.0, released on 2012-11-12 )<br />
<br />
If the package is not in your distributions packages, you need to compile the spell check. For this, obtain the GtkSpell3 3.0 or later source code, and extract the code to a directory, eg gtkspell3, and go into this directory using the terminal.<br />
<br />
Before continuing, remove any old version of gtkspell v3 you might have installed before!<br />
<br />
Now obtain the packages needed to compile this code. <br />
<br />
Install the program 'hg' to get the code.<br />
sudo apt-get install mercurial<br />
<br />
Download the Gtkspell code with:<br />
hg clone <nowiki>http://hg.code.sf.net/p/gtkspell/code</nowiki> gtkspell-code<br />
<br />
You may need to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. By copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
<br />
[[File:Gtkspell working on gramps40.png|thumb|300px|Gtkspell working on gramps40 - You can tell because it does not recognise the word Gramps in the welcome Gramplet]]<br />
{{-}}<br />
<br />
==== Install your Dictionary ====<br />
If your language is missing from the list of dictionaries to spellcheck against you can install them.<br />
<br />
eg: For Australian English:<br />
sudo apt-get install myspell-en-au<br />
<br />
You can check that the language installed correctly by running<br />
enchant-lsmod -list-dicts<br />
<br />
The result should list all the language dictionaries installed and include the one you installed <br />
eg:<br />
en_AU (myspell)<br />
<br />
==== Old install method ====<br />
we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision [http://sourceforge.net/p/gramps/code/20130/tree/trunk/src/gui/spell.py 20130].<br />
<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The [[Gramps_4.0_Wiki_Manual_-_Categories#Geography_Category|Geography]] requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it from the repository listed below:<br />
<br />
==== Download from the home site ====<br />
<br />
http://nzjrs.github.io/osm-gps-map/<br />
<br />
Download the tar source and do :<br />
tar zxvf osm-gps-map-1.0.1.tar.gz<br />
cd osm-gps-map-1.0.1<br />
<br />
==== Download from github ====<br />
<br />
You can also continue to use git to get the last development version :<br />
<br />
git clone git://github.com/nzjrs/osm-gps-map.git<br />
cd osm-gps-map<br />
<br />
As we can have some new patches, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
==== How to compile osm-gps-map ====<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 and gobject-introspection devel packages:<br />
sudo apt-get install gtk+-3.0-dev libgirepository1.0-dev<br />
<br />
and some other stuff like:<br />
sudo apt-get install gnome-common gtk-doc-tools<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Using the latter, you can start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python Gramps.py<br />
<br />
or<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python -c 'from gramps.grampsapp import main; main()'<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
=== GExiv2 for Image metadata ===<br />
<br />
As at 9 Mar 2013 Fedora 18 only has a libgexiv2-0.4.1-3.fc18.i686.rpm. and<br />
version 0.5 (released October 2012) is needed in order to have the Python<br />
bindings for GExiv2.<br />
<br />
The GExiv2 maintainer's homepage is: redmine.yorba.org/projects/gexiv2/wiki<br />
which points to the latest sources, and tells you how to compile it.<br />
<br />
But to compile a Fedora 18 GExiv2 library, you need to have installed both<br />
exiv2-devel-0.23-3.fc18.i686.rpm and exiv2-libs-0.23-3.fc18.i686.rpm also.<br />
And you also need (unless you already have the /usr/bin/g-ir-scanner program)<br />
gobject-introspection-devel-1.34.2-1.fc18.i686.rpm too -- but that requires<br />
pkgconfig (which I already had) and also libffi-devel-3.0.10-3.fc18.i686.rpm<br />
for it to be happy.<br />
<br />
The 0.5 GExiv2 sources are in www.yorba.org/download/gexiv2/0.5. There you<br />
can download "libgexiv2-0.5.0.tar.xz" (not .bz2 or .gz) -- which will again<br />
only be necessary if Fedora has not yet updated its official RPM (to 0.5).<br />
<br />
Then, make a temporary directory and copy libgexiv2-0.5.0.tar.xz into it.<br />
Then "cd" into that directory and say "tar xpfJ libgexiv2-0.5.0.tar.xz".<br />
Then "cd" into the "libgexiv2-0.5.0" it made, and type:<br />
./configure --enable-introspection --prefix=/usr<br />
make<br />
(with the "/usr" being needed to override the "/usr/local" default)<br />
<br />
Then say (as root):<br />
make install<br />
<br />
Since I already had Python3 installed on that F18, along with the Python2<br />
which came with the F18, the "make install" put GExiv2.py into both the<br />
python2.7 and python3.3 site-packages/gi/overrides directories, thus enabling<br />
it on both. If you only have one Python it will put it only there.<br />
<br />
As a test, in both (for me) "python" and "python3" say:<br />
from gi.repository import GExiv2 <br />
<br />
Let's not tell users that they should install self-built software into /usr. They shouldn't, and neither should you.<br />
Either /usr/local or /opt are better choices and more-or-less standard practice. To make the library findable one<br />
should either add the directory of choice to /etc/ld.so.conf and run ldconfig(8) or add it to $LD_LIBRARY_PATH in one's profile.<br />
<br />
<br />
FWIW it seems a bit simpler with Linux Mint Debian Update 6<br />
(Cinnamon)<br />
<br />
libexiv, etc, etc............. are already installed or can<br />
be installed via synaptic.<br />
<br />
Then<br />
git clone git://git.yorba.org/gexiv2" to get gexiv2 0.5;<br />
going into gexiv2/ and running<br />
./configure --enable-introspection<br />
make<br />
(as root) make install"<br />
installs in usr/local<br />
And<br />
python3<br />
from gi.repository import GExiv2"<br />
tests OK.<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : missing tiles : osm-gps-map problem.<br />
(Gramps.py:4515): OsmGpsMap-WARNING **: Error getting missing tile<br />
* Geography : for all other problems, use last version with git pull.<br />
* GraphView : GooCanvas and dash lines : https://bugzilla.gnome.org/show_bug.cgi?id=703592<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others. '''Solved''' : git pull the latest version. You must remove all libosmgps* from /usr/local/lib before make install<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ... '''Solved''' GTK3 available<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug #{{bug|6042}} - resolved<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug #{{bug|5972}} - resolved<br />
<pre> TypeError: Error when calling the metaclass bases<br />
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases</pre><br />
<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree built with debugging CFLAGS (-g -O0). At a minimum, in addition to Python itself, you'll need symbols for Gtk+ (libgtk-3.0.so and libgdk-3.0.so), PyGObject, and GLib.<br />
<br />
To see the python stack:<br />
(gdb) pystack<br />
<br />
This works with gdb7 as-is; for earlier versions, you need to install [http://svn.python.org/view/*checkout*/python/trunk/Misc/gdbinit?revision=77484 gdbinit] as .gdbinit in your home directory before starting gdb.<br />
On some systems (MacOS X in particular), the structure PyStringObject isn't exported in the debug symbols, so if you get the error <br />
No symbol "PyStringObject" in current context.<br />
then you need to tell gdb<br />
add-symbol-file /path/to/Python-build-dir/Objects/stringobject.o<br />
which will be possible only if you've built Python from source.<br />
<br />
<br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=46203GEPS 029: GTK3-GObject introspection Conversion2013-07-03T17:06:24Z<p>SergeNoiraud: /* Download from gramps */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
<br />
=== Ubuntu 12.10 (Linux Mint 14) ===<br />
<br />
On Ubuntu 12.10 (as of December 1, 2012), or Linux Mint 14 (as of December 24, 2012), you need only ('''replace python with python3 if you want to run the python 3 version!'''):<br />
<br />
sudo apt-get install python-dev libglib2.0-dev libcairo2-dev<br />
sudo apt-get install python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
sudo apt-get install gir1.2-freedesktop python-gi python-gobject python-gi-cairo<br />
sudo apt-get install gir1.2-pango-1.0 libgtkspell-3-0 python-gtkspell<br />
sudo apt-get install python-pyicu<br />
<br />
Old note ''The removal of python-gnome2 (and anything that relies on it) is necessary apparently because some "selectors" have not yet been converted. The right thing to do here is to fix the selectors rather than removing the package.'''<br />
<br />
You can also run Gramps 4.0+ in [[GEPS_031:_Python_3_support#Ubuntu_12.10|Python 3]] first Install the Python BSDDB interface and check that it [[Install_latest_BSDDB#Python_BSDDB_interface|works]]<br />
sudo apt-get install python3-bsddb3<br />
<br />
<br />
You will probably want these optional packages:<br />
<br />
sudo apt-get install python-pygoocanvas gir1.2-goocanvas-2.0-9<br />
<br />
For additional functionality, install these:<br />
<br />
sudo apt-get install python-pyexiv2<br />
<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.4.2-2. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.4.2-2_i386.deb<br />
<br />
=== GTK 3 theme ===<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. <br />
* Try gtk3-engines-oxygen.<br />
* install [http://www.webupd8.org/2012/09/customize-gtk3-gtk2-theme-colors-using.html GTK Theme Preferences]<br />
<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
* Elementary theme and warnings<br />
<br />
[[Image:Elementary_theme.png|thumb|431px|center|Default GTK3 elementary engine under Elementary OS]]<br />
<br />
If you see some warnings[https://bugs.launchpad.net/egtk/+bug/999277] by running Gramps with Elementary theme:<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:217:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:218:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:250:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:251:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:277:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:151:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:152:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: content-view.css:92:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
then the best solution is maybe to try to fix it by yourself,<br />
/usr/share/themes/elementary/gtk-3.0/<br />
<br />
GtkSwitch {<br />
- text-shadow: 0 1 alpha (#fff, 0.4);<br />
+ text-shadow: 0 1px alpha (#fff, 0.4);<br />
- icon-shadow: 0 1 alpha (#fff, 0.4);<br />
+ icon-shadow: 0 1px alpha (#fff, 0.4);<br />
..<br />
<br />
and to provide a patch for this theme! <br />
http://bazaar.launchpad.net/~elementary-design/egtk/egtk-2a/files/head:/gtk-3.0/<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, you need [http://gtkspell.sourceforge.net/ gtkspell3 3.0]. <br />
<br />
(In Ubuntu 12.10, the libgtkspell-3-0 package is not suitable [https://bugs.launchpad.net/ubuntu/+source/gtkspell3/+bug/1114403] as it is API incompatible with the official release 3.0.0, released on 2012-11-12 )<br />
<br />
If the package is not in your distributions packages, you need to compile the spell check. For this, obtain the GtkSpell3 3.0 or later source code, and extract the code to a directory, eg gtkspell3, and go into this directory using the terminal.<br />
<br />
Before continuing, remove any old version of gtkspell v3 you might have installed before!<br />
<br />
Now obtain the packages needed to compile this code. <br />
<br />
Install the program 'hg' to get the code.<br />
sudo apt-get install mercurial<br />
<br />
Download the Gtkspell code with:<br />
hg clone <nowiki>http://hg.code.sf.net/p/gtkspell/code</nowiki> gtkspell-code<br />
<br />
You may need to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. By copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
<br />
[[File:Gtkspell working on gramps40.png|thumb|300px|Gtkspell working on gramps40 - You can tell because it does not recognise the word Gramps in the welcome Gramplet]]<br />
{{-}}<br />
<br />
==== Install your Dictionary ====<br />
If your language is missing from the list of dictionaries to spellcheck against you can install them.<br />
<br />
eg: For Australian English:<br />
sudo apt-get install myspell-en-au<br />
<br />
You can check that the language installed correctly by running<br />
enchant-lsmod -list-dicts<br />
<br />
The result should list all the language dictionaries installed and include the one you installed <br />
eg:<br />
en_AU (myspell)<br />
<br />
==== Old install method ====<br />
we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision [http://sourceforge.net/p/gramps/code/20130/tree/trunk/src/gui/spell.py 20130].<br />
<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The [[Gramps_4.0_Wiki_Manual_-_Categories#Geography_Category|Geography]] requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it from the repository listed below:<br />
<br />
==== Download from the home site ====<br />
<br />
http://nzjrs.github.io/osm-gps-map/<br />
<br />
Download the tar source and do :<br />
tar zxvf osm-gps-map-1.0.1.tar.gz<br />
cd osm-gps-map-1.0.1<br />
<br />
==== Download from github ====<br />
<br />
You can also continue to use git to get the last development version :<br />
<br />
git clone git://github.com/nzjrs/osm-gps-map.git<br />
cd osm-gps-map<br />
<br />
As we can have some new patches, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
==== How to compile osm-gps-map ====<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 and gobject-introspection devel packages:<br />
sudo apt-get install gtk+-3.0-dev libgirepository1.0-dev<br />
<br />
and some other stuff like:<br />
sudo apt-get install gnome-common gtk-doc-tools<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Using the latter, you can start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python Gramps.py<br />
<br />
or<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python -c 'from gramps.grampsapp import main; main()'<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
=== GExiv2 for Image metadata ===<br />
<br />
As at 9 Mar 2013 Fedora 18 only has a libgexiv2-0.4.1-3.fc18.i686.rpm. and<br />
version 0.5 (released October 2012) is needed in order to have the Python<br />
bindings for GExiv2.<br />
<br />
The GExiv2 maintainer's homepage is: redmine.yorba.org/projects/gexiv2/wiki<br />
which points to the latest sources, and tells you how to compile it.<br />
<br />
But to compile a Fedora 18 GExiv2 library, you need to have installed both<br />
exiv2-devel-0.23-3.fc18.i686.rpm and exiv2-libs-0.23-3.fc18.i686.rpm also.<br />
And you also need (unless you already have the /usr/bin/g-ir-scanner program)<br />
gobject-introspection-devel-1.34.2-1.fc18.i686.rpm too -- but that requires<br />
pkgconfig (which I already had) and also libffi-devel-3.0.10-3.fc18.i686.rpm<br />
for it to be happy.<br />
<br />
The 0.5 GExiv2 sources are in www.yorba.org/download/gexiv2/0.5. There you<br />
can download "libgexiv2-0.5.0.tar.xz" (not .bz2 or .gz) -- which will again<br />
only be necessary if Fedora has not yet updated its official RPM (to 0.5).<br />
<br />
Then, make a temporary directory and copy libgexiv2-0.5.0.tar.xz into it.<br />
Then "cd" into that directory and say "tar xpfJ libgexiv2-0.5.0.tar.xz".<br />
Then "cd" into the "libgexiv2-0.5.0" it made, and type:<br />
./configure --enable-introspection --prefix=/usr<br />
make<br />
(with the "/usr" being needed to override the "/usr/local" default)<br />
<br />
Then say (as root):<br />
make install<br />
<br />
Since I already had Python3 installed on that F18, along with the Python2<br />
which came with the F18, the "make install" put GExiv2.py into both the<br />
python2.7 and python3.3 site-packages/gi/overrides directories, thus enabling<br />
it on both. If you only have one Python it will put it only there.<br />
<br />
As a test, in both (for me) "python" and "python3" say:<br />
from gi.repository import GExiv2 <br />
<br />
Let's not tell users that they should install self-built software into /usr. They shouldn't, and neither should you.<br />
Either /usr/local or /opt are better choices and more-or-less standard practice. To make the library findable one<br />
should either add the directory of choice to /etc/ld.so.conf and run ldconfig(8) or add it to $LD_LIBRARY_PATH in one's profile.<br />
<br />
<br />
FWIW it seems a bit simpler with Linux Mint Debian Update 6<br />
(Cinnamon)<br />
<br />
libexiv, etc, etc............. are already installed or can<br />
be installed via synaptic.<br />
<br />
Then<br />
git clone git://git.yorba.org/gexiv2" to get gexiv2 0.5;<br />
going into gexiv2/ and running<br />
./configure --enable-introspection<br />
make<br />
(as root) make install"<br />
installs in usr/local<br />
And<br />
python3<br />
from gi.repository import GExiv2"<br />
tests OK.<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : missing tiles : osm-gps-map problem.<br />
(Gramps.py:4515): OsmGpsMap-WARNING **: Error getting missing tile<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others.<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others. '''Solved''' : git pull the latest version. You must remove all libosmgps* from /usr/local/lib before make install<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ... '''Solved''' GTK3 available<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug #{{bug|6042}} - resolved<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug #{{bug|5972}} - resolved<br />
<pre> TypeError: Error when calling the metaclass bases<br />
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases</pre><br />
<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree built with debugging CFLAGS (-g -O0). At a minimum, in addition to Python itself, you'll need symbols for Gtk+ (libgtk-3.0.so and libgdk-3.0.so), PyGObject, and GLib.<br />
<br />
To see the python stack:<br />
(gdb) pystack<br />
<br />
This works with gdb7 as-is; for earlier versions, you need to install [http://svn.python.org/view/*checkout*/python/trunk/Misc/gdbinit?revision=77484 gdbinit] as .gdbinit in your home directory before starting gdb.<br />
On some systems (MacOS X in particular), the structure PyStringObject isn't exported in the debug symbols, so if you get the error <br />
No symbol "PyStringObject" in current context.<br />
then you need to tell gdb<br />
add-symbol-file /path/to/Python-build-dir/Objects/stringobject.o<br />
which will be possible only if you've built Python from source.<br />
<br />
<br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=46202GEPS 029: GTK3-GObject introspection Conversion2013-07-03T17:04:52Z<p>SergeNoiraud: /* Download from github */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
<br />
=== Ubuntu 12.10 (Linux Mint 14) ===<br />
<br />
On Ubuntu 12.10 (as of December 1, 2012), or Linux Mint 14 (as of December 24, 2012), you need only ('''replace python with python3 if you want to run the python 3 version!'''):<br />
<br />
sudo apt-get install python-dev libglib2.0-dev libcairo2-dev<br />
sudo apt-get install python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
sudo apt-get install gir1.2-freedesktop python-gi python-gobject python-gi-cairo<br />
sudo apt-get install gir1.2-pango-1.0 libgtkspell-3-0 python-gtkspell<br />
sudo apt-get install python-pyicu<br />
<br />
Old note ''The removal of python-gnome2 (and anything that relies on it) is necessary apparently because some "selectors" have not yet been converted. The right thing to do here is to fix the selectors rather than removing the package.'''<br />
<br />
You can also run Gramps 4.0+ in [[GEPS_031:_Python_3_support#Ubuntu_12.10|Python 3]] first Install the Python BSDDB interface and check that it [[Install_latest_BSDDB#Python_BSDDB_interface|works]]<br />
sudo apt-get install python3-bsddb3<br />
<br />
<br />
You will probably want these optional packages:<br />
<br />
sudo apt-get install python-pygoocanvas gir1.2-goocanvas-2.0-9<br />
<br />
For additional functionality, install these:<br />
<br />
sudo apt-get install python-pyexiv2<br />
<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.4.2-2. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.4.2-2_i386.deb<br />
<br />
=== GTK 3 theme ===<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. <br />
* Try gtk3-engines-oxygen.<br />
* install [http://www.webupd8.org/2012/09/customize-gtk3-gtk2-theme-colors-using.html GTK Theme Preferences]<br />
<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
* Elementary theme and warnings<br />
<br />
[[Image:Elementary_theme.png|thumb|431px|center|Default GTK3 elementary engine under Elementary OS]]<br />
<br />
If you see some warnings[https://bugs.launchpad.net/egtk/+bug/999277] by running Gramps with Elementary theme:<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:217:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:218:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:250:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:251:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:277:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:151:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:152:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: content-view.css:92:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
then the best solution is maybe to try to fix it by yourself,<br />
/usr/share/themes/elementary/gtk-3.0/<br />
<br />
GtkSwitch {<br />
- text-shadow: 0 1 alpha (#fff, 0.4);<br />
+ text-shadow: 0 1px alpha (#fff, 0.4);<br />
- icon-shadow: 0 1 alpha (#fff, 0.4);<br />
+ icon-shadow: 0 1px alpha (#fff, 0.4);<br />
..<br />
<br />
and to provide a patch for this theme! <br />
http://bazaar.launchpad.net/~elementary-design/egtk/egtk-2a/files/head:/gtk-3.0/<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, you need [http://gtkspell.sourceforge.net/ gtkspell3 3.0]. <br />
<br />
(In Ubuntu 12.10, the libgtkspell-3-0 package is not suitable [https://bugs.launchpad.net/ubuntu/+source/gtkspell3/+bug/1114403] as it is API incompatible with the official release 3.0.0, released on 2012-11-12 )<br />
<br />
If the package is not in your distributions packages, you need to compile the spell check. For this, obtain the GtkSpell3 3.0 or later source code, and extract the code to a directory, eg gtkspell3, and go into this directory using the terminal.<br />
<br />
Before continuing, remove any old version of gtkspell v3 you might have installed before!<br />
<br />
Now obtain the packages needed to compile this code. <br />
<br />
Install the program 'hg' to get the code.<br />
sudo apt-get install mercurial<br />
<br />
Download the Gtkspell code with:<br />
hg clone <nowiki>http://hg.code.sf.net/p/gtkspell/code</nowiki> gtkspell-code<br />
<br />
You may need to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. By copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
<br />
[[File:Gtkspell working on gramps40.png|thumb|300px|Gtkspell working on gramps40 - You can tell because it does not recognise the word Gramps in the welcome Gramplet]]<br />
{{-}}<br />
<br />
==== Install your Dictionary ====<br />
If your language is missing from the list of dictionaries to spellcheck against you can install them.<br />
<br />
eg: For Australian English:<br />
sudo apt-get install myspell-en-au<br />
<br />
You can check that the language installed correctly by running<br />
enchant-lsmod -list-dicts<br />
<br />
The result should list all the language dictionaries installed and include the one you installed <br />
eg:<br />
en_AU (myspell)<br />
<br />
==== Old install method ====<br />
we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision [http://sourceforge.net/p/gramps/code/20130/tree/trunk/src/gui/spell.py 20130].<br />
<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The [[Gramps_4.0_Wiki_Manual_-_Categories#Geography_Category|Geography]] requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it from the repository listed below:<br />
<br />
==== Download from the home site ====<br />
<br />
http://nzjrs.github.io/osm-gps-map/<br />
<br />
Download the tar source and do :<br />
tar zxvf osm-gps-map-1.0.1.tar.gz<br />
cd osm-gps-map-1.0.1<br />
<br />
==== Download from github ====<br />
<br />
You can also continue to use git to get the last development version :<br />
<br />
git clone git://github.com/nzjrs/osm-gps-map.git<br />
cd osm-gps-map<br />
<br />
As we can have some new patches, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
==== Download from gramps ====<br />
<br />
You can download it from : http://sourceforge.net/projects/gramps/files/Dependencies/osmgpsmap/<br />
Then unzip the file.<br />
<br />
unzip osm-gps-map-gtk3.1.zip<br />
cd osm-gps-map-gtk3<br />
<br />
==== How to compile osm-gps-map ====<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 and gobject-introspection devel packages:<br />
sudo apt-get install gtk+-3.0-dev libgirepository1.0-dev<br />
<br />
and some other stuff like:<br />
sudo apt-get install gnome-common gtk-doc-tools<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Using the latter, you can start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python Gramps.py<br />
<br />
or<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python -c 'from gramps.grampsapp import main; main()'<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
=== GExiv2 for Image metadata ===<br />
<br />
As at 9 Mar 2013 Fedora 18 only has a libgexiv2-0.4.1-3.fc18.i686.rpm. and<br />
version 0.5 (released October 2012) is needed in order to have the Python<br />
bindings for GExiv2.<br />
<br />
The GExiv2 maintainer's homepage is: redmine.yorba.org/projects/gexiv2/wiki<br />
which points to the latest sources, and tells you how to compile it.<br />
<br />
But to compile a Fedora 18 GExiv2 library, you need to have installed both<br />
exiv2-devel-0.23-3.fc18.i686.rpm and exiv2-libs-0.23-3.fc18.i686.rpm also.<br />
And you also need (unless you already have the /usr/bin/g-ir-scanner program)<br />
gobject-introspection-devel-1.34.2-1.fc18.i686.rpm too -- but that requires<br />
pkgconfig (which I already had) and also libffi-devel-3.0.10-3.fc18.i686.rpm<br />
for it to be happy.<br />
<br />
The 0.5 GExiv2 sources are in www.yorba.org/download/gexiv2/0.5. There you<br />
can download "libgexiv2-0.5.0.tar.xz" (not .bz2 or .gz) -- which will again<br />
only be necessary if Fedora has not yet updated its official RPM (to 0.5).<br />
<br />
Then, make a temporary directory and copy libgexiv2-0.5.0.tar.xz into it.<br />
Then "cd" into that directory and say "tar xpfJ libgexiv2-0.5.0.tar.xz".<br />
Then "cd" into the "libgexiv2-0.5.0" it made, and type:<br />
./configure --enable-introspection --prefix=/usr<br />
make<br />
(with the "/usr" being needed to override the "/usr/local" default)<br />
<br />
Then say (as root):<br />
make install<br />
<br />
Since I already had Python3 installed on that F18, along with the Python2<br />
which came with the F18, the "make install" put GExiv2.py into both the<br />
python2.7 and python3.3 site-packages/gi/overrides directories, thus enabling<br />
it on both. If you only have one Python it will put it only there.<br />
<br />
As a test, in both (for me) "python" and "python3" say:<br />
from gi.repository import GExiv2 <br />
<br />
Let's not tell users that they should install self-built software into /usr. They shouldn't, and neither should you.<br />
Either /usr/local or /opt are better choices and more-or-less standard practice. To make the library findable one<br />
should either add the directory of choice to /etc/ld.so.conf and run ldconfig(8) or add it to $LD_LIBRARY_PATH in one's profile.<br />
<br />
<br />
FWIW it seems a bit simpler with Linux Mint Debian Update 6<br />
(Cinnamon)<br />
<br />
libexiv, etc, etc............. are already installed or can<br />
be installed via synaptic.<br />
<br />
Then<br />
git clone git://git.yorba.org/gexiv2" to get gexiv2 0.5;<br />
going into gexiv2/ and running<br />
./configure --enable-introspection<br />
make<br />
(as root) make install"<br />
installs in usr/local<br />
And<br />
python3<br />
from gi.repository import GExiv2"<br />
tests OK.<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : missing tiles : osm-gps-map problem.<br />
(Gramps.py:4515): OsmGpsMap-WARNING **: Error getting missing tile<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others.<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others. '''Solved''' : git pull the latest version. You must remove all libosmgps* from /usr/local/lib before make install<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ... '''Solved''' GTK3 available<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug #{{bug|6042}} - resolved<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug #{{bug|5972}} - resolved<br />
<pre> TypeError: Error when calling the metaclass bases<br />
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases</pre><br />
<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree built with debugging CFLAGS (-g -O0). At a minimum, in addition to Python itself, you'll need symbols for Gtk+ (libgtk-3.0.so and libgdk-3.0.so), PyGObject, and GLib.<br />
<br />
To see the python stack:<br />
(gdb) pystack<br />
<br />
This works with gdb7 as-is; for earlier versions, you need to install [http://svn.python.org/view/*checkout*/python/trunk/Misc/gdbinit?revision=77484 gdbinit] as .gdbinit in your home directory before starting gdb.<br />
On some systems (MacOS X in particular), the structure PyStringObject isn't exported in the debug symbols, so if you get the error <br />
No symbol "PyStringObject" in current context.<br />
then you need to tell gdb<br />
add-symbol-file /path/to/Python-build-dir/Objects/stringobject.o<br />
which will be possible only if you've built Python from source.<br />
<br />
<br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=45165GEPS 029: GTK3-GObject introspection Conversion2013-03-29T19:03:14Z<p>SergeNoiraud: /* OsmGpsMap for Geography */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
<br />
=== Ubuntu 12.10 (Linux Mint 14) ===<br />
<br />
On Ubuntu 12.10 (as of December 1, 2012), or Linux Mint 14 (as of December 24, 2012), you need only ('''replace python with python3 if you want to run the python 3 version!'''):<br />
<br />
sudo apt-get install python-dev libglib2.0-dev libcairo2-dev<br />
sudo apt-get install python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
sudo apt-get install gir1.2-freedesktop python-gi python-gobject python-gi-cairo<br />
sudo apt-get install gir1.2-pango-1.0 libgtkspell-3-0 python-gtkspell<br />
sudo apt-get install python-pyicu<br />
<br />
Old note ''The removal of python-gnome2 (and anything that relies on it) is necessary apparently because some "selectors" have not yet been converted. The right thing to do here is to fix the selectors rather than removing the package.'''<br />
<br />
You can also run Gramps 4.0+ in [[GEPS_031:_Python_3_support#Ubuntu_12.10|Python 3]] first Install the Python BSDDB interface and check that it [[Install_latest_BSDDB#Python_BSDDB_interface|works]]<br />
sudo apt-get install python3-bsddb3<br />
<br />
<br />
You will probably want these optional packages:<br />
<br />
sudo apt-get install python-pygoocanvas gir1.2-goocanvas-2.0-9<br />
<br />
For additional functionality, install these:<br />
<br />
sudo apt-get install python-pyexiv2<br />
<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.4.2-2. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.4.2-2_i386.deb<br />
<br />
=== GTK 3 theme ===<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. <br />
* Try gtk3-engines-oxygen.<br />
* install [http://www.webupd8.org/2012/09/customize-gtk3-gtk2-theme-colors-using.html GTK Theme Preferences]<br />
<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
* Elementary theme and warnings<br />
<br />
[[Image:Elementary_theme.png|thumb|431px|center|Default GTK3 elementary engine under Elementary OS]]<br />
<br />
If you see some warnings[https://bugs.launchpad.net/egtk/+bug/999277] by running Gramps with Elementary theme:<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:217:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:218:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:250:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:251:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:277:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:151:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:152:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: content-view.css:92:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
then the best solution is maybe to try to fix it by yourself,<br />
/usr/share/themes/elementary/gtk-3.0/<br />
<br />
GtkSwitch {<br />
- text-shadow: 0 1 alpha (#fff, 0.4);<br />
+ text-shadow: 0 1px alpha (#fff, 0.4);<br />
- icon-shadow: 0 1 alpha (#fff, 0.4);<br />
+ icon-shadow: 0 1px alpha (#fff, 0.4);<br />
..<br />
<br />
and to provide a patch for this theme! <br />
http://bazaar.launchpad.net/~elementary-design/egtk/egtk-2a/files/head:/gtk-3.0/<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, you need [http://gtkspell.sourceforge.net/ gtkspell 3.3.0]. <br />
<br />
(In Ubuntu 12.10, the libgtkspell-3-0 package is not suitable [https://bugs.launchpad.net/ubuntu/+source/gtkspell3/+bug/1114403] as it is API incompatible with the official release 3.0.0, released on 2012-11-12 )<br />
<br />
If the package is not in your distributions packages, you need to compile the spell check. For this, obtain the GtkSpell 3.3.0 or later source code, and extract the code to a directory, eg gtkspell3, and go into this directory using the terminal.<br />
<br />
Before continuing, remove any old version of gtkspell v3 you might have installed before!<br />
<br />
Now obtain the packages needed to compile this code. <br />
<br />
Install the program 'hg' to get the code.<br />
sudo apt-get install mercurial<br />
<br />
Download the Gtkspell code with:<br />
hg clone http://hg.code.sf.net/p/gtkspell/code gtkspell-code<br />
<br />
You may need to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. By copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
<br />
[[File:Gtkspell working on gramps40.png|thumb|300px|Gtkspell working on gramps40 - You can tell because it does not recognise the word Gramps in the welcome Gramplet]]<br />
{{-}}<br />
<br />
==== Install your Dictionary ====<br />
If your language is missing from the list of dictionaries to spellcheck against you can install them.<br />
<br />
eg: For Australian English:<br />
sudo apt-get install myspell-en-au<br />
<br />
You can check that the language installed correctly by running<br />
enchant-lsmod -list-dicts<br />
<br />
The result should list all the language dictionaries installed and include the one you installed <br />
eg:<br />
en_AU (myspell)<br />
<br />
==== Old install method ====<br />
we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision [http://sourceforge.net/p/gramps/code/20130/tree/trunk/src/gui/spell.py 20130].<br />
<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The [[Gramps_4.0_Wiki_Manual_-_Categories#Geography_Category|Geography]] requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it from the repository listed below:<br />
<br />
==== Download from github ====<br />
<br />
git clone git://github.com/nzjrs/osm-gps-map.git<br />
cd osm-gps-map<br />
<br />
As we can have some new patches, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
==== Download from gramps ====<br />
<br />
You can download it from : http://sourceforge.net/projects/gramps/files/Dependencies/osmgpsmap/<br />
Then unzip the file.<br />
<br />
unzip osm-gps-map-gtk3.1.zip<br />
cd osm-gps-map-gtk3<br />
<br />
==== How to compile osm-gps-map ====<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 and gobject-introspection devel packages:<br />
sudo apt-get install gtk+-3.0-dev libgirepository1.0-dev<br />
<br />
and some other stuff like:<br />
sudo apt-get install gnome-common gtk-doc-tools<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Using the latter, you can start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python Gramps.py<br />
<br />
or<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python -c 'from gramps.grampsapp import main; main()'<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
=== GExiv2 for Image metadata ===<br />
<br />
As at 9 Mar 2013 Fedora 18 only has a libgexiv2-0.4.1-3.fc18.i686.rpm. and<br />
version 0.5 (released October 2012) is needed in order to have the Python<br />
bindings for GExiv2.<br />
<br />
The GExiv2 maintainer's homepage is: redmine.yorba.org/projects/gexiv2/wiki<br />
which points to the latest sources, and tells you how to compile it.<br />
<br />
But to compile a Fedora 18 GExiv2 library, you need to have installed both<br />
exiv2-devel-0.23-3.fc18.i686.rpm and exiv2-libs-0.23-3.fc18.i686.rpm also.<br />
And you also need (unless you already have the /usr/bin/g-ir-scanner program)<br />
gobject-introspection-devel-1.34.2-1.fc18.i686.rpm too -- but that requires<br />
pkgconfig (which I already had) and also libffi-devel-3.0.10-3.fc18.i686.rpm<br />
for it to be happy.<br />
<br />
The 0.5 GExiv2 sources are in www.yorba.org/download/gexiv2/0.5. There you<br />
can download "libgexiv2-0.5.0.tar.xz" (not .bz2 or .gz) -- which will again<br />
only be necessary if Fedora has not yet updated its official RPM (to 0.5).<br />
<br />
Then, make a temporary directory and copy libgexiv2-0.5.0.tar.xz into it.<br />
Then "cd" into that directory and say "tar xpfJ libgexiv2-0.5.0.tar.xz".<br />
Then "cd" into the "libgexiv2-0.5.0" it made, and type:<br />
./configure --enable-introspection --prefix=/usr<br />
make<br />
(with the "/usr" being needed to override the "/usr/local" default)<br />
<br />
Then say (as root):<br />
make install<br />
<br />
Since I already had Python3 installed on that F18, along with the Python2<br />
which came with the F18, the "make install" put GExiv2.py into both the<br />
python2.7 and python3.3 site-packages/gi/overrides directories, thus enabling<br />
it on both. If you only have one Python it will put it only there.<br />
<br />
As a test, in both (for me) "python" and "python3" say:<br />
from gi.repository import GExiv2 <br />
<br />
Let's not tell users that they should install self-built software into /usr. They shouldn't, and neither should you.<br />
Either /usr/local or /opt are better choices and more-or-less standard practice. To make the library findable one<br />
should either add the directory of choice to /etc/ld.so.conf and run ldconfig(8) or add it to $LD_LIBRARY_PATH in one's profile.<br />
<br />
<br />
FWIW it seems a bit simpler with Linux Mint Debian Update 6<br />
(Cinnamon)<br />
<br />
libexiv, etc, etc............. are already installed or can<br />
be installed via synaptic.<br />
<br />
Then<br />
git clone git://git.yorba.org/gexiv2" to get gexiv2 0.5;<br />
going into gexiv2/ and running<br />
./configure --enable-introspection<br />
make<br />
(as root) make install"<br />
installs in usr/local<br />
And<br />
python3<br />
from gi.repository import GExiv2"<br />
tests OK.<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : missing tiles : osm-gps-map problem.<br />
(Gramps.py:4515): OsmGpsMap-WARNING **: Error getting missing tile<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others.<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others. '''Solved''' : git pull the latest version. You must remove all libosmgps* from /usr/local/lib before make install<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ... '''Solved''' GTK3 available<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug #{{bug|6042}} - resolved<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug #{{bug|5972}} - resolved<br />
<pre> TypeError: Error when calling the metaclass bases<br />
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases</pre><br />
<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree built with debugging CFLAGS (-g -O0). At a minimum, in addition to Python itself, you'll need symbols for Gtk+ (libgtk-3.0.so and libgdk-3.0.so), PyGObject, and GLib.<br />
<br />
To see the python stack:<br />
(gdb) pystack<br />
<br />
This works with gdb7 as-is; for earlier versions, you need to install [http://svn.python.org/view/*checkout*/python/trunk/Misc/gdbinit?revision=77484 gdbinit] as .gdbinit in your home directory before starting gdb.<br />
On some systems (MacOS X in particular), the structure PyStringObject isn't exported in the debug symbols, so if you get the error <br />
No symbol "PyStringObject" in current context.<br />
then you need to tell gdb<br />
add-symbol-file /path/to/Python-build-dir/Objects/stringobject.o<br />
which will be possible only if you've built Python from source.<br />
<br />
<br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=44314GeoViewHelp2013-02-07T22:23:08Z<p>SergeNoiraud: /* Can we change the marker's color ? */</p>
<hr />
<div>==Geography==<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
If you want to use the animate functionality, click on the right button of the mouse. You'll get a popup menu.<br />
In this menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ( from 4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ( from 4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ( from 4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
<br />
The right button below is for one right handed person.<br />
This will be the left button for one left handed person.<br />
<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select Add place or Link place<br />
<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
===How to change the map provider ?===<br />
We have several available providers in gramps.<br />
Click on the right button of the mouse, you'll get a popup menu.<br />
In the bottom of this menu, you can select a new provider.<br />
The following providers are avalible :<br />
# OpenStreetMap<br />
# Maps For Free<br />
# OpenCycleMap<br />
# Public Transport<br />
# Google street<br />
# Google sat<br />
# Google hybrid<br />
# Virtualearth street<br />
# Virtualearth sat<br />
# Virtualearth hybrid<br />
<br />
===Can we change the marker's color ?===<br />
We can't do that. The marker's colors are hard coded in gramps.<br />
The colors are green for the following renderers : openstreetmap, Maps for free, Opencyclemap and Public transport.<br />
All others are red.<br />
<br />
===How to get/remove the crosshair ?===<br />
It can be useful to have the crosshair visible to see the center of the map.<br />
This functionality is available with the right button of the mouse. you'll get a popup menu.<br />
Select Add or Remove cross hair.<br />
<br />
===How to lock/unlock the map ?===<br />
When we change the map ( person to family, ... ), the zoom is recalculated.<br />
It can be useful in some case to keep the same zoom when we change the map.<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select lock or unlock zoom and position.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=44313GeoViewHelp2013-02-07T22:14:46Z<p>SergeNoiraud: </p>
<hr />
<div>==Geography==<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
If you want to use the animate functionality, click on the right button of the mouse. You'll get a popup menu.<br />
In this menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ( from 4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ( from 4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ( from 4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
<br />
The right button below is for one right handed person.<br />
This will be the left button for one left handed person.<br />
<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select Add place or Link place<br />
<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
===How to change the map provider ?===<br />
We have several available providers in gramps.<br />
Click on the right button of the mouse, you'll get a popup menu.<br />
In the bottom of this menu, you can select a new provider.<br />
The following providers are avalible :<br />
# OpenStreetMap<br />
# Maps For Free<br />
# OpenCycleMap<br />
# Public Transport<br />
# Google street<br />
# Google sat<br />
# Google hybrid<br />
# Virtualearth street<br />
# Virtualearth sat<br />
# Virtualearth hybrid<br />
<br />
===Can we change the marker's color ?===<br />
We can't do that. The marker's colors are hard coded in gramps.<br />
The colors are green for openstreetmap and openstreetmap rendered. All others are red.<br />
<br />
===How to get/remove the crosshair ?===<br />
It can be useful to have the crosshair visible to see the center of the map.<br />
This functionality is available with the right button of the mouse. you'll get a popup menu.<br />
Select Add or Remove cross hair.<br />
<br />
===How to lock/unlock the map ?===<br />
When we change the map ( person to family, ... ), the zoom is recalculated.<br />
It can be useful in some case to keep the same zoom when we change the map.<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select lock or unlock zoom and position.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=44312GeoViewHelp2013-02-07T21:57:19Z<p>SergeNoiraud: /* How to change the map provider ? */</p>
<hr />
<div>==Geography==<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
If you want to use the animate functionality, click on the right button of the mouse. You'll get a popup menu.<br />
In this menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
<br />
The right button below is for one right handed person.<br />
This will be the left button for one left handed person.<br />
<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select Add place or Link place<br />
<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
===How to change the map provider ?===<br />
We have several available providers in gramps.<br />
Click on the right button of the mouse, you'll get a popup menu.<br />
In the bottom of this menu, you can select a new provider.<br />
The following providers are avalible :<br />
# OpenStreetMap<br />
# Maps For Free<br />
# OpenCycleMap<br />
# Public Transport<br />
# Google street<br />
# Google sat<br />
# Google hybrid<br />
# Virtualearth street<br />
# Virtualearth sat<br />
# Virtualearth hybrid<br />
<br />
===Can we change the marker's color ?===<br />
We can't do that. The marker's colors are hard coded in gramps.<br />
The colors are green for openstreetmap and openstreetmap rendered. All others are red.<br />
<br />
===How to get/remove the crosshair ?===<br />
It can be useful to have the crosshair visible to see the center of the map.<br />
This functionality is available with the right button of the mouse. you'll get a popup menu.<br />
Select Add or Remove cross hair.<br />
<br />
===How to lock/unlock the map ?===<br />
When we change the map ( person to family, ... ), the zoom is recalculated.<br />
It can be useful in some case to keep the same zoom when we change the map.<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select lock or unlock zoom and position.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=44311GEPS 029: GTK3-GObject introspection Conversion2013-02-07T21:38:57Z<p>SergeNoiraud: /* OsmGpsMap for Geography */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
<br />
=== Ubuntu 12.10 (Linux Mint 14) ===<br />
<br />
On Ubuntu 12.10 (as of December 1, 2012), or Linux Mint 14 (as of December 24, 2012), you need only ('''replace python with python3 if you want to run the python 3 version!'''):<br />
<br />
sudo apt-get install python-dev libglib2.0-dev libcairo2-dev<br />
sudo apt-get install python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
sudo apt-get install gir1.2-freedesktop python-gi python-gobject python-gi-cairo<br />
sudo apt-get install gir1.2-pango-1.0 libgtkspell-3-0 python-gtkspell<br />
sudo apt-get install python-pyicu<br />
<br />
Old note ''The removal of python-gnome2 (and anything that relies on it) is necessary apparently because some "selectors" have not yet been converted. The right thing to do here is to fix the selectors rather than removing the package.'''<br />
<br />
You can also run Gramps 4.0+ in [[GEPS_031:_Python_3_support#Ubuntu_12.10|Python 3]] first Install the Python BSDDB interface and check that it [[Install_latest_BSDDB#Python_BSDDB_interface|works]]<br />
sudo apt-get install python3-bsddb3<br />
<br />
<br />
You will probably want these optional packages:<br />
<br />
sudo apt-get install python-pygoocanvas gir1.2-goocanvas-2.0-9<br />
<br />
For additional functionality, install these:<br />
<br />
sudo apt-get install python-pyexiv2<br />
<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.4.2-2. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.4.2-2_i386.deb<br />
<br />
=== GTK 3 theme ===<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. <br />
* Try gtk3-engines-oxygen.<br />
* install [http://www.webupd8.org/2012/09/customize-gtk3-gtk2-theme-colors-using.html GTK Theme Preferences]<br />
<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
* Elementary theme and warnings<br />
<br />
[[Image:Elementary_theme.png|thumb|431px|center|Default GTK3 elementary engine under Elementary OS]]<br />
<br />
If you see some warnings[https://bugs.launchpad.net/egtk/+bug/999277] by running Gramps with Elementary theme:<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:217:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:218:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:250:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:251:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: gtk-widgets.css:277:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:151:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: button.css:152:20: <br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
(Gramps.py:3359): Gtk-WARNING **: Theme parsing error: content-view.css:92:20:<br />
Not using units is deprecated. Assuming 'px'.<br />
<br />
then the best solution is maybe to try to fix it by yourself,<br />
/usr/share/themes/elementary/gtk-3.0/<br />
<br />
GtkSwitch {<br />
- text-shadow: 0 1 alpha (#fff, 0.4);<br />
+ text-shadow: 0 1px alpha (#fff, 0.4);<br />
- icon-shadow: 0 1 alpha (#fff, 0.4);<br />
+ icon-shadow: 0 1px alpha (#fff, 0.4);<br />
..<br />
<br />
and to provide a patch for this theme! <br />
http://bazaar.launchpad.net/~elementary-design/egtk/egtk-2a/files/head:/gtk-3.0/<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, you need [http://gtkspell.sourceforge.net/ gtkspell 3.3.0]. <br />
<br />
(In Ubuntu 12.10, the libgtkspell-3-0 package is not suitable [https://bugs.launchpad.net/ubuntu/+source/gtkspell3/+bug/1114403] as it is API incompatible with the official release 3.0.0, released on 2012-11-12 )<br />
<br />
If the package is not in your distributions packages, you need to compile the spell check. For this, obtain the GtkSpell 3.3.0 or later source code, and extract the code to a directory, eg gtkspell3, and go into this directory using the terminal.<br />
<br />
Before continuing, remove any old version of gtkspell v3 you might have installed before!<br />
<br />
Now obtain the packages needed to compile this code. <br />
<br />
Install the program 'hg' to get the code.<br />
sudo apt-get install mercurial<br />
<br />
Download the Gtkspell code with:<br />
hg clone http://hg.code.sf.net/p/gtkspell/code gtkspell-code<br />
<br />
You may need to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. By copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python Gramps.py<br />
<br />
[[File:Gtkspell working on gramps40.png|thumb|300px|Gtkspell working on gramps40 - You can tell because it does not recognise the word Gramps in the welcome Gramplet]]<br />
{{-}}<br />
<br />
==== Install your Dictionary ====<br />
If your language is missing from the list of dictionaries to spellcheck against you can install them.<br />
<br />
eg: For Australian English:<br />
sudo apt-get install myspell-en-au<br />
<br />
You can check that the language installed correctly by running<br />
enchant-lsmod -list-dicts<br />
<br />
The result should list all the language dictionaries installed and include the one you installed <br />
eg:<br />
en_AU (myspell)<br />
<br />
==== Old install method ====<br />
we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision [http://sourceforge.net/p/gramps/code/20130/tree/trunk/src/gui/spell.py 20130].<br />
<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The [[Gramps_4.0_Wiki_Manual_-_Categories#Geography_Category|Geography]] requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
<br />
I finished to convert osmgpsmap from gtk2 to gtk3. it's now in trunk. John added some new patchs and it works correctly since 2013/2/06.<br />
My repository must not be used. So we can now use :<br />
<br />
git clone git://github.com/nzjrs/osm-gps-map.git<br />
cd osm-gps-map<br />
<br />
As we can have some new patches, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
<br />
You need to install gnome-common from the GNOME SVN<br />
sudo apt-get install gnome-common<br />
<br />
and<br />
<br />
sudo apt-get install gtk-doc-tools<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Eg, I start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
<br />
or<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python -c 'from gramps.grampsapp import main; main()'<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
==== Linux Mint 14.1 ====<br />
<br />
The Patches mentioned above are (as of 2013/1/27) in the main osm-gps-map git repository so you can use:<br />
<br />
git clone git://github.com/nzjrs/osm-gps-map.git<br />
<br />
For Linux Mint you also need the gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
Start up Gramps with:<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python Gramps.py<br />
<br />
or<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python -c 'from gramps.grampsapp import main; main()'<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug [http://www.gramps-project.org/bugs/view.php?id=6042 #6042]<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug [http://www.gramps-project.org/bugs/view.php?id=5972 #5972]<br />
<pre> TypeError: Error when calling the metaclass bases<br />
metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases</pre><br />
* Geography : missing tiles : osm-gps-map problem.<br />
(Gramps.py:4515): OsmGpsMap-WARNING **: Error getting missing tile<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others.<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others. '''Solved''' : git pull the latest version. You must remove all libosmgps* from /usr/local/lib before make install<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ... '''Solved''' GTK3 available<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree built with debugging CFLAGS (-g -O0). At a minimum, in addition to Python itself, you'll need symbols for Gtk+ (libgtk-3.0.so and libgdk-3.0.so), PyGObject, and GLib.<br />
<br />
To see the python stack:<br />
(gdb) pystack<br />
<br />
This works with gdb7 as-is; for earlier versions, you need to install [http://svn.python.org/view/*checkout*/python/trunk/Misc/gdbinit?revision=77484 gdbinit] as .gdbinit in your home directory before starting gdb.<br />
On some systems (MacOS X in particular), the structure PyStringObject isn't exported in the debug symbols, so if you get the error <br />
No symbol "PyStringObject" in current context.<br />
then you need to tell gdb<br />
add-symbol-file /path/to/Python-build-dir/Objects/stringobject.o<br />
which will be possible only if you've built Python from source.<br />
<br />
<br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=Gramps_Old_database&diff=40017Gramps Old database2012-10-21T12:16:42Z<p>SergeNoiraud: </p>
<hr />
<div>{{languages|Old_database}}<br />
<br />
==Introduction==<br />
<br />
If you have an old [[GRAMPS_XML|Gramps XML]] database generated '''some years ago''', then you may have some difficulties to import it into last stable release. <br />
<br />
'''Gramps-1''' did not store '''[[Events_in_GRAMPS|event]]''' as primary object and did not use bsddb references. <br />
<br />
There was some [[Database_Formats#GRAMPS_1.0_and_earlier|limitations]] (''size, informations, encoding''), '''new Gramps versions''' tried to fix them.<br />
<br />
==Solutions==<br />
<br />
* The safety way is to import it into '''[http://sourceforge.net/projects/gramps/files/Stable/2.2.10/ Gramps-2]''' and to export this updated database. This will generate a new Gramps XML more compatible for an import into '''Gramps-3'''.<br />
**If your operating system does not support '''Gramps-2''' any more as some dependancies has been removed since '''Gramps-2''' (''GCONF, gnome-doc-utils, yelp, python-reportlab, libglade, etc...'') or updated like python libs and related, then you could have a look at [[Linux_Genealogy_CD|Linux Genealogy Live CD]] archives.<br />
<br />
* Also, you may [[Using_the_bug_tracker|submit your old database on bug-tracker]], mark this report as '''private''' (''will be hidden for non-developers'') and a developer will try to help you for updating your database.<br />
<br />
* related to bug 6129 : I downloaded the gramps 2.2.10 on my ubuntu 11.10 and did the following :<br />
$ tar xzvf gramps-2.2.10.tar.gz<br />
$ ./autogen.sh<br />
$ make<br />
$ python src/gramps.py<br />
then<br />
* import the 20060115.grdb ( your grdb file )<br />
* export in gramps xml<br />
<br />
You can now load the new created file in your last gramps version. I hope it will work for everybody.<br />
<br />
I choosed 2.2.10 because the original file was 20060115 : at this period, gramps was 2.2. or 2.0.<br />
So I used the last 2.2 available version.<br />
If this had not worked, I think I would have tried the last 2.0.11 available version.<br />
<br />
==Experimental==<br />
<br />
XML databases generated by '''Gramps-1''' are not lost as they are written into a documented open format.<br />
<br />
If a XML/XSL wizard planned to generate a script, [[Media:123xsl.gz|here]] an experimental and partial test, which try to migrate a part of data to an other Gramps XML file, according to last [http://gramps-project.org/xml/ XML DTD]. <br />
<br />
Event, Repository and Note references are broken because they was not primary objects on '''Gramps-1'''. If someone knows how to handle this, then feel free to do changes.<br />
<br />
[[Category:Documentation]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39895GEPS 029: GTK3-GObject introspection Conversion2012-10-12T16:15:59Z<p>SergeNoiraud: </p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I forked osmgpsmap.<br />
<br />
git clone git://github.com/SNoiraud/osm-gps-map.git<br />
cd osm-gps-map<br />
# switch to branch gtk3<br />
git checkout -b gtk3 origin/gtk3<br />
git branch -a<br />
<br />
As I'm currently modifying osm-gps-map, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Eg, I start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ...<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug [http://www.gramps-project.org/bugs/view.php?id=6042 #6042]<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug [http://www.gramps-project.org/bugs/view.php?id=5972 #5972]<br />
* Geography : missing tiles : osm-gps-map problem.<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others.<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others. '''Solved''' : git pull the latest version. You must remove all libosmgps* from /usr/local/lib before make install<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39894GEPS 029: GTK3-GObject introspection Conversion2012-10-12T15:53:59Z<p>SergeNoiraud: /* Open */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I forked osmgpsmap.<br />
<br />
git clone git://github.com/SNoiraud/osm-gps-map.git<br />
cd osm-gps-map<br />
# switch to branch gtk3<br />
git checkout -b gtk3 origin/gtk3<br />
git branch -a<br />
<br />
As I'm currently modifying osm-gps-map, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Eg, I start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ...<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug [http://www.gramps-project.org/bugs/view.php?id=6042 #6042]<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug [http://www.gramps-project.org/bugs/view.php?id=5972 #5972]<br />
* Geography : missing tiles : osm-gps-map problem.<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
* Geography : We cannot mix osmgpsmap between trunk and gramps34 and others.<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39884GEPS 029: GTK3-GObject introspection Conversion2012-10-10T16:58:15Z<p>SergeNoiraud: /* OsmGpsMap for Geography */</p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/GtkSpell-3.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I forked osmgpsmap.<br />
<br />
git clone git://github.com/SNoiraud/osm-gps-map.git<br />
cd osm-gps-map<br />
# switch to branch gtk3<br />
git checkout -b gtk3 origin/gtk3<br />
git branch -a<br />
<br />
As I'm currently modifying osm-gps-map, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
You may also need gtk3 devel packages:<br />
sudo apt-get install gtk+-3.0-dev<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
or<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-0.8.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Eg, I start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ...<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug [http://www.gramps-project.org/bugs/view.php?id=6042 #6042]<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug [http://www.gramps-project.org/bugs/view.php?id=5972 #5972]<br />
* Geography : missing tiles : osm-gps-map problem.<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
* No rows_reordered function on treemodels in python, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=684558]. Current fix: disconnect and reconnect the model so sort need not emit rows-reordered signal. However, this means the history of expand collapse of nodes in a treeview is lost after rows have been reordered (this happens in gramps on click on the column that is already sorted.<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39626GEPS 029: GTK3-GObject introspection Conversion2012-09-16T18:58:03Z<p>SergeNoiraud: </p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/Gtkspell-1.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I forked osmgpsmap.<br />
<br />
git clone git://github.com/SNoiraud/osm-gps-map.git<br />
cd osm-gps-map<br />
# switch to branch gtk3<br />
git checkout -b gtk3 origin/gtk3<br />
git branch -a<br />
<br />
As I'm currently modifying osm-gps-map, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-1.0.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Eg, I start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ...<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug [http://www.gramps-project.org/bugs/view.php?id=6042 #6042]<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug [http://www.gramps-project.org/bugs/view.php?id=5972 #5972]<br />
* Geography : missing tiles : osm-gps-map problem.<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography : bad placement of markers : osm-gps-map problem. '''Solved''' : git pull the latest version. Need to be acknowledge by osm-gps-map team.<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39598GEPS 029: GTK3-GObject introspection Conversion2012-09-15T19:57:40Z<p>SergeNoiraud: </p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/Gtkspell-1.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I forked osmgpsmap.<br />
<br />
git clone git://github.com/SNoiraud/osm-gps-map.git<br />
cd osm-gps-map<br />
# switch to branch gtk3<br />
git checkout -b gtk3 origin/gtk3<br />
git branch -a<br />
<br />
As I'm currently modifying osm-gps-map, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-1.0.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Eg, I start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
=== Open ===<br />
* We cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401] It seems we can do without this, so not an issue at the moment<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion. '''In Progress''': Geography really minimalist : no menu, no markers, ...<br />
* pyexiv2 module causes a segmentation fault when exiting Gramps - see bug [http://www.gramps-project.org/bugs/view.php?id=6042 #6042]<br />
* python-gnome2 package causes a segmentation fault when Gramps starts - see bug [http://www.gramps-project.org/bugs/view.php?id=5972 #5972]<br />
* Geography : bad placement of markers : osm-gps-map problem.<br />
* Geography : missing tiles : osm-gps-map problem.<br />
* Geography : for all other problems, use last version with git pull. Be careful, osm-gps-map is now 0.8. You must remove all 1.0 versions (OsmGpsMap*.gir and OsmGpsMap*.typelib)<br />
<br />
===Solved or workaround===<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]. '''Workaround''': we use a global function that calls this once as workaround. There is a fix upstream.<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''Solved:''' Although our catalog cannot be opened, we can use glade with undefined elements without issues.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39381GEPS 029: GTK3-GObject introspection Conversion2012-09-09T21:10:07Z<p>SergeNoiraud: </p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/Gtkspell-1.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I forked osmgpsmap.<br />
<br />
git clone git://github.com/SNoiraud/osm-gps-map.git<br />
cd osm-gps-map<br />
# switch to branch gtk3<br />
git checkout -b gtk3 origin/gtk3<br />
git branch -a<br />
<br />
As I'm currently modifying osm-gps-map, If you already have osm-gps-map and you want to get the last version, do :<br />
<br />
git pull<br />
<br />
You might have all your dependencies as you already compiled pygobject. For Ubuntu you still need packages libsoup2.4-dev and libsoup2.4<br />
<br />
Now compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-1.0.typelib /usr/lib/girepository-1.0/<br />
<br />
To use this now, you have to, or remove the installed version of osmgpsmap on your computer, or set the LD_LIBRARY_PATH to point at the installed version. Eg, I start Gramps in trunk with:<br />
<br />
LD_LIBRARY_PATH=/usr/local/lib PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
<br />
First sets library to ''/usr/local/lib'' so as to find osmgpsmap and gtkspell, second ''/usr/local/lib/python2.7/site-packages/'' to find the local install of pygobject<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* we cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401]<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''SOLVED:''' converted editevent.glade, all works<br />
* expose is no longer present on gtk.widget. Draw must be used. Unclear how, [https://mail.gnome.org/archives/commits-list/2010-December/msg01138.html].<br />
* Gtk.Clipboard seems to work differently<br />
* Pedigreeview is broken and must be converted to new drawing primitives. Same probably for fanchart.<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography really minimalist : no menu, no markers, ...<br />
<br />
<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39139GEPS 029: GTK3-GObject introspection Conversion2012-09-01T09:24:08Z<p>SergeNoiraud: </p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/Gtkspell-1.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I forked osmgpsmap.<br />
<br />
git clone git://github.com/SNoiraud/osm-gps-map.git<br />
cd osm-gps-map<br />
# switch to branch gtk3<br />
<br />
You normaly have all your dependencies as you already compile pygobject<br />
depending on your distribution, you can add the missing packages here<br />
<br />
Then compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-1.0.typelib /usr/lib/girepository-1.0/<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* we cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401]<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''SOLVED:''' converted editevent.glade, all works<br />
* expose is no longer present on gtk.widget. Draw must be used. Unclear how, [https://mail.gnome.org/archives/commits-list/2010-December/msg01138.html].<br />
* Gtk.Clipboard seems to work differently<br />
* Pedigreeview is broken and must be converted to new drawing primitives. Same probably for fanchart.<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
* Geography really minimalist : no menu, no markers, ...<br />
<br />
<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GEPS_029:_GTK3-GObject_introspection_Conversion&diff=39021GEPS 029: GTK3-GObject introspection Conversion2012-08-29T16:20:07Z<p>SergeNoiraud: </p>
<hr />
<div>Gramps was written with GTK 2 toolkit. This has been replaced upstream with GTK 3, so Gramps should convert to GTK 3.<br />
<br />
== Guideline ==<br />
We try to convert 1 to 1. If there are problems due to deprecated features, or otherwise, add in the code:<br />
<br />
# TODO GTK3: write what problem is due to gtk 3 conversion<br />
<br />
Before release, all TODO GTK3 in the code must be cleaned up<br />
<br />
== Documentation ==<br />
Python GTK3 docs: [http://python-gtk-3-tutorial.readthedocs.org/en/latest/index.html]<br />
<br />
Alternative is to look at the base C documentation, and understand from experience how the introspection works. Gnome docs: [http://developer.gnome.org/gtk3/index.html].<br />
<br />
As python works with classes, it looks somewhat like the C++ interface: [http://developer.gnome.org/gtkmm/stable/]. To investigate the specific override (how to init Gtk classes):<br />
* python overrides: [http://git.gnome.org/browse/pygobject/tree/gi/overrides]<br />
<br />
Furthermore, for the other gi libs:<br />
* [http://developer.gnome.org/pango/stable/pango-Cairo-Rendering.html PangoCairo]<br />
* [http://developer.gnome.org/pango/stable/pango.html Pango]<br />
* [http://developer.gnome.org/ http://developer.gnome.org/]<br />
<br />
== Installation ==<br />
=== Ubuntu 12.04 ===<br />
For people on Ubuntu 12.04, you need:<br />
<br />
1. add the gnome_shell repo to have the latest version of glib and friends, see how to add the ppa on:<br />
[http://www.ubuntuupdates.org/ppa/gnome_shell?dist=precise gnome_shell pppa]<br />
Then upgrade your system via the system manager. <br />
<br />
Note 1 : If you use Gnome3, also add the gnome3 ppa!<br />
<br />
Note 2: this can make gnome shell unstable if the ppa is too bleeding edge!!<br />
<br />
2. install version 3.3.2 of pygobject. No ppa for this, I use the git repo on gnome.org, so my git config:<br />
[remote "origin"]<br />
fetch = +refs/heads/*:refs/remotes/origin/*<br />
url = http://git.gnome.org/browse/pygobject<br />
<br />
So to install it to folder pygobject, do <br />
<br />
git clone git://git.gnome.org/pygobject pygobject<br />
<br />
Then checkout tag 3.3.2, so<br />
<br />
cd pygobject<br />
git checkout 3.3.2<br />
<br />
Make sure you have the dependencies installed, you will need:<br />
:# libglib2.0-dev package (otherwise you will obtain an error like ''undefined mqcro: AM_PATH_GLIB_2_0''. <br />
:# autoconf, automake, libtool, intltool package<br />
:# python-dev package<br />
:# libcairo2-dev, python-cairo-dev<br />
:# python-gobject-dev<br />
:# libgirepository1.0-dev<br />
So, use the line:<br />
<br />
sudo apt-get install autoconf automake libtool python-dev libglib2.0-dev libcairo2-dev python-cairo-dev python-gobject-dev libgirepository1.0-dev<br />
<br />
Then compile pygobject:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
<br />
Now this installs to /usr/local, so to run the test with that, on ubuntu in your terminal:<br />
<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python gramps.py<br />
<br />
If you then get:<br />
<br />
<pre><br />
$ PYTHONPATH=/usr/local/lib/python2.7/site-packages/ python src/gramps.py<br />
Gtk typelib not installed. Install Gnome Introspection, and pygobject version 3.3.2 or later.<br />
<br />
Gramps will terminate now.<br />
</pre><br />
<br />
You may need to:<br />
<br />
export LD_LIBRARY_PATH=/usr/local/lib<br />
<br />
Also, I had to get rid of the older gobject:<br />
<br />
sudo rm -rf /usr/lib/python2.7/dist-packages/gobject<br />
<br />
=== Debian Testing ===<br />
As of 25 July 2012, the Debian repositories does not contain sufficiently up-to-date python GObject introspection packages and so need to be installed from the experimental repository, which currently contains version 3.3.4. Perhaps the simplest way to install is just to download the latest packages from the Debian packages web site. The files required can be found for different architectures at:<br />
<br />
* [http://packages.debian.org/experimental/python-gi python-gi]<br />
* [http://packages.debian.org/experimental/python-gi-cairo python-gi-cairo]<br />
<br />
Install the package files with dpkg. eg<br />
<br />
dpkg -i python-gi_3.3.4-1_i386.deb<br />
<br />
A GTK3 theme engine is required to make Gramps look visually more appealing. Try gtk3-engines-oxygen.<br />
<br />
=== GTK 3 theme ===<br />
If Gramps looks ugly in GTK 3, you probably are not using a GTK 3 theme. In that case, GTK falls back to the Raleigh theme. <br />
<br />
[[Image:gramps-gtk3-raleigh.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
The solution is to install a theme that comes with a GTK 3 theme. For example the Adwaita theme:<br />
<br />
[[Image:gramps-gtk3.png|center|550px|Gramps in GTK3 Adwaita theme]]<br />
<br />
For a good dark theme, consider elementary-dark-theme, installable from [http://www.noobslab.com/2012/06/install-elementary-dark-gtk3-theme-on.html]<br />
<br />
[[Image:gramps-gtk3-elementarydark.png|center|550px|Gramps in GTK3 elementary dark theme]]<br />
<br />
==== KDE ====<br />
To set the theme, open gramps, and open '''System settings -> Application Appearance -> GTK+ Appearance''', and select different theme, click on apply. If you see Gramps update completely, you have selected a theme with GTK 3 support. If the theme falls back to something consisting of Raleigh theme components, the theme does not have good GTK 3 support. Even if Gramps updates, not all elements visible will update. Restart Gramps to be sure the theme works as intended. You can install gtk-theme-switch to test themes.<br />
<br />
=== Spell Check Install ===<br />
For working spell check, we need a patched gtkspell version that supports gobject introspection. A working version is the '''changes''' branch at [https://github.com/manisandro/gtkspell3/tree/changes https://github.com/manisandro/gtkspell3/tree/changes]. So one needs to install this version of gtkspell. The python-gtkspell code is then no longer needed, and can be removed. Source of this code is a sourceforge bug entry [https://sourceforge.net/tracker/index.php?func=detail&aid=3298132&group_id=7896&atid=107896] and a redhat bug entry: [https://bugzilla.redhat.com/show_bug.cgi?id=675504]<br />
<br />
Gramps supports this version since revision 20130: [http://gramps.svn.sourceforge.net/viewvc/gramps/trunk/src/gui/spell.py?r1=20057&r2=20130]<br />
<br />
==== Installation of spell check in Ubuntu 12.04 ====<br />
First we install the git package to obtain the code: <br />
sudo apt-get install git<br />
Obtain the source code, and change to the version with gtk3 and gobject introspection support:<br />
git clone git://github.com/manisandro/gtkspell3.git<br />
cd gtkspell3/<br />
git checkout -b changes origin/changes<br />
Now obtain the packages needed to compile this code. In my case I had most code (see above installation introspection for other packages that might be needed). I still needed to install the following:<br />
sudo apt-get install gtk-doc-tools libenchant-dev<br />
Now compile and install the code<br />
./autogen.sh<br />
make<br />
sudo make install<br />
Gramps now needs to find the gtkspell typelib and introspection lib. The first I achieve by copying the typelib to the correct location:<br />
sudo cp /usr/local/lib/girepository-1.0/Gtkspell-1.0.typelib /usr/lib/girepository-1.0/<br />
The lib can be found by path by setting the LD_LIBRARY_PATH environment variable. Hence, start Gramps as follows:<br />
LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
If you followed the guide above and compiled your own pygobject module, you need to start Gramps with the command<br />
PYTHONPATH=/usr/local/lib/python2.7/site-packages/ LD_LIBRARY_PATH=/usr/local/lib python src/gramps.py<br />
<br />
=== WebKit for Htmlrenderer ===<br />
The htmlview requires WebKit. Introspection bindings for this is available, in Ubuntu package gir1.2-webkit-3.0<br />
<br />
Developerwize, we need to replace size-request signal, see [http://developer.gnome.org/gtk3/3.0/ch25s02.html]<br />
<br />
== Problems ==<br />
<br />
If anyone files a bug against PyGobject, Gtk or any of the Gtk dependencies (except Cairo, which isn't part of Gnome), please add John (the address bugzilla has is jralls@ceridwen.fremont.ca.us) to the CC list at the bottom of the bug report page or post the bug URI to the gramps-devel list.<br />
<br />
* there are some drag and drop issues: [https://bugzilla.gnome.org/show_bug.cgi?id=680638], [https://bugzilla.gnome.org/show_bug.cgi?id=680640]. '''Solved:''' Use set_target_list functions for drag and drop with a created TargetList.<br />
* we cannot set strings in struct, see GTK bug [https://bugzilla.gnome.org/show_bug.cgi?id=678401]<br />
* error in list_families on textview in styledtexteditor: [https://bugzilla.gnome.org/show_bug.cgi?id=679654]<br />
* str and unicode no longer seem to work, the encoding must be passed too; '''Future: deprecate unicode() in the code, as we want to support python 3''' - '''SOLVED FOR NOW'': added reload(sys) in gramps.py and set encoding to utf-8. Is there a better way that is userfriendly?<br />
* there is no longer automatic conversion to str utf-8 when using GTK functions, we must convert before passing to GTK.<br />
* glade can no longer work with our catalog. We need to upgrade comboboxentry to combobox with has_entry manually, and hope editors keep working... - '''SOLVED:''' converted editevent.glade, all works<br />
* expose is no longer present on gtk.widget. Draw must be used. Unclear how, [https://mail.gnome.org/archives/commits-list/2010-December/msg01138.html].<br />
* Gtk.Clipboard seems to work differently<br />
* Pedigreeview is broken and must be converted to new drawing primitives. Same probably for fanchart.<br />
* osmgpsmap is GTK2. There is a GTK3 branch in git, we should try it, and contribute to the conversion.<br />
* menu.popup does not seem to work in some instances. '''Solved:''' Make sure the reference to menu survives, so eg, do self.menu= function, then self.menu.popup. Alternatively, passing position function seems to also work as workaround, see grampsbar.py for example<br />
* Many Gtk elements no longer grab certain events. '''Solved:''' Add a Gtk.EventBox under them to grab the event.<br />
<br />
=== OsmGpsMap for Geography ===<br />
The Geography requires osmgpsmap. Introspection bindings for this is not currently available, so you need to compile it.<br />
As it doesn't work correctly for the moment and some patches are not in git, I made one tar file.<br />
I put it on the bug #{{bug|5009}}<br />
<br />
tar jxvf osmgpsmap.tar.bz2<br />
cd osmgpsmap<br />
<br />
You normaly have all your dependencies as you already compile pygobject<br />
depending on your distribution, you can add the missing packages here<br />
<br />
Then compile osmgpsmap:<br />
<br />
./autogen.sh<br />
make<br />
sudo make install<br />
sudo cp /usr/local/lib/girepository-1.0/OsmGpsMap-1.0.typelib /usr/lib/girepository-1.0/<br />
<br />
== Problems ==<br />
For the moment it doesn't work:<br />
<br />
No menu<br />
<br />
No zoom<br />
<br />
<br />
== Related Gramps Bugs ==<br />
* #{{bug|5009}}: Use gobject introspection for GTK 3 dependency<br />
<br />
== How to investigate a hard crash?==<br />
With GTK 3, hard crashes are a lot more likely than before. Very troubling for a python developer, as you do not know where the crash happens. So, to investigate these, do the following.<br />
<br />
First install python with debug symbols, in Ubuntu:<br />
<br />
sudo apt-get install python-dbg<br />
<br />
Now, you can start python with gdb<br />
<br />
$ > gdb python<br />
(gdb) set env GRAMPSCODE /path/to/code/gramps/src<br />
(gdb) set env PYTHONPATH $PYTHONPATH:$GRAMPSHOME:/usr/local/lib/python2.7/site-packages/<br />
(gdb) r $GRAMPSCODE/gramps.py<br />
...after the crash...<br />
(gdb) bt<br />
<br />
This works best if you have the debug symbols installed for everything relevant, or are running from a self-built tree. <br />
<br />
[[Category:GEPS|G]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37882GeoViewHelp2012-07-09T18:52:34Z<p>SergeNoiraud: </p>
<hr />
<div>==Geography==<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
If you want to use the animate functionality, click on the right button of the mouse. You'll get a popup menu.<br />
In this menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
<br />
The right button below is for one right handed person.<br />
This will be the left button for one left handed person.<br />
<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select Add place or Link place<br />
<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
===How to change the map provider ?===<br />
We have several available providers in gramps.<br />
Click on the right button of the mouse, you'll get a popup menu.<br />
In the bottom of this menu, you can select a new provider.<br />
The following providers are avalible :<br />
# openstreetmap<br />
# openstreetmap renderer<br />
# openaerialmap<br />
# maps for free<br />
# google street<br />
# google sat<br />
# google hybrid<br />
# virtualearth street<br />
# virtualearth sat<br />
# virtualearth hybrid<br />
# yahoo street ( doesn't work and mapped to openstreetmap )<br />
# yahoo sat ( doesn't work and mapped to openstreetmap )<br />
# yahoo hybrid ( doesn't work and mapped to openstreetmap )<br />
I don't know why the three last one doesn't work. It's an osmgpsmap internal limitation.<br />
<br />
===Can we change the marker's color ?===<br />
We can't do that. The marker's colors are hard coded in gramps.<br />
The colors are green for openstreetmap and openstreetmap rendered. All others are red.<br />
<br />
===How to get/remove the crosshair ?===<br />
It can be useful to have the crosshair visible to see the center of the map.<br />
This functionality is available with the right button of the mouse. you'll get a popup menu.<br />
Select Add or Remove cross hair.<br />
<br />
===How to lock/unlock the map ?===<br />
When we change the map ( person to family, ... ), the zoom is recalculated.<br />
It can be useful in some case to keep the same zoom when we change the map.<br />
For this, click on the right button of the mouse, you'll get a popup menu.<br />
In this menu, you can select lock or unlock zoom and position.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37881GeoViewHelp2012-07-09T18:14:19Z<p>SergeNoiraud: /* All known places for one person */</p>
<hr />
<div>==Geography==<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
If you want to use the animate functionality, click on the right button of the mouse. You'll get a popup menu.<br />
In this menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37491GeoViewHelp2012-06-04T10:36:26Z<p>SergeNoiraud: </p>
<hr />
<div>==Geography==<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ( not in 3.4.0 ) ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37311GeoViewHelp2012-05-26T20:55:13Z<p>SergeNoiraud: /* Geography */</p>
<hr />
<div>==Geography==<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37310GeoViewHelp2012-05-26T20:41:58Z<p>SergeNoiraud: </p>
<hr />
<div>==Geography==<br />
Work in progress: Serge<br />
<br />
Need to add images<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
<br />
=== The different views ===<br />
{| <br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one person ====<br />
|- <br />
| valign="top" |<br />
[[Image:gramps-person-11.png|left|frameless|200px|The person]]<br />
<br />
| valign="top" |<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
| valign="top" |<br />
[[Image:gramps-configuration-2.png|right|thumb|100px|The animation]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places for one family ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-10.png|left|frameless|200px|The family]]<br />
| valign="top" |<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have they been able to meet ? ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-person-meeting-9.png|left|frameless|200px| Persons meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== Have these two families been able to meet ? ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-family-meeting-8.png|left|frameless|200px| Families meeting?]]<br />
<br />
| valign="top" |<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
| valign="top" |<br />
[[Image:gramps-configuration-3.png|right|thumb|100px|The selection]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All displacements for one person and their descendants ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-geomoves-5.png|left|frameless|200px| Moves]]<br />
<br />
| valign="top" |<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
| valign="top" |<br />
[[Image:gramps-configuration-4.png|right|thumb|100px|Parameters for moves]]<br />
<br />
|-<br />
!colspan="3" align="left" |<br />
==== All places related to events ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-events-7.png|left|frameless|200px| Events]]<br />
<br />
| valign="top" |<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|-<br />
!colspan="3" align="left" |<br />
==== All known places ====<br />
|-<br />
| valign="top" |<br />
[[Image:gramps-places-6.png|left|frameless|200px| Places]]<br />
<br />
| valign="top" |<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
<br />
|<br />
|}<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
[[Image:gramps-configuration-1.png|right|thumb|100px|The map]]<br />
<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]<br />
<br />
{{Free screenshot|GPL}}<br />
All images on this page are free screenshots</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-configuration-1.png&diff=37309File:Gramps-configuration-1.png2012-05-26T18:59:36Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-places-6.png&diff=37308File:Gramps-places-6.png2012-05-26T18:59:30Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-events-7.png&diff=37307File:Gramps-events-7.png2012-05-26T18:56:37Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-geomoves-5.png&diff=37306File:Gramps-geomoves-5.png2012-05-26T18:55:28Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-configuration-4.png&diff=37305File:Gramps-configuration-4.png2012-05-26T18:54:45Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-family-meeting-8.png&diff=37304File:Gramps-family-meeting-8.png2012-05-26T18:52:40Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-person-meeting-9.png&diff=37303File:Gramps-person-meeting-9.png2012-05-26T18:51:30Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-configuration-3.png&diff=37302File:Gramps-configuration-3.png2012-05-26T18:49:16Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-family-10.png&diff=37301File:Gramps-family-10.png2012-05-26T18:48:22Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-person-11.png&diff=37300File:Gramps-person-11.png2012-05-26T18:47:16Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=File:Gramps-configuration-2.png&diff=37296File:Gramps-configuration-2.png2012-05-26T18:22:12Z<p>SergeNoiraud: </p>
<hr />
<div></div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37295GeoViewHelp2012-05-26T15:04:50Z<p>SergeNoiraud: </p>
<hr />
<div>==Geography==<br />
Work in progress: Serge<br />
<br />
Need to add images<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
'''''BE CAREFUL''''' : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
=== The different views ===<br />
==== All known places for one person ====<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the menu popup, you can select 'animate' to see the life way of the current person :<br />
<br />
If the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps. The moves start at the first event year until the last event year.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
<br />
==== All known places for one family ====<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
==== Have they been able to meet ? ====<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
<br />
==== Have these two families been able to meet ? ====<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
<br />
==== All displacements for one person and their descendants ====<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
==== All places related to events ====<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
==== All known places ====<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom : force to no center and no autozoom. Useful when we want to see a selected area of the map.<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37248GeoViewHelp2012-05-23T19:11:49Z<p>SergeNoiraud: </p>
<hr />
<div>==Geography==<br />
Work in progress: Serge<br />
<br />
Need to add images<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
If you have internet active, for all moves on the map, all zoom ... all tiles are saved.<br />
When you are without internet, all tiles cached in a previous session can be used.<br />
So, the map can be used without internet.<br />
<br />
The only thing to do is for each place or area you want to use without an internet connection is to<br />
select them, zoom into these places. You'll be able to use them again without connection.<br />
<br />
BE CAREFUL : it can takes gigabytes. If you use several maps, you need to have this same gigabytes size multiply by the number of map used.<br />
=== The different views ===<br />
==== All known places for one person ====<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the menu popup, you can animate the life way of the current person.<br />
# animate : if the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps.<br />
<br />
In the configuration menu, you can set the following :<br />
#The animation speed in milliseconds. <br />
#How many steps betwwen two markers for long moves.<br />
#The minimum latitude/longitude to select large move. This value is in tenth of degree.<br />
==== All known places for one family ====<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
You have no extra option in the configuration menu.<br />
==== Have they been able to meet ? ====<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
<br />
==== Have these two families been able to meet ? ====<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
When the reference family is active, you'll see all its members's life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
This value is defined in tenth of degree.<br />
<br />
==== All displacements for one person and their descendants ====<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the configuration menu, you can :<br />
#Set the maximum generation to show<br />
#Set the time in milliseconds between two generation drawing.<br />
==== All places related to events ====<br />
This view is used to show all places related to events.<br />
It can take some time to show when we have many events.<br />
<br />
You have no extra option in the configuration menu.<br />
==== All known places ====<br />
This view show all places with coordinates in the database.<br />
<br />
You have no extra option in the configuration menu.<br />
==Usage==<br />
===The configuration===<br />
====All views====<br />
# Where to save the tiles of the map. Be careful, it can take several gigabytes.<br />
# The zoom level when we center the map<br />
====Specific views====<br />
See the description of the view.<br />
===The mouse actions on the map===<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]</div>SergeNoiraudhttps://gramps-project.org/wiki/index.php?title=GeoViewHelp&diff=37247GeoViewHelp2012-05-23T17:16:00Z<p>SergeNoiraud: </p>
<hr />
<div>==Geography==<br />
Not finished. I'm working on this page ( Serge )<br />
<br />
To have these views working correctly, you need to have events related to places.<br />
These places must have coordinates : latitude and longitude.<br />
<br />
If one place has no coordinates, we'll never see it on the map.<br />
<br />
here are different ways to add coordinates to places :<br />
# Within the menu popup you can link or add one place.<br />
# ...<br />
<br />
=== The different views ===<br />
==== All known places for one person ====<br />
This view show all places visited by one person during his life.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
In the menu popup, you can animate the life way of the current person.<br />
# animate : if the active person has several related events, you can see a virtual move between those markers. The move is related to years or distance and can be modified in the person map preferences. If the distance between to markers is greater than a value in tenth of degree, we show moves depending on distance instead of years. In these case, the number of steps between these two markers can be modified. You can modify the animation speed between steps.<br />
<br />
==== All known places for one family ====<br />
This view show all places visited by all family's members during their life.<br />
<br />
This view is not connected to filters. It only depend on the active family and the history.<br />
<br />
==== Have they been able to meet ? ====<br />
This view is used to show if two persons were able to meet during their life.<br />
<br />
You must select one reference person :<br />
#In the menu popup : Choose the reference person<br />
#In the toolbar<br />
<br />
When the reference person is active, you'll see its life way.<br />
For each known place with coordinates, you'll see a circle or an ovale depending on the longitude.<br />
<br />
The circle radius can be tuned in the configuration view.<br />
==== Have these two families been able to meet ? ====<br />
This view is used to show if two families were able to meet during their life.<br />
<br />
You must select one reference family :<br />
#In the menu popup : Choose the reference family<br />
#In the toolbar<br />
<br />
==== All displacements for one person and their descendants ====<br />
This view is used to show all descendant's life ways.<br />
<br />
There are displayed by generation.<br />
You can change the delay between the generation display in the view configuration.<br />
<br />
This view is not connected to filters. It only depend on the active person and the history.<br />
<br />
==== All places related to events ====<br />
==== All known places ====<br />
==Usage==<br />
===The mouse actions on the map===<br />
====button 1 ( left button )====<br />
You have two usages for the button 1 :<br />
# The marker selection.<br />
# Valid the region selection<br />
<br />
====button 2 ( middle button )====<br />
The only usage for this button is to select an area on the map.<br />
# when pressed : start the region selection<br />
# when released, end the region selection.<br />
You must use the button 1 to validate the selected region when finished.<br />
<br />
====button 3 ( right button )====<br />
Only one usage for this button.<br />
# show the menu popup.<br />
<br />
====The mouse over a marker====<br />
When the mouse is placed over one marker, we display the place name in the status bar.<br />
<br />
===The menu popup===<br />
From this menu, you have the following functions available for views :<br />
#hide or show the crosshair<br />
#lock the zoom<br />
#change the default map<br />
#add a place and link a place at the mouse position<br />
#center the map at the mouse position.<br />
#change the map provider<br />
<br />
===Click on a marker===<br />
We have two cases :<br />
# events : For each event, we can edit this event or center the map on this place.<br />
# places : For each place, we can edit this place or center the map on this place.<br />
When centering the map, the zoom used is defined in the geography preferences.<br />
<br />
We may have several markers in the click area depending on the zoom.<br />
In this case, We show for each marker all related events and/or places.<br />
We obtain a mix between the two cases described above.<br />
<br />
===Adding or Linking to a place===<br />
When you add a place or try to link a place to the position of the mouse, you'll get a place selection in a region.<br />
You'll see on the map a circle in which you may choose markers place names. You can adjust the circle size with the cursor. Depending on the diameter of this circle, a list is created. If the place has already some filled fields, you'll see these values in a green color row. If you agree, you double click on this row. if you don't agree, you can choose another row.<br />
<br />
==Gramps Integration==<br />
If you need more information on geography integration in gramps.<br />
[[GEPS 025: Geography]]</div>SergeNoiraud