2 from PyQt4.QtGui import QDialog, QPalette, QVBoxLayout, QLabel, QPushButton, QDialogButtonBox, QSizePolicy
3 from PyQt4.QtSvg
import QSvgWidget
11 QDialog.__init__(self, self._application.mainWindow())
12 self.setAttribute(Qt.WA_DeleteOnClose)
13 self.setFocusPolicy(Qt.StrongFocus)
14 self.setWindowFlags(Qt.Window)
15 self.setAutoFillBackground(
True)
18 self.setWindowTitle(
"About "+self._application.windowTitle())
31 self.setLayout(QVBoxLayout())
32 if "vispa" in self._application.windowTitle().lower():
33 self.
_logo = QSvgWidget(
":/resources/vispa_logo.svg")
34 sizeHint = self._logo.sizeHint()
35 logo_width_height_ratio = 1.0 * sizeHint.width() / sizeHint.height()
37 self._logo.setFixedSize(logo_width, logo_width/logo_width_height_ratio)
38 self.layout().addWidget(self.
_logo)
40 label=QLabel(self._application.windowTitle())
41 self.layout().addWidget(label)
42 self.layout().addWidget(QLabel(
"Version "+ self._application.version()))
43 self.layout().addWidget(QLabel(
"More information can be found on:"))
44 websiteLink = QLabel(
"<a href='"+ websiteUrl +
"'>"+ websiteUrl +
"</a>")
45 websiteLink.setTextInteractionFlags(Qt.LinksAccessibleByMouse | Qt.TextSelectableByMouse)
46 websiteLink.setOpenExternalLinks(
True)
47 self.layout().addWidget(websiteLink)
48 buttonBox=QDialogButtonBox()
49 buttonBox.addButton(QDialogButtonBox.Close)
50 self.connect(buttonBox,SIGNAL(
"rejected()"),self,SLOT(
"reject()"))
51 self.layout().addWidget(buttonBox)