Commit Graph

274 Commits

Author SHA1 Message Date
Jeff Morriss ce23d50028 Fix CID 715143: assert that the preference we were looking for was found. It
should be which is why this is an assertion not a NULL check.

svn path=/trunk/; revision=52847
2013-10-25 15:00:00 +00:00
Jeff Morriss 81b0681c12 Fix CID 715144: assert that the preference we were looking for was found. It
should be which is why this is an assertion not a NULL check.

svn path=/trunk/; revision=52846
2013-10-25 14:57:55 +00:00
Alexis La Goutte f99f7bf17e From Dean Lee via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8597 Qtshark: Chinese Simp translation
From me :
Add to the (new) Qtshark Language selector

svn path=/trunk/; revision=51871
2013-09-09 17:49:15 +00:00
Alexis La Goutte fe4407ebc7 Add Preference to change Language (in QtShark)
Need restart application to change language

svn path=/trunk/; revision=51869
2013-09-09 16:20:45 +00:00
Evan Huus 14b098baf7 When freeing the preferences of a module, also free the preferences of its
submodule.

svn path=/trunk/; revision=51328
2013-08-13 02:56:55 +00:00
Evan Huus 615687f4c0 Fix the most egregious of the newly exposed leaks, about 28KB.
svn path=/trunk/; revision=51047
2013-07-31 01:55:20 +00:00
Evan Huus 999c603027 Convert preferences to wmem. Exposes some more memory leaks that didn't show up
before.

svn path=/trunk/; revision=51046
2013-07-31 01:49:57 +00:00
Guy Harris afe77c5a4e Clean up white space a bit, make the description of the capture column
type depend on what values are supported, add some comments.

Regularize the curly bracket style a bit.

svn path=/trunk/; revision=50998
2013-07-29 00:27:20 +00:00
Gerald Combs a05f55bffc Add a UAT dialog. Make UAT preferences uat_t * instead of void *.
C++-ize the UAT headers.

Add an ElidedLabel widget. Use it in the File Set, Profile, and UAT
dialogs.

Update the Qt README.

svn path=/trunk/; revision=50896
2013-07-25 23:49:47 +00:00
Guy Harris 21609c54bb Don't report a syntax error if a preference name without a "." is
specified, report it as "no such preference" instead.  That should be
less confusing; see

   http://stackoverflow.com/questions/17757659/how-to-apply-and-override-preferences-with-tshark

for an example of confusion.

#BACKPORT 1.10, 1.8

svn path=/trunk/; revision=50745
2013-07-21 00:56:42 +00:00
Pascal Quantin 57aebcf776 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942 :
Fix segmentation fault when reading pref file

svn path=/trunk/; revision=50737
2013-07-19 08:04:58 +00:00
Pascal Quantin fdc867a4fc Temporarily disable offending code triggering a segmentation fault on Linux (see bug 8942)
svn path=/trunk/; revision=50725
2013-07-18 09:12:59 +00:00
Anders Broman 09c5152fa7 From Cal Turney:
Unrecognized preferences and color filters created in proprietary or older versions are discarded when saved.

If the user attempts to save the preferences or colorfilters file, a popup is displayed that warns that unrecognized prefs or color filters have been detected and will be discarded if the save operation is allowed to proceed. In the case of Preferences, the popup message includes the version at which the file was last saved.  A "Continue without Saving" button is provided so that the user can save the profile under a different name.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942

svn path=/trunk/; revision=50716
2013-07-18 04:28:36 +00:00
Anders Broman e9d236ec0b Backing out r50690 (exept simple_dialog)
struct FILE is different on windows vs *nix


https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942

svn path=/trunk/; revision=50691
2013-07-17 05:52:51 +00:00
Anders Broman e0341f776c From Cal Turney:
Unrecognized preferences and color filters created in proprietary or older versions are discarded when saved.

If the user attempts to save the preferences or colorfilters file, a popup is displayed that warns that unrecognized prefs or color filters have been detected and will be discarded if the save operation is allowed to proceed. In the case of Preferences, the popup message includes the version at which the file was last saved.  A "Continue without Saving" button is provided so that the user can save the profile under a different name.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8942

svn path=/trunk/; revision=50690
2013-07-17 04:52:19 +00:00
Guy Harris 86147047f5 Fix one that got missed.
svn path=/trunk/; revision=50660
2013-07-16 03:16:26 +00:00
Chris Maynard 9d3cda266b Revert r50655 for this file.
svn path=/trunk/; revision=50659
2013-07-16 03:04:47 +00:00
Chris Maynard d331c33b4f This should fix warning: to be safe all intermediate pointers in cast from 'gchar **' to 'const char **' must be 'const' qualified.
svn path=/trunk/; revision=50655
2013-07-16 02:34:44 +00:00
Evan Huus afa96c3f33 Fix some of the preferences leaks. Don't strdup the defaults, as they will be
strduped again immediately when they are registered. To make this safe, tweak
the flow a bit so that they are guaranteed to be registered immediately after
being set here.

svn path=/trunk/; revision=50563
2013-07-14 00:45:19 +00:00
Anders Broman 06f748c0b5 prefs.c: In function 'capture_column_set_cb':
prefs.c:1745: warning: unused variable 'syntax_error'

svn path=/trunk/; revision=50457
2013-07-09 05:14:33 +00:00
Anders Broman bbf7636e61 From Cal Turney:
Wireshark crashes when switching from a v1.11.0 profile to a v1.4.6 prof and then to a v1.5.1 profile.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8884

#BACKPORT 1.10

svn path=/trunk/; revision=50455
2013-07-09 04:22:43 +00:00
Jeff Morriss 20674d8877 From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8876 :
Errors in preferences preceding "gui.console_open" are not immediately
displayed in the console:  If a gui.console_open is set to "AUTOMATIC" or
"ALWAYS" and an error or warning occurs in a preference previous to it, the
warning is not displayed in the console window because the window is not yet
open. However, if the user switches to another profile and returns, the
messages will be displayed.

Fix: Move the gui.console_open to the top of the list in
prefs_register_modules() of prefs.c. Existing preferences files can be
corrected by saving them.

svn path=/trunk/; revision=50269
2013-06-30 21:58:25 +00:00
Michael Mann 277aed869e Make colors used by colorize_filter_te_as_* as preferences. Bug 5413 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5413)
svn path=/trunk/; revision=50203
2013-06-28 03:03:36 +00:00
Jeff Morriss 838e3767ce From Cal Turney via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8707 :
As suggested by Jakub, don't use strlen() when g_string->len will do.

From me:

Don't assume that just because we "got_val" that the value has a length.
Checking it first eliminates this warning from Valgrind:

==11954== Invalid read of size 1
==11954==    at 0x61D1466: read_prefs_file (prefs.c:3012)
==11954==    by 0x61D1841: read_prefs (prefs.c:2955)
==11954==    by 0x409901: main (tshark.c:1137)
==11954==  Address 0xc05244f is 1 bytes before a block of size 16 alloc'd
==11954==    at 0x4A08A6E: realloc (vg_replace_malloc.c:662)
==11954==    by 0x3CF8C4D736: g_realloc (in /usr/lib64/libglib-2.0.so.0.3400.2)
==11954==    by 0x3CF8C66226: ??? (in /usr/lib64/libglib-2.0.so.0.3400.2)
==11954==    by 0x3CF8C66ACE: g_string_insert_c (in /usr/lib64/libglib-2.0.so.0.3400.2)
==11954==    by 0x61D1566: read_prefs_file (gstring.h:139)
==11954==    by 0x61D1841: read_prefs (prefs.c:2955)
==11954==    by 0x409901: main (tshark.c:1137)

svn path=/trunk/; revision=49731
2013-06-03 22:07:21 +00:00
Anders Broman aff9b07fd3 From Cal Turney:
Preferences with trailing commas are ignored.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8707

svn path=/trunk/; revision=49629
2013-05-30 05:30:08 +00:00
Guy Harris 7f97cc813e From Cal Tunney:
contify some arrays;

	don't complain about "print.command" on Windows, just ignore it,
	as it's valid on non-Windows platforms;

	fix some comparisons for preferences moved elsewhere;

	clean up some comments.

svn path=/trunk/; revision=49485
2013-05-21 21:28:41 +00:00
Guy Harris dc8af1b552 Clean up white space.
svn path=/trunk/; revision=49484
2013-05-21 20:38:51 +00:00
Anders Broman 1569217448 From Cal Turney:
When another profile is selected, its column.hidden preference is ignored.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8696

svn path=/trunk/; revision=49434
2013-05-20 05:33:18 +00:00
Gerald Combs a5037603ce Tell the user tha gui.update.channel probably shouldn't be changed.
svn path=/trunk/; revision=48970
2013-04-22 17:58:28 +00:00
Jeff Morriss c2ced4a2ab Don't try to open <home>/.wireshark on Windows: Wireshark hasn't written to
that directory since 2001 and reading from that directory was only left in for
backwards compatibility with versions prior to r4702.  I think it's now safe
to remove that backwards compatibility.

This eliminates the last argument of get_persconffile_path().

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8437

svn path=/trunk/; revision=48797
2013-04-09 02:48:03 +00:00
Bill Meier 0df5a9390d From beroset:
remove C++ incompatibilities
 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 attachment #10397

svn path=/trunk/; revision=48438
2013-03-20 01:18:10 +00:00
Irene Rüngeler 44e6a88b13 Add interface options preferences.
svn path=/trunk/; revision=48275
2013-03-13 12:38:08 +00:00
Michael Tüxen 15501fad2a Try to fix the buildbots.
The patch for capture_dlg.c is from Anders...

svn path=/trunk/; revision=48164
2013-03-07 12:06:55 +00:00
Irene Rüngeler cb42bc9fec Add buffersize and snap length to the preferences.
svn path=/trunk/; revision=48163
2013-03-07 09:16:55 +00:00
Anders Broman d4e23d8daa Use explicit casts.
svn path=/trunk/; revision=48162
2013-03-07 07:48:33 +00:00
Bill Meier 24eff41b08 it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47896
2013-02-26 02:19:57 +00:00
Gerald Combs 5a5d872639 Register the gui.update.interval preference.
svn path=/trunk/; revision=47750
2013-02-19 23:05:27 +00:00
Gerald Combs 81a5be5813 Enable automatic updates for Win64. Fix a copy/paste error.
svn path=/trunk/; revision=47749
2013-02-19 22:57:40 +00:00
Gerald Combs e48236a436 Add automatic software update checks for Win32 using WinSparkle. Add
preferences (currently hidden) to disable updates, set the update
frequency, and set the update "channel" (stable vs development). Add a
"Help" menu item to manually check for updates.

svn path=/trunk/; revision=47748
2013-02-19 22:21:17 +00:00
Gerald Combs d21f62b73b Add a directory name preference type (PREF_DIRNAME) and registration
routine (prefs_register_directory_preference). Add PREF_FILENAME and
PREF_DIRNAME support to the Qt module preferences. Change a couple of
preferences to directory names.

Clean up some names and default settings.

svn path=/trunk/; revision=47573
2013-02-08 18:07:34 +00:00
Gerald Combs d1f6e2e3ec Use a not-quite-black background for marked packets.
http://ianstormtaylor.com/design-tip-never-use-black/

svn path=/trunk/; revision=47392
2013-01-31 18:46:40 +00:00
Gerald Combs 2dff8d7605 Add font and color preferences. Unfortunately Qt doesn't have a color
picker widget so we're back to popping up dialogs. Move the contents of
monospace_font.{cpp,h} to wireshark_application.{cpp,h}.

Pango and Qt use completely different string representations for fonts.
Add a separate gui.qt.font_name preference so that they don't clobber
each other.

svn path=/trunk/; revision=47240
2013-01-24 01:10:12 +00:00
Gerald Combs 6ef1fc5002 GTK+:
Get rid of user-hostile behavior. In the layout preferences pane 2 & 3
radio buttons overrode the user's selection if a duplicate item was
selected. Now we assume that the user knows what he or she is doing and
steal duplicate selections from the other panes.

Qt:

Match the new GTK+ behavior in the layout preferences. Add padding
around the layout images. Add toolbar style preferences to the
Appearance pane (instead of the layout pane).

All:

Remove the selection mode and scrollbar placement prefs and mark them
obsolete as recently discussed on -dev.

Adjust the layout images yet again after more Awful Monitor Testing.

svn path=/trunk/; revision=47214
2013-01-22 18:27:18 +00:00
Jaap Keuter 5fe15dfd37 Fix CID 966637 and CID 966638
Check pointers before using them.

svn path=/trunk/; revision=47186
2013-01-20 21:14:12 +00:00
Gerald Combs ae7ee61e84 Rename the "saved_val" preference element to "stashed_val" in order to
more clearly indicate that it's a copy of a preference value rather than
something we've saved in the preferences file. Update
prefs_pref_to_str() to handle default, stashed, and current prefs.

Create ui/preference_utils.[ch] and move some common routines there. Use
prefs_pref_type_name() in the GTK+ preferences dialog.

Make the "OK" button in the Qt preferences dialog work. We simply write
the prefs and redissect on "OK" and do nothing on "Cancel". This is
intentionally different from the Apply/OK/Cancel behavior in the GTK+
version.

Add a general "emitAppSignal" method to wsApp and use it for packet
dissection and preference changes.

Suggest that we might want to create a WsString class to make conversion
between QStrings, gchar *s, and GStrings easier.

svn path=/trunk/; revision=47139
2013-01-18 00:50:14 +00:00
Gerald Combs b0ef1a67ed strcmp → g_strcmp0. Fixes a crash on Windows.
svn path=/trunk/; revision=47085
2013-01-14 23:23:50 +00:00
Gerald Combs b82f42d8cf When the user is editing text or selecting from a combo box, don't
immediately close the dialog if he or she presses the escape or enter
keys. Revert the value if the user presses escape. Properly handle the
base for uint preferences. Fix a NULL pointer dereference.

Add a gchar_free_to_qstring utility routine which creates a QString from
a g_malloced string and frees it.

svn path=/trunk/; revision=47083
2013-01-14 22:21:11 +00:00
Gerald Combs 0fa6a4c421 Allow editing via the advanced preferences tree. Double-clicking an
item's name, status, or type resets it to its default value.
Double-clicking the item's value lets you edit it. Implement the
advanced search field. (Clicking OK and Cancel still doesn't yet do
anything.)

Note that we could probably use a
prefs_register_{uint16|port}_preference routine for 16-bit values. Make
reset_pref public. Update some names and descriptions.

svn path=/trunk/; revision=46986
2013-01-07 19:13:03 +00:00
Alexis La Goutte 86e16b4f61 Fix some Dead Store (Dead initialization) Warning found by Clang
svn path=/trunk/; revision=46978
2013-01-06 19:13:33 +00:00
Gerald Combs b99199fcf8 Constify a couple of variables and export a couple of functions.
svn path=/trunk/; revision=46943
2013-01-05 03:42:28 +00:00