[Openvas-commits] r2882 - in trunk/openvas-client: . nessus/prefs_dialog
scm-commit@wald.intevation.org
scm-commit at wald.intevation.org
Tue Mar 24 12:07:09 CET 2009
Author: felix
Date: 2009-03-24 12:07:08 +0100 (Tue, 24 Mar 2009)
New Revision: 2882
Modified:
trunk/openvas-client/ChangeLog
trunk/openvas-client/nessus/prefs_dialog/prefs_report.c
Log:
Towards icons in the reports tree view (GUI-> right, when report is
selected) indicating applied severity overrides.
* nessus/prefs_dialog/prefs_report.c (fill_tree_model): Fixed bug,
walk was not initialized.
* nessus/prefs_dialog/prefs_report.c (fill_tree_model): Set list
of contained issues in tree model.
* nessus/prefs_dialog/prefs_report.c (row_activated): Pick up list
of contained issues in tree model.
Modified: trunk/openvas-client/ChangeLog
===================================================================
--- trunk/openvas-client/ChangeLog 2009-03-24 10:14:16 UTC (rev 2881)
+++ trunk/openvas-client/ChangeLog 2009-03-24 11:07:08 UTC (rev 2882)
@@ -2,7 +2,21 @@
Towards icons in the reports tree view (GUI-> right, when report is
selected) indicating applied severity overrides.
+
+ * nessus/prefs_dialog/prefs_report.c (fill_tree_model): Fixed bug,
+ walk was not initialized.
+ * nessus/prefs_dialog/prefs_report.c (fill_tree_model): Set list
+ of contained issues in tree model.
+
+ * nessus/prefs_dialog/prefs_report.c (row_activated): Pick up list
+ of contained issues in tree model.
+
+2009-03-24 Felix Wolfsteller <felix.wolfsteller at intevation.de>
+
+ Towards icons in the reports tree view (GUI-> right, when report is
+ selected) indicating applied severity overrides.
+
* nessus/prefs_dialog/prefs_report.c (enum, prefs_report_update): Added
two more cols to the tree model: One indicating whether severities have
been overriden, the other to carry a list of (indexes of) contained
Modified: trunk/openvas-client/nessus/prefs_dialog/prefs_report.c
===================================================================
--- trunk/openvas-client/nessus/prefs_dialog/prefs_report.c 2009-03-24 10:14:16 UTC (rev 2881)
+++ trunk/openvas-client/nessus/prefs_dialog/prefs_report.c 2009-03-24 11:07:08 UTC (rev 2882)
@@ -236,6 +236,7 @@
struct subset * subset = NULL;
struct subset * walk = NULL;
gchar* last_added_sev = NULL;
+ GSList* msg_id_list;
GtkTreeIter iter;
static char * query_patterns[] = {
"SELECT %s,severity FROM results",
@@ -256,6 +257,7 @@
subset = subset_sort (subset, 0, 0, cmps);
}
+ walk = subset;
while (walk)
{
char * name = subset_nth_value (walk, 0);
@@ -273,6 +275,18 @@
last_added_sev = name;
}
+ if (depth == 2)
+ {
+ // Add the index to the list of contained severities for this leave in the tree.
+ gtk_tree_model_get (tree_store, &iter,
+ COL_ISSUE_LINE_NR_LIST, &msg_id_list, -1);
+ GSList* list = g_slist_prepend (msg_id_list, GUINT_TO_POINTER (walk->id_line) );
+ gtk_tree_store_set (GTK_TREE_STORE(tree_store), &iter,
+ COL_ISSUE_LINE_NR_LIST, list, -1);
+ // Check if severity_override was applied (needs different subset)
+ // and set COL_BOOL_SEVERITY_MODIFIED accordingly (TODOs)
+ }
+
// Go down, fill the rest
if (depth < max_depth)
{
@@ -360,7 +374,7 @@
* @brief Handler for the row-activated signal from the tree view.
*
* If the activated row is one at level 3 where host, port and severity
- * are known, display the corresponding report in the report text
+ * are known, display the corresponding rgtk_tree_view_column_set_attributeseport in the report text
* widget.
*/
static void
@@ -376,15 +390,22 @@
struct context *context = arg_get_value((struct arglist*)user_data, "REPORT_CONTEXT");
char * plugin_oid = NULL;
struct nessus_plugin *plugin;
- GSList* issues = NULL;
-
- if (!gtk_tree_model_get_iter(model, &iter, path))
+ GSList* issues = NULL;
+ GSList* issue_ids;
+
+ // Pick up list with "ids" of reported security messages
+ if (TRUE)
+ {
+ gtk_tree_model_get_iter(model, &iter, path);
+ gtk_tree_model_get (model, &iter, COL_ISSUE_LINE_NR_LIST, &issue_ids, -1);
+ }
+
+ if (!gtk_tree_model_get_iter (model, &iter, path))
{
fprintf(stderr, "row_activated: could not set iter from path\n");
return;
}
-
// Pick up parents values
do
{
@@ -413,6 +434,15 @@
GtkTextBuffer *buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(textview));
int be = GPOINTER_TO_SIZE (arg_get_value((struct arglist*)user_data, "BE"));
+#ifdef DEBUG
+ GSList* walker = issue_ids;
+ while (walker)
+ {
+ printf ("In this row we got: %d\n", GPOINTER_TO_UINT (walker->data));
+ walker = walker->next;
+ }
+#endif
+
GtkTextIter iter;
if (be < 0) return;
More information about the Openvas-commits
mailing list