YaST2 Developers Documentation: Configuration of mail



functions
files
intro

Configuration of mail

include/mail/wj.ycp
Widget Juggler
  1. Widget functions to make moving widgets between dialogs easier.
  2. Table editing helpers

Includes

  • mail/widgets.ycp

Structures

Local Functions

local makeItems (list<map> data, list<string> keys) -> list<term>

Parameters:
data a list of structs
keys which members to put in the table
Return value:
an item list

local EditTable (symbol action, list<map> data, list<string> keys) -> list<map>

A generic handler for editing tables. The current item of table_widget makeItems (new_data, keys) is used to fill table_widget

Parameters:
action `add, `edit or `delete
data the data edited using the table
keys keys of respective columns
Return value:
the edited data

local evaluate_fp (any fp) -> any

Evaluate a function pointer, working around interpreter limitations

Parameters:
fp

local WJ_MakeWidget (symbol id) -> term

Constructs a widget term. Uses a global Widgets map. Keys are symbols (ids), values are

Structure widget_def

    `foo: $[
	"widget": `TextEntry (),
	"opt": `opt (`notify), // optional
	"label": "&Foo",
	// if there are choices, they are used to construct the widget,
	// otherwise get is used
	"choices": Choices_foo          // list ()
	"help": _("<p>Foo!</p>"), // used by WJ_MakeHelp, optional
	"get": Get_foo,			// gets value from module to widget
	"set": Set_foo,			// sets value from widget to module
	// popups an error and returns false if invalid
	"validate": ``(Validate_foo ()),// optional
	],

Parameters:
id which widget
Return value:
a widget term

local WJ_GetWidget (symbol id) -> void

Changes widget value using "get" (useful for widgets with choices). Uses a global Widgets map. widget_def

Parameters:
id which widget

local WJ_MakeHelp (list items) -> string

Make a help string by concatenating individual widget helps and other strings. Uses a global Widgets map. widget_def

Parameters:
items an item is
either a string - use it
or a symbol - lookup its help string in Widgets
Return value:
concatenated strings

local WJ_Validate_True (symbol id) -> boolean

A helper for WJ_Validate.

Parameters:
id a widget id
Return value:
always true

local WJ_Validate (list widgets) -> boolean

Call the validation functions for a list of widgets. Widgets with an unspecified function are assumed to be valid. Uses a global Widgets map. widget_def

Parameters:
widgets which widgets to validate
Return value:
true if all widgets are ok

local WJ_Set (list widgets) -> void

Call the "set" functions for a list of widgets to commit the UI values to a module. Uses a global Widgets map. widget_def

Parameters:
widgets which widgets to commit

local RadioButtonVBox (symbol g_id, list<term> rbs) -> term

Make a RadioButtonGroup containing Left aligned widgets in a VBox that has VSpacing (0.2) as top/bottom padding.

Parameters:
g_id group id
rbs a list of widgets, usually RadioButtons
Return value:
widget

YaST2 Developers Documentation