1. Components
    Upstart plugin has two executables. 
    One with UI "control-plugin-upstart"; 
    other without UI "apply-upstart-config".
    Third component is config file(s).

2. UI version
    UI version works as current one. Using interface user can select which 
    components are started by upstart.
    New functionality is menu that allows selection of config file (open & 
    save config file). When UI is started it opens current config file. 
    If one doesn't exists, it reads current upstart status and creates 
    new config file based on that.
    UI shows only components that are defined in config file.

3. Command line version
    This is started with one optional parameter that tells name of the config 
    file that should be applied.
    If no config file is given then current config file is used. If current one
    doesn't exist then new config file is created based on current upstart 
    config.
    Current upstart config is changed based on config file and after that 
    device is booted automatically.
    Booting happens only if there was any changes done to upstart.
    This makes it possible that command line version can be started as part of 
    upstart and rebooting happens only when needed. When cmd line version is
    run as part of the upstart, it should be run without any parameters.
    The config that should be applied is controlled by name of the current
    config file (see chapter "4. Config files").

4. Config files
    Default config file is 
    "/home/user/.control-plugin-upstart/upstart-plugin.conf"
    Config file has following format
    <event_file> {ON | OFF} ["name to be shown on UI"] 
    # comment line
    Example of config file

    af-services         ON    "AF-Services"
    alsaped             OFF 
    #bluetoothd         ON    "Bluetooth"
    # Line above has effect that Bluetooth is not shown on UI and its config 
    # is not changed.
    # Same effect is if event file is not listed at all

    If third parameter (UI name) is not given then UI shows same as is for 
    event_file. In example above alsaped is shown as alsaped.
    If event_file is not listed in config file or it is commented out (#) 
    then those are not shown in UI version and command line version will not 
    touch its current config. 

    Because system can have multiple config files and command line version
    can be run as part of the upstart we must have concept "current config 
    file". This is the config file that is used when UI is started. 
    Name of the file that stores this information is
    "/home/user/.control-plugin-upstart/.current-config-file-name.conf"

    Whenever Apply/Reboot is issued in UI or cmd line version run that file 
    becomes as current config file and is used during next boot.


5. Interactions
    UI has five buttons: OPEN, SAVE, SAVE AS, UNDO, APPLY/REBOOT
    Configuration information is stored in 3 places,
      - Upstart event files and their location (in active dir or in nop dir), 
        called "Upstart dirs"
      - Program internal data. This is what user sees on UI.
      - Config file

    Interaction between different UI & cmd line actions and config parts is 
    illustrated below
                                                             Name of the 
    Operation      Upstart dirs    UI       Config file    current config file

+   "UI started"                   <-------------<..............*
-   "OPEN"                         <-------------*
+   "Each click on UI"            *>
--  "SAVE/SAVE AS"                 *------------->
+   "UNDO"                         <-------------*
+   "APPLY/REBOOT"     <-----------*             *..............>
+   "Command line run 
     with file name"   <-----------<-------------*..............>
+   "Command line run
     w/o file name"    <-----------<-------------<..............*
++  "UI or cmd line
     run w/o file name *----------->------------->..............>
     and default config 
     file does not exist"
++  "Command line run with non existing file name"      Exit

    *    Information is read from here
    < >  Information is written to here
    ---  Config information
    ...  File name

6. Scenarios

   What should happen in this UI scenario
   1. User starts UI with current config file A
   2. Opens config B
   3. Does changes
   4. Press APPLY
   5. Answer save question No
   
   Should dirs be moved?
   What should be name of the current config file?

   Answer:
   We make UI so that reboot is not possible before user does Save or Undo.
   Then there is no change for misunderstanding how box will reboot.
