Namespace sh::paneldetails

namespace sh::paneldetails

Infrastructure for panel details.

Can be shown in the bottom part of the main window. Beyond the infrastructure, it also includes some very basic detail providers.

See sh::paneldetails::PanelDetailManager for more.

Enums

enum PanelDetailPositionIndex

Base values for position indexes of panel details.

Values:

enumerator VeryInteresting = 1000000
enumerator Interesting = 2000000
enumerator Exotic = 3000000
class CommonPanelDetails
#include <commonpaneldetails.h>

Implementations of common details provider for the details panel.

Public Static Functions

void doInitialize()
void doShutdown()
void _ViaDetailColumn(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, std::shared_ptr<sh::filesystem::DetailColumn> column, QString keyname, std::function<QString(QVariant)> valtostring)
void NumberOfSelectedItems(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)
void TotalFileSize(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)
void FileType(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
void FileSize(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
void FileModificationTime(std::shared_ptr<PanelDetail> detail, std::shared_ptr<sh::filesystem::FilesystemNode> node, sh::filesystem::Operation *op)
class PanelDetail : public QObject
#include <paneldetailmanager.h>

A detail panel entry.

Is is essentially a list of PanelDetailRow and some layout information.

Public Functions

PanelDetail(int positionIndex, int valueWidthHint)

Constructed only by the infrastructure and made available otherwise.

QList<PanelDetailRow> rows()

Returns the list of detail rows stored in this panel detail.

int positionIndex()

Returns a position index.

It controls the position of this panel detail in relation to the other ones.

int valueWidthHint()

Returns the specified width for the panel detail.

void setRows(QList<PanelDetailRow> rows)

Sets the list of detail rows.

void addRow(PanelDetailRow row)

Adds a new detail row.

void addOrReplaceRow(PanelDetailRow row)

Adds a new detail row (replacing an old one with the same key).

void _emit_linkTriggered(QString link)

Signals

void changed()

Emitted when data has changed.

void linkTriggered(QString link)

Emitted when a link is triggered by the user.

Private Members

QMutex _rowsmutex
QList<PanelDetailRow> _rows
int _positionIndex
int _valueWidthHint
class PanelDetailFactory
#include <paneldetailmanager.h>

Abstract factory for creating panel details for the selected nodes.

Subclassed by sh::paneldetails::PanelDetailFactoryForFunctionMulti, sh::paneldetails::PanelDetailFactoryForFunctionSingle

Public Functions

std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op) = 0
class PanelDetailFactoryForFunctionMulti : public sh::paneldetails::PanelDetailFactory
#include <paneldetailmanager.h>

A factory for creating panel details for more than one selected node.

Subclassed by sh::scripting::api::ApiPanelDetailFactoryMulti

Public Functions

PanelDetailFactoryForFunctionMulti(std::function<void(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation *op)> fctsetvalue, std::function<void(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Constructed only indirectly.

std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)
class PanelDetailFactoryForFunctionSingle : public sh::paneldetails::PanelDetailFactory
#include <paneldetailmanager.h>

A factory for creating panel details for just one selected node.

Subclassed by sh::scripting::api::ApiPanelDetailFactorySingle

Public Functions

PanelDetailFactoryForFunctionSingle(std::function<void(std::shared_ptr<PanelDetail>, std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation *op)> fctsetvalue, std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Constructed only indirectly.

std::shared_ptr<PanelDetail> construct(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes, sh::filesystem::Operation *op)
class PanelDetailManager : public QObject, public sh::base::Singleton
#include <paneldetailmanager.h>

Manager for details provider as used in the details panel.

Register some code and data here for implementing a new provider.

Public Functions

QList<std::shared_ptr<PanelDetail>> getDetails(QList<std::shared_ptr<sh::filesystem::FilesystemNode>> nodes)

Returns a list of PanelDetail for a list of selected filesystem nodes.

std::shared_ptr<PanelDetailFactory> registerFactorySingle(std::shared_ptr<PanelDetailFactory> factory)

Registers a panel detail factory for single selection by PanelDetailFactory instance.

std::shared_ptr<PanelDetailFactory> registerFactoryMulti(std::shared_ptr<PanelDetailFactory> factory)

Registers a panel detail factory for multi selection by PanelDetailFactory instance.

std::shared_ptr<PanelDetailFactory> registerFactorySingle(std::function<void(std::shared_ptr<PanelDetail>, std::shared_ptr<sh::filesystem::FilesystemNode>, sh::filesystem::Operation*)> fctsetvalue, std::function<void(std::shared_ptr<sh::filesystem::FilesystemNode>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Registers a panel detail factory for single selection by parameters.

std::shared_ptr<PanelDetailFactory> registerFactoryMulti(std::function<void(std::shared_ptr<PanelDetail>, QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, sh::filesystem::Operation*)> fctsetvalue, std::function<void(QList<std::shared_ptr<sh::filesystem::FilesystemNode>>, QString link)> fctlinktriggered, int position, int valueWidthHint, )

Registers a panel detail factory for multi selection by parameters.

void doInitialize()

Executes singleton initialization.

void doShutdown()

Executes singleton shutdown.

void shutdown()

Shutdown down this singleton.

bool isAlive()

Returns if this singleton is alive (true until its shutdown begins).

Private Functions

PanelDetailManager()

Private Members

QList<std::shared_ptr<PanelDetailFactory>> _factoriessingle
QList<std::shared_ptr<PanelDetailFactory>> _factoriesmulti
QMutex _mutex
class PanelDetailRow
#include <paneldetailmanager.h>

One pair of label text and value text in a panel detail.

Public Functions

PanelDetailRow(QString key, QList<PanelDetailRowValueElement> value)

Is intended to be directly constructed from everywhere.

PanelDetailRow(QList<PanelDetailRowValueElement> value)

Is intended to be directly constructed from everywhere.

QString key()
QList<PanelDetailRowValueElement> value()

Private Members

QString _key
QList<PanelDetailRowValueElement> _value
class PanelDetailRowValueElement
#include <paneldetailmanager.h>

One element of a detail row’s value.

This can be something like a string, an icon or a link button.

Public Functions

PanelDetailRowValueElement()

A placeholder for a value which is not yet arrived. It could be visualized with a loading animation or ‘…’. Is intended to be directly constructed from everywhere.

PanelDetailRowValueElement(QString text)

A piece of text. Is intended to be directly constructed from everywhere.

PanelDetailRowValueElement(QIcon icon)

An icon. Is intended to be directly constructed from everywhere.

PanelDetailRowValueElement(QString text, QString linktarget, bool autohide)

A link button. Is intended to be directly constructed from everywhere.

QString text()

Returns the text.

QIcon icon()

Returns the icon.

QString linktarget()

Returns the link target.

bool linkautohide()

Returns if this link shall automatically hide (e.g. when the mouse disappears).

bool isWaiting()

Returns if it is currently waiting for an update.

Private Members

QString _text
QIcon _icon
QString _linktarget
bool _linkautohide = false
bool _iswaiting = false