YaST2 Developers Documentation: Country settings

Country settings

modules/Timezone.ycp
Timezone related stuff
  • Klaus Kaempf
  • Thomas Roelz

This module has an unstable interface.

Imports

  • Arch
  • HTML
  • Language
  • Misc
  • Mode
  • ProductFeatures
  • Stage
  • String

Global Variables

Global Functions

Local Functions

global modified -> boolean

if anyuthing was modified (currently for auto client only)

global windows_partition -> boolean

If there is windows partition, assume that local time is used

local get_lang2tz () -> map<string, string>

get_lang2tz()

Get the language --> timezone conversion map.

Return value:
conversion map
See
get_zonemap()
global get_zonemap () -> list<map<string,any> >

get_zonemap()

Get the timezone database.

Return value:
timezone DB (map)
See
get_lang2tz()
global Set (string zone, boolean really) -> integer

Set()

Set system to selected timezone.

Parameters:
zone
really
Return value:
the number of the region that contains the timezone
global UpdateTimezone (string tmz) -> string

Convert the duplicated timezone to the only one supported Temporary solution - a result of discussion of bug #47472

Parameters:
tmz current timezone
global Read () -> void

Read timezone settings from sysconfig

global Timezone () -> void

Timezone()

The module constructor. Sets the proprietary module data defined globally for public access. This is done only once (and automatically) when the module is loaded for the first time. Calls Set() in initial mode. Reads current timezone from sysconfig in normal mode.

See
Set()
global SetTime (string year, string month, string day, string hour, string minute, string second) -> void

Set the new time and date given by user

Parameters:
year
month
day
hour
minute
second
global SystemTime2HWClock () -> void

Set the Hardware Clock to the current System Time.

global GetTimezoneForLanguage (string sys_language, string default_timezone) -> string

GetTimezoneForLanguage()

Get the timezone for the given system language.

Parameters:
sys_language
default_timezone
Return value:
The timezone for this language, e.g. "US/Eastern" or the default value if nothing found.
See
-
global SetTimezoneForLanguage (string sys_language) -> void

Set the timezone for the given system language.

Parameters:
sys_language
Return value:
the number of the region that contains the timezone
global GetLanguageForTimezone (string tz) -> string

Return the language code for given timezone (by reverse searching the "language -> timezone" map)

Parameters:
tz
global GetCountryForTimezone (string tz) -> string

Return the country part of language code for given timezone

Parameters:
tz
global GetTimezoneCountry (string zone) -> string

Return translated country name of given timezone

Parameters:
zone
global GetDateTime (boolean real_time, boolean locale_format) -> string

GetDateTime()

Get the output of date "+%H:%M:%S - %Y-%m-%d" or in locale defined format

Parameters:
real_time
locale_format
Return value:
The string output.
global ResetZonemap () -> void

Clear the internal map with timezones, so the timezone data could be retranslated next time when they are needed

global ProposeLocaltime () -> boolean

Return true if localtime should be proposed as default Based on current hardware configuration: Win partitions present or 32bit Mac

global MakeProposal (boolean force_reset, boolean language_changed) -> list<string>

Return proposal list of strings.

Parameters:
force_reset
language_changed
Return value:
user readable description. If force_reset is true reset the module to the timezone stored in default_timezone.
global Selection (integer num) -> list

Selection()

Return a map of ids and names to build up a selection list for the user. The key is used later in the Set function to select this timezone. The name is a translated string.

Parameters:
num
Return value:
map for timezones 'timezone_id' is used internally in Set and Probe functions. 'timezone_name' is a user-readable string. Uses Language::language for translation.
See
Set()
global Region () -> list

Return list of regions for timezone selection list

global Save () -> void

Save()

global GetDateTimeMap () -> map

Return current date and time in the map

global PushVal () -> void

save the initial data

global PopVal () -> void

restore the original data from internal map

global Modified () -> boolean

was anything modified?

global Import (map settings) -> boolean

AutoYaST interface function: Get the Timezone configuration from a map.

Parameters:
settings imported map
Return value:
success
global Export () -> map

AutoYaST interface function: Return the Timezone configuration as a map.

Return value:
with the settings
global Summary () -> string

AutoYaST interface function: Return the summary of Timezone configuration as a map.

Return value:
summary string (html)