| 4315 | |
| 4316 | |
| 4317 | void Widget::reloadProgram(XL::Tree *newProg) |
| 4318 | // ---------------------------------------------------------------------------- |
| 4319 | // Set the program to reload |
| 4320 | // ---------------------------------------------------------------------------- |
| 4321 | { |
| 4322 | if (sourceChanged()) |
| 4323 | return; |
| 4324 | |
| 4325 | if (!newProg) |
| 4326 | { |
| 4327 | // We want to force a clone so that we recompile everything |
| 4328 | normalizeProgram(); |
| 4329 | } |
| 4330 | |
| 4331 | // Check if we can simply change some parameters in the tree |
| 4332 | else if (Tree *prog = xlProgram->tree) |
| 4333 | { |
| 4334 | ApplyChanges changes(newProg); |
| 4335 | if (!prog->Do(changes)) |
| 4336 | { |
| 4337 | // Need a big hammer, i.e. reload the complete program |
| 4338 | newProg->SetSymbols(prog->Symbols()); |
| 4339 | xlProgram->tree = newProg; |
| 4340 | } |
| 4341 | } |
| 4342 | |
| 4343 | // Now update the window |
| 4344 | updateProgramSource(); |
| 4345 | refreshNow(); |
| 4346 | clearErrors(); |
| 4347 | } |
| 4348 | |
| 4349 | |
| 4350 | void Widget::updateProgramSource(bool notWhenHidden) |
no test coverage detected