+ fixes #0001447: Crash when opening task dialog for orthographic projection while another task dialog is open

This commit is contained in:
wmayer
2014-02-27 11:14:53 +01:00
parent 995b146659
commit daf8b1d49e
2 changed files with 21 additions and 3 deletions

View File

@@ -24,6 +24,7 @@
#include "PreCompiled.h"
#ifndef _PreComp_
# include <QDebug>
# include <QDockWidget>
# include <QPointer>
#endif
@@ -93,8 +94,18 @@ void ControlSingleton::showModelView()
void ControlSingleton::showDialog(Gui::TaskView::TaskDialog *dlg)
{
// only one dialog at a time
assert(!ActiveDialog || ActiveDialog==dlg);
// only one dialog at a time, print a warning instead of raising an assert
if (ActiveDialog && ActiveDialog != dlg) {
if (dlg) {
qWarning() << "ControlSingleton::showDialog: Can't show "
<< dlg->metaObject()->className()
<< " since there is already an active task dialog";
}
else {
qWarning() << "ControlSingleton::showDialog: Task dialog is null";
}
return;
}
Gui::DockWnd::CombiView* pcCombiView = qobject_cast<Gui::DockWnd::CombiView*>
(Gui::DockWindowManager::instance()->getDockWindow("Combo View"));
// should return the pointer to combo view