mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-07 18:24:30 -04:00
Prevent very long saved searches from making create/edit virtual library dialog too large
This commit is contained in:
parent
c5fb9e75de
commit
e0590843c0
@ -10,7 +10,7 @@ from functools import partial
|
|||||||
|
|
||||||
from PyQt5.Qt import (
|
from PyQt5.Qt import (
|
||||||
Qt, QMenu, QPoint, QIcon, QDialog, QGridLayout, QLabel, QLineEdit, QComboBox,
|
Qt, QMenu, QPoint, QIcon, QDialog, QGridLayout, QLabel, QLineEdit, QComboBox,
|
||||||
QDialogButtonBox, QSize, QVBoxLayout, QListWidget, QRadioButton, QAction)
|
QDialogButtonBox, QSize, QVBoxLayout, QListWidget, QRadioButton, QAction, QTextBrowser)
|
||||||
|
|
||||||
from calibre.gui2 import error_dialog, question_dialog, gprefs
|
from calibre.gui2 import error_dialog, question_dialog, gprefs
|
||||||
from calibre.gui2.dialogs.confirm_delete import confirm
|
from calibre.gui2.dialogs.confirm_delete import confirm
|
||||||
@ -112,9 +112,9 @@ class CreateVirtualLibrary(QDialog): # {{{
|
|||||||
gl.addWidget(self.vl_name, 0, 1)
|
gl.addWidget(self.vl_name, 0, 1)
|
||||||
self.editing = editing
|
self.editing = editing
|
||||||
|
|
||||||
self.saved_searches_label = QLabel('')
|
self.saved_searches_label = sl = QTextBrowser(self)
|
||||||
self.saved_searches_label.setTextInteractionFlags(Qt.TextSelectableByMouse)
|
sl.viewport().setAutoFillBackground(False)
|
||||||
gl.addWidget(self.saved_searches_label, 2, 0, 1, 2)
|
gl.addWidget(sl, 2, 0, 1, 2)
|
||||||
|
|
||||||
self.la2 = la2 = QLabel(_('&Search expression:'))
|
self.la2 = la2 = QLabel(_('&Search expression:'))
|
||||||
gl.addWidget(la2, 1, 0)
|
gl.addWidget(la2, 1, 0)
|
||||||
@ -211,9 +211,9 @@ class CreateVirtualLibrary(QDialog): # {{{
|
|||||||
else:
|
else:
|
||||||
txt = ''
|
txt = ''
|
||||||
if len(searches) > 1:
|
if len(searches) > 1:
|
||||||
self.saved_searches_label.setText('\n'.join(searches))
|
self.saved_searches_label.setPlainText('\n'.join(searches))
|
||||||
else:
|
else:
|
||||||
self.saved_searches_label.setText('')
|
self.saved_searches_label.setPlainText('')
|
||||||
|
|
||||||
def name_text_edited(self, new_name):
|
def name_text_edited(self, new_name):
|
||||||
self.new_name = unicode(new_name)
|
self.new_name = unicode(new_name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user