Check if a path is valid. Should contains at least one object.

--HG--
branch : feature
This commit is contained in:
Roman Telezhynskyi 2016-11-23 18:50:52 +02:00
parent 1a73a1f870
commit 8a5c4a1a37
2 changed files with 15 additions and 11 deletions

View File

@ -964,7 +964,8 @@ void MainWindow::ToolDetail(bool checked)
void MainWindow::ToolPiecePath(bool checked)
{
ToolSelectAllDrawObjects();
SetToolButton<DialogPiecePath>(checked, Tool::PiecePath, "://cursor/path_cursor.png", tr("Select path objects."),
SetToolButton<DialogPiecePath>(checked, Tool::PiecePath, "://cursor/path_cursor.png",
tr("Select path objects, <b>Shift</b> - reverse direction curve"),
&MainWindow::ClosedDialogPiecePath);
}

View File

@ -140,18 +140,21 @@ void DialogPiecePath::ShowDialog(bool click)
{
if (click == false)
{
emit ToolTip("");
prepare = true;
if (not m_showMode)
if (CreatePath().CountNodes() > 0)
{
auto visPath = qobject_cast<VisToolPiecePath *>(vis);
SCASSERT(visPath != nullptr);
visPath->SetMode(Mode::Show);
visPath->RefreshGeometry();
emit ToolTip("");
prepare = true;
if (not m_showMode)
{
auto visPath = qobject_cast<VisToolPiecePath *>(vis);
SCASSERT(visPath != nullptr);
visPath->SetMode(Mode::Show);
visPath->RefreshGeometry();
}
setModal(true);
show();
}
setModal(true);
show();
}
}