diff --git a/src/DataViews/GeoView.py b/src/DataViews/GeoView.py index ed8b8c316..81e200470 100644 --- a/src/DataViews/GeoView.py +++ b/src/DataViews/GeoView.py @@ -53,6 +53,8 @@ import gtk # #------------------------------------------------------------------------- import logging +LOG = logging.getLogger(".GeoView") +#LOG.setLevel(logging.DEBUG) #------------------------------------------------------------------------- # @@ -172,6 +174,9 @@ class Renderer(): def page_loaded(self): raise NotImplementedError + def page_begin_load(self): + raise NotImplementedError + def set_button_sensitivity(self): """ We must set the back and forward button in the HtmlView class. @@ -193,10 +198,14 @@ class RendererWebkit(Renderer): self.window = webkit.WebView() self.browser = WEBKIT self.window.get_main_frame().connect("load-done", self.page_loaded) + self.window.connect("load-started", self.page_begin_load) def page_loaded(self,obj,status): self.set_button_sensitivity() + def page_begin_load(self,obj,stat): + pass + def open(self, url): self.window.open(url) @@ -224,10 +233,14 @@ class RendererMozilla(Renderer): self.window = gtkmozembed.MozEmbed() self.browser = MOZIL self.handler = self.window.connect("net-stop", self.page_loaded) + self.handler = self.window.connect("net-start", self.page_begin_load) def page_loaded(self,obj): self.set_button_sensitivity() + def page_begin_load(self,obj): + pass + def open(self, url): self.window.load_url(url) @@ -520,6 +533,7 @@ class GeoView(HtmlView): self.usedmap = "openstreetmap" self.displaytype = "person" self.nbmarkers = 0 + self.without = 0 self.nbpages = 0 def top_widget(self): @@ -694,6 +708,7 @@ class GeoView(HtmlView): """ self.external_url = False self.nbmarkers = 0 + self.without = 0 self.createMapstraction(displaytype) self.open("file://"+self.htmlfile) @@ -759,6 +774,42 @@ class GeoView(HtmlView): pass pass # We don't use a proxy or the http_proxy variable is not set. + def create_page_for_places_without_coordinates(self): + """ + This command creates a page with the list of all places without coordinates + page. + """ + data = """ + + +
+ +') + } + end = """ + + + + """ + fd = open(self.without_coord_file,"w+") + fd.write(data) + self.places = sorted(self.place_without_coordinates) + i = 1 + fd.write("
NB | Gramps ID | Place | ") + for place in self.places: + fd.write("
---|---|---|
%d | %s | %s | " % ( i, place[0], place[1] )) + i += 1 + fd.write(end) + fd.close() + def createMapstractionPostHeader(self,h3mess,h4mess,maxpages,curpage,ftype): self.maxgen=Config.get(Config.GENERATION_DEPTH) if self.maxyear == 0: @@ -802,6 +853,11 @@ class GeoView(HtmlView): else: self.mapview.write(" ++") self.mapview.write("\n\n") + if self.without != 0: + self.without_coord_file = GEOVIEW_SUBPATH+"/without_coord.html" + self.mapview.write("