Ejemplo n.º 1
0
def show_console():
    """ called from QGIS to open the console """
    global _console
    if _console is None:
        parent = iface.mainWindow() if iface else None
        _console = PythonConsole(parent)
        _console.show()  # force show even if it was restored as hidden
        # set focus to the console so the user can start typing
        # defer the set focus event so it works also whether the console not visible yet
        QTimer.singleShot(0, _console.activate)
    else:
        _console.setVisible(not _console.isVisible())
        # set focus to the console so the user can start typing
        if _console.isVisible():
            _console.activate()

    # Shows help on first launch of the console
    settings = QgsSettings()
    if settings.value('pythonConsole/contextHelpOnFirstLaunch',
                      True,
                      type=bool):
        QgsContextHelp.run("PythonConsole")
        settings.setValue('pythonConsole/contextHelpOnFirstLaunch', False)

    return _console
Ejemplo n.º 2
0
def show_console():
    """ called from QGIS to open the console """
    global _console
    if _console is None:
        parent = iface.mainWindow() if iface else None
        _console = PythonConsole(parent)
        _console.show() # force show even if it was restored as hidden
        # set focus to the console so the user can start typing
        # defer the set focus event so it works also whether the console not visible yet
        QTimer.singleShot(0, _console.activate)
    else:
        _console.setVisible(not _console.isVisible())
        # set focus to the console so the user can start typing
        if _console.isVisible():
            _console.activate()
    ## Shows help on first launch of the console
    settings = QSettings()
    if settings.value('pythonConsole/contextHelpOnFirstLaunch', True, type=bool):
        QgsContextHelp.run("PythonConsole")
        settings.setValue('pythonConsole/contextHelpOnFirstLaunch', False)
Ejemplo n.º 3
0
 def openHelp(self):
     QgsContextHelp.run("PythonConsole")
Ejemplo n.º 4
0
 def runHelp(self):
   """ open the context help browser """
   QgsContextHelp.run("QgsPluginInstallerDialog")
Ejemplo n.º 5
0
 def openHelp(self):
     QgsContextHelp.run("PythonConsole")
Ejemplo n.º 6
0
 def runHelp(self):
     """ open the context help browser """
     QgsContextHelp.run("QgsPluginInstallerDialog")