Skip to content

Commit

Permalink
render() conflicts with Qt method
Browse files Browse the repository at this point in the history
  • Loading branch information
dae committed Apr 2, 2020
1 parent de79087 commit 4790fec
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion qt/aqt/browser.py
Original file line number Diff line number Diff line change
Expand Up @@ -1572,7 +1572,7 @@ def onTogglePreview(self):

def _renderPreview(self, cardChanged=False):
if self._previewer:
self._previewer.render(cardChanged)
self._previewer.render_card(cardChanged)

def _cancelPreviewTimer(self):
if self._previewer:
Expand Down
18 changes: 9 additions & 9 deletions qt/aqt/previewer.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def open(self):
self._last_state = None
self._create_gui()
self._setup_web_view()
self.render(True)
self.render_card(True)
self.show()

def _create_gui(self):
Expand Down Expand Up @@ -109,7 +109,7 @@ def _on_bridge_cmd(self, cmd: str) -> Any:
if cmd.startswith("play:"):
play_clicked_audio(cmd, self.card())

def render(self, cardChanged=False):
def render_card(self, cardChanged=False):
self.cancel_timer()
# Keep track of whether render() has ever been called
# with cardChanged=True since the last successful render
Expand Down Expand Up @@ -191,7 +191,7 @@ def _on_show_both_sides(self, toggle):
self.mw.col.setMod()
if self._state == "answer" and not toggle:
self._state = "question"
self.render()
self.render_card()

def _state_and_mod(self):
c = self.card()
Expand Down Expand Up @@ -223,7 +223,7 @@ def _create_gui(self):
def _on_prev(self):
if self._state == "answer" and not self._show_both_sides:
self._state = "question"
self.render()
self.render_card()
else:
self._on_prev_card()

Expand All @@ -233,7 +233,7 @@ def _on_prev_card(self):
def _on_next(self):
if self._state == "question":
self._state = "answer"
self.render()
self.render_card()
else:
self._on_next_card()

Expand Down Expand Up @@ -325,11 +325,11 @@ def open(self):

def _on_prev_card(self):
self.index -= 1
self.render()
self.render_card()

def _on_next_card(self):
self.index += 1
self.render()
self.render_card()

def _should_enable_prev(self):
return super()._should_enable_prev() or self.index > 0
Expand All @@ -342,7 +342,7 @@ def _on_other_side(self):
self._state = "answer"
else:
self._state = "question"
self.render()
self.render_card()


class SingleCardPreviewer(Previewer):
Expand All @@ -369,4 +369,4 @@ def _on_other_side(self):
self._state = "answer"
else:
self._state = "question"
self.render()
self.render_card()

0 comments on commit 4790fec

Please sign in to comment.