squash 40 commits:

1. 6848: citationtreeview corrupts when search bar open and edit occurs
2. avoid critical gdk error by processing events only when window visible :
     Gdk-CRITICAL **: gdk_error_trap_pop_internal: assertion `trap != NULL' failed
3. In case of errors with fg_color, enormous amount of error messages. This patch
   grabs wrong fg_color, and skips action, avoiding the error messages. Error goes to debug.


svn: r22610
This commit is contained in:
Benny Malengier 2013-06-25 22:15:08 +00:00
parent e9629f77e0
commit 4664f77608
3 changed files with 13 additions and 5 deletions

View File

@ -538,7 +538,11 @@ class DisplayState(Callback):
self.window.get_window().set_cursor(self.BUSY_CURSOR)
else:
self.window.get_window().set_cursor(self.cursor)
process_pending_events()
if self.window.get_window().is_visible():
#avoid critical gdk error:
#Gdk-CRITICAL **: gdk_error_trap_pop_internal: assertion `trap != NULL' failed
#only process events if window is actually visible
process_pending_events()
def set_open_widget(self, widget):
self.widget = widget

View File

@ -285,7 +285,11 @@ class ListView(NavigationView):
function because we don't want to set the color of untagged rows.
'''
fg_color = model.get_value(iter_, model.color_column())
renderer.set_property('foreground', fg_color)
#for color errors, typically color column is badly set
if fg_color:
renderer.set_property('foreground', fg_color)
else:
_LOG.debug('Bad color set: ' + str(fg_color))
def set_active(self):
"""

View File

@ -452,7 +452,7 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel):
if search[1]:
# we have search[1] = (index, text_unicode, inversion)
col, text, inv = search[1]
func = lambda x: self._get_value(x, col) or ""
func = lambda x: self._get_value(x, col, store_cache=False) or ""
if search[2]:
self.search = ExactSearchFilter(func, text, inv)
else:
@ -912,7 +912,7 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel):
else:
return val
def _get_value(self, handle, col, secondary=False):
def _get_value(self, handle, col, secondary=False, store_cache=True):
"""
Returns the contents of a given column of a gramps object
"""
@ -923,7 +923,7 @@ class TreeBaseModel(GObject.GObject, Gtk.TreeModel):
data = self.map(handle)
else:
data = self.map2(handle)
if not self._in_build:
if not self._in_build and store_cache:
self.lru_data[handle] = data
try: