Ejemplo n.º 1
0
 def trigger_configuration(self):
     dialog = SimpleSettingsDialog(title='Shell Options')
     dialog.add_exclusive_option_group(title='Shell Type', options=self.shell_types, selected_index=self._shell_type_index)
     shell_type = dialog.get_settings()[0]
     if shell_type is not None and self._shell_type_index != shell_type['selected_index']:
         self._shell_type_index = shell_type['selected_index']
         self._context.reload_plugin()
 def trigger_configuration(self):
     options = [
         {
             'title': 'SpyderConsole',
             'description':
             'Advanced Python console with tab-completion (needs spyderlib to be installed).',
             'enabled': _has_spyderlib
         },
         {
             'title': 'PyConsole',
             'description': 'Simple Python console.'
         },
     ]
     dialog = SimpleSettingsDialog(title='PyConsole Options')
     dialog.add_exclusive_option_group(
         title='Console Type',
         options=options,
         selected_index=int(not self._use_spyderlib))
     console_type = dialog.get_settings()[0]
     new_use_spyderlib = {
         0: True,
         1: False
     }.get(console_type['selected_index'], self._use_spyderlib)
     if self._use_spyderlib != new_use_spyderlib:
         self._use_spyderlib = new_use_spyderlib
         self._switch_console_widget()
Ejemplo n.º 3
0
 def trigger_configuration(self):
     dialog = SimpleSettingsDialog(title='Plot Options')
     dialog.add_exclusive_option_group(title='Plot Type',
                                       options=self.plot_types,
                                       selected_index=self._plot_type_index)
     plot_type = dialog.get_settings()[0]
     if plot_type is not None and plot_type[
             'selected_index'] is not None and self._plot_type_index != plot_type[
                 'selected_index']:
         self._switch_data_plot_widget(plot_type['selected_index'])
Ejemplo n.º 4
0
 def trigger_configuration(self):
     options = [
         {'title': 'SpyderConsole', 'description': 'Advanced Python console with tab-completion (needs spyderlib to be installed).', 'enabled': _has_spyderlib},
         {'title': 'PyConsole', 'description': 'Simple Python console.'},
     ]
     dialog = SimpleSettingsDialog(title='PyConsole Options')
     dialog.add_exclusive_option_group(title='Console Type', options=options, selected_index=int(not self._use_spyderlib))
     console_type = dialog.get_settings()[0]
     new_use_spyderlib = {0: True, 1: False}.get(console_type['selected_index'], self._use_spyderlib)
     if self._use_spyderlib != new_use_spyderlib:
         self._use_spyderlib = new_use_spyderlib
         self._switch_console_widget()
Ejemplo n.º 5
0
    def doSettingsDialog(self):
        """Present the user with a dialog for choosing the plot backend

        This displays a SimpleSettingsDialog asking the user to choose a
        plot type, gets the result, and updates the plot type as necessary
        
        This method is blocking"""

        marker_settings = [
            {
                'title': 'Show Plot Markers',
                'description': 'Warning: Displaying markers in rqt_plot may cause\n \t high cpu load, especially using PyQtGraph\n',
                'enabled': True,
            }]
        if self._markers_on:
            selected_checkboxes = [0]
        else:
            selected_checkboxes = []

        dialog = SimpleSettingsDialog(title='Plot Options')
        dialog.add_exclusive_option_group(title='Plot Type', options=self.plot_types, selected_index=self._plot_index)
        dialog.add_checkbox_group(title='Plot Markers', options=marker_settings, selected_indexes=selected_checkboxes)
        [plot_type, checkboxes] = dialog.get_settings()
        if plot_type is not None and plot_type['selected_index'] is not None and self._plot_index != plot_type['selected_index']:
            self._switch_data_plot_widget(plot_type['selected_index'], 0 in checkboxes['selected_indexes'])
        else:
            if checkboxes is not None and self._markers_on != (0 in checkboxes['selected_indexes']):
                self._switch_plot_markers(0 in checkboxes['selected_indexes'])