Unknown YCP Module |
This module has an unstable interface. |
Module: SlideShow.ycp
Purpose: Slide show during installation
Author: Stefan Hundhammer
$Id$
Usage: This is a generic module for handling global progress bar with optional slideshow/release notes etc.
Global progress =============== The basic idea is that the progress consists of "stages" - during a new install, there are 3: disk preparation, image deployment and package installation.
Before the first client using the unified progress, the stages need to be set up, e.g. :
list< map
SlideShow::Setup( stages );
The function will calculate the partitioning of the unified progress based on estimate of a needed time. A stage can provide the estimate of time or an amount of data to be transferred (the constants used are based on assumption of 15 min install time and that the data are downloaded and written to disk). The logic is no rocket science as the only goal for a progress bar is to have it move somewhat regularly. Also, the function resets timers and other progress status information, including which parts are shown. See \ref SlideShow::Reset.
A client using the new unified progress will do basically 2 things:
1) calls SlideShow::MoveToStage( stage-id ) - this will move the global progress to a proper position for start of the stage and updates also the label ("description" entry in the map)
2) calls regularly SlideShow::StageProgress( new_percent, new_label ) - new_percent is the progress inside of the current stage, the library will recompute this to get a global progress percents. - if new_label is nil, label is not updated.
SlideShow dialogs
=================
// SlideShow language must be set before opening the dialog
SlideShow::SetLanguage( Language::language );
SlideShow::OpenDialog ();
...
Set the flag that user requested abort of the installation
- Parameters:
-
abort new state of the abort requested flag (true = abort requested)
Get the status of the flag that user requested abort of the installation
- Return value:
-
state of the abort requested flag (true = abort requested)
Start the internal (global) timer.
Reset the internal (global) timer.
Stop the internal (global) timer and account elapsed time.
Check if currently the "Details" page is shown
- Return value:
-
true if showing details, false otherwise
Check if currently the "Slide Show" page is shown
- Return value:
-
true if showing details, false otherwise
Check if currently the "Release Notes" page is shown
- Return value:
-
true if showing details, false otherwise
Restart the subprogress of the slideshow. This means the label will be set to \param text, value to 0.
- Parameters:
-
text new label for the subprogress
Update status of subprogress of the slideshow. The new value will be set to \param value, if the \text is not nil, the label will be updated to this text as well. Otherwise label will not change.
- Parameters:
-
value new value for the subprogress text new label for the subprogress
Restart the global progress of the slideshow. This means the label will be set to \param text, value to 0.
- Parameters:
-
text new label for the global progress
Update status of global progress of the slideshow. The new value will be set to \param value, if the \text is not nil, the label will be updated to this text as well. Otherwise label will not change.
- Parameters:
-
value new value for the global progress new_text
Return the description for the current stage.
- Return value:
-
localized string description
Move the global progress to the beginning of the given stage.
- Parameters:
-
stage_name id of the stage to move to
Update the global progress according to the progress in the current stage. The new value will be set to the per cent of the current stage according to \param value.The value must be lower that 100 (or it's corrected to 100). If the \text is not nil, the label will be updated to this text as well. Otherwise label will not change.
- Parameters:
-
value new value for the stage progress in per cents text new label for the global progress
Return the current global progress label.
- Parameters:
-
text
- Return value:
-
current label
Append message to the installation log.
- Parameters:
-
msg message to be added, without trailing eoln
Check if the dialog is currently set up so the user could switch to the slide page.
Check if the slide show is available. This must be called before trying to access any slides; some late initialization is done here.
Set the slide show text.
- Parameters:
-
text
Set the curent language. Must be called once during initialization.
- Parameters:
-
new_language
Create one single item for the CD statistics table
- Parameters:
-
id col1 col2 col3 col4
Load a slide image + text.
- Parameters:
-
slide_no number of slide to load
Check if the current slide needs to be changed and do that if necessary.
Add widgets for progress bar etc. around a slide show page
- Parameters:
-
page_id ID to use for this page (for checking with UI::WidgetExists() ) page_contents The inner widgets (the page contents)
- Return value:
-
A term describing the widgets
Construct widgets describing a page with the real slide show (the RichText / HTML page)
- Return value:
-
A term describing the widgets
Construct widgets for the "details" page
- Return value:
-
A term describing the widgets
Construct widgets for the "release notes" page
- Return value:
-
A term describing the widgets
Switch from the 'details' view to the 'slide show' view.
Rebuild the details page.
Switch from the 'slide show' view to the 'details' view.
Switch to the 'release notes' view.
Help text for the dialog
Rebuild the dialog. Useful if slides become available post-creating the dialog.
Open the slide show base dialog with empty work area (placeholder for the image) and CD statistics.
Initialize generic data to default values
Process (slide show) input (button press).
- Parameters:
-
button
Check for user button presses and handle them. Generic handling to be used in the progress handlers.
Open the slide show dialog.
Close the slide show dialog.
Prepare the stages for the global progressbar. Will compute the total estimate of time and partition the global 100% to given stages based on their estimates. Can compute out of time and size to download.
- Parameters:
-
stages
Returns the current setup defined by Setup().
Structure $[ stage_name : $[ stage_setup ], ... ]
- Return value:
-
stages
- See
-
Setup()