From f1ecafb8e980b1a0298194bac9cf7721d31792be Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 19 Dec 2020 13:50:30 +0530 Subject: [PATCH] More stupid PyQt enums --- src/calibre/gui2/dialogs/custom_recipes.py | 4 ++-- src/calibre/gui2/dialogs/saved_search_editor.py | 2 +- src/calibre/gui2/dialogs/search.py | 8 ++++---- src/calibre/gui2/icon_theme.py | 2 +- src/calibre/gui2/preferences/look_feel.py | 4 ++-- src/calibre/gui2/preferences/server.py | 10 +++++----- src/calibre/gui2/tweak_book/spell.py | 2 +- src/calibre/gui2/tweak_book/widgets.py | 4 ++-- 8 files changed, 18 insertions(+), 18 deletions(-) diff --git a/src/calibre/gui2/dialogs/custom_recipes.py b/src/calibre/gui2/dialogs/custom_recipes.py index ca6e75ead3..b0009ecd6f 100644 --- a/src/calibre/gui2/dialogs/custom_recipes.py +++ b/src/calibre/gui2/dialogs/custom_recipes.py @@ -303,7 +303,7 @@ class BasicRecipe(QWidget): # {{{ def __init__(self, parent): QWidget.__init__(self, parent) self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) self.hm = hm = QLabel(_( 'Create a basic news recipe, by adding RSS feeds to it.\n' @@ -354,7 +354,7 @@ class BasicRecipe(QWidget): # {{{ self.afg = afg = QGroupBox(self) afg.setTitle(_('Add feed to recipe')) afg.l = QFormLayout(afg) - afg.l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) + afg.l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) self.feed_title = ft = QLineEdit(self) afg.l.addRow(_('&Feed title:'), ft) self.feed_url = fu = QLineEdit(self) diff --git a/src/calibre/gui2/dialogs/saved_search_editor.py b/src/calibre/gui2/dialogs/saved_search_editor.py index df1e42b80b..96b114b1a3 100644 --- a/src/calibre/gui2/dialogs/saved_search_editor.py +++ b/src/calibre/gui2/dialogs/saved_search_editor.py @@ -38,7 +38,7 @@ class AddSavedSearch(Dialog): def setup_ui(self): self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.la = la = QLabel(self.label or _( 'You can create a Saved search, for frequently used searches here.' diff --git a/src/calibre/gui2/dialogs/search.py b/src/calibre/gui2/dialogs/search.py index 58df42f8d5..f05cf20d8f 100644 --- a/src/calibre/gui2/dialogs/search.py +++ b/src/calibre/gui2/dialogs/search.py @@ -92,7 +92,7 @@ def create_adv_tab(self): l.addWidget(w.g1), l.addWidget(w.g2), l.addStretch(10) w.g1.l = l = QFormLayout(w.g1) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) for key, text in ( ('all', _("A&ll these words:")), ('phrase', _("&This exact phrase:")), @@ -103,7 +103,7 @@ def create_adv_tab(self): l.addRow(text, le) w.g2.l = l = QFormLayout(w.g2) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.none = le = QLineEdit(w) l.addRow(_("Any of these &unwanted words:"), le) @@ -113,7 +113,7 @@ def create_simple_tab(self, db): self.tab_widget.addTab(w, _("Titl&e/author/series...")) w.l = l = QFormLayout(w) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.title_box = le = QLineEdit(w) le.setObjectName('title_box') @@ -239,7 +239,7 @@ def create_template_tab(self): self.tab_widget.addTab(w, _("&Template search")) w.l = l = QFormLayout(w) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.template_value_box = le = QLineEdit(w) le.setObjectName('template_value_box') diff --git a/src/calibre/gui2/icon_theme.py b/src/calibre/gui2/icon_theme.py index a58180849a..edd469fb4f 100644 --- a/src/calibre/gui2/icon_theme.py +++ b/src/calibre/gui2/icon_theme.py @@ -214,7 +214,7 @@ class ThemeCreateDialog(Dialog): self.w = w = QGroupBox(_('Theme Metadata'), self) self.splitter.addWidget(w) l = w.l = QFormLayout(w) - l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) self.missing_icons_group = mg = QGroupBox(self) self.mising_icons = mi = QListWidget(mg) mi.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) diff --git a/src/calibre/gui2/preferences/look_feel.py b/src/calibre/gui2/preferences/look_feel.py index 10f14c86a7..ed7d26b013 100644 --- a/src/calibre/gui2/preferences/look_feel.py +++ b/src/calibre/gui2/preferences/look_feel.py @@ -61,7 +61,7 @@ class DefaultAuthorLink(QWidget): # {{{ l.setContentsMargins(0, 0, 0, 0) l = QFormLayout(self) l.setContentsMargins(0, 0, 0, 0) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.choices = c = QComboBox() c.setMinimumContentsLength(30) for text, data in [ @@ -125,7 +125,7 @@ class IdLinksRuleEdit(Dialog): def setup_ui(self): self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) l.addRow(QLabel(_( 'The key of the identifier, for example, in isbn:XXX, the key is "isbn"'))) self.key = k = QLineEdit(self) diff --git a/src/calibre/gui2/preferences/server.py b/src/calibre/gui2/preferences/server.py index c1cb8e981a..5d6d953664 100644 --- a/src/calibre/gui2/preferences/server.py +++ b/src/calibre/gui2/preferences/server.py @@ -243,7 +243,7 @@ class AdvancedTab(QWidget): def __init__(self, parent=None): QWidget.__init__(self, parent) self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.widgets = [] self.widget_map = {} self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) @@ -448,7 +448,7 @@ class NewUser(QDialog): if username else _('Add new user') ) self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.uw = u = QLineEdit(self) l.addRow(_('&Username:'), u) if username: @@ -591,7 +591,7 @@ class ChangeRestriction(QDialog): self.username = username self._items = [] self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.libraries = t = QWidget(self) t.setObjectName('libraries') @@ -898,7 +898,7 @@ class CustomList(QWidget): # {{{ QWidget.__init__(self, parent) self.default_template = default_custom_list_template() self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.la = la = QLabel('

' + _( 'Here you can create a template to control what data is shown when' ' using the Custom list mode for the book list')) @@ -1029,7 +1029,7 @@ class URLItem(QWidget): self.changed_signal.connect(parent.changed_signal) self.l = l = QFormLayout(self) self.type_widget = t = QComboBox(self) - l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow) t.addItems([_('Book'), _('Author')]) l.addRow(_('URL type:'), t) self.name_widget = n = QLineEdit(self) diff --git a/src/calibre/gui2/tweak_book/spell.py b/src/calibre/gui2/tweak_book/spell.py index dfbd80c8ed..312fcbe34a 100644 --- a/src/calibre/gui2/tweak_book/spell.py +++ b/src/calibre/gui2/tweak_book/spell.py @@ -69,7 +69,7 @@ class AddDictionary(QDialog): # {{{ QDialog.__init__(self, parent) self.setWindowTitle(_('Add a dictionary')) self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.setLayout(l) self.la = la = QLabel('

' + _( diff --git a/src/calibre/gui2/tweak_book/widgets.py b/src/calibre/gui2/tweak_book/widgets.py index 4dd08c63d5..4d4963bc37 100644 --- a/src/calibre/gui2/tweak_book/widgets.py +++ b/src/calibre/gui2/tweak_book/widgets.py @@ -188,7 +188,7 @@ class ImportForeign(Dialog): # {{{ def setup_ui(self): self.l = l = QFormLayout(self) - l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) + l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.setLayout(l) la = self.la = QLabel(_( @@ -666,7 +666,7 @@ class InsertLink(Dialog): h.addLayout(fnl), h.setStretch(1, 1) self.tl = tl = QFormLayout() - tl.setFieldGrowthPolicy(tl.AllNonFixedFieldsGrow) + tl.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow) self.target = t = QLineEdit(self) t.setPlaceholderText(_('The destination (href) for the link')) tl.addRow(_('&Target:'), t)