2.7. Details of File Commands

The scenarios in this section cover full details of file-related commands of the CSTutor, some of which have been introduced in preceding sections.

2.7.1. Save and Save As

A new tutorial is not associated with a file until it is saved for the first time. For new not-yet-saved tutorials, the `Save' and `Save As' commands have exactly the same effect. When the user selects either of these commands for a not-yet-saved tutorial, the system prompts the user for a save location using the standard file chooser. When the user presses `OK', the system saves the entire contents of the tutorial onto the named file. After completing the save, the system removes the save dialog from the screen. If the user enters the name of an existing tutorial file and presses `OK', the system asks for overwrite confirmation.

When the current tutorial is already associated with a file, the `Save' and `Save As' commands differ. The `Save' command is enabled whenever the current tutuorial is associated with a file, and the tutorial has unsaved changes. A tutorial has unsaved changes when the user has performed one or more of the following actions since the file was opened or the last confirmed save operation, whichever has occurred most recently:

  1. added a page
  2. deleted a page
  3. added a picture
  4. added a drawing
  5. edited a drawing
  6. removed a drawing
  7. added an interactive shell
  8. changed/edited language of interactive shell
If the user undoes any of these actions such that the state of the tutorial returns to the same state as most recently saved, then the tutorial no longer has unsaved changes. The "state" of the tutorial is defined as the values of all pages of a tutorial and tutorial-specific settings. It is noteworthy that the definition of unsaved change includes any an all actions that change pages or tutorial-specific settings.

When the user selects the enabled `Save' command in the `File' menu, the system saves the pages and settings for the current tutorial on the file associated with the tutorial.

The `Save As' command is enabled in the `File' menu whenever the current tutorial is not that of another user or group. `Save As' is enabled whether or not the current tutorial has unsaved changes.




Prev: error | Next: edit | Up: functional | Top: index