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 | _isReloading = true; | 219 | _isReloading = true; |
| 220 | 220 | ||
| 221 | if (QFileInfo(_currentScript).lastModified() > _currentScriptModified) { | 221 | if (QFileInfo(_currentScript).lastModified() > _currentScriptModified) { |
| 222 | if (QMessageBox::warning(this, _currentScript, | 222 | if (static_cast<ScriptEditorWindow*>(this->parent()->parent()->parent())->autoReloadScripts() |
| 223 | tr("This file has been modified outside of the Interface editor.") + "\n\n" | 223 | || QMessageBox::warning(this, _currentScript, |
| 224 | +(isModified() | 224 | tr("This file has been modified outside of the Interface editor.") + "\n\n" |
| 225 | ? tr("Do you want to reload it and lose the changes you've made in the Interface editor?") | 225 | + (isModified() |
| 226 | : tr("Do you want to reload it?")), | 226 | ? tr("Do you want to reload it and lose the changes you've made in the Interface editor?") |
| 227 | QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { | 227 | : tr("Do you want to reload it?")), |
| 228 | QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) { | ||
| 228 | loadFile(_currentScript); | 229 | loadFile(_currentScript); |
| 229 | if (_scriptEditorWidgetUI->onTheFlyCheckBox->isChecked() && isRunning()) { | 230 | if (_scriptEditorWidgetUI->onTheFlyCheckBox->isChecked() && isRunning()) { |
| 230 | _isRestarting = true; | 231 | _isRestarting = true; |