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] Prefs GUI handling: Apply followed by Cancel gives incorrect

From: "Sake Blok" <sake@xxxxxxxxxx>
Date: Sun, 3 May 2009 20:54:40 +0200
Bill,

My intuitive use of the "OK", "Apply" and "Cancel" buttons would be as follows:

- Starting point would be that the preferences used in the current instance of WS are the same as the preferences on disk - When the preferences window is opened, a backup copy of these preferences are made in memory - The user can make changes and revert them to the backup copy *before* applying them to the current WS instance - The user can make changes to the preferences and apply them to the current WS instance to see the effect, only the preferences in memory are affected - When the user clicks on cancel, the backup copy of the preferences will again be loaded into memory and applied, so that the preferences are the same as when the preferences display was opened, also the preferences on disk are still unchanged. - When the user makes changes and likes the result after applying the changes, they will be saved to disk when the OK button is clicked.

This means that the current behavior of saving the preferences to disk on apply need to be replaced by saving the preferences to disk on "OK" only. Your solution would mean that there is no way of returning to the preferences that were active when the preferences window was opened and the "Apply" button has been pressed. So there is no way of trying out the effect of new settings with an easy bail-out.

But that's just *my* intuitive use, not sure how others would intuitively use the "OK", "Apply" and "Cancel" buttons.

Cheers,
   Sake

----- Original Message ----- From: "Bill Meier" <wmeier@xxxxxxxxxxx>
To: <wireshark-dev@xxxxxxxxxxxxx>
Sent: Sunday, May 03, 2009 6:45 PM
Subject: [Wireshark-dev] Prefs GUI handling: Apply followed by Cancel gives incorrect results ?


Summary
-------

While working on fixing various issues with Preferences!Columns
I found the that Preferences!Apply followed by Preferences!Cancel
reverts the preferences not to the "preferences settings last saved
state" but to the preferences settings state when the preferences window
was opened.

(I'm describing the case for the normal default Wireshark configuration
when the Preferences Buttons are OK/Apply/Cancel w/o a Save button).


Both the Wireshark Wiki and the Wireshark User's Guide indicate that
Preferences ! Cancel should restore the preferences to the "last saved
state".

If there's no objection (and assuming that I'm not missing something),
I plan to check in a fix tomorrow (Monday) to update the in-memory saved
preferences state when/if the preferences are written to disk for
the Preferences!Apply and Preferences!Save buttons.



Details
-------

In the current Wireshark development SVN (and presumably in the various
1.0 releases) [For "show a save button" set to False]:

Preferences ! Apply followed by Preferences ! Cancel does the following

1. "Apply" writes the preferences to disk (with any changes made since
the preferences window was opened);

   (The next time Wireshark is started these preferences will be used).

2. "Cancel" reverts the in-memory preferences to the state of the
preferences when the Preferences window was opened (before any changes
were made) and *not* to the most recently saved state.

   This is true for the "general" preferences as well as for the the
   protocol preferences.


The fix looks reasonably simple:

For Prefs!Apply and Prefs!Save if/when the prefs are written to disk:

1. (Re)save the "prefs" structure (in memory).

2. (Re)save all the module preferences (in memory).


Bill
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe