Install default PAT file

This commit is contained in:
WandererFan 2017-01-27 19:26:57 -05:00
parent 7cb3e93686
commit 722b2d1c04
3 changed files with 12 additions and 1 deletions

View File

@ -157,6 +157,10 @@ SET(TechDraw_Templates
Templates/A4_Portrait_ISO7200TD.svg
)
SET(TechDraw_PATFile
PAT/FCPAT.pat
)
if(MSVC)
#add_definitions(-D_PreComp_)
#GET_MSVC_PRECOMPILED_SOURCE("PreCompiled.cpp" TechDrawCPP_SRCS ${TechDraw_SRCS} ${Draw_SRCS} )
@ -182,6 +186,11 @@ fc_target_copy_resource(TechDraw
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw
${TechDraw_Templates})
fc_target_copy_resource(TechDraw
${CMAKE_SOURCE_DIR}/src/Mod/TechDraw
${CMAKE_BINARY_DIR}/${CMAKE_INSTALL_DATADIR}/Mod/TechDraw
${TechDraw_PATFile})
SET_BIN_DIR(TechDraw TechDraw /Mod/TechDraw)
SET_PYTHON_PREFIX_SUFFIX(TechDraw)

View File

@ -393,7 +393,7 @@ void DrawGeomHatch::getParameters(void)
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");
std::string defaultDir = App::Application::getResourceDir() + "Mod/TechDraw/PAT/";
std::string defaultFileName = defaultDir + "FCStd.pat";
std::string defaultFileName = defaultDir + "FCPAT.pat";
QString patternFileName = QString::fromStdString(hGrp->GetASCII("FilePattern",defaultFileName.c_str()));
if (patternFileName.isEmpty()) {
patternFileName = QString::fromStdString(defaultFileName);
@ -401,6 +401,8 @@ void DrawGeomHatch::getParameters(void)
QFileInfo tfi(patternFileName);
if (tfi.isReadable()) {
FilePattern.setValue(patternFileName.toUtf8().constData());
} else {
Base::Console().Error("DrawGeomHatch: PAT file: %s Not Found\n",patternFileName.toUtf8().constData());
}
hGrp = App::GetApplication().GetUserParameter()
.GetGroup("BaseApp")->GetGroup("Preferences")->GetGroup("Mod/TechDraw/PAT");