Common widget manipulation |
modules/CWM.ycp |
Routines for common widget manipulation | |
|
|
This module has an unstable interface. |
Widget that is being currently processed
All widgets of the current dialog, in the correct order
stack of settings of nested calls of CWM
Push the settings of the currently run dialog to the stack
Pop the settings of the currently run dialog from the stack
UI containers, layout helpers that contain other widgets. Used by functions that recurse through "contents" to decide whether to go deeper.
Process term with the dialog, replace strings in the term with appropriate widgets
- Parameters:
-
t term dialog containing strings widgets map of widget name -> widget description map
- Return value:
-
updated term ready to be used as a dialog
Process term with the dialog, return all strings. To be used as an argument for widget_names until they are obsoleted.
- Parameters:
-
t term dialog containing strings
- Return value:
-
strings found in the term
Validate the value against the basic type
- Parameters:
-
value any a value to validate type string type information
- Return value:
-
true on success or if do not know how to validate
Validate type of entry of the widget/option description map Also checks option description maps if present
- Parameters:
-
key string key of the map entry value any value of the map entry widget any name of the widget/option
- Return value:
-
true if validation succeeded
Validate value of entry of the widget/option description map Also checks option description maps if present
- Parameters:
-
key string key of the map entry value any value of the map entry widget any name of the widget/option
- Return value:
-
true if validation succeeded
Add fallback functions to a widget global only because of testsuites
- Parameters:
-
widgets a list of widget desctiption maps functions map of functions
- Return value:
-
a list of modified widget description maps
Set widgets according to internally stored settings global only because of testsuites
- Parameters:
-
widgets list of maps representing widgets
Handle change of widget after event generated global only because of testsuites
- Parameters:
-
widgets list of maps represenging widgets event_descr map event that occured
- Return value:
-
modified action (sometimes may be needed) or nil
Save changes of widget after event generated global only because of testsuites CWMTab uses it too
- Parameters:
-
widgets list of maps represenging widgets event map event that occured
Cleanup after dialog was finished (independently on what event) global only because of testsuites
- Parameters:
-
widgets list of maps represenging widgets
Return description map of currently processed widget
- Return value:
-
description map of currently processed widget
Create a term with OK and Cancel buttons placed horizontally
- Return value:
-
the term (HBox)
Validate widget description map, check for maps structure Also checks option description maps if present
- Parameters:
-
widgets map widgets description map
- Return value:
-
true on success
Prepare a widget for usage
- Parameters:
-
widget_descr map widget description map
- Return value:
-
modified widget description map
Validate single widget
- Parameters:
-
widget widget description map event map event that caused validation key widget key for validation by function
- Return value:
-
true if validation succeeded
Validate dialog contents for allow it to be saved
- Parameters:
-
widgets list of widgets to validate event map event that caused validation
- Return value:
-
true if everything is OK, false if something is wrong
Read widgets with listed names
- Parameters:
-
names a list of strings/symbols names of widgets source a map containing the widgets
- Return value:
-
of maps representing widgets
Merge helps from the widgets
- Parameters:
-
widgets a list of widget description maps
- Return value:
-
merged helps of the widgets
Prepare the dialog, replace strings in the term with appropriate widgets
- Parameters:
-
dialog term dialog containing strings widgets list of widget description maps
- Return value:
-
updated term ready to be used as a dialog
Replace help for a particular widget
- Parameters:
-
widget string widget ID of widget to replace help help string new help to the widget
Generic function to create dialog and handle it's events
- Parameters:
-
widgets list of widget maps functions map initialize/save/handle fallbacks if not specified with the widgets.
- Return value:
-
wizard sequencer symbol
Disable given bottom buttons of the wizard sequencer
- Parameters:
-
buttons
Adjust the labels of the bottom buttons of the wizard sequencer
- Parameters:
-
next label of the "Next" button back string label of the "Back" button abort string label of the "Abort" button help string label of the additional "Help" button (if needed)
Display the dialog and run its event loop
- Parameters:
-
settings a map of all settings needed to run the dialog
Display the dialog and run its event loop
- Parameters:
-
widget_names list of names of widgets that will be used in the dialog widget_descr map description map of all widgets contents term contents of the dialog, identifiers instead of widgets caption string dialog caption back_button string label of the back button next_button string label of the next button fallback map initialize/save/handle fallbacks if not specified with the widgets.
- Return value:
-
wizard sequencer symbol
Do-nothing replacement for a widget initialization function. Used for push buttons if all the other widgets have a fallback.
- Parameters:
-
key id of the widget
Do-nothing replacement for a widget storing function. Used for push buttons if all the other widgets have a fallback.
- Parameters:
-
key id of the widget event the event being handled