Пример #1
0
 def __init__(self, project, new, parent):
     """
     Constructor
     
     @param project reference to the project object
     @param new flag indicating the generation of a new project
     @param parent parent widget of this dialog (QWidget)
     """
     super(SpellingPropertiesDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.pwlButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.pelButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     self.project = project
     self.parent = parent
     
     self.pwlCompleter = E5FileCompleter(self.pwlEdit)
     self.pelCompleter = E5FileCompleter(self.pelEdit)
     
     from QScintilla.SpellChecker import SpellChecker
     self.spellingComboBox.addItem(self.tr("<default>"))
     self.spellingComboBox.addItems(
         sorted(SpellChecker.getAvailableLanguages()))
     
     if not new:
         self.initDialog()
     
     msh = self.minimumSizeHint()
     self.resize(max(self.width(), msh.width()), msh.height())
 def __init__(self, project, new, parent):
     """
     Constructor
     
     @param project reference to the project object
     @param new flag indicating the generation of a new project
     @param parent parent widget of this dialog (QWidget)
     """
     super(SpellingPropertiesDialog, self).__init__(parent)
     self.setupUi(self)
     
     self.pwlPicker.setMode(E5PathPickerModes.SaveFileMode)
     self.pwlPicker.setDefaultDirectory(project.ppath)
     self.pwlPicker.setFilters(self.tr(
         "Dictionary File (*.dic);;All Files (*)"))
     
     self.pelPicker.setMode(E5PathPickerModes.SaveFileMode)
     self.pelPicker.setDefaultDirectory(project.ppath)
     self.pelPicker.setFilters(self.tr(
         "Dictionary File (*.dic);;All Files (*)"))
     
     self.project = project
     self.parent = parent
     
     from QScintilla.SpellChecker import SpellChecker
     self.spellingComboBox.addItem(self.tr("<default>"))
     self.spellingComboBox.addItems(
         sorted(SpellChecker.getAvailableLanguages()))
     
     if not new:
         self.initDialog()
     
     msh = self.minimumSizeHint()
     self.resize(max(self.width(), msh.width()), msh.height())
 def __init__(self):
     """
     Constructor
     """
     super(EditorSpellCheckingPage, self).__init__()
     self.setupUi(self)
     self.setObjectName("EditorSpellCheckingPage")
     
     self.pwlPicker.setMode(E5PathPickerModes.OpenFileMode)
     self.pwlPicker.setFilters(self.tr(
         "Dictionary File (*.dic);;All Files (*)"))
     
     self.pelPicker.setMode(E5PathPickerModes.OpenFileMode)
     self.pelPicker.setFilters(self.tr(
         "Dictionary File (*.dic);;All Files (*)"))
     
     from QScintilla.SpellChecker import SpellChecker
     languages = sorted(SpellChecker.getAvailableLanguages())
     self.defaultLanguageCombo.addItems(languages)
     if languages:
         self.errorLabel.hide()
     else:
         self.spellingFrame.setEnabled(False)
     
     # set initial values
     self.checkingEnabledCheckBox.setChecked(
         Preferences.getEditor("SpellCheckingEnabled"))
     
     self.defaultLanguageCombo.setCurrentIndex(
         self.defaultLanguageCombo.findText(
             Preferences.getEditor("SpellCheckingDefaultLanguage")))
     
     self.stringsOnlyCheckBox.setChecked(
         Preferences.getEditor("SpellCheckStringsOnly"))
     self.fullCheckUnknownCheckBox.setChecked(
         Preferences.getEditor("FullSpellCheckUnknown"))
     self.minimumWordSizeSlider.setValue(
         Preferences.getEditor("SpellCheckingMinWordSize"))
     self.spellCheckTextFilesLineEdit.setText(
         " ".join(Preferences.getEditor("FullSpellCheckExtensions")))
     
     self.initColour(
         "SpellingMarkers", self.spellingMarkerButton,
         Preferences.getEditorColour, hasAlpha=True)
     
     self.pwlPicker.setText(
         Preferences.getEditor("SpellCheckingPersonalWordList"))
     self.pelPicker.setText(
         Preferences.getEditor("SpellCheckingPersonalExcludeList"))
     
     if self.spellingFrame.isEnabled():
         self.enabledCheckBox.setChecked(
             Preferences.getEditor("AutoSpellCheckingEnabled"))
     else:
         self.enabledCheckBox.setChecked(False)  # not available
     self.chunkSizeSpinBox.setValue(
         Preferences.getEditor("AutoSpellCheckChunkSize"))
Пример #4
0
 def __init__(self):
     """
     Constructor
     """
     super(EditorSpellCheckingPage, self).__init__()
     self.setupUi(self)
     self.setObjectName("EditorSpellCheckingPage")
     
     self.pwlPicker.setMode(E5PathPickerModes.OpenFileMode)
     self.pwlPicker.setFilters(self.tr(
         "Dictionary File (*.dic);;All Files (*)"))
     
     self.pelPicker.setMode(E5PathPickerModes.OpenFileMode)
     self.pelPicker.setFilters(self.tr(
         "Dictionary File (*.dic);;All Files (*)"))
     
     from QScintilla.SpellChecker import SpellChecker
     languages = sorted(SpellChecker.getAvailableLanguages())
     self.defaultLanguageCombo.addItems(languages)
     if languages:
         self.errorLabel.hide()
     else:
         self.spellingFrame.setEnabled(False)
     
     # set initial values
     self.checkingEnabledCheckBox.setChecked(
         Preferences.getEditor("SpellCheckingEnabled"))
     
     self.defaultLanguageCombo.setCurrentIndex(
         self.defaultLanguageCombo.findText(
             Preferences.getEditor("SpellCheckingDefaultLanguage")))
     
     self.stringsOnlyCheckBox.setChecked(
         Preferences.getEditor("SpellCheckStringsOnly"))
     self.minimumWordSizeSlider.setValue(
         Preferences.getEditor("SpellCheckingMinWordSize"))
     
     self.initColour(
         "SpellingMarkers", self.spellingMarkerButton,
         Preferences.getEditorColour, hasAlpha=True)
     
     self.pwlPicker.setText(
         Preferences.getEditor("SpellCheckingPersonalWordList"))
     self.pelPicker.setText(
         Preferences.getEditor("SpellCheckingPersonalExcludeList"))
     
     if self.spellingFrame.isEnabled():
         self.enabledCheckBox.setChecked(
             Preferences.getEditor("AutoSpellCheckingEnabled"))
     else:
         self.enabledCheckBox.setChecked(False)  # not available
     self.chunkSizeSpinBox.setValue(
         Preferences.getEditor("AutoSpellCheckChunkSize"))
Пример #5
0
    def __init__(self):
        """
        Constructor
        """
        super(EditorSpellCheckingPage, self).__init__()
        self.setupUi(self)
        self.setObjectName("EditorSpellCheckingPage")

        self.pwlButton.setIcon(UI.PixmapCache.getIcon("open.png"))
        self.pelButton.setIcon(UI.PixmapCache.getIcon("open.png"))

        from QScintilla.SpellChecker import SpellChecker
        languages = sorted(SpellChecker.getAvailableLanguages())
        self.defaultLanguageCombo.addItems(languages)
        if languages:
            self.errorLabel.hide()
        else:
            self.spellingFrame.setEnabled(False)

        self.pwlFileCompleter = E5FileCompleter(self.pwlEdit, showHidden=True)
        self.pelFileCompleter = E5FileCompleter(self.pelEdit, showHidden=True)

        # set initial values
        self.checkingEnabledCheckBox.setChecked(
            Preferences.getEditor("SpellCheckingEnabled"))

        self.defaultLanguageCombo.setCurrentIndex(
            self.defaultLanguageCombo.findText(
                Preferences.getEditor("SpellCheckingDefaultLanguage")))

        self.stringsOnlyCheckBox.setChecked(
            Preferences.getEditor("SpellCheckStringsOnly"))
        self.minimumWordSizeSlider.setValue(
            Preferences.getEditor("SpellCheckingMinWordSize"))

        self.initColour("SpellingMarkers",
                        self.spellingMarkerButton,
                        Preferences.getEditorColour,
                        hasAlpha=True)

        self.pwlEdit.setText(
            Preferences.getEditor("SpellCheckingPersonalWordList"))
        self.pelEdit.setText(
            Preferences.getEditor("SpellCheckingPersonalExcludeList"))

        if self.spellingFrame.isEnabled():
            self.enabledCheckBox.setChecked(
                Preferences.getEditor("AutoSpellCheckingEnabled"))
        else:
            self.enabledCheckBox.setChecked(False)  # not available
        self.chunkSizeSpinBox.setValue(
            Preferences.getEditor("AutoSpellCheckChunkSize"))
 def __init__(self):
     """
     Constructor
     """
     super(EditorSpellCheckingPage, self).__init__()
     self.setupUi(self)
     self.setObjectName("EditorSpellCheckingPage")
     
     self.pwlButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     self.pelButton.setIcon(UI.PixmapCache.getIcon("open.png"))
     
     from QScintilla.SpellChecker import SpellChecker
     languages = sorted(SpellChecker.getAvailableLanguages())
     self.defaultLanguageCombo.addItems(languages)
     if languages:
         self.errorLabel.hide()
     else:
         self.spellingFrame.setEnabled(False)
     
     self.pwlFileCompleter = E5FileCompleter(self.pwlEdit, showHidden=True)
     self.pelFileCompleter = E5FileCompleter(self.pelEdit, showHidden=True)
     
     # set initial values
     self.checkingEnabledCheckBox.setChecked(
         Preferences.getEditor("SpellCheckingEnabled"))
     
     self.defaultLanguageCombo.setCurrentIndex(
         self.defaultLanguageCombo.findText(
             Preferences.getEditor("SpellCheckingDefaultLanguage")))
     
     self.stringsOnlyCheckBox.setChecked(
         Preferences.getEditor("SpellCheckStringsOnly"))
     self.minimumWordSizeSlider.setValue(
         Preferences.getEditor("SpellCheckingMinWordSize"))
     
     self.initColour(
         "SpellingMarkers", self.spellingMarkerButton,
         Preferences.getEditorColour, hasAlpha=True)
     
     self.pwlEdit.setText(
         Preferences.getEditor("SpellCheckingPersonalWordList"))
     self.pelEdit.setText(
         Preferences.getEditor("SpellCheckingPersonalExcludeList"))
     
     if self.spellingFrame.isEnabled():
         self.enabledCheckBox.setChecked(
             Preferences.getEditor("AutoSpellCheckingEnabled"))
     else:
         self.enabledCheckBox.setChecked(False)  # not available
     self.chunkSizeSpinBox.setValue(
         Preferences.getEditor("AutoSpellCheckChunkSize"))
 def __init__(self):
     """
     Constructor
     """
     ConfigurationPageBase.__init__(self)
     self.setupUi(self)
     self.setObjectName("EditorSpellCheckingPage")
     
     self.editorColours = {}
     
     languages = sorted(SpellChecker.getAvailableLanguages())
     self.defaultLanguageCombo.addItems(languages)
     if languages:
         self.errorLabel.hide()
     else:
         self.spellingFrame.setEnabled(False)
     
     self.pwlFileCompleter = E4FileCompleter(self.pwlEdit, showHidden = True)
     self.pelFileCompleter = E4FileCompleter(self.pelEdit, showHidden = True)
     
     # set initial values
     self.checkingEnabledCheckBox.setChecked(
         Preferences.getEditor("SpellCheckingEnabled"))
     
     self.defaultLanguageCombo.setCurrentIndex(
         self.defaultLanguageCombo.findText(
             Preferences.getEditor("SpellCheckingDefaultLanguage")))
     
     self.stringsOnlyCheckBox.setChecked(
         Preferences.getEditor("SpellCheckStringsOnly"))
     self.minimumWordSizeSlider.setValue(
         Preferences.getEditor("SpellCheckingMinWordSize"))
     
     self.editorColours["SpellingMarkers"] = \
         self.initColour("SpellingMarkers", self.spellingMarkerButton, 
             Preferences.getEditorColour)
     
     self.pwlEdit.setText(Preferences.getEditor("SpellCheckingPersonalWordList"))
     self.pelEdit.setText(Preferences.getEditor("SpellCheckingPersonalExcludeList"))
     
     if self.spellingFrame.isEnabled():
         self.enabledCheckBox.setChecked(\
             Preferences.getEditor("AutoSpellCheckingEnabled"))
     else:
         self.enabledCheckBox.setChecked(False)  # not available
     self.chunkSizeSpinBox.setValue(Preferences.getEditor("AutoSpellCheckChunkSize"))
 def __init__(self, project, new, parent):
     """
     Constructor
     
     @param project reference to the project object
     @param new flag indicating the generation of a new project
     @param parent parent widget of this dialog (QWidget)
     """
     QDialog.__init__(self, parent)
     self.setupUi(self)
     
     self.project = project
     self.parent = parent
     
     self.pwlCompleter = E4FileCompleter(self.pwlEdit)
     self.pelCompleter = E4FileCompleter(self.pelEdit)
     
     projectSpellings = QStringList(self.trUtf8("<default>"))
     for language in sorted(SpellChecker.getAvailableLanguages()):
         projectSpellings.append(language)
     self.spellingComboBox.addItems(projectSpellings)
     
     if not new:
         self.initDialog()