YaST2 Developers Documentation: ProductLicense

ProductLicense

ProductLicense.ycp
Provide access / dialog for product license
  • Jiri Srain
  • Lukas Ocilka

This module has an unstable interface.

Imports

  • Directory
  • FileUtils
  • InstShowInfo
  • Language
  • Mode
  • Popup
  • ProductFeatures
  • Progress
  • Report
  • Stage
  • String
  • Wizard
  • WorkflowManager

Structures

Global Functions

Local Variables

Local Functions

local all_licenses -> map <string, map <string, string> >

License files by their eula_ID

Structure $["ID":$[licenses]]


   
local GetId (string id_text) -> string

Checks the string that might contain ID of a license and eventually returns that id. See also GetIdPlease for a better ratio of successful stories.

Parameters:
id_text
local GetLicenseIdentString (string filename) -> string

Creates a unique identification from filename (MD5sum + file size)

Parameters:
filename
Return value:
unique ID
local IsLicenseAlreadyAccepted (string license_ident) -> boolean

Checks whether the license (file) has been already accepted

Parameters:
license_ident
Return value:
whether the license has been accepted before
local LicenseHasBeenAccepted (string license_ident) -> void

Sets that the license (file) has been already accepted

Parameters:
license_ident
global AcceptanceNeeded (string id) -> boolean

Returns whether accepting the license manually is requied.

Parameters:
id
Return value:
if required
See
BNC #448598
local DisplayLicenseDialog (list<string> languages, boolean back, string license_language, map <string, string> & licenses, string id) -> void

Displays License with Help and ( ) Yes / ( ) No radio buttons

Parameters:
languages
back
license_language
licenses
id
local CleanUpLicense (string tmpdir) -> void

Removes the temporary directory for licenses

Parameters:
tmpdir
local LicenseFiles (string dir, list<string> patterns) -> map<string,string>

Get all files with license existing in specified directory

Parameters:
dir string directory to look into
patterns a list of patterns for the files, regular expressions with %1 for the language
Return value:
a map $[ lang_code : filename ]
local CleanUp () -> void

Generic cleanup

global AskLicenseAgreement (integer src_id, string dir, list<string> patterns, string action, boolean enable_back, boolean base_product, boolean require_agreement, string id) -> symbol

Ask user to confirm license agreement

Parameters:
src_id integer repository to get the license from. If set to 'nil', the license is considered to belong to a base product
dir string directory to look for the license in if src_id is nil and not 1st stage installation
patterns a list of patterns for the files, regular expressions with %1 for the language
action
enable_back
base_product
require_agreement means that even if the license (or the very same license) has been already accepetd, ask user to accept it again (because of 'going back' in the installation proposal).
id
global AskLicensesAgreement (list <string> dirs, list<string> patterns, string action, boolean enable_back, boolean base_product, boolean require_agreement) -> symbol

Ask user to confirm license agreement

Parameters:
dirs
patterns a list of patterns for the files, regular expressions with %1 for the language
action
enable_back
base_product
require_agreement means that even if the license (or the very same license) has been already accepetd, ask user to accept it again (because of 'going back' in the installation proposal).
global ShowFullScreenLicenseInInstallation (any replace_point_ID, integer src_id) -> boolean

Called from the first stage Welcome dialog by clicking on a button

Parameters:
replace_point_ID
src_id
global ShowLicenseInInstallation (any replace_point_ID, integer src_id) -> boolean

Used in the first-stage Welcome dialog

Parameters:
replace_point_ID
src_id