Skip to content

Commit ad630cb

Browse files
committed
Use new transaction methods in dlgmaterial
1 parent 51ac15b commit ad630cb

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/Mod/Material/Gui/DlgMaterialImp.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ TaskMaterial::TaskMaterial()
260260
taskbox->groupLayout()->addWidget(widget);
261261
Content.push_back(taskbox);
262262

263-
Gui::Command::openCommand(QT_TRANSLATE_NOOP("Command", "Set Material"));
263+
tid = Gui::Command::openActiveDocumentCommand(QT_TRANSLATE_NOOP("Command", "Set Material"));
264264
}
265265

266266
TaskMaterial::~TaskMaterial() = default;
@@ -272,13 +272,13 @@ QDialogButtonBox::StandardButtons TaskMaterial::getStandardButtons() const
272272

273273
bool TaskMaterial::accept()
274274
{
275-
Gui::Command::commitCommand();
275+
Gui::Command::commitCommand(tid);
276276
return true;
277277
}
278278

279279
bool TaskMaterial::reject()
280280
{
281-
Gui::Command::abortCommand();
281+
Gui::Command::abortCommand(tid);
282282
widget->reject();
283283
return (widget->result() == QDialog::Rejected);
284284
}

src/Mod/Material/Gui/DlgMaterialImp.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#include <vector>
3131

3232
#include <App/Material.h>
33+
#include <App/TransactionDefs.h>
3334
#include <Gui/Selection/Selection.h>
3435
#include <Gui/TaskView/TaskDialog.h>
3536
#include <Gui/TaskView/TaskView.h>
@@ -114,6 +115,7 @@ class TaskMaterial: public Gui::TaskView::TaskDialog
114115
private:
115116
DlgMaterialImp* widget;
116117
Gui::TaskView::TaskBox* taskbox;
118+
int tid {App::NullTransaction};
117119
};
118120

119121
} // namespace MatGui

0 commit comments

Comments
 (0)