From 97900a087dfb47fc69cb133d0acf7536841ad467 Mon Sep 17 00:00:00 2001 From: Alex Roitman Date: Fri, 3 Jun 2005 13:39:36 +0000 Subject: [PATCH] * src/Utils.py (bold_label,unbold_label,temp_label): optionally set cursor. * src/EditSource.py (__init__,on_switch_page): Call display_references using idle_add; (display_references): set cursor when done. svn: r4770 --- gramps2/ChangeLog | 7 +++++++ gramps2/src/EditSource.py | 11 +++++++---- gramps2/src/Utils.py | 26 ++++++++++++++++++++++---- 3 files changed, 36 insertions(+), 8 deletions(-) diff --git a/gramps2/ChangeLog b/gramps2/ChangeLog index b5a830e9f..76cb11668 100644 --- a/gramps2/ChangeLog +++ b/gramps2/ChangeLog @@ -1,3 +1,10 @@ +2005-06-03 Alexander Roitman + * src/Utils.py (bold_label,unbold_label,temp_label): optionally + set cursor. + * src/EditSource.py (__init__,on_switch_page): Call + display_references using idle_add; (display_references): set + cursor when done. + 2005-06-03 Jens Arvidsson * src/po/sv.po: Minor fixes found via pochkpyvar.pl. diff --git a/gramps2/src/EditSource.py b/gramps2/src/EditSource.py index 37d962bcc..b0d407038 100644 --- a/gramps2/src/EditSource.py +++ b/gramps2/src/EditSource.py @@ -32,6 +32,7 @@ from gettext import gettext as _ # GTK/Gnome modules # #------------------------------------------------------------------------- +import gobject import gtk.glade import gnome @@ -180,11 +181,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() + Utils.temp_label(self.refs_label,self.top) + gobject.idle_add(self.display_references) self.data_sel = self.datalist.get_selection() def on_add_data_clicked(self,widget): @@ -343,9 +345,9 @@ class EditSource: self.model.add([_("Media"),gramps_id,name],(5,handle)) if any: - Utils.bold_label(self.refs_label) + Utils.bold_label(self.refs_label,self.top) else: - Utils.unbold_label(self.refs_label) + Utils.unbold_label(self.refs_label,self.top) self.ref_not_loaded = 0 @@ -403,7 +405,8 @@ class EditSource: self.gallery.load_images() elif page == 3 and self.ref_not_loaded: self.ref_not_loaded = 0 - self.display_references() + Utils.temp_label(self.refs_label,self.top) + 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/Utils.py b/gramps2/src/Utils.py index 2e069ec00..6b8066774 100644 --- a/gramps2/src/Utils.py +++ b/gramps2/src/Utils.py @@ -34,6 +34,7 @@ import locale # #------------------------------------------------------------------------- import gtk +import gtk.gdk import gnome try: @@ -402,17 +403,34 @@ def search_for(name): # Change label apperance # #------------------------------------------------------------------------- -def bold_label(label): +def bold_label(label,widget=None): text = unicode(label.get_text()) + text = text.replace('','') + text = text.replace('','') label.set_text("%s" % text ) - label.set_use_markup(1) + label.set_use_markup(True) + if widget: + widget.window.set_cursor(None) -def unbold_label(label): +def unbold_label(label,widget=None): text = unicode(label.get_text()) text = text.replace('','') text = text.replace('','') + text = text.replace('','') + text = text.replace('','') label.set_text(text) - label.set_use_markup(0) + label.set_use_markup(False) + if widget: + widget.window.set_cursor(None) + +def temp_label(label,widget=None): + text = unicode(label.get_text()) + text = text.replace('','') + text = text.replace('','') + label.set_text("%s" % text ) + label.set_use_markup(True) + if widget: + widget.window.set_cursor(gtk.gdk.Cursor(gtk.gdk.WATCH)) #------------------------------------------------------------------------- #