Skip to content

Commit

Permalink
Merge branch 'master' into bugfix/deburr-offset-part
Browse files Browse the repository at this point in the history
  • Loading branch information
mlampert committed Feb 12, 2021
2 parents e552702 + f0d3e19 commit d3b8376
Show file tree
Hide file tree
Showing 114 changed files with 8,958 additions and 4,816 deletions.
4 changes: 4 additions & 0 deletions src/Gui/Language/FreeCAD.ts
Expand Up @@ -5297,6 +5297,10 @@ How do you want to proceed?</source>
<source>Expression...</source>
<translation type="unfinished"></translation>
</message>
<message>
<source>Auto expand</source>
<translation type="unfinished"></translation>
</message>
</context>
<context>
<name>Gui::PropertyEditor::PropertyModel</name>
Expand Down
9 changes: 8 additions & 1 deletion src/Gui/TaskView/TaskDialog.cpp
Expand Up @@ -38,7 +38,9 @@ using namespace Gui::TaskView;
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

TaskDialog::TaskDialog()
: QObject(0), pos(North), escapeButton(true)
: QObject(nullptr), pos(North)
, escapeButton(true)
, autoCloseTransaction(false)
{

}
Expand Down Expand Up @@ -84,6 +86,11 @@ void TaskDialog::closed()

}

void TaskDialog::autoClosedOnTransactionChange()
{

}

void TaskDialog::clicked(int)
{

Expand Down
13 changes: 13 additions & 0 deletions src/Gui/TaskView/TaskDialog.h
Expand Up @@ -75,6 +75,15 @@ class GuiExport TaskDialog : public QObject
return escapeButton;
}

/// Defines whether a task dialog must be closed if the document changed the
/// active transaction.
void setAutoCloseOnTransactionChange(bool on) {
autoCloseTransaction = on;
}
bool isAutoCloseOnTransactionChange() const {
return autoCloseTransaction;
}

const std::string& getDocumentName() const
{ return documentName; }
void setDocumentName(const std::string& doc)
Expand Down Expand Up @@ -105,6 +114,9 @@ class GuiExport TaskDialog : public QObject
virtual void open();
/// is called by the framework when the dialog is closed
virtual void closed();
/// is called by the framework when the dialog is automatically closed due to
/// changing the active transaction
virtual void autoClosedOnTransactionChange();
/// is called by the framework if a button is clicked which has no accept or reject role
virtual void clicked(int);
/// is called by the framework if the dialog is accepted (Ok)
Expand All @@ -129,6 +141,7 @@ class GuiExport TaskDialog : public QObject
private:
std::string documentName;
bool escapeButton;
bool autoCloseTransaction;
};

} //namespace TaskView
Expand Down
10 changes: 10 additions & 0 deletions src/Gui/TaskView/TaskView.cpp
Expand Up @@ -532,12 +532,22 @@ void TaskView::slotDeletedDocument()

void TaskView::slotUndoDocument(const App::Document&)
{
if (ActiveDialog && ActiveDialog->isAutoCloseOnTransactionChange()) {
ActiveDialog->autoClosedOnTransactionChange();
removeDialog();
}

if (!ActiveDialog)
updateWatcher();
}

void TaskView::slotRedoDocument(const App::Document&)
{
if (ActiveDialog && ActiveDialog->isAutoCloseOnTransactionChange()) {
ActiveDialog->autoClosedOnTransactionChange();
removeDialog();
}

if (!ActiveDialog)
updateWatcher();
}
Expand Down
1 change: 1 addition & 0 deletions src/Mod/AddonManager/Resources/AddonManager.qrc
Expand Up @@ -46,6 +46,7 @@
<file>icons/Reinforcement_workbench_icon.svg</file>
<file>icons/Reporting_workbench_icon.svg</file>
<file>icons/Render_workbench_icon.svg</file>
<file>icons/Rocket_workbench_icon.svg</file>
<file>icons/sheetmetal_workbench_icon.svg</file>
<file>icons/slic3r-tools_workbench_icon.svg</file>
<file>icons/Ship_workbench_icon.svg</file>
Expand Down
111 changes: 111 additions & 0 deletions src/Mod/AddonManager/Resources/icons/Rocket_workbench_icon.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit d3b8376

Please sign in to comment.