mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-20 16:20:52 +01:00
Enable the possibility to define the path of user tbt template
collection. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5605 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -61,6 +61,7 @@ RecentFiles *QETApp::m_elements_recent_files = nullptr;
|
||||
TitleBlockTemplate *QETApp::default_titleblock_template_ = nullptr;
|
||||
QString QETApp::m_user_common_elements_dir = QString();
|
||||
QString QETApp::m_user_custom_elements_dir = QString();
|
||||
QString QETApp::m_user_custom_tbt_dir = QString();
|
||||
QETApp *QETApp::m_qetapp = nullptr;
|
||||
|
||||
|
||||
@@ -559,6 +560,27 @@ QString QETApp::commonTitleBlockTemplatesDir() {
|
||||
templates collection.
|
||||
*/
|
||||
QString QETApp::customTitleBlockTemplatesDir() {
|
||||
if (m_user_custom_tbt_dir.isEmpty())
|
||||
{
|
||||
QSettings settings;
|
||||
QString path = settings.value("elements-collections/custom-tbt-collection-path", "default").toString();
|
||||
if (path != "default" && !path.isEmpty())
|
||||
{
|
||||
QDir dir(path);
|
||||
if (dir.exists())
|
||||
{
|
||||
m_user_custom_tbt_dir = path;
|
||||
return m_user_custom_tbt_dir;
|
||||
}
|
||||
}
|
||||
else {
|
||||
m_user_custom_tbt_dir = "default";
|
||||
}
|
||||
}
|
||||
else if (m_user_custom_tbt_dir != "default") {
|
||||
return m_user_custom_tbt_dir;
|
||||
}
|
||||
|
||||
return(configDir() + "titleblocks/");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user