mirror of
https://github.com/ankitects/anki.git
synced 2025-11-10 22:57:11 -05:00
make sure to open a browser when link clicked in preview
This commit is contained in:
parent
3bb16dc50a
commit
64cd0499ba
1 changed files with 6 additions and 0 deletions
|
|
@ -1089,6 +1089,9 @@ class PreviewDialog(QDialog):
|
||||||
self.dialog.setupUi(self)
|
self.dialog.setupUi(self)
|
||||||
self.dialog.webView.page().setLinkDelegationPolicy(
|
self.dialog.webView.page().setLinkDelegationPolicy(
|
||||||
QWebPage.DelegateExternalLinks)
|
QWebPage.DelegateExternalLinks)
|
||||||
|
self.connect(self.dialog.webView,
|
||||||
|
SIGNAL("linkClicked(QUrl)"),
|
||||||
|
self.linkClicked)
|
||||||
self.dialog.comboBox.addItems(QStringList(
|
self.dialog.comboBox.addItems(QStringList(
|
||||||
[c.cardModel.name for c in self.cards]))
|
[c.cardModel.name for c in self.cards]))
|
||||||
self.connect(self.dialog.comboBox, SIGNAL("activated(int)"),
|
self.connect(self.dialog.comboBox, SIGNAL("activated(int)"),
|
||||||
|
|
@ -1097,6 +1100,9 @@ class PreviewDialog(QDialog):
|
||||||
restoreGeom(self, "preview")
|
restoreGeom(self, "preview")
|
||||||
self.exec_()
|
self.exec_()
|
||||||
|
|
||||||
|
def linkClicked(self, url):
|
||||||
|
QDesktopServices.openUrl(QUrl(url))
|
||||||
|
|
||||||
def updateCard(self):
|
def updateCard(self):
|
||||||
c = self.cards[self.currentCard]
|
c = self.cards[self.currentCard]
|
||||||
styles = (self.deck.css +
|
styles = (self.deck.css +
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue