mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 20:50:34 +01:00
added a second user-collection
This commit is contained in:
BIN
lang/qet_de.qm
BIN
lang/qet_de.qm
Binary file not shown.
423
lang/qet_de.ts
423
lang/qet_de.ts
File diff suppressed because it is too large
Load Diff
@@ -51,6 +51,7 @@
|
|||||||
<file>ico/16x16/endline-triangle.png</file>
|
<file>ico/16x16/endline-triangle.png</file>
|
||||||
<file>ico/16x16/folder-new.png</file>
|
<file>ico/16x16/folder-new.png</file>
|
||||||
<file>ico/16x16/folder.png</file>
|
<file>ico/16x16/folder.png</file>
|
||||||
|
<file>ico/16x16/go-company.png</file>
|
||||||
<file>ico/16x16/go-down.png</file>
|
<file>ico/16x16/go-down.png</file>
|
||||||
<file>ico/16x16/go-home.png</file>
|
<file>ico/16x16/go-home.png</file>
|
||||||
<file>ico/16x16/go-up.png</file>
|
<file>ico/16x16/go-up.png</file>
|
||||||
@@ -131,6 +132,7 @@
|
|||||||
<file>ico/22x22/folder-delete.png</file>
|
<file>ico/22x22/folder-delete.png</file>
|
||||||
<file>ico/22x22/folder-edit.png</file>
|
<file>ico/22x22/folder-edit.png</file>
|
||||||
<file>ico/22x22/folder-new.png</file>
|
<file>ico/22x22/folder-new.png</file>
|
||||||
|
<file>ico/22x22/go-company.png</file>
|
||||||
<file>ico/22x22/go-down.png</file>
|
<file>ico/22x22/go-down.png</file>
|
||||||
<file>ico/22x22/go-home.png</file>
|
<file>ico/22x22/go-home.png</file>
|
||||||
<file>ico/22x22/go-up.png</file>
|
<file>ico/22x22/go-up.png</file>
|
||||||
|
|||||||
@@ -258,6 +258,7 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data,
|
|||||||
@param projects : list of projects to load
|
@param projects : list of projects to load
|
||||||
*/
|
*/
|
||||||
void ElementsCollectionModel::loadCollections(bool common_collection,
|
void ElementsCollectionModel::loadCollections(bool common_collection,
|
||||||
|
bool company_collection,
|
||||||
bool custom_collection,
|
bool custom_collection,
|
||||||
QList<QETProject *> projects)
|
QList<QETProject *> projects)
|
||||||
{
|
{
|
||||||
@@ -265,10 +266,12 @@ void ElementsCollectionModel::loadCollections(bool common_collection,
|
|||||||
|
|
||||||
if (common_collection)
|
if (common_collection)
|
||||||
addCommonCollection(false);
|
addCommonCollection(false);
|
||||||
|
if (company_collection)
|
||||||
|
addCompanyCollection(false);
|
||||||
if (custom_collection)
|
if (custom_collection)
|
||||||
addCustomCollection(false);
|
addCustomCollection(false);
|
||||||
|
|
||||||
if (common_collection || custom_collection)
|
if (common_collection || company_collection || custom_collection)
|
||||||
m_items_list_to_setUp.append(items());
|
m_items_list_to_setUp.append(items());
|
||||||
|
|
||||||
|
|
||||||
@@ -320,6 +323,25 @@ void ElementsCollectionModel::addCommonCollection(bool set_data)
|
|||||||
delete feci;
|
delete feci;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ElementsCollectionModel::addCompanyCollection
|
||||||
|
Add the company elements collection to this model
|
||||||
|
@param set_data
|
||||||
|
*/
|
||||||
|
void ElementsCollectionModel::addCompanyCollection(bool set_data)
|
||||||
|
{
|
||||||
|
FileElementCollectionItem *feci = new FileElementCollectionItem();
|
||||||
|
if (feci->setRootPath(QETApp::companyElementsDirN(),
|
||||||
|
set_data,
|
||||||
|
m_hide_element)) {
|
||||||
|
invisibleRootItem()->appendRow(feci);
|
||||||
|
if (set_data)
|
||||||
|
feci->setUpData();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
delete feci;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsCollectionModel::addCustomCollection
|
@brief ElementsCollectionModel::addCustomCollection
|
||||||
Add the custom elements collection to this model
|
Add the custom elements collection to this model
|
||||||
@@ -557,8 +579,9 @@ QModelIndex ElementsCollectionModel::indexFromLocation(
|
|||||||
{
|
{
|
||||||
QList <ElementCollectionItem *> child_list;
|
QList <ElementCollectionItem *> child_list;
|
||||||
|
|
||||||
for (int i=0 ; i<rowCount() ; i++)
|
for (int i=0 ; i<rowCount() ; i++){
|
||||||
child_list.append(static_cast<ElementCollectionItem *>(item(i)));
|
child_list.append(static_cast<ElementCollectionItem *>(item(i)));
|
||||||
|
}
|
||||||
|
|
||||||
foreach(ElementCollectionItem *eci, child_list) {
|
foreach(ElementCollectionItem *eci, child_list) {
|
||||||
|
|
||||||
@@ -567,6 +590,7 @@ QModelIndex ElementsCollectionModel::indexFromLocation(
|
|||||||
if (eci->type() == FileElementCollectionItem::Type) {
|
if (eci->type() == FileElementCollectionItem::Type) {
|
||||||
if (FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci)) {
|
if (FileElementCollectionItem *feci = static_cast<FileElementCollectionItem *>(eci)) {
|
||||||
if ( (location.isCommonCollection() && feci->isCommonCollection()) ||
|
if ( (location.isCommonCollection() && feci->isCommonCollection()) ||
|
||||||
|
(location.isCompanyCollection() && feci->isCompanyCollection()) ||
|
||||||
(location.isCustomCollection() && !feci->isCommonCollection()) ) {
|
(location.isCustomCollection() && !feci->isCommonCollection()) ) {
|
||||||
match_eci = feci->itemAtPath(location.collectionPath(false));
|
match_eci = feci->itemAtPath(location.collectionPath(false));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,9 +42,10 @@ class ElementsCollectionModel : public QStandardItemModel
|
|||||||
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override;
|
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) const override;
|
||||||
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
|
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row, int column, const QModelIndex &parent) override;
|
||||||
|
|
||||||
void loadCollections(bool common_collection, bool custom_collection, QList<QETProject *> projects);
|
void loadCollections(bool common_collection, bool company_collection, bool custom_collection, QList<QETProject *> projects);
|
||||||
|
|
||||||
void addCommonCollection(bool set_data = true);
|
void addCommonCollection(bool set_data = true);
|
||||||
|
void addCompanyCollection(bool set_data = true);
|
||||||
void addCustomCollection(bool set_data = true);
|
void addCustomCollection(bool set_data = true);
|
||||||
void addLocation(const ElementsLocation& location);
|
void addLocation(const ElementsLocation& location);
|
||||||
|
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ void ElementsCollectionWidget::addProject(QETProject *project)
|
|||||||
m_progress_bar->show();
|
m_progress_bar->show();
|
||||||
m_tree_view->setDisabled(true);
|
m_tree_view->setDisabled(true);
|
||||||
QList <QETProject *> prj; prj.append(project);
|
QList <QETProject *> prj; prj.append(project);
|
||||||
m_model->loadCollections(false,false, prj);
|
m_model->loadCollections(false, false, false, prj);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
m_waiting_project.append(project);
|
m_waiting_project.append(project);
|
||||||
@@ -387,7 +387,8 @@ void ElementsCollectionWidget::deleteElement()
|
|||||||
if (! (loc.isElement()
|
if (! (loc.isElement()
|
||||||
&& loc.exist()
|
&& loc.exist()
|
||||||
&& loc.isFileSystem()
|
&& loc.isFileSystem()
|
||||||
&& loc.collectionPath().startsWith("custom://")) ) return;
|
&& (loc.collectionPath().startsWith("company://")
|
||||||
|
|| loc.collectionPath().startsWith("custom://"))) ) return;
|
||||||
|
|
||||||
if (QET::QetMessageBox::question(
|
if (QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
@@ -430,7 +431,8 @@ void ElementsCollectionWidget::deleteDirectory()
|
|||||||
if (! (loc.isDirectory()
|
if (! (loc.isDirectory()
|
||||||
&& loc.exist()
|
&& loc.exist()
|
||||||
&& loc.isFileSystem()
|
&& loc.isFileSystem()
|
||||||
&& loc.collectionPath().startsWith("custom://")) ) return;
|
&& (loc.collectionPath().startsWith("company://")
|
||||||
|
|| loc.collectionPath().startsWith("custom://"))) ) return;
|
||||||
|
|
||||||
if (QET::QetMessageBox::question(
|
if (QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
@@ -655,7 +657,7 @@ void ElementsCollectionWidget::reload()
|
|||||||
this,
|
this,
|
||||||
&ElementsCollectionWidget::loadingFinished);
|
&ElementsCollectionWidget::loadingFinished);
|
||||||
|
|
||||||
m_new_model->loadCollections(true, true, project_list);
|
m_new_model->loadCollections(true, true, true, project_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -168,7 +168,7 @@ QString ElementsLocation::baseName() const
|
|||||||
@brief ElementsLocation::collectionPath
|
@brief ElementsLocation::collectionPath
|
||||||
Return the path of the represented element relative to collection
|
Return the path of the represented element relative to collection
|
||||||
if protocol is true the path is prepended by
|
if protocol is true the path is prepended by
|
||||||
the collection type (common://, custom:// or embed://)
|
the collection type (common://, company://, custom:// or embed://)
|
||||||
else if false,
|
else if false,
|
||||||
only the collection path is returned without the collection type.
|
only the collection path is returned without the collection type.
|
||||||
@param protocol
|
@param protocol
|
||||||
@@ -181,7 +181,7 @@ QString ElementsLocation::collectionPath(bool protocol) const
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
QString path = m_collection_path;
|
QString path = m_collection_path;
|
||||||
return path.remove(QRegularExpression("common://|custom://|embed://"));
|
return path.remove(QRegularExpression("common://|company://|custom://|embed://"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -229,7 +229,7 @@ QString ElementsLocation::path() const
|
|||||||
@brief ElementsLocation::setPath
|
@brief ElementsLocation::setPath
|
||||||
Set the path of this item.
|
Set the path of this item.
|
||||||
The path can be relative to a collection
|
The path can be relative to a collection
|
||||||
(start by common:// , custom:// or embed://) or not.
|
(start by common://, company://, custom:// or embed://) or not.
|
||||||
@param path
|
@param path
|
||||||
*/
|
*/
|
||||||
void ElementsLocation::setPath(const QString &path)
|
void ElementsLocation::setPath(const QString &path)
|
||||||
@@ -290,7 +290,7 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
|
|
||||||
// The path is in file system,
|
// The path is in file system,
|
||||||
// the given path is relative to common or custom collection
|
// the given path is relative to common or custom collection
|
||||||
else if (path.startsWith("common://") || path.startsWith("custom://"))
|
else if (path.startsWith("common://") || path.startsWith("company://") || path.startsWith("custom://"))
|
||||||
{
|
{
|
||||||
QString p;
|
QString p;
|
||||||
if (path.startsWith("common://"))
|
if (path.startsWith("common://"))
|
||||||
@@ -298,6 +298,11 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
tmp_path.remove("common://");
|
tmp_path.remove("common://");
|
||||||
p = QETApp::commonElementsDirN() + "/" + tmp_path;
|
p = QETApp::commonElementsDirN() + "/" + tmp_path;
|
||||||
}
|
}
|
||||||
|
else if (path.startsWith("company://"))
|
||||||
|
{
|
||||||
|
tmp_path.remove("company://");
|
||||||
|
p = QETApp::companyElementsDirN() + "/" + tmp_path;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
tmp_path.remove("custom://");
|
tmp_path.remove("custom://");
|
||||||
@@ -320,6 +325,12 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
path_.prepend("common://");
|
path_.prepend("common://");
|
||||||
m_collection_path = path_;
|
m_collection_path = path_;
|
||||||
}
|
}
|
||||||
|
else if (path_.startsWith(QETApp::companyElementsDirN()))
|
||||||
|
{
|
||||||
|
path_.remove(QETApp::companyElementsDirN()+="/");
|
||||||
|
path_.prepend("company://");
|
||||||
|
m_collection_path = path_;
|
||||||
|
}
|
||||||
else if (path_.startsWith(QETApp::customElementsDirN()))
|
else if (path_.startsWith(QETApp::customElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::customElementsDirN()+="/");
|
path_.remove(QETApp::customElementsDirN()+="/");
|
||||||
@@ -336,6 +347,12 @@ void ElementsLocation::setPath(const QString &path)
|
|||||||
path_.prepend("common://");
|
path_.prepend("common://");
|
||||||
m_collection_path = path_;
|
m_collection_path = path_;
|
||||||
}
|
}
|
||||||
|
else if (path_.startsWith(QETApp::companyElementsDirN()))
|
||||||
|
{
|
||||||
|
path_.remove(QETApp::companyElementsDirN()+="/");
|
||||||
|
path_.prepend("company://");
|
||||||
|
m_collection_path = path_;
|
||||||
|
}
|
||||||
else if (path_.startsWith(QETApp::customElementsDirN()))
|
else if (path_.startsWith(QETApp::customElementsDirN()))
|
||||||
{
|
{
|
||||||
path_.remove(QETApp::customElementsDirN()+="/");
|
path_.remove(QETApp::customElementsDirN()+="/");
|
||||||
@@ -493,6 +510,16 @@ bool ElementsLocation::isCommonCollection() const
|
|||||||
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief ElementsLocation::isCompanyCollection
|
||||||
|
@return
|
||||||
|
True if this location represent an item from the company collection
|
||||||
|
*/
|
||||||
|
bool ElementsLocation::isCompanyCollection() const
|
||||||
|
{
|
||||||
|
return fileSystemPath().startsWith(QETApp::companyElementsDirN());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief ElementsLocation::isCustomCollection
|
@brief ElementsLocation::isCustomCollection
|
||||||
@return
|
@return
|
||||||
|
|||||||
@@ -76,6 +76,7 @@ class ElementsLocation
|
|||||||
bool isDirectory() const;
|
bool isDirectory() const;
|
||||||
bool isFileSystem() const;
|
bool isFileSystem() const;
|
||||||
bool isCommonCollection() const;
|
bool isCommonCollection() const;
|
||||||
|
bool isCompanyCollection() const;
|
||||||
bool isCustomCollection() const;
|
bool isCustomCollection() const;
|
||||||
bool isProject() const;
|
bool isProject() const;
|
||||||
bool exist() const;
|
bool exist() const;
|
||||||
|
|||||||
@@ -122,6 +122,8 @@ QString FileElementCollectionItem::localName()
|
|||||||
if (isCollectionRoot()) {
|
if (isCollectionRoot()) {
|
||||||
if (m_path == QETApp::commonElementsDirN())
|
if (m_path == QETApp::commonElementsDirN())
|
||||||
setText(QObject::tr("Collection QET"));
|
setText(QObject::tr("Collection QET"));
|
||||||
|
else if (m_path == QETApp::companyElementsDirN())
|
||||||
|
setText(QObject::tr("Collection Company"));
|
||||||
else if (m_path == QETApp::customElementsDirN())
|
else if (m_path == QETApp::customElementsDirN())
|
||||||
setText(QObject::tr("Collection utilisateur"));
|
setText(QObject::tr("Collection utilisateur"));
|
||||||
else
|
else
|
||||||
@@ -194,6 +196,8 @@ QString FileElementCollectionItem::collectionPath() const
|
|||||||
if (isCollectionRoot()) {
|
if (isCollectionRoot()) {
|
||||||
if (m_path == QETApp::commonElementsDirN())
|
if (m_path == QETApp::commonElementsDirN())
|
||||||
return "common://";
|
return "common://";
|
||||||
|
else if (m_path == QETApp::companyElementsDirN())
|
||||||
|
return "company://";
|
||||||
else
|
else
|
||||||
return "custom://";
|
return "custom://";
|
||||||
}
|
}
|
||||||
@@ -217,6 +221,7 @@ QString FileElementCollectionItem::collectionPath() const
|
|||||||
bool FileElementCollectionItem::isCollectionRoot() const
|
bool FileElementCollectionItem::isCollectionRoot() const
|
||||||
{
|
{
|
||||||
if (m_path == QETApp::commonElementsDirN()
|
if (m_path == QETApp::commonElementsDirN()
|
||||||
|
|| m_path == QETApp::companyElementsDirN()
|
||||||
|| m_path == QETApp::customElementsDirN())
|
|| m_path == QETApp::customElementsDirN())
|
||||||
return true;
|
return true;
|
||||||
else
|
else
|
||||||
@@ -232,6 +237,15 @@ bool FileElementCollectionItem::isCommonCollection() const
|
|||||||
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
return fileSystemPath().startsWith(QETApp::commonElementsDirN());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief FileElementCollectionItem::isCompanyCollection
|
||||||
|
@return True if this item represent the company collection
|
||||||
|
*/
|
||||||
|
bool FileElementCollectionItem::isCompanyCollection() const
|
||||||
|
{
|
||||||
|
return fileSystemPath().startsWith(QETApp::companyElementsDirN());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief FileElementCollectionItem::isCustomCollection
|
@brief FileElementCollectionItem::isCustomCollection
|
||||||
@return True if this item represent the custom collection
|
@return True if this item represent the custom collection
|
||||||
@@ -306,6 +320,8 @@ void FileElementCollectionItem::setUpIcon()
|
|||||||
if (isCollectionRoot()) {
|
if (isCollectionRoot()) {
|
||||||
if (m_path == QETApp::commonElementsDirN())
|
if (m_path == QETApp::commonElementsDirN())
|
||||||
setIcon(QIcon(":/ico/16x16/qet.png"));
|
setIcon(QIcon(":/ico/16x16/qet.png"));
|
||||||
|
else if (m_path == QETApp::companyElementsDirN())
|
||||||
|
setIcon(QIcon(":/ico/16x16/go-company.png"));
|
||||||
else
|
else
|
||||||
setIcon(QIcon(":/ico/16x16/go-home.png"));
|
setIcon(QIcon(":/ico/16x16/go-home.png"));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ class FileElementCollectionItem : public ElementCollectionItem
|
|||||||
QString collectionPath() const override;
|
QString collectionPath() const override;
|
||||||
bool isCollectionRoot() const override;
|
bool isCollectionRoot() const override;
|
||||||
bool isCommonCollection() const;
|
bool isCommonCollection() const;
|
||||||
|
bool isCompanyCollection() const;
|
||||||
bool isCustomCollection() const;
|
bool isCustomCollection() const;
|
||||||
void addChildAtPath(const QString &collection_name) override;
|
void addChildAtPath(const QString &collection_name) override;
|
||||||
|
|
||||||
|
|||||||
@@ -217,7 +217,8 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
|
|||||||
{HTMLYellowYellowFilling, "HTMLYellowYellow"},
|
{HTMLYellowYellowFilling, "HTMLYellowYellow"},
|
||||||
{HTMLYellowLightYellowFilling, "HTMLYellowLightYellow"},
|
{HTMLYellowLightYellowFilling, "HTMLYellowLightYellow"},
|
||||||
{HTMLYellowLemonChiffonFilling, "HTMLYellowLemonChiffon"},
|
{HTMLYellowLemonChiffonFilling, "HTMLYellowLemonChiffon"},
|
||||||
{HTMLYellowLightGoldenrodYellowFilling, "HTMLYellowLightGoldenrodYellow"},
|
{HTMLYellowLightGoldenrodYellowFilling,
|
||||||
|
"HTMLYellowLightGoldenrodYellow"},
|
||||||
{HTMLYellowPapayaWhipFilling, "HTMLYellowPapayaWhip"},
|
{HTMLYellowPapayaWhipFilling, "HTMLYellowPapayaWhip"},
|
||||||
{HTMLYellowMoccasinFilling, "HTMLYellowMoccasin"},
|
{HTMLYellowMoccasinFilling, "HTMLYellowMoccasin"},
|
||||||
{HTMLYellowPeachPuffFilling, "HTMLYellowPeachPuff"},
|
{HTMLYellowPeachPuffFilling, "HTMLYellowPeachPuff"},
|
||||||
@@ -594,7 +595,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
|||||||
{"HTMLYellowYellow", HTMLYellowYellowFilling},
|
{"HTMLYellowYellow", HTMLYellowYellowFilling},
|
||||||
{"HTMLYellowLightYellow", HTMLYellowLightYellowFilling},
|
{"HTMLYellowLightYellow", HTMLYellowLightYellowFilling},
|
||||||
{"HTMLYellowLemonChiffon", HTMLYellowLemonChiffonFilling},
|
{"HTMLYellowLemonChiffon", HTMLYellowLemonChiffonFilling},
|
||||||
{"HTMLYellowLightGoldenrodYellow", HTMLYellowLightGoldenrodYellowFilling},
|
{"HTMLYellowLightGoldenrodYellow",
|
||||||
|
HTMLYellowLightGoldenrodYellowFilling},
|
||||||
{"HTMLYellowPapayaWhip", HTMLYellowPapayaWhipFilling},
|
{"HTMLYellowPapayaWhip", HTMLYellowPapayaWhipFilling},
|
||||||
{"HTMLYellowMoccasin", HTMLYellowMoccasinFilling},
|
{"HTMLYellowMoccasin", HTMLYellowMoccasinFilling},
|
||||||
{"HTMLYellowPeachPuff", HTMLYellowPeachPuffFilling},
|
{"HTMLYellowPeachPuff", HTMLYellowPeachPuffFilling},
|
||||||
@@ -629,7 +631,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
|||||||
{"HTMLGreenChartreuse", HTMLGreenChartreuseFilling},
|
{"HTMLGreenChartreuse", HTMLGreenChartreuseFilling},
|
||||||
{"HTMLGreenGreenYellow", HTMLGreenGreenYellowFilling},
|
{"HTMLGreenGreenYellow", HTMLGreenGreenYellowFilling},
|
||||||
{"HTMLGreenSpringGreen", HTMLGreenSpringGreenFilling},
|
{"HTMLGreenSpringGreen", HTMLGreenSpringGreenFilling},
|
||||||
{"HTMLGreenMediumSpringGreen", HTMLGreenMediumSpringGreenFilling},
|
{"HTMLGreenMediumSpringGreen",
|
||||||
|
HTMLGreenMediumSpringGreenFilling},
|
||||||
{"HTMLGreenLightGreen", HTMLGreenLightGreenFilling},
|
{"HTMLGreenLightGreen", HTMLGreenLightGreenFilling},
|
||||||
{"HTMLGreenPaleGreen", HTMLGreenPaleGreenFilling},
|
{"HTMLGreenPaleGreen", HTMLGreenPaleGreenFilling},
|
||||||
{"HTMLGreenDarkSeaGreen", HTMLGreenDarkSeaGreenFilling},
|
{"HTMLGreenDarkSeaGreen", HTMLGreenDarkSeaGreenFilling},
|
||||||
@@ -759,7 +762,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
|
|||||||
{"HTMLYellowYellow", HTMLYellowYellowColor},
|
{"HTMLYellowYellow", HTMLYellowYellowColor},
|
||||||
{"HTMLYellowLightYellow", HTMLYellowLightYellowColor},
|
{"HTMLYellowLightYellow", HTMLYellowLightYellowColor},
|
||||||
{"HTMLYellowLemonChiffon", HTMLYellowLemonChiffonColor},
|
{"HTMLYellowLemonChiffon", HTMLYellowLemonChiffonColor},
|
||||||
{"HTMLYellowLightGoldenrodYellow", HTMLYellowLightGoldenrodYellowColor},
|
{"HTMLYellowLightGoldenrodYellow",
|
||||||
|
HTMLYellowLightGoldenrodYellowColor},
|
||||||
{"HTMLYellowPapayaWhip", HTMLYellowPapayaWhipColor},
|
{"HTMLYellowPapayaWhip", HTMLYellowPapayaWhipColor},
|
||||||
{"HTMLYellowMoccasin", HTMLYellowMoccasinColor},
|
{"HTMLYellowMoccasin", HTMLYellowMoccasinColor},
|
||||||
{"HTMLYellowPeachPuff", HTMLYellowPeachPuffColor},
|
{"HTMLYellowPeachPuff", HTMLYellowPeachPuffColor},
|
||||||
|
|||||||
@@ -176,6 +176,7 @@ qreal PartTerminal::rotation() const {
|
|||||||
case Qet::South : return 180;
|
case Qet::South : return 180;
|
||||||
case Qet::West : return 270;
|
case Qet::West : return 270;
|
||||||
}
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -93,9 +93,9 @@ void ElementDialog::setUpWidget()
|
|||||||
prjs.append(prj);
|
prjs.append(prj);
|
||||||
|
|
||||||
if (m_mode == OpenElement)
|
if (m_mode == OpenElement)
|
||||||
m_model->loadCollections(true, true, prjs);
|
m_model->loadCollections(true, true, true, prjs);
|
||||||
else
|
else
|
||||||
m_model->loadCollections(false, true, prjs);
|
m_model->loadCollections(false, true, true, prjs);
|
||||||
|
|
||||||
m_tree_view->setModel(m_model);
|
m_tree_view->setModel(m_model);
|
||||||
m_tree_view->setHeaderHidden(true);
|
m_tree_view->setHeaderHidden(true);
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item,
|
|||||||
void ElementsPanel::reload()
|
void ElementsPanel::reload()
|
||||||
{
|
{
|
||||||
QIcon system_icon(":/ico/16x16/qet.png");
|
QIcon system_icon(":/ico/16x16/qet.png");
|
||||||
|
QIcon company_icon(":/ico/16x16/go-company.png");
|
||||||
QIcon user_icon(":/ico/16x16/go-home.png");
|
QIcon user_icon(":/ico/16x16/go-home.png");
|
||||||
|
|
||||||
// load the common title block templates collection
|
// load the common title block templates collection
|
||||||
|
|||||||
@@ -81,6 +81,7 @@ class ElementsPanel : public GenericPanel {
|
|||||||
private:
|
private:
|
||||||
QSet<QETProject *> projects_to_display_; ///< list of projects that have been added to this panel
|
QSet<QETProject *> projects_to_display_; ///< list of projects that have been added to this panel
|
||||||
QTreeWidgetItem *common_tbt_collection_item_; ///< pointer to the item representing the common templates collection
|
QTreeWidgetItem *common_tbt_collection_item_; ///< pointer to the item representing the common templates collection
|
||||||
|
QTreeWidgetItem *company_tbt_collection_item_; ///< pointer to the item representing the company's templates collection
|
||||||
QTreeWidgetItem *custom_tbt_collection_item_; ///< pointer to the item representing the user templates collection
|
QTreeWidgetItem *custom_tbt_collection_item_; ///< pointer to the item representing the user templates collection
|
||||||
bool first_reload_; ///< used to distinguish the first time this panel is reloaded
|
bool first_reload_; ///< used to distinguish the first time this panel is reloaded
|
||||||
QString filter_; ///< Currently applied filter
|
QString filter_; ///< Currently applied filter
|
||||||
|
|||||||
@@ -362,6 +362,7 @@ QString ElementData::masterTypeToString(ElementData::MasterType type)
|
|||||||
case ElementData::Commutator:
|
case ElementData::Commutator:
|
||||||
return QStringLiteral("commutator");
|
return QStringLiteral("commutator");
|
||||||
}
|
}
|
||||||
|
return QStringLiteral("coil");
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementData::MasterType ElementData::masterTypeFromString(const QString &string)
|
ElementData::MasterType ElementData::masterTypeFromString(const QString &string)
|
||||||
@@ -394,6 +395,7 @@ QString ElementData::slaveTypeToString(ElementData::SlaveType type)
|
|||||||
case ElementData::delayOnOff:
|
case ElementData::delayOnOff:
|
||||||
return QStringLiteral("delayOnOff");
|
return QStringLiteral("delayOnOff");
|
||||||
}
|
}
|
||||||
|
return QStringLiteral("simple");
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementData::SlaveType ElementData::slaveTypeFromString(const QString &string)
|
ElementData::SlaveType ElementData::slaveTypeFromString(const QString &string)
|
||||||
@@ -428,6 +430,7 @@ QString ElementData::slaveStateToString(ElementData::SlaveState type)
|
|||||||
case Other:
|
case Other:
|
||||||
return QStringLiteral("Other");
|
return QStringLiteral("Other");
|
||||||
}
|
}
|
||||||
|
return QStringLiteral("Other");
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementData::SlaveState ElementData::slaveStateFromString(const QString &string)
|
ElementData::SlaveState ElementData::slaveStateFromString(const QString &string)
|
||||||
@@ -462,6 +465,7 @@ QString ElementData::terminalTypeToString(ElementData::TerminalType type)
|
|||||||
case ElementData::TTGround:
|
case ElementData::TTGround:
|
||||||
return QStringLiteral("ground");
|
return QStringLiteral("ground");
|
||||||
}
|
}
|
||||||
|
return QStringLiteral("generic");
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementData::TerminalType ElementData::terminalTypeFromString(const QString &string)
|
ElementData::TerminalType ElementData::terminalTypeFromString(const QString &string)
|
||||||
@@ -498,6 +502,7 @@ QString ElementData::translatedTerminalType(ElementData::TerminalType type)
|
|||||||
case ElementData::TTGround:
|
case ElementData::TTGround:
|
||||||
return QObject::tr("Terre", "ground terminal element type");
|
return QObject::tr("Terre", "ground terminal element type");
|
||||||
}
|
}
|
||||||
|
return QObject::tr("Générique", "generic terminal element type");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString ElementData::terminalFunctionToString(ElementData::TerminalFunction function)
|
QString ElementData::terminalFunctionToString(ElementData::TerminalFunction function)
|
||||||
@@ -510,6 +515,7 @@ QString ElementData::terminalFunctionToString(ElementData::TerminalFunction func
|
|||||||
case ElementData::TFNeutral:
|
case ElementData::TFNeutral:
|
||||||
return QStringLiteral("neutral");
|
return QStringLiteral("neutral");
|
||||||
}
|
}
|
||||||
|
return QStringLiteral("generic");
|
||||||
}
|
}
|
||||||
|
|
||||||
ElementData::TerminalFunction ElementData::terminalFunctionFromString(const QString &string)
|
ElementData::TerminalFunction ElementData::terminalFunctionFromString(const QString &string)
|
||||||
@@ -535,6 +541,7 @@ QString ElementData::translatedTerminalFunction(ElementData::TerminalFunction fu
|
|||||||
case TFPhase : return QObject::tr("Phase", "phase terminal element function" );
|
case TFPhase : return QObject::tr("Phase", "phase terminal element function" );
|
||||||
case TFNeutral : return QObject::tr("Neutre", "neutral terminal element function");
|
case TFNeutral : return QObject::tr("Neutre", "neutral terminal element function");
|
||||||
}
|
}
|
||||||
|
return QObject::tr("Générique", "generic terminal element function");
|
||||||
}
|
}
|
||||||
|
|
||||||
void ElementData::kindInfoFromXml(const QDomElement &xml_element)
|
void ElementData::kindInfoFromXml(const QDomElement &xml_element)
|
||||||
|
|||||||
@@ -172,6 +172,7 @@ QString TerminalData::typeToString(TerminalData::Type type)
|
|||||||
case Outer :
|
case Outer :
|
||||||
return QString("Outer");
|
return QString("Outer");
|
||||||
}
|
}
|
||||||
|
return QString("Generic");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -687,6 +687,8 @@ QString QET::qetCollectionToString(const QET::QetCollection &c)
|
|||||||
{
|
{
|
||||||
case Common :
|
case Common :
|
||||||
return "common";
|
return "common";
|
||||||
|
case Company :
|
||||||
|
return "company";
|
||||||
case Custom :
|
case Custom :
|
||||||
return "custom";
|
return "custom";
|
||||||
case Embedded :
|
case Embedded :
|
||||||
@@ -706,6 +708,8 @@ QET::QetCollection QET::qetCollectionFromString(const QString &str)
|
|||||||
{
|
{
|
||||||
if (str == "common")
|
if (str == "common")
|
||||||
return QetCollection::Common;
|
return QetCollection::Common;
|
||||||
|
else if (str == "company")
|
||||||
|
return QetCollection::Company;
|
||||||
else if (str == "custom")
|
else if (str == "custom")
|
||||||
return QetCollection::Custom;
|
return QetCollection::Custom;
|
||||||
else if (str == "embedded")
|
else if (str == "embedded")
|
||||||
|
|||||||
@@ -147,6 +147,7 @@ namespace QET {
|
|||||||
///Enum used to specify the origin of a collection of thing (title block, element etc...)
|
///Enum used to specify the origin of a collection of thing (title block, element etc...)
|
||||||
enum QetCollection {
|
enum QetCollection {
|
||||||
Common, ///< From common collection
|
Common, ///< From common collection
|
||||||
|
Company, ///< From company collection
|
||||||
Custom, ///< From user collection
|
Custom, ///< From user collection
|
||||||
Embedded ///< From an embedded collection (a project for example)
|
Embedded ///< From an embedded collection (a project for example)
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ TitleBlockTemplate *QETApp::default_titleblock_template_ = nullptr;
|
|||||||
QString QETApp::m_common_element_dir = QString();
|
QString QETApp::m_common_element_dir = QString();
|
||||||
bool QETApp::m_common_element_dir_is_set = false;
|
bool QETApp::m_common_element_dir_is_set = false;
|
||||||
|
|
||||||
|
QString QETApp::m_company_element_dir = QString();
|
||||||
|
bool QETApp::m_company_element_dir_is_set = false;
|
||||||
|
|
||||||
QString QETApp::m_custom_element_dir = QString();
|
QString QETApp::m_custom_element_dir = QString();
|
||||||
bool QETApp::m_custom_element_dir_is_set = false;
|
bool QETApp::m_custom_element_dir_is_set = false;
|
||||||
|
|
||||||
@@ -592,6 +595,43 @@ QString QETApp::customElementsDir()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief QETApp::companyElementsDir
|
||||||
|
@return the dir path of company elements collection appended with a
|
||||||
|
"/" separator
|
||||||
|
*/
|
||||||
|
QString QETApp::companyElementsDir()
|
||||||
|
{
|
||||||
|
if (m_company_element_dir_is_set)
|
||||||
|
{
|
||||||
|
return m_company_element_dir;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
m_company_element_dir_is_set = true;
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
QString path = settings.value(
|
||||||
|
"elements-collections/company-collection-path",
|
||||||
|
"default").toString();
|
||||||
|
if (path != "default" && !path.isEmpty())
|
||||||
|
{
|
||||||
|
QDir dir(path);
|
||||||
|
if (dir.exists())
|
||||||
|
{
|
||||||
|
m_company_element_dir = path;
|
||||||
|
if(!m_company_element_dir.endsWith("/")) {
|
||||||
|
m_company_element_dir.append("/");
|
||||||
|
}
|
||||||
|
return m_company_element_dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_company_element_dir = configDir() + "elements/";
|
||||||
|
return m_company_element_dir;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief QETApp::commonElementsDirN
|
@brief QETApp::commonElementsDirN
|
||||||
like QString QETApp::commonElementsDir but without "/" at the end
|
like QString QETApp::commonElementsDir but without "/" at the end
|
||||||
@@ -604,6 +644,18 @@ QString QETApp::commonElementsDirN()
|
|||||||
return path;
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@brief QETApp::companyElementsDirN
|
||||||
|
like QString QETApp::companyElementsDir but without "/" at the end
|
||||||
|
@return QString path
|
||||||
|
*/
|
||||||
|
QString QETApp::companyElementsDirN()
|
||||||
|
{
|
||||||
|
QString path = companyElementsDir();
|
||||||
|
if (path.endsWith("/")) path.remove(path.length()-1, 1);
|
||||||
|
return path;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@brief QETApp::customElementsDirN
|
@brief QETApp::customElementsDirN
|
||||||
like QString QETApp::customElementsDir but without "/" at the end
|
like QString QETApp::customElementsDir but without "/" at the end
|
||||||
@@ -758,6 +810,10 @@ QString QETApp::realPath(const QString &sym_path) {
|
|||||||
QString directory;
|
QString directory;
|
||||||
if (sym_path.startsWith("common://")) {
|
if (sym_path.startsWith("common://")) {
|
||||||
directory = commonElementsDir();
|
directory = commonElementsDir();
|
||||||
|
} else if (sym_path.startsWith("company://")) {
|
||||||
|
directory = companyElementsDir();
|
||||||
|
} else if (sym_path.startsWith("company://")) {
|
||||||
|
directory = companyElementsDir();
|
||||||
} else if (sym_path.startsWith("custom://")) {
|
} else if (sym_path.startsWith("custom://")) {
|
||||||
directory = customElementsDir();
|
directory = customElementsDir();
|
||||||
} else if (sym_path.startsWith(QETAPP_COMMON_TBT_PROTOCOL "://")) {
|
} else if (sym_path.startsWith(QETAPP_COMMON_TBT_PROTOCOL "://")) {
|
||||||
@@ -790,6 +846,7 @@ QString QETApp::symbolicPath(const QString &real_path) {
|
|||||||
// get the common and custom folders
|
// get the common and custom folders
|
||||||
// recupere les dossier common et custom
|
// recupere les dossier common et custom
|
||||||
QString commond = commonElementsDir();
|
QString commond = commonElementsDir();
|
||||||
|
QString companyd = companyElementsDir();
|
||||||
QString customd = customElementsDir();
|
QString customd = customElementsDir();
|
||||||
QString chemin;
|
QString chemin;
|
||||||
// analyzes the file path passed in parameter
|
// analyzes the file path passed in parameter
|
||||||
@@ -798,6 +855,10 @@ QString QETApp::symbolicPath(const QString &real_path) {
|
|||||||
chemin = "common://"
|
chemin = "common://"
|
||||||
+ real_path.right(
|
+ real_path.right(
|
||||||
real_path.length() - commond.length());
|
real_path.length() - commond.length());
|
||||||
|
} else if (real_path.startsWith(companyd)) {
|
||||||
|
chemin = "company://"
|
||||||
|
+ real_path.right(
|
||||||
|
real_path.length() - companyd.length());
|
||||||
} else if (real_path.startsWith(customd)) {
|
} else if (real_path.startsWith(customd)) {
|
||||||
chemin = "custom://"
|
chemin = "custom://"
|
||||||
+ real_path.right(
|
+ real_path.right(
|
||||||
@@ -1917,6 +1978,10 @@ void QETApp::initConfiguration()
|
|||||||
if (!custom_elements_dir.exists())
|
if (!custom_elements_dir.exists())
|
||||||
custom_elements_dir.mkpath(QETApp::customElementsDir());
|
custom_elements_dir.mkpath(QETApp::customElementsDir());
|
||||||
|
|
||||||
|
QDir company_elements_dir(QETApp::companyElementsDir());
|
||||||
|
if (!company_elements_dir.exists())
|
||||||
|
company_elements_dir.mkpath(QETApp::companyElementsDir());
|
||||||
|
|
||||||
QDir custom_tbt_dir(QETApp::customTitleBlockTemplatesDir());
|
QDir custom_tbt_dir(QETApp::customTitleBlockTemplatesDir());
|
||||||
if (!custom_tbt_dir.exists())
|
if (!custom_tbt_dir.exists())
|
||||||
custom_tbt_dir.mkpath(QETApp::customTitleBlockTemplatesDir());
|
custom_tbt_dir.mkpath(QETApp::customTitleBlockTemplatesDir());
|
||||||
|
|||||||
@@ -80,8 +80,10 @@ class QETApp : public QObject
|
|||||||
static TitleBlockTemplatesCollection *titleBlockTemplatesCollection(const QString &);
|
static TitleBlockTemplatesCollection *titleBlockTemplatesCollection(const QString &);
|
||||||
|
|
||||||
static QString commonElementsDir();
|
static QString commonElementsDir();
|
||||||
|
static QString companyElementsDir();
|
||||||
static QString customElementsDir();
|
static QString customElementsDir();
|
||||||
static QString commonElementsDirN();
|
static QString commonElementsDirN();
|
||||||
|
static QString companyElementsDirN();
|
||||||
static QString customElementsDirN();
|
static QString customElementsDirN();
|
||||||
static void resetCollectionsPath();
|
static void resetCollectionsPath();
|
||||||
static QString commonTitleBlockTemplatesDir();
|
static QString commonTitleBlockTemplatesDir();
|
||||||
@@ -213,6 +215,9 @@ class QETApp : public QObject
|
|||||||
static QString m_common_element_dir;
|
static QString m_common_element_dir;
|
||||||
static bool m_common_element_dir_is_set;
|
static bool m_common_element_dir_is_set;
|
||||||
|
|
||||||
|
static QString m_company_element_dir;
|
||||||
|
static bool m_company_element_dir_is_set;
|
||||||
|
|
||||||
static QString m_custom_element_dir;
|
static QString m_custom_element_dir;
|
||||||
static bool m_custom_element_dir_is_set;
|
static bool m_custom_element_dir_is_set;
|
||||||
|
|
||||||
|
|||||||
@@ -970,10 +970,12 @@ bool QetShapeItem::toDXF(const QString &filepath,const QPen &pen)
|
|||||||
Createdxf::dxfColor(pen));
|
Createdxf::dxfColor(pen));
|
||||||
return true;
|
return true;
|
||||||
case Polygon:
|
case Polygon:
|
||||||
if(m_polygon.isClosed())
|
if(m_polygon.isClosed()) {
|
||||||
Createdxf::drawPolygon(filepath,m_polygon,Createdxf::dxfColor(pen));
|
Createdxf::drawPolygon(filepath,m_polygon,Createdxf::dxfColor(pen));
|
||||||
else
|
}
|
||||||
|
else {
|
||||||
Createdxf::drawPolyline(filepath,m_polygon,Createdxf::dxfColor(pen));
|
Createdxf::drawPolyline(filepath,m_polygon,Createdxf::dxfColor(pen));
|
||||||
|
}
|
||||||
return true;
|
return true;
|
||||||
default:
|
default:
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ namespace QET {
|
|||||||
QIcon Autoconnect;
|
QIcon Autoconnect;
|
||||||
QIcon BringForward;
|
QIcon BringForward;
|
||||||
QIcon Cancel;
|
QIcon Cancel;
|
||||||
|
QIcon Company;
|
||||||
QIcon Conductor;
|
QIcon Conductor;
|
||||||
QIcon ConductorEdit;
|
QIcon ConductorEdit;
|
||||||
QIcon ConductorSettings;
|
QIcon ConductorSettings;
|
||||||
@@ -395,6 +396,8 @@ void QET::Icons::initIcons()
|
|||||||
Autoconnect .addFile(":/ico/22x22/autoconnect.png");
|
Autoconnect .addFile(":/ico/22x22/autoconnect.png");
|
||||||
BringForward .addFile(":/ico/22x22/bring_forward.png");
|
BringForward .addFile(":/ico/22x22/bring_forward.png");
|
||||||
Cancel .addFile(":/ico/16x16/item-cancel.png");
|
Cancel .addFile(":/ico/16x16/item-cancel.png");
|
||||||
|
Company .addFile(":/ico/16x16/go-company.png");
|
||||||
|
Company .addFile(":/ico/22x22/go-company.png");
|
||||||
Conductor .addFile(":/ico/16x16/conductor.png");
|
Conductor .addFile(":/ico/16x16/conductor.png");
|
||||||
ConductorEdit .addFile(":/ico/16x16/conductor-edit.png");
|
ConductorEdit .addFile(":/ico/16x16/conductor-edit.png");
|
||||||
ConductorSettings .addFile(":/ico/16x16/conductor-reset.png");
|
ConductorSettings .addFile(":/ico/16x16/conductor-reset.png");
|
||||||
|
|||||||
@@ -39,6 +39,7 @@ namespace QET {
|
|||||||
extern QIcon Autoconnect;
|
extern QIcon Autoconnect;
|
||||||
extern QIcon BringForward;
|
extern QIcon BringForward;
|
||||||
extern QIcon Cancel;
|
extern QIcon Cancel;
|
||||||
|
extern QIcon Company;
|
||||||
extern QIcon Conductor;
|
extern QIcon Conductor;
|
||||||
extern QIcon ConductorEdit;
|
extern QIcon ConductorEdit;
|
||||||
extern QIcon ConductorSettings;
|
extern QIcon ConductorSettings;
|
||||||
|
|||||||
@@ -509,6 +509,9 @@ void QETProject::setDefaultTitleBlockProperties(const TitleBlockProperties &titl
|
|||||||
case QET::Common :
|
case QET::Common :
|
||||||
collection = QETApp::commonTitleBlockTemplatesCollection();
|
collection = QETApp::commonTitleBlockTemplatesCollection();
|
||||||
break;
|
break;
|
||||||
|
case QET::Company :
|
||||||
|
// collection = QETApp::companyTitleBlockTemplatesCollection();
|
||||||
|
break;
|
||||||
case QET::Custom :
|
case QET::Custom :
|
||||||
collection = QETApp::customTitleBlockTemplatesCollection();
|
collection = QETApp::customTitleBlockTemplatesCollection();
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -138,6 +138,15 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
|
|||||||
ui->m_common_elmt_path_cb->blockSignals(false);
|
ui->m_common_elmt_path_cb->blockSignals(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path = settings.value("elements-collections/company-collection-path", "default").toString();
|
||||||
|
if (path != "default")
|
||||||
|
{
|
||||||
|
ui->m_company_elmt_path_cb->blockSignals(true);
|
||||||
|
ui->m_company_elmt_path_cb->setCurrentIndex(1);
|
||||||
|
ui->m_company_elmt_path_cb->setItemData(1, path, Qt::DisplayRole);
|
||||||
|
ui->m_company_elmt_path_cb->blockSignals(false);
|
||||||
|
}
|
||||||
|
|
||||||
path = settings.value("elements-collections/custom-collection-path", "default").toString();
|
path = settings.value("elements-collections/custom-collection-path", "default").toString();
|
||||||
if (path != "default")
|
if (path != "default")
|
||||||
{
|
{
|
||||||
@@ -241,6 +250,21 @@ void GeneralConfigurationPage::applyConf()
|
|||||||
QETApp::resetCollectionsPath();
|
QETApp::resetCollectionsPath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path = settings.value("elements-collections/company-collection-path").toString();
|
||||||
|
if (ui->m_company_elmt_path_cb->currentIndex() == 1)
|
||||||
|
{
|
||||||
|
QString path = ui->m_company_elmt_path_cb->currentText();
|
||||||
|
QDir dir(path);
|
||||||
|
settings.setValue("elements-collections/company-collection-path",
|
||||||
|
dir.exists() ? path : "default");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
settings.setValue("elements-collections/company-collection-path", "default");
|
||||||
|
}
|
||||||
|
if (path != settings.value("elements-collections/company-collection-path").toString()) {
|
||||||
|
QETApp::resetCollectionsPath();
|
||||||
|
}
|
||||||
|
|
||||||
path = settings.value("elements-collections/custom-collection-path").toString();
|
path = settings.value("elements-collections/custom-collection-path").toString();
|
||||||
if (ui->m_custom_elmt_path_cb->currentIndex() == 1)
|
if (ui->m_custom_elmt_path_cb->currentIndex() == 1)
|
||||||
{
|
{
|
||||||
@@ -398,6 +422,20 @@ void GeneralConfigurationPage::on_m_common_elmt_path_cb_currentIndexChanged(int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GeneralConfigurationPage::on_m_company_elmt_path_cb_currentIndexChanged(int index)
|
||||||
|
{
|
||||||
|
if (index == 1)
|
||||||
|
{
|
||||||
|
QString path = QFileDialog::getExistingDirectory(this, tr("Chemin de la collection company"), QDir::homePath());
|
||||||
|
if (!path.isEmpty()) {
|
||||||
|
ui->m_company_elmt_path_cb->setItemData(1, path, Qt::DisplayRole);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ui->m_company_elmt_path_cb->setCurrentIndex(0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void GeneralConfigurationPage::on_m_custom_elmt_path_cb_currentIndexChanged(int index)
|
void GeneralConfigurationPage::on_m_custom_elmt_path_cb_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (index == 1)
|
if (index == 1)
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ class GeneralConfigurationPage : public ConfigPage
|
|||||||
void on_m_font_pb_clicked();
|
void on_m_font_pb_clicked();
|
||||||
void on_m_dyn_text_font_pb_clicked();
|
void on_m_dyn_text_font_pb_clicked();
|
||||||
void on_m_common_elmt_path_cb_currentIndexChanged(int index);
|
void on_m_common_elmt_path_cb_currentIndexChanged(int index);
|
||||||
|
void on_m_company_elmt_path_cb_currentIndexChanged(int index);
|
||||||
void on_m_custom_elmt_path_cb_currentIndexChanged(int index);
|
void on_m_custom_elmt_path_cb_currentIndexChanged(int index);
|
||||||
void on_m_custom_tbt_path_cb_currentIndexChanged(int index);
|
void on_m_custom_tbt_path_cb_currentIndexChanged(int index);
|
||||||
void on_m_indi_text_font_pb_clicked();
|
void on_m_indi_text_font_pb_clicked();
|
||||||
|
|||||||
@@ -6,7 +6,7 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>822</width>
|
<width>872</width>
|
||||||
<height>411</height>
|
<height>411</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="tabWidget">
|
<widget class="QTabWidget" name="tabWidget">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="tab_3">
|
<widget class="QWidget" name="tab_3">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@@ -243,13 +243,34 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_16">
|
||||||
|
<property name="text">
|
||||||
|
<string>Répertoire de la collection company</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QComboBox" name="m_company_elmt_path_cb">
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Par defaut</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<property name="text">
|
||||||
|
<string>Parcourir...</string>
|
||||||
|
</property>
|
||||||
|
</item>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="label_8">
|
<widget class="QLabel" name="label_8">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Répertoire de la collection utilisateur</string>
|
<string>Répertoire de la collection utilisateur</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QComboBox" name="m_custom_elmt_path_cb">
|
<widget class="QComboBox" name="m_custom_elmt_path_cb">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -263,7 +284,14 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="label_10">
|
||||||
|
<property name="text">
|
||||||
|
<string>Répertoire des cartouches utilisateur</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
<widget class="QComboBox" name="m_custom_tbt_path_cb">
|
<widget class="QComboBox" name="m_custom_tbt_path_cb">
|
||||||
<item>
|
<item>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
@@ -277,20 +305,13 @@
|
|||||||
</item>
|
</item>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="4" column="1">
|
<item row="5" column="1">
|
||||||
<widget class="QLabel" name="label_9">
|
<widget class="QLabel" name="label_9">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>(Recharger les collections d'éléments pour appliquer les changements)</string>
|
<string>(Recharger les collections d'éléments pour appliquer les changements)</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="label_10">
|
|
||||||
<property name="text">
|
|
||||||
<string>Répertoire des cartouches utilisateur</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@@ -847,9 +868,9 @@ Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments
|
|||||||
</attribute>
|
</attribute>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_7">
|
<layout class="QVBoxLayout" name="verticalLayout_7">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout_1">
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="label_2">
|
<widget class="QLabel" name="label_1">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Max. parts in Element Editor List</string>
|
<string>Max. parts in Element Editor List</string>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
@@ -419,6 +419,8 @@ void TitleBlockPropertiesWidget::updateTemplateList()
|
|||||||
QET::QetCollection qc = tbt_c -> collection();
|
QET::QetCollection qc = tbt_c -> collection();
|
||||||
if (qc == QET::QetCollection::Common)
|
if (qc == QET::QetCollection::Common)
|
||||||
icon = QET::Icons::QETLogo;
|
icon = QET::Icons::QETLogo;
|
||||||
|
else if (qc == QET::QetCollection::Company)
|
||||||
|
icon = QET::Icons::Company;
|
||||||
else if (qc == QET::QetCollection::Custom)
|
else if (qc == QET::QetCollection::Custom)
|
||||||
icon = QET::Icons::Home;
|
icon = QET::Icons::Home;
|
||||||
else if (qc == QET::QetCollection::Embedded)
|
else if (qc == QET::QetCollection::Embedded)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#include "macosxopenevent.h"
|
#include "macosxopenevent.h"
|
||||||
|
|
||||||
#include "singleapplication.h"
|
#include "../singleapplication.h"
|
||||||
|
|
||||||
#include <QFileOpenEvent>
|
#include <QFileOpenEvent>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user