[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [p2-dev] WizardWithLicenses enables finish before accepting license

Title: Re: [p2-dev] WizardWithLicenses enables finish before accepting license
Hi Susan,

My use of p2 is very limited to IUs with only native touchpoints and it would be difficult for me to setup a test case to use the standard p2 UIs since our IUs are not recognized by them. In any case, I don’t think we’re calling the PreselectedIUInstallWizard in any way that is causing this problem. In fact, the problem seems like it’s in there lurking even if not visible in all types of WizardWithLicenses given when the license page is added (i.e., as a side effect of getNextPage()).

I was able to fix it by just adding an asyncExec calling getContainer().updateButtons() just after the license page is added. It seems that adding a wizard page that can potentially change the enablement of the finish button as a side effect of Wizard.getNextPage() which can be called during the enablement of buttons seems like a very brittle coding pattern and bound to cause problems in the long run. The reason that adding the asyncExec call to update the buttons again fixes it is that it causes the enablement to be reevaluated after the current operation during which it’s too late to get the state correct. Since the page is only added once, it is guaranteed not to cause an endless loop. It’s not the best solution but is in the same spirit as adding a page as a side effect of returning state information. ;)


On 5/14/09 9:39 AM, "ext Susan Franklin McCourt" <susan_franklin@xxxxxxxxxx> wrote:

can you reproduce the behavior in the SDK UI or in the admin agent?  If yes, then please open a bug with specific steps (ie, a site to connect to, what to install, etc.).  

Note that PreselectedIUInstallWizard is only used in the SDK as the error page of the install wizard, so it's possible that we don't have the same scenario you do in the SDK.  

The admin agent uses PreselectedIUInstallWizard when you select items in the metadata repository viewer and choose install.  Since this code is not exercised as much, it's possible that there's something missing in PreselectedIUInstallWizard.

If you can't reproduce in either the SDK or agent, then you could still open a bug including a code snippet that shows how you are launching the wizard...

susan

<David.Dubrow@xxxxxxxxx>






To: <p2-dev@xxxxxxxxxxx>
cc:
Subject: [p2-dev] WizardWithLicenses enables finish before accepting license

I couldn’t find an existing bugzilla addressing this but wanted to check here first.

I am currently calling PreselectedIUInstallWizard and I don’t know whether this is an issue with the other wizards as well but it may be. In any case, the problem is that due to the ordering of calls between when the license page is added by WizardWithLicenses.getNextPage() and when canFInish() is called causes the finish button to be enabled prior to the user accepting licenses even though a license is provided by selected IUs. Of course, this allows users to install Ius without accepting the license. If next is pressed rather than finish, then the finish button is correctly disabled until the user accepts the license.

If you want me to log this bugzilla, please let me know.

TIA,

--David Dubrow
david.dubrow@xxxxxxxxx
<david.dubrow@xxxxxxxxx>

_______________________________________________
p2-dev mailing list
p2-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/p2-dev