CURA-5280
Remove the machine prefix in the base name, otherwise when the machine
gets changed, the job name will become
"<new-machine>_<old_machine>_basename".
Manual override of job name should also set the base name so that when the printer prefix is updated, it the prefix can be added to the manually added name, not the old base name.
This was a bit tricky because if you enter a job name, is that the job name or the base name? My answer is that it's both, and if you update your printer for the job, it will append a new prefix.
If this is not the desired behavior, and in fact once a custom name is set nothing can change it, then line 78 should be removed.
several instances need to be created.
- In the ThreeMFWorkspaceReader we need to create some temporal
instances of Preferences that makes it not singleton anymore.
- The current preferences are kept in the Application class and so all
the calls to the preferences are changed to get the preferences from
Application.
- The method getInstance in Preferences is kept as deprecated since some
external plugins.
- Create SingleInstance class to handling single instance stuff.
- Instead of calling getInstance() everywhere, initialize each object
explicitly in order when application starts and getInstance()s do not
create instances any more and they merely return the created
instances.
- Only set initial values in construtor functions __init__(). Move the
initialization of context-aware (i.e. things that depend on other
things) to separate functions.
- Split application creation and initialziation into several steps and
them should be called explicitly in the correct order.
Scan for 'ultimaker' in the name. If found, add 'UM' to abbreviation, and scan again for a number after 'ultimaker' (e.g. 'ultimaker3'). If found, add the number as well. If 'ultimaker' is not found, take either the first 4 letters of the name or first letter.
We shouldn't delete the singleton PrintInformation object. We should rather just zero out the print information. And instead of doing that explicitly in deleteAll, listen to scene changes from PrintInformation in order to keep the logic related to the print information contained within its class.
Contributes to issue CURA-4810.