mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04: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
@ -69,6 +69,7 @@ d['add_cover_preserve_aspect_ratio'] = False
|
||||
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 @@ class TextEdit(PlainTextEdit):
|
||||
|
||||
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 @@ class EditorSettings(BasicSettings):
|
||||
' 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…
x
Reference in New Issue
Block a user