mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-09 09:03:07 +02:00
Edit Book: Add an option to turn off drag and drop editing of text (Preferences->Editor)
This commit is contained in:
parent
9759944cc8
commit
f95ddb76fd
3 changed files with 9 additions and 0 deletions
|
|
@ -69,6 +69,7 @@
|
|||
d['templates'] = {}
|
||||
d['auto_close_tags'] = True
|
||||
d['restore_book_state'] = True
|
||||
d['editor_accepts_drops'] = True
|
||||
del d
|
||||
|
||||
ucase_map = {l:string.ascii_uppercase[i] for i, l in enumerate(string.ascii_lowercase)}
|
||||
|
|
|
|||
|
|
@ -119,6 +119,7 @@ def sizeHint(self):
|
|||
|
||||
def apply_settings(self, prefs=None, dictionaries_changed=False): # {{{
|
||||
prefs = prefs or tprefs
|
||||
self.setAcceptDrops(prefs.get('editor_accepts_drops', True))
|
||||
self.setLineWrapMode(QPlainTextEdit.WidgetWidth if prefs['editor_line_wrap'] else QPlainTextEdit.NoWrap)
|
||||
theme = get_theme(prefs['editor_theme'])
|
||||
self.apply_theme(theme)
|
||||
|
|
|
|||
|
|
@ -220,6 +220,13 @@ def __init__(self, parent=None):
|
|||
' for easy correction as you type.'))
|
||||
l.addRow(lw)
|
||||
|
||||
lw = self('editor_accepts_drops')
|
||||
lw.setText(_('Allow drag and drop editing of text'))
|
||||
lw.setToolTip('<p>' + _(
|
||||
'Allow using drag and drop to move text around in the editor.'
|
||||
' It can be useful to turn this off if you have a misbehaving touchpad.'))
|
||||
l.addRow(lw)
|
||||
|
||||
self.dictionaries = d = QPushButton(_('Manage &spelling dictionaries'), self)
|
||||
d.setSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed)
|
||||
d.clicked.connect(self.manage_dictionaries)
|
||||
|
|
|
|||
Loading…
Reference in a new issue