aboutsummaryrefslogtreecommitdiffstats
path: root/prefs.c
AgeCommit message (Collapse)AuthorFilesLines
2000-08-21Add prefs.gui_marked_[fb]g color preferences for theLaurent Deniel1-1/+37
color of marked frames. They are currently only available from preferences file, but I will add the color selection in GUI later. svn path=/trunk/; revision=2327
2000-08-21Instead of each set of built-in preferences having "ok", "save",Guy Harris1-8/+86
"cancel", and "delete" methods, give them: "fetch" - fetch from the notebook tab any values not already stored in "prefs", and store them there, but doesn't apply them; "apply" - apply the settings in "prefs"; "destroy" - clean up any windows created from the tab. As we no longer have "cancel" methods, we don't have per-preference code to revert preference values; instead, we have the common preference dialog box code make a copy of all the current preferences, and, when the "Cancel" button is clicked, free the current preferences and copy the saved preferences to it, and apply the preferences. Add an "Apply" button to the preference dialog box, which applies the current preferences without closing the dialog box. Treat a request to delete the preferences dialog box as equivalent to clicking "Cancel". Have a "remember_ptree_widget()" routine to remember all protocol tree widgets, and use the list of those widgets when we set GUI preferences for the protocol tree widgets, rather than setting the main protocol tree widget and then using the list of packet windows. Move that code out of "main.c" to "proto_draw.c", as it's not used by anything in "main.c", but is used by stuff in "proto_draw.c". Make the font one of the preferences we can set on the fly for protocol tree widgets. Also make it something we can set on the fly for the packet list widget. svn path=/trunk/; revision=2316
2000-08-20Instead of having the normal-weight and bold fonts set separately,Guy Harris1-1/+14
generate the name of the boldface font from the Roman font; if the two fonts don't have the same widths, the display will look weird when a field is selected, and it's a bit of a pain for the user to have to select *two* fonts. On UNIX/X, default to "-*-fixed-medium-r-semicondensed-*-*-120-*-*-*-*-*-" rather than to "-*-lucidatypewriter-medium-r-normal-*-*-120-*-*-*-*-iso8859-1" - some Linux distributions appear to lack the Lucida typewriter font. Add a "gui.font_name" preference to the preferences file, specifying the normal-weight font to use. Have it settable from the "GUI" tab in the Preferences dialog box - the "Font..." button, when clicked, pops up a font selection dialog box. If we either can't open the selected font or the boldfaced version of the font, default to "6x13" and "6x13bold" as fallbacks - the former will probably be "fixed", and the latter would be "fixedbold" if X actually created such an alias, but it doesn't so we use "6x13bold" instead. svn path=/trunk/; revision=2304
2000-08-15Fix a problem with const char *Laurent Deniel1-2/+2
svn path=/trunk/; revision=2276
2000-08-15Implements the "Properties" menu item which displays the preferences windowLaurent Deniel1-1/+20
at the correct notebook page when a particular protocol (which has registered some preferences) is selected in the tree view. - add set_menus_for_selected_tree_row() in menu.[ch] - add prefs_is_registered_protocol() and prefs_get_title_by_name() in prefs.[ch] svn path=/trunk/; revision=2275
2000-08-11Miscellaneous code cleaningLaurent Deniel1-1/+3
- add <stdarg.h> or <varargs.h> in snprintf.h and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes - remove the check of multiple inclusions in source (.c) code (there is a bit loss of _cpp_ performance, but I prefer the gain of code reading and maintenance; and nowadays, disk caches and VM are correctly optimized ;-). - protect all (well almost) header files against multiple inclusions - add header (i.e. GPL license) in some include files - reorganize a bit the way header files are included: First: #include <system_include_files> #include <external_package_include_files (e.g. gtk, glib etc.)> Then #include "ethereal_include_files" with the correct HAVE_XXX or NEED_XXX protections. - add some HAVE_XXX checks before including some system header files - add the same HAVE_XXX in wiretap as in ethereal Please forgive me, if I break something (I've only compiled and regression tested on Linux). svn path=/trunk/; revision=2254
2000-08-07Cast an argument to "isspace()" to "guchar" so that if it has the 8thGuy Harris1-2/+2
bit set it won't get sign-extended; this squelches a GCC complaint, and may keep weird things from happening if there're non-ASCII ISO 8859/n characters in a preferences file. svn path=/trunk/; revision=2221
2000-07-09Turn the code of "colorize_packet()" into a static routine that is givenGuy Harris1-10/+34
a word to use in the progress dialog, and a flag indicating whether the display filter is to be reevaluated or not, and: have "colorize_packet()" call that routine with "Colorizing" and FALSE as those arguments; have the filtering code call that routine with "Filtering" and TRUE as those arguments; add an exported routine to call that routine with "Reprocessing" and TRUE as those arguments, to use to re-generate the packet list and to re-filter the packets if a protocol preference has been changed. Keep track of whether preferences are changed from their initial value by a preferences file or a command-line option, or from their previous value by the "Preferences" dialog box; have "prefs_apply_all()" only call the "apply" callback for a module if they have. Call "prefs_apply_all()" after the command-line arguments have been parsed and after "OK" has been clicked in the "Preferences" dialog box, to notify modules of preference changes if they've registered a callback for that. After "OK" has been clicked in the "Preferences" dialog box, if any preferences have changed, call the reprocessing routine, as the summary line for some frames and/or the current display filter's value when applied to some frames may have changed as a result of a preference change. Do the same after "OK" or "Apply" has been clicked in the "Display Options" dialog box (as it controls a protocol preferences item. svn path=/trunk/; revision=2126
2000-07-05Add support for a global "ethereal.conf" preferences file, stored in theGuy Harris1-43/+542
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most likely). Add a mechanism to allow modules (e.g., dissectors) to register preference values, which: can be put into the global or the user's preference file; can be set from the command line, with arguments to the "-o" flag; can be set from tabs in the "Preferences" dialog box. Use that mechanism to register the "Decode IPv4 TOS field as DiffServ field" variable for IP as a preference. Stuff that still needs to be done: documenting the API for registering preferences; documenting the "-o" values in the man page (probably needs a flag similar to "-G", and a Perl script to turn the output into documentation as is done with the list of field); handling error checking for numeric values (range checking, making sure that if the user changes the variable from the GUI they change it to a valid numeric value); using the callbacks to, for example, update the display when preferences are changed (could be expensive); panic if the user specifies a numeric value with a base other than 10, 8, or 16. We may also want to clean up the existing wired-in preferences not to take effect the instant you tweak the widget, and to add an "Apply" button to the "Preferences" dialog. svn path=/trunk/; revision=2117
2000-01-29Remove instances of getenv("HOME") and provide a get_home_dir() functionGilbert Ramirez1-6/+7
which provides a default value if "HOME" is not set. svn path=/trunk/; revision=1579
2000-01-03Don't have "write_prefs()" display a dialog box if the attempt to openGuy Harris1-8/+12
the preferences file fails, have it return an error indication and the path of the preferences file, and have its caller display the dialog box. That way you don't have to drag in the dialog box code if you're going to use the preferences code in, say, a "line-mode" Ethereal. svn path=/trunk/; revision=1413
1999-12-30Allow user to modify appearance of lines and expanders in GUI protocolGilbert Ramirez1-3/+48
tree. svn path=/trunk/; revision=1400
1999-12-29Changed the protocol tree widget from a GtkTree to a GtkCTree. The two reasonsGilbert Ramirez1-1/+26
I did this: First, Havoc Pennington, in "GTK+/Gnome Application Development", in Appendix seciton A.3.88, recommends using GtkCTree instead of GtkTree because GtkCtree is faster, and GtkTree has limitation on its total row height: since it must fit inside a GdkWindow, it is limited to 32,768 pixels of height. GtkTree is more flexible with regards to the types of widgets that can be placed in the tree, but since we deal only with text, that doesn't matter, at least for now. Secondly, a GtkTree doesn't allow arrow-key navigation (at least as far as I could tell). It always bothered me that the up and down arrow keys worked in the packet list and in the hex dump, but no in the protocol tree. GtkCTree does allow arrow-key navigation. In fact, GtkCTree is a subclass of GtkCList (the packet list widget), so they behave a lot alike. I went ahead and fixed the selection bar which has been bothering Richard for a long time now. :) In the GUI preferences dialogue, you can now set both the packet list selection bar and the protocol tree selection bar to either "browse" or "select" mode. "browse" mode is what you're used to: the arrow keys move an outline of the selection bar, but do not change the selection. "select" mode does change the selection when the arrow keys are pressed. The default behavior is set to "select", which seems more natural for a first-time user. svn path=/trunk/; revision=1393
1999-12-29Move the definition of "prefs" from "gtk/prefs_dlg.c" to "prefs.c", soGuy Harris1-1/+3
that you don't have to have "gtk/prefs_dlg.c" to get it defined - future non-GTK (text mode, curses, etc.) programs wouldn't have it. svn path=/trunk/; revision=1387
1999-12-16Add a new page to the Preferences notebook: a GUI page. The soleGilbert Ramirez1-1/+15
option right now is the placement of the vertical scrollbars in the 3 panes. (it's one decision; you can't have the placement of the vertical scrollbar in the packet list pane different than the placement in the protocol tree pane, for example). I did this because I find it convenient to have the vertical scrollbars on the *left* side of the text. My mouse cursor is usually expanding and collapsing the protocol tree widgets, and once the protocol tree changes size, I usually have to scroll. I'd rather move my mouse cursor just a few pixels over to find the vertical scrollbar. svn path=/trunk/; revision=1351
1999-12-09Move the GTK+ implementations of various UI utilities out of "util.c"Guy Harris1-2/+2
into "gtk/ui_util.c", and move the declarations of those UI utilities out of "util.h" into "ui_util.h". (The header file is in the top-level directory, rather than the "gtk" directory, because it declares window-system-independent interfaces to routines with window-system-dependent implementations.) Add to "gtk/ui_util.c" a routine to set the window and icon title. Use that routine to make the title of an Ethereal top-level window be {filename} - Ethereal if there's a capture open, and have "{filename}" be "<capture>" if it's a temporary capture file. svn path=/trunk/; revision=1255
1999-12-02Add stream window color preferences. We don't (yet) use cmaps, so thisGerald Combs1-6/+74
may not work with pseudocolor systems. svn path=/trunk/; revision=1179
1999-09-09More shuffling of GTK-related routines to gtk subdirectory.Gilbert Ramirez1-140/+4
svn path=/trunk/; revision=636
1999-09-09More shuffling of GTK-related files to gtk subdirectory.Gilbert Ramirez1-2/+2
svn path=/trunk/; revision=635
1999-09-01Moved GTK-dependent routines for file dialogues, print dialogues, printGilbert Ramirez1-1/+2
preferences, and menus to gtk subdirectory. svn path=/trunk/; revision=623
1999-07-13Added support for compiling on win32 with Visual C and 'nmake'. It compiles,Gilbert Ramirez1-1/+13
but does not link. Perhaps someone who understands the MS tools can help out. I made it link a few months ago, but with different version of glib/gtk+. I can't remember how I made it link. Most of the compatibility issues were resolved with adding #ifdef HAVE_UNISTD_H the the source code. Please be sure to add this to all future code. svn path=/trunk/; revision=359
1999-06-21Found some erroneous usages of gtk_signal_connect_object. I always wonderedGilbert Ramirez1-29/+21
why I had to swap fields (data = w) in some of the callback functions when I added support for gtk+-1.1. Because of the use of gtk_signal_connect_object, the wrong value was being sent to the callback function. We were just lucky that with gtk+-1.0 it worked. gtk_signal_connect_object is for use with callbacks that take one argument. gtk_signal_connect is for use with callbacks that take two arguments. svn path=/trunk/; revision=324
1999-06-12Don't pop up the "Can't open preferences file" dialog until *after*Guy Harris1-6/+5
we've shown the top-level window, because we want it to pop up on *top* of the top-level window, rather than being hidden behind it. Put a "strerror()"-based reason *why* the open failed in that dialog. svn path=/trunk/; revision=308
1999-03-01Added display filters to wiretap.Gilbert Ramirez1-4/+1
svn path=/trunk/; revision=198
1998-12-29* Added Joerg Mayer's Vines patchGerald Combs1-7/+4
* Added Joerg to the AUTHORS file * Added Guy's bitfield decode patch * Fixed time output svn path=/trunk/; revision=142
1998-12-22Fixed more bugs with dialogues and gtk+-1.1.x.Gilbert Ramirez1-6/+22
svn path=/trunk/; revision=137
1998-12-17A patch spread across many files to let Ethereal compile under GTK+-1.1.x.Gilbert Ramirez1-1/+2
Tests for GTK versions are done during compilation, not during "./configure". The big problems have been taken care of in this patch (functional change in the packet clist and conversion of menu_factory to item_factory), but plenty of smaller problems with dialogue boxes abound. I have fixed a small problem with file_open*(), but have left 2 comments in just in case I'm not going about this the right way. Can someone verify? svn path=/trunk/; revision=127
1998-11-18* Disable filter-related widgets if we're using wiretap.Gerald Combs1-1/+4
svn path=/trunk/; revision=105
1998-11-18* Added patches from Laurent and GuyGerald Combs1-6/+5
svn path=/trunk/; revision=103
1998-11-17* Added column formatting functionality.Gerald Combs1-42/+193
* Added check_col(), add_col_str() and add_col_fmt() to replace references to ft->win_info. * Added column prefs handling code. svn path=/trunk/; revision=97
1998-10-29* Fixes for problems with the preference initialization code (Guy)Gerald Combs1-5/+10
svn path=/trunk/; revision=77
1998-10-28* Added preference file saves and reads.Gerald Combs1-3/+216
svn path=/trunk/; revision=75
1998-10-16* Copied in the correct GNU license (I'm such a goober)Gerald Combs1-3/+3
* Hacks to the filter interface (Gerald) * About box (Laurent) * AppleTalk support (Simon) * Mods to the match_strval routine (Gerald) svn path=/trunk/; revision=61
1998-10-13* Pod page updateGerald Combs1-5/+6
* Minor tweaks to the filter prefs svn path=/trunk/; revision=40
1998-10-12- Added match_strval function to packet.cGerald Combs1-20/+28
- Separated display and capture filters; rearranged some of the look and feel - Lots of other miscellaneous fixes and updates svn path=/trunk/; revision=38
1998-10-10* OSPF alignment fixes (Gerald)Gerald Combs1-10/+31
* FDDI support (Laurent, Guy) svn path=/trunk/; revision=36
1998-09-27Merged in a _huge_ patch from Guy Harris. It adds a time stap column,Gerald Combs1-1/+2
generalizes the column printing code, adds a "frame" tree item to the tree view, and fixes a bunch of miscellaneous coding bugs. svn path=/trunk/; revision=31
1998-09-26Initial prefs support.Gerald Combs1-12/+22
svn path=/trunk/; revision=27
1998-09-25* Ethernet manufacturer support (Laurent)Gerald Combs1-0/+109
* PPP fixes (Gerald) * Null/loopback interface support (Gerald) svn path=/trunk/; revision=25