Add ability to store informations for element like label, manufacturer, ref etc....

Add widget to edit it, save/load works
Informations are stored in a diagramcontext, this class was modified (new feature) to store information
but keep compatibilty with older version.  


git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@2850 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2014-02-12 17:36:35 +00:00
parent 2c8bf84795
commit b361788873
14 changed files with 510 additions and 16 deletions

View File

@@ -337,6 +337,36 @@ ElementsCollectionCache *QETApp::collectionCache() {
return(collections_cache_);
}
/**
* @brief QETApp::elementInfoKeys
* @return all available key for describe an element
*/
QStringList QETApp::elementInfoKeys() {
QStringList info_list;
info_list << "label"
<< "comment"
<< "manufacturer"
<< "manufacturer-reference"
<< "machine-manufacturer-reference";
return info_list;
}
/**
* @brief ElementsProperties::translatedInfo
* Return the translated information key given by @info
* If @info don't match, return an empty string
* @param info the key to be translated
* @return
*/
QString QETApp::elementTranslatedInfoKey(QString &info) {
if (info == "label") return tr("Label");
else if (info == "comment") return tr("Commentaire");
else if (info == "manufacturer") return tr("Fabriquant");
else if (info == "manufacturer-reference") return tr("R\351f\351rence fabriquant");
else if (info == "machine-manufacturer-reference") return tr("R\351f\351rence fabriquant machine");
return (info);
}
/**
@return the common title block templates collection, i.e. the one provided
by QElecrotTech