Esempio n. 1
0
    def show(self):
        # append folder of 'qt_gui_cpp/lib' to module search path
        qt_gui_cpp_path = os.path.realpath(get_package_path('qt_gui_cpp'))
        sys.path.append(os.path.join(qt_gui_cpp_path, 'lib'))
        sys.path.append(os.path.join(qt_gui_cpp_path, 'src'))
        from qt_gui_cpp.cpp_binding_helper import qt_gui_cpp

        _rospkg_version = None
        try:
            import rospkg
            _rospkg_version = getattr(rospkg, '__version__', '< 0.2.4')
        except ImportError:
            pass

        logo = os.path.realpath(os.path.join(os.path.dirname(__file__), '..', '..', 'icons', 'ros_org_vertical.png'))
        text = '<img src="%s" width="56" height="200" style="float: left;"/>' % logo

        text += '<h3 style="margin-top: 1px;">%s</h3>' % self.tr('ROS GUI')

        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++.'))
        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'))

        text += '<p>%s: ' % self.tr('Utilized libraries:')

        text += 'Python %s, ' % platform.python_version()

        if _rospkg_version is not None:
            text += 'rospkg %s, ' % _rospkg_version
        else:
            text += '%s, ' % self.tr('rospkg not found - using roslib')

        if QT_BINDING == 'pyside':
            text += 'PySide'
        elif QT_BINDING == 'pyqt':
            text += 'PyQt'
        text += ' %s (%s), ' % (QT_BINDING_VERSION, ', '.join(sorted(QT_BINDING_MODULES)))

        text += 'Qt %s, ' % qVersion()

        if qt_gui_cpp is not None:
            if QT_BINDING == 'pyside':
                text += '%s' % (self.tr('%s C++ bindings available') % 'Shiboken')
            elif QT_BINDING == 'pyqt':
                text += '%s' % (self.tr('%s C++ bindings available') % 'SIP')
            else:
                text += '%s' % self.tr('C++ bindings available')
        else:
            text += '%s' % self.tr('no C++ bindings found - no C++ plugins available')

        text += '.</p>'

        QMessageBox.about(self.parent(), self.tr('About ROS GUI'), text)
 def showError(self, message):
     QMessageBox.about(self, "ERROR", message)