Mailing List Archive

NessusClient/nessus/prefs_dialog prefs_report.c,1.5,1.6
Update of /usr/local/cvs/NessusClient/nessus/prefs_dialog
In directory raccoon.nessus.org:/tmp/cvs-serv80015/nessus/prefs_dialog

Modified Files:
prefs_report.c
Log Message:
Update the report text whenever the selection in the report tree
changes. This way the user only has to click once, and the report text
matches the selection.


Index: prefs_report.c
===================================================================
RCS file: /usr/local/cvs/NessusClient/nessus/prefs_dialog/prefs_report.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- prefs_report.c 13 Feb 2006 13:49:15 -0000 1.5
+++ prefs_report.c 13 Feb 2006 17:33:03 -0000 1.6
@@ -354,8 +354,34 @@
}
subset_free(subset);
}
+ else
+ {
+ clear_report_text(user_data);
+ }
}

+
+/* Called whenever the selection changes. If the row is to be selected
+ * call row_activated so that the corresponding report is shown */
+static gboolean
+selection_func(GtkTreeSelection *selection, GtkTreeModel *model,
+ GtkTreePath *path, gboolean path_currently_selected, gpointer user_data)
+{
+ GtkTreeIter iter;
+
+ if(!path_currently_selected &&
+ !gtk_tree_selection_get_selected(selection, NULL, NULL))
+ {
+ gtk_tree_model_get_iter(model, &iter, path);
+ row_activated(gtk_tree_selection_get_tree_view(selection), path,
+ NULL, user_data);
+ }
+
+ /* allow selection state to change */
+ return TRUE;
+}
+
+
/* Set the pixmap of the cell renderer from the severity of the current cell
*/
static void
@@ -481,10 +507,11 @@

selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(tree));
gtk_tree_selection_set_mode(selection, GTK_SELECTION_SINGLE);
+ gtk_tree_selection_set_select_function(selection,
+ selection_func, ctrls, NULL);

g_signal_connect(G_OBJECT(tree), "row-activated", G_CALLBACK(row_activated),
ctrls);
-

/* the report widget in a scolled window */
report_window = gtk_scrolled_window_new(NULL, NULL);

_______________________________________________
Nessus-cvs mailing list
Nessus-cvs@list.nessus.org
http://mail.nessus.org/mailman/listinfo/nessus-cvs