From 033d02bc181b7d4b9bebaad47ac6968bc315939d Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 25 Aug 2006 00:19:06 +0000 Subject: [PATCH] * src/plugins/EventCmp.py: Remove sorting columns for saving. svn: r7257 --- ChangeLog | 1 + src/plugins/EventCmp.py | 44 +++++++++++++++++++++++++++-------------- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0677d5704..583fc92b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,5 @@ 2006-08-24 Alex Roitman + * src/plugins/EventCmp.py: Remove sorting columns for saving. * src/plugins/PHPGedViewConnector.py: Disable registration, until this plugin is fixed. * src/glade/gramps.glade (family_editor): Remove Y expansion diff --git a/src/plugins/EventCmp.py b/src/plugins/EventCmp.py index 0424e00c0..8e50534ae 100644 --- a/src/plugins/EventCmp.py +++ b/src/plugins/EventCmp.py @@ -77,6 +77,7 @@ class TableReport: t.set_columns(cols) for index in range(0,cols): t.set_column_width(index,4) + t.set_column_width(1,1) self.doc.add_table_style("mytbl",t) f = BaseDoc.FontStyle() @@ -103,9 +104,13 @@ class TableReport: self.doc.end_page() self.doc.close() - def write_table_data(self,data): + def write_table_data(self,data,skip_columns=[]): self.doc.start_row() + index = -1 for item in data: + index += 1 + if index in skip_columns: + continue self.doc.start_cell("data") self.doc.write_text(item) self.doc.end_cell() @@ -115,8 +120,6 @@ class TableReport: self.row = val + 2 def write_table_head(self,data): - self.prev = 3 - self.doc.start_row() for item in data: self.doc.start_cell("head") @@ -387,15 +390,16 @@ class DisplayChart(ManagedWindow.ManagedWindow): unsort_list = [ (the_map[item],item) for item in the_map.keys() ] unsort_list.sort(by_value) sort_list = [ item[1] for item in unsort_list ] - - # Move birth and death to the begining of the list - if the_map.has_key(_("Death")): - sort_list.remove(_("Death")) - sort_list = [_("Death")] + sort_list +## Presently there's no Birth and Death. Instead there's Birth Date and +## Birth Place, as well as Death Date and Death Place. +## # Move birth and death to the begining of the list +## if the_map.has_key(_("Death")): +## sort_list.remove(_("Death")) +## sort_list = [_("Death")] + sort_list - if the_map.has_key(_("Birth")): - sort_list.remove(_("Birth")) - sort_list = [_("Birth")] + sort_list +## if the_map.has_key(_("Birth")): +## sort_list.remove(_("Birth")) +## sort_list = [_("Birth")] + sort_list return sort_list @@ -417,15 +421,25 @@ class DisplayChart(ManagedWindow.ManagedWindow): doc = ODSDoc.ODSDoc(pstyle,BaseDoc.PAPER_PORTRAIT) doc.creator(self.db.get_researcher().get_name()) spreadsheet = TableReport(name,doc) - spreadsheet.initialize(len(self.table_titles)) - spreadsheet.write_table_head(self.table_titles) + new_titles = [] + skip_columns = [] + index = 0 + for title in self.table_titles: + if title == 'sort': + skip_columns.append(index) + else: + new_titles.append(title) + index += 1 + spreadsheet.initialize(len(new_titles)) + + spreadsheet.write_table_head(new_titles) index = 0 for top in self.row_data: spreadsheet.set_row(index%2) - index = index + 1 - spreadsheet.write_table_data(top) + index += 1 + spreadsheet.write_table_data(top,skip_columns) spreadsheet.finalize()