Hi Chris,
We made some changes to the code so that the various plugins remember where they were, and it also remembers which plugins you want open.
The relevant code tree is in
http://github.com/jonhendry/MWorks/tree/8e66ba3cfc6585943511cc603de7985fb4762d61
Can you merge this in?
Thanks,
Jon
Thanks, Jon. I’ll take a look at your patch.
Chris
[From Jon]
Hi Chris,
Here are some more patches for window-position-saving, for mw_cocoa, mw_client_plugins (Behavior Window and Variables Window), and mw_client.
The code also makes the Variables Window expand the outline view automatically.
I think I may have left these out of the last patch I sent.
Jon
Thanks, Jon. This seems like a good change. Unfortunately, there’s been a bunch of higher-priority stuff on my to-do list, and I haven’t gotten to this yet.
One comment: Your initial patch (and perhaps the new ones, too?) is against the “0.4.3” codebase and can’t be applied to the latest code. Any chance you can update your patches to work with the latest code on GitHub? If not, I’ll have to re-implement your changes.
Thanks,
Chris
Hi Chris,
Good news: My latest patches are from a clone of the 0.4.4 master branch.
Hi Jon,
Sorry for not getting back to you about this sooner.
I just took a look at your patches. I already implemented saving the position and size of plugin windows in this commit, so your mw_cocoa patch and some of your mw_client_plugins patch aren’t necessary.
The net effect of your changes to the variables window seems to be that all variable groups are always expanded; if you try to close one, it immediately reopens. That doesn’t seem like the right behavior to me. Was that your intent?
As for the mw_client patch, I agree that the open/closed state of client windows should be preserved, both within and between sessions. However, I think that you need to serialize the list of “preferred” windows using something more robust than simple numeric indices. I’ll think about a different approach.
Chris
However, I think that you need to serialize the list of “preferred” windows using something more robust than simple numeric indices.
Actually, it looks like you aren’t persisting that list at all, although you do try to read it from the preferences at startup. Did you decide against saving window state between MWClient sessions, or is it just not fully implemented?
Chris
Chris,
mw_client’s AppController should have this method to persist the default:
// Write the open plugin list to the defaults database.
-
(void)applicationWillTerminate:(NSNotification *)aNotification
{
if (modalClientInstanceInCharge != nil) {
// Record what plugin windows are open to the defaults database
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
[modalClientInstanceInCharge updateOpenPlugins];
[defaults setObject:[NSKeyedArchiver archivedDataWithRootObject:[modalClientInstanceInCharge openPlugins]] forKey:@“MWOpenPlugins”];
[defaults synchronize];
}
}
I see your point about the indices. Names would probably be better, in case the ordering changes.
WRT the Variables window, the intent was simply to have it default to being open. I suppose Mark’s usage pattern is to keep the outline expanded, and having to expand the outline every time was tiresome.