From cb5f6c7f31a05c1d423f2a06c5a850655668b582 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sun, 26 Apr 2020 16:37:18 +0530 Subject: [PATCH] Fix #1875119 [[Enhancement - Viewer] Edit lookup sources](https://bugs.launchpad.net/calibre/+bug/1875119) --- src/calibre/gui2/viewer/lookup.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/viewer/lookup.py b/src/calibre/gui2/viewer/lookup.py index 09eb3cca4c..10187fab7c 100644 --- a/src/calibre/gui2/viewer/lookup.py +++ b/src/calibre/gui2/viewer/lookup.py @@ -6,7 +6,6 @@ from __future__ import absolute_import, division, print_function, unicode_litera import os import sys -import textwrap from PyQt5.Qt import ( QApplication, QComboBox, QDialog, QDialogButtonBox, QFormLayout, QHBoxLayout, @@ -57,6 +56,7 @@ class SourceEditor(Dialog): self.initial_name = source_to_edit['name'] self.initial_url = source_to_edit['url'] Dialog.__init__(self, _('Edit lookup source'), 'viewer-edit-lookup-location', parent=parent) + self.resize(self.sizeHint()) def setup_ui(self): self.l = l = QFormLayout(self) @@ -70,11 +70,13 @@ class SourceEditor(Dialog): self.url_edit = u = QLineEdit(self) u.setPlaceholderText(_('The URL template of the source')) u.setMinimumWidth(n.minimumWidth()) - u.setToolTip(textwrap.fill(_( - 'The URL template must starts with https:// and have {word} in it which will be replaced by the actual query'))) l.addRow(_('&URL:'), u) if self.initial_url: u.setText(self.initial_url) + la = QLabel(_( + 'The URL template must starts with https:// and have {word} in it which will be replaced by the actual query')) + la.setWordWrap(True) + l.addRow(la) l.addRow(self.bb) if self.initial_name: u.setFocus(Qt.OtherFocusReason)