Commit Graph

29 Commits

Author SHA1 Message Date
Michael Mann acf2c06044 Compiler error fixes resulting from r44348
svn path=/trunk/; revision=44359
2012-08-08 20:47:20 +00:00
Michael Mann 3d12ea758b Base framework to allow all preferences to be part of generic preferences API. Implementation will follow, but I wanted the framework in place first.
svn path=/trunk/; revision=44331
2012-08-08 12:13:24 +00:00
Guy Harris fa1f18d80b Clean up mix of tabs and 4-space-tab indents.
svn path=/trunk/; revision=43594
2012-07-07 01:26:58 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Anders Broman 3814106d7e From Michael Mann:
generic preferences implementation

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

svn path=/trunk/; revision=43484
2012-06-25 21:05:36 +00:00
Jeff Morriss 4fdc3c3cc2 Create, and start using, file name preferences.
File name preferences are basically just string preferences except that the
GUI will present a "Browse" button that allows the user to go and find the
file s/he wants (rather than having to blindly type in the full path).

svn path=/trunk/; revision=43228
2012-06-13 01:13:12 +00:00
Jeff Morriss 6eba069093 Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4768 :
Return an error if the user specifies a value in a range in excess of the
range-specified maximum.

Except when reading in preferences files which might have ranges that exceed
the maximum (because we didn't use to check): in that case silently lower the
out-of-range values.

svn path=/trunk/; revision=34698
2010-10-29 22:09:31 +00:00
Anders Broman a009cc0605 Doxygen changes.
svn path=/trunk/; revision=33990
2010-08-29 10:47:38 +00:00
Anders Broman a96e6b2047 Doxygen changes.
svn path=/trunk/; revision=33981
2010-08-28 19:27:19 +00:00
Jeff Morriss 12b5361a7b Remember the default value of each protocol preference.
If, when we're writing the preferences file, the current value of the
preference is the same as the default, write out the preference (since the
preference file is also the documentation for the preferences) but comment it
out (so that if, for example, you go back to an older version of Wireshark
you won't get warnings about non-existant preferences that you didn't
change--and thus probably don't care too much about).

It might be interesting to, in the future, add a UI to restore the default
values.

svn path=/trunk/; revision=32967
2010-05-26 03:31:30 +00:00
Jeff Morriss c420b83ee5 find_val_for_string() is only used in prefs.c so remove the prototype
and make it static.

When reading enum preferences, use the current value of the preference as the
default value of the preference instead of a hard-coded 1.  This way if we
couldn't find the appropriate value we'll don't end up changing the preference
to something that may or may not make sense.

svn path=/trunk/; revision=32950
2010-05-25 20:57:14 +00:00
Bill Meier 1826a02933 Add #include <stdio.h> in a few places for Solaris
svn path=/trunk/; revision=29576
2009-08-27 02:53:13 +00:00
Ronnie Sahlberg 8686381c19 get rid of GTree and use emem trees instead
svn path=/trunk/; revision=23738
2007-12-04 03:28:04 +00:00
Ronnie Sahlberg 643705ac5d reverse previous patch
svn path=/trunk/; revision=23735
2007-12-04 02:09:37 +00:00
Ronnie Sahlberg 75eacd9ad5 remove the use of GTrees and replace these with emem trees instead
svn path=/trunk/; revision=23734
2007-12-04 01:45:17 +00:00
Tomas Kukosa 6caaafbb6d Next few improvements to speed up startup about 10%.
- use GTree instead of GList for preference module lists

svn path=/trunk/; revision=23679
2007-11-30 09:22:01 +00:00
Graeme Lunt a51f1694c9 This change allows a structure to be created under the "Protocols" section of the preferences.
A new function is introduced, prefs_register_protocol_subtree(), that allows the subtree the protocol should appear under to be specified. The subtree is specified as a string, with a '/' delimiting each subtree element. For example,
	prefs_register_protocol(proto_dap, prefs_register_dap);
becomes
	prefs_register_protocol_subtree("OSI/X.500", proto_dap, prefs_register_dap);

The function will create all the intermediate subtree nodes that are required, if they don't already exist. 
This allows the grouping of procotols which should make the list of protocols more manageable as even more are added. The current aim is to group by protocol family e.g. 
+ OSI
  + X.400
      X.411
      X.420
  + X.500
      DISP
      DAP
      DOP
      DSP
  + X.509
      X509AF
      X509CE
      ...

but others grouping could be envisioned (e.g. by first letter). 

As the intermediate nodes may already have preferences (e.g. OSI), then modules are now allowed to have submodules. Previously each node was either a subtree or held preferences. This is consistent with the "User Interface" node.

The subtree structure has no effect on how the preferences are saved to file, and the "Protocol Preferences..." menu option will bring up the preferences expanded to the correct node.

In addition, a new "blank page" has been introduced for intermediate nodes that have no preferences (and is also used when the "Protocols" node itself is chosen). This prevents confusion when the user moves from a node with preferences to a node without preferences, but the page old page is still shown.

There is also a change to prevent '#' characters in a value being treated as a comment when parsing the preferences file. (There is nothing that adds comments when writing the preferences file.) 


svn path=/trunk/; revision=21066
2007-03-19 19:08:22 +00:00
Luis Ontanon d70a58f881 second iteration:
* fields of an uat table now are passed using an array of uat_filed_t
* field callbacks take two more userdata arguments
* add some macros to define uat field callbacks.
* uats can be registered as preferences for a specific protocol
   - the preference widget is a button that opens the uat's window
* dfilter-macro => reflect changes to API


svn path=/trunk/; revision=20695
2007-02-03 14:25:02 +00:00
Guy Harris 72bc2582fc A callback in read_prefs_file() should return a prefs_set_pref_e, not an
int.

svn path=/trunk/; revision=20069
2006-12-08 01:11:20 +00:00
Gerald Combs 40ca271813 From Giorgio Tino: Add a "static text" protocol preference type. This
can be used to add descriptive text inline with other preference items.
The "preference" contents are not written to disk.

Fixup whitespace.


svn path=/trunk/; revision=20037
2006-12-05 00:43:00 +00:00
Ulf Lamping 627b9196a5 various minor prefs code cleanup
svn path=/trunk/; revision=19916
2006-11-17 01:24:03 +00:00
Ulf Lamping 58c388e903 add a "private_data" pointer to the read_prefs_file() function, which will be "tunneled" to the callback function. This seems to be generally a good idea - as a lot of GLib/GTK function doing similiar and I'll need this for the upcoming update mechanisms.
svn path=/trunk/; revision=19905
2006-11-15 23:33:39 +00:00
Ulf Lamping e940ff36b4 from Stephen Fisher:
Attached is a patch for consideration that changes the title in the 
preferences notebook to be the full description of the preference (but 
leaves the short name in the preferences list on the left).

svn path=/trunk/; revision=19370
2006-09-29 22:48:38 +00:00
Gerald Combs f7e38bd5e6 Change ETH_VAR_IMPORT to WS_VAR_IMPORT. Try to fix a duplicate variable
definition in the Catapult DCT2000 code.

svn path=/trunk/; revision=18524
2006-06-20 18:30:54 +00:00
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Guy Harris 554f620001 Constify to remove a bunch of warnings. Add some casts to squelch
(presumably-)harmless-but-otherwise-unremovable const-to-nonconst
warnings.

In the TACACS dissector, clean up the variables used in option parsing
to avoid some const-to-nonconst warnings.

Clean up some white space.

svn path=/trunk/; revision=15043
2005-07-24 19:01:28 +00:00
Guy Harris 727ad67453 Remove the fixed maximum number of subranges in a range_t; dynamically
allocate them to be large enough.

Add checks that the numbers in the range fit in a guint32.

Check the validity of a range before saving or printing, and report
errors in an alert box.

Clean up white space.

svn path=/trunk/; revision=12320
2004-10-16 23:32:24 +00:00
Guy Harris abd16b297f From Jeff Morriss: PREF_RANGE preference type, for ranges of integers.
svn path=/trunk/; revision=12300
2004-10-14 23:45:09 +00:00
Guy Harris 92ee993e82 "prefs-int.h" belongs in epan, too.
svn path=/trunk/; revision=12168
2004-10-01 08:33:53 +00:00