Ian Schorr wrote:
Guy Harris wrote:
Mainly called from "cell_size_request()", which is, in turn, mainly
called from "gtk_clist_optimal_column_width()", called mainly from
"gtk_clist_set_column_auto_resize()". Not automatically sizing the
columns might be the right answer here.
We talked about getting rid of the auto-resize a while back - what
would you suggest, attempting to "remember" column widths in the prefs
file and memory, like is being done with file dialog start dirs and
window position/size? Or did you have something else in mind?
I guess the only issue I have with trying to "remember" the column
widths is the same problem I have with other GUI items we're trying to
"remember" - both the window position/sizse and file dialog directory
"remembering" happens by setting prefs_write_needed to true.
Unfortunately this means that if the user has these GUI options selected
and one of them changes, Ethereal saves ALL current settings to the
prefs file on exiting - including prefs that the user didn't necessarily
want to change.
There's also the issue of what width columns should be by default - when
no prefs exist for column widths, or a "new" column is added whose width
has not been adjusted by the user yet.
I'm thinking this:
- "Remember" column widths in the prefs file, but change the way we're
flushing prefs:
(I suppose we could add "flags" for marking each pref that should
be flushed on exit and written by write_prefs() on exit, but I'm
thinking that perhaps there should be a new, seperate function for
writing individual prefs that accepts a pref name and value.)
- Call the new function and save the column width(s) every time a column
is resized.
- Associate a "default" column width with each column type - I don't
think a "general" default (i.e. each type of column gets, say, 100
pixels by default) makes any sense.
- Add a "Reset column widths" button to the Columns Preferences window
Does that sound reasonable?
A slightly related question:
Is there a good reason that we can't dynamically add/remove columns from
the packet list when added or removed by the user? I thought I read
that this would require us to completely rebuild that clist, but I'm not
quite sure why that can't be done (even if it means reparsing an open
trace to rebuild the packet list, which is currently done for just about
everything else anyway...).
If it's terribly difficult, would it make sense to add a pop-up box that
indicates to the user, after changing Columns, that they'll need to save
their preferences and restart Ethereal before the change will take
effect? I've noticed a lot of users very confused that Ethereal just
stares blankly at them after making Columns changes, myself included...
Ian