[TD]assorted Preference updates

- section line convention label
- remove superfluous save/restore on changeEvent
- change default scrub count
- add preference for default symbol dir
- add preference for display of section cut line
This commit is contained in:
wandererfan
2024-05-17 18:31:36 -04:00
committed by WandererFan
parent 9decb98c71
commit 55968bbf6c
20 changed files with 574 additions and 442 deletions

View File

@@ -250,6 +250,24 @@ bool Preferences::showDetailHighlight()
return getPreferenceGroup("General")->GetBool("ShowDetailHighlight", true);
}
//! returns the default or preferred directory to search for svg symbols
QString Preferences::defaultSymbolDir()
{
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/Templates";
std::string prefSymbolDir = getPreferenceGroup("Files")->GetASCII("DirSymbol", defaultDir.c_str());
if (prefSymbolDir.empty()) {
prefSymbolDir = defaultDir;
}
QString symbolDir = QString::fromStdString(prefSymbolDir);
Base::FileInfo fi(prefSymbolDir);
if (!fi.isReadable()) {
Base::Console().Warning("Symbol Directory: %s is not readable\n",
prefSymbolDir.c_str());
symbolDir = QString::fromStdString(defaultDir);
}
return symbolDir;
}
std::string Preferences::svgFile()
{
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/Patterns/";
@@ -402,7 +420,7 @@ bool Preferences::autoCorrectDimRefs()
//! number of times to clean the output edges from HLR
int Preferences::scrubCount()
{
return getPreferenceGroup("General")->GetInt("ScrubCount", 0);
return getPreferenceGroup("General")->GetInt("ScrubCount", 1);
}
//! Returns the factor for the overlap of svg tiles when hatching faces
@@ -540,6 +558,19 @@ int Preferences::sectionLineConvention()
return getPreferenceGroup("Standards")->GetInt("SectionLineStandard", 1);
}
//! true if a section line annotation should be drawn on the source view. If false,
//! no cut line, change marks, arrows or symbol will be drawn.
bool Preferences::showSectionLine()
{
return getPreferenceGroup("Decorations")->GetBool("ShowSectionLine", true);
}
//! true if the section cut line should be drawn on the source view. Some conventions do not draw the
//! actual cut line, but only the change points, arrows and symbols.
bool Preferences::includeCutLine()
{
return getPreferenceGroup("Decorations")->GetBool("IncludeCutLine", true);
}
//! true if the GeometryMatcher should be used in correcting Dimension references
bool Preferences::useExactMatchOnDims()