Details
-
Suggestion
-
Resolution: Won't Do
-
P3: Somewhat important
-
None
-
3.2.0
Description
I want to have dynamic pages after the component selection, which should only appear, depending on the just selected components.
The only way I know, of how to achieve this, is by adding and removing the pages as needed, when leaving the component selection page.
The following code snippet serves as a basic example, of how I am trying to implement it:
function Component() { gui.pageById(QInstaller.ComponentSelection).left.connect(updateVisiblePages); } var pageVisible = false; function updateVisiblePages() { var pageVisibleNow = component.installationRequested(); if (pageVisibleNow === pageVisible) return; if (pageVisibleNow) installer.addWizardPage(component, "MyPage", QInstaller.LicenseCheck); else installer.removeWizardPage(component, "MyPage"); pageVisible = pageVisibleNow; }
The actual behavior is as follows:
Assuming that the dynamic page does not initially exist, but gets added upon clicking next on the component selection page, it will simply skip the created page, landing on the license check page. Going back now, will go right back to the component selection page, effectively skipping the dynamic page again. From here on it works as expected, as the page exists already, before the callback gets triggered.
I had a different configuration too, which would effectively stay on the component selection page once, but work the second time.
As a workaround, I am currently using the license check page as a sort of buffer page, and add the dynamic pages after that instead. This seems to be a sufficient in my situation for now, but it makes me wonder, if I am overseeing something fundamental and going about it the wrong way.
This also raised another question, which might be its own ticket, but it is somewhat related:
If I have multiple pages, I cannot just remove and add pages, as this would mess up the ordering as you can only add pages relative to the fixed ones. Do you really have to remove all pages first and add the ones you actually want to display, to get a consistent ordering? This actually has a notable lag-spike when pressing the next button, even for just a few pages.