diff --git a/python/about_mp_dialog.py b/python/about_mp_dialog.py index 15b63cbd6f2cfd20f201299117a83e03e53cbbd0..556aeed96f2348904514a3039620766c6ed456f0 100644 --- a/python/about_mp_dialog.py +++ b/python/about_mp_dialog.py @@ -3,7 +3,7 @@ ################################################################################ ## Form generated from reading UI file 'about_mp_dialog.ui' ## -## Created by: Qt User Interface Compiler version 6.3.1 +## Created by: Qt User Interface Compiler version 6.5.1 ## ## WARNING! All changes made in this file will be lost when recompiling UI file! ################################################################################ @@ -15,62 +15,40 @@ from PySide6.QtGui import (QBrush, QColor, QConicalGradient, QCursor, QFont, QFontDatabase, QGradient, QIcon, QImage, QKeySequence, QLinearGradient, QPainter, QPalette, QPixmap, QRadialGradient, QTransform) -from PySide6.QtWidgets import (QApplication, QDialog, QHBoxLayout, QLabel, - QSizePolicy, QToolButton, QWidget) +from PySide6.QtWidgets import (QApplication, QDialog, QLabel, QSizePolicy, + QToolButton, QWidget) import resources_rc class Ui_AboutMPDialog(object): def setupUi(self, AboutMPDialog): if not AboutMPDialog.objectName(): AboutMPDialog.setObjectName(u"AboutMPDialog") - AboutMPDialog.resize(821, 327) - sizePolicy = QSizePolicy(QSizePolicy.Expanding, QSizePolicy.Expanding) - sizePolicy.setHorizontalStretch(0) - sizePolicy.setVerticalStretch(0) - sizePolicy.setHeightForWidth(AboutMPDialog.sizePolicy().hasHeightForWidth()) - AboutMPDialog.setSizePolicy(sizePolicy) - AboutMPDialog.setStyleSheet(u"background:white; border:0") - self.horizontalLayout = QHBoxLayout(AboutMPDialog) - self.horizontalLayout.setSpacing(0) - self.horizontalLayout.setObjectName(u"horizontalLayout") - self.horizontalLayout.setContentsMargins(0, 0, 0, 0) - self.widget_2 = QWidget(AboutMPDialog) - self.widget_2.setObjectName(u"widget_2") - self.widget_2.setMinimumSize(QSize(300, 0)) - self.widget = QWidget(self.widget_2) + AboutMPDialog.resize(946, 328) + self.widget = QWidget(AboutMPDialog) self.widget.setObjectName(u"widget") - self.widget.setGeometry(QRect(10, 20, 300, 300)) - sizePolicy1 = QSizePolicy(QSizePolicy.Fixed, QSizePolicy.Fixed) - sizePolicy1.setHorizontalStretch(117) - sizePolicy1.setVerticalStretch(28) - sizePolicy1.setHeightForWidth(self.widget.sizePolicy().hasHeightForWidth()) - self.widget.setSizePolicy(sizePolicy1) - self.widget.setMinimumSize(QSize(300, 300)) + self.widget.setGeometry(QRect(30, 30, 291, 271)) + self.widget.setStyleSheet(u"background-color: rgb(255, 255, 255);") self.mp_gryphon_tb = QToolButton(self.widget) self.mp_gryphon_tb.setObjectName(u"mp_gryphon_tb") - self.mp_gryphon_tb.setGeometry(QRect(10, 10, 251, 151)) + self.mp_gryphon_tb.setGeometry(QRect(20, 20, 251, 151)) self.mp_gryphon_tb.setFocusPolicy(Qt.NoFocus) - self.mp_gryphon_tb.setStyleSheet(u"QToolTip{color:black}") + self.mp_gryphon_tb.setStyleSheet(u"border:none") icon = QIcon() icon.addFile(u":/images/phoenix_logo", QSize(), QIcon.Normal, QIcon.Off) self.mp_gryphon_tb.setIcon(icon) self.mp_gryphon_tb.setIconSize(QSize(600, 150)) self.nps_tb = QToolButton(self.widget) self.nps_tb.setObjectName(u"nps_tb") - self.nps_tb.setGeometry(QRect(70, 190, 151, 53)) + self.nps_tb.setGeometry(QRect(70, 200, 151, 53)) self.nps_tb.setFocusPolicy(Qt.NoFocus) - self.nps_tb.setStyleSheet(u"QToolTip{color:black}") + self.nps_tb.setStyleSheet(u"border:none") icon1 = QIcon() icon1.addFile(u":/images/nps_logo", QSize(), QIcon.Normal, QIcon.Off) self.nps_tb.setIcon(icon1) self.nps_tb.setIconSize(QSize(400, 50)) - self.about_mp_label = QLabel(self.widget_2) + self.about_mp_label = QLabel(AboutMPDialog) self.about_mp_label.setObjectName(u"about_mp_label") - self.about_mp_label.setGeometry(QRect(320, 20, 471, 281)) - self.about_mp_label.setWordWrap(True) - - self.horizontalLayout.addWidget(self.widget_2) - + self.about_mp_label.setGeometry(QRect(370, 10, 551, 311)) self.retranslateUi(AboutMPDialog) @@ -78,7 +56,7 @@ class Ui_AboutMPDialog(object): # setupUi def retranslateUi(self, AboutMPDialog): - AboutMPDialog.setWindowTitle(QCoreApplication.translate("AboutMPDialog", u"About Montery Phoenix - Gryphon", None)) + AboutMPDialog.setWindowTitle(QCoreApplication.translate("AboutMPDialog", u"About Monterey Phoenix - Gryphon", None)) #if QT_CONFIG(tooltip) self.mp_gryphon_tb.setToolTip(QCoreApplication.translate("AboutMPDialog", u"http://wiki.nps.edu/display/MP", None)) #endif // QT_CONFIG(tooltip) @@ -87,6 +65,6 @@ class Ui_AboutMPDialog(object): self.nps_tb.setToolTip(QCoreApplication.translate("AboutMPDialog", u"http://www.nps.edu", None)) #endif // QT_CONFIG(tooltip) self.nps_tb.setText(QCoreApplication.translate("AboutMPDialog", u"...", None)) - self.about_mp_label.setText(QCoreApplication.translate("AboutMPDialog", u"<html><head/><body><p><span style=\" font-size:20pt;\">Monterey Phoenix (MP) Gryphon</span></p><p>The Monterey Phoenix Gryphon GUI supports Monterey Phoenix users with an interface for creating MP schemas and generating trace graphs and other local and global views.</p><p>The Monterey Phoenix language and editor were developed at the <a href=\"http://nps.edu\"><span style=\" text-decoration: underline; color:#0000ff;\">Naval Postgraduate School.</span></a></p><p><span style=\" font-size:16pt;\">Resources:</span><br/>\u2022 <a href=\"https://wiki.nps.edu/display/MP\"><span style=\" text-decoration: underline; color:#0000ff;\">Monterey Phoenix website</span></a></p><p>\u2022 <a href=\"https://wiki.nps.edu/display/MP/about\"><span style=\" text-decoration: underline; color:#0000ff;\">Monterey Phoenix website About page</span></a></p></body></html>", None)) + self.about_mp_label.setText(QCoreApplication.translate("AboutMPDialog", u"TextLabel", None)) # retranslateUi diff --git a/python/about_mp_dialog.ui b/python/about_mp_dialog.ui index e2c1ea1df8be286992810859fd743e386362e4fd..3cff324b79a539c62a2912f5cdfece623537e69c 100644 --- a/python/about_mp_dialog.ui +++ b/python/about_mp_dialog.ui @@ -6,151 +6,103 @@ <rect> <x>0</x> <y>0</y> - <width>821</width> - <height>327</height> + <width>946</width> + <height>328</height> </rect> </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Expanding" vsizetype="Expanding"> - <horstretch>0</horstretch> - <verstretch>0</verstretch> - </sizepolicy> - </property> <property name="windowTitle"> - <string>About Montery Phoenix - Gryphon</string> - </property> - <property name="styleSheet"> - <string notr="true">background:white; border:0</string> + <string>About Monterey Phoenix - Gryphon</string> </property> - <layout class="QHBoxLayout" name="horizontalLayout"> - <property name="spacing"> - <number>0</number> - </property> - <property name="leftMargin"> - <number>0</number> + <widget class="QWidget" name="widget" native="true"> + <property name="geometry"> + <rect> + <x>30</x> + <y>30</y> + <width>291</width> + <height>271</height> + </rect> </property> - <property name="topMargin"> - <number>0</number> + <property name="styleSheet"> + <string notr="true">background-color: rgb(255, 255, 255);</string> </property> - <property name="rightMargin"> - <number>0</number> + <widget class="QToolButton" name="mp_gryphon_tb"> + <property name="geometry"> + <rect> + <x>20</x> + <y>20</y> + <width>251</width> + <height>151</height> + </rect> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="toolTip"> + <string>http://wiki.nps.edu/display/MP</string> + </property> + <property name="styleSheet"> + <string notr="true">border:none</string> + </property> + <property name="text"> + <string>...</string> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/images/phoenix_logo</normaloff>:/images/phoenix_logo</iconset> + </property> + <property name="iconSize"> + <size> + <width>600</width> + <height>150</height> + </size> + </property> + </widget> + <widget class="QToolButton" name="nps_tb"> + <property name="geometry"> + <rect> + <x>70</x> + <y>200</y> + <width>151</width> + <height>53</height> + </rect> + </property> + <property name="focusPolicy"> + <enum>Qt::NoFocus</enum> + </property> + <property name="toolTip"> + <string>http://www.nps.edu</string> + </property> + <property name="styleSheet"> + <string notr="true">border:none</string> + </property> + <property name="text"> + <string>...</string> + </property> + <property name="icon"> + <iconset resource="resources.qrc"> + <normaloff>:/images/nps_logo</normaloff>:/images/nps_logo</iconset> + </property> + <property name="iconSize"> + <size> + <width>400</width> + <height>50</height> + </size> + </property> + </widget> + </widget> + <widget class="QLabel" name="about_mp_label"> + <property name="geometry"> + <rect> + <x>370</x> + <y>10</y> + <width>551</width> + <height>311</height> + </rect> </property> - <property name="bottomMargin"> - <number>0</number> + <property name="text"> + <string>TextLabel</string> </property> - <item> - <widget class="QWidget" name="widget_2" native="true"> - <property name="minimumSize"> - <size> - <width>300</width> - <height>0</height> - </size> - </property> - <widget class="QWidget" name="widget" native="true"> - <property name="geometry"> - <rect> - <x>10</x> - <y>20</y> - <width>300</width> - <height>300</height> - </rect> - </property> - <property name="sizePolicy"> - <sizepolicy hsizetype="Fixed" vsizetype="Fixed"> - <horstretch>117</horstretch> - <verstretch>28</verstretch> - </sizepolicy> - </property> - <property name="minimumSize"> - <size> - <width>300</width> - <height>300</height> - </size> - </property> - <widget class="QToolButton" name="mp_gryphon_tb"> - <property name="geometry"> - <rect> - <x>10</x> - <y>10</y> - <width>251</width> - <height>151</height> - </rect> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="toolTip"> - <string>http://wiki.nps.edu/display/MP</string> - </property> - <property name="styleSheet"> - <string notr="true">QToolTip{color:black}</string> - </property> - <property name="text"> - <string>...</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/images/phoenix_logo</normaloff>:/images/phoenix_logo</iconset> - </property> - <property name="iconSize"> - <size> - <width>600</width> - <height>150</height> - </size> - </property> - </widget> - <widget class="QToolButton" name="nps_tb"> - <property name="geometry"> - <rect> - <x>70</x> - <y>190</y> - <width>151</width> - <height>53</height> - </rect> - </property> - <property name="focusPolicy"> - <enum>Qt::NoFocus</enum> - </property> - <property name="toolTip"> - <string>http://www.nps.edu</string> - </property> - <property name="styleSheet"> - <string notr="true">QToolTip{color:black}</string> - </property> - <property name="text"> - <string>...</string> - </property> - <property name="icon"> - <iconset resource="resources.qrc"> - <normaloff>:/images/nps_logo</normaloff>:/images/nps_logo</iconset> - </property> - <property name="iconSize"> - <size> - <width>400</width> - <height>50</height> - </size> - </property> - </widget> - </widget> - <widget class="QLabel" name="about_mp_label"> - <property name="geometry"> - <rect> - <x>320</x> - <y>20</y> - <width>471</width> - <height>281</height> - </rect> - </property> - <property name="text"> - <string><html><head/><body><p><span style=" font-size:20pt;">Monterey Phoenix (MP) Gryphon</span></p><p>The Monterey Phoenix Gryphon GUI supports Monterey Phoenix users with an interface for creating MP schemas and generating trace graphs and other local and global views.</p><p>The Monterey Phoenix language and editor were developed at the <a href="http://nps.edu"><span style=" text-decoration: underline; color:#0000ff;">Naval Postgraduate School.</span></a></p><p><span style=" font-size:16pt;">Resources:</span><br/>• <a href="https://wiki.nps.edu/display/MP"><span style=" text-decoration: underline; color:#0000ff;">Monterey Phoenix website</span></a></p><p>• <a href="https://wiki.nps.edu/display/MP/about"><span style=" text-decoration: underline; color:#0000ff;">Monterey Phoenix website About page</span></a></p></body></html></string> - </property> - <property name="wordWrap"> - <bool>true</bool> - </property> - </widget> - </widget> - </item> - </layout> + </widget> </widget> <resources> <include location="resources.qrc"/> diff --git a/python/about_mp_dialog_wrapper.py b/python/about_mp_dialog_wrapper.py index 14bdf9e69ee775ba6d08c45a1f3012161f3e61e9..cf6d2d7fdb873d0b5c23b782983d1af66280e400 100644 --- a/python/about_mp_dialog_wrapper.py +++ b/python/about_mp_dialog_wrapper.py @@ -5,6 +5,30 @@ from PySide6.QtCore import Qt from PySide6.QtWidgets import QDialog from about_mp_dialog import Ui_AboutMPDialog +def _make_link(url, text): + return "<a href='%s'>%s</a>"%(url, text) + +_nps_link = _make_link("http://nps.edu", "Naval Postgraduate School") +_mp_link = _make_link("https://wiki.nps.edu/display/MP", + "Monterey Phoenix website") +_mp_about_link = _make_link("https://wiki.nps.edu/display/MP/about", + "Monterey Phoenix website About page") +_doc_link = _make_link("https://gitlab.nps.edu/monterey-phoenix/" + "user-interfaces/gryphon/-/wikis/home", + "Gryphon Wiki home page") + +_text = '<p><span style="font-size:20pt;">Monterey Phoenix (MP) Gryphon' \ + '</span></p>' \ + 'The Monterey Phoenix Gryphon GUI supports Monterey Phoenix users ' \ + 'with an interface for creating MP schemas and generating trace ' \ + 'graphs and other local and global views.' \ + '<p>The Monterey Phoenix language and editor were developed at ' \ + 'the %s.' \ + '<p><span style="font-size:16pt;">Resources:</span>' \ + '<p>• %s' \ + '<p>• %s' \ + '<p>• %s'%(_nps_link, _mp_link, _mp_about_link, _doc_link) + class AboutMPDialogWrapper(QDialog): def __init__(self, parent): super(AboutMPDialogWrapper, self).__init__(parent) @@ -15,3 +39,10 @@ class AboutMPDialogWrapper(QDialog): self.setAttribute(Qt.WA_MacAlwaysShowToolWindow) self.ui.about_mp_label.setOpenExternalLinks(True) + self.ui.about_mp_label.setOpenExternalLinks(True) + + label = self.ui.about_mp_label + label.setTextFormat(Qt.RichText) + label.setWordWrap(True) + label.setText(_text) +