-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changed the IPython completion option from a checkbox to a combobox #2237
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -271,7 +271,7 @@ def is_ubuntu(): | |
'font/italic': False, | ||
'font/bold': False, | ||
'show_banner': True, | ||
'use_gui_completion': True, | ||
'completion_widget': 0, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Per the previous comment, please change this option's name to |
||
'use_pager': False, | ||
'show_calltips': True, | ||
'ask_before_closing': True, | ||
|
@@ -715,7 +715,7 @@ def is_ubuntu(): | |
# 2. If you want to *remove* options that are no longer needed in our codebase, | ||
# you need to do a MAJOR update in version, e.g. from 3.0.0 to 4.0.0 | ||
# 3. You don't need to touch this value if you're just adding a new option | ||
CONF_VERSION = '16.1.0' | ||
CONF_VERSION = '17.0.0' | ||
|
||
# XXX: Previously we had load=(not DEV) here but DEV was set to *False*. | ||
# Check if it *really* needs to be updated or not | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,10 +161,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 " | ||
|
@@ -177,12 +173,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")) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because of the text below, this should be called Completion type, instead of Completion widget. I mean, the completion widget is only one type of completion |
||
comp_label = QLabel(_("Decide what type of completion to use")) | ||
comp_label.setWordWrap(True) | ||
completers = [("Graphical", 0), ("Terminal", 1), ("Plain", 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"), | ||
|
@@ -435,8 +441,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), | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -682,9 +682,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: "droplist", 1: "ncurses", 2: "plain"} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note that these values remain the same as IPython ends up validating them against an Enum traitlet so the renaming only happens at the spyder/combobox level. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, there's no problem here because this is done internally. The problem is in the GUI, that's why I added my comment above :-) |
||
spy_cfg.IPythonWidget.gui_completion = completions[completion_widget_o] | ||
|
||
# Pager | ||
pager_o = self.get_option('use_pager') | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given that you're removing an option, you need to bump
CONF_VERSION
below.See the comment above it to learn how to that :-)