diff --git a/ChangeLog b/ChangeLog index 3d515dd39..4963981ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-18 Douglas S. Blank + * src/plugins/DefaultGramplets.py (SurnameCloudGramplet.main): + moved cursor to beginning of text + * src/DataViews/GrampletView.py (Gramplet.append_text): + new scroll_to="begin" to go to start of text area + 2008-01-18 Jerome Rapinat * data/man/gramps.1.in: add missing -l option diff --git a/src/DataViews/GrampletView.py b/src/DataViews/GrampletView.py index c8d23fdfe..cffa2c08a 100644 --- a/src/DataViews/GrampletView.py +++ b/src/DataViews/GrampletView.py @@ -252,8 +252,14 @@ class Gramplet(object): enditer = self.gui.buffer.get_end_iter() end = self.gui.buffer.create_mark(None, enditer, True) self.gui.textview.scroll_to_mark(end, 0.0, True, 0, 0) - else: + elif scroll_to == "start": # beginning of this append self.gui.textview.scroll_to_mark(start, 0.0, True, 0, 0) + elif scroll_to == "begin": # beginning of this append + begin_iter = self.gui.buffer.get_start_iter() + begin = self.gui.buffer.create_mark(None, begin_iter, True) + self.gui.textview.scroll_to_mark(begin, 0.0, True, 0, 0) + else: + raise AttributeError, ("no such cursor position: '%s'" % scroll_to) def load_data_to_text(self, pos=0): if len(self.gui.data) >= pos + 1: diff --git a/src/plugins/DefaultGramplets.py b/src/plugins/DefaultGramplets.py index 706b24c5a..c1eb21410 100644 --- a/src/plugins/DefaultGramplets.py +++ b/src/plugins/DefaultGramplets.py @@ -254,7 +254,7 @@ class TopSurnamesGramplet(Gramplet): break self.append_text(("\n" + _("Total unique surnames") + ": %d\n") % total_surnames) - self.append_text((_("Total people") + ": %d") % total_people) + self.append_text((_("Total people") + ": %d") % total_people, "begin") def make_tag_size(n, counts, mins=8, maxs=20): # return font sizes mins to maxs @@ -345,7 +345,7 @@ class SurnameCloudGramplet(Gramplet): break self.append_text(("\n" + _("Total unique surnames") + ": %d\n") % total_surnames) - self.append_text((_("Total people") + ": %d") % total_people) + self.append_text((_("Total people") + ": %d") % total_people, "begin") class StatsGramplet(Gramplet): def init(self):