Showing the changes to interface/src/ui/ScriptEditorWidget.cpp (1 of 4 files). Show all
Unified · Split
| @@ -219,12 +219,13 @@ void ScriptEditorWidget::onWindowActivated() { · 218 unmodified lines | ||
| 219 | 219 | _isReloading = true; |
| 220 | 220 | |
| 221 | 221 | if (QFileInfo(_currentScript).lastModified() > _currentScriptModified) { |
| 222 | − if (QMessageBox::warning(this, _currentScript, | |
| 223 | − tr("This file has been modified outside of the Interface editor.") + "\n\n" | |
| 224 | − +(isModified() | |
| 225 | − ? tr("Do you want to reload it and lose the changes you've made in the Interface editor?") | |
| 226 | − : tr("Do you want to reload it?")), | |
| 227 | − QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { | |
| 222 | + if (static_cast<ScriptEditorWindow*>(this->parent()->parent()->parent())->autoReloadScripts() | |
| 223 | + || QMessageBox::warning(this, _currentScript, | |
| 224 | + tr("This file has been modified outside of the Interface editor.") + "\n\n" | |
| 225 | + + (isModified() | |
| 226 | + ? tr("Do you want to reload it and lose the changes you've made in the Interface editor?") | |
| 227 | + : tr("Do you want to reload it?")), | |
| 228 | + QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { | |
| 228 | 229 | loadFile(_currentScript); |
| 229 | 230 | if (_scriptEditorWidgetUI->onTheFlyCheckBox->isChecked() && isRunning()) { |
| 230 | 231 | _isRestarting = true; |