aboutsummaryrefslogtreecommitdiffstats
path: root/gtk/prefs_dlg.c
AgeCommit message (Collapse)AuthorFilesLines
2003-03-11When registering a string preference, if the value of the preference isGuy Harris1-10/+5
NULL, convert it to a copy of a null string, otherwise replace it with a copy of the string, so that we know that the variable for the preference always points to a string that can be freed. That also obviates the need to worry about a null-pointer value for a preference variable when checking to see whether a preference has changed. When checking for a string preference not being set, check for an empty string, not a null pointer - the above code turns null pointers into pointers to empty strings, *and* the GUI code does (and always did!) the same. svn path=/trunk/; revision=7343
2002-12-27Make last modifications work with gtk2.Olivier Abad1-3/+7
svn path=/trunk/; revision=6817
2002-12-20Support putting preferences into arbitrary places in a tree, which isGuy Harris1-66/+109
used to construct the "Edit->Preferences" dialog box; this includes the ability to register a "subtree" for preferences. Instead of special-casing protocol preferences, have a subtree "Protocols" for protocol preferences. svn path=/trunk/; revision=6808
2002-11-28Constify some pointers to avoid converting const pointers to non-constGuy Harris1-5/+5
pointers. svn path=/trunk/; revision=6685
2002-11-11Use gtk1/gtk2 compatibility macros to reduce #ifdefs.Olivier Abad1-131/+68
svn path=/trunk/; revision=6610
2002-11-03Merge gtk and gtk2 directories.Olivier Abad1-84/+267
svn path=/trunk/; revision=6552
2002-09-05Include cleanups in gtk and gtk2:Jörg Mayer1-12/+1
Remove unneded includes Add include wrappers where missing svn path=/trunk/; revision=6191
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-27/+27
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-5/+1
equivalents for the gtk/ directory. svn path=/trunk/; revision=5930
2002-08-01Fix a few more memleaks found by valgrind (all derivingJörg Mayer1-2/+3
from the get_persconffile_path mess). svn path=/trunk/; revision=5927
2002-07-17Get rid of some "unused variable" and "unused static function" warnings,Guy Harris1-2/+68
and some compile errors in Tethereal, when compiling without libpcap. If libpcap is missing (whether that's detected at compile time or, as on Windows, at run time), don't call any of the "capture_prefs" routines - the routine to create the capture preferences page wasn't called, so the other routines can try to refer to non-existent widgets and other items and crash. Get rid of the stub routines in "capture_prefs()" used when compiling without libpcap, as they're no longer called. svn path=/trunk/; revision=5888
2002-06-16Handle the "bool" members the same way we handled the members forGuy Harris1-7/+7
enumerated values - "boolp" for pointers, "boolval" for values. svn path=/trunk/; revision=5678
2002-06-16From Chris Waters: don't use "bool" as a variable name or structureGuy Harris1-7/+7
member, as it's a C++ keyword. svn path=/trunk/; revision=5677
2002-04-20On Windows, include "capture-wpcap.h", to define "has_wpcap".Guy Harris1-1/+7
svn path=/trunk/; revision=5209
2002-04-19On Windows, don't put the capture preferences item into theGuy Harris1-2/+9
"Preferences" dialog box if we couldn't load WinPcap. svn path=/trunk/; revision=5204
2002-03-05From Joerg Mayer: remove unused variables.Guy Harris1-6/+2
svn path=/trunk/; revision=4879
2002-03-05From Joerg Mayer: use _U_ to flag unused arguments.Guy Harris1-11/+11
svn path=/trunk/; revision=4878
2002-02-14FIRST_PROTO_PREFS_PAGE needs to be incremented by 2 in order forGilbert Ramirez1-2/+2
the "Protocol Preferences" pop-up menu option to work properly. svn path=/trunk/; revision=4735
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-2/+2
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). svn path=/trunk/; revision=4586
2002-01-20Make the blurbs for protocol preference items into tooltips. (This alsoGuy Harris1-22/+79
lets us add tooltips to other preference items whose widgets are created with the "create_preference_XXX()" routines - just pass in a tooltip text string rather than a null pointer.) svn path=/trunk/; revision=4577
2002-01-14Get the current value of Boolean preferences before adding widgets forGuy Harris1-1/+2
them (by putting back a line that got accidentally deleted in a previous checkin). svn path=/trunk/; revision=4537
2002-01-13Add a preferences page for the name resolution flags.Guy Harris1-79/+226
Separate the preferences value for those flags and the name resolution code's value into separate variables; this means that the resolution code no longer depends on the preferences code, and may let us eventually have the current setting and the preference setting differ (so that a user can temporarily override the preference setting without causing subsequent saves of the preferences to save the temporary value). Add routines to create various types of widgets for preferences, and to fetch the values for "enumerated" preferences, and use them both in the code to handle hardwired preference pages and table-driven preference pages. svn path=/trunk/; revision=4536
2002-01-11Have a routine to create a scrolled window, set its vertical scrollbarGuy Harris1-4/+2
preference, and add it to the list of scrolled windows; call that routine to create scrolled windows, rather than creating it and calling other routines to do the other two operations. As "set_scrollbar_placement_all()" and "set_ctree_styles_all()" always set the styles to match the user's preference, don't have them take an argument, have them just use the user's preference settings. Get rid of unnecessary includes of "prefs_dlg.h", replacing them with includes of "prefs.h" if necessary. Don't have "prefs_dlg.h" include "prefs.h" - its sole purpose is to declare routines defined in "prefs_dlg.c" - and add any additional includes of "prefs.h" this requires. Get rid of unnecessary includes of "prefs.h" and "gtkglobals.h". Fix up white space. svn path=/trunk/; revision=4521
2002-01-11Have routines to create GtkCTrees, set their line and expander styleGuy Harris1-12/+2
based on the user's UI preferences, and add them to a list of GtkCTrees. Use those routines to create all GtkCTrees. Have a routine to update the preferences for all of those GtkCTrees. Call that routine whenever the preferences change. Label the line and expander style preferences as "Tree line style" and "Tree expander style", as they no longer apply only to protocol trees. Move the routines to maintain a list of scrolled windows, and to update scrollbar placement for scrolled windows, to "ui_util.c". svn path=/trunk/; revision=4520
2002-01-10Add a preferences page for capture preferences, so that the user canGuy Harris1-6/+31
directly edit the capture preferences, rather than only being able to set them implicitly from the values for the most recent capture. Add a preferences item for the interface on which to capture. Get rid of some unused variables. svn path=/trunk/; revision=4510
2001-12-04From Thomas Wittwer: remove unnecessary calls toGuy Harris1-3/+1
"prefs_module_foreach()". svn path=/trunk/; revision=4321
2001-11-04Allow a dissector to register preferences that it no longer supports asGuy Harris1-2/+15
obsolete; we silently ignore attempts to set those in a preferences file, so that we don't spam the user with error messages caused by them having saved preferences in an earlier release that contained those preferences. Make the Diameter and iSCSI dissectors register obsolete preferences. Crash if some code tries to register a preferences module with a name that contains something other than lower-case ASCII letters, numbers, or underscores, or that has already been registered, or if some code tries to register a preference with a name that contains something other than lower-case ASCII letters, numbers, underscores, or periods, or that has already been registered, so that we don't put code like that in a release and have to shovel code into "prefs.c" to fix it up later. (The problem with multiple modules or preferences with the same name should be obvious; the problem with names with blanks, or upper-case letters, or punctuation, is that they're a pain to type on the command line.) svn path=/trunk/; revision=4148
2001-10-24On Windows, put Ethereal configuration files under the "ApplicationGuy Harris1-3/+5
Data\Ethereal" directory under the user's profile, as that appears to be the Windows 2000 standard. svn path=/trunk/; revision=4071
2001-10-23Add a new routine to create the ".ethereal" directory for a user.Guy Harris1-6/+16
Use that routine rather than duplicating that code in the routines to write out the preference file and filter files. Use it in the code for the color filter dialog, so that the directory in question is created if necessary. As that routine returns an error indication, have the code that calls that routine put up a message box if the attempt fails. svn path=/trunk/; revision=4065
2001-10-22Add a routine to get the directory in which personal configuration filesGuy Harris1-2/+2
reside. Use it, rather than concatenating the user's home directory and ".ethereal" in a number of files. Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname separator. svn path=/trunk/; revision=4061
2001-10-13A small patch from Moronori Shindo to fix compiles under MSVC etc ...Richard Sharpe1-1/+2
svn path=/trunk/; revision=4026
2001-10-13Put the scrollbar for the scrolled window containing the CList in theGuy Harris1-1/+3
preferences dialog where the user specified, and register that scrolled window so that if the preference is changed the scrollbar moves. svn path=/trunk/; revision=4025
2001-10-13Set the data for E_{PRINT,COLUMN,STREAM,GUI}_PAGE_KEY to the notebookGuy Harris1-5/+5
page for the preferences item rather than to the frame for the preferences item, as that's what the code in "gtk/gui_prefs.c" expects (otherwise you get errors). svn path=/trunk/; revision=4024
2001-10-11Reduce the CinemaScope-like proportions of the preferences dialog byGerald Combs1-24/+131
getting rid of the notebook tabs and using a CTree to select pages. svn path=/trunk/; revision=4015
2001-08-21On Windows, use the directory in which the binary resides as theGuy Harris1-4/+2
directory in which global data files are stored. If an installed binary is being run, that's the correct directory for them; if a build-tree binary is being run, the "manuf" file will be there, and you can put other data files there as well, if necessary. Do the same with plugins, except that, if there's no "plugins\\{version}" subdirectory of that directory, fall back on the default installation directory, so you at least have a place where you can put plugins for use by build-tree binaries. (Should we, instead, have the Windows build procedure create a subdirectory of the "plugins" source directory, with the plugin version number as its name, and copy the plugins there, so you'd use the build-tree plugin binaries?) Move "test_for_directory()" out of "util.c" and into "epan/filesystem.c", with the other file system access portability wrappers and convenience routines. Fix "util.h" not to declare it - or other routines moved to "epan/filesystem.c" a while ago. svn path=/trunk/; revision=3858
2001-01-11Show the menu_item widget during the creation of an option menu forGilbert Ramirez1-1/+2
enumerated option lists. This to overcome a small bug in which the menu item text doesn't have enough vertical padding. svn path=/trunk/; revision=2868
2000-11-18Fix a number of problems that caused compiles to fail ifGuy Harris1-2/+2
PLUGINS_NEED_ADDRESS_TABLE was defined. svn path=/trunk/; revision=2662
2000-08-23Bleah. What was I thinking? "dlg_window_new()" should take the titleGuy Harris1-3/+2
for the dialog window as an argument (as various dialog creators in GTK+ do), not oblige every caller of it to cut-and-paste a "gtk_window_set_title()" call after it. svn path=/trunk/; revision=2345
2000-08-21Instead of each set of built-in preferences having "ok", "save",Guy Harris1-24/+123
"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-17It was silly of me to require that "forget_scrolled_window()" be calledGuy Harris1-2/+2
explicitly; the right thing to do was to have "remember_scrolled_window()" catch the "destroy" signal on the scrolled window widget, and have the handler for that signal forget the scrolled window. Doing that obviates the need to have creators of scrolled windows keep track of the windows they have and forget them when they're destroyed. The signal for a "the window manager has requested that this window go away" event is "delete_event", not "delete-event"; fix the "gtk_signal_connect()" calls that were using "delete-event". svn path=/trunk/; revision=2284
2000-08-15Fix a problem with const char *Laurent Deniel1-3/+3
svn path=/trunk/; revision=2276
2000-08-15Implements the "Properties" menu item which displays the preferences windowLaurent Deniel1-2/+66
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-07-10In the "Preferences" dialog box, "Save" sets the current preferenceGuy Harris1-13/+55
values to the ones specified in the dialog box, so it should also redissect the packets and re-evaluate the display filter if any of them changed. (I.e., it did part of an "Apply"; it needs to do all of it.) "Cancel" also needs to find out if any preferences were changed by the reversion and redissect and refilter if they did. svn path=/trunk/; revision=2132
2000-07-09Turn the code of "colorize_packet()" into a static routine that is givenGuy Harris1-10/+44
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-1/+296
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-07-05Get rid of the stuff to let the callback that pops up the PreferencesGuy Harris1-8/+2
dialog select a particular page - I think that was used only by the filter code back when "Filter:" buttons popped up a Preferences dialog with the Filter page (which is no longer a Preferences dialog page) selected, but now there's a separate Filter dialog box. svn path=/trunk/; revision=2116
2000-07-05Add a "dlg_window_new()" routine, which creates a GTK_WINDOW_DIALOGGuy Harris1-2/+2
window and makes it transient for the top-level window; the transient-for at least provides a hint to X window managers to minimize the dialog if the main window is minimized; keep the dialog on top of the main window in the Z order for windows; perhaps (if there are any window managers that actually *do* this) even put it atop the main window in the X-Y plane (KWM doesn't and I seem to remember that the Exceed X server for Windows doesn't). It's generally considered the Right Thing To Do for dialog boxes. Use that routine to create dialog boxes, rather than doing it directly in the code for that dialog box. svn path=/trunk/; revision=2112
2000-05-08Make the "Preferences" dialog box use the new utilities to make the EscGuy Harris1-1/+7
key cancel the dialog box. svn path=/trunk/; revision=1923
2000-05-08Keep a pointer to the current "Preferences" window, if any - if not, theGuy Harris1-3/+29
pointer is NULL - so that, instead of doing nothing if the user selects "Edit->Preferences" when there's already a "Preferences" dialog box open, we raise and de-iconify that window. Connect the preferences dialog box and any file selection dialog box opened from its Print tab, so that: if the preferences dialog box goes away, so does the file selection dialog box (as it no longer has a text widget into which it can stuff the selected file name); if the "File:" button is clicked when there's already a file selection dialog box open, we just reactivate that existing dialog box rather than popping up a new one. Catch the ESC key in the file selection dialog box popped up for the "File:" button in the Print tab of the Preferences dialog box, and make it cancel the file selection dialog box. svn path=/trunk/; revision=1922