Logo Search packages:      
Sourcecode: kanagram version File versions  Download package

void Kanagram::setupActions (  ) [private]

setup the actions and their shortcut keys

Definition at line 197 of file kanagram.cpp.

References m_helpMenu, slotNextAnagram(), slotNextVocabulary(), slotPrevVocabulary(), slotRevealWord(), slotShowSettings(), and slotToggleHint().

Referenced by Kanagram().

{
    m_actionCollection = new KActionCollection(this);

    // next anagram action
    KAction *nextAnagramAction = new KAction(i18n(m_nextText), m_actionCollection);
    nextAnagramAction->setShortcut(Qt::CTRL+Qt::Key_N);
    connect(nextAnagramAction, SIGNAL(triggered(bool)), this, SLOT(slotNextAnagram()));
    m_actionCollection->addAction("nextanagram", nextAnagramAction);

    // hint action needs to not be help, as that conflicts with helpContents for shortcut key
    KAction *showHintAction = new KAction(i18n("Show Hint"), m_actionCollection);
    showHintAction->setShortcut(Qt::CTRL+Qt::Key_H);
    connect(showHintAction, SIGNAL(triggered(bool)), this, SLOT(slotToggleHint()));
    m_actionCollection->addAction("showhint", showHintAction);

    // reveal word action
    KAction *revealWordAction = new KAction(i18n("Reveal Anagram"), m_actionCollection);
    revealWordAction->setShortcut(Qt::CTRL+Qt::Key_R);
    connect(revealWordAction, SIGNAL(triggered(bool)), this, SLOT(slotRevealWord()));
    m_actionCollection->addAction("revealword", revealWordAction);

    // vocabulary actions
    KStandardAction::prior(this, SLOT(slotPrevVocabulary()), m_actionCollection);
    KStandardAction::next(this, SLOT(slotNextVocabulary()), m_actionCollection);

    // help actions
    KStandardAction::aboutApp(m_helpMenu, SLOT(aboutApplication()), m_actionCollection);
    KStandardAction::aboutKDE(m_helpMenu, SLOT(aboutKDE()), m_actionCollection);
    KStandardAction::helpContents(m_helpMenu, SLOT(appHelpActivated()), m_actionCollection);

    // standard actions
    KStandardAction::preferences(this, SLOT(slotShowSettings()), m_actionCollection);
    KStandardAction::quit(this, SLOT(close()), m_actionCollection);


    // load any user-defined changes to shortcuts
    m_actionCollection->readSettings();

    m_actionCollection->addAssociatedWidget(this);
    foreach (QAction* action, m_actionCollection->actions())
        action->setShortcutContext(Qt::WidgetWithChildrenShortcut);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index