Class sh::actions::ActionActionItem¶
-
class
sh::actions
::
ActionActionItem
: public sh::actions::AbstractActionItem¶ Abstract base class for an executable action.
It can be made visible in menus or the toolbar or executed directly.
Subclasses provide the actual implementation by implementing
action
. Execution can be triggered from outside by callingexecute
.Subclassed by sh::actions::common::ActionAbstractTransferTree, sh::actions::common::ActionAddToBookmarks, sh::actions::common::ActionBookmark, sh::actions::common::ActionClipboardCopy, sh::actions::common::ActionClipboardCut, sh::actions::common::ActionClipboardPaste, sh::actions::common::ActionClipboardPasteAsLink, sh::actions::common::ActionCreateFile, sh::actions::common::ActionCreateFolder, sh::actions::common::ActionDeleteItems, sh::actions::common::ActionExecute, sh::actions::common::ActionManageBookmarks, sh::actions::common::ActionNavigateInHistory, sh::actions::common::ActionOpenArchive, sh::actions::common::ActionOpenDirectoryInNewWindow, sh::actions::common::ActionOpenFile, sh::actions::common::ActionOpenFileWith::_ActionOpenFileWithEntry, sh::actions::common::ActionOpenFileWith::_ActionOpenFileWithUI, sh::actions::common::ActionOpenSharcArchive, sh::actions::common::ActionOpenTerminalAsUser, sh::actions::common::ActionRenameItem, sh::actions::common::ActionShowProperties, sh::actions::common::ActionTransferToHelper, sh::actions::mainmenu::ActionAbout, sh::actions::mainmenu::ActionAbstractSelectNodes, sh::actions::mainmenu::ActionApplyProfile::ActionApplyProfileX, sh::actions::mainmenu::ActionFileViewChangeIconDimension, sh::actions::mainmenu::ActionFileviewFilesizeFormatting, sh::actions::mainmenu::ActionFileviewShowHiddenFiles, sh::actions::mainmenu::ActionFileviewView, sh::actions::mainmenu::ActionGotoDirectory, sh::actions::mainmenu::ActionHelp, sh::actions::mainmenu::ActionManageSavedSettings, sh::actions::mainmenu::ActionNumberFileviews_Add, sh::actions::mainmenu::ActionNumberFileviews_Remove, sh::actions::mainmenu::ActionNumberFileviews_Remove_Current, sh::actions::mainmenu::ActionQuit, sh::actions::mainmenu::ActionRefresh, sh::actions::mainmenu::ActionSaveSettings, sh::actions::mainmenu::ActionSearch, sh::actions::mainmenu::ActionSetWindowTitlePattern, sh::actions::mainmenu::ActionShowDetailPanel, sh::actions::mainmenu::ActionShowFolderTree, sh::actions::mainmenu::ActionShowLog, sh::actions::mainmenu::ActionTreeStickyness, sh::actions::mainmenu::ActionTuning, sh::filepropertydialogtabs::FilePropertyDialogTabExtendedAttributes::ActionAddAttribute, sh::filepropertydialogtabs::FilePropertyDialogTabExtendedAttributes::ActionChangeAttribute, sh::filepropertydialogtabs::FilePropertyDialogTabExtendedAttributes::ActionRemoveAttribute, sh::filepropertydialogtabs::FilePropertyDialogTabUnixPermissions::ActionChange, sh::filesystemhandlers::ActionMountGnomeIOLocation, sh::filesystemhandlers::ActionMountNetworkGnomeIOLocation, sh::filesystemhandlers::ActionUnmountGnomeIOLocation, sh::scripting::api::ApiActionActionItem, sh::scripting::ScriptingEngine::ActionPluginLoadCrashedAgain, sh::search::criteria::ActionAbstractActionDrivenSearchCriterionConfigure
Public Functions
-
ActionActionItem
(QString text, bool enabled = true, QString icon = QString(), int defaultActionPrecedence = 0, bool checkable = false, bool ischecked = false)¶ Is (for subclasses) intended to be directly constructed from everywhere or by registering a factory somewhere.
-
void
execute
()¶ Executes this action.
-
void
execute
(sh::actions::ActionExecutionInfo *info)¶ Executes this action.
-
QKeySequence
shortcuthint
()¶ Returns the keyboard shortcut for triggering this action.
-
bool
shortcuthintTriggersOnCurrentDirectory
()¶ Checks if using the keyboard shortcut shall trigger the action on the current directory (or on the entry selection).
-
void
setShortcuthint
(QKeySequence shortcut, bool triggersOnCurrentDirectory = false)¶ Sets the keyboard shortcut for triggering this action.
-
QString
text
()¶ Returns the displayed text for this action.
-
QString
icon
()¶ Returns the icon for this action.
-
bool
enabled
()¶ Checks if this action is enabled.
-
bool
isChecked
()¶ Checks if this action is checked (has a cross in the ui).
-
bool
isCheckable
()¶ Checks if this action is checkable (can have a cross in the ui).
-
int
defaultActionPrecedence
() const¶ Returns the precedence for becoming the default action of a parent submenu.
This e.g. leads to a bold label.
The action with the highest value becomes the default. Only values >0 will be considered. See ActionDefaultPrecedenceValues for reference values.
-
void
setText
(QString text)¶ Sets the displayed text.
-
void
setIcon
(QString icon)¶ Sets the icon.
-
void
setEnabled
(bool enabled)¶ Sets if the item is enabled.
-
void
setChecked
(bool checked)¶ Sets if the item is checked (has a cross in the ui).
-
void
setVisible
(bool visible)¶ Sets the visibility of this item.
-
bool
visible
()¶ Checks the visibility of this item (non-recursively).
-
std::weak_ptr<AbstractActionItem>
parentAction
()¶ Returns the parent action, if it is added to a container.
Sets the parent action. .
-
void
initializeAsync
(std::function<void()> oninitialized = 0)¶ Asynchonously initializes the action.
-
void
initializeSync
()¶ Synchonously initializes the action.
-
bool
isInitialized
()¶ Checks if this action is initialized.
-
bool
isInitializing
()¶ Checks if this action is initializing.
Signals
-
void
changed
()¶ Emits when some data changed.
-