diff --git a/python/console/__init__.py b/python/console/__init__.py index e2f7bf4cd4a..a206a3c7ffb 100644 --- a/python/console/__init__.py +++ b/python/console/__init__.py @@ -19,5 +19,4 @@ __author__ = "Salvatore Larosa" __date__ = "September 2012" __copyright__ = "(C) 2012, Salvatore Larosa" -from .console import show_console # NOQA -from .console import init_options_widget +from .console import show_console, init_console # NOQA diff --git a/python/console/console.py b/python/console/console.py index ea614d4390a..c2fdfd8c014 100644 --- a/python/console/console.py +++ b/python/console/console.py @@ -106,8 +106,11 @@ def console_displayhook(obj): _console_output = obj -def init_options_widget(): - """called from QGIS to add the console options widget""" +def init_console(): + """ + Called from QGIS to initialize the console related options and shortcuts, + before the dock is shown + """ global _options_factory _options_factory.setTitle(QCoreApplication.translate("PythonConsole", "Python")) iface.registerOptionsWidgetFactory(_options_factory) diff --git a/src/app/qgisapp.cpp b/src/app/qgisapp.cpp index 41c86478072..96d30c8d9e3 100644 --- a/src/app/qgisapp.cpp +++ b/src/app/qgisapp.cpp @@ -3247,7 +3247,7 @@ void QgisApp::showStyleManager() void QgisApp::initPythonConsoleOptions() { QgsPythonRunner::run( QStringLiteral( "import console" ) ); - QgsPythonRunner::run( QStringLiteral( "console.init_options_widget()" ) ); + QgsPythonRunner::run( QStringLiteral( "console.init_console()" ) ); } void QgisApp::showPythonDialog()