From 75ad582913efe3ee5027cc85952f9d3e9b6bab86 Mon Sep 17 00:00:00 2001 From: AjinkyaDahale Date: Tue, 20 Dec 2016 11:41:48 +0530 Subject: [PATCH] Lock doesn't complain "no selection" --- src/Mod/Sketcher/Gui/CommandConstraints.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Mod/Sketcher/Gui/CommandConstraints.cpp b/src/Mod/Sketcher/Gui/CommandConstraints.cpp index ccca1656e..8d31b0790 100644 --- a/src/Mod/Sketcher/Gui/CommandConstraints.cpp +++ b/src/Mod/Sketcher/Gui/CommandConstraints.cpp @@ -1123,8 +1123,8 @@ void CmdSketcherConstrainLock::activated(int iMsg) // only one sketch with its subelements are allowed to be selected if (selection.size() != 1) { - QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), - QObject::tr("Select entities from the sketch.")); +// QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), +// QObject::tr("Select entities from the sketch.")); return; } @@ -1135,6 +1135,8 @@ void CmdSketcherConstrainLock::activated(int iMsg) if (SubNames.size() != 1) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Select exactly one entity from the sketch.")); + // clear the selection (convenience) + getSelection().clearSelection(); return; } @@ -1145,6 +1147,8 @@ void CmdSketcherConstrainLock::activated(int iMsg) if (isEdge(GeoId,PosId) || (GeoId < 0 && GeoId >= Sketcher::GeoEnum::VAxis)) { QMessageBox::warning(Gui::getMainWindow(), QObject::tr("Wrong selection"), QObject::tr("Select one vertex from the sketch other than the origin.")); + // clear the selection (convenience) + getSelection().clearSelection(); return; }