
functions
files
intro
|
|
Runlevel Editor
|
ui.ycp
|
Runlevel Editor user interface.
|
|
|
Runlevel editor user interface functions.
Imports
- Label
- Popup
- RunlevelEd
- Service
- Wizard
Local Functions
- AutoDialog ()
- CheckMissingServices (list<string> services)
- ComplexDialog ()
- EnableDisableServiceDep (string service_name, list<string> rls, boolean enable)
- GetScriptOutput (string name, string param)
- GetScriptStatus (string name, string param)
- LongContinueCancelHeadlinePopup (string headline, term richtext, integer hdim, integer vdim)
- ModeTabs (symbol mode)
- ModifyServiceDep (string service_name, list<string> rls, boolean enable, boolean init_time, boolean run_time)
- SetService (string service_name, list<string> rls, boolean enable)
- SimpleDialog ()
- SimpleSetServiceDep (string service_name, boolean enable)
- StartStopServiceDep (string service_name, boolean enable)
- StartedText (integer started)
- addService ()
- changeService1 (map service)
- formatLine (list<string> l, integer len)
- getActionReturnHelp (integer exit)
- getDefaultPicker (symbol mode)
- getHelpAuto ()
- getHelpComplex ()
- getHelpProgress ()
- getInRunlevels (list<string> rll)
- getRlCheckBoxes ()
- getStatusReturnHelp (integer exit)
- mapkeys (map m)
- overviewText ()
- queryRlCheckBoxes (string service_name, map service)
- reallyAbort ()
- refreshTableLine2 ()
- serviceStatusIterator (boolean use_func)
- servicesToTable (symbol mix)
- setServiceDisable (string service_name)
- setServiceToDefault (string service_name)
- startStopService (string service_name, string command)
- tomap_true (list<string> l)
- updateDescription (map service)
- updateRlCheckBox (map service, string rl)
- updateRlCheckBoxes (map service)
- updateRlColumns (string service_name, map service, list<string> rls)
- updateServiceStatus (boolean use_func, string service_name)
- updateSimpleStatusColumn (string service_name, map service)
- updateStatusColumn (string service_name, integer started)
- updateStatusInTable (string service_name, map service, integer started)
|
|
|
local getRlCheckBoxes () -> term
|
|
Create term of checkboxes for runlevel selection.
- Return value:
local updateRlCheckBox (map service, string rl) -> void
|
|
Changes value of a runlevel checkbox.
Prevents triggering userinput by disabling notify.
- Parameters:
local updateRlCheckBoxes (map service) -> void
|
|
Changes values of runlevel checkboxes.
- Parameters:
local updateDescription (map service) -> void
|
|
Update the long description text box
- Parameters:
local updateRlColumns (string service_name, map service, list<string> rls) -> void
|
|
Sets runlevel columns in the table.
- Parameters:
service_name |
which line |
service |
service |
rls |
which columns to update, nil == all |
local updateSimpleStatusColumn (string service_name, map service) -> void
|
|
Update simple-mode status column.
TODO combine runtime status too?
- Parameters:
service_name |
which line |
service |
service |
local updateStatusColumn (string service_name, integer started) -> void
|
|
Update run-time status column.
- Parameters:
service_name |
which line |
started |
status or -1 (unknown yet) |
local updateStatusInTable (string service_name, map service, integer started) -> void
|
|
Helper function for fetching service status in run-time.
- Parameters:
service_name |
which line |
service |
service |
started |
status or -1 (unknown yet) |
local GetScriptOutput (string name, string param) -> map
|
|
-------Tedd Guo: these routine is used get Output of rhel'4 service scripts-----
Run init script and return also its output (stdout and stderr merged).
- Parameters:
name |
init service name |
param |
init script argument |
- Return value:
|
of $[ "stdout" : "...", "stderr" : "...", "exit" : int,] |
local GetScriptStatus (string name, string param) -> integer
|
|
-------Tedd Guo: these routine is used get Status of rhel'4 service scripts-----
For specified service, determines its status and calls a supplied function.
- Parameters:
name |
init service name |
param |
init script argument |
- Return value:
local changeService1 (map service) -> void
|
|
Changes values of runlevel checkboxes.
Get the status if not known yet.
- Parameters:
local queryRlCheckBoxes (string service_name, map service) -> map
|
|
Reads data from checkboxes and updates service
and RunlevelEd::services maps.
- Parameters:
service_name |
which service |
service |
service |
- Return value:
local getActionReturnHelp (integer exit) -> string
|
|
Get help text for rcscript start|stop command exit value.
- Parameters:
- Return value:
local getStatusReturnHelp (integer exit) -> string
|
|
Get help text for rcscript status return value
according to LSB.
- Parameters:
- Return value:
local getDefaultPicker (symbol mode) -> list
|
|
Returns items for default runlevel combo box.
(Excludes 0, 1, 6, S and B)
- Parameters:
mode |
if `auto, adds Unchanged. if `proposal, only 2, 3 and 5 |
- Return value:
|
List of items. Default is selected. |
local getInRunlevels (list<string> rll) -> string
|
|
- Parameters:
rll |
a list of runlevels or nil, meaning "all" |
- Return value:
|
"in [these] runlevels" (translated) |
local StartedText (integer started) -> string
|
|
- Parameters:
started |
status or -1 (unknown yet) |
- Return value:
local reallyAbort () -> boolean
|
|
Ask if really abort. Uses boolean changed_settings. Sets boolean do_abort_now.
- Return value:
|
true if user really wants to abort |
local servicesToTable (symbol mix) -> list
|
|
Create table items from services.
For simple mode, also filter out critical services: boot ones.
For Expert mode:
Mixin: started, start, (short)description.
- Parameters:
mix |
which items to mix in:
`simple: id=name, name, bstatus, (short)description
`complex: id=name, name, rstatus, runlevels, (short)description
`auto: id=name, name, dirty, runlevels, ?(short)description
|
- Return value:
local serviceStatusIterator (boolean use_func) -> void
|
|
For each service, determines its status and calls a supplied function.
- Parameters:
- See:
-
local updateServiceStatus (boolean use_func, string service_name) -> void
|
|
For specified service, determines its status and calls a supplied function.
- Parameters:
- See:
-
local getHelpProgress () -> string
|
|
help text for progress
- Return value:
local SetService (string service_name, list<string> rls, boolean enable) -> void
|
|
Enable or disable a service in some runlevels.
Set the variables and update the ui (rl columns).
- Parameters:
service_name |
a service |
rls |
which runlevels, nil == disable in all |
enable |
enabling or disabling? |
local CheckMissingServices (list<string> services) -> list
|
|
Check that all the services exist (in RunlevelEd::services).
If not, popup a list of the missing ones and ask whether
continue or not. Filter out the missing ones.
- Parameters:
- Return value:
|
[continue?, filtered list] |
local ModifyServiceDep (string service_name, list<string> rls, boolean enable, boolean init_time, boolean run_time) -> boolean
|
|
Generic function to handle enabling, disabling, starting and
stoping services and their dependencies, in various runlevels.
Piece of cake ;-)
Either of init_time or run_time can be specified (for complex
mode) or both (for simple mode).
rls: ignored for -init +run
What it does: gets dependent services (in the correct order),
filters ones that are already in the desired state, if there
are dependencies left, pop up a confirmation dialog, check for
missing dependencies, perform the action (run-time, then init-time)
for the deps and the
service (in this order), displaying output after each error and
at the end.
- Parameters:
service_name |
name of service |
rls |
in which run levels, nil == all |
enable |
on/off |
init_time |
do enable/disable |
run_time |
do start/stop |
- Return value:
|
success (may have been canceled because of dependencies) |
local SimpleSetServiceDep (string service_name, boolean enable) -> boolean
|
|
Turns a service on or off in the simple mode, ie. resolving
dependencies and for each service doing start,enable or
stop,disable.
- Parameters:
service_name |
name of service |
enable |
|
- Return value:
|
success (may have been canceled because of dependencies) |
local EnableDisableServiceDep (string service_name, list<string> rls, boolean enable) -> boolean
|
|
Used for enabling/disabling a service and services depending on
it in a runlevel or a set of runlevels.
- Parameters:
service_name |
name of service |
rls |
in which run levels, nil == all |
enable |
enable/disable |
- Return value:
|
success (may have been canceled because of dependencies) |
local StartStopServiceDep (string service_name, boolean enable) -> boolean
|
|
Used for starting/stopping a service and services depending on it.
Displays result popups.
- Parameters:
service_name |
name of service |
enable |
start/stop |
- Return value:
|
success (may have been canceled because of dependencies) |
local startStopService (string service_name, string command) -> list
|
|
Starts/stops/checks status of a service
- Parameters:
service_name |
service to start/stop |
command |
"start" or "stop" or "status" |
- Return value:
|
[integer exit_status, string rich_message] |
local formatLine (list<string> l, integer len) -> string
|
|
Prints list items into a string, separating them by commas
and when line exceeds len characters, it does line break (\n).
It adds 5 spaces before each line.
Do not expect reasonable results if you set len < 0.
- Parameters:
l |
list of strings |
len |
minimal length of line |
- Return value:
local overviewText () -> string
|
|
Checks what services should run in this runlevel and do not run
or what services run but should not run.
- Return value:
local ModeTabs (symbol mode) -> term
|
|
Radio buttons (faking tabs) for switching modes
- Parameters:
mode |
`simple or `complex, which one are we in |
- Return value:
local getHelpComplex () -> string
|
|
help text services dialog
- Return value:
local ComplexDialog () -> symbol
|
|
Main dialog for changing services.
- Return value:
local SimpleDialog () -> symbol
|
|
Main dialog for changing services.
- Return value:
local getHelpAuto () -> string
|
|
Help text for auto-complex-screen
- Return value:
local addService () -> string
|
|
Add service by hand.
- Return value:
|
new service name (already added to RunlevelEd::services) or "" |
local AutoDialog () -> symbol
|
|
Main dialog for changing services.
- Return value:
local refreshTableLine2 () -> void
|
|
Sets columns 0-S (runlevels) in table so they are synchronized with checkboxes.
local LongContinueCancelHeadlinePopup (string headline, term richtext, integer hdim, integer vdim) -> boolean
|
|
Like Popup::LongText
- Parameters:
headline |
a headline |
richtext |
`RichText(_("<p>foo...</p>")) |
hdim |
popup width |
vdim |
popup height |
- Return value:
local setServiceDisable (string service_name) -> void
|
|
Disable the service. Changes global services.
- Parameters:
service_name |
name of the service. |
local setServiceToDefault (string service_name) -> void
|
|
DUH, in fact ENABLES the service.
but the described function will be there sometime
Set service to its default state upon installation.
Changes global services.
- Parameters:
service_name |
Name of service to process. |
local tomap_true (list<string> l) -> map<string, boolean>
|
|
Converts a list to a map with values of true
- Parameters:
- Return value:
local mapkeys (map m) -> list
|
|
- Parameters:
- Return value:
|