Fixed UI bugs

This commit is contained in:
jrheinlaender 2012-11-30 15:58:38 +04:30 committed by wmayer
parent 37b3c3df0f
commit 8a1c9f0651
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());

View File

@ -58,6 +58,9 @@ public:
const std::string getLine(void) const;
App::DocumentObject *getBase(void) const;
void hideObject();
void showObject();
private Q_SLOTS:
void onAngleChanged(double angle);
void onReversedChanged(bool reversed);
@ -68,8 +71,6 @@ private Q_SLOTS:
void onFaceDeleted(void);
protected:
void hideObject();
void showObject();
void exitSelectionMode();
protected: