source: sasview/src/sas/qtgui/AboutBox.py @ aa6028c

ESS_GUIESS_GUI_DocsESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_iss959ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since aa6028c was f51ed67, checked in by Piotr Rozyczko <piotr.rozyczko@…>, 8 years ago

Clean up and automate generation of UI and resources

  • Property mode set to 100755
File size: 2.3 KB
Line 
1import functools
2from PyQt4 import QtGui
3
4import sas.sasview
5import LocalConfig
6import GuiUtils
7
8from UI.AboutUI import Ui_AboutUI
9
10class AboutBox(QtGui.QDialog, Ui_AboutUI):
11    def __init__(self, parent=None):
12        super(AboutBox, self).__init__(parent)
13        self.setupUi(self)
14
15        self.setWindowTitle("About")
16
17        self.addText()
18
19        self.addActions()
20
21    def addText(self):
22        """
23        Modify the labels so the text corresponds to the current version
24        """
25        version = sas.sasview.__version__
26
27        self.lblVersion.setText(str(version))
28        lbl_font = self.font()
29        lbl_font.setPointSize(24)
30        self.lblVersion.setFont(lbl_font)
31        about_text = r'<html><head/><body><p>'
32        about_text += '<p>Build ' + str(LocalConfig.__build__) +'</p>'
33        about_text += '<p>' + LocalConfig._copyright + '</p>'
34        about_text += r'<p><a href=http://www.sasview.org>http://www.sasview.org</a></p><br/>'
35        about_text += '<p>Comments? Bugs? Requests?<br/>'
36        about_text += r'<a href=mailto:help@sasview.org>Send us a ticket</a></p><br/>'
37        about_text += r'<a href=' + str(LocalConfig.__download_page__)\
38                   + 'Get the latest version</a></p><br/>'
39        self.lblAbout.setText(about_text)
40
41        # Enable link clicking on the label
42        self.lblAbout.setOpenExternalLinks(True)
43
44    def addActions(self):
45        """
46        Add actions to the logo push buttons
47        """
48        self.cmdLinkUT.clicked.connect(functools.partial(
49            GuiUtils.openLink, LocalConfig._inst_url))
50        self.cmdLinkUMD.clicked.connect(functools.partial(
51            GuiUtils.openLink, LocalConfig._umd_url))
52        self.cmdLinkNIST.clicked.connect(functools.partial(
53            GuiUtils.openLink, LocalConfig._nist_url))
54        self.cmdLinkSNS.clicked.connect(functools.partial(
55            GuiUtils.openLink, LocalConfig._sns_url))
56        self.cmdLinkISIS.clicked.connect(functools.partial(
57            GuiUtils.openLink, LocalConfig._isis_url))
58        self.cmdLinkESS.clicked.connect(functools.partial(
59            GuiUtils.openLink, LocalConfig._ess_url))
60        self.cmdLinkILL.clicked.connect(functools.partial(
61            GuiUtils.openLink, LocalConfig._ill_url))
62
63        self.cmdOK.clicked.connect(self.close)
Note: See TracBrowser for help on using the repository browser.