From 8a2270ff073fa7721943dd8bcbbe59a8080a83d8 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Wed, 25 May 2005 05:09:11 +0000 Subject: [PATCH] * src/EditSource.py (__init__): set cursor to WATCH before displaying references; call display_references when idle; (display_references): set cursor to LEFT_PTR when done. * src/ListModel.py (__init__): Typo. * src/Utils.py (bold_label,unbold_label): make work with both labels and their parent containers. svn: r4669 --- gramps2/ChangeLog | 8 ++++++++ gramps2/src/EditSource.py | 9 +++++++-- gramps2/src/ListModel.py | 2 +- gramps2/src/Utils.py | 36 ++++++++++++++++++++++++------------ 4 files changed, 40 insertions(+), 15 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index faad4fe7a..684026e71 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,11 @@ +2005-05-25 Alex Roitman + * src/EditSource.py (__init__): set cursor to WATCH before displaying + references; call display_references when idle; + (display_references): set cursor to LEFT_PTR when done. + * src/ListModel.py (__init__): Typo. + * src/Utils.py (bold_label,unbold_label): make work with both + labels and their parent containers. + 2005-05-24 Don Allingham * various: CVS conflict resolution diff --git a/gramps2/src/EditSource.py b/gramps2/src/EditSource.py index 99c3061d5..ebc1d1252 100644 --- a/gramps2/src/EditSource.py +++ b/gramps2/src/EditSource.py @@ -32,7 +32,9 @@ from gettext import gettext as _ # GTK/Gnome modules # #------------------------------------------------------------------------- +import gobject import gtk.glade +import gtk.gdk import gnome #------------------------------------------------------------------------- @@ -180,11 +182,12 @@ class EditSource: self.top_window.get_widget('ok').set_sensitive(not self.db.readonly) - self.display_references() if parent_window: self.top.set_transient_for(parent_window) self.add_itself_to_menu() self.top.show() + self.refs_label.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) + gobject.idle_add(self.display_references) self.data_sel = self.datalist.get_selection() def on_add_data_clicked(self,widget): @@ -348,6 +351,7 @@ class EditSource: Utils.unbold_label(self.refs_label) self.ref_not_loaded = 0 + self.refs_label.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.LEFT_PTR)) def on_source_apply_clicked(self,obj): @@ -403,7 +407,8 @@ class EditSource: self.gallery.load_images() elif page == 3 and self.ref_not_loaded: self.ref_not_loaded = 0 - self.display_references() + self.refs_label.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) + gobject.idle_add(self.display_references) text = unicode(self.notes_buffer.get_text(self.notes_buffer.get_start_iter(), self.notes_buffer.get_end_iter(),False)) if text: diff --git a/gramps2/src/ListModel.py b/gramps2/src/ListModel.py index 9bd13cfaa..2bcc5c813 100644 --- a/gramps2/src/ListModel.py +++ b/gramps2/src/ListModel.py @@ -42,7 +42,7 @@ class ListModel: self.mylist = [] self.data_index = 0 for l in dlist: - if l[3] == TOGGLE: + if l[0] == TOGGLE: self.mylist.append(TYPE_BOOLEAN) else: self.mylist.append(TYPE_STRING) diff --git a/gramps2/src/Utils.py b/gramps2/src/Utils.py index 37f36dfb8..40810ac2b 100644 --- a/gramps2/src/Utils.py +++ b/gramps2/src/Utils.py @@ -403,20 +403,32 @@ def search_for(name): # #------------------------------------------------------------------------- def bold_label(label): - clist = label.get_children() - text = unicode(clist[1].get_text()) - clist[0].show() - clist[1].set_text("%s" % text ) - clist[1].set_use_markup(True) + try: + clist = label.get_children() + text = unicode(clist[1].get_text()) + clist[0].show() + clist[1].set_text("%s" % text ) + clist[1].set_use_markup(True) + except AttributeError: + text = unicode(label.get_text()) + label.set_text("%s" % text ) + label.set_use_markup(1) def unbold_label(label): - clist = label.get_children() - text = unicode(clist[1].get_text()) - text = text.replace('','') - text = text.replace('','') - clist[0].hide() - clist[1].set_text(text) - clist[1].set_use_markup(False) + try: + clist = label.get_children() + text = unicode(clist[1].get_text()) + text = text.replace('','') + text = text.replace('','') + clist[0].hide() + clist[1].set_text(text) + clist[1].set_use_markup(False) + except AttributeError: + text = unicode(label.get_text()) + text = text.replace('','') + text = text.replace('','') + label.set_text(text) + label.set_use_markup(0) #------------------------------------------------------------------------- #