[TD]move format spec to dimension tab
- also make %.2w default format
This commit is contained in:
committed by
WandererFan
parent
0149b99b6f
commit
58d1ef260b
@@ -1470,9 +1470,7 @@ std::string DrawViewDimension::getPrefix() const
|
||||
|
||||
std::string DrawViewDimension::getDefaultFormatSpec(bool isToleranceFormat) const
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
|
||||
std::string prefFormat = hGrp->GetASCII("formatSpec","");
|
||||
std::string prefFormat = Preferences::formatSpec();
|
||||
QString formatSpec;
|
||||
QString qPrefix;
|
||||
if (prefFormat.empty()) {
|
||||
@@ -1482,7 +1480,7 @@ std::string DrawViewDimension::getDefaultFormatSpec(bool isToleranceFormat) cons
|
||||
if (useDecimals()) {
|
||||
precision = Base::UnitsApi::getDecimals();
|
||||
} else {
|
||||
precision = hGrp->GetInt("AltDecimals", 2);
|
||||
precision = Preferences::altDecimals();
|
||||
}
|
||||
QString formatPrecision = QString::number(precision);
|
||||
|
||||
|
||||
@@ -233,3 +233,17 @@ std::string Preferences::lineGroupFile()
|
||||
}
|
||||
return lgFileName;
|
||||
}
|
||||
|
||||
std::string Preferences::formatSpec()
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
|
||||
return hGrp->GetASCII("formatSpec","%.2w");
|
||||
}
|
||||
|
||||
int Preferences::altDecimals()
|
||||
{
|
||||
Base::Reference<ParameterGrp> hGrp = App::GetApplication().GetUserParameter()
|
||||
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/Dimensions");
|
||||
return hGrp->GetInt("AltDecimals", 2);
|
||||
}
|
||||
|
||||
@@ -67,9 +67,11 @@ static QString defaultTemplate();
|
||||
static QString defaultTemplateDir();
|
||||
static std::string lineGroupFile();
|
||||
|
||||
|
||||
|
||||
static const double DefaultFontSizeInMM;
|
||||
|
||||
static std::string formatSpec();
|
||||
static int altDecimals();
|
||||
|
||||
};
|
||||
|
||||
} //end namespace TechDraw
|
||||
|
||||
Reference in New Issue
Block a user