Skip to content

Commit

Permalink
Core: return information about ifcopenshell version in About info cli…
Browse files Browse the repository at this point in the history
…pboard
  • Loading branch information
furgo16 committed Jan 26, 2025
1 parent 29ea277 commit 5b0f49d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Gui/Dialogs/DlgAbout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <App/Application.h>
#include <App/Metadata.h>
#include <Base/Console.h>
#include <Base/Interpreter.h>
#include <CXX/WrapPython.h>

#include <boost/filesystem.hpp>
Expand Down Expand Up @@ -647,11 +648,27 @@ void AboutDialog::copyToClipboard()
if (it != config.end()) {
str << "Hash: " << QString::fromStdString(it->second) << '\n';
}

// report also the version numbers of the most important libraries in FreeCAD
str << "Python " << PY_VERSION << ", ";
str << "Qt " << QT_VERSION_STR << ", ";
str << "Coin " << COIN_VERSION << ", ";
str << "Vtk " << fcVtkVersion << ", ";

std::stringstream cmd;
cmd << "import ifcopenshell\n";
cmd << "version = ifcopenshell.version";
PyObject * ifcopenshellVer = Base::Interpreter().getValue(cmd.str().c_str(), "version");
if (ifcopenshellVer) {
const char* ifcopenshellVerAsStr = PyUnicode_AsUTF8(ifcopenshellVer);

if (ifcopenshellVerAsStr) {
str << "IfcOpenShell: " << ifcopenshellVerAsStr << ", "; // << '\n';
Py_DECREF(ifcopenshellVerAsStr);
}
Py_DECREF(ifcopenshellVer);
}

#if defined(HAVE_OCC_VERSION)
str << "OCC " << OCC_VERSION_MAJOR << "." << OCC_VERSION_MINOR << "." << OCC_VERSION_MAINTENANCE
#ifdef OCC_VERSION_DEVELOPMENT
Expand Down

0 comments on commit 5b0f49d

Please sign in to comment.