.. | .. |
---|
297 | 297 | client = inClient; |
---|
298 | 298 | copy = client; |
---|
299 | 299 | |
---|
300 | | - if (copy.versionlist == null) |
---|
301 | | - { |
---|
302 | | - copy.versionlist = new Object3D[100]; |
---|
303 | | - copy.versionindex = -1; |
---|
304 | | - } |
---|
| 300 | +// if (copy.versionlist == null) |
---|
| 301 | +// { |
---|
| 302 | +// copy.versionlist = new Object3D[100]; |
---|
| 303 | +// copy.versionindex = -1; |
---|
| 304 | +// |
---|
| 305 | +// callee.Save(true); |
---|
| 306 | +// } |
---|
305 | 307 | |
---|
306 | 308 | // "this" is not called: SetupUI2(objEditor); |
---|
307 | 309 | } |
---|
.. | .. |
---|
320 | 322 | { |
---|
321 | 323 | copy.versionlist = new Object3D[100]; |
---|
322 | 324 | copy.versionindex = -1; |
---|
| 325 | + |
---|
| 326 | +// Save(true); |
---|
323 | 327 | } |
---|
324 | 328 | |
---|
325 | 329 | SetupUI2(callee.GetEditor()); |
---|
.. | .. |
---|
354 | 358 | copy = localCopy; |
---|
355 | 359 | copy.editWindow = this; |
---|
356 | 360 | |
---|
357 | | - if (copy.versionlist == null) |
---|
358 | | - { |
---|
359 | | -// copy.versions = new byte[100][]; |
---|
| 361 | +// if (copy.versionlist == null) |
---|
| 362 | +// { |
---|
| 363 | +// copy.versionlist = new Object3D[100]; |
---|
360 | 364 | // copy.versionindex = -1; |
---|
361 | | - } |
---|
| 365 | +// |
---|
| 366 | +// Save(true); |
---|
| 367 | +// } |
---|
362 | 368 | |
---|
363 | 369 | SetupMenu(); |
---|
364 | 370 | |
---|
.. | .. |
---|
445 | 451 | // EditSelection(false); |
---|
446 | 452 | // } |
---|
447 | 453 | |
---|
448 | | - refreshContents(false); // To refresh Info tab |
---|
| 454 | +// refreshContents(false); // To refresh Info tab |
---|
449 | 455 | } |
---|
450 | 456 | }; |
---|
451 | 457 | objectPanel.addChangeListener(changeListener); |
---|
.. | .. |
---|
4161 | 4167 | System.err.println("Save"); |
---|
4162 | 4168 | Replace(); |
---|
4163 | 4169 | |
---|
4164 | | - cRadio tab = GetCurrentTab(); |
---|
| 4170 | + //cRadio tab = GetCurrentTab(); |
---|
4165 | 4171 | |
---|
4166 | 4172 | Object3D compress = Duplicate(copy); // Saved version. No need for "Replace"? |
---|
4167 | 4173 | |
---|
.. | .. |
---|
4328 | 4334 | |
---|
4329 | 4335 | void SetUndoStates() |
---|
4330 | 4336 | { |
---|
4331 | | - cRadio tab = GetCurrentTab(); |
---|
| 4337 | + //if (true) |
---|
| 4338 | + // return; |
---|
| 4339 | + |
---|
| 4340 | + //cRadio tab = GetCurrentTab(); |
---|
4332 | 4341 | |
---|
4333 | | - restoreButton.setEnabled(true); // copy.versionindex != -1); |
---|
4334 | | - replaceButton.setEnabled(true); // copy.versionindex != -1); |
---|
| 4342 | + restoreButton.setEnabled(copy.versionindex != -1); |
---|
| 4343 | + replaceButton.setEnabled(copy.versionindex != -1); |
---|
4335 | 4344 | |
---|
4336 | 4345 | previousVersionButton.setEnabled(copy.versionindex > 0); |
---|
4337 | 4346 | nextVersionButton.setEnabled(copy.versionlist[copy.versionindex + 1] != null); |
---|
.. | .. |
---|
4340 | 4349 | copy.versionlist[copy.versionindex + 1] != null); |
---|
4341 | 4350 | |
---|
4342 | 4351 | muteSlider = true; |
---|
| 4352 | + versionSlider.setMinimum(0); |
---|
4343 | 4353 | versionSlider.setMaximum(VersionCount() - 1); |
---|
4344 | 4354 | versionSlider.setInteger(copy.versionindex); |
---|
| 4355 | + versionSlider.setEnabled(copy.versionindex != -1); |
---|
4345 | 4356 | muteSlider = false; |
---|
4346 | 4357 | } |
---|
4347 | 4358 | |
---|
.. | .. |
---|
4352 | 4363 | |
---|
4353 | 4364 | System.err.println("Undo"); |
---|
4354 | 4365 | |
---|
4355 | | - cRadio tab = GetCurrentTab(); |
---|
| 4366 | + //cRadio tab = GetCurrentTab(); |
---|
4356 | 4367 | |
---|
4357 | 4368 | if (copy.versionindex == 0) |
---|
4358 | 4369 | { |
---|
.. | .. |
---|
4384 | 4395 | { |
---|
4385 | 4396 | System.err.println("Restore"); |
---|
4386 | 4397 | |
---|
4387 | | - cRadio tab = GetCurrentTab(); |
---|
| 4398 | + //cRadio tab = GetCurrentTab(); |
---|
4388 | 4399 | |
---|
4389 | 4400 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4390 | 4401 | { |
---|
.. | .. |
---|
4402 | 4413 | { |
---|
4403 | 4414 | System.err.println("Replace"); |
---|
4404 | 4415 | |
---|
4405 | | - cRadio tab = GetCurrentTab(); |
---|
| 4416 | + //cRadio tab = GetCurrentTab(); |
---|
4406 | 4417 | |
---|
4407 | 4418 | if (copy.versionindex == -1 || copy.versionlist[copy.versionindex] == null) |
---|
4408 | 4419 | { |
---|
.. | .. |
---|
4420 | 4431 | // Option? |
---|
4421 | 4432 | Replace(); |
---|
4422 | 4433 | |
---|
4423 | | - cRadio tab = GetCurrentTab(); |
---|
| 4434 | + //cRadio tab = GetCurrentTab(); |
---|
4424 | 4435 | |
---|
4425 | 4436 | if (copy.versionlist[copy.versionindex + 1] == null) |
---|
4426 | 4437 | { |
---|
.. | .. |
---|
4741 | 4752 | |
---|
4742 | 4753 | int version = versionSlider.getInteger(); |
---|
4743 | 4754 | |
---|
4744 | | - if (copy.versionlist[version] != null) |
---|
| 4755 | + if (version != -1 && copy.versionlist[version] != null) |
---|
4745 | 4756 | { |
---|
4746 | 4757 | copy.versionindex = version; |
---|
4747 | 4758 | CopyChanged(); |
---|
.. | .. |
---|
5489 | 5500 | |
---|
5490 | 5501 | if (copy.versionlist == null) |
---|
5491 | 5502 | { |
---|
| 5503 | + // Backward compatibility |
---|
5492 | 5504 | copy.versionlist = new Object3D[100]; |
---|
5493 | 5505 | copy.versionindex = -1; |
---|
| 5506 | + |
---|
| 5507 | + Save(true); |
---|
5494 | 5508 | } |
---|
5495 | 5509 | |
---|
5496 | 5510 | //? SetUndoStates(); |
---|