Skip to content

Commit

Permalink
python formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
jakeprobst committed Jun 11, 2024
1 parent d53e248 commit be92048
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions qt/aqt/preferences.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,20 @@ def setup_collection(self) -> None:
form.showPlayButtons.setChecked(not reviewing.hide_audio_play_buttons)
form.interrupt_audio.setChecked(reviewing.interrupt_audio_when_answering)
form.load_balancer_enable.setChecked(reviewing.load_balancer_enable)
form.load_balancer_avoid_siblings.setChecked(reviewing.load_balancer_avoid_siblings)
form.load_balancer_avoid_siblings.setChecked(
reviewing.load_balancer_avoid_siblings
)
form.load_balancer_per_deck.setChecked(reviewing.load_balancer_per_deck)

form.load_balancer_enable.stateChanged.connect(
lambda: [cb.setEnabled(form.load_balancer_enable.isChecked())
for cb in [form.load_balancer_avoid_siblings, form.load_balancer_per_deck]])
lambda: [
cb.setEnabled(form.load_balancer_enable.isChecked())
for cb in [
form.load_balancer_avoid_siblings,
form.load_balancer_per_deck,
]
]
)
if reviewing.load_balancer_enable:
form.load_balancer_avoid_siblings.setEnabled(True)
form.load_balancer_per_deck.setEnabled(True)
Expand Down Expand Up @@ -161,7 +169,9 @@ def update_collection(self, on_done: Callable[[], None]) -> None:
reviewing.hide_audio_play_buttons = not self.form.showPlayButtons.isChecked()
reviewing.interrupt_audio_when_answering = self.form.interrupt_audio.isChecked()
reviewing.load_balancer_enable = self.form.load_balancer_enable.isChecked()
reviewing.load_balancer_avoid_siblings = self.form.load_balancer_avoid_siblings.isChecked()
reviewing.load_balancer_avoid_siblings = (
self.form.load_balancer_avoid_siblings.isChecked()
)
reviewing.load_balancer_per_deck = self.form.load_balancer_per_deck.isChecked()

editing = self.prefs.editing
Expand Down

0 comments on commit be92048

Please sign in to comment.