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

ESS_GUIESS_GUI_batch_fittingESS_GUI_bumps_abstractionESS_GUI_iss1116ESS_GUI_iss879ESS_GUI_openclESS_GUI_orderingESS_GUI_sync_sascalc
Last change on this file since d0528c4 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
Line 
1import functools
2from PyQt5 import QtWidgets
3
4import sas.sasview
5import sas.qtgui.Utilities.LocalConfig as LocalConfig
6import sas.qtgui.Utilities.GuiUtils as GuiUtils
7from sas.qtgui.UI import images_rc
8from sas.qtgui.UI import main_resources_rc
9
10from .UI.AboutUI import Ui_AboutUI
11
12class AboutBox(QtWidgets.QDialog, Ui_AboutUI):
13    def __init__(self, parent=None):
14        super(AboutBox, self).__init__(parent)
15        self.setupUi(self)
16
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/>'
39        about_text += r'<a href=' + str(LocalConfig.__download_page__)\
40                   + 'Get the latest version</a></p><br/>'
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        """
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))
64        self.cmdLinkANSTO.clicked.connect(functools.partial(
65            GuiUtils.openLink, LocalConfig._ansto_url))
66
67        self.cmdOK.clicked.connect(self.close)
Note: See TracBrowser for help on using the repository browser.