Skip to content

Commit

Permalink
Changed the completion option from a checkbox to a combobox
Browse files Browse the repository at this point in the history
  • Loading branch information
David Hirschfeld committed Mar 12, 2015
1 parent 148df40 commit 8b316c2
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 11 deletions.
2 changes: 1 addition & 1 deletion spyderlib/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ def is_ubuntu():
'font/italic': False,
'font/bold': False,
'show_banner': True,
'use_gui_completion': True,
'completion_widget': 0,
'use_pager': False,
'show_calltips': True,
'ask_before_closing': True,
Expand Down
20 changes: 13 additions & 7 deletions spyderlib/plugins/ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,6 @@ def setup_page(self):
banner_box = newcb(_("Display initial banner"), 'show_banner',
tip=_("This option lets you hide the message shown at\n"
"the top of the console when it's opened."))
gui_comp_box = newcb(_("Use a completion widget"),
'use_gui_completion',
tip=_("Use a widget instead of plain text "
"output for tab completion"))
pager_box = newcb(_("Use a pager to display additional text inside "
"the console"), 'use_pager',
tip=_("Useful if you don't want to fill the "
Expand All @@ -180,12 +176,22 @@ def setup_page(self):

interface_layout = QVBoxLayout()
interface_layout.addWidget(banner_box)
interface_layout.addWidget(gui_comp_box)
interface_layout.addWidget(pager_box)
interface_layout.addWidget(calltips_box)
interface_layout.addWidget(ask_box)
interface_group.setLayout(interface_layout)

comp_group = QGroupBox(_("Completion Widget"))
comp_label = QLabel(_("Decide what type of completion to use"))
comp_label.setWordWrap(True)
completers = [("plain", 0), ("droplist", 1), ("ncurses", 2)]
comp_box = self.create_combobox(_("Completion:")+" ", completers,
'completion_widget', default=0)
comp_layout = QVBoxLayout()
comp_layout.addWidget(comp_label)
comp_layout.addWidget(comp_box)
comp_group.setLayout(comp_layout)

# Background Color Group
bg_group = QGroupBox(_("Background color"))
light_radio = self.create_radiobutton(_("Light background"),
Expand Down Expand Up @@ -438,8 +444,8 @@ def setup_page(self):

# --- Tabs organization ---
tabs = QTabWidget()
tabs.addTab(self.create_tab(font_group, interface_group, bg_group,
source_code_group), _("Display"))
tabs.addTab(self.create_tab(font_group, interface_group, comp_group,
bg_group, source_code_group), _("Display"))
tabs.addTab(self.create_tab(pylab_group, backend_group, inline_group),
_("Graphics"))
tabs.addTab(self.create_tab(run_lines_group, run_file_group),
Expand Down
6 changes: 3 additions & 3 deletions spyderlib/widgets/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -692,9 +692,9 @@ def shellwidget_config(self):
spy_cfg.IPythonWidget.kind = 'rich'

# Gui completion widget
gui_comp_o = self.get_option('use_gui_completion')
completions = {True: 'droplist', False: 'ncurses'}
spy_cfg.IPythonWidget.gui_completion = completions[gui_comp_o]
completion_widget_o = CONF.get('ipython_console', 'completion_widget')
completions = {0: "plain", 1: "droplist", 2: "ncurses"}
spy_cfg.IPythonWidget.gui_completion = completions[completion_widget_o]

# Pager
pager_o = self.get_option('use_pager')
Expand Down

0 comments on commit 8b316c2

Please sign in to comment.