Path: utzoo!yunexus!ists!jarvis.csri.toronto.edu!rutgers!ucsd!tut.cis.ohio-state.edu!gem.mps.ohio-state.edu!apple!sun-barr!decwrl!shelby!lindy!liemandt From: liemandt@lindy.Stanford.EDU (Joe Liemandt) Newsgroups: comp.sys.next Subject: Re: Power-Off message to Apps Message-ID: <5844@lindy.Stanford.EDU> Date: 17 Nov 89 09:54:01 GMT Article-I.D.: lindy.5844 References: <6694@portia.Stanford.EDU> <12846@polya.Stanford.EDU> Sender: news@lindy.Stanford.EDU (News Service) Reply-To: liemandt@lindy.Stanford.EDU (Joe Liemandt) Organization: Stanford University Lines: 86 In article <12846@polya.Stanford.EDU> ali@Polya.Stanford.EDU (Ali T. Ozer) writes: >In article <6694@portia.Stanford.EDU> John Lynch writes: >>I may have missed this discussion earlier, but I was wondering if anyone >>knows what(if any) messages the Worskpace Manager sends to the running >>applications when the user hits the power off switch. From the alert panel >>that gets displayed and its statement that "all unsaved changes will be lost", >>one would get the impression that all the Manager does is kill all of the >>current processes. > >When the user tries to log out or power off the machine, the Workspace Manager >sends a powerOffIn:andSave: method to all the apps started from the Workspace >Manager itself. The default implementation of this method in Application >causes the appPowerOffIn:andSave: method to be called in the app's delegate >with the same arguments sent from the Workspace Manager. The first argument >specifies the time remaining before the app will be killed, unless the app >quits on its own accord earlier. The second argument specifies if the user >wants all files saved or not. In 0.9, this argument would be YES or NO >depending how the user replied to the "Cancel / Save / Don't Save" panel. >In 1.0, this argument is always NO, indicating that the apps should not try >to save unsaved documents (hence the Workspace's warning, "all unsaved changes >will be lost"). This seems to be less than optimal. I do not always remember or know if changes were made or need to be saved. I often hide a window or application and could easily forget to save it. Example: I write a paper in WriteNow, hide it, open another, make changes. If I logout, the NeXT is not going to tell me I have unsaved changes. Even if I remember to save the current window, I will probably forget to save the hidden one. Or what if someone wants to logout of my machine and log themselves in. they have no way of knowing what I have changed. I like the Macintosh solution of going through each app and posting a quit event. It is much easier for the computer to prompt me for changes rather than trying to remember where I made changes, going there and saving them. When I am tired, I make stupid mistakes, please save me from them. >>I've heard that in 0.8, there was more support for saving changes on >>power off but that it was taken out for 0.9 and 1.0. If this is true, does >>anyone know the rationale for the change? > >Rather than having the user hit "Save" on the Logout panel and have all the >apps try to save their files within a finite time, it's better to have the >user explicitly save the documents that need to be saved and not deal with >the documents that don't need to be saved. It might very well be the case >that you don't want to save all the changes; only some of them. When I quit, I should get the yes,no, cancel dialog for each window of each app with changes. I can save only the ones I want. >And, as you can see from above, the apps do have time to clean up and tie >loose ends; hitting "Logout" doesn't cause the Workspace to immediately >blast away all the running apps. Apps have time to clean up, but all unsaved changes are lost. > >Ali The problem with my solution is that is does not guarantee that the machine will ever logout/powerdown. I could leave a dialog up and not respond to it and hang the logout. I think this could be solved by adding a button to the logout dialog. So now it has three choices: Logout - do not save changes (how it works now) Save if changes - post a quit to each app and let it deal Cancel - Cancel shutdown Logout - guarantees that the machine will shutdown Save - no guarantee Cancel - guaranteed not to shutdown. This just seems a better way. With the NeXT, I keep many applications open/hidden. I am confident about the machine not bombing, so I am less careful than I am on my Mac. But I can just see having lots of open unsaved windows/applications, and then logging out and losing it. Why not just add the button? Joe Liemandt Stanford University