Tutorial management

In order to be useful, tutorials must be managed in some way so it can be know which ones are availables and execute them. Also, this system needs a setup so it can be used in the applications. Those things are made by this module.

Tutorials can be implemented in C++ or in a script language supported by Kross. However, a tutorial by itself does nothing. It must be started somehow, and to be started the user also has to know which tutorials are available.

KTutorial offers an automatic management system of the tutorials. A tutorial can be registered with a TutorialManager, and it takes care of executing it when needed. Scripted tutorials are registered automatically, although C++ tutorials must be registered explicitly. Apart from that, C++ and scripted tutorials are managed in the same way.

To execute a Tutorial, the manager starts it when the user selects it in the graphical user interface. When the Tutorial notifies the manager that it was finished, the manager itself propagates the notification to the objects connected to its finished signal.

Apart from executing them, a manager can be queried to know what tutorials are available. So Tutorial objects are associated with a TutorialInformation which contain the information about it, and also a unique identifier used to manage the Tutorial.

In order for KTutorial to work properly, it must be set up by the application using it. This is just informing KTutorial what is the main window of the application before the GUI of the application itself is set up. KTutorial will then create the needed menu entries so users can show the tutorial manager dialog.

Once set up, all the C++ tutorials in the application can be registered with KTutorial class. This class follows a Singleton design pattern and is the main access point for the applications to KTutorial system.

KTutorial class privately contains a TutorialManager that handles the register of tutorials, showing them to the user and their execution them, all of it transparently done for the application using KTutorial.

Here it is the final diagram for tutorial management design, that includes all the explained elements and shows (if size doesn't prevent it) the relations between each of them: