mirror of
https://github.com/ankitects/anki.git
synced 2025-09-24 16:56:36 -04:00
about tweaks
- fix sort order - treat as a collection window so it's only opened once, and is closed on quit - use our standard font
This commit is contained in:
parent
90f7038109
commit
1fe86e1bde
3 changed files with 104 additions and 22 deletions
|
@ -44,12 +44,13 @@ from anki.utils import checksum
|
||||||
class DialogManager:
|
class DialogManager:
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
from aqt import addcards, browser, editcurrent, stats
|
from aqt import addcards, browser, editcurrent, stats, about
|
||||||
self._dialogs = {
|
self._dialogs = {
|
||||||
"AddCards": [addcards.AddCards, None],
|
"AddCards": [addcards.AddCards, None],
|
||||||
"Browser": [browser.Browser, None],
|
"Browser": [browser.Browser, None],
|
||||||
"EditCurrent": [editcurrent.EditCurrent, None],
|
"EditCurrent": [editcurrent.EditCurrent, None],
|
||||||
"DeckStats": [stats.DeckStats, None]
|
"DeckStats": [stats.DeckStats, None],
|
||||||
|
"About": [about.show, None],
|
||||||
}
|
}
|
||||||
|
|
||||||
def open(self, name, *args):
|
def open(self, name, *args):
|
||||||
|
|
118
aqt/about.py
118
aqt/about.py
|
@ -5,10 +5,21 @@
|
||||||
from aqt.qt import *
|
from aqt.qt import *
|
||||||
import aqt.forms
|
import aqt.forms
|
||||||
from aqt import appVersion
|
from aqt import appVersion
|
||||||
from aqt.utils import openLink
|
|
||||||
|
class ClosableQDialog(QDialog):
|
||||||
|
def canClose(self):
|
||||||
|
return True
|
||||||
|
|
||||||
|
def reject(self):
|
||||||
|
aqt.dialogs.close("About")
|
||||||
|
QDialog.reject(self)
|
||||||
|
|
||||||
|
def accept(self):
|
||||||
|
aqt.dialogs.close("About")
|
||||||
|
QDialog.accept(self)
|
||||||
|
|
||||||
def show(mw):
|
def show(mw):
|
||||||
dialog = QDialog(mw)
|
dialog = ClosableQDialog(mw)
|
||||||
mw.setupDialogGC(dialog)
|
mw.setupDialogGC(dialog)
|
||||||
abt = aqt.forms.about.Ui_About()
|
abt = aqt.forms.about.Ui_About()
|
||||||
abt.setupUi(dialog)
|
abt.setupUi(dialog)
|
||||||
|
@ -21,21 +32,92 @@ system. It's free and open source.")
|
||||||
abouttext += ("Qt %s PyQt %s<br>") % (QT_VERSION_STR, PYQT_VERSION_STR)
|
abouttext += ("Qt %s PyQt %s<br>") % (QT_VERSION_STR, PYQT_VERSION_STR)
|
||||||
abouttext += (_("<a href='%s'>Visit website</a>") % aqt.appWebsite) + \
|
abouttext += (_("<a href='%s'>Visit website</a>") % aqt.appWebsite) + \
|
||||||
"</span>"
|
"</span>"
|
||||||
|
|
||||||
|
# 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",
|
||||||
|
"赵金鹏",
|
||||||
|
"黃文龍",
|
||||||
|
))
|
||||||
|
|
||||||
abouttext += '<p>' + _("Written by Damien Elmes, with patches, translation,\
|
abouttext += '<p>' + _("Written by Damien Elmes, with patches, translation,\
|
||||||
testing and design from:<p>%(cont)s") % {'cont': """Aaron Harsh, Ádám Szegi, Alex Fraser,
|
testing and design from:<p>%(cont)s") % {'cont': ", ".join(allusers)}
|
||||||
Andreas Klauer, Andrew Wright, Aristotelis P., Bernhard Ibertsberger, C. van Rooyen, Charlene Barina,
|
|
||||||
Christian Krause, Christian Rusche, David Smith, Dave Druelinger, Dmitry Mikheev, Dotan Cohen,
|
|
||||||
Emilio Wuerges, Emmanuel Jarri, Frank Harper, Gregor Skumavc, H. Mijail, Guillem Palau Salvà, 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, Michael Jürges, Mark Wilbur,
|
|
||||||
Matthew Duggan, Matthew Holtz, Meelis Vasser, Michael Keppler, Michael
|
|
||||||
Montague, Michael Penkov, Michal Čadil, Morteza Salehi, Nathanael Law, Nick Cook, Niklas
|
|
||||||
Laxström, Nguyễn Hào Khôi, Norbert Nagold, Ole Guldberg,
|
|
||||||
Pcsl88, Petr Michalec, Piotr Kubowicz, Richard Colley, Roland Sieker, Samson Melamed,
|
|
||||||
Stefaan De Pooter, Silja Ijas, Snezana Lukic, Soren Bjornstad, Susanna Björverud, Sylvain Durand,
|
|
||||||
Tacutu, Timm Preetz, Timo Paulssen, Ursus, Victor Suba, Volker Jansen,
|
|
||||||
Volodymyr Goncharenko, Xtru, 赵金鹏 and 黃文龍."""}
|
|
||||||
abouttext += '<p>' + _("""\
|
abouttext += '<p>' + _("""\
|
||||||
The icons were obtained from various sources; please see the Anki source
|
The icons were obtained from various sources; please see the Anki source
|
||||||
for credits.""")
|
for credits.""")
|
||||||
|
@ -43,7 +125,7 @@ for credits.""")
|
||||||
please get in touch.")
|
please get in touch.")
|
||||||
abouttext += '<p>' + _("A big thanks to all the people who have provided \
|
abouttext += '<p>' + _("A big thanks to all the people who have provided \
|
||||||
suggestions, bug reports and donations.")
|
suggestions, bug reports and donations.")
|
||||||
abt.label.setHtml(abouttext)
|
abt.label.stdHtml(abouttext, js=" ")
|
||||||
dialog.adjustSize()
|
dialog.adjustSize()
|
||||||
dialog.show()
|
dialog.show()
|
||||||
dialog.exec_()
|
return dialog
|
||||||
|
|
|
@ -746,8 +746,7 @@ title="%s" %s>%s</button>''' % (
|
||||||
aqt.models.Models(self, self, fromMain=True)
|
aqt.models.Models(self, self, fromMain=True)
|
||||||
|
|
||||||
def onAbout(self):
|
def onAbout(self):
|
||||||
import aqt.about
|
aqt.dialogs.open("About", self)
|
||||||
aqt.about.show(self)
|
|
||||||
|
|
||||||
def onDonate(self):
|
def onDonate(self):
|
||||||
openLink(aqt.appDonate)
|
openLink(aqt.appDonate)
|
||||||
|
|
Loading…
Reference in a new issue