void Window::closeEvent(QCloseEvent *event) { if (exitConfirmation()) event->accept(); else event->ignore(); }
void MainWindow::createShortcuts() { m_LoadShortcut = new QShortcut(QKeySequence(ShortcutKeys::loadShortcutKey), this); connect(m_LoadShortcut, SIGNAL(activated()), this, SLOT(loadCrossword())); m_SaveShortcut = new QShortcut(QKeySequence(ShortcutKeys::saveShortcutKey), this); connect(m_SaveShortcut, SIGNAL(activated()), this, SLOT(saveCrossword())); m_HelpShortcut = new QShortcut(QKeySequence(ShortcutKeys::helpShortcutKey), this); connect(m_HelpShortcut, SIGNAL(activated()), this, SLOT(openHelp())); m_ExitShortcut = new QShortcut(QKeySequence(ShortcutKeys::exitShortcutKey), this); connect(m_ExitShortcut, SIGNAL(activated()), this, SLOT(exitConfirmation())); m_TutorialShortcut = new QShortcut(QKeySequence(ShortcutKeys::tutorialShortcutKey), this); connect(m_TutorialShortcut, SIGNAL(activated()), this, SLOT(openTutorial())); m_EmailAnswersShortcut = new QShortcut(QKeySequence(ShortcutKeys::emailAnswersKey), this); connect(m_EmailAnswersShortcut, SIGNAL(activated()), this, SLOT(emailAnswers())); m_EmailFeedbackShortcut = new QShortcut(QKeySequence(ShortcutKeys::emailFeedbackKey), this); connect(m_EmailFeedbackShortcut, SIGNAL(activated()), this, SLOT(emailFeedback())); m_PrintAnswersShortcut = new QShortcut(QKeySequence(ShortcutKeys::printAnswersKey), this); connect(m_PrintAnswersShortcut, SIGNAL(activated()), this, SLOT(printAnswers())); m_ScoreShortcut = new QShortcut(QKeySequence(ShortcutKeys::markShortcutKey), this); connect(m_ScoreShortcut, SIGNAL(activated()), this, SLOT(scoreCrossword())); m_FilePropertiesShortcut = new QShortcut(QKeySequence(ShortcutKeys::filePropertiesShortcutKey), this); connect(m_FilePropertiesShortcut, SIGNAL(activated()), this, SLOT(showFileProperties())); m_FilterTableViewShortcut = new QShortcut(QKeySequence(ShortcutKeys::filterTableViewShortcutKey), this); connect(m_FilterTableViewShortcut, SIGNAL(activated()), this, SLOT(cycleTableViewFilter())); m_CycleSpeechModeShortcut = new QShortcut(QKeySequence(ShortcutKeys::cycleSpeechModeShortcutKey), this); connect(m_CycleSpeechModeShortcut, SIGNAL(activated()), this, SLOT(cycleSpeechMode())); m_StopSpeechShortcut = new QShortcut(QKeySequence(ShortcutKeys::stopSpeechKey), this); connect(m_StopSpeechShortcut, SIGNAL(activated()), this, SLOT(stopSpeech())); m_ApplicationOpenReminderShortcut = new QShortcut(QKeySequence(ShortcutKeys::toggleApplicationOpenReminderKey), this); connect(m_ApplicationOpenReminderShortcut, SIGNAL(activated()), this, SLOT(toggleApplicationOpenReminder())); m_ReadCurrentClueWordShortcut = new QShortcut(QKeySequence(ShortcutKeys::readCurrentClueWordKey), this); connect(m_ReadCurrentClueWordShortcut, SIGNAL(activated()), this, SLOT(readCurrentWordInClue())); m_AdvanceCurrentClueWordShortcut = new QShortcut(QKeySequence(ShortcutKeys::advanceClueWordKey), this); connect(m_AdvanceCurrentClueWordShortcut, SIGNAL(activated()), this, SLOT(advanceToNextWordInClue())); m_IncreaseSpeechRateShortcut = new QShortcut(QKeySequence(ShortcutKeys::increaseSpeechRateKey), this); connect(m_IncreaseSpeechRateShortcut, SIGNAL(activated()), this, SLOT(increaseSpeechRate())); m_DecreaseSpeechRateShortcut = new QShortcut(QKeySequence(ShortcutKeys::decreaseSpeechRateKey), this); connect(m_DecreaseSpeechRateShortcut, SIGNAL(activated()), this, SLOT(decreaseSpeechRate())); m_ReadLastSpokenPhraseShortcut = new QShortcut(QKeySequence(ShortcutKeys::readLastSpokenPhraseKey), this); connect(m_ReadLastSpokenPhraseShortcut, SIGNAL(activated()), this, SLOT(readLastSpokenPhrase())); m_CycleViewVisibilityShortcut = new QShortcut(QKeySequence(ShortcutKeys::cycleViewVisibilityKey), this); connect(m_CycleViewVisibilityShortcut, SIGNAL(activated()), this, SLOT(cycleViewVisibility())); }