Exemplo n.º 1
0
    def initialSetup(self):
        import anki.consts as cs

        self.form.order.addItems(list(cs.dynOrderLabels().values()))
        self.form.order_2.addItems(list(cs.dynOrderLabels().values()))

        qconnect(self.form.resched.stateChanged, self._onReschedToggled)
Exemplo n.º 2
0
    def _initial_dialog_setup(self) -> None:
        import anki.consts as cs

        self.form = aqt.forms.filtered_deck.Ui_Dialog()
        self.form.setupUi(self)

        self.form.order.addItems(list(cs.dynOrderLabels(self.mw.col).values()))
        self.form.order_2.addItems(
            list(cs.dynOrderLabels(self.mw.col).values()))

        qconnect(self.form.resched.stateChanged, self._onReschedToggled)

        qconnect(self.form.search_button.clicked, self.on_search_button)
        qconnect(self.form.search_button_2.clicked, self.on_search_button_2)
        qconnect(self.form.hint_button.clicked, self.on_hint_button)
        blue = theme_manager.color(colors.LINK)
        grey = theme_manager.color(colors.DISABLED)
        self.setStyleSheet(f"""QPushButton[label] {{ padding: 0; border: 0 }}
            QPushButton[label]:hover {{ text-decoration: underline }}
            QPushButton[label="search"] {{ color: {blue} }}
            QPushButton[label="hint"] {{ color: {grey} }}""")
        disable_help_button(self)
        self.setWindowModality(Qt.WindowModal)
        qconnect(self.form.buttonBox.helpRequested,
                 lambda: openHelp(HelpPage.FILTERED_DECK))

        if self.col.schedVer() == 1:
            self.form.secondFilter.setVisible(False)
        restoreGeom(self, self.GEOMETRY_KEY)
Exemplo n.º 3
0
    def _desc(self, deck):
        if deck['dyn']:
            search, limit, order = deck['terms'][0]
            desc = "%s<br>%s" % (_("Search: %s") % search, _("Order: %s") %
                                 dynOrderLabels()[order].lower())
        else:
            desc = deck.get("desc", "")
        if not desc:
            return "<p>"
        if deck['dyn']:
            dyn = "dyn"
        else:
            dyn = ""
        if len(desc) < 160 or dyn:
            return '<div class="descfont descmid description %s">%s</div>' % (
                dyn, desc)
        else:
            return '''
<div class="descfont description descmid" id=shortdesc>%s\
 <a class=smallLink href=# onclick="$('#shortdesc').hide();$('#fulldesc').show();">...More</a></div>
<div class="descfont description descmid" id=fulldesc>%s</div>''' % (
                desc[:160], desc)
Exemplo n.º 4
0
    def _desc(self, deck):
        if deck['dyn']:
            desc = "%s<br>%s<br>%s" % (
                _("Search: %s") % deck['search'],
                _("Order: %s") % dynOrderLabels()[deck['order']],
                _("Steps: %s") % " ".join([str(x) for x in deck['delays']]))
        else:
            desc = deck.get("desc", "")
        if not desc:
            return "<p>"
        if deck['dyn']:
            dyn = "dyn"
        else:
            dyn = ""
        if len(desc) < 160 or dyn:
            return '<div class="descfont descmid description %s">%s</div>' % (
                dyn, desc)
        else:
            return '''
<div class="descfont description descmid" id=shortdesc>%s\
 <a class=smallLink href=# onclick="$('#shortdesc').hide();$('#fulldesc').show();">...More</a></div>
<div class="descfont description descmid" id=fulldesc>%s</div>''' % (
                 desc[:160], desc)
Exemplo n.º 5
0
    def _desc(self, deck):
        if deck['dyn']:
            search, limit, order  = deck['terms'][0]
            desc = "%s<br>%s" % (
                _("Search: %s") % search,
                _("Order: %s") % dynOrderLabels()[order].lower())
        else:
            desc = deck.get("desc", "")
        if not desc:
            return "<p>"
        if deck['dyn']:
            dyn = "dyn"
        else:
            dyn = ""
        if len(desc) < 160 or dyn:
            return '<div class="descfont descmid description %s">%s</div>' % (
                dyn, desc)
        else:
            return '''
<div class="descfont description descmid" id=shortdesc>%s\
 <a class=smallLink href=# onclick="$('#shortdesc').hide();$('#fulldesc').show();">...More</a></div>
<div class="descfont description descmid" id=fulldesc>%s</div>''' % (
                 desc[:160], desc)
Exemplo n.º 6
0
 def setupOrder(self):
     import anki.consts as cs
     self.form.order.addItems(list(cs.dynOrderLabels().values()))
     self.form.order_2.addItems(list(cs.dynOrderLabels().values()))
Exemplo n.º 7
0
 def setupOrder(self):
     import anki.consts as cs
     self.form.order.addItems(cs.dynOrderLabels().values())
Exemplo n.º 8
0
 def setupCombos(self):
     import anki.consts as cs
     f = self.form
     f.order.addItems(cs.dynOrderLabels().values())
Exemplo n.º 9
0
    def initialSetup(self):
        import anki.consts as cs
        self.form.order.addItems(list(cs.dynOrderLabels().values()))
        self.form.order_2.addItems(list(cs.dynOrderLabels().values()))

        self.form.resched.stateChanged.connect(self._onReschedToggled)