def runSpellCheck(self, parentWindow, spellcheckContext): if spellcheckContext is None: ZShowInfoMessage(parentWindow, _extstr(u"spellcheckuiutil.SpellcheckNotSupported"), _extstr(u"spellcheckdialog.DialogTitle") ) #$NON-NLS-1$ #$NON-NLS-2$ return model = ZSpellCheckModel(spellcheckContext) if not model.isSpellcheckEnabled(): message = _extstr(u"spellcheckuiutil.SpellcheckNotEnabledQuestion") #$NON-NLS-1$ title = _extstr(u"spellcheckdialog.DialogTitle") #$NON-NLS-1$ if ZShowYesNoMessage(parentWindow, message, title ): showRavenSettingsDialog(parentWindow, u"zoundry.appframework.ui.preferences.prefpage.spelling") #$NON-NLS-1$ if not model.isSpellcheckEnabled(): return else: return # Init model model.initializeSpellcheckContext() # check first mispelled word\ spellcheckResult = model.checkNextWord() if spellcheckResult and not spellcheckResult.isFinished(): dialog = ZSpellCheckDialog(parentWindow, model) dialog.ShowModal() dialog.Destroy() spellcheckResult = model.checkNextWord() model.cleanupSpellcheckContext() if spellcheckResult and spellcheckResult.isFinished(): ZShowInfoMessage(parentWindow, _extstr(u"spellcheckuiutil.SpellcheckCompleted"), _extstr(u"spellcheckdialog.DialogTitle") ) #$NON-NLS-1$ #$NON-NLS-2$
def runAction(self, actionContext): try: parentWindow = actionContext.getParentWindow() showRavenSettingsDialog(parentWindow) except Exception, e: ZShowExceptionMessage(None, e)