-
Notifications
You must be signed in to change notification settings - Fork 3
Adding progress banners
###Overview
The last major user-interface elements that we need to add are our progress banners. These banners help users track the progress of the engine as it configures their computers. Again, these banners are relatively simple. Here, though, they differ from the banners that we have created for our earlier tutorials in that they do not require user interaction.
Setup
This tutorial assumes that you have completed the tutorial, Adding a finish banner, and have a version of the engine that will start and attempt to contact your web-server.
A note on examples
Our xml files are starting to get too long to include their full text inline in these tutorials. When you see this symbol in the text, you can click on it to view the xml in question.
Adding our two progress dialogs
- Add the following to the
Banners
block of your banners.xml file:
<SimpleBanner name="ConfirmSettingsProgressBanner" height="550" width="500">
<Content>
<SimpleParagraph margin="20,36,20,36" fontSize="24" alignment="Center">
<Content>
<DirectTextContent>Verifying Security</DirectTextContent>
</Content>
</SimpleParagraph>
<DefaultCheckedParagraph controlKey="Setting system restore point" fontSize="18" margin="20,0,20,0" enabled="false">
<Content>
<DirectTextContent>Setting system restore point</DirectTextContent>
</Content>
</DefaultCheckedParagraph>
<DefaultCheckedParagraph controlKey="Confirming administrator account" fontSize="18" margin="20,4,20,0" enabled="false">
<Content>
<DirectTextContent>Confirming administrator credentials</DirectTextContent>
</Content>
</DefaultCheckedParagraph>
<DefaultCheckedParagraph controlKey="Scanning computer for malware" fontSize="18" margin="20,4,20,0" enabled="false">
<Content>
<DirectTextContent>Verifying system integrity</DirectTextContent>
</Content>
</DefaultCheckedParagraph>
<DefaultCheckedParagraph controlKey="Verifying windows security center" fontSize="18" margin="20,4,20,0" enabled="false">
<Content>
<DirectTextContent>Checking Windows Security Center</DirectTextContent>
</Content>
</DefaultCheckedParagraph>
<DefaultCheckedParagraph controlKey="Verifying anti-virus software" fontSize="18" margin="20,4,20,0" enabled="false">
<Content>
<DirectTextContent>Checking anti-virus software</DirectTextContent>
</Content>
</DefaultCheckedParagraph>
<DefaultCheckedParagraph controlKey="Verifying anti-spyware software" fontSize="18" margin="20,4,20,0" enabled="false">
<Content>
<DirectTextContent>Checking anti-spyware software</DirectTextContent>
</Content>
</DefaultCheckedParagraph>
</Content>
<Buttons>
<DisabledButton>
<Target>BackButton</Target>
<Text>Back</Text>
</DisabledButton>
<DisabledButton>
<Target>NextButton</Target>
<Text>Next</Text>
</DisabledButton>
<UrlButton>
<Target>HelpButton</Target>
<Text>Help</Text>
<Value>http://certdev0.incommontest.org/</Value>
</UrlButton>
</Buttons>
</SimpleBanner>
This is the first of our progress banners. As you can see, there's not much to it. It has a title ("Verifying Security") and a series of check boxes, each representing, roughly, a major step in the engine's configuration process.
Also note that the banner's next and back buttons are explicitly disabled here. This is because this banner does not need to wait for user input. Instead, the engine will modify its contents as it proceeds through its configuration tasks.
-
Add this
SimpleBanner
to theBanners
block of your banners.xml file as well:
-
Add the following xml block to the
main
role-branch in yourtasklist.xml
file just between the task blocks that we added in the last tutorial to show the ready-to-begin and finish dialogs:<UserInterface.ChangeBanner minimumTaskTime="1"> <Properties> <Dialog>Main dialog</Dialog> <Banner>ConfirmSettingsProgressBanner</Banner> </Properties> </UserInterface.ChangeBanner> <UserInterface.ChangeBanner minimumTaskTime="1"> <Properties> <Dialog>Main dialog</Dialog> <Banner>ConfigureProgressBanner</Banner> </Properties>
</UserInterface.ChangeBanner>
These two task blocks will change the content of our main dialog to each of our progress banners. To do this, we're using the `UserInterface.ChangeBanner` task instead of `UserInterface.ShowBorderedBannerModal`.
`UserInterface.ShowBorderedBannerModal` waits for the user to interact with the banner in question before returning a result and continuing to the next task in the list. `UserInterface.ChangeBanner` updates the dialog in question and continues to the next task in the list immediately. This is the behavior that we want for our two progress dialogs, as we will be updating them programatically as the engine proceeds through its list of configuration tasks.
1. Upload tasklist.xml [![external link](images/el.gif)](examples/1003_tasklist.xml) and banners.xml [![external link](images/el.gif)](examples/1003_banners.xml) to your server and run the engine. After clicking 'start' on the ready-to-begin dialog, you should see, briefly, our two new progress banners:
![verifying security progress dialog](images/verifyingsecurity0.png)
![configuring computer progress dialog](images/configuringcomputer0.png)
All of the entries on both progress dialogs are currently disabled, but we will be enabling them in future tutorials as we implement the various configuration tasks!
**Conclusion**
In this quick tutorial, we implemented two [non-modal](http://en.wikipedia.org/wiki/Dialog_box#Modeless) progress banners. This is the last of our big, user-interface tutorials. From here on out, we'll concentrate on tasks to configure users' computers.