-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Changed the IPython completion option from a checkbox to a combobox #2237
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
Changes from all 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 |
---|---|---|
|
@@ -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 Type")) | ||
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_type', default=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. Please remove the Sorry I forgot to tell you before :-) |
||
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_type_o = CONF.get('ipython_console', 'completion_type') | ||
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_type_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 :-)