From 4790fec8810819d360c4c01eaa35c1be66dd7bba Mon Sep 17 00:00:00 2001 From: Damien Elmes Date: Fri, 3 Apr 2020 08:29:35 +1000 Subject: [PATCH] render() conflicts with Qt method --- qt/aqt/browser.py | 2 +- qt/aqt/previewer.py | 18 +++++++++--------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/qt/aqt/browser.py b/qt/aqt/browser.py index 46950ed1714..e6ac91a745c 100644 --- a/qt/aqt/browser.py +++ b/qt/aqt/browser.py @@ -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: diff --git a/qt/aqt/previewer.py b/qt/aqt/previewer.py index c11f879aa0a..1a5dcebbe8e 100644 --- a/qt/aqt/previewer.py +++ b/qt/aqt/previewer.py @@ -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): @@ -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 @@ -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() @@ -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() @@ -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() @@ -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 @@ -342,7 +342,7 @@ def _on_other_side(self): self._state = "answer" else: self._state = "question" - self.render() + self.render_card() class SingleCardPreviewer(Previewer): @@ -369,4 +369,4 @@ def _on_other_side(self): self._state = "answer" else: self._state = "question" - self.render() + self.render_card()