Version: 9.15.0
SUIT_ShortcutTabWidget Class Reference

Main element of Shotcut Editor GUI. Each tab presents a shortcut tree of a module. More...

#include <SUIT_ShortcutEditor.h>

Inheritance diagram for SUIT_ShortcutTabWidget:
Inheritance graph

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_ShortcutTabWidgetoperator= (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_ShortcutContainershortcutContainer () 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_ShortcutContainermyShortcutContainer
 Allows to modify plenty of shortcuts and then apply them to SUIT_ShortcutMgr as a batch. More...
 
SUIT_FindActionWidgetmyFindActionWidget
 
std::map< QString, SUIT_ShortcutTree * > myModuleTrees
 {moduleID, SUIT_ShortcutTree}. More...
 
SUIT_EditKeySequenceDialogmyEditDialog
 
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
 

Detailed Description

Main element of Shotcut Editor GUI. Each tab presents a shortcut tree of a module.

Constructor & Destructor Documentation

◆ SUIT_ShortcutTabWidget()

SUIT_ShortcutTabWidget::SUIT_ShortcutTabWidget ( const std::set< QString > &  theIDsOfModulesToShow,
std::shared_ptr< SUIT_ShortcutContainer theContainer = std::shared_ptr<SUIT_ShortcutContainer>(),
QWidget theParent = nullptr 
)
Parameters
theContainerShare 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.

◆ ~SUIT_ShortcutTabWidget()

SUIT_ShortcutTabWidget::~SUIT_ShortcutTabWidget ( )
virtual

References instances, and myShortcutContainer.

Member Function Documentation

◆ applyChangesToShortcutMgr()

void SUIT_ShortcutTabWidget::applyChangesToShortcutMgr ( )

Applies pending changes to ShortcutMgr. Updates other instances of SUIT_ShortcutTabWidget.

References SUIT_ShortcutMgr::get(), instances, and myShortcutContainer.

◆ getConfirmedKeySequence()

std::pair< QString, bool > SUIT_ShortcutTabWidget::getConfirmedKeySequence ( const QString &  theModuleID,
const QString &  theInModuleActionID 
) const
private
Returns
Key sequence from the tree and true, if it differs from a keysequence in ShortcutMgr (applied key sequence).

References SUIT_ShortcutMgr::get(), SUIT_ShortcutMgr::getKeySequence(), myModuleTrees, and SUIT_ShortcutMgr::splitIntoTokens().

◆ jumpToTreeItem()

void SUIT_ShortcutTabWidget::jumpToTreeItem ( const QString &  theModuleID,
const QString &  theInModuleID 
)
private

◆ onTreeItemDoubleClicked()

◆ operator=()

SUIT_ShortcutTabWidget& SUIT_ShortcutTabWidget::operator= ( const SUIT_ShortcutTree )
delete

◆ setDefaultShortcuts()

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().

◆ setShortcutsFromManager()

void SUIT_ShortcutTabWidget::setShortcutsFromManager ( )

Copies shortcuts from ShortcutMgr. (Re)displays shortcuts of myModuleIDs.

References SUIT_ShortcutMgr::get(), SUIT_ShortcutMgr::getShortcutContainer(), myShortcutContainer, and updateTabs().

◆ shortcutContainer()

std::shared_ptr< const SUIT_ShortcutContainer > SUIT_ShortcutTabWidget::shortcutContainer ( ) const

References myShortcutContainer.

◆ updateTabs()

void SUIT_ShortcutTabWidget::updateTabs ( bool  theHighlightModifiedTreeItems,
bool  theUpdateSyncTabWidgets 
)
private

Friends And Related Function Documentation

◆ SUIT_ShortcutTree

friend class SUIT_ShortcutTree
friend

Member Data Documentation

◆ instances

std::map< SUIT_ShortcutContainer *, std::set< SUIT_ShortcutTabWidget * > > SUIT_ShortcutTabWidget::instances
staticprivate
Initial value:
=
std::map<SUIT_ShortcutContainer*, std::set<SUIT_ShortcutTabWidget*>>()

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.

◆ myEditDialog

SUIT_EditKeySequenceDialog* SUIT_ShortcutTabWidget::myEditDialog
private

◆ myFindActionWidget

SUIT_FindActionWidget* SUIT_ShortcutTabWidget::myFindActionWidget
private

◆ myIsPopulated

bool SUIT_ShortcutTabWidget::myIsPopulated
private

◆ myModuleIDs

const std::set<QString> SUIT_ShortcutTabWidget::myModuleIDs

Keeps IDs of modules, which will are shown on setShortcutsFromManager().

◆ myModuleTrees

std::map<QString, SUIT_ShortcutTree*> SUIT_ShortcutTabWidget::myModuleTrees
private

{moduleID, SUIT_ShortcutTree}.

All tabs share the same SUIT_ShortcutContainer.

◆ myShortcutContainer

const std::shared_ptr<SUIT_ShortcutContainer> SUIT_ShortcutTabWidget::myShortcutContainer
private

Allows to modify plenty of shortcuts and then apply them to SUIT_ShortcutMgr as a batch.

Never nullpt.


The documentation for this class was generated from the following files: