mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Integrate the dictionary widget into the editor preferences
This commit is contained in:
parent
bcadc7673d
commit
56ef487a5d
@ -117,6 +117,9 @@ class Boss(QObject):
|
||||
ed.apply_settings()
|
||||
setup_cssutils_serialization()
|
||||
self.gui.apply_settings()
|
||||
if p.dictionaries_changed:
|
||||
pass # TODO: Clear dictionary caches and rerun syntax highlighting in
|
||||
# all open editors so that spellings are updated
|
||||
|
||||
def mark_requested(self, name, action):
|
||||
self.commit_dirty_opf()
|
||||
|
@ -14,11 +14,13 @@ from itertools import product
|
||||
from PyQt4.Qt import (
|
||||
QDialog, QGridLayout, QStackedWidget, QDialogButtonBox, QListWidget,
|
||||
QListWidgetItem, QIcon, QWidget, QSize, QFormLayout, Qt, QSpinBox,
|
||||
QCheckBox, pyqtSignal, QDoubleSpinBox, QComboBox, QLabel, QFont, QFontComboBox)
|
||||
QCheckBox, pyqtSignal, QDoubleSpinBox, QComboBox, QLabel, QFont,
|
||||
QFontComboBox, QPushButton, QSizePolicy)
|
||||
|
||||
from calibre.gui2.keyboard import ShortcutConfig
|
||||
from calibre.gui2.tweak_book import tprefs
|
||||
from calibre.gui2.tweak_book.editor.themes import default_theme, THEMES
|
||||
from calibre.gui2.tweak_book.spell import ManageDictionaries
|
||||
from calibre.gui2.font_family_chooser import FontFamilyChooser
|
||||
|
||||
class BasicSettings(QWidget): # {{{
|
||||
@ -146,6 +148,7 @@ class EditorSettings(BasicSettings):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
BasicSettings.__init__(self, parent)
|
||||
self.dictionaries_changed = False
|
||||
self.l = l = QFormLayout(self)
|
||||
self.setLayout(l)
|
||||
|
||||
@ -191,6 +194,16 @@ class EditorSettings(BasicSettings):
|
||||
' time you open a HTML/CSS/etc. file for editing.'))
|
||||
l.addRow(lw)
|
||||
|
||||
self.dictionaries = d = QPushButton(_('Manage &spelling dictionaries'), self)
|
||||
d.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||
d.clicked.connect(self.manage_dictionaries)
|
||||
l.addRow(d)
|
||||
|
||||
def manage_dictionaries(self):
|
||||
d = ManageDictionaries(self)
|
||||
d.exec_()
|
||||
self.dictionaries_changed = True
|
||||
|
||||
class IntegrationSettings(BasicSettings):
|
||||
|
||||
def __init__(self, parent=None):
|
||||
@ -338,6 +351,10 @@ class Preferences(QDialog):
|
||||
cl.setMaximumWidth(cl.sizeHintForColumn(0) + 35)
|
||||
cl.setHorizontalScrollBarPolicy(Qt.ScrollBarAlwaysOff)
|
||||
|
||||
@property
|
||||
def dictionaries_changed(self):
|
||||
return self.editor_panel.dictionaries_changed
|
||||
|
||||
def restore_all_defaults(self):
|
||||
for i in xrange(self.stacks.count()):
|
||||
w = self.stacks.widget(i)
|
||||
|
Loading…
x
Reference in New Issue
Block a user