fix typo and improve whitespaces

This commit is contained in:
wmayer
2018-01-03 17:52:32 +01:00
parent 433f366304
commit 14d06fe84c
2 changed files with 8 additions and 6 deletions

View File

@@ -127,7 +127,7 @@ Workflow WorkflowManager::getWorkflowForDocument( App::Document *doc) {
}
}
Workflow WorkflowManager::determinWorkflow( App::Document *doc) {
Workflow WorkflowManager::determineWorkflow(App::Document *doc) {
Workflow rv = getWorkflowForDocument (doc);
if (rv != Workflow::Undetermined) {
@@ -138,14 +138,15 @@ Workflow WorkflowManager::determinWorkflow( App::Document *doc) {
// Guess the workflow again
rv = guessWorkflow (doc);
if (rv != Workflow::Modern) {
QMessageBox msgBox;
QMessageBox msgBox(Gui::getMainWindow());
if ( rv == Workflow::Legacy ) { // legacy messages
msgBox.setText( QObject::tr( "The document \"%1\" you are editing was designed with an old version of "
"PartDesign workbench." ).arg( QString::fromStdString ( doc->getName()) ) );
msgBox.setInformativeText (
QObject::tr( "Do you want to migrate in order to use modern PartDesign features?" ) );
} else { // The document is already in the middle of migration
}
else { // The document is already in the middle of migration
msgBox.setText( QObject::tr( "The document \"%1\" seems to be either in the middle of"
" the migration process from legacy PartDesign or have a slightly broken structure."
).arg( QString::fromStdString ( doc->getName()) ) );
@@ -162,6 +163,7 @@ Workflow WorkflowManager::determinWorkflow( App::Document *doc) {
QPushButton * yesBtn = msgBox.addButton ( QMessageBox::Yes );
QPushButton * manuallyBtn = msgBox.addButton (
QObject::tr ( "Migrate manually" ), QMessageBox::YesRole );
// If it is already a document in the middle of the migration the user shouldn't refuse to migrate
if ( rv != Workflow::Undetermined ) {
msgBox.addButton ( QMessageBox::No );
@@ -187,7 +189,7 @@ Workflow WorkflowManager::determinWorkflow( App::Document *doc) {
return rv;
}
void WorkflowManager::forceWorkflow( const App::Document *doc, Workflow wf) {
void WorkflowManager::forceWorkflow(const App::Document *doc, Workflow wf) {
dwMap[ doc ] = wf;
}

View File

@@ -65,7 +65,7 @@ public:
* 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.
*/
Workflow determinWorkflow(App::Document *doc);
Workflow determineWorkflow(App::Document *doc);
/**
* Force the desired workflow in document
@@ -112,7 +112,7 @@ inline bool assureLegacyWorkflow (App::Document *doc) {
/// Assures that workflow of the given document is determined and returns true if it is Workflow::Modern
inline bool assureModernWorkflow (App::Document *doc) {
return WorkflowManager::instance()->determinWorkflow( doc ) == Workflow::Modern ;
return WorkflowManager::instance()->determineWorkflow( doc ) == Workflow::Modern ;
}
/// Returns true if the workflow of the given document is Workflow::Legacy