Open moirage opened 8 years ago
Shouldn't this information be stored by the OS not by the application? Kind of like the argument for storing window position and the like?
Kevin is correct. This is the kind of information that should be stored in user preferences in the OS rather than in the XML saving the machine.
The information stored will likely be different for each machine the user creates, so there isn't one setting per user and instead there is one setting per machine. Currently, the node where preferences are saved is the one associated with the DesktopController. I suppose there should be a new child node of this node storing in its map the name of a machine as the key and the pane info as the value. This key/value pair should be updated whenever the machine is saved (to handle cases where the user changes the name of the machine). Is this standard practice with preferences? I haven't used preferences outside of CPU Sim.
Usually, the "desktop environment" handles windows and where the live. For example, if you open MSWord and close it. It'll open in the same place. The "dialogs" that are used are not bound by the same rules since they automatically get placed over top of the parent window (this is what dialogs are supposed to do). Additionally, when you open a machine between machines, it can cause some "strange" behaviour to show up, particularly if there are different resolutions in play.
So, a better solution than to store this information within the machine files would be to actually let the OS store all of these.. maybe switching the Dialogs to Windows. I was also curious, and came across this library: https://github.com/RobertBColton/DockFX. Might be a neat idea to investigate, too.
Alternately, this information could be stored in a settings file within the Preferences API: https://docs.oracle.com/javase/8/docs/technotes/guides/preferences/overview.html. Should probably do this anyway for non-machine specific configuration data.
E: Looks like Preferences is already used (I haven't looked into that code, yet).
Fix the DTD for saving machines to files as follows (this is low priority):