Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 316011

Summary: [Help] Restore defaults button does not read remoteHelpPreferred preference correctly. - Fix in Eclipse 3.6.1
Product: [Eclipse Project] Platform Reporter: Jim Perry <perryja>
Component: User AssistanceAssignee: Chris Goldthorpe <cgold>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: cgold, ChrisAustin
Version: 4.0   
Target Milestone: 3.6.1   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
Patch with one line change for correct local help preferred value
none
Improved patch none

Description Jim Perry CLA 2010-06-07 11:24:58 EDT
Build Identifier: eclipse-SDK-I20100603-1500-win32

When clicking the Restore Defaults button, Eclipse reads the default preferences for remote help, and loads them in.  However, when reading the value for the remote help preferred setting, when setting the correct values for the "Include remote help but give local help priority" and "Include remote help but give local help priority", the preference is not negated properly for the local help priority setting.  

searchLocalHelpFirst.setSelection(new DefaultPreferenceFileHandler().isRemoteHelpPreferred());
searchLocalHelpLast.setSelection(new DefaultPreferenceFileHandler().isRemoteHelpPreferred());

The searchLocalHelpFirst should negate the isRemoteHelpPreferred() value:

searchLocalHelpFirst.setSelection(!(new DefaultPreferenceFileHandler().isRemoteHelpPreferred()));

The bad behavior is that if remote help preferred is the default, both boxes will have that value which is incorrect.

Reproducible: Always

Steps to Reproduce:
1. Contribute to the default preferences for remote help
2. Click Restore Defaults
3. Both radios always have the same value
Comment 1 Jim Perry CLA 2010-06-07 11:27:19 EDT
Created attachment 171284 [details]
Patch with one line change for correct local help preferred value

One line fix: 

searchLocalHelpFirst.setSelection(!(new DefaultPreferenceFileHandler().isRemoteHelpPreferred()));
Comment 2 Chris Austin CLA 2010-06-07 11:32:20 EDT
Targeting 3.6.1
Comment 3 Chris Goldthorpe CLA 2010-06-22 17:13:43 EDT
Created attachment 172463 [details]
Improved patch

The previous patch was still incorrect - if the default for remoteHelpOn was false setting the defaults would always cause two of the three radio buttons to be set. This new patch works for all four possible combinations of true/false values for remoteHelpOn and remoteHelpPreferred.
Comment 4 Chris Goldthorpe CLA 2010-06-25 16:26:48 EDT
Patch applied to 3.6 maintenance stream, Fixed