Ticket #723 (closed defect: fixed)

Opened 8 years ago

Last modified 7 years ago

Clear Preferences Plugin

Reported by: gharris Owned by: bdezonia
Priority: major Milestone: imagej2-b1-initial
Component: Plugins Version:
Severity: serious Keywords:
Cc: Blocked By:


Add a plugin to clear the IJ2 Preferences, thus falling back to the default parameter values.

Change History

comment:1 Changed 7 years ago by gharris

  • Milestone changed from imagej-2.0-alpha5 to imagej-2.0-beta1

comment:2 Changed 7 years ago by curtis

  • Owner changed from gharris to bdezonia
  • Status changed from new to assigned

Assigning to Barry since he is working on the Options code.

comment:3 Changed 7 years ago by bdezonia

Grant, can you clarify this? Do you mean reset the values of the OptionsPlugins? (Arrow Size, Font, Threads, etc.) Or do you mean for all plugins/preferences in the whole program and user plugins?

comment:4 Changed 7 years ago by gharris

Given that we are using the Prefs API, if we just remove all of the entries (from the backstore/registry), it effectively resets all defaults. (AFAIK, anything that gets a Pref value needs to provide a default.)

comment:5 Changed 7 years ago by bdezonia

682a930c788b5292f633162ec5e9a34280e8fe6a contains an implementation of a reset options plugin. so it does not clear everything but could be extended if needed.

implementation was straightforward. need to test a couple things:

1) if reset is run are there synchronization issues (like options dialogs load their fields correctly but are there existing settings in use that need to be updated?)

2) attempted to test if code is working. Process > Math > Divide relies on divide by zero value from Edit > Options > Misc. Should be able to set DBZ val to something like 10 and run Process > Math > Divide and pass 0 as value. This should set input image to all 10's. Unfortunately it is not working. In DivideDataValuesBy the call to getOption() is always returning "infinity" (the default value in the options dialog) rather than the currently set value. Determine why.

comment:6 Changed 7 years ago by bdezonia

2) fixed in 3741d1d14046f114349fa662f73cdfb0c7426f15 and 50c60bbd1cb3b90d73425a86a1395ea1842884c8

comment:7 Changed 7 years ago by bdezonia

After some testing I don't think 1) is an issue.

All that is left to do is determine whether resetting Options defaults is enough. Or do we need to reset all imagej.* prefs (such as other dialogs' values. This could affect 3rd party plugins if they use the IJ2 Prefs mechanism.

comment:8 Changed 7 years ago by gharris

How about reset the Options settings and have an option to reset ALL (meaning imagej.*) ?

comment:9 Changed 7 years ago by bdezonia

  • Component changed from ij-ext to ij-plugins

comment:10 Changed 7 years ago by bdezonia

  • Status changed from assigned to closed
  • Resolution set to fixed

In b7bc8516a7e860272675d9b621be3d9967845a8e added ability for ShowPrefs plugin to clear existing preferences

Note: See TracTickets for help on using tickets.