Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031 import os
00032 import platform
00033 import sys
00034
00035 from python_qt_binding import QT_BINDING, QT_BINDING_MODULES, QT_BINDING_VERSION
00036 from python_qt_binding.QtCore import QObject, qVersion
00037 from python_qt_binding.QtGui import QMessageBox
00038
00039 from .ros_package_helper import get_package_path
00040
00041
00042 class AboutHandler(QObject):
00043
00044 """Handler for the about action in the menu bar showing a message box with details on the used libraries and their versions."""
00045
00046 def __init__(self, parent=None):
00047 super(AboutHandler, self).__init__(parent)
00048
00049 def show(self):
00050
00051 qt_gui_cpp_path = os.path.realpath(get_package_path('qt_gui_cpp'))
00052 sys.path.append(os.path.join(qt_gui_cpp_path, 'lib'))
00053 sys.path.append(os.path.join(qt_gui_cpp_path, 'src'))
00054 from qt_gui_cpp.cpp_binding_helper import qt_gui_cpp
00055
00056 _rospkg_version = None
00057 try:
00058 import rospkg
00059 _rospkg_version = getattr(rospkg, '__version__', '< 0.2.4')
00060 except ImportError:
00061 pass
00062
00063 logo = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', 'icons', 'ros_org_vertical.png'))
00064 text = '<img src="%s" width="56" height="200" style="float: left;"/>' % logo
00065
00066 text += '<h3 style="margin-top: 1px;">%s</h3>' % self.tr('ROS GUI')
00067
00068 text += '<p>%s %s</p>' % (self.tr('ROS GUI is a framework for graphical user interfaces.'), self.tr('It is extensible with plugins which can be written in either Python or C++.'))
00069 text += '<p>%s</p>' % (self.tr('Please see the <a href="%s">Wiki</a> for more information on ROS GUI and available plugins.' % 'http://www.ros.org/wiki/rqt'))
00070
00071 text += '<p>%s: ' % self.tr('Utilized libraries:')
00072
00073 text += 'Python %s, ' % platform.python_version()
00074
00075 if _rospkg_version is not None:
00076 text += 'rospkg %s, ' % _rospkg_version
00077 else:
00078 text += '%s, ' % self.tr('rospkg not found - using roslib')
00079
00080 if QT_BINDING == 'pyside':
00081 text += 'PySide'
00082 elif QT_BINDING == 'pyqt':
00083 text += 'PyQt'
00084 text += ' %s (%s), ' % (QT_BINDING_VERSION, ', '.join(sorted(QT_BINDING_MODULES)))
00085
00086 text += 'Qt %s, ' % qVersion()
00087
00088 if qt_gui_cpp is not None:
00089 if QT_BINDING == 'pyside':
00090 text += '%s' % (self.tr('%s C++ bindings available') % 'Shiboken')
00091 elif QT_BINDING == 'pyqt':
00092 text += '%s' % (self.tr('%s C++ bindings available') % 'SIP')
00093 else:
00094 text += '%s' % self.tr('C++ bindings available')
00095 else:
00096 text += '%s' % self.tr('no C++ bindings found - no C++ plugins available')
00097
00098 text += '.</p>'
00099
00100 QMessageBox.about(self.parent(), self.tr('About ROS GUI'), text)