[TD]fix line standard drop downs
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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/";
|
||||
|
||||
@@ -107,6 +107,7 @@ public:
|
||||
static bool SectionUsePreviousCut();
|
||||
|
||||
static int lineStandard();
|
||||
static void setLineStandard(int index);
|
||||
static std::string lineDefinitionLocation();
|
||||
static std::string lineElementsLocation();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user