Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 316011 - [Help] Restore defaults button does not read remoteHelpPreferred preference correctly. - Fix in Eclipse 3.6.1
Summary: [Help] Restore defaults button does not read remoteHelpPreferred preference c...
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: User Assistance (show other bugs)
Version: 4.0   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: 3.6.1   Edit
Assignee: Chris Goldthorpe CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-06-07 11:24 EDT by Jim Perry CLA
Modified: 2010-06-25 16:26 EDT (History)
2 users (show)

See Also:


Attachments
Patch with one line change for correct local help preferred value (1.18 KB, patch)
2010-06-07 11:27 EDT, Jim Perry CLA
no flags Details | Diff
Improved patch (1.56 KB, patch)
2010-06-22 17:13 EDT, Chris Goldthorpe CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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