More stupid PyQt enums

This commit is contained in:
Kovid Goyal 2020-12-19 13:50:30 +05:30
parent 9541725696
commit f1ecafb8e9
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
8 changed files with 18 additions and 18 deletions

View File

@ -303,7 +303,7 @@ class BasicRecipe(QWidget): # {{{
def __init__(self, parent): def __init__(self, parent):
QWidget.__init__(self, parent) QWidget.__init__(self, parent)
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
self.hm = hm = QLabel(_( self.hm = hm = QLabel(_(
'Create a basic news recipe, by adding RSS feeds to it.\n' 'Create a basic news recipe, by adding RSS feeds to it.\n'
@ -354,7 +354,7 @@ class BasicRecipe(QWidget): # {{{
self.afg = afg = QGroupBox(self) self.afg = afg = QGroupBox(self)
afg.setTitle(_('Add feed to recipe')) afg.setTitle(_('Add feed to recipe'))
afg.l = QFormLayout(afg) afg.l = QFormLayout(afg)
afg.l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) afg.l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
self.feed_title = ft = QLineEdit(self) self.feed_title = ft = QLineEdit(self)
afg.l.addRow(_('&Feed title:'), ft) afg.l.addRow(_('&Feed title:'), ft)
self.feed_url = fu = QLineEdit(self) self.feed_url = fu = QLineEdit(self)

View File

@ -38,7 +38,7 @@ class AddSavedSearch(Dialog):
def setup_ui(self): def setup_ui(self):
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.la = la = QLabel(self.label or _( self.la = la = QLabel(self.label or _(
'You can create a <i>Saved search</i>, for frequently used searches here.' 'You can create a <i>Saved search</i>, for frequently used searches here.'

View File

@ -92,7 +92,7 @@ def create_adv_tab(self):
l.addWidget(w.g1), l.addWidget(w.g2), l.addStretch(10) l.addWidget(w.g1), l.addWidget(w.g2), l.addStretch(10)
w.g1.l = l = QFormLayout(w.g1) w.g1.l = l = QFormLayout(w.g1)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
for key, text in ( for key, text in (
('all', _("A&ll these words:")), ('all', _("A&ll these words:")),
('phrase', _("&This exact phrase:")), ('phrase', _("&This exact phrase:")),
@ -103,7 +103,7 @@ def create_adv_tab(self):
l.addRow(text, le) l.addRow(text, le)
w.g2.l = l = QFormLayout(w.g2) w.g2.l = l = QFormLayout(w.g2)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.none = le = QLineEdit(w) self.none = le = QLineEdit(w)
l.addRow(_("Any of these &unwanted words:"), le) 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...")) self.tab_widget.addTab(w, _("Titl&e/author/series..."))
w.l = l = QFormLayout(w) w.l = l = QFormLayout(w)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.title_box = le = QLineEdit(w) self.title_box = le = QLineEdit(w)
le.setObjectName('title_box') le.setObjectName('title_box')
@ -239,7 +239,7 @@ def create_template_tab(self):
self.tab_widget.addTab(w, _("&Template search")) self.tab_widget.addTab(w, _("&Template search"))
w.l = l = QFormLayout(w) w.l = l = QFormLayout(w)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.template_value_box = le = QLineEdit(w) self.template_value_box = le = QLineEdit(w)
le.setObjectName('template_value_box') le.setObjectName('template_value_box')

View File

@ -214,7 +214,7 @@ class ThemeCreateDialog(Dialog):
self.w = w = QGroupBox(_('Theme Metadata'), self) self.w = w = QGroupBox(_('Theme Metadata'), self)
self.splitter.addWidget(w) self.splitter.addWidget(w)
l = w.l = QFormLayout(w) l = w.l = QFormLayout(w)
l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
self.missing_icons_group = mg = QGroupBox(self) self.missing_icons_group = mg = QGroupBox(self)
self.mising_icons = mi = QListWidget(mg) self.mising_icons = mi = QListWidget(mg)
mi.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection) mi.setSelectionMode(QAbstractItemView.SelectionMode.NoSelection)

View File

@ -61,7 +61,7 @@ class DefaultAuthorLink(QWidget): # {{{
l.setContentsMargins(0, 0, 0, 0) l.setContentsMargins(0, 0, 0, 0)
l = QFormLayout(self) l = QFormLayout(self)
l.setContentsMargins(0, 0, 0, 0) l.setContentsMargins(0, 0, 0, 0)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.choices = c = QComboBox() self.choices = c = QComboBox()
c.setMinimumContentsLength(30) c.setMinimumContentsLength(30)
for text, data in [ for text, data in [
@ -125,7 +125,7 @@ class IdLinksRuleEdit(Dialog):
def setup_ui(self): def setup_ui(self):
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
l.addRow(QLabel(_( l.addRow(QLabel(_(
'The key of the identifier, for example, in isbn:XXX, the key is "isbn"'))) 'The key of the identifier, for example, in isbn:XXX, the key is "isbn"')))
self.key = k = QLineEdit(self) self.key = k = QLineEdit(self)

View File

@ -243,7 +243,7 @@ class AdvancedTab(QWidget):
def __init__(self, parent=None): def __init__(self, parent=None):
QWidget.__init__(self, parent) QWidget.__init__(self, parent)
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.widgets = [] self.widgets = []
self.widget_map = {} self.widget_map = {}
self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed) self.setSizePolicy(QSizePolicy.Policy.Expanding, QSizePolicy.Policy.Fixed)
@ -448,7 +448,7 @@ class NewUser(QDialog):
if username else _('Add new user') if username else _('Add new user')
) )
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.uw = u = QLineEdit(self) self.uw = u = QLineEdit(self)
l.addRow(_('&Username:'), u) l.addRow(_('&Username:'), u)
if username: if username:
@ -591,7 +591,7 @@ class ChangeRestriction(QDialog):
self.username = username self.username = username
self._items = [] self._items = []
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.libraries = t = QWidget(self) self.libraries = t = QWidget(self)
t.setObjectName('libraries') t.setObjectName('libraries')
@ -898,7 +898,7 @@ class CustomList(QWidget): # {{{
QWidget.__init__(self, parent) QWidget.__init__(self, parent)
self.default_template = default_custom_list_template() self.default_template = default_custom_list_template()
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.la = la = QLabel('<p>' + _( self.la = la = QLabel('<p>' + _(
'Here you can create a template to control what data is shown when' 'Here you can create a template to control what data is shown when'
' using the <i>Custom list</i> mode for the book list')) ' using the <i>Custom list</i> mode for the book list'))
@ -1029,7 +1029,7 @@ class URLItem(QWidget):
self.changed_signal.connect(parent.changed_signal) self.changed_signal.connect(parent.changed_signal)
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
self.type_widget = t = QComboBox(self) self.type_widget = t = QComboBox(self)
l.setFieldGrowthPolicy(l.ExpandingFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.ExpandingFieldsGrow)
t.addItems([_('Book'), _('Author')]) t.addItems([_('Book'), _('Author')])
l.addRow(_('URL type:'), t) l.addRow(_('URL type:'), t)
self.name_widget = n = QLineEdit(self) self.name_widget = n = QLineEdit(self)

View File

@ -69,7 +69,7 @@ class AddDictionary(QDialog): # {{{
QDialog.__init__(self, parent) QDialog.__init__(self, parent)
self.setWindowTitle(_('Add a dictionary')) self.setWindowTitle(_('Add a dictionary'))
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.setLayout(l) self.setLayout(l)
self.la = la = QLabel('<p>' + _( self.la = la = QLabel('<p>' + _(

View File

@ -188,7 +188,7 @@ class ImportForeign(Dialog): # {{{
def setup_ui(self): def setup_ui(self):
self.l = l = QFormLayout(self) self.l = l = QFormLayout(self)
l.setFieldGrowthPolicy(l.AllNonFixedFieldsGrow) l.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.setLayout(l) self.setLayout(l)
la = self.la = QLabel(_( la = self.la = QLabel(_(
@ -666,7 +666,7 @@ class InsertLink(Dialog):
h.addLayout(fnl), h.setStretch(1, 1) h.addLayout(fnl), h.setStretch(1, 1)
self.tl = tl = QFormLayout() self.tl = tl = QFormLayout()
tl.setFieldGrowthPolicy(tl.AllNonFixedFieldsGrow) tl.setFieldGrowthPolicy(QFormLayout.FieldGrowthPolicy.AllNonFixedFieldsGrow)
self.target = t = QLineEdit(self) self.target = t = QLineEdit(self)
t.setPlaceholderText(_('The destination (href) for the link')) t.setPlaceholderText(_('The destination (href) for the link'))
tl.addRow(_('&Target:'), t) tl.addRow(_('&Target:'), t)