Remoto - VFS
|
The fileSelectField class adds a file selector to a form. More...
#include <fileSelectField.h>
Public Member Functions | |
fileSelectField (QJsonValue v, QString label="", QString tip="") | |
void | setAllowed (QString allowed) |
Set the file types that are selectable. More... | |
void | setBasePath (QString base) |
The base path is hidden from the user, and represents the top level that can be navigated. More... | |
void | setMProtocol (bool p, QString base) |
Enable or disable mProtocol. More... | |
void | setSourceOrDestination (QString sd) |
A fileSelectField can choose a destination path, or a source file or folder. More... | |
void | setWhat (QString what) |
A fileSelectField can be used to select files or directories. More... | |
Public Member Functions inherited from VFS_form_field | |
VFS_form_field (QJsonValue val, QString type, QString label="", QString tip="") | |
VFS_form_field (QString type) | |
void | clearOption (QString o) |
Clear/remove a widget option. More... | |
int | getIndex () |
Get the field index. More... | |
QString | getLabel () |
Return the label. More... | |
void | setAllowEmpty (bool e) |
Validate this field against empty-ness. More... | |
void | setEnabled (bool e) |
Enable or disable this field. More... | |
void | setHidden (bool e) |
Keep the field, but hide it when rendering. More... | |
void | setHideLabel (bool l) |
Hide the label for this field. More... | |
void | setIndex (int i) |
Set the field index for this widget. More... | |
void | setLabel (QString l, bool replace=true) |
Set the label. More... | |
void | setOption (QString o, QJsonValue v) |
Set a widget option. More... | |
void | setSpellcheck (bool s) |
Enable or disable spellchecking on this text field. More... | |
void | setTip (QString t) |
Set the tooltip. More... | |
void | setValue (QJsonValue val) |
Set the value. More... | |
Static Public Attributes | |
static QString | DESTINATION = "destination" |
used for the setSourceOrDestination command More... | |
static QString | DIRECTORY = "directory" |
used for the setWhat command More... | |
static QString | FILE = "file" |
used for the setWhat command More... | |
static QString | SOURCE = "source" |
used for the setSourceOrDestination command More... | |
Additional Inherited Members | |
Protected Attributes inherited from VFS_form_field | |
QJsonObject | options |
Options for any widget type... this is an arbitrary list. More... | |
The fileSelectField class adds a file selector to a form.
The files in the file browser correspond to VFS entries, not necessarily the underlying file system.
Definition at line 6 of file fileSelectField.h.
|
explicit |
t | The initial path value |
label | The label |
tip | The tooltip |
Note that the widget type is set to "stdlib:js/widgets/widgets/fileSelectWidget.js", which will use the VFS_stdlib library to load the selector widget.
Definition at line 27 of file fileSelectField.cpp.
void fileSelectField::setAllowed | ( | QString | allowed | ) |
Set the file types that are selectable.
allowed | A regex string, which must be javascript compliant |
Definition at line 74 of file fileSelectField.cpp.
void fileSelectField::setBasePath | ( | QString | base | ) |
The base path is hidden from the user, and represents the top level that can be navigated.
base | The root of this selector |
It can be useful to force a user to select a file under a certain location, or to prevent them from navigating out of a specified area.
Definition at line 40 of file fileSelectField.cpp.
void fileSelectField::setMProtocol | ( | bool | p, |
QString | mbase | ||
) |
Enable or disable mProtocol.
p | enable or disable |
mbase | The filesystem base on the user's local system |
mProtocol will make a link on this field allowing a user to open, for instance, a Photoshop file on their local system using a locally-installed application. This requires remoto:// protocol handlers to be installed, and requires the VFS path to be translatable to a local filesystem path.
Definition at line 89 of file fileSelectField.cpp.
void fileSelectField::setSourceOrDestination | ( | QString | sd | ) |
A fileSelectField can choose a destination path, or a source file or folder.
sd | source or destination? |
Although not enforced, this should be either fileSelectField::SOURCE or fileSelectField::DESTINATION
Definition at line 64 of file fileSelectField.cpp.
void fileSelectField::setWhat | ( | QString | what | ) |
A fileSelectField can be used to select files or directories.
what | what is being selected |
Although not enforced, this should be set to either fileSelectField::FILE or fileSelectField::DIRECTORY
Definition at line 52 of file fileSelectField.cpp.
|
static |
used for the setSourceOrDestination command
Definition at line 20 of file fileSelectField.h.
|
static |
used for the setWhat command
Definition at line 18 of file fileSelectField.h.
|
static |
used for the setWhat command
Definition at line 17 of file fileSelectField.h.
|
static |
used for the setSourceOrDestination command
Definition at line 19 of file fileSelectField.h.