コード例 #1
0
    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$
コード例 #2
0
ファイル: tools.py プロジェクト: mpm2050/Raven
 def runAction(self, actionContext):
     try:
         parentWindow = actionContext.getParentWindow()
         showRavenSettingsDialog(parentWindow)
     except Exception, e:
         ZShowExceptionMessage(None, e)
コード例 #3
0
ファイル: tools.py プロジェクト: Tidosho/zoundryraven
 def runAction(self, actionContext):
     try:
         parentWindow = actionContext.getParentWindow()
         showRavenSettingsDialog(parentWindow)
     except Exception, e:
         ZShowExceptionMessage(None, e)