Fixed UI bugs

This commit is contained in:
jrheinlaender
2012-11-30 15:58:38 +04:30
committed by wmayer
parent f27d789f17
commit 1e5ff95f95
2 changed files with 13 additions and 2 deletions

View File

@@ -38,6 +38,7 @@
#include <Base/Console.h>
#include <Gui/Selection.h>
#include <Gui/Command.h>
#include <Gui/MainWindow.h>
#include <Mod/PartDesign/App/FeatureDraft.h>
#include <Mod/Sketcher/App/SketchObject.h>
#include <Mod/PartDesign/Gui/ReferenceSelection.h>
@@ -366,6 +367,15 @@ void TaskDlgDraftParameters::clicked(int)
bool TaskDlgDraftParameters::accept()
{
parameter->showObject();
// Force the user to select a neutral plane
if (parameter->getPlane().empty()) {
QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Missing neutral plane"),
QObject::tr("Please select a plane or an edge plus a pull direction"));
return false;
}
std::string name = DraftView->getObject()->getNameInDocument();
Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.%s.Angle = %f",name.c_str(),parameter->getAngle());