1 | import functools |
---|
2 | from PyQt4 import QtGui |
---|
3 | |
---|
4 | import sas.sasview |
---|
5 | import sas.qtgui.Utilities.LocalConfig as LocalConfig |
---|
6 | import sas.qtgui.Utilities.GuiUtils as GuiUtils |
---|
7 | from sas.qtgui.UI import images_rc |
---|
8 | from sas.qtgui.UI import main_resources_rc |
---|
9 | |
---|
10 | from UI.AboutUI import Ui_AboutUI |
---|
11 | |
---|
12 | class AboutBox(QtGui.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) |
---|