aboutdialog.py
Go to the documentation of this file.
1 '''
2  Copyright (C) 1997-2017 JDERobot Developers Team
3 
4  This program is free software; you can redistribute it and/or modify
5  it under the terms of the GNU General Public License as published by
6  the Free Software Foundation; either version 2 of the License, or
7  (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  GNU Library General Public License for more details.
13 
14  You should have received a copy of the GNU General Public License
15  along with this program; if not, see <http://www.gnu.org/licenses/>.
16 
17  Authors : Okan Asik (asik.okan@gmail.com)
18 
19  '''
20 import sys
21 
22 from PyQt5.QtWidgets import QDialog, QApplication
23 from PyQt5.QtWidgets import QVBoxLayout, QHBoxLayout, QLabel
24 from PyQt5.QtGui import QPixmap
25 from PyQt5.QtCore import Qt
26 from visualstates.configs.rospackage import getPackagePath
27 
28 
29 class AboutDialog(QDialog):
30  def __init__(self):
31  QDialog.__init__(self)
32  self.setWindowTitle("JdeRobot VisualStates")
33  mainLayout = QVBoxLayout()
34  headerLayout = QHBoxLayout()
35  logo = QLabel()
36  logoPixmap = QPixmap(getPackagePath() + '/resources/jderobot_big.png')
37  logo.setPixmap(logoPixmap)
38  logo.setStyleSheet("QLabel {background-color:white; padding:10px;}")
39  logo.setFixedWidth(160)
40  headerLayout.addWidget(logo)
41  title = QLabel()
42  title.setAlignment(Qt.AlignLeft)
43  title.setAlignment(Qt.AlignVCenter)
44  title.setText("JdeRobot VisualStates")
45  title.setStyleSheet("QLabel {font-size:24pt; background-color:white;}")
46  headerLayout.addWidget(title)
47  mainLayout.addItem(headerLayout)
48 
49  explanation = QLabel()
50  explanation.setWordWrap(True)
51  explanation.setStyleSheet("QLabel {font-size:14pt; padding:10px; background-color:#FEFFA8;}")
52  explanation.setText("JdeRobot VisualStates is an open source visual tool to develop reactive robot behaviors. "
53  "The behaviors are represented by hierarchical finite state machines. "
54  "The tool generates a ROS package that is ready to be run.")
55  mainLayout.addWidget(explanation)
56 
57  githubLink = QLabel()
58  githubLink.setTextFormat(Qt.RichText)
59  githubLink.setTextInteractionFlags(Qt.TextBrowserInteraction)
60  githubLink.setOpenExternalLinks(True)
61  githubLink.setText("<a href=\"https://github.com/JdeRobot/VisualStates\">https://github.com/JdeRobot/VisualStates</a>")
62  githubLink.setAlignment(Qt.AlignHCenter)
63  githubLink.setStyleSheet("QLabel {color:blue; text-decoration: underline; padding:5px;}")
64  githubLink.setFixedHeight(30)
65  mainLayout.addWidget(githubLink)
66 
67  jderobotLink = QLabel()
68  jderobotLink.setTextFormat(Qt.RichText)
69  jderobotLink.setTextInteractionFlags(Qt.TextBrowserInteraction)
70  jderobotLink.setOpenExternalLinks(True)
71  jderobotLink.setFixedHeight(30)
72  jderobotLink.setText("<a href=\"https://jderobot.org\">https://jderobot.org</a>")
73  jderobotLink.setAlignment(Qt.AlignHCenter)
74  jderobotLink.setStyleSheet("QLabel {color:blue; text-decoration: underline; padding:5px;}")
75  mainLayout.addWidget(jderobotLink)
76 
77 
78  self.setLayout(mainLayout)
79  self.setFixedSize(600, 400)
80 
81 if __name__ == '__main__':
82  app = QApplication(sys.argv)
83  resource_path = '/media/okan/depo/jderobot/catkin_ws/src/visualstates'
84  dialog = AboutDialog()
85  dialog.exec_()


visualstates
Author(s):
autogenerated on Thu Apr 1 2021 02:42:20