MCPcopy Create free account
hub / github.com/collin80/SavvyCAN / changeCurrentScript

Method changeCurrentScript

scriptingwindow.cpp:145–169  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

143}
144
145void ScriptingWindow::changeCurrentScript()
146{
147 ui->tableVariables->clear();
148 for (int i = 0; i < ui->tableVariables->rowCount(); i++) ui->tableVariables->removeRow(0);
149 QStringList labels;
150 labels.append("Parameter");
151 labels.append("Value");
152 ui->tableVariables->setHorizontalHeaderLabels(labels);
153
154 int sel = ui->listLoadedScripts->currentRow();
155 if (sel < 0) return;
156
157 if (currentScript) {
158 currentScript->scriptText = editor->toPlainText();
159 disconnect(this, SIGNAL(updateValueTable(QTableWidget*)), currentScript, SLOT(updateValuesTable(QTableWidget*)));
160 disconnect(this, SIGNAL(updatedParameter(QString,QString)), currentScript, SLOT(updateParameter(QString,QString)));
161 }
162
163 ScriptContainer *container = scripts.at(sel);
164 currentScript = container;
165 editor->setPlainText(container->scriptText);
166 editor->setEnabled(true);
167 connect(this, SIGNAL(updateValueTable(QTableWidget*)), currentScript, SLOT(updateValuesTable(QTableWidget*)));
168 connect(this, SIGNAL(updatedParameter(QString,QString)), currentScript, SLOT(updateParameter(QString,QString)));
169}
170
171void ScriptingWindow::valuesTimerElapsed()
172{

Callers

nothing calls this directly

Calls 4

appendMethod · 0.80
atMethod · 0.80
clearMethod · 0.45
rowCountMethod · 0.45

Tested by

no test coverage detected