The Playbook object provides the following related functions to assist in development.
Function declaration file address:
https://github.com/aoyiduo/woterm/blob/main/woterm/qwoplaybookwidget.h
Usage example:
Playbook.openTerminal()
Function List:
- bool isConsoleVisible()
Check if the console window is displayed.
Return value:
>>true: show the window already.
>>false: hide the window. - void openConsole()
Open the console window. - void closeConsole()
Close the console window. - QString hostChooser()
Open the session selection dialog and return the selected session name. - int critical(QString title, QString text, int buttons, int defaultButton)
Show the dangious information dialog.
Parameters:
>>title: the title text on dialog。
>>text: the content message on dialog.
>>buttons: Button type,reference:MessageDialog document on Qt help.
>>defaultButton: reference:MessageDialog document on Qt help.
return value:
>>Returns the button value selected by the user. - int information(QString title, QString text, int buttons, int defaultButton)
Show the normal information dialog
Parameters: Reference critical function
Return value: Reference critical function - int question(QString title, QString text, int buttons, int defaultButton)
Show the question information dialog - Parameters: Reference critical function
- Return value: Reference critical function
- int warning(QString title, QString text, int buttons, int defaultButton)
Show the warning information dialog - Parameters: Reference critical function
- Return value: Reference critical function
- QVariant storageValue(QString key, QVariant vdef)
Read the persistence parameters of the script.
Parameters:
>>key: the key of parameter.
>>vdef: If the parameter does not exist, return the default value. - void setStorageValue(QString key, QVariant val)
Save the persistence parameters of the script.
Parameters:
>>key: the key of parameter.
>>val: The saved content can be string, integer, Floating-point arithmetic and other atomic types. - QString urlToLocalFile(QString url)
Convert the file format of the URL to a local file format.
Parameters:
>>url: the value start with file:///c:/a.txt.
return value:
>>The file path in local format. - void openTerminal()
Open the terminal sub window. - void closeTerminal()
Close the terminal window. - void adjustTerminal()
auto resize the terminal. - QObject *terminal()
get the terminal object. - QString log(QJSValue v1,QJSValue v2,QJSValue v3,QJSValue v4,QJSValue v5,QJSValue v6,QJSValue v7,QJSValue v8,QJSValue v9)
Output the log to the console and return the corresponding string.