BibleTime
|
#include <btactioncollection.h>
Public Member Functions | |
QAction & | action (QString const &name) const |
template<typename T > | |
T & | actionAs (QString const &name) const |
QMap< QString, QAction * > const & | actions () const noexcept |
void | addAction (QString const &name, QAction *const action) |
BtActionCollection (QObject *const parent=nullptr) | |
void | readShortcuts (QString const &group) |
Read shortcuts from config. More... | |
void | removeAction (QString const &name) |
void | writeShortcuts (QString const &group) const |
Write shortcuts to config. More... | |
Static Public Member Functions | |
static QKeySequence | getDefaultShortcut (QAction &action) |
Private Attributes | |
QMap< QString, QAction * > | m_actions |
Definition at line 24 of file btactioncollection.h.
|
inline |
Definition at line 30 of file btactioncollection.h.
QAction & BtActionCollection::action | ( | QString const & | name | ) | const |
Definition at line 25 of file btactioncollection.cpp.
References BT_ASSERT, and m_actions.
Referenced by actionAs(), addAction(), getDefaultShortcut(), CDisplayWindow::initAction(), CBibleReadWindow::initActions(), CBookReadWindow::initActions(), CCommentaryReadWindow::initActions(), CDisplayWindow::initToolbars(), BibleTime::retranslateUiActions(), and CDisplayWindow::setupMainWindowToolBars().
|
inline |
Definition at line 44 of file btactioncollection.h.
|
inlinenoexcept |
Definition at line 34 of file btactioncollection.h.
References m_actions.
Referenced by BtShortcutsEditor::BtShortcutsEditor().
void BtActionCollection::addAction | ( | QString const & | name, |
QAction *const | action | ||
) |
Definition at line 31 of file btactioncollection.cpp.
References action(), BT_ASSERT, anonymous_namespace{btactioncollection.cpp}::defaultShortcutPropertyName, and m_actions.
Referenced by CLexiconReadWindow::insertKeyboardActions(), BibleTime::insertKeyboardActions(), CBibleReadWindow::insertKeyboardActions(), CBookReadWindow::insertKeyboardActions(), CCommentaryReadWindow::insertKeyboardActions(), and CDisplayWindow::insertKeyboardActions().
|
static |
Definition at line 53 of file btactioncollection.cpp.
References action(), and anonymous_namespace{btactioncollection.cpp}::defaultShortcutPropertyName.
Referenced by BtShortcutsEditor::BtShortcutsEditor().
void BtActionCollection::readShortcuts | ( | QString const & | group | ) |
Read shortcuts from config.
Read the shortcuts for the given group from the configuration and add them to this action collection.
[in] | group | Shortcut group to read actions from. |
Definition at line 56 of file btactioncollection.cpp.
References btConfig(), BtConfig::getShortcuts(), and m_actions.
Referenced by CAcceleratorSettingsPage::CAcceleratorSettingsPage(), CDisplayWindow::initActions(), CBibleReadWindow::initActions(), CBookReadWindow::initActions(), CCommentaryReadWindow::initActions(), CLexiconReadWindow::initActions(), CDisplayWindow::reload(), CBibleReadWindow::reload(), CCommentaryReadWindow::reload(), CLexiconReadWindow::reload(), and BibleTime::slotSettingsOptions().
void BtActionCollection::removeAction | ( | QString const & | name | ) |
Definition at line 45 of file btactioncollection.cpp.
void BtActionCollection::writeShortcuts | ( | QString const & | group | ) | const |
Write shortcuts to config.
Write the shortcuts of this action collection to the given group in the configuration.
[in] | group | Shortcut group to write actions to. |
Definition at line 64 of file btactioncollection.cpp.
References btConfig(), m_actions, and BtConfig::setShortcuts().
Referenced by CAcceleratorSettingsPage::save().
|
private |
Definition at line 75 of file btactioncollection.h.
Referenced by action(), actions(), addAction(), readShortcuts(), removeAction(), and writeShortcuts().