From 3882f3944e8e427ad55409b7ec9244514aa8136f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mario=20H=C3=BCttel?= Date: Tue, 5 Mar 2019 21:02:57 +0100 Subject: [PATCH] Change selction filter function. Now only cells without major errors are selectable. Warnings are okay because the renderers can handle these (unresolved references etc...) --- tree-renderer/tree-store.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/tree-renderer/tree-store.c b/tree-renderer/tree-store.c index 28b3ec7..3da3d63 100644 --- a/tree-renderer/tree-store.c +++ b/tree-renderer/tree-store.c @@ -49,15 +49,20 @@ static gboolean tree_sel_func(GtkTreeSelection *selection, { GtkTreeIter iter; struct gds_cell *cell; + unsigned int error_level; + gboolean ret = FALSE; 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 */ - if (cell) - return TRUE; - else - return FALSE; + /* Allow only rows with _valid_ cell to be selected */ + if (cell) { + /* Cell available. Check if it passed the critical checks */ + if (!(error_level & LIB_CELL_RENDERER_ERROR_ERR)) + ret = TRUE; + } + + return ret; } /**