+ fixes #0001549: crash with Draft move tool while sketch is in edit mode
This commit is contained in:
parent
581d88485d
commit
17b7003ea7
|
@ -24,6 +24,7 @@
|
|||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
# include <QApplication>
|
||||
# include <QDebug>
|
||||
# include <QDockWidget>
|
||||
# include <QPointer>
|
||||
|
@ -162,6 +163,37 @@ Gui::TaskView::TaskDialog* ControlSingleton::activeDialog() const
|
|||
return ActiveDialog;
|
||||
}
|
||||
|
||||
Gui::TaskView::TaskView* ControlSingleton::getTaskPanel()
|
||||
{
|
||||
// should return the pointer to combo view
|
||||
Gui::DockWnd::CombiView* pcCombiView = qobject_cast<Gui::DockWnd::CombiView*>
|
||||
(Gui::DockWindowManager::instance()->getDockWindow("Combo View"));
|
||||
if (pcCombiView)
|
||||
return pcCombiView->getTaskPanel();
|
||||
else
|
||||
return _taskPanel;
|
||||
}
|
||||
|
||||
void ControlSingleton::accept()
|
||||
{
|
||||
Gui::TaskView::TaskView* taskPanel = getTaskPanel();
|
||||
if (taskPanel) {
|
||||
taskPanel->accept();
|
||||
qApp->processEvents(QEventLoop::ExcludeUserInputEvents |
|
||||
QEventLoop::ExcludeSocketNotifiers);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlSingleton::reject()
|
||||
{
|
||||
Gui::TaskView::TaskView* taskPanel = getTaskPanel();
|
||||
if (taskPanel) {
|
||||
taskPanel->reject();
|
||||
qApp->processEvents(QEventLoop::ExcludeUserInputEvents |
|
||||
QEventLoop::ExcludeSocketNotifiers);
|
||||
}
|
||||
}
|
||||
|
||||
void ControlSingleton::closeDialog()
|
||||
{
|
||||
Gui::DockWnd::CombiView* pcCombiView = qobject_cast<Gui::DockWnd::CombiView*>
|
||||
|
|
|
@ -82,6 +82,8 @@ public:
|
|||
bool isAllowedAlterSelection(void) const;
|
||||
|
||||
public Q_SLOTS:
|
||||
void accept();
|
||||
void reject();
|
||||
void closeDialog();
|
||||
/// raises the task view panel
|
||||
void showTaskView();
|
||||
|
@ -90,6 +92,9 @@ private Q_SLOTS:
|
|||
/// This get called by the TaskView when the Dialog is finished
|
||||
void closedDialog();
|
||||
|
||||
private:
|
||||
Gui::TaskView::TaskView *getTaskPanel();
|
||||
|
||||
private:
|
||||
struct status {
|
||||
std::bitset<32> StatusBits;
|
||||
|
|
|
@ -77,7 +77,7 @@ bool ViewProviderFemConstraintBearing::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
} else if (constraintDialog != NULL) {
|
||||
|
|
|
@ -77,7 +77,7 @@ bool ViewProviderFemConstraintFixed::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
} else if (constraintDialog != NULL) {
|
||||
|
|
|
@ -77,7 +77,7 @@ bool ViewProviderFemConstraintForce::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
} else if (constraintDialog != NULL) {
|
||||
|
|
|
@ -76,7 +76,7 @@ bool ViewProviderFemConstraintGear::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
} else if (constraintDialog != NULL) {
|
||||
|
|
|
@ -75,7 +75,7 @@ bool ViewProviderFemConstraintPulley::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
} else if (constraintDialog != NULL) {
|
||||
|
|
|
@ -75,7 +75,7 @@ bool ViewProviderChamfer::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ bool ViewProviderDraft::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -75,7 +75,7 @@ bool ViewProviderFillet::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ bool ViewProviderGroove::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -87,7 +87,7 @@ bool ViewProviderPad::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ bool ViewProviderPocket::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -82,7 +82,7 @@ bool ViewProviderRevolution::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -178,7 +178,7 @@ const bool ViewProviderTransformed::checkDlgOpen(TaskDlgTransformedParameters* t
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -2991,7 +2991,7 @@ bool ViewProviderSketch::setEdit(int ModNum)
|
|||
msgBox.setDefaultButton(QMessageBox::Yes);
|
||||
int ret = msgBox.exec();
|
||||
if (ret == QMessageBox::Yes)
|
||||
Gui::Control().closeDialog();
|
||||
Gui::Control().reject();
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user