Commit Graph

71 Commits

Author SHA1 Message Date
Ulf Lamping 54fe7e9e93 a lot of code cleanup
svn path=/trunk/; revision=11017
2004-05-27 16:50:16 +00:00
Guy Harris 911bad80f0 Have two strings in an enum_val_t - one that's a short string that is
convenient to put into a command line (no capital letters, no spaces to
require quotes), and one that's a detailed description for use in the
UI.  Allow either of them in the preferences file or "-o" option; use
the detailed description in the UI, and also use it when writing the
preferences out, so that the preference will be readable by older
versions of Ethereal (assuming the preference existed in that version).

Update "README.developer" to give more detail about an enum_val_t (and
to put the _t in), and to give a more detailed description of the
"radio_buttons" argument to "prefs_register_enum_preference()".

svn path=/trunk/; revision=10982
2004-05-24 02:25:21 +00:00
Ulf Lamping e1fef4b5ca Win32 only: Preference setting to open a console window, one of:
never (default), automatic (like before), always

svn path=/trunk/; revision=10870
2004-05-13 15:28:02 +00:00
Ulf Lamping 1cd1c93214 fixed a typo
svn path=/trunk/; revision=10727
2004-04-29 16:35:15 +00:00
Ulf Lamping cbcacf7e48 from Thomas Palmer: add a preference setting for filter toolbar placement
svn path=/trunk/; revision=10555
2004-04-06 19:02:18 +00:00
Ulf Lamping 7b62a629e8 replaced sprintf / snprintf by g_snprintf,
various other string related changes

svn path=/trunk/; revision=10373
2004-03-13 15:15:26 +00:00
Ulf Lamping 8d463d620f changed some label texts
svn path=/trunk/; revision=10225
2004-02-24 18:39:13 +00:00
Guy Harris 90cf9a6b7b The HIG's and/or GUI toolkit documentation for:
Mac OS X

	GNOME

	Qt

	KDE

	Windows

all indicate that {message,alert} boxes are modal, at least for the
window to which they apply.  (Presumably the idea is that not forcing
the user to pay attention to the alert box, and allowing more than one
alert box to be up for a given window, causes more problems than not
letting the user do stuff to that window in order to figure out what the
underlying problem is or figure out what to do to fix it - the message
should be sufficient, in most if not all cases, to let you know what the
problem is.)

Make "simple_dialog()" unconditionally make the alert box modal, and get
rid of ESD_TYPE_MODAL.  XXX - we need to make it possible to make an
alert box modal for a given window, rather than just the top-level
window.

svn path=/trunk/; revision=10051
2004-02-12 22:24:28 +00:00
Ulf Lamping d11080a09f moved window geometry values from prefs to recent,
added new pref / recent setting: "maximized main window",
which will save, if the main window is maximized or not,
this will take effect on GTK version 2 only, but is saved nonetheless

svn path=/trunk/; revision=9949
2004-02-01 20:28:11 +00:00
Guy Harris 1980fa5dbf Pass ESD_BTN_OK rather than NULL as a second argument to
"simple_dialog()"; NULL might be #defined to be a pointer expression on
some platforms, causing compiler warnings (and, on platforms where a
null pointer doesn't have all its bits 0, possibly causing misbehavior,
although I don't think there are any such platforms on which Ethereal
runs).

Don't allow 0 as button mask argument to "simple_dialog()".

Squelch a compiler warning.

Report fatal problems as errors, not warnings.

Report file I/O errors with "file_open_error_message()".

Report file write errors (including those reported by "close()", e.g.
some errors writing to an NFS server) when saving raw packet data to a
file.

svn path=/trunk/; revision=9915
2004-01-31 03:22:42 +00:00
Ulf Lamping 25edd1c53e renamed ESD_TYPE_CRIT to ESD_TYPE_ERROR to
better reflect the real error text

svn path=/trunk/; revision=9913
2004-01-31 02:25:46 +00:00
Guy Harris 89c529db8e Have "font_apply()" return an indication as to whether it succeeded or
failed and, if it failed, how it failed.  Have it leave up to its caller
the job of reporting that it couldn't load the requested font; have its
callers do that, and have them set the zoom level on failure so that we
have a zoom level that is at least more likely to work.  Make the alert
boxes for "font_apply()" failures be error boxes, not warning boxes.

svn path=/trunk/; revision=9818
2004-01-24 01:02:54 +00:00
Guy Harris 52faded8d8 If we call "font_apply()", we don't need to call
"redraw_hex_dump_all()".

svn path=/trunk/; revision=9815
2004-01-23 20:13:23 +00:00
Ulf Lamping 6861d6351a code cleanup
svn path=/trunk/; revision=9794
2004-01-23 01:10:24 +00:00
Olivier Abad 7728b2c563 gtk_font_selection_set_font_name doesn't work when run before appending
the font selection widget to the notebook (at least in GTK2).

svn path=/trunk/; revision=9769
2004-01-21 12:19:19 +00:00
Ulf Lamping b21d225252 prevented GTK-warning, as the column index was too high
svn path=/trunk/; revision=9756
2004-01-20 19:33:23 +00:00
Ulf Lamping ef57df088f a.) saving GTK1 and GTK2 fontnames in different preference setting, to prevent problems when switching between GTK1 and GTK2 ethereal versions
b.) added new feature "Edit->Go To First Packet" "Edit->Go To Last Packet" with corresponding menu and toolbar items
c.) added new feature "View->Zoom In" / "View->Zoom Out" / View->Normal Size" with corresponding menu and toolbar items
This feature will act as a "size offset" to the current fontsize, so that the packet list/tree view/... will have a larger/smaller font size.
The value is stored inside the recent file.
d.) Win32 only: Try to get the win32 system font and fontsize at program startup and show the menus/dialogs and such with the same font and fontsize like other win32 windows.
This makes the program make a *lot* more feel like a normal win32 program.

svn path=/trunk/; revision=9753
2004-01-20 18:47:25 +00:00
Guy Harris ae92ea0b12 Clean up some compiler warnings.
Clean up white space.

Have "font_fetch()" return a Boolean indicating whether it succeeded or
not.  If it failed, don't use "new_font_name", as it hasn't been set.

svn path=/trunk/; revision=9689
2004-01-17 03:09:24 +00:00
Ulf Lamping af78977df5 new "Font" preferences page instead of a font dialog in "User Interface"
svn path=/trunk/; revision=9686
2004-01-17 00:26:22 +00:00
Ulf Lamping 065edac68b move "marked packet color" setting from gui_prefs to Colors page.
remove the Color dialog from gui_prefs.c

svn path=/trunk/; revision=9667
2004-01-15 01:13:51 +00:00
Ulf Lamping 949f1f2d07 using button compatibility macros
svn path=/trunk/; revision=9636
2004-01-10 16:27:43 +00:00
Guy Harris 563f423d76 Turn the GTK+ 1.2.10 clist code into our own widget; that lets us modify it
to add functionality or improve performance, although, until we make it
work on GTK+ 1.3[.x] and 2.x, we shouldn't count on the performance
improvements, or make its API different from that of the GtkClist API
(other than names).

Move all the code that knows about the packet list into
gtk/packet_list.c, so that the GtkClist vs. EthClist stuff is
encapsulated inside it.

svn path=/trunk/; revision=9608
2004-01-09 08:36:23 +00:00
Ulf Lamping 864fbca295 moved recent files pref, as it splits corresponding dir entries
svn path=/trunk/; revision=9508
2004-01-01 13:16:40 +00:00
Richard Sharpe 930410872f OK, now I have added the preference for recent_files_count_max, and we can
set the value and so on. We put the value in the text field before it is
displayed, and so on ...

svn path=/trunk/; revision=9470
2003-12-29 00:48:56 +00:00
Ulf Lamping 467c05b3ea removed some MSVC warnings (conversions between double/float and int)
svn path=/trunk/; revision=9422
2003-12-23 00:16:46 +00:00
Ulf Lamping 34dfb0b3d0 redraw supported_protos dialog, if GUI prefs changed
svn path=/trunk/; revision=9022
2003-11-19 00:10:25 +00:00
Guy Harris c5fad03460 The user interface preference page has only 9 rows in the GTK+ 2.x
version.

svn path=/trunk/; revision=8933
2003-11-11 05:23:23 +00:00
Guy Harris 6108feb655 Create the last two items in the GUI preferences page's first column the
same way the other items are created - in order, going down the page,
and using "pos++" as the table position.

svn path=/trunk/; revision=8932
2003-11-11 05:09:03 +00:00
Olivier Abad 3b90e2f177 In fileopen_dir_changed_cb() :
- return FALSE immediately if the text entry is empty ;
- return FALSE at the end of the function so that the signal is sent to
  the entry. It avoids a Gtk-ERROR (and an abort) :
file: gtkentry.c: line 4338 (blink_cb): assertion failed:
GTK_WIDGET_HAS_FOCUS(entry))

svn path=/trunk/; revision=8735
2003-10-20 06:06:26 +00:00
Guy Harris ee5c9ff5b8 From Ulf Lamping: add a GUI preference item to control the toolbar
style.

Make the style text arrays static, as nobody uses them outside prefs.c.

Use FALSE and TRUE for the values for the Boolean controlling the
highlighting style.

Note that we're now using stock icons in the toolbar in GTK+ 2.x.

Put back the resizing of elements in the top-level container, at least
for GTK+ 1.2[.x]; otherwise, the toolbar's height never gets smaller,
even if you change the style in such a way as to reduce the height of
the elements (icons+text -> icons or text, icons -> text).

Make some routines and variables not used outside gtk/toolbar.c static.

svn path=/trunk/; revision=8720
2003-10-16 21:19:12 +00:00
Guy Harris ffa3ad8ef5 From Ian Schorr:
Add a preference to control whether the "File > Open" dialog box
	should start out in the last directory in which it looked - and
	save that in the preferences file across invocations - or should
	always start out in a user-specified directory, and add another
	preference to specify that directory.

	Write out section name comments into the preferences file.

Clean up white space a bit.

svn path=/trunk/; revision=8699
2003-10-14 23:20:17 +00:00
Gerald Combs 9d603ccc2c Make sure the color selection dialog displays a color selection widget.
Tweak the button layout slightly.

svn path=/trunk/; revision=8332
2003-09-02 18:27:50 +00:00
Olivier Abad 5d8e9b0d14 Various fixes related to GTK2 :
- give the focus to the packet_list when a capture file is opened, and
  each time we change the selection in the packet list (it seems that
  the tree view has the focus if we don't do this) ;

- in set_plist_sel_browse() : it seems that packet_list->selection_mode
  is always 0 in GTK2 so we can't use it to determine the current mode.
  Use a static variable instead.

This should fix the second part of debian bug #199763

svn path=/trunk/; revision=8045
2003-07-18 20:55:11 +00:00
Olivier Abad 29011060de Use gtk1/gtk2 compatibility macros to reduce #ifdefs.
svn path=/trunk/; revision=6610
2002-11-11 15:39:06 +00:00
Olivier Abad 05ef1fc475 Merge gtk and gtk2 directories.
svn path=/trunk/; revision=6552
2002-11-03 17:38:45 +00:00
Jörg Mayer e4a2e2cefe Include cleanups in gtk and gtk2:
Remove unneded includes
Add include wrappers where missing

svn path=/trunk/; revision=6191
2002-09-05 18:48:52 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris 5fe414c555 From Joerg Mayer: use _U_ to flag unused arguments.
svn path=/trunk/; revision=4878
2002-03-05 11:56:00 +00:00
Guy Harris a0d7e90519 Make the blurbs for protocol preference items into tooltips. (This also
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-20 20:05:18 +00:00
Guy Harris 0a03b0f73e Add a preferences page for the name resolution flags.
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-13 20:35:12 +00:00
Guy Harris 649cc279d6 Put the labels of check boxes to the left of the checkboxes,
right-aligned, and give all of them a colon at the end, to match the
style of other preferences.

svn path=/trunk/; revision=4535
2002-01-12 11:09:09 +00:00
Guy Harris feb5791d6a Have a routine to create a scrolled window, set its vertical scrollbar
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-11 07:40:32 +00:00
Guy Harris e592fa4a6b Have routines to create GtkCTrees, set their line and expander style
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-11 06:43:18 +00:00
Guy Harris 9357047df5 Add a preferences page for capture preferences, so that the user can
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
2002-01-10 07:43:39 +00:00
Gerald Combs 30c5551caa Add preferences to save the main window size and position. If enabled,
the geometry is saved at exit.  Should we save the main window pane
sizes as well?

Move the DEF_WIDTH and DEF_HEIGHT #defines from gtk/main.h to prefs.h.
Remove the reference to DEF_WIDTH from proto_hier_stats_dlg.c.

svn path=/trunk/; revision=4462
2001-12-31 04:41:50 +00:00
Guy Harris 4acaa8b961 Fix to a preferences dialog bug, from <inoue@ainet.or.jp>.
svn path=/trunk/; revision=3315
2001-04-17 18:49:55 +00:00
Gilbert Ramirez 540f564993 Calculate the height and width of m_r_font globally, since various
routines need it.

When a user clicks on a hex digit or on the corresponding character
(the "text dump" portion) in the hex dump, find the field in the
proto_tree that the byte corresponds to, expand the GtkCTree so that
the field is viewable, select the field, and center it vertically.
LanAlyzer has this feature, and I've missed it in Ethereal.

svn path=/trunk/; revision=3096
2001-03-02 23:10:12 +00:00
Guy Harris fcd119d834 Add a "color.h" file that declares a nominally-toolkit-independent
"color_t" structure to store color values (although currently it has all
the same fields that a GdkColor has; its currently advantage is that you
don't have to include any GTK/GDK stuff to declare it).

Add routines in the "gtk" directory to convert between "color_t" and
GdkColor values.

Define, in "prefs.h", all colors as "color_t" values rather than
GdkColor values.  "prefs.h" now no longer needs to include <gtk/gtk.h>,
so don't include it.

svn path=/trunk/; revision=2692
2000-11-21 23:54:10 +00:00
Guy Harris 74777083d3 Fix a number of problems that caused compiles to fail if
PLUGINS_NEED_ADDRESS_TABLE was defined.

svn path=/trunk/; revision=2662
2000-11-18 21:41:40 +00:00
Gilbert Ramirez 3424ae654e Remove #include "gtk/colors.h" from file.h, which keep the GTK+ header
files from being #included in epan/packet.c.
Fix the other files that need either "gtk/colors.h" or <gtk/gtk.h> #included
as a result of not pulling in gtk/colors.h automatically because of file.h.

svn path=/trunk/; revision=2519
2000-10-20 04:26:40 +00:00