diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index f27c627b4..cad8b86a8 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,9 @@ +2006-01-08 Richard Taylor + * src/GrampsLogger/_ErrorReportAssistant.py: don't show excep twice + * src/GrampsLogger/_ErrorView.py: don't show excep twice + * src/GrampsLogger/_GtkHandler.py: don't show excep twice + * src/GrampsLogger/_RotateHandler.py: don't show excep twice + 2006-01-08 Richard Taylor * src/Assistant.py: changed button handling to improve usability * src/GrampsLogger/_ErrorReportAssistant.py: rewording and some frames. diff --git a/gramps2/src/GrampsLogger/_ErrorReportAssistant.py b/gramps2/src/GrampsLogger/_ErrorReportAssistant.py index 125bb838e..9a7ab62e0 100644 --- a/gramps2/src/GrampsLogger/_ErrorReportAssistant.py +++ b/gramps2/src/GrampsLogger/_ErrorReportAssistant.py @@ -99,9 +99,10 @@ class ErrorReportAssistant: textview = gtk.TextView() self._error_details_text_buffer = textview.get_buffer() - self._error_details_text_buffer.set_text("\n".join(self._rotate_handler.get_formatted_log()) + - "\n\n" + - self._error_detail) + self._error_details_text_buffer.set_text( + "\n".join(self._rotate_handler.get_formatted_log(self._error_detail.get_record())) + + "\n\n" + + self._error_detail.get_formatted_log()) sw.add(textview) sw.show() @@ -219,7 +220,7 @@ class ErrorReportAssistant: self._sys_information_text_buffer.get_text( self._sys_information_text_buffer.get_start_iter(), self._sys_information_text_buffer.get_end_iter()) + - "Additional Information: \n\n" + + "\nAdditional Information: \n\n" + self._user_information_text_buffer.get_text( self._user_information_text_buffer.get_start_iter(), self._user_information_text_buffer.get_end_iter()) + diff --git a/gramps2/src/GrampsLogger/_ErrorView.py b/gramps2/src/GrampsLogger/_ErrorView.py index dd258630a..c76cce58f 100644 --- a/gramps2/src/GrampsLogger/_ErrorView.py +++ b/gramps2/src/GrampsLogger/_ErrorView.py @@ -62,7 +62,7 @@ class ErrorView(object): tb_frame = gtk.Frame(_("Error Detail")) tb_frame.set_border_width(6) tb_label = gtk.TextView() - tb_label.get_buffer().set_text(self._error_detail) + tb_label.get_buffer().set_text(self._error_detail.get_formatted_log()) tb_label.set_border_width(6) tb_label.set_editable(False) diff --git a/gramps2/src/GrampsLogger/_GtkHandler.py b/gramps2/src/GrampsLogger/_GtkHandler.py index 2f668c245..52b32caa5 100644 --- a/gramps2/src/GrampsLogger/_GtkHandler.py +++ b/gramps2/src/GrampsLogger/_GtkHandler.py @@ -24,4 +24,11 @@ class GtkHandler(logging.Handler): """ - ErrorView(error_detail=self.format(record),rotate_handler=self._rotate_handler) + self._record = record + ErrorView(error_detail=self,rotate_handler=self._rotate_handler) + + def get_formatted_log(self): + return self.format(self._record) + + def get_record(self): + return self._record diff --git a/gramps2/src/GrampsLogger/_RotateHandler.py b/gramps2/src/GrampsLogger/_RotateHandler.py index 726dc78f9..128b863ad 100644 --- a/gramps2/src/GrampsLogger/_RotateHandler.py +++ b/gramps2/src/GrampsLogger/_RotateHandler.py @@ -31,7 +31,7 @@ class RotateHandler(logging.Handler): return [record for record in self._buffer[self._index:] + self._buffer[:self._index] if record is not None] - def get_formatted_log(self): + def get_formatted_log(self, remove_tail_duplicate=None): """ Return the log buffer after it has been formatted. @@ -39,7 +39,7 @@ class RotateHandler(logging.Handler): """ return [self.format(record) for record in self._buffer[self._index:] + self._buffer[:self._index] - if record is not None] + if record is not None and record != remove_tail_duplicate] def set_capacity(self,capacity): """