Ethereal-dev: [Ethereal-dev] Preferences for non-dissectors

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Jason House <jhouse@xxxxxxxxx>
Date: Mon, 15 Jul 2002 13:22:31 -0400
I was trying to evaluate how easy it would be to add a  preferences
module for a new non-dissector element of ethereal (such as rate
graphs).

There is a GList called modules that stores all preference modules.  It
appears that this is used indiscriminately as both "all modules" and
"modules for protocol dissectors."  I see two ways to fix this:
1. Have a list of lists and modify all the pref accessing functions to
handle the new structure
(or just 2 lists, but this looses generality)
2. Modify the struct pref_module to have a field indicating what
category it belongs to and add a function/functions similar to
prefs_module_foreach that recognizes these categories.

I don't like the extra work of #1, but I do see at least one advantage
to it.  The list of lists could instead be a list of structures, where
each structure contains a list of modules.  The idea would be that the
extra information within the structure would indicate other useful
information for displaying the groups of modules in a GUI.  That way
titles such as "Protocols", "Rate Graphs", "Plugins", etc... would not
have to be hard coded into the GUI rendering.

#2 avoids the extra work of modifying just about everything in prefs.c,
but requires the GUI rendering components to handle more specific
details.  This would make the use of multiple GUI interfaces more
complex.

Anybody have any additional thoughts on this topic?