Main element of Shotcut Editor GUI. Each tab presents a shortcut tree of a module. More...
#include <SUIT_ShortcutEditor.h>

Public Member Functions | |
| SUIT_ShortcutTabWidget (const std::set< QString > &theIDsOfModulesToShow, std::shared_ptr< SUIT_ShortcutContainer > theContainer=std::shared_ptr< SUIT_ShortcutContainer >(), QWidget *theParent=nullptr) | |
| SUIT_ShortcutTabWidget & | operator= (const SUIT_ShortcutTree &)=delete |
| virtual | ~SUIT_ShortcutTabWidget () |
| void | setShortcutsFromManager () |
| Copies shortcuts from ShortcutMgr. (Re)displays shortcuts of myModuleIDs. More... | |
| void | setDefaultShortcuts () |
| Copies shortcuts from resources, user files are not accounted. (Re)displays shortcuts of myModuleIDs. More... | |
| void | applyChangesToShortcutMgr () |
| Applies pending changes to ShortcutMgr. Updates other instances of SUIT_ShortcutTabWidget. More... | |
| std::shared_ptr< const SUIT_ShortcutContainer > | shortcutContainer () const |
| void | onTreeItemDoubleClicked (SUIT_ShortcutTree *theTree, SUIT_ShortcutTreeItem *theItem) |
Public Attributes | |
| const std::set< QString > | myModuleIDs |
| Keeps IDs of modules, which will are shown on setShortcutsFromManager(). More... | |
Private Member Functions | |
| void | jumpToTreeItem (const QString &theModuleID, const QString &theInModuleID) |
| std::pair< QString, bool > | getConfirmedKeySequence (const QString &theModuleID, const QString &theInModuleActionID) const |
| void | updateTabs (bool theHighlightModifiedTreeItems, bool theUpdateSyncTabWidgets) |
Private Attributes | |
| const std::shared_ptr< SUIT_ShortcutContainer > | myShortcutContainer |
| Allows to modify plenty of shortcuts and then apply them to SUIT_ShortcutMgr as a batch. More... | |
| SUIT_FindActionWidget * | myFindActionWidget |
| std::map< QString, SUIT_ShortcutTree * > | myModuleTrees |
| {moduleID, SUIT_ShortcutTree}. More... | |
| SUIT_EditKeySequenceDialog * | myEditDialog |
| bool | myIsPopulated |
Static Private Attributes | |
| static std::map< SUIT_ShortcutContainer *, std::set< SUIT_ShortcutTabWidget * > > | instances |
| Ensures that, if several SUIT_ShortcutTab instances coexist, all of them are updated when one of them applies pending changes to SUIT_ShortcutMgr. More... | |
Friends | |
| class | SUIT_ShortcutTree |
Main element of Shotcut Editor GUI. Each tab presents a shortcut tree of a module.
| SUIT_ShortcutTabWidget::SUIT_ShortcutTabWidget | ( | const std::set< QString > & | theIDsOfModulesToShow, |
| std::shared_ptr< SUIT_ShortcutContainer > | theContainer = std::shared_ptr<SUIT_ShortcutContainer>(), |
||
| QWidget * | theParent = nullptr |
||
| ) |
| theContainer | Share the same container between several trees, to edit them synchronously even without exchange of changes with SUIT_ShortcutMgr. Pass nullptr to create non-synchronized tab widget. |
References SUIT_ShortcutMgr::ROOT_MODULE_ID.
|
virtual |
References instances, and myShortcutContainer.
| void SUIT_ShortcutTabWidget::applyChangesToShortcutMgr | ( | ) |
Applies pending changes to ShortcutMgr. Updates other instances of SUIT_ShortcutTabWidget.
References SUIT_ShortcutMgr::get(), instances, and myShortcutContainer.
|
private |
References SUIT_ShortcutMgr::get(), SUIT_ShortcutMgr::getKeySequence(), myModuleTrees, and SUIT_ShortcutMgr::splitIntoTokens().
|
private |
References myModuleTrees, onTreeItemDoubleClicked(), ShCutDbg(), and SUIT_ShortcutMgr::splitIntoTokens().
| void SUIT_ShortcutTabWidget::onTreeItemDoubleClicked | ( | SUIT_ShortcutTree * | theTree, |
| SUIT_ShortcutTreeItem * | theItem | ||
| ) |
{ moduleID, inModuleID }[]
{ moduleID, {inModuleID, keySequence}[] }[]
{inModuleID, newKeySequence}[]
References SUIT_EditKeySequenceDialog::editedKeySequence(), SUIT_EditKeySequenceDialog::exec(), SUIT_ShortcutTree::findItem(), SUIT_ShortcutMgr::get(), SUIT_ShortcutTreeItem::inModuleID(), SUIT_ShortcutTreeItem::isAction(), SUIT_ShortcutTreeItem::keySequence(), SUIT_ShortcutTree::moduleID(), myEditDialog, myFindActionWidget, myModuleTrees, myShortcutContainer, SUIT_ShortcutTree::name(), SUIT_ShortcutTreeItem::path(), SUIT_EditKeySequenceDialog::setConfirmedKeySequence(), SUIT_ShortcutTreeItem::setKeySequence(), SUIT_EditKeySequenceDialog::setModuleAndActionID(), SUIT_EditKeySequenceDialog::setModuleAndActionName(), ShCutDbg(), SUIT_ShortcutMgr::splitIntoTokens(), SUIT_ShortcutTreeItem::styleAsKeySequenceModified(), SUIT_ShortcutTreeItem::toolTip(), SUIT_EditKeySequenceDialog::updateConflictsMessage(), and SUIT_FindActionWidget::updateUI().
|
delete |
| void SUIT_ShortcutTabWidget::setDefaultShortcuts | ( | ) |
Copies shortcuts from resources, user files are not accounted. (Re)displays shortcuts of myModuleIDs.
References SUIT_ShortcutMgr::fillContainerFromPreferences(), myShortcutContainer, and updateTabs().
| void SUIT_ShortcutTabWidget::setShortcutsFromManager | ( | ) |
Copies shortcuts from ShortcutMgr. (Re)displays shortcuts of myModuleIDs.
References SUIT_ShortcutMgr::get(), SUIT_ShortcutMgr::getShortcutContainer(), myShortcutContainer, and updateTabs().
| std::shared_ptr< const SUIT_ShortcutContainer > SUIT_ShortcutTabWidget::shortcutContainer | ( | ) | const |
References myShortcutContainer.
|
private |
| If | theUpdateSyncTabWidgets, ShortcutTabWidgets sharing the same shortcut container are updated. |
References SUIT_ShortcutMgr::currentLang(), SUIT_tools::distanceFromBegin(), SUIT_ShortcutMgr::get(), instances, myFindActionWidget, myIsPopulated, myModuleIDs, myModuleTrees, myShortcutContainer, SUIT_ShortcutTree::name(), SUIT_FindActionWidget::setColumnWidth(), ShCutDbg(), SUIT_ShortcutTree, SUIT_ShortcutTree::toFoundActionTreeColIdx(), SUIT_ShortcutTree::updateItems(), and SUIT_FindActionWidget::updateUI().
|
friend |
|
staticprivate |
Ensures that, if several SUIT_ShortcutTab instances coexist, all of them are updated when one of them applies pending changes to SUIT_ShortcutMgr.
Sharing of SUIT_ShortcutContainer allows to keep trees in tabs synchronized even without applying changes to SUIT_ShortcutMgr. Why? See SUIT_PagePrefShortcutTreeItem.
Access is not synchronized in assumption, that all instances live in the same thread.
|
private |
|
private |
|
private |
| const std::set<QString> SUIT_ShortcutTabWidget::myModuleIDs |
Keeps IDs of modules, which will are shown on setShortcutsFromManager().
|
private |
{moduleID, SUIT_ShortcutTree}.
All tabs share the same SUIT_ShortcutContainer.
|
private |
Allows to modify plenty of shortcuts and then apply them to SUIT_ShortcutMgr as a batch.
Never nullpt.