+ minor changes

This commit is contained in:
wmayer 2015-09-13 23:24:12 +02:00
parent b9865ed4f1
commit 694c409caf
3 changed files with 9 additions and 4 deletions

View File

@ -65,13 +65,16 @@ ConstraintCreationMode constraintCreationMode=Driving;
bool isCreateConstraintActive(Gui::Document *doc)
{
if (doc)
if (doc) {
// checks if a Sketch Viewprovider is in Edit and is in no special mode
if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom(SketcherGui::ViewProviderSketch::getClassTypeId()))
if (doc->getInEdit() && doc->getInEdit()->isDerivedFrom(SketcherGui::ViewProviderSketch::getClassTypeId())) {
if (dynamic_cast<SketcherGui::ViewProviderSketch*>(doc->getInEdit())
->getSketchMode() == ViewProviderSketch::STATUS_NONE)
->getSketchMode() == ViewProviderSketch::STATUS_NONE) {
if (Gui::Selection().countObjectsOfType(Sketcher::SketchObject::getClassTypeId()) > 0)
return true;
}
}
}
return false;
}

View File

@ -192,6 +192,7 @@ void ConstraintView::modifyCurrentItem()
void ConstraintView::renameCurrentItem()
{
// See also TaskSketcherConstrains::on_listWidgetConstraints_itemChanged
QListWidgetItem* item = currentItem();
if (item)
editItem(item);

View File

@ -853,7 +853,8 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
<< "Sketcher_External"
<< "Sketcher_ToggleConstruction"
/*<< "Sketcher_CreateText"*/
/*<< "Sketcher_CreateDraftLine"*/;
/*<< "Sketcher_CreateDraftLine"*/
<< "Separator";
Gui::Application::Instance->setupContextMenu("View", geom);
//Create the Context Menu using the Main View Qt Widget