Handle all tools when creating the history records.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-02-09 17:26:59 +02:00
parent 6b4b79a1b5
commit 61adfbaef5
2 changed files with 22 additions and 6 deletions

View file

@ -193,6 +193,11 @@ void DialogHistory::FillTable()
ui->tableWidget->verticalHeader()->setDefaultSectionSize(20);
}
#if defined(Q_CC_GNU)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wswitch-default"
#endif
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief Record return description for record
@ -212,6 +217,12 @@ QString DialogHistory::Record(const VToolRecord &tool)
switch ( tool.getTypeTool() )
{
case Tool::Arrow:
case Tool::SinglePoint:
case Tool::DoublePoint:
case Tool::LinePoint:
case Tool::AbstractSpline:
case Tool::Cut:
case Tool::LAST_ONE_DO_NOT_USE:
Q_UNREACHABLE(); //-V501
break;
case Tool::BasePoint:
@ -400,6 +411,10 @@ QString DialogHistory::Record(const VToolRecord &tool)
{
return QString(tr("%1 - point of circles intersection")).arg(PointName(tool.getId()));
}
case Tool::PointOfIntersectionCurves:
{
return QString(tr("%1 - point of curves intersection")).arg(PointName(tool.getId()));
}
case Tool::PointFromCircleAndTangent:
{
return QString(tr("%1 - point from circle and tangent")).arg(PointName(tool.getId()));
@ -429,10 +444,6 @@ QString DialogHistory::Record(const VToolRecord &tool)
break;
case Tool::NodeSplinePath:
break;
default:
qDebug()<<"Got wrong tool type. Ignore.";
return tr("Can't create record.");
break;
}
}
catch (const VExceptionBadId &e)
@ -440,9 +451,14 @@ QString DialogHistory::Record(const VToolRecord &tool)
qDebug()<<e.ErrorMessage()<<Q_FUNC_INFO;
return tr("Can't create record.");
}
return QString();
qDebug()<<"Can't create history record for the tool.";
return tr("Can't create record.");
}
#if defined(Q_CC_GNU)
#pragma GCC diagnostic pop
#endif
//---------------------------------------------------------------------------------------------------------------------
/**
* @brief InitialTable set initial option of table

View file

@ -97,7 +97,7 @@ enum class Tool : ToolVisHolderType
PointFromCircleAndTangent,
PointFromArcAndTangent,
TrueDarts,
UnionDetails, // 37
UnionDetails,
LAST_ONE_DO_NOT_USE //add new stuffs above this, this constant must be last and never used
};