YaST2 Developers Documentation: yast2

yast2

Wizard.ycp
Wizard dialog

This module has an unstable interface.

Provides the wizard dialog (common screen for all YaST2 installation modules) and functions to set the contents, to replace and restore special widgets.

Imports

  • Directory
  • Label
  • Popup
  • SuSERelease

Global Functions

Local Variables

Local Functions

global BackAbortNextButtonBox () -> term

Returns a button box with buttons "Back", "Abort", "Next"

Return value:
a widget tree
global BackAbortInstallationNextButtonBox () -> term

Returns a button box with buttons "Back", "Abort Installation", "Next"

Return value:
a widget tree
global BackNextButtonBox () -> term

Returns a button box with buttons "Back", "Next"

Return value:
a widget tree
global CancelAcceptButtonBox () -> term

Returns a button box with buttons "Cancel", "Accept"

Return value:
a widget tree
global AbortAcceptButtonBox () -> term

Returns a button box with buttons "Abort", "Accept"

Return value:
a widget tree
global AbortInstallationAcceptButtonBox () -> term

Returns a button box with buttons "Abort Installation", "Accept"

Return value:
a widget tree
global AbortApplyFinishButtonBox () -> term

Returns a button box with buttons "Abort", "Apply", "Finish"

Return value:
a widget tree
global GenericDialog (term button_box) -> term

Create a Generic Dialog

Returns a term describing a generic wizard dialog with a configurable button box.

Parameters:
button_box term that contains a `HBox() with buttons in it
Return value:
term describing the dialog.
global IsWizardDialog () -> boolean

Check if the topmost dialog is a wizard dialog (i.e. has a widget with `id(`WizardDialog) )

Return value:
True if topmost dialog is a wizard dialog, false otherwise
global ShowHelp (string help_text) -> void

Open a popup dialog that displays a help text (rich text format).

Parameters:
help_text the text to display
global NextBackDialog () -> term

Returns a standard wizard dialog with buttons "Next", "Back", "Abort".

Return value:
describing the dialog.
global AcceptDialog () -> term

Returns a standard wizard dialog with buttons "Cancel", "Accept"

Return value:
describing the dialog.
global OpenDialog (term dialog) -> void

Open any wizard dialog.

Parameters:
dialog a wizard dialog, e.g. Wizard::GenericDialog()
global OpenNextBackDialog () -> void

Open a dialog with buttons "Next", "Back", "Abort" and set the keyboard focus to "Next".

global OpenAcceptDialog () -> void

Open a dialog with "Accept", "Cancel" and set the keyboard focus to "Accept".

global OpenAbortApplyFinishDialog () -> void

Open a dialog with "Accept", "Cancel" and set the keyboard focus to "Accept".

global OpenAcceptStepsDialog () -> void

Open a dialog with "Accept", "Cancel" that will also accept workflow steps.

global OpenAcceptAbortStepsDialog () -> void

Open a dialog with "Accept", "Cancel" that will also accept workflow steps.

global OpenNextBackStepsDialog () -> void

Open a dialog with "Back", "Next", "Abort" that will also accept workflow steps.

global OpenCustomDialog (term help_space_contents, term button_box) -> void

Open a wizard dialog with simple layout

no graphics, no steps, only a help widget buttons (by default "Back", "Abort", "Next").

This is the only type of wizard dialog which still allows replacing the help space - either already upon opening it or later with Wizard::ReplaceCustomHelp().

If help_space_contents is 'nil', the normal help widget will remain. If button_box is 'nil', Wizard::BackAbortNextButtonBox() is used.

Parameters:
help_space_contents Help space contents
button_box Buttom Box
See
CloseDialog
global ReplaceCustomHelp (term contents) -> void

Replace the help widget for dialogs opened with Wizard::OpenCustomDialog().

Parameters:
contents Replace custom help with supplied contents
global CloseDialog () -> void

Close a wizard dialog.

global UserInput () -> any

Substitute for UI::UserInput

This function transparently handles different variations of the wizard layout. Returns `next if `next or `accept were clicked, `back if `back or `cancel were clicked. Simply replace ret = UI::UserInput() with ret = Wizard::UserInput()

Return value:
(maybe normalized) widget ID
global CreateDialog () -> void

Create and open a typical installation wizard dialog.

global SetContents (string title, term contents, string help_text, boolean has_back, boolean has_next) -> void

Set the contents of a wizard dialog

How the general framework for the installation wizard should look like. This function creates and shows a dialog.

Parameters:
title Dialog Title
contents The Dialog contents
help_text Help text
has_back Is the Back button enabled?
has_next Is the Next button enabled?
global ClearContents () -> void

Clear the wizard contents.

This may sound silly, but it gives much faster feedback to the user if used properly: Whenever the user clicks "Next" or "Back", call ClearContents() prior to any lengthy operation -> the user notices instant response, even though he may in fact still have to wait.

global SetContentsButtons (string title, term contents, string help_text, string back_label, string next_label) -> void

Set contents and Buttons of wizard dialog

Additionally set its title, help_text and buttons labels. Enables both back and next button.

Parameters:
title title of window
contents contents of dialog
help_text help text
back_label label of back button
next_label label of next button
global ReplaceHelp (term contents) -> void

This function is deprecated.

Replace the wizard help subwindow with a custom widget.

Parameters:
contents Replace Help with contents
global SetHelpText (string help_text) -> void

Set a new help text.

Parameters:
help_text Help text
Example
 Wizard::SetHelpText("This is a help Text");
global RestoreHelp (string help_text) -> void

Restore the wizard help subwindow.

Parameters:
help_text Help text
global SetNextButton (any id, string label) -> void

Set the dialog's "Next" button with a new label and a new ID

Parameters:
id Button ID
label Button Label
global SetBackButton (any id, string label) -> void

Set the dialog's "Back" button with a new label and a new ID

Parameters:
id Button ID
label Button Label
global SetAbortButton (any id, string label) -> void

Set the dialog's "Abort" button with a new label and a new ID

Parameters:
id Button ID
label Button Label
global HideNextButton () -> void

Hide the Wizard's "Next" button. Restore it later with RestoreNextButton():

See
RestoreNextButton
global HideBackButton () -> void

Hide the Wizard's "Back" button. Restore it later with RestoreBackButton():

See
RestoreBackButton
global HideAbortButton () -> void

Hide the Wizard's "Abort" button. Restore it later with RestoreAbortButton():

See
RestoreAbortButton
global RestoreBackButton () -> void

Restore the wizard 'back' button.

See
HideBackButton
global RestoreNextButton () -> void

Restore the wizard 'next' button.

See
HideNextButton
global RestoreAbortButton () -> void

Restore the wizard 'abort' button.

See
HideAbortButton
global ReplaceNextButton (term contents) -> void

This function is deprecated.

Replace the wizard 'next' button with a custom widget. THIS FUNCTION IS DEPRECATED!

Parameters:
contents a term describing the new contents
See
SetNextButton
global ReplaceBackButton (term contents) -> void

This function is deprecated.

Replace the wizard 'back' button with a custom widget. THIS FUNCTION IS DEPRECATED!

Parameters:
contents a term describing the new contents
See
SetBackButton
global ReplaceAbortButton (term contents) -> void

This function is deprecated.

Replace the wizard 'abort' button with a custom widget. THIS FUNCTION IS DEPRECATED!

Parameters:
contents a term describing the new contents
See
SetAbortButton
global SetTitleIcon (string icon_name) -> void

Set the wizard 'title' icon

Set the wizard 'title' icon to the specified icon from the standard icon directory.

Parameters:
icon_name name (without path) of the new icon
See
ClearTitleIcon
global ClearTitleIcon () -> void

Clear the wizard 'title' icon, i.e. replace it with nothing

See
SetTitleIcon
global SetDesktopIcon (string file) -> boolean

Set Desktop Icon

Parameters:
file Icon name
Return value:
true on success
local ReplaceButtonBox (term button_box) -> void

PRIVATE - Replace the entire Wizard button box with a new one.

Parameters:
button_box Button Box term
global EnableAbortButton () -> void

Enable the wizard's "Abort" button.

See
DisableAbortButton
global DisableAbortButton () -> void

Disable the wizard's "Abort" button.

See
EnableAbortButton
global DisableNextButton () -> void

Disable the wizard's "Next" (or "Accept") button.

See
EnableNextButton
global EnableNextButton () -> void

Enable the wizard's "Next" (or "Accept") button.

See
DisableNextButton
global DisableBackButton () -> void

Disable the wizard's "Back" button.

See
EnableBackButton
global EnableBackButton () -> void

Enable the wizard's "Back" button.

See
DisableBackButton
global DisableCancelButton () -> void

Disable the wizard's "Cancel" button.

See
EnableCancelButton
global EnableCancelButton () -> void

Enable the wizard's "Cancel" button.

See
DisableCancelButton
global ShowReleaseNotesButton (string label, any id) -> void

Show a "Release Notes" button with the specified label and ID if there is a "steps" panel

Parameters:
label
id
global HideReleaseNotesButton () -> void

Hide the "Release Notes" button, if there is any

global RetranslateButtons () -> void

Retranslate the wizard buttons.

global SetFocusToNextButton () -> void

Set the keyboard focus to the wizard's "Next" (or "Accept") button.

global SetFocusToBackButton () -> void

Set the keyboard focus to the wizard's "Back" (or "Cancel") button.

local screenshot_name -> string

Currently used screenshot name. Initially, it must match the UI default, "yast2"

local screenshot_name_stack -> list<string>

Screenshot names overriden by nested SetScreenShotName calls

global SetScreenShotName (string s) -> void

Declare a name for the current dialog

Parameters:
s eg. "mail-1-conntype"
See
RestoreScreenShotName
global RestoreScreenShotName () -> void

Restore the screenshot name.

global OpenTreeNextBackDialog () -> void

Open a Tree dialog with buttons "Next", "Back", "Abort" and set the keyboard focus to "Next".

global CreateTreeDialog () -> void

Create and open a Tree wizard dialog.

global AddTreeItem (list<map> Tree, string parent, string title, string id) -> list<map>

Add Tree Item to tree enabled Wizard

Parameters:
Tree Tree Data
parent Parent of this item
title Item Title
id Item ID
Return value:
Updated Tree Data
local CreateTreeInternal (list<map> Tree, string parent) -> list

Create the Tree Items

Parameters:
Tree Tree data
parent Parent of current Item
Return value:
Tree Items
global QueryTreeItem () -> string

Query Tree Item

Return value:
Tree Item
global CreateTree (list<map> Tree, string title) -> void

Create the tree in the dialog, replaces helpspace with new tree widget

Parameters:
Tree Tree data
title Tree title
global SelectTreeItem (string tree_item) -> void

Select Tree item

Parameters:
tree_item tree item
global DeleteTreeItems () -> void

Delete Tree items

global DeleteMenus () -> void

Delete Menu items

global AddMenu (list<map> Menu, string title, string id) -> list<map>

Add Menu

Parameters:
Menu Menu data
title Menu Title
id Menu ID
Return value:
Updated Menu Data
global AddSubMenu (list<map> Menu, string parent_id, string title, string id) -> list<map>

Add Sub Menu

Parameters:
Menu Menu data
parent_id Menu Parent
title Menu Title
id Menu ID
Return value:
Updated Menu Data
global AddMenuEntry (list<map> Menu, string parent_id, string title, string id) -> list<map>

Add Menu Entry

Parameters:
Menu Menu data
parent_id Menu Parent
title Menu Title
id Menu ID
Return value:
Updated Menu Data
local CreateMenuInternal (list<map> Menu, string parent) -> list

Create the Menu Items

Parameters:
Menu Menu data
parent Menu Parent
Return value:
Menu Items
global CreateMenu (list<map> Menu) -> void

Create the menu in the dialog

Parameters:
Menu Menu data
global SetProductName (string name) -> void

Set the product name for UI

Parameters:
name the product name