Class sh::actions::ActionsManager¶
-
class
sh::actions
::
ActionsManager
: public QObject, public sh::base::Singleton¶ Factory for actions which are valid for a given list of FileSystemNode and tools for placing actions in some gui elements.
Public Functions
Asychonously gets actions for a list of sh::filesystem::FilesystemNode.
- Parameters
nodes
: The list of nodes.callback
: This callback is called once the list is fetched.initializedcallback
: This callback is called for each result action after initialization.
Determines the default action for a given list of actions.
- Parameters
actionList
: The list of all available actions.callback
: This callback is called when the default action was found (with an already initialized action).
Asychonously gets the action for a shortcut.
- Parameters
selectedNodes
: The nodes which are currently selected in the active fileview.folderNode
: The folder which is shown by the active fileview.key
: The keypress character code.modifiers
: The keypress modifiers.callback
: This callback is called when an action was found (with an already initialized action).
Registers an action factory.
This makes an action implementation available in the toolbar and context menus.
-
QList<std::shared_ptr<sh::actions::ActionActionItem>>
runningActions
()¶ Returns a list of all currently running actions.
-
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).
Signals
-
void
runningActionsChanged
()¶ Emitted when the list of running actions changed.
Public Static Functions
Returns a short header label text for a node selection.
Returns a short header label text for a current directory.
Sorts a lists of actionitems and adds separators between groups. Modifies the given list.
Private Functions
-
ActionsManager
()¶
-
void
_emit_runningActionsChanged
()¶
Recursively initializes a list of action items and calls a callback for each action item recursively afterwards.
- Parameters
actions
: List of all action items to traverse.callback
: This callback is called for each action item (even indirectly in a subtree hierarchy).
Internal helper for the public getDefaultAction() method.
Helper for updating _runningactions. .
Private Members
-
QList<std::shared_ptr<sh::actions::AbstractActionFactory>>
_actionfactories
¶
-
QMutex
_mutex_actionfactories
¶
-
QList<std::shared_ptr<sh::actions::ActionActionItem>>
_runningactions
¶
-
QMutex
_mutex_runningactions
¶
Friends
- friend class ActionActionItem
-
struct
GDAHstruct
¶ Internal data structure used for _getDefaultAction_helper();.
Public Members
-
sh::tools::AtomicCounter
counter
¶
-
std::function<void(std::shared_ptr<sh::actions::ActionActionItem>)>
callback
¶
-
int
currentValue
= 0¶
-
QList<std::shared_ptr<sh::actions::AbstractActionItem>>
initialActionList
¶
-
std::shared_ptr<sh::actions::AbstractActionItem>
currentAction
= 0¶
-
sh::tools::AtomicCounter
-
class
RunningActionsCounter
¶ Helper for updating _runningactions. .