TABLE OF CONTENTS
- 1. Hunter/Utils
- 1.1. Utils/Positive
- 1.2. Utils/ProgressIndex
- 1.3. Utils/CanBeOpened
- 1.4. Utils/CountFileSize
- 1.5. Utils/FindExecutable
- 1.6. Utils/GetMimeType
- 1.7. Utils/RemoveChild
- 1.8. Utils/SetProgressBar
- 1.9. Utils/ToggleActionButtons
- 1.10. Utils/ToggleToolButtons
- 1.11. Utils/UpdateProgressBar
Hunter/Utils [ Packages ]
FUNCTION
Various utility subprograms.
SOURCE
package Utils is
Utils/CanBeOpened [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Check if there is application associated to open selected MIME Type
SOURCE
function CanBeOpened(MimeType: String) return Boolean;
PARAMETERS
MimeType - MIME Type to check
RESULT
Return True if there is application associated with selected MIME Type, otherwise False
Utils/CountFileSize [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Convert file size to human readable format
SOURCE
function CountFileSize(Size: File_Size) return String;
PARAMETERS
Size - Size of file in bytes
RESULT
Return formated string with info about file size (in MiB, GiB, etc)
Utils/FindExecutable [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Find executable file with selected name in this same directory where the program is or in PATH variable
SOURCE
function FindExecutable(Name: String) return String;
PARAMETERS
Name - Name of executable file to find
RESULT
Full path to the executable file or empty string and show message if file could not be found.
Utils/GetMimeType [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Check MIME Type of selected file
SOURCE
function GetMimeType(FileName: String) return String;
PARAMETERS
FileName - full path to the selected file to check MIME Type
RESULT
String with MIME Type of selected file
Utils/RemoveChild [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Remove all children from preview window Widget - Gtk_Widget to remove
SOURCE
procedure RemoveChild(Widget: not null access Gtk_Widget_Record'Class);
Utils/SetProgressBar [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Set values for progress bar and show it to the user
SOURCE
procedure SetProgressBar(Amount: Positive);
PARAMETERS
Amount - Max amount of items - will be used to count progress
Utils/ToggleActionButtons [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Show or hide files and directories actions buttons
SOURCE
procedure ToggleActionButtons;
Utils/ToggleToolButtons [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Show or hide other tool bar buttons when user starts any action with files or directories
SOURCE
procedure ToggleToolButtons (Action: ItemActions; Finished: Boolean := False);
PARAMETERS
Action - Action on files or directories started or finished. Finished - If true, action was finished. Default is False
Utils/UpdateProgressBar [ Subprograms ]
[ Top ] [ Utils ] [ Subprograms ]
FUNCTION
Update fraction of the progress bar
SOURCE
procedure UpdateProgressBar;