Provides interface for communicating to backend for generation of local models.
More...
#include <ResourceSpawner.hh>
|
void | DisplayResources () |
| Displays the resources to the qml grid abiding by all search and sort criteria. More...
|
|
void | OnDownloadFuelResource (const QString &_path, const QString &_name, const QString &_owner, int index) |
| Callback when a request is made to download a fuel resource. More...
|
|
void | OnOwnerClicked (const QString &_owner) |
| Callback when a fuel owner is selected, will clear the currently loaded resources and load the ones belonging to the specified owner. More...
|
|
void | OnPathClicked (const QString &_path) |
| Callback when a resource path is selected, will clear the currently loaded resources and load the ones at the specified path. More...
|
|
void | OnResourceSpawn (const QString &_sdfPath) |
| Callback when a resource is selected. More...
|
|
void | OnSearchEntered (const QString &_searchKeyword) |
| Callback when a search request is made. More...
|
|
void | OnSortChosen (const QString &_sortType) |
| Callback when a sort request is made. More...
|
|
Provides interface for communicating to backend for generation of local models.
◆ ResourceSpawner()
◆ ~ResourceSpawner()
◆ AddOwner()
Q_INVOKABLE bool AddOwner |
( |
const QString & |
_owner | ) |
|
Add owner to the list of owners whose resources would be fetched from Fuel.
- Parameters
-
- Returns
- True if the owner was successfully added.
◆ AddPath()
Adds a path to the path list model.
- Parameters
-
◆ DisplayResources
void DisplayResources |
( |
| ) |
|
|
slot |
Displays the resources to the qml grid abiding by all search and sort criteria.
◆ FilterResources()
Filters the vector of resources by the previously entered search keyword.
- Parameters
-
[in,out] | _resources | The vector of resources to filter |
◆ FuelResources()
Returns the fuel resources as a vector belonging to the passed in owner.
- Parameters
-
[in] | _owner | The name of the owner |
- Returns
- The vector of resources
◆ IsDefaultOwner()
Q_INVOKABLE bool IsDefaultOwner |
( |
const QString & |
_owner | ) |
const |
Determine if owner is the default owner.
- Parameters
-
◆ LoadConfig()
void LoadConfig |
( |
const tinyxml2::XMLElement * |
_pluginElem | ) |
|
|
override |
◆ LocalResource()
Returns the resource corresponding to the model.config file.
- Parameters
-
[in] | _path | The path of the model.config file |
- Returns
- The local resource
◆ LocalResources()
Returns the local resources as a vector located under the passed in path.
- Parameters
-
[in] | _path | The path to search |
- Returns
- The vector of resources
◆ OnDownloadFuelResource
void OnDownloadFuelResource |
( |
const QString & |
_path, |
|
|
const QString & |
_name, |
|
|
const QString & |
_owner, |
|
|
int |
index |
|
) |
| |
|
slot |
Callback when a request is made to download a fuel resource.
- Parameters
-
[in] | _path | URI to the fuel resource |
[in] | _name | Name of the resource |
[in] | _owner | The name of the owner |
[in] | index | The index of the grid pane to update |
◆ OnOwnerClicked
void OnOwnerClicked |
( |
const QString & |
_owner | ) |
|
|
slot |
Callback when a fuel owner is selected, will clear the currently loaded resources and load the ones belonging to the specified owner.
- Parameters
-
[in] | _owner | The name of the owner |
◆ OnPathClicked
void OnPathClicked |
( |
const QString & |
_path | ) |
|
|
slot |
Callback when a resource path is selected, will clear the currently loaded resources and load the ones at the specified path.
- Parameters
-
[in] | _path | The path to search resources |
◆ OnResourceSpawn
void OnResourceSpawn |
( |
const QString & |
_sdfPath | ) |
|
|
slot |
Callback when a resource is selected.
- Parameters
-
[in] | _sdfPath | The absolute path to the resource's sdf file |
◆ OnSearchEntered
void OnSearchEntered |
( |
const QString & |
_searchKeyword | ) |
|
|
slot |
Callback when a search request is made.
- Parameters
-
[in] | _searchKeyword | The search keyword, applies to either the resource's name or owner |
◆ OnSortChosen
void OnSortChosen |
( |
const QString & |
_sortType | ) |
|
|
slot |
Callback when a sort request is made.
- Parameters
-
[in] | _sortType | The sorting type as a string, accepts "Most Recent", "A - Z", "Z - A", and "Downloaded." Defaults to "Most Recent." |
◆ RemoveOwner()
Q_INVOKABLE void RemoveOwner |
( |
const QString & |
_owner | ) |
|
Remove owner from the list of owners whose resources would be fetched from Fuel.
- Parameters
-
◆ Resources()
Populates the passed in _resources
vector with the currently selected group of resources.
- Parameters
-
[in,out] | _resources | The vector of resources to populate |
◆ resourceSpawnerError
void resourceSpawnerError |
( |
const QString & |
_errorMsg | ) |
|
|
signal |
Signal emitted when an error is encountered regarding an owner.
- Parameters
-
[in] | _errorMsg | Error message to be displayed. |
◆ SetThumbnail()
Finds a thumbnail on the provided thumbnail path and sets the model's thumbnail path attribute to it, no action is taken if no thumbnail is found.
- Parameters
-
[in] | _thumbnailPath | The path to search for a thumbnail |
[in] | _resource | The model to update with the thumbnail information |
◆ SortResources()
Sorts the vector of resources by the previously entered sort method. The sorting types as a string, are "Most Recent", "A - Z", "Z - A", and "Downloaded." The sort defaults to "Most Recent.".
- Parameters
-
[in,out] | _resources | The vector of resources to sort |
◆ UpdateOwnerListModel()
Called form a download thread to update the GUI's list of resources.
- Parameters
-
[in] | _resource | The resource fetched from Fuel. Note that it is passed by value as a copy is necessary to update the resource if it's cached. |
The documentation for this class was generated from the following file: