Merge pull request #1042 from BlueGreenMagick/studydeck-noadd

StudyDeck without add button
This commit is contained in:
Damien Elmes 2021-02-26 14:42:41 +10:00 committed by GitHub
commit 5d578cab03
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -37,8 +37,6 @@ class StudyDeck(QDialog):
geomKey: str = "default", geomKey: str = "default",
) -> None: ) -> None:
QDialog.__init__(self, parent or mw) QDialog.__init__(self, parent or mw)
if buttons is None:
buttons = []
self.mw = mw self.mw = mw
self.form = aqt.forms.studydeck.Ui_Dialog() self.form = aqt.forms.studydeck.Ui_Dialog()
self.form.setupUi(self) self.form.setupUi(self)
@ -52,7 +50,7 @@ class StudyDeck(QDialog):
self.form.buttonBox.removeButton( self.form.buttonBox.removeButton(
self.form.buttonBox.button(QDialogButtonBox.Cancel) self.form.buttonBox.button(QDialogButtonBox.Cancel)
) )
if buttons: if buttons is not None:
for b in buttons: for b in buttons:
self.form.buttonBox.addButton(b, QDialogButtonBox.ActionRole) self.form.buttonBox.addButton(b, QDialogButtonBox.ActionRole)
else: else: