| 6505 | } |
| 6506 | |
| 6507 | void ShaderViewer::on_resetEdits_clicked() |
| 6508 | { |
| 6509 | QMessageBox::StandardButton res = |
| 6510 | RDDialog::question(this, tr("Are you sure?"), |
| 6511 | tr("Are you sure you want to reset all edits and restore the " |
| 6512 | "shader source back to the original?"), |
| 6513 | QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel); |
| 6514 | |
| 6515 | if(res != QMessageBox::Yes) |
| 6516 | return; |
| 6517 | |
| 6518 | for(ScintillaEdit *s : m_Scintillas) |
| 6519 | { |
| 6520 | QWidget *w = (QWidget *)s; |
| 6521 | s->selectAll(); |
| 6522 | s->replaceSel(w->property("origText").toString().toUtf8().data()); |
| 6523 | } |
| 6524 | |
| 6525 | m_RevertCallback(&m_Ctx, this, m_EditingShader); |
| 6526 | |
| 6527 | m_Modified = false; |
| 6528 | m_Saved = false; |
| 6529 | |
| 6530 | updateEditState(); |
| 6531 | } |
| 6532 | |
| 6533 | void ShaderViewer::on_unrefresh_clicked() |
| 6534 | { |