Base YaST package |
modules/WizardHW |
Routines for generic hardware summary dialog | |
|
|
This module has an unstable interface. |
List of items in the currently displayed dialog
Map of rich text descriptions for all items Contained info can be reachable through current_items, this is for faster access
The last handled UI event
The return value to be returned by WizardHW::WaitForEvent ()
Callback Perform an action (when an event which is not handled internally occurred)
Callback Get rich text description of an item. This can be used to set it dynamically
Callback Set all the items Should call the SetContents function of this module
Callback Select the initial item If not set, the first is selected
Store the event description in internal variable To be used by WizardHW::WaitForEvent function
- Parameters:
-
selected string the ID of the currently selected item event a map of the current item
- Return value:
-
always a non-nil symbol (needed just to finish event loop
Set which item is to be selected
- Parameters:
-
selected string the item that is should be marked as selected
Init function of the widget Used when using the callback interface
- Parameters:
-
key strnig the widget key
Handle function of the widget Used when using the callback interface
- Parameters:
-
key strnig the widget key event map event to be handled
- Return value:
-
for wizard sequencer or nil
Get the description label for the action
- Parameters:
-
action a list describing the action
- Return value:
-
the label of the action
Create the Push/Menu button for additional actions
- Parameters:
-
actions a list of the actions
- Return value:
-
the widget
Create CWM widtet for the hardware settings NOTE: The Init and Handle callbacks must be defined
- Parameters:
-
headers a list of headers of the table actions a list of additionaly offered actions, see CreateHWDialog function for details
- Return value:
-
a map a widget for CWM
Draw the dialog, handle all its events via callbacks
- Parameters:
-
settings a map containing all the settings: $[ "action_callback" : symbol(string,map ) -- callback to handle all events which aren't handled internally, first parameter is the ID of the selected item, second is the event. If not set, events which are symbols are returned to wizard sequencer "set_items_callback" : void() -- callback to set the items to be displayed. Should called WizardHW::SetContents instead of direct widgets modification, as it stores the settings also internally. This callback must be set. "set_initial_item_callback" : void() -- callback to set the selected item when dialog initialized. Should call the function WizardHW::SetSelectedItem instead of manual widget modification. If not set, the first item is selected. "item_descr_callback" : string(string) -- callback to get rich text description of the item if it is intended to be dynamical. if not set, static description set via "set_items_callback" is used. "actions" : list - -- a list of actions to be offered
via additional button next to Add/Edit/Delete button. Each item is
a two-item-list, where the first item is the event ID and the second
item is the label of the entry of the menu button. If there is only
one entry, menu button is replaced by push button. If empty
(or not specifued), nothing is shown.
"title" : string -- the dialog title, must be specified
"help" : string -- the help for the dialog, must be specifed
"headers" : list
-- a list of the table headers, must be specified "next_button" : string -- label for the "Next" button. To hide it, set to nil. If not specified, "Next" is used. "back_button" : string -- label for the "Back" button. To hide it, set to nil. If not specified, "Back" is used. "abort_button" : string -- label for the "Abort" button. To hide it, set to nil. If not specified, "Abort" is used. ]
- Return value:
-
for wizard sequencer
Create the Hardware Wizard dialog Draw the dialog
- Parameters:
-
title string the dialog title help string the help for the dialog headers a list of the table headers actions a list of actions to be offered via additional button next to Add/Edit/Delete button. Each item is a two-item-list, where the first item is the event ID and the second item is the label of the entry of the menu button. If there is only one entry, menu button is replaced by push button. If empty (or not specifued), nothing is shown. below the widgets (next to other buttons)
Set which item is to be selected
- Parameters:
-
selected string the item that is should be marked as selected
Return the id of the currently selected item in the table
- Return value:
-
id of the selected item
Set the rich text description.
- Parameters:
-
descr rich text description
Set the information about hardware
- Parameters:
-
items a list of maps, one item per item in the dialog, with keys "id" : string = the identification of the device, "rich_descr" : string = RichText description of the device "table_descr" : list = fields of the table
Wait for event from the event
- Return value:
-
a map with keys: "event" : map = event as returned from UI::WaitForEvent (), "selected" : string = ID of the selected item in the list box
Wait for event from the event
- Return value:
-
a map with keys: "event" : any = event as returned from UI::UserInoput () "selected" : string = ID of the selected item in the list box
Create rich text description of a device. It can be used for WizardHW::SetContents function for formatting richtext device descriptions
- Parameters:
-
title header - usually device name properties important properties of the device which should be displayed in the overview dialog
- Return value:
-
rich text string
Get propertly list of an unconfigured device. Should be used together with device name in CreateRichTextDescription() function.
- Return value:
-
a list of strings