YaST2 Developers Documentation: Backup module

Backup module

ui.ycp
Yast2 user interface functions - dialogs

Imports

  • Backup
  • Label
  • NetworkPopup
  • Nfs
  • PackageSystem
  • Popup
  • Popup
  • Progress
  • Report
  • String
  • Wizard

Includes

  • backup/functions.ycp
  • backup/help_texts.ycp

Local Functions

local CheckFreeSpace () -> void

Function periodically checks the free space

local waitForUserOrProcess (integer wait, symbol abort_question) -> symbol

Wait for output from subprocess or user action. If user press `abort button, then subprocess is terminated.

Parameters:
wait Delay in miliseconds between user action checks (if no output from subprocess is available)
abort_question Symbol for AbortConfirmation function - which dialog will be displayed if Abort button is pressed
Return value:
Pressed button id or nil if some data is ready from subprocess.
local InstallNeededPackages (list<string> packages) -> boolean

Function for installing packages

Parameters:
packages
local update_cron_dialog () -> void

Update widget status in the dialog. Enable/disable widget according to checkbox/combobox value.

local update_location_dialog () -> void

Refresh widget states in the location dialog

local WriteArchive () -> boolean

Ask whether archive can be overwritten if it already exists

Return value:
true when archive can be overwritten, nil when an error occured (e.g. NFS mount failed)
local CronDialog () -> symbol

Display dialog for automatic backup - set time when backup module will be started at background with current selected profile.

Return value:
User input value
local refresh_widget_status (boolean enable_archive_type) -> void

Refresh widget status (enable/disable) in the displayed dialog.

Parameters:
enable_archive_type if true enable archive selection combo box and option push button, select "archive" radio button. If enable_archive_type is false then disbale widgets, select "only list" radio button.
local AbortNewProfileCreation (string profile_name) -> boolean

Dialog asks for aborting the new profile creation, If aborted, profile is deleted and true returned.

Parameters:
profile_name
Return value:
whether `abort` meaning is returned
local ArchDialog () -> symbol

Dialog for setting archive options

Return value:
Symbol for wizard sequencer - pressed button
local TarOptionsDialog () -> symbol

Setting multi volume archive options

Return value:
Symbol for wizard sequencer - pressed button
local BackupDialog () -> symbol

Dialog for setting backup options

Return value:
Symbol for wizard sequencer - pressed button
local SystemBackupDialog () -> symbol

System area backup options

Return value:
Symbol for wizard sequencer - pressed button
local is_space (integer required, integer available, symbol target_type) -> boolean

Check whether there is enough free space.

Parameters:
required required space in kB
available required space in kB
target_type selected target archive type
Return value:
true = there is enough free space, false = not enough free space, nil = may be not enough space (compression is used, impossible to tell exactly)
local display_free_space_warning (boolean fits, string dir) -> boolean

Display warning dialog - there is (may) not enough free space in the directory. The dialog is not displayed when cron mode is active (there is no real UI).

Parameters:
fits if true no dialog is displayed, if false display "there is no space", if nil display "there may not be space"
dir directory
Return value:
false = abort backup
local check_space (integer found_size, string tmp_dir, string target_dir, symbol target_type) -> boolean

Check available free space and decide whether archive will fit

Parameters:
found_size total size of found files in bytes
tmp_dir selected temporary directory
target_dir target archive directory
target_type target archive type
Return value:
true = archive fits, false = it doesn't fit, nil = may not fit (compression is used, there is no guarantee that archive will fit but it can be possible if compression ratio will be enough high
local SetDialogContents_SearchingForModifiedFiles (integer total_packages) -> void

Sets dialog contents - Searching for Modified Files

Parameters:
total_packages
local InitSearchingModifiedDialog () -> void

Initializes variables before the SearchingModifiedDialog

local Search_ProcessInstalledPackages () -> void

Takes care about installed packages

local Search_ModifiedFiles () -> void

not sure

local Search_ReadListOfFilesAndPackages () -> void

Reads list of packages files, installed packages

local SetDialogContents_SearchingFiles () -> void

Function sets the dialog contents before searching files...

local SearchingModifiedDialog () -> symbol

Display progress of searching modified files in packages

Return value:
Symbol for wizard sequencer - pressed button
local FilesDialog () -> symbol

Display found files, user can select files to backup

Return value:
Symbol for wizard sequencer - pressed button
local ArchivingDialog () -> symbol

Display progress of creating archive

Return value:
Symbol for wizard sequencer - pressed button
local AskNewProfileName (string current_name) -> string

Allow user to enter a new profile name. If the profile already exists, it allows to replace it. Allows to rename current profile if current_name in not nil or "".

Parameters:
current_name
Return value:
the name for the new profile, "" for cancel
local SummaryDialog () -> symbol

Display backup summary

Return value:
Symbol for wizard sequencer - pressed button
local ExpertOptionsDialog () -> symbol

Display dialog with expert options (e.g. system area backup, temporary location...)

Return value:
user input - widget ID
local RenameProfilePupupDialog (string current_name) -> string

Displays a popup dialog asking for new name for the current profile. If nil returned, no redraw is needed, no changes are done.

Parameters:
current_name
local SelectProfileDialog () -> symbol

Dialog for selection of a profile before backup

Return value:
Symbol for wizard sequencer - pressed button
local PrepareSearching () -> symbol

Choose the next step - start searching or return to the profile dialog.

Return value:
Symbol for wizard sequencer - `next for searching, `next2 for return to profile dialog
local DirPopup (string label, string dir) -> map

Directory selection dialog

Parameters:
label dialog label
dir start directory
Return value:
result $[ "input" : symbol (user input, `ok or `cancel), "dir" : string (selected directory) ];
local size2map (integer sz) -> map

Convert size in bytes to B, kiB, kB, MiB or MB

Parameters:
sz size in bytes
Return value:
map $[ "string" : string (textual representation), "size" : integer (value), "unit" : symbol (unit of the value) ]
local symbol2string (symbol s, integer user_size) -> string

Convert size description to string

Parameters:
s volume size
user_size user defined size
Return value:
result
local list2items (integer start_id, string type, list<string> input) -> list<term>

Convert list of strings to list of items

Parameters:
start_id identification of the first item
type description of item
input input
Return value:
result
local createConstraintsTable () -> list

Create contstraints table content, add directories, regular expressions and file systems to exclude

Return value:
list of items
local ConstraintDialog () -> symbol

Dialog for setting excluded directories, file systems and reg. expressions

Return value:
Symbol for wizard sequencer - pressed button