Path: utzoo!attcan!uunet!aplcen!uakari.primate.wisc.edu!gem.mps.ohio-state.edu!apple!sun-barr!decwrl!shelby!polya!ali From: ali@polya.Stanford.EDU (Ali T. Ozer) Newsgroups: comp.sys.next Subject: Re: Power-Off message to Apps Message-ID: <12846@polya.Stanford.EDU> Date: 17 Nov 89 07:46:43 GMT References: <6694@portia.Stanford.EDU> Reply-To: ali@Polya.Stanford.EDU (Ali T. Ozer) Organization: . Lines: 41 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"). Anyway, despite that an app can take its time quitting, perhaps if it needs to close some files and such. If it needs more than the default time provided, it can also ask for my time with the extendPowerOffBy: message, just like in 0.9 (and 0.8). >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. 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. Ali