improvements to Assistant and ErrorReportAssistant.

svn: r5695
This commit is contained in:
Richard Taylor 2006-01-08 15:19:46 +00:00
parent 19eeabe953
commit c2195c1074
3 changed files with 60 additions and 28 deletions

View File

@ -1,3 +1,7 @@
2006-01-08 Richard Taylor <rjt-gramps@thegrindstone.me.uk>
* src/Assistant.py: changed button handling to improve usability
* src/GrampsLogger/_ErrorReportAssistant.py: rewording and some frames.
2006-01-07 Don Allingham <don@gramps-project.org> 2006-01-07 Don Allingham <don@gramps-project.org>
* src/FamilyList.py: new family list view * src/FamilyList.py: new family list view
* src/DisplayModels.py: model for family list * src/DisplayModels.py: model for family list

View File

@ -93,10 +93,14 @@ class Assistant(gtk.Object):
self.back.connect('clicked',self.back_clicked) self.back.connect('clicked',self.back_clicked)
self.next = gtk.Button(stock=gtk.STOCK_GO_FORWARD) self.next = gtk.Button(stock=gtk.STOCK_GO_FORWARD)
self.next.connect('clicked',self.next_clicked) 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.cancel)
hbox.add(self.back) hbox.add(self.back)
hbox.add(self.next) hbox.add(self.next)
hbox.add(self.ok)
vbox.pack_start(titlebox,False) vbox.pack_start(titlebox,False)
vbox.pack_start(self.notebook,True) vbox.pack_start(self.notebook,True)
@ -117,18 +121,39 @@ class Assistant(gtk.Object):
self.title.set_label(self.title_text[self.current_page]) self.title.set_label(self.title_text[self.current_page])
self.title.set_use_markup(True) 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): def back_clicked(self,obj):
self.emit('before-page-back',self.notebook.get_current_page()) 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.current_page -= 1
self.notebook.set_current_page(self.current_page) self.notebook.set_current_page(self.current_page)
self.update_title() self.update_title()
self.next.set_label(gtk.STOCK_GO_FORWARD) self.set_buttons()
self.next.set_use_stock(True)
self.cancel.show()
self.emit('after-page-back',self.notebook.get_current_page()) self.emit('after-page-back',self.notebook.get_current_page())
self.emit('page-changed',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.current_page += 1
self.notebook.set_current_page(self.current_page) self.notebook.set_current_page(self.current_page)
self.update_title() self.update_title()
if self.current_page == self.max_page: self.set_buttons()
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.emit('after-page-next',self.notebook.get_current_page()) self.emit('after-page-next',self.notebook.get_current_page())
self.emit('page-changed',self.notebook.get_current_page()) self.emit('page-changed',self.notebook.get_current_page())

View File

@ -21,13 +21,13 @@ class ErrorReportAssistant:
self.w.set_intro(_("This is the Bug Reporting Assistant. It will "\ self.w.set_intro(_("This is the Bug Reporting Assistant. It will "\
"help you to make a bug report to the Gramps "\ "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 "\ "The assistant will ask you a few questions and will "\
"gather some information about the error that has "\ "gather some information about the error that has "\
"occured and the operating environment. "\ "occured and the operating environment. "\
"At then end of the assistent you will be asked to "\ "At the end of the assistent you will be asked to "\
"send an email to the Gramps bug reporting mailing list "\ "send an email to the Gramps bug reporting mailing list. "\
"and the bug report will be placed on the clip board so "\ "The assistant will place the bug report on the clip board so "\
"that you can paste it into your email programme and review "\ "that you can paste it into your email programme and review "\
"exactly what information is being sent.")) "exactly what information is being sent."))
@ -83,9 +83,9 @@ class ErrorReportAssistant:
box = gtk.VBox() 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 "\ "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 "\ "will have the opportunity to add further detail about the error "\
"in the following pages of the assistant.")) "in the following pages of the assistant."))
@ -95,6 +95,7 @@ class ErrorReportAssistant:
sw = gtk.ScrolledWindow() sw = gtk.ScrolledWindow()
sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC) sw.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
textview = gtk.TextView() textview = gtk.TextView()
self._error_details_text_buffer = textview.get_buffer() self._error_details_text_buffer = textview.get_buffer()
@ -106,7 +107,10 @@ class ErrorReportAssistant:
sw.show() sw.show()
textview.show() textview.show()
box.pack_start(sw) frm = gtk.Frame()
frm.add(sw)
box.pack_start(frm)
box.show_all() box.show_all()
return box return box
@ -135,7 +139,10 @@ class ErrorReportAssistant:
sw.show() sw.show()
textview.show() textview.show()
box.pack_start(sw) frm = gtk.Frame()
frm.add(sw)
box.pack_start(frm)
box.show_all() box.show_all()
return box return box
@ -161,7 +168,10 @@ class ErrorReportAssistant:
sw.show() sw.show()
textview.show() textview.show()
box.pack_start(sw) frm = gtk.Frame()
frm.add(sw)
box.pack_start(frm)
box.show_all() box.show_all()
return box return box
@ -194,7 +204,10 @@ class ErrorReportAssistant:
sw.show() sw.show()
textview.show() textview.show()
box.pack_start(sw) frm = gtk.Frame()
frm.add(sw)
box.pack_start(frm)
box.show_all() box.show_all()
return box return box