Ejemplo n.º 1
0
    def _showAnswerButton(self) -> None:
        middle = """
<span class=stattxt>{}</span><br>
<button title="{}" id="ansbut" class="focus" onclick='pycmd("ans");'>{}</button>""".format(
            self._remaining(),
            tr.actions_shortcut_key(val=tr.studying_space()),
            tr.studying_show_answer(),
        )
        # wrap it in a table so it has the same top margin as the ease buttons
        middle = (
            "<table cellpadding=0><tr><td class=stat2 align=center>%s</td></tr></table>"
            % middle
        )
        if self.card.should_show_timer():
            maxTime = self.card.time_limit() / 1000
        else:
            maxTime = 0
        self.bottom.web.eval("showQuestion(%s,%d);" % (json.dumps(middle), maxTime))
        self.bottom.web.adjustHeightToFit()
Ejemplo n.º 2
0
 def updateDelimiterButtonText(self) -> None:
     if not self.importer.needDelimiter:
         return
     if self.importer.delimiter:
         d = self.importer.delimiter
     else:
         d = self.importer.dialect.delimiter
     if d == "\t":
         d = tr.importing_tab()
     elif d == ",":
         d = tr.importing_comma()
     elif d == " ":
         d = tr.studying_space()
     elif d == ";":
         d = tr.importing_semicolon()
     elif d == ":":
         d = tr.importing_colon()
     else:
         d = repr(d)
     txt = tr.importing_fields_separated_by(val=d)
     self.frm.autoDetect.setText(txt)