Skip to content

Commit

Permalink
Merge branch 'master' into archstairs_connections_flight_landing
Browse files Browse the repository at this point in the history
  • Loading branch information
three-ddd committed Jan 24, 2021
2 parents de01775 + 305fb03 commit d0bcdaa
Show file tree
Hide file tree
Showing 23 changed files with 715 additions and 98 deletions.
1 change: 1 addition & 0 deletions src/App/Document.cpp
Expand Up @@ -2745,6 +2745,7 @@ void Document::restore (const char *filename,
}
catch (const Base::Exception& e) {
Base::Console().Error("Invalid Document.xml: %s\n", e.what());
setStatus(Document::RestoreError, true);
}

d->partialLoadObjects.clear();
Expand Down
1 change: 1 addition & 0 deletions src/App/Document.h
Expand Up @@ -74,6 +74,7 @@ class AppExport Document : public App::PropertyContainer
PartialDoc = 7,
AllowPartialRecompute = 8, // allow recomputing editing object if SkipRecompute is set
TempDoc = 9, // Mark as temporary document without prompt for save
RestoreError = 10
};

/** @name Properties */
Expand Down
13 changes: 10 additions & 3 deletions src/App/OriginGroupExtension.cpp
Expand Up @@ -27,12 +27,15 @@
#endif

#include <Base/Exception.h>

#include <Base/Console.h>
#include <Base/Tools.h>
#include <App/Document.h>
#include "Origin.h"

#include "GeoFeature.h"

FC_LOG_LEVEL_INIT("App", true, true)

using namespace App;

EXTENSION_PROPERTY_SOURCE(App::OriginGroupExtension, App::GeoFeatureGroupExtension)
Expand Down Expand Up @@ -160,8 +163,12 @@ void OriginGroupExtension::extensionOnChanged(const Property* p) {
&& owner->getDocument()->testStatus(Document::Importing)) {
for (auto o : origin->getInList()) {
if(o != owner && o->hasExtension(App::OriginGroupExtension::getExtensionClassTypeId())) {
Origin.setValue(nullptr);
throw Base::RuntimeError("Origin can only be in a single OriginGroup");
// Temporarily reset 'Restoring' status to allow document to auto label new objects
Base::ObjectStatusLocker<Document::Status, Document> guard(
Document::Restoring, owner->getDocument(), false);
Origin.setValue(owner->getDocument()->addObject("App::Origin", "Origin"));
FC_WARN("Reset origin in " << owner->getFullName());
return;
}
}
}
Expand Down
8 changes: 8 additions & 0 deletions src/Gui/CommandDoc.cpp
Expand Up @@ -160,6 +160,14 @@ void StdCmdOpen::activated(int iMsg)
else {
for (SelectModule::Dict::iterator it = dict.begin(); it != dict.end(); ++it) {
getGuiApplication()->open(it.key().toUtf8(), it.value().toLatin1());

App::Document *doc = App::GetApplication().getActiveDocument();

if(doc && doc->testStatus(App::Document::PartialRestore))
QMessageBox::critical(getMainWindow(), QObject::tr("Error"), QObject::tr("There were errors while loading the file. Some data might have been modified or not recovered at all. Look in the report view for more specific information about the objects involved."));

if(doc && doc->testStatus(App::Document::RestoreError))
QMessageBox::critical(getMainWindow(), QObject::tr("Error"), QObject::tr("There were serious errors while loading the file. Some data might have been modified or not recovered at all. Saving the project will most likely result in loss of data."));
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/CommandWindow.cpp
Expand Up @@ -257,7 +257,7 @@ StdCmdWindows::StdCmdWindows()
sToolTipText = QT_TR_NOOP("Windows list");
sWhatsThis = "Std_Windows";
sStatusTip = QT_TR_NOOP("Windows list");
//sPixmap = "";
sPixmap = "Std_Windows";
eType = 0;
}

Expand Down
292 changes: 292 additions & 0 deletions src/Gui/Icons/Std_Windows.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions src/Gui/Icons/resource.qrc
Expand Up @@ -196,6 +196,7 @@
<file>Std_ViewIvStereoQuadBuff.svg</file>
<file>Std_ViewIvStereoRedGreen.svg</file>
<file>Std_ViewTrimetric.svg</file>
<file>Std_Windows.svg</file>
<file>Std_WindowCascade.svg</file>
<file>Std_WindowNext.svg</file>
<file>Std_WindowPrev.svg</file>
Expand Down
4 changes: 4 additions & 0 deletions src/Mod/Fem/App/FemMesh.cpp
Expand Up @@ -2193,7 +2193,11 @@ int FemMesh::addGroup(const std::string TypeString, const std::string Name, cons
SMESH_Group* group = this->getSMesh()->AddGroup(mapping[TypeString], Name.c_str(), aId);
if (!group)
throw std::runtime_error("AddGroup: Failed to create new group.");
#if SMESH_VERSION_MAJOR >= 9
return group->GetID();
#else
return aId;
#endif
}

void FemMesh::addGroupElements(int GroupId, const std::set<int>& ElementIds)
Expand Down

0 comments on commit d0bcdaa

Please sign in to comment.