mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 23:42:23 -04:00
hyperlink added cards
This commit is contained in:
parent
23d39daeaa
commit
af67f6fa9c
3 changed files with 20 additions and 2 deletions
|
@ -88,6 +88,14 @@ class AddCards(QDialog):
|
|||
c = unicode(p.color(QPalette.Window).name())
|
||||
self.dialog.status.setStyleSheet(
|
||||
"* { background: %s; color: #000000; }" % c)
|
||||
self.connect(self.dialog.status, SIGNAL("anchorClicked(QUrl)"),
|
||||
self.onLink)
|
||||
|
||||
def onLink(self, url):
|
||||
browser = ui.dialogs.get("CardList", self.parent)
|
||||
browser.dialog.filterEdit.setText("fid:" + url.toString())
|
||||
browser.updateSearch()
|
||||
browser.onFact()
|
||||
|
||||
def modelChanged(self, model):
|
||||
oldFact = self.editor.fact
|
||||
|
@ -129,8 +137,11 @@ class AddCards(QDialog):
|
|||
The input you have provided would make an empty
|
||||
question or answer on all cards."""), parent=self)
|
||||
return
|
||||
self.dialog.status.append(_("Added %(num)d card(s) for '%(str)s'.") % {
|
||||
self.dialog.status.append(
|
||||
_("Added %(num)d card(s) for <a href=\"%(id)d\">"
|
||||
"%(str)s</a>.") % {
|
||||
"num": len(fact.cards),
|
||||
"id": fact.id,
|
||||
# we're guaranteed that all fields will exist now
|
||||
"str": stripHTML(fact[fact.fields[0].name]),
|
||||
})
|
||||
|
|
|
@ -1057,6 +1057,7 @@ where id in %s""" % ids2str(sf))
|
|||
|
||||
def onFind(self):
|
||||
self.dialog.filterEdit.setFocus()
|
||||
self.dialog.filterEdit.selectAll()
|
||||
|
||||
def onFact(self):
|
||||
self.editor.focusFirst()
|
||||
|
|
|
@ -71,7 +71,7 @@
|
|||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QTextEdit" name="status" >
|
||||
<widget class="QTextBrowser" name="status" >
|
||||
<property name="enabled" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -143,6 +143,12 @@ p, li { white-space: pre-wrap; }
|
|||
</style></head><body style=" font-family:'Sans Serif'; font-size:8pt; font-weight:400; font-style:normal;">
|
||||
<p style="-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Arial';"></p></body></html></string>
|
||||
</property>
|
||||
<property name="textInteractionFlags" >
|
||||
<set>Qt::TextBrowserInteraction</set>
|
||||
</property>
|
||||
<property name="openLinks" >
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
|
|
Loading…
Reference in a new issue