示例#1
0
    def __init__(self, node, parent=None):
        super(PublisherWidget, self).__init__(parent)
        self._node = node
        self._topic_dict = {}
        self._update_thread = WorkerThread(self._update_thread_run,
                                           self._update_finished)

        package_path = get_package_path('rqt_publisher')
        ui_file = os.path.join(package_path, 'share', 'rqt_publisher',
                               'resource', 'Publisher.ui')
        loadUi(
            ui_file, self, {
                'ExtendedComboBox': ExtendedComboBox,
                'PublisherTreeWidget': PublisherTreeWidget
            })
        self.refresh_button.setIcon(QIcon.fromTheme('view-refresh'))
        self.refresh_button.clicked.connect(self.refresh_combo_boxes)
        self.add_publisher_button.setIcon(QIcon.fromTheme('list-add'))
        self.remove_publisher_button.setIcon(QIcon.fromTheme('list-remove'))
        self.clear_button.setIcon(QIcon.fromTheme('edit-clear'))

        self.refresh_combo_boxes()

        self.publisher_tree_widget.model().item_value_changed.connect(
            self.change_publisher)
        self.publisher_tree_widget.remove_publisher.connect(
            self.remove_publisher)
        self.publisher_tree_widget.publish_once.connect(self.publish_once)
        self.remove_publisher_button.clicked.connect(
            self.publisher_tree_widget.remove_selected_publishers)
        self.clear_button.clicked.connect(self.clean_up_publishers)
示例#2
0
 def create_application(self, argv):
     from python_qt_binding.QtGui import QIcon
     app = super(Main, self).create_application(argv)
     rqt_gui_path = get_package_path('rqt_gui')
     logo = os.path.join(rqt_gui_path, 'share', 'rqt_gui', 'resource',
                         'rqt.png')
     icon = QIcon(logo)
     app.setWindowIcon(icon)
     return app
示例#3
0
 def __init__(self, parent=None, script_path=None):
     super(ShellWidget, self).__init__(parent=parent)
     package_path = get_package_path('rqt_shell')
     ui_file = os.path.join(package_path, 'share', 'rqt_shell', 'resource',
                            'shell_widget.ui')
     if not os.path.exists(ui_file):
         raise Exception(
             'ShellWidget UI File was not found at {}'.format(ui_file))
     loadUi(ui_file, self, {'ShellTextEdit': ShellTextEdit})
     self.setObjectName('ShellWidget')
示例#4
0
    def plugin_help_request(self, plugin_descriptor):
        package_name = plugin_descriptor.attributes()['package_name']
        package_path = get_package_path(package_name)
        try:
            package = parse_package(package_path)
        except (InvalidPackage, IOError):
            return

        if len(package.urls) == 0:
            return
        url_str = package.urls[0].url
        for url in package.urls:
            if url.type == 'website':
                url_str = url.url
                break
        webbrowser.open(url_str)
示例#5
0
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE.

import os
import sys
import traceback

from python_qt_binding import QT_BINDING
from python_qt_binding.QtCore import qWarning

from qt_gui.ros_package_helper import get_package_path
sys.path.append(
    os.path.realpath(os.path.join(get_package_path('qt_gui_cpp'), 'lib')))

try:
    if QT_BINDING == 'pyside':
        import libqt_gui_cpp_shiboken
        qt_gui_cpp = libqt_gui_cpp_shiboken.qt_gui_cpp

    elif QT_BINDING == 'pyqt':
        import libqt_gui_cpp_sip
        qt_gui_cpp = libqt_gui_cpp_sip.qt_gui_cpp

    else:
        raise ImportError('Qt binding name "%s" is unknown.' % QT_BINDING)

except ImportError:
    qt_gui_cpp = None
示例#6
0
 def __init__(self, filename=None):
     qtgui_path = get_package_path('qt_gui')
     super(Main, self).__init__(qtgui_path,
                                invoked_filename=filename,
                                settings_filename='rqt_gui')