source: sasview/src/sas/qtgui/MainWindow/AboutBox.py @ d744767

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 d744767 was 4992ff2, checked in by Piotr Rozyczko <rozyczko@…>, 7 years ago

Initial, in-progress version. Not really working atm. SASVIEW-787

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