Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] How do I initialise a boolean preference

From: "Hal Lander" <hal_lander@xxxxxxxxxxx>
Date: Mon, 29 Jan 2007 07:16:27 -0900
This makes things clearer. I was looking in the directories where I have been building/running Wireshark. Instead Windows, in my documents directory, has a hidden directory called 'Appllication Data'. That is why I could not find things.

The sub directory
\Application Data\Wireshark
contains three files cfilters, preferences and recent.

Preferences does contain the boolean I was registering and I can see it changing as I edit the preference in Wireshark.

Thanks Gerald

Hal


From: Gerald Combs <gerald@xxxxxxxxxxxxx>
Reply-To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
Subject: Re: [Wireshark-dev] How do I initialise a boolean preference
Date: Mon, 22 Jan 2007 13:18:57 -0800

You might try checking Help->About Wireshark->Folders.  Specific
locations vary by platform and compile-time options.

Hal Lander wrote:
> I did not realise there was a preference file.
>
> Now looking at http://www.wireshark.org/docs/man-pages/tshark.html I can
> see there should be a global and a personal preference file.
> The manual does not seem to give the actual names for these files, and I
> don't have a 'preferences' directory.
>
> Do you know what the filenames and directory path should be?
>
> Thanks again
> Hal
>
>
>> From: skydiver <skydiver@xxxxxxxxx>
>> Reply-To: Developer support list for Wireshark
>> <wireshark-dev@xxxxxxxxxxxxx>
>> To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
>> Subject: Re: [Wireshark-dev] How do I initialise a boolean preference
>> Date: Mon, 22 Jan 2007 16:39:49 +0100 (CET)
>>
>> Hi,
>>
>> Question: is our preference already in the preferences file?
>> Then your default gets overwritten by this stored value. The default is
>> default only when the preference is newly introduced.
>>
>> Thanx,
>> Jaap
>>
>> On Mon, 22 Jan 2007, Hal Lander wrote:
>>
>> > I start Wireshark (don't open a file or anything).
>> > My dissector's proto_reg_handoff routine is called.
>> > In the code that runs only once I initialise a variable
>> >     static gboolean prefTick
>> > to TRUE, and register the preference.
>> > Before returning the variable is printed out and it is TRUE.
>> >
>> > My dissector's proto_reg_handoff routine is called a second time (I
>> have not
>> > done anything in the Wireshark window yet).
>> > Before returning the variable prefTick is printed out and it is FALSE.
>> >
>> > In Wireshark I edit the preferences for my protocol, I can see my
>> tick box
>> > and it is unticked.
>> > I tick the box and apply it.
>> > My dissector's proto_reg_handoff routine is called
>> > Before returning the variable prefTick is printed out and it is TRUE.
>> >
>> > My question are;
>> > 1. Why is my proto_reg_handoff routine being called twice initially?
>> > 2. Why does the second call set my preference to FALSE?
>> > 3. How do I get the tick box to default to TRUE initially (which is
>> what i
>> > was trying to do) ?
>> >
>> > It looks as though the code is working apart from not having the right
>> > initial value.
>> >
>> > TIA
>> > Hal
>> >
>> > _________________________________________________________________
>> > Valentine�s Day -- Shop for gifts that spell L-O-V-E at MSN Shopping
>> >
>> http://shopping.msn.com/content/shp/?ctId=8323,ptnrid=37,ptnrdata=24095&tcode=wlmtagline
>>
>> >
>> >
>>
>
>
>> _______________________________________________
>> Wireshark-dev mailing list
>> Wireshark-dev@xxxxxxxxxxxxx
>> http://www.wireshark.org/mailman/listinfo/wireshark-dev
>
> _________________________________________________________________
> Search for grocery stores. Find gratitude. Turn a simple search into
> something more.
> http://click4thecause.live.com/search/charity/default.aspx?source=hmemtagline_gratitude&FORM=WLMTAG
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Wireshark-dev mailing list
> Wireshark-dev@xxxxxxxxxxxxx
> http://www.wireshark.org/mailman/listinfo/wireshark-dev

_______________________________________________
Wireshark-dev mailing list
Wireshark-dev@xxxxxxxxxxxxx
http://www.wireshark.org/mailman/listinfo/wireshark-dev

_________________________________________________________________
From predictions to trailers, check out the MSN Entertainment Guide to the
Academy Awards� http://movies.msn.com/movies/oscars2007/?icid=ncoscartagline1