diff --git a/lang/qet_de.qm b/lang/qet_de.qm
index 81d5d7089..2e22a0177 100644
Binary files a/lang/qet_de.qm and b/lang/qet_de.qm differ
diff --git a/lang/qet_de.ts b/lang/qet_de.ts
index 53e5e2e6d..a6ab87024 100644
--- a/lang/qet_de.ts
+++ b/lang/qet_de.ts
@@ -946,6 +946,11 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.bus
Bus:
+
+
+ TextLabel
+ TextLabel
+
@@ -982,11 +987,6 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.Terre
Erde
-
-
- TextLabel
-
-
Taille :
@@ -1094,7 +1094,7 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.
GroupBox
-
+
@@ -1105,7 +1105,7 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.
CustomElementGraphicPart
-
+
Déplacer une primitive
Stammfunktion verschieben
@@ -2159,11 +2159,6 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.
ElementQueryWidget
-
-
- Form
-
-
Informations disponibles
@@ -2274,6 +2269,11 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.Organes de protection
Schutzeinrichtungen
+
+
+ Form
+
+
Configuration
@@ -2516,13 +2516,13 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.Suchen
-
+
Supprimer l'élément ?
message box title
Bauteil löschen?
-
+
Êtes-vous sûr de vouloir supprimer cet élément ?
message box content
@@ -2530,25 +2530,25 @@ Bemerkung: diese Optionen verhindern NICHT das automatische Nummerieren.
-
+
Suppression de l'élément
message box title
Bauteil wird gelöscht
-
+
La suppression de l'élément a échoué.
message box content
Das Löschen des Bauteils ist gescheitert.
-
+
Supprimer le dossier?
message box title
Ordner löschen?
-
+
Êtes-vous sûr de vouloir supprimer le dossier ?
Tout les éléments et les dossier contenus dans ce dossier seront supprimés.
message box content
@@ -2556,24 +2556,24 @@ Tout les éléments et les dossier contenus dans ce dossier seront supprimés.
Alle Bauteile und Unterordner von diesem Ordner werden ebenso gelöscht.
-
+
Suppression du dossier
message box title
Ordner wird gelöscht
-
+
La suppression du dossier a échoué.
message box content
Das Löschen vom Ordner ist gescheitert.
-
+
Le dossier %1 contient
Der Ordner %1 beinhaltet
-
+
%n élément(s), répartie(s)
%n Bauteil, verteilt
@@ -2581,7 +2581,7 @@ Alle Bauteile und Unterordner von diesem Ordner werden ebenso gelöscht.
-
+
dans %n dossier(s).
in %n Ordner.
@@ -2589,17 +2589,17 @@ Alle Bauteile und Unterordner von diesem Ordner werden ebenso gelöscht.
-
+
Chemin de la collection : %1
Pfad der Sammlung: %1
-
+
Chemin dans le système de fichiers : %1
Pfad im Dateisystem: %1
-
+
Propriété du dossier %1
Eigenschaften vom Ordner %1
@@ -2630,25 +2630,25 @@ Alle Bauteile und Unterordner von diesem Ordner werden ebenso gelöscht.Ziehen/Ablegen, um das Schriftfeld auf der Folie anzuwenden.
-
+
Double-cliquez pour réduire ou développer la collection de cartouches QElectroTech
Status tip
Doppelklick zum Öffnen oder Schließen der Sammlung "QElectroTech-Schriftfelder"
-
+
Ceci est la collection de cartouches fournie avec QElectroTech. Installée en tant que composant système, vous ne pouvez normalement pas la personnaliser.
"What's this" tip
Diese Sammlung von Schriftfeldern kommt standardmäßig mit QElectroTech. Sie ist fester Bestandteil vom System und kann nicht verändert werden.
-
+
Double-cliquez pour réduire ou développer votre collection personnelle de cartouches
Status tip
Doppelklick zum Öffnen oder Schließen Ihrer persönlichen Schriftfeld-Sammlung
-
+
Ceci est votre collection personnelle de cartouches -- utilisez-la pour créer, stocker et éditer vos propres cartouches.
"What's this" tip
Dies ist Ihre persönliche Schriftfeld-Sammlung. Benutzen Sie sie, um Ihre eigenen Schriftfelder zu erstellen, ablegen und bearbeiten.
@@ -3251,36 +3251,38 @@ Texte und Zahlen sind ebenso erlaubt.
Farben vom Betriebssystem verwenden
-
+
Chemin de la collection utilisateur
Pfad zur Benutzersammlung
-
+
Chemin des cartouches utilisateur
Pfad zu den Benutzer-Schriftfeldern
-
+
Chemin de la collection commune
Pfad zur QET Sammlung
-
+
+
Par defaut
Standard
-
+
+
Parcourir...
Auswählen...
-
+
(Recharger les collections d'éléments pour appliquer les changements)
(Bauteilsammlungen neu laden, um die Änderungen zu aktualisieren)
@@ -3317,19 +3319,19 @@ Texte und Zahlen sind ebenso erlaubt.
min
-
+
Mettre en valeur dans le panel les éléments fraîchement intégrés
Neu zum Projekt hinzugefügte Bauteile in der Sammlung hervorheben
-
+
Chaque élément embarque des informations sur ses auteurs, sa licence, ou tout autre renseignement que vous jugerez utile dans un champ libre.
Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments que vous créerez :
Jedes Bauteil enthält Informationen über den Autor, die Lizenz und weiteren nützlichen Hinweise in einem frei definierbaren Textfeld.
Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile definiert werden:
-
+
Appliqué au prochain lancement de QElectroTech
Wirksam nach einem Neustart von QElectroTech
@@ -3364,7 +3366,7 @@ Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile de
Pfad zur gemeinsamen Bauteilsammlung
-
+
Répertoire de la collection utilisateur
Pfad zur Benutzer-Bauteilsammlung
@@ -3374,32 +3376,32 @@ Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile de
Pfad zu den Benutzer-Schriftfeldern
-
+
Gestion des éléments
Bauteilverwaltung
-
+
Vous pouvez définir ici l'apparence par defaut des differents textes de QElectroTech
Einstellungen für die Standarddarstellung der verschiedenen Texte
-
+
Grille + Clavier
Raster & Tastatur
-
+
Grille : 1 - 30
Raster: 1 - 30
-
+
DiagramEditor xGrid
Schaltplaneditor, Schrittweite x
-
+
DiagramEditor yGrid
Schaltplaneditor, Schrittweite y
@@ -3419,98 +3421,103 @@ Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile de
Methode zur Skalierung bei hochauflösenden Bildschirmen (hdpi) (wirksam nach einem Neustart von QElectroTech):
-
+
+ Répertoire de la collection company
+ Pfad zur Firmen-Bauteilsammlung
+
+
+
Langues
Sprachen
-
+
Textes
Texte
-
+
Textes d'éléments
Bauteiltexte
-
-
-
+
+
+
Police :
Schriftart:
-
-
+
+
°
°
-
+
Longueur :
Länge:
-
-
+
+
Rotation :
Drehung:
-
+
Textes indépendants
Unabhängige Textfelder
-
+
Autres textes
Sonstige Texte
-
+
La Grille doite etre active pour pouvoir voir les modifications.
Änderungen sind nur sichtbar, wenn das Raster aktiviert ist.
-
+
Déplacement au clavier : 1 - 30
Bewegung mittels Tastatur: 1 - 30
-
+
DiagramEditor (touche : gauche / droite) xGrid
Schaltplaneditor (rechts/links Tasten), Schrittweite x
-
+
DiagramEditor (touche : haut / bas) yGrid
Schaltplaneditor (hoch/runter Tasten), Schrittweite y
-
+
Déplacement au clavier avec la touche ALT : 1 - 9
Bewegung mittels Tastatur und ALT Taste: 1 - 9
-
+
DiagramEditor (touche : gauche / droite ) xGrid
Schaltplaneditor (rechts/links Tasten), Schrittweite x
-
+
DiagramEditor (touche : haut / bas) yGrid
Schaltplaneditor (hoch/runter Tasten), Schrittweite y
-
+
Editor
-
+ Editor
-
+
Max. parts in Element Editor List
-
+ Max. Anzahl in der Element Editor Liste
@@ -3548,150 +3555,155 @@ Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile de
nicht runden
-
+
Général
configuration page title
Allgemein
-
+
Système
System
-
+
Arabe
Arabisch
-
+
Brézilien
Brasilianisch
-
+
Catalan
Katalanisch
-
+
Tchèque
Tschechisch
-
+
Allemand
Deutsch
-
+
Danois
Dänisch
-
+
Grec
Grieschisch
-
+
Anglais
Englisch
-
+
Espagnol
Spanisch
-
+
Français
Französisch
-
+
Croate
Kroatisch
-
+
Italien
Italienisch
-
+
Japonais
Japanisch
-
+
Polonais
Polnisch
-
+
Portugais
Portugesisch
-
+
Roumains
Rumänisch
-
+
Russe
Russisch
-
+
Slovène
Slowenisch
-
+
Pays-Bas
Niederländisch
-
+
Norvege
Norwegisch
-
+
Belgique-Flemish
Belgien-Flandern
-
+
Turc
Türkisch
-
+
Hongrois
Ungarisch
-
+
Mongol
Mongolisch
-
+
Ukrainien
Ukrainisch
-
+
Chinois
-
+ Chinesisch
-
+
+ Chemin de la collection company
+ Firmen-Sammlung
+
+
+
To high values might lead to crashes of the application.
-
+ Zu große Werte führen zum Absturz der Applikation
@@ -3746,11 +3758,6 @@ Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile de
GraphicsTablePropertiesEditor
-
-
- Form
-
-
Affichage
@@ -3817,6 +3824,11 @@ Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile de
Ajuster le tableau au folio
Tabelle an Foliengröße anpassen
+
+
+ Form
+
+
TextLabel
@@ -3929,7 +3941,7 @@ Hier unten kann der Standardwert dieses Textfeldes für Ihre eigenen Bauteile de
Appliquer la géometrie d'un tableau aux tableau liée à celui-ci
Geometrie einer Tabelle auf alle damit verknüpften Tabellen anwenden
-
+ Geometrie einer Tabelle auf alle damit verknüpften Tabellen anwenden
@@ -4534,12 +4546,12 @@ Veuillez utiliser l'éditeur avancé pour cela.
x:
-
+ x:
y:
-
+ y:
@@ -5189,7 +5201,7 @@ Folgende Variablen sind inkompatibel:
Form
-
+
@@ -5518,12 +5530,12 @@ Voulez-vous enregistrer les modifications ?
Revenir au debut du projet
-
+ Zurück zum Anfang des Projekts
Aller à la fin du projet
-
+ Zum Projektende springen
@@ -5554,211 +5566,211 @@ Voulez-vous enregistrer les modifications ?
QETApp
-
+
Chargement... Initialisation du cache des collections d'éléments
splash screen caption
Laden... Initialisiere die Bauteilsammlungen
-
+
Chargement... Éditeur de schéma
splash screen caption
Laden... Schaltplaneditor
-
+
Chargement... Ouverture des fichiers
splash screen caption
Laden... Öffne Dateien
-
+
LTR
Translate this string to RTL if you are translating to a Right-to-Left language, else translate to LTR
LTR
-
+
Cartouches QET
title of the title block templates collection provided by QElectroTech
QET-Schriftfelder
-
+
Cartouches utilisateur
title of the user's title block templates collection
Benutzer-Schriftfelder
-
+
Q
Single-letter example text - translate length, not meaning
Q
-
+
QET
Small example text - translate length, not meaning
QET
-
+
Schema
Normal example text - translate length, not meaning
Folie
-
+
Electrique
Normal example text - translate length, not meaning
Elektrik
-
+
QElectroTech
Long example text - translate length, not meaning
QElectroTech
-
+
Configurer QElectroTech
window title
QElectroTech Einstellungen
-
+
Chargement...
splash screen caption
Lade...
-
+
Chargement... icône du systray
splash screen caption
Lade... Symbole des Systemsbenachrichtigungsfelds
-
+
QElectroTech
systray menu title
QElectroTech
-
+
&Quitter
&Beenden
-
+
&Masquer
&Verstecken
-
+
&Restaurer
&Zeigen
-
+
&Masquer tous les éditeurs de schéma
&Verstecke alle Schaltplaneditoren
-
+
&Restaurer tous les éditeurs de schéma
&Zeige alle Schaltplaneditoren
-
+
&Masquer tous les éditeurs d'élément
&Verstecke alle Bauteileditoren
-
+
&Restaurer tous les éditeurs d'élément
&Zeige alle Bauteileditoren
-
+
&Masquer tous les éditeurs de cartouche
systray submenu entry
&Verstecke alle Schriftfeld-Editoren
-
+
&Restaurer tous les éditeurs de cartouche
systray submenu entry
&Zeige alle Schriftfeld-Editoren
-
+
&Nouvel éditeur de schéma
&Neuer Schaltplaneditor
-
+
&Nouvel éditeur d'élément
&Neuer Bauteileditor
-
+
Ferme l'application QElectroTech
Anwendung QElectroTech schließen
-
+
Réduire QElectroTech dans le systray
QElectroTech in Systembenachrichtigungsfeld minimieren
-
+
Restaurer QElectroTech
QElectroTech wiederherstellen
-
+
QElectroTech
systray icon tooltip
QElectroTech
-
+
Éditeurs de schémas
Schaltplaneditor
-
+
Éditeurs d'élément
Bauteileditor
-
+
Éditeurs de cartouche
systray menu entry
Schriftfeld-Editor
-
+
<b>Le fichier de restauration suivant a été trouvé,<br>Voulez-vous l'ouvrir ?</b><br>
<b>Die folgende Sicherungsdatei wurde gefunden,<br>Möchten Sie sie öffnen?</b><br>
-
+
<b>Les fichiers de restauration suivant on été trouvé,<br>Voulez-vous les ouvrir ?</b><br>
<b>Die folgenden Sicherungsdateien wurden gefunden,<br>Möchten Sie sie öffnen?</b><br>
-
+
Fichier de restauration
Sicherungsdatei
-
+
Usage :
Verwendung:
-
+
[options] [fichier]...
@@ -5767,7 +5779,7 @@ Voulez-vous enregistrer les modifications ?
-
+
QElectroTech, une application de réalisation de schémas électriques.
Options disponibles :
@@ -5784,28 +5796,28 @@ Verfügbare Optionen:
-
+
--common-elements-dir=DIR Definir le dossier de la collection d'elements
--common-elements-dir=DIR Setzt Pfad zur Bauteilsammlung
-
+
--common-tbt-dir=DIR Definir le dossier de la collection de modeles de cartouches
--common-tbt-dir=DIR Pfad zur Schriftfeld-Sammlung setzen
-
+
--config-dir=DIR Definir le dossier de configuration
--config-dir=DIR Setzt Pfad zur Konfiguration
-
+
--lang-dir=DIR Definir le dossier contenant les fichiers de langue
--lang-dir=DIR Setzt Pfad zu den Sprachdateien
@@ -6448,12 +6460,12 @@ Verfügbare Optionen:
SPACE
-
+
Ctrl+SPACE
-
+
@@ -7623,19 +7635,19 @@ les conditions requises ne sont pas valides
%1 [geändert]
-
+
Une erreur s'est produite durant l'intégration du modèle.
error message
Ein Fehler ist beim Einfügen der Vorlage aufgetreten.
-
+
Avertissement
message box title
Warnung
-
+
Ce document semble avoir été enregistré avec une version %1
qui est ultérieure à votre version !
Vous utilisez actuellement QElectroTech en version %2
@@ -7643,7 +7655,7 @@ Vous utilisez actuellement QElectroTech en version %2
Sie verwenden derzeit QElectroTech Version %2
-
+
.
Il est alors possible que l'ouverture de tout ou partie de ce document échoue.
Que désirez vous faire ?
@@ -7651,32 +7663,32 @@ Que désirez vous faire ?
Was möchten Sie tun?
-
+
Avertissement
message box title
Warnung
-
+
Le projet que vous tentez d'ouvrir est partiellement compatible avec votre version %1 de QElectroTech.
Das Projekt, das Sie zu öffnen versuchen, ist teilweise mit Ihrer Version %1 von QElectroTech kompatibel.
-
+
Afin de le rendre totalement compatible veuillez ouvrir ce même projet avec la version 0.8, ou 0.80 de QElectroTech et sauvegarder le projet et l'ouvrir à nouveau avec cette version.
Que désirez vous faire ?
Um es vollständig kompatibel zu machen, öffnen Sie bitte das gleiche Projekt mit der QElectroTech-Version 0.8 oder 0.80, speichern Sie das Projekt und öffnen Sie es erneut mit dieser Version.
Was möchten Sie tun?
-
+
<p align="center"><b>Ouverture du projet en cours...</b><br/>Création des folios</p>
<p align="center"><b>Öffnen des Projekts...</b><br/>Folien werden erstellt</p>
-
+
<p align="center"><b>Ouverture du projet en cours...</b><br/>Mise en place des références croisées</p>
<p align="center"><b>Öffnen des Projekts...</b><br/>Querverweise werden eingelesen</p>
@@ -8321,7 +8333,7 @@ Was möchten Sie tun?
%n tableau(s)
part of a sentence listing the content of diagram
-
+
@@ -8347,7 +8359,7 @@ Was möchten Sie tun?
-
+
Impossible d'ouvrir le fichier %1 en écriture, erreur %2 rencontrée.
error message when attempting to write an XML file
@@ -8360,62 +8372,62 @@ Was möchten Sie tun?
Ein Fehler ist beim Schreiben der Datei %1 aufgetreten. Fehler ist: %2.
-
+
Amener au premier plan
Im Vordergrund
-
+
Rapprocher
Eine Ebene vor
-
+
Éloigner
Eine Ebene zurück
-
+
Envoyer au fond
Im Hintergrund
-
+
Ramène la ou les sélections au premier plan
Verschiebt die Auswahl in den Vordergrund
-
+
Rapproche la ou les sélections
Verschiebt die Auswahl eine Ebene nach vorne
-
+
Éloigne la ou les sélections
Verschiebt die Auswahl eine Ebene nach hinten
-
+
Envoie en arrière plan la ou les sélections
Verschiebt die Auswahl in den Hintergrund
-
+
Ctrl+Shift+Up
Strg+Umschalt+oben
-
+
Ctrl+Shift+Down
Strg+Umschalt+unten
-
+
Ctrl+Shift+End
Strg+Umschalt+Ende
-
+
Ctrl+Shift+Home
Strg+Umschalt+Pos1
@@ -8747,11 +8759,16 @@ Was möchten Sie tun?
+ Collection Company
+ Firmen-Sammlung
+
+
+
Collection utilisateur
Benutzersammlung
-
+
Collection inconnue
Unbekannte Sammlung
@@ -9142,16 +9159,16 @@ Möchten Sie sie ersetzen?
Einfügen
+
-
+
+
+
-
-
-
this is an error in the code
dies ist ein Programmfehler
@@ -9275,49 +9292,51 @@ Möchten Sie sie ersetzen?
Klemme %1 sortieren
-
+
+
Générique
generic terminal element type
Generisch
-
+
Fusible
fuse terminal element type
Sicherungsklemme
-
+
Sectionable
sectional terminal element type
Trennklemme
-
+
Diode
diode terminal element type
Diode
-
+
Terre
ground terminal element type
Erde
-
+
+
Générique
generic terminal element function
Generisch
-
+
Phase
phase terminal element function
Aussenleiter
-
+
Neutre
neutral terminal element function
Neutralleiter
@@ -9403,12 +9422,12 @@ Bitte fügen Sie eine neue Tabelle hinzu oder passen Sie die vorhandene Tabelle
QetShapeItem
-
+
une shape
ein Shape
-
+
une ligne
einer Linie
@@ -9438,17 +9457,17 @@ Bitte fügen Sie eine neue Tabelle hinzu oder passen Sie die vorhandene Tabelle
%1 ändern
-
+
un rectangle
eines Rechtecks
-
+
une éllipse
einer Ellipse
-
+
une polyligne
eine Polylinie
@@ -9713,7 +9732,7 @@ Bitte fügen Sie eine neue Tabelle hinzu oder passen Sie die vorhandene Tabelle
PushButton
-
+
@@ -12410,7 +12429,7 @@ Andere Felder werden nicht verwendet.
Gray : Black
element part filling
-
+ Grau: Schwarz
@@ -13217,7 +13236,7 @@ Andere Felder werden nicht verwendet.
-
+
Créer un Folio Numérotation Auto
Neue auto-nummerierte Folie anlegen
@@ -13864,7 +13883,7 @@ Maximale Länge: %2px
Form
-
+
diff --git a/qelectrotech.qrc b/qelectrotech.qrc
index e7095b1fe..00c5c219a 100644
--- a/qelectrotech.qrc
+++ b/qelectrotech.qrc
@@ -51,6 +51,7 @@
ico/16x16/endline-triangle.png
ico/16x16/folder-new.png
ico/16x16/folder.png
+ ico/16x16/go-company.png
ico/16x16/go-down.png
ico/16x16/go-home.png
ico/16x16/go-up.png
@@ -131,6 +132,7 @@
ico/22x22/folder-delete.png
ico/22x22/folder-edit.png
ico/22x22/folder-new.png
+ ico/22x22/go-company.png
ico/22x22/go-down.png
ico/22x22/go-home.png
ico/22x22/go-up.png
diff --git a/sources/ElementsCollection/elementscollectionmodel.cpp b/sources/ElementsCollection/elementscollectionmodel.cpp
index 14c37c9fc..e3e6c8841 100644
--- a/sources/ElementsCollection/elementscollectionmodel.cpp
+++ b/sources/ElementsCollection/elementscollectionmodel.cpp
@@ -258,6 +258,7 @@ bool ElementsCollectionModel::dropMimeData(const QMimeData *data,
@param projects : list of projects to load
*/
void ElementsCollectionModel::loadCollections(bool common_collection,
+ bool company_collection,
bool custom_collection,
QList projects)
{
@@ -265,10 +266,12 @@ void ElementsCollectionModel::loadCollections(bool common_collection,
if (common_collection)
addCommonCollection(false);
+ if (company_collection)
+ addCompanyCollection(false);
if (custom_collection)
addCustomCollection(false);
- if (common_collection || custom_collection)
+ if (common_collection || company_collection || custom_collection)
m_items_list_to_setUp.append(items());
@@ -321,22 +324,41 @@ void ElementsCollectionModel::addCommonCollection(bool set_data)
}
/**
- @brief ElementsCollectionModel::addCustomCollection
- Add the custom elements collection to this model
- @param set_data
+ @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
+ Add the custom elements collection to this model
+ @param set_data
*/
void ElementsCollectionModel::addCustomCollection(bool set_data)
{
- FileElementCollectionItem *feci = new FileElementCollectionItem();
- if (feci->setRootPath(QETApp::customElementsDirN(),
- set_data,
- m_hide_element)) {
- invisibleRootItem()->appendRow(feci);
- if (set_data)
- feci->setUpData();
- }
- else
- delete feci;
+ FileElementCollectionItem *feci = new FileElementCollectionItem();
+ if (feci->setRootPath(QETApp::customElementsDirN(),
+ set_data,
+ m_hide_element)) {
+ invisibleRootItem()->appendRow(feci);
+ if (set_data)
+ feci->setUpData();
+ }
+ else
+ delete feci;
}
/**
@@ -557,8 +579,9 @@ QModelIndex ElementsCollectionModel::indexFromLocation(
{
QList child_list;
- for (int i=0 ; i(item(i)));
+ }
foreach(ElementCollectionItem *eci, child_list) {
@@ -567,7 +590,8 @@ QModelIndex ElementsCollectionModel::indexFromLocation(
if (eci->type() == FileElementCollectionItem::Type) {
if (FileElementCollectionItem *feci = static_cast(eci)) {
if ( (location.isCommonCollection() && feci->isCommonCollection()) ||
- (location.isCustomCollection() && !feci->isCommonCollection()) ) {
+ (location.isCompanyCollection() && feci->isCompanyCollection()) ||
+ (location.isCustomCollection() && !feci->isCommonCollection()) ) {
match_eci = feci->itemAtPath(location.collectionPath(false));
}
}
diff --git a/sources/ElementsCollection/elementscollectionmodel.h b/sources/ElementsCollection/elementscollectionmodel.h
index 9a3971c23..a435dc8c9 100644
--- a/sources/ElementsCollection/elementscollectionmodel.h
+++ b/sources/ElementsCollection/elementscollectionmodel.h
@@ -42,10 +42,11 @@ class ElementsCollectionModel : public QStandardItemModel
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;
- void loadCollections(bool common_collection, bool custom_collection, QList projects);
+ void loadCollections(bool common_collection, bool company_collection, bool custom_collection, QList projects);
- void addCommonCollection(bool set_data = true);
- void addCustomCollection(bool set_data = true);
+ void addCommonCollection(bool set_data = true);
+ void addCompanyCollection(bool set_data = true);
+ void addCustomCollection(bool set_data = true);
void addLocation(const ElementsLocation& location);
void addProject(QETProject *project, bool set_data = true);
diff --git a/sources/ElementsCollection/elementscollectionwidget.cpp b/sources/ElementsCollection/elementscollectionwidget.cpp
index 7ea332cce..ebee5ab25 100644
--- a/sources/ElementsCollection/elementscollectionwidget.cpp
+++ b/sources/ElementsCollection/elementscollectionwidget.cpp
@@ -96,7 +96,7 @@ void ElementsCollectionWidget::addProject(QETProject *project)
m_progress_bar->show();
m_tree_view->setDisabled(true);
QList prj; prj.append(project);
- m_model->loadCollections(false,false, prj);
+ m_model->loadCollections(false, false, false, prj);
}
else {
m_waiting_project.append(project);
@@ -387,7 +387,8 @@ void ElementsCollectionWidget::deleteElement()
if (! (loc.isElement()
&& loc.exist()
&& loc.isFileSystem()
- && loc.collectionPath().startsWith("custom://")) ) return;
+ && (loc.collectionPath().startsWith("company://")
+ || loc.collectionPath().startsWith("custom://"))) ) return;
if (QET::QetMessageBox::question(
this,
@@ -430,7 +431,8 @@ void ElementsCollectionWidget::deleteDirectory()
if (! (loc.isDirectory()
&& loc.exist()
&& loc.isFileSystem()
- && loc.collectionPath().startsWith("custom://")) ) return;
+ && (loc.collectionPath().startsWith("company://")
+ || loc.collectionPath().startsWith("custom://"))) ) return;
if (QET::QetMessageBox::question(
this,
@@ -655,7 +657,7 @@ void ElementsCollectionWidget::reload()
this,
&ElementsCollectionWidget::loadingFinished);
- m_new_model->loadCollections(true, true, project_list);
+ m_new_model->loadCollections(true, true, true, project_list);
}
/**
diff --git a/sources/ElementsCollection/elementslocation.cpp b/sources/ElementsCollection/elementslocation.cpp
index f1e666384..617d902c7 100644
--- a/sources/ElementsCollection/elementslocation.cpp
+++ b/sources/ElementsCollection/elementslocation.cpp
@@ -168,7 +168,7 @@ QString ElementsLocation::baseName() const
@brief ElementsLocation::collectionPath
Return the path of the represented element relative to collection
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,
only the collection path is returned without the collection type.
@param protocol
@@ -181,7 +181,7 @@ QString ElementsLocation::collectionPath(bool protocol) const
else
{
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
Set the path of this item.
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
*/
void ElementsLocation::setPath(const QString &path)
@@ -290,15 +290,20 @@ void ElementsLocation::setPath(const QString &path)
// The path is in file system,
// 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;
- if (path.startsWith("common://"))
- {
- tmp_path.remove("common://");
- p = QETApp::commonElementsDirN() + "/" + tmp_path;
- }
- else
+ if (path.startsWith("common://"))
+ {
+ tmp_path.remove("common://");
+ p = QETApp::commonElementsDirN() + "/" + tmp_path;
+ }
+ else if (path.startsWith("company://"))
+ {
+ tmp_path.remove("company://");
+ p = QETApp::companyElementsDirN() + "/" + tmp_path;
+ }
+ else
{
tmp_path.remove("custom://");
p = QETApp::customElementsDirN() + "/" + tmp_path;
@@ -314,13 +319,19 @@ void ElementsLocation::setPath(const QString &path)
if(path_.endsWith(".elmt"))
{
m_file_system_path = path_;
- if (path_.startsWith(QETApp::commonElementsDirN()))
- {
- path_.remove(QETApp::commonElementsDirN()+="/");
- path_.prepend("common://");
- m_collection_path = path_;
- }
- else if (path_.startsWith(QETApp::customElementsDirN()))
+ if (path_.startsWith(QETApp::commonElementsDirN()))
+ {
+ path_.remove(QETApp::commonElementsDirN()+="/");
+ path_.prepend("common://");
+ 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()))
{
path_.remove(QETApp::customElementsDirN()+="/");
path_.prepend("custom://");
@@ -330,13 +341,19 @@ void ElementsLocation::setPath(const QString &path)
else
{
m_file_system_path = path_;
- if (path_.startsWith(QETApp::commonElementsDirN()))
- {
- path_.remove(QETApp::commonElementsDirN()+="/");
- path_.prepend("common://");
- m_collection_path = path_;
- }
- else if (path_.startsWith(QETApp::customElementsDirN()))
+ if (path_.startsWith(QETApp::commonElementsDirN()))
+ {
+ path_.remove(QETApp::commonElementsDirN()+="/");
+ path_.prepend("common://");
+ 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()))
{
path_.remove(QETApp::customElementsDirN()+="/");
path_.prepend("custom://");
@@ -484,13 +501,23 @@ bool ElementsLocation::isFileSystem() const
}
/**
- @brief ElementsLocation::isCommonCollection
- @return
- True if this location represent an item from the common collection
+ @brief ElementsLocation::isCommonCollection
+ @return
+ True if this location represent an item from the common collection
*/
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());
}
/**
diff --git a/sources/ElementsCollection/elementslocation.h b/sources/ElementsCollection/elementslocation.h
index b5223914d..501b32764 100644
--- a/sources/ElementsCollection/elementslocation.h
+++ b/sources/ElementsCollection/elementslocation.h
@@ -75,8 +75,9 @@ class ElementsLocation
bool isElement() const;
bool isDirectory() const;
bool isFileSystem() const;
- bool isCommonCollection() const;
- bool isCustomCollection() const;
+ bool isCommonCollection() const;
+ bool isCompanyCollection() const;
+ bool isCustomCollection() const;
bool isProject() const;
bool exist() const;
bool isWritable() const;
diff --git a/sources/ElementsCollection/fileelementcollectionitem.cpp b/sources/ElementsCollection/fileelementcollectionitem.cpp
index d3354435f..75f77aaf9 100644
--- a/sources/ElementsCollection/fileelementcollectionitem.cpp
+++ b/sources/ElementsCollection/fileelementcollectionitem.cpp
@@ -120,9 +120,11 @@ QString FileElementCollectionItem::localName()
else if (isDir()) {
if (isCollectionRoot()) {
- if (m_path == QETApp::commonElementsDirN())
- setText(QObject::tr("Collection QET"));
- else if (m_path == QETApp::customElementsDirN())
+ if (m_path == QETApp::commonElementsDirN())
+ setText(QObject::tr("Collection QET"));
+ else if (m_path == QETApp::companyElementsDirN())
+ setText(QObject::tr("Collection Company"));
+ else if (m_path == QETApp::customElementsDirN())
setText(QObject::tr("Collection utilisateur"));
else
setText(QObject::tr("Collection inconnue"));
@@ -194,6 +196,8 @@ QString FileElementCollectionItem::collectionPath() const
if (isCollectionRoot()) {
if (m_path == QETApp::commonElementsDirN())
return "common://";
+ else if (m_path == QETApp::companyElementsDirN())
+ return "company://";
else
return "custom://";
}
@@ -217,19 +221,29 @@ QString FileElementCollectionItem::collectionPath() const
bool FileElementCollectionItem::isCollectionRoot() const
{
if (m_path == QETApp::commonElementsDirN()
- || m_path == QETApp::customElementsDirN())
- return true;
+ || m_path == QETApp::companyElementsDirN()
+ || m_path == QETApp::customElementsDirN())
+ return true;
else
return false;
}
/**
- @brief FileElementCollectionItem::isCommonCollection
- @return True if this item represent the common collection
+ @brief FileElementCollectionItem::isCommonCollection
+ @return True if this item represent the common collection
*/
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());
}
/**
@@ -306,6 +320,8 @@ void FileElementCollectionItem::setUpIcon()
if (isCollectionRoot()) {
if (m_path == QETApp::commonElementsDirN())
setIcon(QIcon(":/ico/16x16/qet.png"));
+ else if (m_path == QETApp::companyElementsDirN())
+ setIcon(QIcon(":/ico/16x16/go-company.png"));
else
setIcon(QIcon(":/ico/16x16/go-home.png"));
}
diff --git a/sources/ElementsCollection/fileelementcollectionitem.h b/sources/ElementsCollection/fileelementcollectionitem.h
index 1e4cf87bf..230cf95d3 100644
--- a/sources/ElementsCollection/fileelementcollectionitem.h
+++ b/sources/ElementsCollection/fileelementcollectionitem.h
@@ -47,8 +47,9 @@ class FileElementCollectionItem : public ElementCollectionItem
QString name() const override;
QString collectionPath() const override;
bool isCollectionRoot() const override;
- bool isCommonCollection() const;
- bool isCustomCollection() const;
+ bool isCommonCollection() const;
+ bool isCompanyCollection() const;
+ bool isCustomCollection() const;
void addChildAtPath(const QString &collection_name) override;
void setUpData() override;
diff --git a/sources/editor/graphicspart/customelementgraphicpart.cpp b/sources/editor/graphicspart/customelementgraphicpart.cpp
index 50bb4a9c5..abfa6317e 100644
--- a/sources/editor/graphicspart/customelementgraphicpart.cpp
+++ b/sources/editor/graphicspart/customelementgraphicpart.cpp
@@ -217,7 +217,8 @@ void CustomElementGraphicPart::stylesToXml(QDomElement &qde) const
{HTMLYellowYellowFilling, "HTMLYellowYellow"},
{HTMLYellowLightYellowFilling, "HTMLYellowLightYellow"},
{HTMLYellowLemonChiffonFilling, "HTMLYellowLemonChiffon"},
- {HTMLYellowLightGoldenrodYellowFilling, "HTMLYellowLightGoldenrodYellow"},
+ {HTMLYellowLightGoldenrodYellowFilling,
+ "HTMLYellowLightGoldenrodYellow"},
{HTMLYellowPapayaWhipFilling, "HTMLYellowPapayaWhip"},
{HTMLYellowMoccasinFilling, "HTMLYellowMoccasin"},
{HTMLYellowPeachPuffFilling, "HTMLYellowPeachPuff"},
@@ -594,7 +595,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
{"HTMLYellowYellow", HTMLYellowYellowFilling},
{"HTMLYellowLightYellow", HTMLYellowLightYellowFilling},
{"HTMLYellowLemonChiffon", HTMLYellowLemonChiffonFilling},
- {"HTMLYellowLightGoldenrodYellow", HTMLYellowLightGoldenrodYellowFilling},
+ {"HTMLYellowLightGoldenrodYellow",
+ HTMLYellowLightGoldenrodYellowFilling},
{"HTMLYellowPapayaWhip", HTMLYellowPapayaWhipFilling},
{"HTMLYellowMoccasin", HTMLYellowMoccasinFilling},
{"HTMLYellowPeachPuff", HTMLYellowPeachPuffFilling},
@@ -629,7 +631,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
{"HTMLGreenChartreuse", HTMLGreenChartreuseFilling},
{"HTMLGreenGreenYellow", HTMLGreenGreenYellowFilling},
{"HTMLGreenSpringGreen", HTMLGreenSpringGreenFilling},
- {"HTMLGreenMediumSpringGreen", HTMLGreenMediumSpringGreenFilling},
+ {"HTMLGreenMediumSpringGreen",
+ HTMLGreenMediumSpringGreenFilling},
{"HTMLGreenLightGreen", HTMLGreenLightGreenFilling},
{"HTMLGreenPaleGreen", HTMLGreenPaleGreenFilling},
{"HTMLGreenDarkSeaGreen", HTMLGreenDarkSeaGreenFilling},
@@ -759,7 +762,8 @@ void CustomElementGraphicPart::stylesFromXml(const QDomElement &qde)
{"HTMLYellowYellow", HTMLYellowYellowColor},
{"HTMLYellowLightYellow", HTMLYellowLightYellowColor},
{"HTMLYellowLemonChiffon", HTMLYellowLemonChiffonColor},
- {"HTMLYellowLightGoldenrodYellow", HTMLYellowLightGoldenrodYellowColor},
+ {"HTMLYellowLightGoldenrodYellow",
+ HTMLYellowLightGoldenrodYellowColor},
{"HTMLYellowPapayaWhip", HTMLYellowPapayaWhipColor},
{"HTMLYellowMoccasin", HTMLYellowMoccasinColor},
{"HTMLYellowPeachPuff", HTMLYellowPeachPuffColor},
diff --git a/sources/editor/graphicspart/partterminal.cpp b/sources/editor/graphicspart/partterminal.cpp
index dc1a68101..c46c2dc96 100644
--- a/sources/editor/graphicspart/partterminal.cpp
+++ b/sources/editor/graphicspart/partterminal.cpp
@@ -176,6 +176,7 @@ qreal PartTerminal::rotation() const {
case Qet::South : return 180;
case Qet::West : return 270;
}
+ return 0;
}
/**
diff --git a/sources/elementdialog.cpp b/sources/elementdialog.cpp
index 1c95c7175..fbbde70d8 100644
--- a/sources/elementdialog.cpp
+++ b/sources/elementdialog.cpp
@@ -93,9 +93,9 @@ void ElementDialog::setUpWidget()
prjs.append(prj);
if (m_mode == OpenElement)
- m_model->loadCollections(true, true, prjs);
+ m_model->loadCollections(true, true, true, prjs);
else
- m_model->loadCollections(false, true, prjs);
+ m_model->loadCollections(false, true, true, prjs);
m_tree_view->setModel(m_model);
m_tree_view->setHeaderHidden(true);
diff --git a/sources/elementspanel.cpp b/sources/elementspanel.cpp
index 40d361d83..064dc76e9 100644
--- a/sources/elementspanel.cpp
+++ b/sources/elementspanel.cpp
@@ -221,8 +221,9 @@ bool ElementsPanel::matchesFilter(const QTreeWidgetItem *item,
void ElementsPanel::reload()
{
QIcon system_icon(":/ico/16x16/qet.png");
+ QIcon company_icon(":/ico/16x16/go-company.png");
QIcon user_icon(":/ico/16x16/go-home.png");
-
+
// load the common title block templates collection
TitleBlockTemplatesCollection *common_tbt_collection = QETApp::commonTitleBlockTemplatesCollection();
common_tbt_collection_item_ = addTemplatesCollection(common_tbt_collection, invisibleRootItem());
diff --git a/sources/elementspanel.h b/sources/elementspanel.h
index cee15905d..e5be94d79 100644
--- a/sources/elementspanel.h
+++ b/sources/elementspanel.h
@@ -81,6 +81,7 @@ class ElementsPanel : public GenericPanel {
private:
QSet 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 *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
bool first_reload_; ///< used to distinguish the first time this panel is reloaded
QString filter_; ///< Currently applied filter
diff --git a/sources/properties/elementdata.cpp b/sources/properties/elementdata.cpp
index 309e98593..6209fb85d 100644
--- a/sources/properties/elementdata.cpp
+++ b/sources/properties/elementdata.cpp
@@ -362,6 +362,7 @@ QString ElementData::masterTypeToString(ElementData::MasterType type)
case ElementData::Commutator:
return QStringLiteral("commutator");
}
+ return QStringLiteral("coil");
}
ElementData::MasterType ElementData::masterTypeFromString(const QString &string)
@@ -394,6 +395,7 @@ QString ElementData::slaveTypeToString(ElementData::SlaveType type)
case ElementData::delayOnOff:
return QStringLiteral("delayOnOff");
}
+ return QStringLiteral("simple");
}
ElementData::SlaveType ElementData::slaveTypeFromString(const QString &string)
@@ -428,6 +430,7 @@ QString ElementData::slaveStateToString(ElementData::SlaveState type)
case Other:
return QStringLiteral("Other");
}
+ return QStringLiteral("Other");
}
ElementData::SlaveState ElementData::slaveStateFromString(const QString &string)
@@ -462,6 +465,7 @@ QString ElementData::terminalTypeToString(ElementData::TerminalType type)
case ElementData::TTGround:
return QStringLiteral("ground");
}
+ return QStringLiteral("generic");
}
ElementData::TerminalType ElementData::terminalTypeFromString(const QString &string)
@@ -498,6 +502,7 @@ QString ElementData::translatedTerminalType(ElementData::TerminalType type)
case ElementData::TTGround:
return QObject::tr("Terre", "ground terminal element type");
}
+ return QObject::tr("Générique", "generic terminal element type");
}
QString ElementData::terminalFunctionToString(ElementData::TerminalFunction function)
@@ -510,6 +515,7 @@ QString ElementData::terminalFunctionToString(ElementData::TerminalFunction func
case ElementData::TFNeutral:
return QStringLiteral("neutral");
}
+ return QStringLiteral("generic");
}
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 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)
diff --git a/sources/properties/terminaldata.cpp b/sources/properties/terminaldata.cpp
index 6eb471945..c073400c3 100644
--- a/sources/properties/terminaldata.cpp
+++ b/sources/properties/terminaldata.cpp
@@ -172,6 +172,7 @@ QString TerminalData::typeToString(TerminalData::Type type)
case Outer :
return QString("Outer");
}
+ return QString("Generic");
}
/**
diff --git a/sources/qet.cpp b/sources/qet.cpp
index bfa47c503..1bf0ceabd 100644
--- a/sources/qet.cpp
+++ b/sources/qet.cpp
@@ -687,6 +687,8 @@ QString QET::qetCollectionToString(const QET::QetCollection &c)
{
case Common :
return "common";
+ case Company :
+ return "company";
case Custom :
return "custom";
case Embedded :
@@ -706,6 +708,8 @@ QET::QetCollection QET::qetCollectionFromString(const QString &str)
{
if (str == "common")
return QetCollection::Common;
+ else if (str == "company")
+ return QetCollection::Company;
else if (str == "custom")
return QetCollection::Custom;
else if (str == "embedded")
diff --git a/sources/qet.h b/sources/qet.h
index 5a5a2d9e6..5764a2cb3 100644
--- a/sources/qet.h
+++ b/sources/qet.h
@@ -147,6 +147,7 @@ namespace QET {
///Enum used to specify the origin of a collection of thing (title block, element etc...)
enum QetCollection {
Common, ///< From common collection
+ Company, ///< From company collection
Custom, ///< From user collection
Embedded ///< From an embedded collection (a project for example)
};
diff --git a/sources/qetapp.cpp b/sources/qetapp.cpp
index bb64c1ca5..cb27ddcac 100644
--- a/sources/qetapp.cpp
+++ b/sources/qetapp.cpp
@@ -75,6 +75,9 @@ TitleBlockTemplate *QETApp::default_titleblock_template_ = nullptr;
QString QETApp::m_common_element_dir = QString();
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();
bool QETApp::m_custom_element_dir_is_set = false;
@@ -556,52 +559,101 @@ QString QETApp::commonElementsDir()
}
/**
- @brief QETApp::customElementsDir
- @return the dir path of user elements collection appended with a
- "/" separator
+ @brief QETApp::customElementsDir
+ @return the dir path of user elements collection appended with a
+ "/" separator
*/
QString QETApp::customElementsDir()
{
- if (m_custom_element_dir_is_set)
- {
- return m_custom_element_dir;
- }
- else
- {
- m_custom_element_dir_is_set = true;
+ if (m_custom_element_dir_is_set)
+ {
+ return m_custom_element_dir;
+ }
+ else
+ {
+ m_custom_element_dir_is_set = true;
- QSettings settings;
- QString path = settings.value(
- "elements-collections/custom-collection-path",
- "default").toString();
- if (path != "default" && !path.isEmpty())
- {
- QDir dir(path);
- if (dir.exists())
- {
- m_custom_element_dir = path;
- if(!m_custom_element_dir.endsWith("/")) {
- m_custom_element_dir.append("/");
- }
- return m_custom_element_dir;
- }
- }
+ QSettings settings;
+ QString path = settings.value(
+ "elements-collections/custom-collection-path",
+ "default").toString();
+ if (path != "default" && !path.isEmpty())
+ {
+ QDir dir(path);
+ if (dir.exists())
+ {
+ m_custom_element_dir = path;
+ if(!m_custom_element_dir.endsWith("/")) {
+ m_custom_element_dir.append("/");
+ }
+ return m_custom_element_dir;
+ }
+ }
- m_custom_element_dir = configDir() + "elements/";
- return m_custom_element_dir;
- }
+ m_custom_element_dir = configDir() + "elements/";
+ return m_custom_element_dir;
+ }
}
/**
- @brief QETApp::commonElementsDirN
- like QString QETApp::commonElementsDir but without "/" at the end
- @return QString path
+ @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
+ like QString QETApp::commonElementsDir but without "/" at the end
+ @return QString path
*/
QString QETApp::commonElementsDirN()
{
- QString path = commonElementsDir();
- if (path.endsWith("/")) path.remove(path.length()-1, 1);
- return path;
+ QString path = commonElementsDir();
+ if (path.endsWith("/")) path.remove(path.length()-1, 1);
+ 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;
}
/**
@@ -758,9 +810,13 @@ QString QETApp::realPath(const QString &sym_path) {
QString directory;
if (sym_path.startsWith("common://")) {
directory = commonElementsDir();
- } else if (sym_path.startsWith("custom://")) {
- directory = customElementsDir();
- } else if (sym_path.startsWith(QETAPP_COMMON_TBT_PROTOCOL "://")) {
+ } else if (sym_path.startsWith("company://")) {
+ directory = companyElementsDir();
+ } else if (sym_path.startsWith("company://")) {
+ directory = companyElementsDir();
+ } else if (sym_path.startsWith("custom://")) {
+ directory = customElementsDir();
+ } else if (sym_path.startsWith(QETAPP_COMMON_TBT_PROTOCOL "://")) {
directory = commonTitleBlockTemplatesDir();
} else if (sym_path.startsWith(QETAPP_CUSTOM_TBT_PROTOCOL "://")) {
directory = customTitleBlockTemplatesDir();
@@ -790,6 +846,7 @@ QString QETApp::symbolicPath(const QString &real_path) {
// get the common and custom folders
// recupere les dossier common et custom
QString commond = commonElementsDir();
+ QString companyd = companyElementsDir();
QString customd = customElementsDir();
QString chemin;
// analyzes the file path passed in parameter
@@ -798,6 +855,10 @@ QString QETApp::symbolicPath(const QString &real_path) {
chemin = "common://"
+ real_path.right(
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)) {
chemin = "custom://"
+ real_path.right(
@@ -1913,11 +1974,15 @@ void QETApp::initConfiguration()
QDir config_dir(QETApp::configDir());
if (!config_dir.exists()) config_dir.mkpath(QETApp::configDir());
- QDir custom_elements_dir(QETApp::customElementsDir());
- if (!custom_elements_dir.exists())
- custom_elements_dir.mkpath(QETApp::customElementsDir());
+ QDir custom_elements_dir(QETApp::customElementsDir());
+ if (!custom_elements_dir.exists())
+ custom_elements_dir.mkpath(QETApp::customElementsDir());
- QDir custom_tbt_dir(QETApp::customTitleBlockTemplatesDir());
+ QDir company_elements_dir(QETApp::companyElementsDir());
+ if (!company_elements_dir.exists())
+ company_elements_dir.mkpath(QETApp::companyElementsDir());
+
+ QDir custom_tbt_dir(QETApp::customTitleBlockTemplatesDir());
if (!custom_tbt_dir.exists())
custom_tbt_dir.mkpath(QETApp::customTitleBlockTemplatesDir());
diff --git a/sources/qetapp.h b/sources/qetapp.h
index 042dc8204..5e3c59032 100644
--- a/sources/qetapp.h
+++ b/sources/qetapp.h
@@ -79,10 +79,12 @@ class QETApp : public QObject
static QList availableTitleBlockTemplatesCollections();
static TitleBlockTemplatesCollection *titleBlockTemplatesCollection(const QString &);
- static QString commonElementsDir();
- static QString customElementsDir();
+ static QString commonElementsDir();
+ static QString companyElementsDir();
+ static QString customElementsDir();
static QString commonElementsDirN();
- static QString customElementsDirN();
+ static QString companyElementsDirN();
+ static QString customElementsDirN();
static void resetCollectionsPath();
static QString commonTitleBlockTemplatesDir();
static QString customTitleBlockTemplatesDir();
@@ -213,6 +215,9 @@ class QETApp : public QObject
static QString m_common_element_dir;
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 bool m_custom_element_dir_is_set;
diff --git a/sources/qetgraphicsitem/qetshapeitem.cpp b/sources/qetgraphicsitem/qetshapeitem.cpp
index ff563d262..11ca96b66 100644
--- a/sources/qetgraphicsitem/qetshapeitem.cpp
+++ b/sources/qetgraphicsitem/qetshapeitem.cpp
@@ -970,10 +970,12 @@ bool QetShapeItem::toDXF(const QString &filepath,const QPen &pen)
Createdxf::dxfColor(pen));
return true;
case Polygon:
- if(m_polygon.isClosed())
+ if(m_polygon.isClosed()) {
Createdxf::drawPolygon(filepath,m_polygon,Createdxf::dxfColor(pen));
- else
+ }
+ else {
Createdxf::drawPolyline(filepath,m_polygon,Createdxf::dxfColor(pen));
+ }
return true;
default:
return false;
diff --git a/sources/qeticons.cpp b/sources/qeticons.cpp
index bb297486c..5a6091074 100644
--- a/sources/qeticons.cpp
+++ b/sources/qeticons.cpp
@@ -32,6 +32,7 @@ namespace QET {
QIcon Autoconnect;
QIcon BringForward;
QIcon Cancel;
+ QIcon Company;
QIcon Conductor;
QIcon ConductorEdit;
QIcon ConductorSettings;
@@ -395,6 +396,8 @@ void QET::Icons::initIcons()
Autoconnect .addFile(":/ico/22x22/autoconnect.png");
BringForward .addFile(":/ico/22x22/bring_forward.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");
ConductorEdit .addFile(":/ico/16x16/conductor-edit.png");
ConductorSettings .addFile(":/ico/16x16/conductor-reset.png");
diff --git a/sources/qeticons.h b/sources/qeticons.h
index 3363e1abf..066742814 100644
--- a/sources/qeticons.h
+++ b/sources/qeticons.h
@@ -39,6 +39,7 @@ namespace QET {
extern QIcon Autoconnect;
extern QIcon BringForward;
extern QIcon Cancel;
+ extern QIcon Company;
extern QIcon Conductor;
extern QIcon ConductorEdit;
extern QIcon ConductorSettings;
diff --git a/sources/qetproject.cpp b/sources/qetproject.cpp
index 1b1ca6e51..cbd7ffa72 100644
--- a/sources/qetproject.cpp
+++ b/sources/qetproject.cpp
@@ -509,7 +509,10 @@ void QETProject::setDefaultTitleBlockProperties(const TitleBlockProperties &titl
case QET::Common :
collection = QETApp::commonTitleBlockTemplatesCollection();
break;
- case QET::Custom :
+ case QET::Company :
+ // collection = QETApp::companyTitleBlockTemplatesCollection();
+ break;
+ case QET::Custom :
collection = QETApp::customTitleBlockTemplatesCollection();
break;
case QET::Embedded :
diff --git a/sources/ui/configpage/generalconfigurationpage.cpp b/sources/ui/configpage/generalconfigurationpage.cpp
index 30d0adf6d..a32d0f590 100644
--- a/sources/ui/configpage/generalconfigurationpage.cpp
+++ b/sources/ui/configpage/generalconfigurationpage.cpp
@@ -138,6 +138,15 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) :
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();
if (path != "default")
{
@@ -241,6 +250,21 @@ void GeneralConfigurationPage::applyConf()
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();
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)
{
if (index == 1)
diff --git a/sources/ui/configpage/generalconfigurationpage.h b/sources/ui/configpage/generalconfigurationpage.h
index 0fb6b4737..61fd8c6f6 100644
--- a/sources/ui/configpage/generalconfigurationpage.h
+++ b/sources/ui/configpage/generalconfigurationpage.h
@@ -42,6 +42,7 @@ class GeneralConfigurationPage : public ConfigPage
void on_m_font_pb_clicked();
void on_m_dyn_text_font_pb_clicked();
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_tbt_path_cb_currentIndexChanged(int index);
void on_m_indi_text_font_pb_clicked();
diff --git a/sources/ui/configpage/generalconfigurationpage.ui b/sources/ui/configpage/generalconfigurationpage.ui
index 3645f6aa6..c6b08ba08 100644
--- a/sources/ui/configpage/generalconfigurationpage.ui
+++ b/sources/ui/configpage/generalconfigurationpage.ui
@@ -6,7 +6,7 @@
0
0
- 822
+ 872
411
@@ -17,7 +17,7 @@
-
- 0
+ 2
@@ -243,13 +243,34 @@
-
+
+
+ Répertoire de la collection company
+
+
+
+ -
+
+
-
+
+ Par defaut
+
+
+ -
+
+ Parcourir...
+
+
+
+
+ -
Répertoire de la collection utilisateur
- -
+
-
-
@@ -263,7 +284,14 @@
- -
+
-
+
+
+ Répertoire des cartouches utilisateur
+
+
+
+ -
-
@@ -277,20 +305,13 @@
- -
+
-
(Recharger les collections d'éléments pour appliquer les changements)
- -
-
-
- Répertoire des cartouches utilisateur
-
-
-
@@ -847,9 +868,9 @@ Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments
-
-
+
-
-
+
Max. parts in Element Editor List
diff --git a/sources/ui/titleblockpropertieswidget.cpp b/sources/ui/titleblockpropertieswidget.cpp
index 374694515..5cbc8e854 100644
--- a/sources/ui/titleblockpropertieswidget.cpp
+++ b/sources/ui/titleblockpropertieswidget.cpp
@@ -419,6 +419,8 @@ void TitleBlockPropertiesWidget::updateTemplateList()
QET::QetCollection qc = tbt_c -> collection();
if (qc == QET::QetCollection::Common)
icon = QET::Icons::QETLogo;
+ else if (qc == QET::QetCollection::Company)
+ icon = QET::Icons::Company;
else if (qc == QET::QetCollection::Custom)
icon = QET::Icons::Home;
else if (qc == QET::QetCollection::Embedded)
diff --git a/sources/utils/macosxopenevent.cpp b/sources/utils/macosxopenevent.cpp
index e3a6e34d0..c98693fc4 100644
--- a/sources/utils/macosxopenevent.cpp
+++ b/sources/utils/macosxopenevent.cpp
@@ -17,7 +17,7 @@
*/
#include "macosxopenevent.h"
-#include "singleapplication.h"
+#include "../singleapplication.h"
#include