From 865a064dd307e7433654093c308045f94ac2fe3b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 19 Dec 2020 10:36:33 +0530 Subject: [PATCH] More stupid PyQt enums --- src/calibre/gui2/css_transform_rules.py | 4 ++-- src/calibre/gui2/jobs.py | 2 +- src/calibre/gui2/open_with.py | 2 +- src/calibre/gui2/tag_mapper.py | 2 +- src/calibre/gui2/tweak_book/char_select.py | 2 +- src/calibre/gui2/tweak_book/check_links.py | 2 +- src/calibre/gui2/tweak_book/diff/main.py | 2 +- src/calibre/gui2/tweak_book/function_replace.py | 2 +- src/calibre/gui2/tweak_book/manage_fonts.py | 2 +- src/calibre/gui2/tweak_book/reports.py | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/calibre/gui2/css_transform_rules.py b/src/calibre/gui2/css_transform_rules.py index 7ea9923371..612befc8a4 100644 --- a/src/calibre/gui2/css_transform_rules.py +++ b/src/calibre/gui2/css_transform_rules.py @@ -5,7 +5,7 @@ from PyQt5.Qt import ( QWidget, QVBoxLayout, QHBoxLayout, QLabel, QComboBox, QLineEdit, - QPushButton, QSize, pyqtSignal, QMenu + QPushButton, QSize, pyqtSignal, QMenu, QDialogButtonBox ) from calibre.ebooks.css_transform_rules import ( @@ -204,7 +204,7 @@ class Tester(Dialog): # {{{ def setup_ui(self): from calibre.gui2.tweak_book.editor.text import TextEdit self.l = l = QVBoxLayout(self) - self.bb.setStandardButtons(self.bb.Close) + self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) self.la = la = QLabel(self.LABEL) l.addWidget(la) self.css = t = TextEdit(self) diff --git a/src/calibre/gui2/jobs.py b/src/calibre/gui2/jobs.py index 850835b373..e7d44056ec 100644 --- a/src/calibre/gui2/jobs.py +++ b/src/calibre/gui2/jobs.py @@ -464,7 +464,7 @@ class DetailView(Dialog): # {{{ w.setReadOnly(True), w.setLineWrapMode(w.NoWrap) l.addWidget(w) l.addWidget(self.bb) - self.bb.clear(), self.bb.setStandardButtons(self.bb.Close) + self.bb.clear(), self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) self.copy_button = b = self.bb.addButton(_('&Copy to clipboard'), QDialogButtonBox.ButtonRole.ActionRole) b.setIcon(QIcon(I('edit-copy.png'))) b.clicked.connect(self.copy_to_clipboard) diff --git a/src/calibre/gui2/open_with.py b/src/calibre/gui2/open_with.py index 2d5e758f21..afe38f57e5 100644 --- a/src/calibre/gui2/open_with.py +++ b/src/calibre/gui2/open_with.py @@ -400,7 +400,7 @@ class EditPrograms(Dialog): # {{{ pl.setIconSize(QSize(48, 48)), pl.setSpacing(5) l.addWidget(pl) - self.bb.clear(), self.bb.setStandardButtons(self.bb.Close) + self.bb.clear(), self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) self.rb = b = self.bb.addButton(_('&Remove'), QDialogButtonBox.ButtonRole.ActionRole) b.clicked.connect(self.remove), b.setIcon(QIcon(I('list_remove.png'))) self.cb = b = self.bb.addButton(_('Change &icon'), QDialogButtonBox.ButtonRole.ActionRole) diff --git a/src/calibre/gui2/tag_mapper.py b/src/calibre/gui2/tag_mapper.py index 8a51368f8f..8eacc1e6ea 100644 --- a/src/calibre/gui2/tag_mapper.py +++ b/src/calibre/gui2/tag_mapper.py @@ -398,7 +398,7 @@ class Tester(Dialog): def setup_ui(self): self.l = l = QVBoxLayout(self) - self.bb.setStandardButtons(self.bb.Close) + self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) self.la = la = QLabel(self.LABEL) l.addWidget(la) self.tags = t = QLineEdit(self) diff --git a/src/calibre/gui2/tweak_book/char_select.py b/src/calibre/gui2/tweak_book/char_select.py index 2acef50575..27d0252b3d 100644 --- a/src/calibre/gui2/tweak_book/char_select.py +++ b/src/calibre/gui2/tweak_book/char_select.py @@ -703,7 +703,7 @@ class CharSelect(Dialog): self.l = l = QGridLayout(self) self.setLayout(l) - self.bb.setStandardButtons(self.bb.Close) + self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) self.rearrange_button = b = self.bb.addButton(_('Re-arrange favorites'), QDialogButtonBox.ButtonRole.ActionRole) b.setCheckable(True) b.setChecked(False) diff --git a/src/calibre/gui2/tweak_book/check_links.py b/src/calibre/gui2/tweak_book/check_links.py index b707ce10e5..dd8e4b0e70 100644 --- a/src/calibre/gui2/tweak_book/check_links.py +++ b/src/calibre/gui2/tweak_book/check_links.py @@ -83,7 +83,7 @@ class CheckExternalLinks(Dialog): ca.stateChanged.connect(self.anchors_changed) h.addWidget(ca), h.addStretch(100), h.addWidget(self.bb) l.addLayout(h) - self.bb.setStandardButtons(self.bb.Close) + self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) self.rb = b = self.bb.addButton(_('&Refresh'), QDialogButtonBox.ButtonRole.ActionRole) b.setIcon(QIcon(I('view-refresh.png'))) b.clicked.connect(self.refresh) diff --git a/src/calibre/gui2/tweak_book/diff/main.py b/src/calibre/gui2/tweak_book/diff/main.py index 26f8cf082e..6b13309ba2 100644 --- a/src/calibre/gui2/tweak_book/diff/main.py +++ b/src/calibre/gui2/tweak_book/diff/main.py @@ -297,7 +297,7 @@ class Diff(Dialog): self.names = QLabel('') self.hl.addWidget(self.names, r) - self.bb.setStandardButtons(self.bb.Close) + self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) if self.revert_button_msg is not None: self.rvb = b = self.bb.addButton(self.revert_button_msg, QDialogButtonBox.ButtonRole.ActionRole) b.setIcon(QIcon(I('edit-undo.png'))), b.setAutoDefault(False) diff --git a/src/calibre/gui2/tweak_book/function_replace.py b/src/calibre/gui2/tweak_book/function_replace.py index 7a4bd63c7d..a51683770b 100644 --- a/src/calibre/gui2/tweak_book/function_replace.py +++ b/src/calibre/gui2/tweak_book/function_replace.py @@ -116,7 +116,7 @@ class DebugOutput(Dialog): self.log_text = '' l.addWidget(t) l.addWidget(self.bb) - self.bb.setStandardButtons(self.bb.Close) + self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) self.cb = b = self.bb.addButton(_('&Copy to clipboard'), QDialogButtonBox.ButtonRole.ActionRole) b.clicked.connect(self.copy_to_clipboard) b.setIcon(QIcon(I('edit-copy.png'))) diff --git a/src/calibre/gui2/tweak_book/manage_fonts.py b/src/calibre/gui2/tweak_book/manage_fonts.py index c020a6d616..4d2e806f99 100644 --- a/src/calibre/gui2/tweak_book/manage_fonts.py +++ b/src/calibre/gui2/tweak_book/manage_fonts.py @@ -76,7 +76,7 @@ class EmbeddingData(Dialog): self.text = t = QTextEdit(self) t.setReadOnly(True) l.addWidget(t), l.addWidget(self.bb) - self.bb.clear(), self.bb.setStandardButtons(self.bb.Close) + self.bb.clear(), self.bb.setStandardButtons(QDialogButtonBox.StandardButton.Close) def populate_text(self): text = ['

' + self.windowTitle() + '