Skip to content

Commit

Permalink
make calltips configurable in qtconsole
Browse files Browse the repository at this point in the history
adds FrontendWidget.enable_calltips configurable, with default behavior unchanged.

closes ipythongh-694
  • Loading branch information
minrk committed Aug 15, 2011
1 parent 32f3d05 commit f1c6119
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions IPython/frontend/qt/console/frontend_widget.py
Expand Up @@ -75,6 +75,9 @@ class FrontendWidget(HistoryConsoleWidget, BaseFrontendMixin):
""" A Qt frontend for a generic Python kernel.
"""

enable_calltips = Bool(True, config=True,
help="Whether to draw information calltips on open-parentheses.")

# An option and corresponding signal for overriding the default kernel
# interrupt behavior.
custom_interrupt = Bool(False)
Expand Down Expand Up @@ -508,6 +511,8 @@ def _call_tip(self):
""" Shows a call tip, if appropriate, at the current cursor location.
"""
# Decide if it makes sense to show a call tip
if not self.enable_calltips:
return False
cursor = self._get_cursor()
cursor.movePosition(QtGui.QTextCursor.Left)
if cursor.document().characterAt(cursor.position()) != '(':
Expand Down

0 comments on commit f1c6119

Please sign in to comment.