import functools
from PyQt4 import QtGui
import sas.sasview
import sas.qtgui.LocalConfig as LocalConfig
import sas.qtgui.GuiUtils as GuiUtils
from UI.AboutUI import Ui_AboutUI
class AboutBox(QtGui.QDialog, Ui_AboutUI):
def __init__(self, parent=None):
super(AboutBox, self).__init__(parent)
self.setupUi(self)
self.setWindowTitle("About")
self.addText()
self.addActions()
def addText(self):
"""
Modify the labels so the text corresponds to the current version
"""
version = sas.sasview.__version__
self.lblVersion.setText(str(version))
lbl_font = self.font()
lbl_font.setPointSize(24)
self.lblVersion.setFont(lbl_font)
about_text = r'
'
about_text += '
Build ' + str(LocalConfig.__build__) +'
'
about_text += '' + LocalConfig._copyright + '
'
about_text += r'http://www.sasview.org
'
about_text += 'Comments? Bugs? Requests?
'
about_text += r'Send us a ticket
'
about_text += r'
'
self.lblAbout.setText(about_text)
# Enable link clicking on the label
self.lblAbout.setOpenExternalLinks(True)
def addActions(self):
"""
Add actions to the logo push buttons
"""
self.cmdLinkUT.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._inst_url))
self.cmdLinkUMD.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._umd_url))
self.cmdLinkNIST.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._nist_url))
self.cmdLinkSNS.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._sns_url))
self.cmdLinkISIS.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._isis_url))
self.cmdLinkESS.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._ess_url))
self.cmdLinkILL.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._ill_url))
self.cmdLinkANSTO.clicked.connect(functools.partial(
GuiUtils.openLink, LocalConfig._ansto_url))
self.cmdOK.clicked.connect(self.close)