示例#1
0
void MainWindow::handleReloadPlugins(void)
{
    //close any open properties panel editor window
    _propertiesPanel->launchEditor(nullptr);

    //stop evaluation on all graph editor
    for (int i = 0; i < _editorTabs->count(); i++)
    {
        auto editor = qobject_cast<GraphEditor *>(_editorTabs->widget(i));
        if (editor != nullptr) editor->stopEvaluation();
    }

    //clear the block cache
    _blockCache->clear();

    //restart the local server
    this->setupServer();

    //reload the block cache
    _blockCache->update();

    //start evaluation on all graph editor
    for (int i = 0; i < _editorTabs->count(); i++)
    {
        auto editor = qobject_cast<GraphEditor *>(_editorTabs->widget(i));
        if (editor != nullptr) editor->restartEvaluation();
    }

    _logger.information("Reload plugins complete");
}
示例#2
0
ScriptConsole::ScriptConsole(QWidget *parent) :
    QDialog(parent)
{
    setupUi(this);

    setWindowTitle(tr("Script Console"));

    ScriptEngine::getInstance()->prepareThis(engine);

    QScriptValue myPrint = engine.newFunction(myPrintFunc);
    myPrint.setData(engine.newQObject(textEdit_OUTPUT));
    engine.globalObject().setProperty("print", myPrint);

    connect(pushButton_START, SIGNAL(clicked()), this, SLOT(startEvaluation()));
    connect(pushButton_STOP, SIGNAL(clicked()), this, SLOT(stopEvaluation()));
}