Merge pull request #28462 from theo-vt/fix_filet_regression
Fix filet regression
This commit is contained in:
@@ -310,11 +310,7 @@ public:
|
||||
* @return The new transaction ID.
|
||||
*/
|
||||
|
||||
int setActiveTransaction(TransactionName name);
|
||||
|
||||
/// Return the current global transaction name and ID if such a global transaction is
|
||||
/// setup (uncommon)
|
||||
std::string getActiveTransaction(int *tid=nullptr) const;
|
||||
int setActiveTransaction(TransactionName name);
|
||||
|
||||
int openGlobalTransaction(TransactionName name);
|
||||
int getGlobalTransaction() const;
|
||||
|
||||
@@ -1221,9 +1221,10 @@ PyObject* ApplicationPy::sGetActiveTransaction(PyObject* /*self*/, PyObject* arg
|
||||
PY_TRY
|
||||
{
|
||||
int id = 0;
|
||||
std::string name = GetApplication().getActiveTransaction(&id);
|
||||
if (name.empty() || id <= 0) {
|
||||
Py_Return;
|
||||
std::string name = "";
|
||||
if (Document* doc = GetApplication().getActiveDocument()) {
|
||||
id = doc->getBookedTransactionID();
|
||||
name = GetApplication().getTransactionName(id);
|
||||
}
|
||||
Py::Tuple ret(2);
|
||||
ret.setItem(0, Py::String(name));
|
||||
|
||||
@@ -71,13 +71,6 @@ int Application::setActiveTransaction(TransactionName name)
|
||||
return openGlobalTransaction(name);
|
||||
}
|
||||
|
||||
std::string Application::getActiveTransaction(int* id) const
|
||||
{
|
||||
if (id != nullptr) {
|
||||
*id = _globalTransactionID;
|
||||
}
|
||||
return _globalTransactionID != 0 ? getTransactionName(_globalTransactionID) : "";
|
||||
}
|
||||
int Application::openGlobalTransaction(TransactionName name)
|
||||
{
|
||||
if (name.name.empty()) {
|
||||
|
||||
@@ -403,7 +403,7 @@ void PropertyEditor::openEditor(const QModelIndex& index)
|
||||
str << "...";
|
||||
}
|
||||
transactionID = obj->getDocument()->openTransaction(str.str().c_str());
|
||||
FC_LOG("editor transaction " << App::GetApplication().getActiveTransaction(&transactionID));
|
||||
FC_LOG("editor transaction " << App::GetApplication().getTransactionName(transactionID));
|
||||
}
|
||||
|
||||
void PropertyEditor::onItemActivated(const QModelIndex& index)
|
||||
|
||||
@@ -64,7 +64,7 @@ class _BasePostTaskPanel(base_femtaskpanel._BaseTaskPanel):
|
||||
|
||||
def open(self):
|
||||
# open a new transaction if non is open
|
||||
if not FreeCAD.getActiveTransaction():
|
||||
if FreeCAD.ActiveDocument.getBookedTransactionID() == 0:
|
||||
FreeCAD.ActiveDocument.openTransaction(
|
||||
translate("FEM", "Edit {}").format(self.obj.Label)
|
||||
)
|
||||
|
||||
@@ -217,7 +217,6 @@ bool TaskDlgFeatureParameters::accept()
|
||||
feature->getDocument()->commitTransaction();
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
feature->getDocument()->abortTransaction();
|
||||
QString errorText = QString::fromUtf8(e.what());
|
||||
QString statusText = QString::fromUtf8(getObject()->getStatusString());
|
||||
|
||||
|
||||
Reference in New Issue
Block a user