From c2195c107435ca9cb6bef52fda531d45548e6159 Mon Sep 17 00:00:00 2001 From: Richard Taylor Date: Sun, 8 Jan 2006 15:19:46 +0000 Subject: [PATCH] improvements to Assistant and ErrorReportAssistant. svn: r5695 --- gramps2/ChangeLog | 4 ++ gramps2/src/Assistant.py | 51 ++++++++++++------- .../src/GrampsLogger/_ErrorReportAssistant.py | 33 ++++++++---- 3 files changed, 60 insertions(+), 28 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index 819077e68..f27c627b4 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,7 @@ +2006-01-08 Richard Taylor + * src/Assistant.py: changed button handling to improve usability + * src/GrampsLogger/_ErrorReportAssistant.py: rewording and some frames. + 2006-01-07 Don Allingham * src/FamilyList.py: new family list view * src/DisplayModels.py: model for family list diff --git a/gramps2/src/Assistant.py b/gramps2/src/Assistant.py index e7e3ae292..063c5b212 100644 --- a/gramps2/src/Assistant.py +++ b/gramps2/src/Assistant.py @@ -93,10 +93,14 @@ class Assistant(gtk.Object): self.back.connect('clicked',self.back_clicked) self.next = gtk.Button(stock=gtk.STOCK_GO_FORWARD) self.next.connect('clicked',self.next_clicked) + self.ok = gtk.Button(stock=gtk.STOCK_OK) + self.ok.connect('clicked',self.next_clicked) + self.ok.set_sensitive(False) hbox.add(self.cancel) hbox.add(self.back) hbox.add(self.next) + hbox.add(self.ok) vbox.pack_start(titlebox,False) vbox.pack_start(self.notebook,True) @@ -116,19 +120,40 @@ class Assistant(gtk.Object): def update_title(self): self.title.set_label(self.title_text[self.current_page]) self.title.set_use_markup(True) + + def set_buttons(self): + print "current_page = ", self.current_page + if self.current_page == self.max_page-1: + self.next.show() + self.back.show() + self.cancel.show() + self.ok.set_sensitive(True) + self.next.set_sensitive(False) + elif self.current_page == self.max_page: + self.next.hide() + self.back.hide() + self.cancel.hide() + elif self.current_page == 0: + self.next.show() + self.back.show() + self.cancel.show() + self.back.set_sensitive(False) + self.next.set_sensitive(True) + self.ok.set_sensitive(False) + else: + self.next.show() + self.back.show() + self.back.set_sensitive(True) + self.next.set_sensitive(True) + self.ok.set_sensitive(False) + self.cancel.show() def back_clicked(self,obj): self.emit('before-page-back',self.notebook.get_current_page()) - if self.current_page == 1: - self.back.show() - self.back.set_sensitive(False) - self.cancel.show() self.current_page -= 1 self.notebook.set_current_page(self.current_page) self.update_title() - self.next.set_label(gtk.STOCK_GO_FORWARD) - self.next.set_use_stock(True) - self.cancel.show() + self.set_buttons() self.emit('after-page-back',self.notebook.get_current_page()) self.emit('page-changed',self.notebook.get_current_page()) @@ -143,17 +168,7 @@ class Assistant(gtk.Object): self.current_page += 1 self.notebook.set_current_page(self.current_page) self.update_title() - if self.current_page == self.max_page: - self.next.set_label(gtk.STOCK_OK) - self.next.set_use_stock(True) - self.back.hide() - self.cancel.hide() - else: - self.next.set_label(gtk.STOCK_GO_FORWARD) - self.next.set_use_stock(True) - self.back.show() - self.back.set_sensitive(True) - self.cancel.show() + self.set_buttons() self.emit('after-page-next',self.notebook.get_current_page()) self.emit('page-changed',self.notebook.get_current_page()) diff --git a/gramps2/src/GrampsLogger/_ErrorReportAssistant.py b/gramps2/src/GrampsLogger/_ErrorReportAssistant.py index 30d116762..125bb838e 100644 --- a/gramps2/src/GrampsLogger/_ErrorReportAssistant.py +++ b/gramps2/src/GrampsLogger/_ErrorReportAssistant.py @@ -21,13 +21,13 @@ class ErrorReportAssistant: self.w.set_intro(_("This is the Bug Reporting Assistant. It will "\ "help you to make a bug report to the Gramps "\ - "developers that will be as detailed as possible.\n"\ + "developers that will be as detailed as possible.\n\n"\ "The assistant will ask you a few questions and will "\ "gather some information about the error that has "\ "occured and the operating environment. "\ - "At then end of the assistent you will be asked to "\ - "send an email to the Gramps bug reporting mailing list "\ - "and the bug report will be placed on the clip board so "\ + "At the end of the assistent you will be asked to "\ + "send an email to the Gramps bug reporting mailing list. "\ + "The assistant will place the bug report on the clip board so "\ "that you can paste it into your email programme and review "\ "exactly what information is being sent.")) @@ -83,9 +83,9 @@ class ErrorReportAssistant: box = gtk.VBox() - label = gtk.Label(_("This is the detail Gramps error information, don't worry if you "\ + label = gtk.Label(_("This is the detailed Gramps error information, don't worry if you "\ "do not understand it. If you can see that there is any personal "\ - "informatin included in the error details please remove it, you "\ + "information included in the error please remove it. You "\ "will have the opportunity to add further detail about the error "\ "in the following pages of the assistant.")) @@ -95,6 +95,7 @@ class ErrorReportAssistant: sw = gtk.ScrolledWindow() sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) + textview = gtk.TextView() self._error_details_text_buffer = textview.get_buffer() @@ -105,8 +106,11 @@ class ErrorReportAssistant: sw.add(textview) sw.show() textview.show() + + frm = gtk.Frame() + frm.add(sw) - box.pack_start(sw) + box.pack_start(frm) box.show_all() return box @@ -135,7 +139,10 @@ class ErrorReportAssistant: sw.show() textview.show() - box.pack_start(sw) + frm = gtk.Frame() + frm.add(sw) + + box.pack_start(frm) box.show_all() return box @@ -161,7 +168,10 @@ class ErrorReportAssistant: sw.show() textview.show() - box.pack_start(sw) + frm = gtk.Frame() + frm.add(sw) + + box.pack_start(frm) box.show_all() return box @@ -194,7 +204,10 @@ class ErrorReportAssistant: sw.show() textview.show() - box.pack_start(sw) + frm = gtk.Frame() + frm.add(sw) + + box.pack_start(frm) box.show_all() return box