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