2019-02-05 04:59:03 +01:00
|
|
|
# Copyright: Ankitects Pty Ltd and contributors
|
2012-12-21 08:51:59 +01:00
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
# License: GNU AGPL, version 3 or later; http://www.gnu.org/licenses/agpl.html
|
|
|
|
|
|
|
|
import aqt.forms
|
2019-12-20 10:19:03 +01:00
|
|
|
from anki.lang import _
|
2019-02-27 23:37:42 +01:00
|
|
|
from anki.utils import versionWithBuild
|
2019-12-20 10:19:03 +01:00
|
|
|
from aqt.qt import *
|
2019-02-27 23:37:42 +01:00
|
|
|
from aqt.utils import supportText, tooltip
|
2019-12-20 10:19:03 +01:00
|
|
|
|
2017-06-26 05:05:11 +02:00
|
|
|
|
|
|
|
class ClosableQDialog(QDialog):
|
|
|
|
def reject(self):
|
2017-08-16 04:45:33 +02:00
|
|
|
aqt.dialogs.markClosed("About")
|
2017-06-26 05:05:11 +02:00
|
|
|
QDialog.reject(self)
|
|
|
|
|
|
|
|
def accept(self):
|
2017-08-16 04:45:33 +02:00
|
|
|
aqt.dialogs.markClosed("About")
|
2017-06-26 05:05:11 +02:00
|
|
|
QDialog.accept(self)
|
2012-12-21 08:51:59 +01:00
|
|
|
|
2017-08-16 04:45:33 +02:00
|
|
|
def closeWithCallback(self, callback):
|
|
|
|
self.reject()
|
|
|
|
callback()
|
|
|
|
|
2016-07-04 05:22:35 +02:00
|
|
|
def show(mw):
|
2017-06-26 05:05:11 +02:00
|
|
|
dialog = ClosableQDialog(mw)
|
2016-07-04 05:22:35 +02:00
|
|
|
mw.setupDialogGC(dialog)
|
2012-12-21 08:51:59 +01:00
|
|
|
abt = aqt.forms.about.Ui_About()
|
|
|
|
abt.setupUi(dialog)
|
2019-02-24 14:55:55 +01:00
|
|
|
|
|
|
|
# Copy debug info
|
|
|
|
######################################################################
|
|
|
|
def onCopy():
|
|
|
|
addmgr = mw.addonManager
|
|
|
|
addons = "\n".join(addmgr.annotatedName(d) for d in addmgr.allAddons())
|
|
|
|
info = "\n".join((supportText(), "Add-ons:\n\n{}".format(addons)))
|
|
|
|
QApplication.clipboard().setText(info)
|
|
|
|
tooltip(_("Copied to clipboard"), parent=dialog)
|
|
|
|
|
|
|
|
btn = QPushButton(_("Copy Debug Info"))
|
|
|
|
btn.clicked.connect(onCopy)
|
|
|
|
abt.buttonBox.addButton(btn, QDialogButtonBox.ActionRole)
|
|
|
|
abt.buttonBox.button(QDialogButtonBox.Ok).setFocus()
|
|
|
|
|
|
|
|
# WebView contents
|
|
|
|
######################################################################
|
2018-10-25 07:43:17 +02:00
|
|
|
abouttext = "<center><img src='/_anki/imgs/anki-logo-thin.png'></center>"
|
2012-12-21 08:51:59 +01:00
|
|
|
abouttext += '<p>' + _("Anki is a friendly, intelligent spaced learning \
|
|
|
|
system. It's free and open source.")
|
2013-05-24 03:54:33 +02:00
|
|
|
abouttext += "<p>"+_("Anki is licensed under the AGPL3 license. Please see "
|
|
|
|
"the license file in the source distribution for more information.")
|
2018-12-13 11:59:06 +01:00
|
|
|
abouttext += '<p>' + _("Version %s") % versionWithBuild() + '<br>'
|
2013-05-17 09:09:24 +02:00
|
|
|
abouttext += ("Qt %s PyQt %s<br>") % (QT_VERSION_STR, PYQT_VERSION_STR)
|
2012-12-21 08:51:59 +01:00
|
|
|
abouttext += (_("<a href='%s'>Visit website</a>") % aqt.appWebsite) + \
|
|
|
|
"</span>"
|
2017-06-26 05:05:11 +02:00
|
|
|
|
|
|
|
# automatically sorted; add new lines at the end
|
|
|
|
allusers = sorted((
|
|
|
|
"Aaron Harsh",
|
|
|
|
"Alex Fraser",
|
|
|
|
"Andreas Klauer",
|
|
|
|
"Andrew Wright",
|
|
|
|
"Aristotelis P.",
|
|
|
|
"Bernhard Ibertsberger",
|
|
|
|
"C. van Rooyen",
|
|
|
|
"Charlene Barina",
|
|
|
|
"Christian Krause",
|
|
|
|
"Christian Rusche",
|
|
|
|
"Dave Druelinger",
|
|
|
|
"David Smith",
|
|
|
|
"Dmitry Mikheev",
|
|
|
|
"Dotan Cohen",
|
|
|
|
"Emilio Wuerges",
|
|
|
|
"Emmanuel Jarri",
|
|
|
|
"Frank Harper",
|
|
|
|
"Gregor Skumavc",
|
|
|
|
"Guillem Palau Salvà",
|
|
|
|
"H. Mijail",
|
|
|
|
"Henrik Enggaard Hansen",
|
|
|
|
"Houssam Salem",
|
|
|
|
"Ian Lewis",
|
|
|
|
"Immanuel Asmus",
|
|
|
|
"Iroiro",
|
|
|
|
"Jarvik7",
|
|
|
|
"Jin Eun-Deok",
|
|
|
|
"Jo Nakashima",
|
|
|
|
"Johanna Lindh",
|
|
|
|
"Joseph Lorimer",
|
|
|
|
"Julien Baley",
|
|
|
|
"Jussi Määttä",
|
|
|
|
"Kieran Clancy",
|
|
|
|
"LaC",
|
|
|
|
"Laurent Steffan",
|
|
|
|
"Luca Ban",
|
|
|
|
"Luciano Esposito",
|
|
|
|
"Marco Giancotti",
|
|
|
|
"Marcus Rubeus",
|
|
|
|
"Mari Egami",
|
|
|
|
"Mark Wilbur",
|
|
|
|
"Matthew Duggan",
|
|
|
|
"Matthew Holtz",
|
|
|
|
"Meelis Vasser",
|
|
|
|
"Michael Jürges",
|
|
|
|
"Michael Keppler",
|
|
|
|
"Michael Montague",
|
|
|
|
"Michael Penkov",
|
|
|
|
"Michal Čadil",
|
|
|
|
"Morteza Salehi",
|
|
|
|
"Nathanael Law",
|
|
|
|
"Nguyễn Hào Khôi",
|
|
|
|
"Nick Cook",
|
|
|
|
"Niklas Laxström",
|
|
|
|
"Norbert Nagold",
|
|
|
|
"Ole Guldberg",
|
|
|
|
"Pcsl88",
|
|
|
|
"Petr Michalec",
|
|
|
|
"Piotr Kubowicz",
|
|
|
|
"Richard Colley",
|
|
|
|
"Roland Sieker",
|
|
|
|
"Samson Melamed",
|
|
|
|
"Silja Ijas",
|
|
|
|
"Snezana Lukic",
|
|
|
|
"Soren Bjornstad",
|
|
|
|
"Stefaan De Pooter",
|
|
|
|
"Susanna Björverud",
|
|
|
|
"Sylvain Durand",
|
|
|
|
"Tacutu",
|
|
|
|
"Timm Preetz",
|
|
|
|
"Timo Paulssen",
|
|
|
|
"Ursus",
|
|
|
|
"Victor Suba",
|
|
|
|
"Volker Jansen",
|
|
|
|
"Volodymyr Goncharenko",
|
|
|
|
"Xtru",
|
|
|
|
"Ádám Szegi",
|
|
|
|
"赵金鹏",
|
|
|
|
"黃文龍",
|
2017-08-04 09:38:39 +02:00
|
|
|
"David Bailey",
|
2018-09-24 06:46:44 +02:00
|
|
|
"Arman High",
|
2019-02-16 11:28:02 +01:00
|
|
|
"Arthur Milchior",
|
2017-06-26 05:05:11 +02:00
|
|
|
))
|
|
|
|
|
2012-12-21 08:51:59 +01:00
|
|
|
abouttext += '<p>' + _("Written by Damien Elmes, with patches, translation,\
|
2017-06-26 05:05:11 +02:00
|
|
|
testing and design from:<p>%(cont)s") % {'cont': ", ".join(allusers)}
|
2012-12-21 08:51:59 +01:00
|
|
|
abouttext += '<p>' + _("If you have contributed and are not on this list, \
|
|
|
|
please get in touch.")
|
|
|
|
abouttext += '<p>' + _("A big thanks to all the people who have provided \
|
|
|
|
suggestions, bug reports and donations.")
|
2018-10-25 07:47:17 +02:00
|
|
|
abt.label.setMinimumWidth(800)
|
|
|
|
abt.label.setMinimumHeight(600)
|
|
|
|
dialog.show()
|
2018-10-25 07:43:17 +02:00
|
|
|
abt.label.stdHtml(abouttext, js=" ")
|
2017-06-26 05:05:11 +02:00
|
|
|
return dialog
|