YaST2 Developers Documentation: SlideShow.ycp Purpose: Slide show during package installation

SlideShow.ycp Purpose: Slide show during package installation

This module has an unstable interface.

Imports

  • FileUtils
  • Installation
  • Label
  • Language
  • Stage
  • String
  • Wizard

Global Functions

Local Functions

global SlideShow () -> void

Constructor

global StartTimer () -> void

Start the internal (global) timer.

global ResetTimer () -> void

Reset the internal (global) timer.

global StopTimer () -> void

Stop the internal (global) timer and account elapsed time.

local ShowingDetails () -> boolean

Check if currently the "Details" page is shown

Return value:
true if showing details, false otherwise
local ShowingSlide () -> boolean

Check if currently the "Slide Show" page is shown

Return value:
true if showing details, false otherwise
local ShowingRelNotes () -> boolean

Check if currently the "Release Notes" page is shown

Return value:
true if showing details, false otherwise
local ListSum (list<integer> sizes) -> integer

Sum up all list items

Parameters:
sizes
local ListSumCutOff (list<integer> sizes, integer max_cutoff) -> integer

Sum up all positive list items, but cut off individual items at a maximum value. Negative return values indicate overflow of any individual item at "max_cutoff". In this case, the real sum is the absolute value of the return value.

Parameters:
sizes
max_cutoff
local FormatTwoDigits (integer x) -> string

Format an integer number as (at least) two digits; use leading zeroes if necessary.

Parameters:
x
Return value:
number as two-digit string
local FormatTime (integer seconds) -> string

Format an integer seconds value with min:sec or hours:min:sec

Parameters:
seconds
local FormatTimeShowOverflow (integer seconds) -> string

Format an integer seconds value with min:sec or hours:min:sec

Parameters:
seconds
local FormatRemainingSize (integer remaining) -> string

Format number of remaining bytes to be installed as string.

Parameters:
remaining bytes remaining, -1 for 'done'
Return value:
human readable remaining time or byte / kB/ MB size
local FormatRemainingCount (integer remaining) -> string

Format number of remaining packages to be installed as string.

Parameters:
remaining bytes remaining, -1 for 'done'
Return value:
human readable remaining time or byte / kB/ MB size
local FlattenNoZeroes (list< list<integer> > sizesPerSourceList) -> list<integer>

Normalize a CD size list like [ [ 111, 0, 333 ], [ 211, 222, 0 ] ] to a flat single list that doesn't contain any 0 items (but -1 if there are any) If the resulting list would be completely empty, use a simple fallback: [ 1 ]

Parameters:
sizesPerSourceList
local GetSlideList (string lang) -> list<string>

Get a list of available slides (images) for the slide show.

Parameters:
lang
Return value:
slides
local HaveSlideSupport () -> boolean

Check if showing slides is supported.

local HaveSlides () -> boolean

Check if slides are available.

local HaveSlideWidget () -> boolean

Check if the dialog is currently set up so the user could switch to the slide page.

global CheckForSlides () -> void

Check if the slide show is available. This must be called before trying to access any slides; some late initialization is done here.

local SetSlideText (string text) -> void

Set the slide show text.

Parameters:
text
local LoadSlideFile (string text_file_name) -> boolean

Load one slide from files complete with image and textual description.

Parameters:
text_file_name file name + path of the text file (rich text / HTML)
Return value:
true if OK, false if error
global StripReleaseNo (string pkg_name) -> string

Get version info for a package (without build no.)

Parameters:
pkg_name name of the package without path and ".rpm" extension
Return value:
version string
global StripPath (string pkg_name) -> string

Get package file name from path

Parameters:
pkg_name location of the package
Return value:
package file name
global SetMediaType (string new_media_type) -> void

set media type "CD" or "DVD"

Parameters:
new_media_type
global SetSlideDir (string dir) -> void

Set the slide show directory

Parameters:
dir
local SanityCheck (boolean silent) -> boolean

Perform sanity check for correct initialzation etc.

Parameters:
silent don't complain in log file
Return value:
true if OK, false if any error
global SlideProvideStart (string pkg_name, integer sz, boolean remote) -> void

Package providal start

Parameters:
pkg_name
sz
remote
global SetLanguage (string new_language) -> void

Set the curent language. Must be called once during initialization.

Parameters:
new_language
global AppendMessageToInstLog (string msg) -> void

Append message to the installation log

Parameters:
msg
local SubtractPackageSize (integer pkg_size) -> void

Update internal bookkeeping: subtract size of one package from the global list of remaining sizes per CD

Parameters:
pkg_size
local CdProgressId (integer src_no, integer cd_no) -> string

Return a CD's progress bar ID

Parameters:
src_no number of the repository (from 0 on)
cd_no number of the CD within that repository (from 0 on)
local RecalcRemainingTimes (boolean force_recalc) -> boolean

Recalculate remaining times per CD based on package sizes remaining and data rate so far. Recalculation is only done each 'recalc_interval' seconds unless 'force_recalc' is set to 'true'.

Parameters:
force_recalc force recalculation even if timeout not reached yet
Return value:
true if recalculated, false if not
local TableItem (string id, string col1, string col2, string col3, string col4) -> term

Create one single item for the CD statistics table

Parameters:
id
col1
col2
col3
col4
local CdStatisticsTableItems () -> list<term>

Returns a table widget item list for CD statistics

global UpdateCurrentPackageProgress (integer pkg_percent) -> void

Progress display update This is called via the packager's progress callbacks.

Parameters:
pkg_percent package percentage
global UpdateAllCdProgress (boolean silent_check) -> void

Update progress widgets for all CDs. Uses global statistics variables.

Parameters:
silent_check
global UpdateCurrentCdProgress (boolean silent_check) -> void

Update progress widgets for the current CD: Label and ProgressBar. Use global statistics variables for that.

Parameters:
silent_check
local UpdateTotalProgress (boolean silent_check) -> void

Update progress widgets

Parameters:
silent_check
local SwitchToSecondsIfNecessary () -> boolean

Switch unit to seconds if necessary and recalc everything accordingly.

Return value:
true if just switched from sizes to seconds, false otherwise
local LoadSlide (integer slide_no) -> void

Load a slide image + text.

Parameters:
slide_no number of slide to load
local ChangeSlideIfNecessary () -> void

Check if the current slide needs to be changed and do that if necessary.

global SlideDisplayStart (string pkg_name, string pkg_summary, integer pkg_size, boolean deleting) -> void

package start display update - this is called at the beginning of a new package

Parameters:
pkg_name package name
pkg_summary package summary (short description)
pkg_size
deleting Flag: deleting (true) or installing (false) package?
global SlideDisplayDone (string pkg_name, integer pkg_size, boolean deleting) -> void

package start display update - this is called at the end of a new package

Parameters:
pkg_name package name
pkg_size
deleting Flag: deleting (true) or installing (false) package?
local AddProgressWidgets (symbol page_id, term page_contents) -> term

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
local SlidePageWidgets () -> term

Construct widgets describing a page with the real slide show (the RichText / HTML page)

Return value:
A term describing the widgets
local DetailsPageWidgets () -> term

Construct widgets for the "details" page

Return value:
A term describing the widgets
global SwitchToSlideView () -> void

Switch from the 'details' view to the 'slide show' view.

global SwitchToDetailsView (boolean silent_check) -> void

Switch from the 'slide show' view to the 'details' view.

Parameters:
silent_check
global SwitchToReleaseNotesView () -> void

Switch to the 'release notes' view.

local OpenSlideShowBaseDialog () -> void

Open the slide show base dialog with empty work area (placeholder for the image) and CD statistics.

global InitPkgData (boolean force) -> void

Initialize internal pacakge data, such as remaining package sizes and times. This may not be called before the pkginfo server is up and running, so this cannot be reliably done from the constructor in all cases.

Parameters:
force true to force reinitialization
local FindNextMedia () -> void

Try to figure out what media will be needed next and set next_src_no and next_cd_no accordingly.

global SetCurrentCdNo (integer src_no, integer cd_no) -> void

Set the current repository and CD number. Must be called for each CD change. src_no: 1...n cd_no: 1...n

Parameters:
src_no
cd_no
global HandleInput (any button) -> void

Process (slide show) input (button press).

Parameters:
button
global OpenSlideShowDialog () -> void

Open the slide show dialog.

global CloseSlideShowDialog () -> void

Close the slide show dialog.