diff --git a/src/calibre/gui2/tweak_book/__init__.py b/src/calibre/gui2/tweak_book/__init__.py index ccc74956dd..0a49f381d7 100644 --- a/src/calibre/gui2/tweak_book/__init__.py +++ b/src/calibre/gui2/tweak_book/__init__.py @@ -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)} diff --git a/src/calibre/gui2/tweak_book/editor/text.py b/src/calibre/gui2/tweak_book/editor/text.py index 41ead63caa..24698913dd 100644 --- a/src/calibre/gui2/tweak_book/editor/text.py +++ b/src/calibre/gui2/tweak_book/editor/text.py @@ -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) diff --git a/src/calibre/gui2/tweak_book/preferences.py b/src/calibre/gui2/tweak_book/preferences.py index a46dde0a80..1c764848d3 100644 --- a/src/calibre/gui2/tweak_book/preferences.py +++ b/src/calibre/gui2/tweak_book/preferences.py @@ -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('
' + _( + '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)