YaST2 Developers Documentation: Table/Popup dialogs backend

Table/Popup dialogs backend

modules/TablePopup.ycp
Routines for Table/Popup interface
  • Jiri Srain

This module has an unstable interface.

Imports

  • CWM
  • Label
  • Mode
  • Report

Global Functions

Local Variables

Local Functions

local previous_selected_item -> any

Item, that is the last selected Used to decide if selected item should be moved up or down if separator clicked Loss of contents is no problem

local getIdList (map<string, any> descr) -> list

Get list of IDs of entries of the table

Parameters:
descr map table description map
Return value:
of IDs of the table
local ValidateTableAttr (map<string,any> attr) -> boolean

Validate table options specifyign attributesA

Parameters:
attr a map of table attributes
Return value:
true if validation succeeded
local ValidateValueType (string key, any value, string widget, boolean popup) -> boolean

Validate type of entry of the 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
popup boolean true if is option of a popup
Return value:
true if validation succeeded
local ValidateTableDescr (string key, map<string,any> descr) -> boolean

Validate the table description

Parameters:
key
descr a map containing the table description
Return value:
true if validation succeeded
global id2key (map<string, any> descr, any opt_id) -> string

Get option key from the option id global only because of testsuites

Parameters:
descr map description of the table
opt_id any id of the option
Return value:
option key
global key2descr (map<string, any> descr, string opt_key) -> map<string, any>

Get option description map from the key global only because of testsuites

Parameters:
descr map description of the table
opt_key string option key
Return value:
option description map
global updateOptionMap (map<string, any> opt_descr, map fallbacks) -> map<string, any>

Update the option description map in order to contain handlers of all needed functions global only because of testsuites

Parameters:
opt_descr map option description map
fallbacks map of fallback handlers
Return value:
updated option description map
local tableEntryKey (any opt_id, map<string, any> opt_descr) -> string

Get the left column of the table

Parameters:
opt_id any option id
opt_descr map option description map
Return value:
text to the table
local tableEntryValue (any opt_id, map<string, any> opt_descr) -> string

Get value to the table entry

Parameters:
opt_id any option id
opt_descr map option description map
Return value:
text to the table
global tableEntryChanged (any opt_id, map<string, any> opt_descr) -> boolean

Realize if table entry was changed

Parameters:
opt_id any option id
opt_descr map option description map
Return value:
true if was changed
global deleteTableItem (any opt_id, map<string, any> descr) -> boolean

Delete an item from the table Just a wrapper for module-specific function

Parameters:
opt_id any option id
descr map table description map
Return value:
true if was really deleted
global updateButtons (map<string,any> descr, map<string,any> opt_descr) -> void

Enable or disable the Delete and up/down buttons

Parameters:
descr map table description map
opt_descr map selected option description map
local moveTableItem (any opt_id, map<string, any> descr, symbol dir) -> any

Move table item up or down Just a wrapper for module-specific function

Parameters:
opt_id any option id
descr map table description map
dir symbol `up or `down (according to the button user pressed)
Return value:
new id of selected option, nil if wasn't reordered
local TableRedraw (map<string, any> descr, boolean update_buttons) -> void

Redraw completely the table

Parameters:
descr map description map of the whole table
update_buttons boolean true if buttons status (enabled/disabled) should be updated according to currently selected item
global askForNewOption (list possible, boolean editable, map<string,any> descr) -> string

Displaye popup for option to edit choosing

Parameters:
possible a list of strings or items of all possible options to provide
editable boolean true means that it is possible to add non-listed options
descr a map table description map
Return value:
option identifies, nil if canceled
global singleOptionEditPopup (map<string,any> option) -> symbol

Display and handle the popup for option

Parameters:
option map one option description map that is modified in order to contain the option name and more percise option identification
Return value:
`_tp_ok or `_tp_cancel
global DisableTable (map<string,any> descr) -> void

Disable whole table

Parameters:
descr map table widget description map
global EnableTable (map<string, any> descr) -> void

Enable whole table (except buttons that should be grayed according to currently selected table row

Parameters:
descr map table widget description map
global TableInit (map<string, any> descr, string key) -> void

Initialize the displayed table

Parameters:
descr map description map of the whole table
key table widget key
global TableHandle (map<string, any> descr, string key, map event_descr) -> symbol

Handle the event that happened on the table

Parameters:
descr map description of the table
key table widget key
event_descr map event to handle
Return value:
modified event if needed
global TableInitWrapper (string key) -> void

Wrapper for TableInit using CWM::GetProcessedWidget () for getting widget description map

Parameters:
key any widget key
global TableHandleWrapper (string key, map event_descr) -> symbol

Wrapper for TableHandle using CWM::GetProcessedWidget () for getting widget description map

Parameters:
key any widget key
event_descr map event description map
Return value:
return value for wizard sequencer or nil
global CreateTableDescr (map<string,any> attrib, map<string,any> widget_descr) -> map<string,any>

Get the map with the table widget

Parameters:
attrib map table attributes
widget_descr map widget description map of the table, will be unioned with the generated map
Return value:
table widget