This class controls the workflow of each file. More...
#include <WorkflowManager.h>
Public Member Functions | |
Workflow | determineWorkflow (App::Document *doc) |
Asserts the workflow of the document to be determined and prompt user to migrate if it is not modern. More... | |
void | forceWorkflow (const App::Document *doc, Workflow wf) |
Force the desired workflow in document. More... | |
Workflow | getWorkflowForDocument (App::Document *doc) |
Lookup the workflow of the document in the map. More... | |
virtual | ~WorkflowManager () |
Init, Destruct an Access methods | |
static void | init () |
Creates an instance of the manager, should be called before any instance() More... | |
static WorkflowManager * | instance () |
Return an instance of the WorkflofManager. More... | |
static void | destruct () |
destroy the manager More... | |
This class controls the workflow of each file.
It has been introduced to support legacy files migrating to the new workflow.
|
virtual |
|
static |
destroy the manager
Referenced by PartDesignGui::Workbench::~Workbench().
Workflow WorkflowManager::determineWorkflow | ( | App::Document * | doc | ) |
Asserts the workflow of the document to be determined and prompt user to migrate if it is not modern.
If workflow was already chosen return it. If the guesed workflow is Workflow::Legacy or Workflow::Mixed the user will be prompted to migrate. If the user agrees the file will be migrated and the workflow will be set as modern. If the user refuses to migrate use the old workflow.
References Gui::Application::commandManager(), Gui::getMainWindow(), getWorkflowForDocument(), Gui::Application::Instance, PartDesignGui::Legacy, PartDesignGui::Modern, Gui::CommandManager::runCommandByName(), and PartDesignGui::Undetermined.
Referenced by PartDesignGui::assureLegacyWorkflow(), and PartDesignGui::assureModernWorkflow().
void WorkflowManager::forceWorkflow | ( | const App::Document * | doc, |
Workflow | wf | ||
) |
Force the desired workflow in document.
Workflow WorkflowManager::getWorkflowForDocument | ( | App::Document * | doc | ) |
Lookup the workflow of the document in the map.
If the document not in the map yet return Workflow::Undetermined.
References PartDesignGui::Undetermined.
Referenced by determineWorkflow(), PartDesignGui::isLegacyWorkflow(), and PartDesignGui::isModernWorkflow().
|
static |
Creates an instance of the manager, should be called before any instance()
Referenced by PartDesignGui::Workbench::activated(), instance(), and DocumentObject.DocumentObject::onChanged().
|
static |
Return an instance of the WorkflofManager.
References init().
Referenced by PartDesignGui::assureLegacyWorkflow(), PartDesignGui::assureModernWorkflow(), PartDesignGui::isLegacyWorkflow(), and PartDesignGui::isModernWorkflow().