Skip to content

Commit

Permalink
Add more Qt6 qualifying
Browse files Browse the repository at this point in the history
  • Loading branch information
hgiesel authored and MinmoTech committed Jun 27, 2023
1 parent b4625c2 commit c4e7d40
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion addon/bridge_actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def arg_from(i):
if reviewer:
aqt.mw.requireReset()
r = CustomKeywordsDialog(character, parent).exec()
if r == QDialog.Accepted:
if r == QDialog.DialogCode.Accepted:
if reviewer:
aqt.mw.maybeReset()
else:
Expand Down
18 changes: 13 additions & 5 deletions addon/create_cards_from_notes_dialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
import aqt
from aqt.qt import *
from aqt.qt import (
QDialog,
QVBoxLayout,
QLabel,
QListWidget,
QListWidgetItem,
QDialogButtonBox,
Qt,
)

import anki.find

Expand Down Expand Up @@ -41,9 +49,9 @@ def __init__(self, note_ids, parent=None):
for field_name in anki.find.fieldNamesForNotes(aqt.mw.col, note_ids):
itm = QListWidgetItem(field_name)
itm.setCheckState(
Qt.Checked
Qt.CheckState.Checked
if (field_name in last_checked and last_checked[field_name])
else Qt.Unchecked
else Qt.CheckState.Unchecked
)
self.list_box.addItem(itm)
lyt.addWidget(self.list_box)
Expand Down Expand Up @@ -86,14 +94,14 @@ def create_cards(self):
new_kanji = aqt.mw.migaku_kanji_db.new_characters(card_type, kanji)

if len(new_kanji):
r = aqt.qt.QMessageBox.question(
response = aqt.qt.QMessageBox.question(
self,
"Migaku Kanji",
f"Do you want to create kanji {card_type.label} cards for these kanji?\n\n"
+ " ".join(new_kanji),
)

if r == aqt.qt.QMessageBox.StandardButton.Yes:
if response == aqt.qt.QMessageBox.StandardButton.Yes:
util.error_msg_on_error(
self,
aqt.mw.migaku_kanji_db.make_cards_from_characters,
Expand Down
4 changes: 2 additions & 2 deletions addon/mark_known_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def __init__(self, note_ids, parent=None):
self.list_box = QListWidget()
for field_name in anki.find.fieldNamesForNotes(aqt.mw.col, note_ids):
itm = QListWidgetItem(field_name)
itm.setCheckState(Qt.Unchecked)
itm.setCheckState(Qt.CheckState.Unchecked)
self.list_box.addItem(itm)
lyt.addWidget(self.list_box)

Expand Down Expand Up @@ -182,7 +182,7 @@ def on_ok(self):

dlg = MarkKnownDialog(kanji, self)
r = dlg.exec()
if r == QDialog.Accepted:
if r == QDialog.DialogCode.Accepted:
self.accept()

@classmethod
Expand Down

0 comments on commit c4e7d40

Please sign in to comment.