YaST2 Developers Documentation: Progress

Progress

modules/Progress.ycp
Progress bar

This module has an unstable interface.

Functions for progress bar.
 Dialog Title

 [x] Stage 1
 [x] Stage 2
  => Stage 3
  -  Stage 4
  -  Stage 5

 Progress Title
 [============================90%=======================------]

 
Example of progress bar usage (don't forget the translation marks in your code): Progress bar supposes main wizard dialog is created.
 Progress::Simple ("Some progress bar", "Progress runs here...", 3, "");
 Progress::NextStep (); // the 1st one does nothing!
 Progress::NextStep ();
 Progress::NextStep ();
 Progress::NextStep ();
Another example:
 Progress::New ("Complex progress bar", " ", 100, [
      "Stage1", "Stage2", "Stage3",
      ], [
      "Stage 1 ...", "Stage 2 ...", "Stage 3 ...", "Finished",
      ], "Help text");
 Progress::NextStage ();
 Progress::NextStageStep (20);
 Progress::Stage (0, "I am back", 2);
 Progress::Title ("Still in stage 0");
 Progress::NextStageStep (90);
 Progress::Finish ();
See also hand made documentation. Progress.html

Imports

  • CommandLine
  • Mode
  • Wizard

Global Functions

Local Functions

global set (boolean state) -> boolean

Sets progress bar state: on = normal operation, off = All Progress:: calls return immediatelly.

Parameters:
state on or off
Return value:
previous state
global status () -> boolean

Returns currently selected visibility status of all UI-modifying Progress:: functions.

Return value:
whether the progress bar is used
See
Progress::set Progress::off Progress::on
global off () -> void

This function is deprecated. Use set instead.

Turns progress bar off. All Progress:: calls return immediatelly.

global on () -> void

This function is deprecated. Use set instead.

Turns progress bar on after calling Progress::off.

local Mark (symbol kind) -> any

Parameters:
kind `todo, `current or `done
Return value:
UI mark for stages
local MarkId (integer i) -> term

Parameters:
i stage number
Return value:
widget `id(...) for the marker
global New (string window_title, string progress_title, integer length, list<string> stg, list tits, string help_text) -> void

New complex progress bar with stages.

Parameters:
window_title title of the window
progress_title title of the progress bar. Pass at least " " (one space) if you want some progress bar title.
length number of steps. If 0, no progress bar is created, there are only stages and bottom title. THIS IS NOT NUMBER OF STAGES!
stg list of strings - stage names. If it is nil, then there are no stages.
tits Titles corresponding to stages. When stage changes, progress bar title changes to one of these titles. May be nil/empty.
help_text help text
global Simple (string window_title, string progress_title, integer length, string help_text) -> void

Create simple progress bar with no stages, only with progress bar.

Parameters:
window_title Title of the window.
progress_title Title of the progress bar.
length Number of steps.
help_text Help text.
local UpdateProgressBar () -> void

Uses current_step

local SetProgressBarTitle (string s) -> void

the bar is either `ProgressBar or `Label

Parameters:
s title
global NextStep () -> void

Some people say it is the best operating system ever. But now to the function. Advances progress bar value by 1.

global NextStage () -> void

Advance stage, advance step by 1 and set progress bar caption to that defined in New.

global Step (integer st) -> void

Changes progress bar value to st.

Parameters:
st new value
global Stage (integer st, string title, integer step) -> void

Go to stage st, change progress bar title to title and set progress bar step to step.

Parameters:
st New stage.
title New title for progress bar. If nil, title specified in New is used.
step New step or -1 if step should not change.
global NextStageStep (integer st) -> void

Jumps to the next stage and sets step to st.

Parameters:
st new progress bar value
global Title (string t) -> void

Change progress bar title.

Parameters:
t new title. Use ""(empty string) if you want an empty progress bar.
global Finish () -> void

Moves progress bar to the end and marks all stages as completed.

global OpenSuperior (string title, list<string> stages) -> void

Creates a higher-level progress bar made of stages. Currently it is placed instead of help text.

Parameters:
title title of the progress...
stages list of stage descriptions
global CloseSuperior () -> void

Replaces stages of superior progress by an empty help text.

global StepSuperior () -> void

Make one step in a superior progress bar.