Class sh::ui::web::WebFileViewManager

class sh::ui::web::WebFileViewManager : public QObject, public sh::ui::web::WebModule

Manages WebFileView instances.

Public Functions

bool executeCommand(WebServerEngineRequest *request, QString command) override

Executes command as requested by the browser, if responsible.

Read parameters, check if this module is responsible for answering, and then write an answer with request.

Implementations often use executeCommand_byQObjectReflection() for convenience.

Return

If it handled (answered) the command.

std::shared_ptr<WebFileView> addFileView(bool reinitialize)
void setCurrentFileViewByIndex(int idx)
sh::ui::web::WebFileView *currentFileView()
int fileViewCount()
void removeFileView(int i)
sh::ui::web::WebFileView *getFileView(int i)
int getFileViewIndex(sh::ui::FileView *fileview)
bool rootCommand(WebServerEngineRequest *request, QString webadapter)

Returns the root (‘index.html’) content. .

void setEngine(WebServerEngine *webserver)

Assigns this web module to a sh::ui::web::WebServerEngine. .

WebServerEngine *webserver()

Returns the sh::ui::web::WebServerEngine this web module is assigned to (may be nullptr).

Signals

void activeSelectionChanged()
void fileViewOptionsChanged(int i)
void fileViewCountChanged()
void currentFileViewChanged()

Public Static Functions

bool executeCommand_byQObjectReflection(QObject *o, WebServerEngineRequest *request, QString command, QString justLeftside = QString())

Convenience function often used by executeCommand().

For a QObject, it searches there for a slot with the name cmd_{command}, with `’/’s replaced by’_’s (so, for the command”foo/get_bars”, it searches for slotcmd_foo_get_bars`). If it finds one, it gets executed (in a worker thread). The request is considered as handled, if so.

If there is such a slot, but with appended __M in name, it is called in main thread!

Return

If it handled (answered) the command.

Private Members

QList<std::shared_ptr<WebFileView>> _fileviews
int _icurrentfileview = 0

Private Slots

void cmd__checkednodes_changed__M(WebServerEngineRequest *request)
void cmd__focus_current__M(WebServerEngineRequest *request)
void cmd__get__M(WebServerEngineRequest *request)
void cmd__list_view_items__M(WebServerEngineRequest *request)
void cmd__node_activated__M(WebServerEngineRequest *request)
void cmd__selection_changed__M(WebServerEngineRequest *request)