YaST2 Developers Documentation: Unknown YCP Module

Unknown YCP Module

This module has an unstable interface.

Imports

  • Desktop
  • Directory
  • Label
  • Popup
  • SuSERelease

Global Functions

Local Variables

Local Functions

Info:

File: Wizard.ycp Package: yast2 Author: Stefan Hundhammer

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 CancelOKButtonBox () -> term

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

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 GenericTreeDialog (term button_box) -> term

Create a Generic Tree Dialog

Returns a term describing a wizard dialog with left menu tree, right contents and 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 OKDialog () -> term

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

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 OpenOKDialog () -> void

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

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 TimeoutUserInput (integer timeout_millisec) -> any

Substitute for UI::TimeoutUserInput

Analogical to Wizard::UserInput.

Parameters:
timeout_millisec
global WaitForEvent () -> map

Substitute for UI::WaitForEvent

global TimeoutWaitForEvent (integer timeout_millisec) -> map

Substitute for UI::WaitForEvent with timeout

Parameters:
timeout_millisec
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 ReplaceHelp (term contents) -> void

This function is deprecated.

Replace the wizard help subwindow with a custom widget.

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

Restore the wizard help subwindow.

Parameters:
help_text Help text
global CreateDialog () -> void

Create and open a typical installation wizard dialog.

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

Set the contents of a wizard dialog and define if to move focus to next button

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?
set_focus Should the focus be set to Next button?
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 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 OpenCancelOKDialog () -> void

Overview Dialog http://en.opensuse.org/YaST/Style_Guide#Single_Configuration.2FOverview.2FEdit_Dialog dialog with Cancel and OK buttons (cancel has function as abort)

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 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 SetDialogTitle (string titleText) -> void

Sets the dialog title shown in the window manager's title bar.

Parameters:
titleText title of the dialog
Example

	SetDialogTitle ("DNS Server Configuration");
global SetTitleIcon (string icon_name) -> void

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

Parameters:
icon_name name (without path) of the new icon
Example

	SetTitleIcon ("yast-dns-server");
See
ClearTitleIcon
global ClearTitleIcon () -> void

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

See
SetTitleIcon
global SetDesktopTitle (string file) -> boolean

Sets the window title according to the name specified in a .desktop file got as parameter. Desktop file is placed in a special directory (/usr/share/applications/YaST2). Parameter file is realative to that directory without ".desktop" suffix.

Parameters:
file desktop file
Return value:
true on success
Example

	// Opens /usr/share/applications/YaST2/lan.desktop
	// Reads (localized) "name" entry from there
	// Sets the window title.
	SetDesktopTitle ("lan")
global SetDesktopIcon (string file) -> boolean

Sets the icon specified in a .desktop file got as parameter. Desktop file is placed in a special directory (/usr/share/applications/YaST2). Parameter file is realative to that directory without ".desktop" suffix. Warning: There are no desktop files in inst-sys. Use "SetTitleIcon" instead.

Parameters:
file Icon name
Return value:
true on success
Example

	// Opens /usr/share/applications/YaST2/lan.desktop
	// Reads "Icon" entry from there
	// Sets the icon.
	SetDesktopIcon ("lan")
global SetDesktopTitleAndIcon (string file) -> boolean

Convenience function to avoid 2 calls if application needs to set both dialog title and icon from desktop file specified as parameter. Desktop file is placed in a special directory (/usr/share/applications/YaST2). Parameter file is realative to that directory without ".desktop" suffix. Warning: There are no desktop files in inst-sys.

Parameters:
file desktop file name
Return value:
true on success
Example

	// Opens /usr/share/applications/YaST2/lan.desktop
	// Reads "Icon" and "Name" entries from there
	// Sets the icon, sets the dialog title
	SetDialogTitleAndIcon ("lan")
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
local HasWidgetWizard () -> boolean

Returns whether the `Wizard widget is available.

Return value:
available
See
bnc #367213.
global ShowReleaseNotesButton (string label, string 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 name) -> void

Set a name for the current dialog:

Parameters:
name
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