コード例 #1
0
    def __init__(self, title, pdata, dbstate, uistate, bm_type, nav_group):
        NavigationView.__init__(self, title, pdata, dbstate, uistate, bm_type,
                                nav_group)

        OsmGps.__init__(self, uistate)
        self.dbstate = dbstate
        self.dbstate.connect('database-changed', self.change_db)
        self.dbstate.connect('no-database', self.clear_view)
        self.default_text = "Enter location here!"
        self.centerlon = config.get("geography.center-lon")
        self.centerlat = config.get("geography.center-lat")
        self.zoom = config.get("geography.zoom")
        self.lock = config.get("geography.lock")
        if config.get('geography.path') == "":
            config.set('geography.path', GEOGRAPHY_PATH)

        self.format_helper = FormattingHelper(self.dbstate)
        self.centerlat = self.centerlon = 0.0
        self.cross_map = None
        self.current_map = None
        self.without = 0
        self.place_list = []
        self.places_found = []
        self.select_fct = None
        self.geo_mainmap = None
        theme = Gtk.IconTheme.get_default()
        self.geo_mainmap = theme.load_surface('gramps-geo-mainmap', 48, 1,
                                              None, 0)
        self.geo_altmap = theme.load_surface('gramps-geo-altmap', 48, 1, None,
                                             0)
        if (config.get('geography.map_service') in (
                constants.OPENSTREETMAP,
                constants.MAPS_FOR_FREE,
                constants.OPENCYCLEMAP,
                constants.OSM_PUBLIC_TRANSPORT,
        )):
            default_image = self.geo_mainmap
        else:
            default_image = self.geo_altmap
        self.geo_othermap = {}
        for ident in (EventType.BIRTH, EventType.DEATH, EventType.MARRIAGE):
            icon = constants.ICONS.get(int(ident))
            self.geo_othermap[ident] = theme.load_surface(icon, 48, 1, None, 0)
        self.maxyear = 0
        self.minyear = 9999
        self.maxlat = 0.0
        self.minlat = 0.0
        self.maxlon = 0.0
        self.minlon = 0.0
        self.longt = 0.0
        self.latit = 0.0
        self.itemoption = None
        self.menu = None
        self.mark = None
        self.path_entry = None
        self.changemap = None
        self.clearmap = None
        self.nbplaces = 0
コード例 #2
0
ファイル: geography.py プロジェクト: xfengs/gramps
    def __init__(self, title, pdata, dbstate, uistate, bm_type, nav_group):
        NavigationView.__init__(self, title, pdata, dbstate, uistate, bm_type,
                                nav_group)

        OsmGps.__init__(self, uistate)
        self.dbstate = dbstate
        self.dbstate.connect('database-changed', self.change_db)
        self.dbstate.connect('no-database', self.clear_view)
        self.default_text = "Enter location here!"
        self.centerlon = config.get("geography.center-lon")
        self.centerlat = config.get("geography.center-lat")
        self.zoom = config.get("geography.zoom")
        self.lock = config.get("geography.lock")
        if config.get('geography.path') == "":
            config.set('geography.path', GEOGRAPHY_PATH)

        self.uistate = uistate
        self.uistate.connect('font-changed', self.font_changed)
        self.uistate.connect('nameformat-changed', self.build_tree)
        self.format_helper = FormattingHelper(self.dbstate, self.uistate)
        self.centerlat = self.centerlon = 0.0
        self.cross_map = None
        self.current_map = None
        self.without = 0
        self.place_list = []
        self.places_found = []
        self.select_fct = None
        self.geo_mainmap = None
        self.reloadtiles = None
        theme = Gtk.IconTheme.get_default()
        self.geo_mainmap = theme.load_surface('gramps-geo-mainmap', 48, 1,
                                              None, 0)
        self.geo_altmap = theme.load_surface('gramps-geo-altmap', 48, 1, None,
                                             0)
        self.sort = []
        self.geo_othermap = {}
        for ident in (EventType.BIRTH, EventType.DEATH, EventType.MARRIAGE):
            icon = constants.ICONS.get(int(ident))
            self.geo_othermap[ident] = theme.load_surface(icon, 48, 1, None, 0)
        self.maxyear = 0
        self.minyear = 9999
        self.maxlat = 0.0
        self.minlat = 0.0
        self.maxlon = 0.0
        self.minlon = 0.0
        self.longt = 0.0
        self.latit = 0.0
        self.itemoption = None
        self.menu = None
        self.mark = None
        self.path_entry = None
        self.changemap = None
        self.clearmap = None
        self.nbplaces = 0
        self.nbmarkers = 0
        self.place_without_coordinates = []
コード例 #3
0
    def __init__(self, title, pdata, dbstate, uistate,
                 bm_type, nav_group):
        NavigationView.__init__(self, title, pdata, dbstate, uistate,
                                bm_type, nav_group)

        self.dbstate = dbstate
        self.dbstate.connect('database-changed', self.change_db)
        self.default_text = "Enter location here!"
        self.centerlon = config.get("geography.center-lon")
        self.centerlat = config.get("geography.center-lat")
        self.zoom = config.get("geography.zoom")
        self.lock = config.get("geography.lock")
        if config.get('geography.path') == "" :
            config.set('geography.path', GEOGRAPHY_PATH )
        OsmGps.__init__(self)

        self.format_helper = FormattingHelper(self.dbstate)
        self.centerlat = self.centerlon = 0.0
        self.cross_map = None
        self.current_map = None
        self.without = 0
        self.place_list = []
        self.places_found = []
        self.select_fct = None
        self.geo_mainmap = None
        path = os.path.join(IMAGE_DIR, "48x48",
                            ('gramps-geo-mainmap' + '.png' ))
        with open(path, 'rb') as fh: # this is to avoid bug with cairo 1.8.8
            self.geo_mainmap = cairo.ImageSurface.create_from_png(fh)
        #self.geo_mainmap = cairo.ImageSurface.create_from_png(path)
        path = os.path.join(IMAGE_DIR, "48x48",
                            ('gramps-geo-altmap' + '.png' ))
        with open(path, 'rb') as fh: # this is to avoid bug with cairo 1.8.8
            self.geo_altmap = cairo.ImageSurface.create_from_png(fh)
        #self.geo_altmap = cairo.ImageSurface.create_from_png(path)
        if ( config.get('geography.map_service') in
            ( constants.OPENSTREETMAP,
              constants.MAPS_FOR_FREE,
              constants.OPENCYCLEMAP,
              constants.OSM_PUBLIC_TRANSPORT,
             )):
            default_image = self.geo_mainmap
        else:
            default_image = self.geo_altmap
        self.geo_othermap = {}
        for ident in ( EventType.BIRTH,
                    EventType.DEATH,
                    EventType.MARRIAGE ):
            path = os.path.join(IMAGE_DIR, "48x48",
                                (constants.ICONS.get(int(ident), default_image) + '.png' ))
            with open(path, 'rb') as fh: # this is to avoid bug with cairo 1.8.8
                self.geo_othermap[ident] = cairo.ImageSurface.create_from_png(fh)