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

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 b94889a was 31c5b58, checked in by Piotr Rozyczko <rozyczko@…>, 8 years ago

Refactored to allow running with run.py.
Minor fixes to plotting.

  • Property mode set to 100644
File size: 2.4 KB
RevLine 
[f82ab8c]1import functools
[f51ed67]2from PyQt4 import QtGui
[f82ab8c]3
4import sas.sasview
[31c5b58]5import sas.qtgui.LocalConfig as LocalConfig
6import sas.qtgui.GuiUtils as GuiUtils
[f82ab8c]7
[f51ed67]8from UI.AboutUI import Ui_AboutUI
[f82ab8c]9
[f51ed67]10class AboutBox(QtGui.QDialog, Ui_AboutUI):
[f82ab8c]11    def __init__(self, parent=None):
12        super(AboutBox, self).__init__(parent)
[f51ed67]13        self.setupUi(self)
14
[f82ab8c]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/>'
[481ff26]37        about_text += r'<a href=' + str(LocalConfig.__download_page__)\
38                   + 'Get the latest version</a></p><br/>'
[f82ab8c]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        """
[481ff26]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))
[e207c3f]62        self.cmdLinkANSTO.clicked.connect(functools.partial(
63            GuiUtils.openLink, LocalConfig._ansto_url))
[f82ab8c]64
65        self.cmdOK.clicked.connect(self.close)
Note: See TracBrowser for help on using the repository browser.