| 323 | } |
| 324 | |
| 325 | void ScriptingWindow::revertScript() |
| 326 | { |
| 327 | QMessageBox msgBox; |
| 328 | msgBox.setText("Are you sure you'd like to revert?"); |
| 329 | msgBox.setInformativeText("Really do it?"); |
| 330 | msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No); |
| 331 | msgBox.setDefaultButton(QMessageBox::Cancel); |
| 332 | int ret = msgBox.exec(); |
| 333 | switch (ret) |
| 334 | { |
| 335 | case QMessageBox::Yes: |
| 336 | //just grab the last stored copy of the script (last compiled version) and replace current text with that text |
| 337 | editor->setPlainText(currentScript->scriptText); |
| 338 | break; |
| 339 | case QMessageBox::No: |
| 340 | break; |
| 341 | default: |
| 342 | // should never be reached |
| 343 | break; |
| 344 | } |
| 345 | } |
| 346 | |
| 347 | void ScriptingWindow::recompileScript() |
| 348 | { |