| 143 | } |
| 144 | |
| 145 | void 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 | |
| 171 | void ScriptingWindow::valuesTimerElapsed() |
| 172 | { |