Scripting - Chapter 11: List of Functions
Contents
Legend of colour for the arguments
Red: Required argument. Orange : Required argument if further arguments are present, but can be left empty (""). Blue : Optional argument, but in some cases required. Green : Optional argument.
Start and stop the graphical interface
POL_GetSetupImages
Arguments:
- URL of top image.
- URL of left image.
- Name of the directory where to store the images (often $TITLE).
Description:
Download top and left images of the script from the PlayOnLinux site.
Prerequisite:
Must be used before POL_SetupWindow_Init.
Example:
POL_GetSetupImages "http://files.playonlinux.com/resources/setups/AC2/top.jpg" "http://files.playonlinux.com/resources/setups/AC2/left.jpg" "$TITLE"
POL_SetupWindow_Init
Description:
Opens the installation wizard window.
Example:
POL_SetupWindow_Init
POL_SetupWindow_Close
Description:
Closes the installation wizard window.
Example:
POL_SetupWindow_Close
PlayOnLinux graphical interface
Note: All the functions below need the command POL_SetupWindow_Init to be executed beforehand.
POL_SetupWindow_presentation
Arguments:
- Software name (often $TITLE).
- Software publisher.
- Site of the publisher.
- Script author.
- Prefix name (usually $PREFIX).
Description:
Present the software.
Example:
POL_SetupWindow_presentation "$TITLE" "Mozilla" "http://www.mozilla.com" "SuperPlumus and NSLW" "$PREFIX"
POL_SetupWindow_free_presentation
Arguments:
- Software name (often $TITLE).
- Message.
Description:
Present the software with more freedom than POL_SetupWindow_presentation.
Example:
POL_SetupWindow_free_presentation "$TITLE" "Welcome to Mozilla Firefox installation wizard."
POL_SetupWindow_message
Arguments:
- Message.
- Title (often $TITLE).
Description:
Display a message.
Example:
POL_SetupWindow_message "Hello world!" "$TITLE"
check_one - POL_SetupWindow_missing
Arguments for check_one:
- Program that must be present.
- Package that contains this program.
Description:
Check the availability of one or more programs required by the script.
Call check_one as many times as needed (once per program), then use POL_SetupWindow_missing.
Example:
check_one "p7zip" "p7zip" POL_SetupWindow_missing
POL_SetupWindow_file
Arguments:
- Message.
- Title (often $TITLE).
- File to display.
Description:
Display the content of a file.
Example:
POL_SetupWindow_file "Changelog" "$TITLE" "$POL_System_TmpDir/changelog.txt"
POL_SetupWindow_licence
Arguments:
- Message.
- Title (often $TITLE).
- File to display.
Description:
Similar to the command POL_SetupWindow_file, but adds an "I agree" checkbox.
Useful for displaying licenses.
Example:
POL_SetupWindow_licence "Licence:" "$TITLE" "$POL_System_TmpDir/licence.txt"
POL_SetupWindow_pulsebar - POL_SetupWindow_pulse - POL_SetupWindow_set_text
Arguments for POL_SetupWindow_pulsebar:
- Message.
- Title (often $TITLE).
Arguments for POL_SetupWindow_pulse:
- Percentage.
Arguments for POL_SetupWindow_set_text:
- Current text.
Description:
Display a progression bar, from 0 to 100%.
POL_SetupWindow_pulsebar display the progression bar.
POL_SetupWindow_pulse changes the progression value, from 0 to 100%.
POL_SetupWindow_set_text modifies the current message (different from POL_SetupWindow_pulsebar message).
Useful for displaying licenses.
Example:
POL_SetupWindow_pulsebar "Installing patchs 1 to 5." "$TITLE" POL_SetupWindow_set_text "Installation of patch 1 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch1.exe" POL_SetupWindow_pulse "20" # meaning 20% POL_SetupWindow_set_text "Installation of patch 2 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch2.exe" POL_SetupWindow_pulse "40" POL_SetupWindow_set_text "Installation of patch 3 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch3.exe" POL_SetupWindow_pulse "60" POL_SetupWindow_set_text "Installation of patch 4 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch4.exe" POL_SetupWindow_pulse "80" POL_SetupWindow_set_text "Installation of patch 5 in progress" POL_Wine start /unix "$POL_System_TmpDir/patch5.exe" POL_SetupWindow_pulse "100"