Exemple #1
0
 def about(self):
     name = self.applicationName()
     domain = self.organizationDomain()
     caption = self.tr(
         "<h3>About {n}</h3>"
         "<p>{n} is a cross-platform, modular typeface design "
         "application.</p>").format(n=name)
     text = self.tr(
         "<p>{} is built on top of "
         "<a href='http://ts-defcon.readthedocs.org/en/ufo3/'>defcon</a> "
         "and includes scripting support "
         "with a <a href='http://robofab.com/'>robofab</a>-like API.</p>"
         "<p>Running on Qt {} (PyQt {}).</p>"
         "<p>Version {} {} – Python {}.").format(
         name, QT_VERSION_STR, PYQT_VERSION_STR, __version__, gitShortHash,
         platform.python_version())
     if domain:
         text += self.tr("<br>See <a href='http://{d}'>{d}</a> for more "
                         "information.</p>").format(d=domain)
     else:
         text += "</p>"
     # This duplicates much of QMessageBox.about(), but it has no way to
     # setInformativeText()...
     msgBox = QMessageBox(self.activeWindow())
     msgBox.setAttribute(Qt.WA_DeleteOnClose)
     icon = msgBox.windowIcon()
     size = icon.actualSize(QSize(64, 64))
     msgBox.setIconPixmap(icon.pixmap(size))
     msgBox.setWindowTitle(self.tr("About {}").format(name))
     msgBox.setText(caption)
     msgBox.setInformativeText(text)
     if platformSpecific.useCenteredButtons():
         buttonBox = msgBox.findChild(QDialogButtonBox)
         buttonBox.setCenterButtons(True)
     msgBox.show()