History

Don't ask about differences over after the user has said no -- until the external file changes again.

Howard Stearns committed 10 years ago

Commit 0cbddb21 parent d59d5541 file · +10 −7Browse files

Showing the changes to interface/src/ui/ScriptEditorWidget.cpp (1 of 1 file). Show all

Unified · Split

interface/src/ui/ScriptEditorWidget.cpp+10−7
@@ -224,17 +224,18 @@ void ScriptEditorWidget::onWindowActivated() { · 223 unmodified lines
224224 if (!_isReloading) {
225225 _isReloading = true;
226226
227− if (QFileInfo(_currentScript).lastModified() > _currentScriptModified) {
227+ QDateTime fileStamp = QFileInfo(_currentScript).lastModified();
228+ if (fileStamp > _currentScriptModified) {
228229 bool doReload = false;
229230 auto window = static_cast<ScriptEditorWindow*>(this->parent()->parent()->parent());
230231 window->inModalDialog = true;
231232 if (window->autoReloadScripts()
232233 || OffscreenUi::question(this, tr("Reload Script"),
233− tr("The following file has been modified outside of the Interface editor:") + "\n" + _currentScript + "\n"
234− + (isModified()
235− ? tr("Do you want to reload it and lose the changes you've made in the Interface editor?")
236− : tr("Do you want to reload it?")),
237− QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
234+ tr("The following file has been modified outside of the Interface editor:") + "\n" + _currentScript + "\n"
235+ + (isModified()
236+ ? tr("Do you want to reload it and lose the changes you've made in the Interface editor?")
237+ : tr("Do you want to reload it?")),
238+ QMessageBox::Yes | QMessageBox::No) == QMessageBox::Yes) {
238239 doReload = true;
239240 }
240241 window->inModalDialog = false;
@@ -245,8 +246,10 @@ void ScriptEditorWidget::onWindowActivated() { · 4 unmodified lines
245246 setRunning(false);
246247 // Script is restarted once current script instance finishes.
247248 }
249+ } else {
250+ _currentScriptModified = fileStamp; // Asked and answered. Don't ask again until the external file is changed again.
248251 }
249252 }
250253 _isReloading = false;
251254 }
252−}
255+}