[r21155]Use IMAGE_DIR in geography.py so that map images can be found

when running from source directory.

svn: r21288
This commit is contained in:
John Ralls 2013-02-04 02:15:55 +00:00
parent efdb6e9fd5
commit a00a5ba32d

View File

@ -54,7 +54,7 @@ from gramps.gen.display.name import displayer as _nd
from gramps.gui.views.navigationview import NavigationView from gramps.gui.views.navigationview import NavigationView
from gramps.gen.utils.libformatting import FormattingHelper from gramps.gen.utils.libformatting import FormattingHelper
from gramps.gen.errors import WindowActiveError from gramps.gen.errors import WindowActiveError
from gramps.gen.const import HOME_DIR, ROOT_DIR from gramps.gen.const import HOME_DIR, IMAGE_DIR
from gramps.gui.managedwindow import ManagedWindow from gramps.gui.managedwindow import ManagedWindow
from gramps.gen.config import config from gramps.gen.config import config
from gramps.gui.editors import EditPlace, EditEvent, EditFamily, EditPerson from gramps.gui.editors import EditPlace, EditEvent, EditFamily, EditPerson
@ -148,13 +148,13 @@ class GeoGraphyView(OsmGps, NavigationView):
self.places_found = [] self.places_found = []
self.select_fct = None self.select_fct = None
self.geo_mainmap = None self.geo_mainmap = None
path = os.path.join(ROOT_DIR, "images", "48x48", path = os.path.join(IMAGE_DIR, "48x48",
('gramps-geo-mainmap' + '.png' )) ('gramps-geo-mainmap' + '.png' ))
pathu = path pathu = path
if sys.version_info[0] < 3: if sys.version_info[0] < 3:
pathu = path.encode(sys.getfilesystemencoding()) pathu = path.encode(sys.getfilesystemencoding())
self.geo_mainmap = cairo.ImageSurface.create_from_png(pathu) self.geo_mainmap = cairo.ImageSurface.create_from_png(pathu)
path = os.path.join(ROOT_DIR, "images", "48x48", path = os.path.join(IMAGE_DIR, "48x48",
('gramps-geo-altmap' + '.png' )) ('gramps-geo-altmap' + '.png' ))
pathu = path pathu = path
if sys.version_info[0] < 3: if sys.version_info[0] < 3:
@ -171,7 +171,7 @@ class GeoGraphyView(OsmGps, NavigationView):
for ident in ( EventType.BIRTH, for ident in ( EventType.BIRTH,
EventType.DEATH, EventType.DEATH,
EventType.MARRIAGE ): EventType.MARRIAGE ):
path = os.path.join(ROOT_DIR, "images", "48x48", path = os.path.join(IMAGE_DIR, "48x48",
(constants.ICONS.get(int(ident), default_image) + '.png' )) (constants.ICONS.get(int(ident), default_image) + '.png' ))
pathu = path pathu = path
if sys.version_info[0] < 3: if sys.version_info[0] < 3: