Change selction filter function. Now only cells without major errors are selectable. Warnings are okay because the renderers can handle these (unresolved references etc...)

This commit is contained in:
Mario Hüttel 2019-03-05 21:02:57 +01:00
parent 00b47d7ded
commit 3882f3944e

View File

@ -49,15 +49,20 @@ static gboolean tree_sel_func(GtkTreeSelection *selection,
{ {
GtkTreeIter iter; GtkTreeIter iter;
struct gds_cell *cell; struct gds_cell *cell;
unsigned int error_level;
gboolean ret = FALSE;
gtk_tree_model_get_iter(model, &iter, path); gtk_tree_model_get_iter(model, &iter, path);
gtk_tree_model_get(model, &iter, CELL_SEL_CELL, &cell, -1); gtk_tree_model_get(model, &iter, CELL_SEL_CELL, &cell, CELL_SEL_CELL_ERROR_STATE, &error_level, -1);
/* Allow only rows with valid cell to be selected */ /* Allow only rows with _valid_ cell to be selected */
if (cell) if (cell) {
return TRUE; /* Cell available. Check if it passed the critical checks */
else if (!(error_level & LIB_CELL_RENDERER_ERROR_ERR))
return FALSE; ret = TRUE;
}
return ret;
} }
/** /**