[TD]fix line standard drop downs

This commit is contained in:
wandererfan
2023-12-05 13:28:06 -05:00
committed by WandererFan
parent fb128a3f4d
commit efd3407dd8
7 changed files with 92 additions and 25 deletions

View File

@@ -55,6 +55,14 @@ using namespace TechDraw;
using DU = DrawUtil;
LineGenerator::LineGenerator()
{
reloadDescriptions();
// m_elementDefs = loadElements();
// m_lineDefs = getLineDefinitions();
// m_lineDescs = getLineDescriptions();
}
void LineGenerator::reloadDescriptions()
{
m_elementDefs = loadElements();
m_lineDefs = getLineDefinitions();

View File

@@ -63,6 +63,10 @@ public:
static std::vector<std::string> getAvailableLineStandards();
static std::string getLineStandardsBody();
//! if the line standard changes during a lineGenerator's life time
//! then the elements and line descriptions need to be reloaded using the
//! new standard.
void reloadDescriptions();
//! get line descriptions from memory
std::vector<std::string> getLoadedDescriptions();
//! get line descriptions from file

View File

@@ -425,6 +425,12 @@ int Preferences::lineStandard()
return getPreferenceGroup("Standards")->GetInt("LineStandard", 1);
}
//! update the line standard preference. used in the preferences dialog.
void Preferences::setLineStandard(int index)
{
getPreferenceGroup("Standards")->SetInt("LineStandard", index);
}
std::string Preferences::lineDefinitionLocation()
{
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/LineGroup/";

View File

@@ -107,6 +107,7 @@ public:
static bool SectionUsePreviousCut();
static int lineStandard();
static void setLineStandard(int index);
static std::string lineDefinitionLocation();
static std::string lineElementsLocation();