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
00032
00033
00034
00035 import os
00036 import sys
00037
00038 import rospy
00039 from rospkg.rospack import RosPack
00040
00041 from qt_gui.main import Main as Base
00042
00043
00044 class Main(Base):
00045
00046 def __init__(self, filename=None, ros_pack=None):
00047 rp = ros_pack or RosPack()
00048 qtgui_path = rp.get_path('qt_gui')
00049 super(Main, self).__init__(qtgui_path, invoked_filename=filename, settings_filename='rqt_gui')
00050 self._ros_pack = rp
00051
00052 def main(self, argv=None, standalone=None, plugin_argument_provider=None):
00053 if argv is None:
00054 argv = sys.argv
00055
00056
00057 argv = rospy.myargv(argv)
00058
00059 return super(Main, self).main(argv, standalone=standalone, plugin_argument_provider=plugin_argument_provider, plugin_manager_settings_prefix=str(hash(os.environ['ROS_PACKAGE_PATH'])))
00060
00061 def create_application(self, argv):
00062 from python_qt_binding.QtGui import QIcon
00063 app = super(Main, self).create_application(argv)
00064 logo = os.path.join(self._ros_pack.get_path('rqt_gui'), 'resource', 'rqt.png')
00065 icon = QIcon(logo)
00066 app.setWindowIcon(icon)
00067 return app
00068
00069 def _add_plugin_providers(self):
00070
00071 from qt_gui.recursive_plugin_provider import RecursivePluginProvider
00072 from .rospkg_plugin_provider import RospkgPluginProvider
00073 RospkgPluginProvider.rospack = self._ros_pack
00074 self.plugin_providers.append(RospkgPluginProvider('qt_gui', 'qt_gui_py::Plugin'))
00075 self.plugin_providers.append(RecursivePluginProvider(RospkgPluginProvider('qt_gui', 'qt_gui_py::PluginProvider')))
00076 self.plugin_providers.append(RecursivePluginProvider(RospkgPluginProvider('rqt_gui', 'rqt_gui_py::PluginProvider')))
00077
00078 def _add_reload_paths(self, reload_importer):
00079 super(Main, self)._add_reload_paths(reload_importer)
00080 reload_importer.add_reload_path(os.path.join(os.path.dirname(__file__), *('..',) * 4))
00081
00082
00083 if __name__ == '__main__':
00084 main = Main()
00085 sys.exit(main.main())