mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-03-14 21:50:01 +01:00
Nomenclature add field Auxiliary_x-contact-bloc
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4196 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -1,17 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2015 The QElectroTech Team
|
Copyright 2006-2015 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
@@ -23,7 +23,7 @@
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Constructor
|
Constructor
|
||||||
@param an project (QETProject) of QET file
|
@param an project (QETProject) of QET file
|
||||||
*/
|
*/
|
||||||
nomenclature::nomenclature(QETProject *project, QWidget *parent):
|
nomenclature::nomenclature(QETProject *project, QWidget *parent):
|
||||||
QObject(),
|
QObject(),
|
||||||
@@ -60,7 +60,7 @@ bool nomenclature::saveToCSVFile() {
|
|||||||
tr("Impossible de remplacer le fichier!\n\n")+
|
tr("Impossible de remplacer le fichier!\n\n")+
|
||||||
"Destination: "+filename+"\n");
|
"Destination: "+filename+"\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (file.open(QIODevice::WriteOnly | QIODevice::Text)){
|
if (file.open(QIODevice::WriteOnly | QIODevice::Text)){
|
||||||
QTextStream stream(&file);
|
QTextStream stream(&file);
|
||||||
@@ -69,7 +69,7 @@ bool nomenclature::saveToCSVFile() {
|
|||||||
else return false;
|
else return false;
|
||||||
}
|
}
|
||||||
else return false;
|
else return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -90,6 +90,8 @@ QString nomenclature::getNomenclature() {
|
|||||||
""+ tr("Commentaire") +";"
|
""+ tr("Commentaire") +";"
|
||||||
""+ tr("Fabricant") +";"
|
""+ tr("Fabricant") +";"
|
||||||
""+ tr("Reference") +";"
|
""+ tr("Reference") +";"
|
||||||
|
""+ tr("Bloc auxilliaire 1") +";"
|
||||||
|
""+ tr("Bloc auxilliaire 2") +";"
|
||||||
""+ tr("Machine-reference") +";"
|
""+ tr("Machine-reference") +";"
|
||||||
""+ tr("Localisation") +";"
|
""+ tr("Localisation") +";"
|
||||||
""+ tr("Fonction") +"\n";
|
""+ tr("Fonction") +"\n";
|
||||||
@@ -132,6 +134,8 @@ QString nomenclature::getElementInfo(const Element *elmt) {
|
|||||||
info += elmt_info["comment"].toString() + ";";
|
info += elmt_info["comment"].toString() + ";";
|
||||||
info += elmt_info["manufacturer"].toString() + ";";
|
info += elmt_info["manufacturer"].toString() + ";";
|
||||||
info += elmt_info["manufacturer-reference"].toString() + ";";
|
info += elmt_info["manufacturer-reference"].toString() + ";";
|
||||||
|
info += elmt_info["Auxiliary_1-contact-bloc"].toString() + ";";
|
||||||
|
info += elmt_info["Auxiliary_2-contact-bloc"].toString() + ";";
|
||||||
info += elmt_info["machine-manufacturer-reference"].toString() + ";";
|
info += elmt_info["machine-manufacturer-reference"].toString() + ";";
|
||||||
info += elmt_info["location"].toString() + ";";
|
info += elmt_info["location"].toString() + ";";
|
||||||
info += elmt_info["function"].toString() + "\n";
|
info += elmt_info["function"].toString() + "\n";
|
||||||
|
|||||||
@@ -1,17 +1,17 @@
|
|||||||
/*
|
/*
|
||||||
Copyright 2006-2015 The QElectroTech Team
|
Copyright 2006-2015 The QElectroTech Team
|
||||||
This file is part of QElectroTech.
|
This file is part of QElectroTech.
|
||||||
|
|
||||||
QElectroTech is free software: you can redistribute it and/or modify
|
QElectroTech is free software: you can redistribute it and/or modify
|
||||||
it under the terms of the GNU General Public License as published by
|
it under the terms of the GNU General Public License as published by
|
||||||
the Free Software Foundation, either version 2 of the License, or
|
the Free Software Foundation, either version 2 of the License, or
|
||||||
(at your option) any later version.
|
(at your option) any later version.
|
||||||
|
|
||||||
QElectroTech is distributed in the hope that it will be useful,
|
QElectroTech is distributed in the hope that it will be useful,
|
||||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
GNU General Public License for more details.
|
GNU General Public License for more details.
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
You should have received a copy of the GNU General Public License
|
||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
@@ -75,7 +75,7 @@ QETApp::QETApp(int &argc, char **argv) :
|
|||||||
initLanguage();
|
initLanguage();
|
||||||
QET::Icons::initIcons();
|
QET::Icons::initIcons();
|
||||||
initStyle();
|
initStyle();
|
||||||
|
|
||||||
if (!non_interactive_execution_ && isRunning()) {
|
if (!non_interactive_execution_ && isRunning()) {
|
||||||
// envoie les arguments a l'instance deja existante
|
// envoie les arguments a l'instance deja existante
|
||||||
non_interactive_execution_ = sendMessage(
|
non_interactive_execution_ = sendMessage(
|
||||||
@@ -83,42 +83,42 @@ QETApp::QETApp(int &argc, char **argv) :
|
|||||||
QET::joinWithSpaces(QStringList(qet_arguments_.arguments()))
|
QET::joinWithSpaces(QStringList(qet_arguments_.arguments()))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (non_interactive_execution_) {
|
if (non_interactive_execution_) {
|
||||||
std::exit(EXIT_SUCCESS);
|
std::exit(EXIT_SUCCESS);
|
||||||
}
|
}
|
||||||
|
|
||||||
initSplashScreen();
|
initSplashScreen();
|
||||||
initSystemTray();
|
initSystemTray();
|
||||||
|
|
||||||
// prise en compte des messages des autres instances
|
// prise en compte des messages des autres instances
|
||||||
connect(this, SIGNAL(messageAvailable(QString)), this, SLOT(messageReceived(const QString&)));
|
connect(this, SIGNAL(messageAvailable(QString)), this, SLOT(messageReceived(const QString&)));
|
||||||
|
|
||||||
// nettoyage avant de quitter l'application
|
// nettoyage avant de quitter l'application
|
||||||
connect(this, SIGNAL(aboutToQuit()), this, SLOT(cleanup()));
|
connect(this, SIGNAL(aboutToQuit()), this, SLOT(cleanup()));
|
||||||
|
|
||||||
// connexion pour le signalmapper
|
// connexion pour le signalmapper
|
||||||
connect(&signal_map, SIGNAL(mapped(QWidget *)), this, SLOT(invertMainWindowVisibility(QWidget *)));
|
connect(&signal_map, SIGNAL(mapped(QWidget *)), this, SLOT(invertMainWindowVisibility(QWidget *)));
|
||||||
|
|
||||||
setQuitOnLastWindowClosed(false);
|
setQuitOnLastWindowClosed(false);
|
||||||
connect(this, SIGNAL(lastWindowClosed()), this, SLOT(checkRemainingWindows()));
|
connect(this, SIGNAL(lastWindowClosed()), this, SLOT(checkRemainingWindows()));
|
||||||
|
|
||||||
setSplashScreenStep(tr("Chargement... Initialisation du cache des collections d'éléments", "splash screen caption"));
|
setSplashScreenStep(tr("Chargement... Initialisation du cache des collections d'éléments", "splash screen caption"));
|
||||||
if (!collections_cache_) {
|
if (!collections_cache_) {
|
||||||
QString cache_path = QETApp::configDir() + "/elements_cache.sqlite";
|
QString cache_path = QETApp::configDir() + "/elements_cache.sqlite";
|
||||||
collections_cache_ = new ElementsCollectionCache(cache_path, this);
|
collections_cache_ = new ElementsCollectionCache(cache_path, this);
|
||||||
collections_cache_->setLocale(langFromSetting());
|
collections_cache_->setLocale(langFromSetting());
|
||||||
}
|
}
|
||||||
|
|
||||||
// loads known collections into memory (this does not include items rendering made in elements panels)
|
// loads known collections into memory (this does not include items rendering made in elements panels)
|
||||||
setSplashScreenStep(tr("Chargement... Lecture des collections d'éléments", "splash screen caption"));
|
setSplashScreenStep(tr("Chargement... Lecture des collections d'éléments", "splash screen caption"));
|
||||||
foreach(ElementsCollection *collection, availableCollections()) {
|
foreach(ElementsCollection *collection, availableCollections()) {
|
||||||
collection -> reload();
|
collection -> reload();
|
||||||
}
|
}
|
||||||
|
|
||||||
// on ouvre soit les fichiers passes en parametre soit un nouvel editeur de projet
|
// on ouvre soit les fichiers passes en parametre soit un nouvel editeur de projet
|
||||||
if (qet_arguments_.files().isEmpty()) {
|
if (qet_arguments_.files().isEmpty()) {
|
||||||
setSplashScreenStep(tr("Chargement... Éditeur de schéma", "splash screen caption"));
|
setSplashScreenStep(tr("Chargement... Éditeur de schéma", "splash screen caption"));
|
||||||
new QETDiagramEditor();
|
new QETDiagramEditor();
|
||||||
} else {
|
} else {
|
||||||
setSplashScreenStep(tr("Chargement... Ouverture des fichiers", "splash screen caption"));
|
setSplashScreenStep(tr("Chargement... Ouverture des fichiers", "splash screen caption"));
|
||||||
@@ -159,14 +159,14 @@ QETApp *QETApp::instance() {
|
|||||||
*/
|
*/
|
||||||
void QETApp::setLanguage(const QString &desired_language) {
|
void QETApp::setLanguage(const QString &desired_language) {
|
||||||
QString languages_path = languagesPath();
|
QString languages_path = languagesPath();
|
||||||
|
|
||||||
// load Qt library translations
|
// load Qt library translations
|
||||||
QString qt_l10n_path = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
QString qt_l10n_path = QLibraryInfo::location(QLibraryInfo::TranslationsPath);
|
||||||
if (!qtTranslator.load("qt_" + desired_language, qt_l10n_path)) {
|
if (!qtTranslator.load("qt_" + desired_language, qt_l10n_path)) {
|
||||||
qtTranslator.load("qt_" + desired_language, languages_path);
|
qtTranslator.load("qt_" + desired_language, languages_path);
|
||||||
}
|
}
|
||||||
installTranslator(&qtTranslator);
|
installTranslator(&qtTranslator);
|
||||||
|
|
||||||
// charge les traductions pour l'application QET
|
// charge les traductions pour l'application QET
|
||||||
if (!qetTranslator.load("qet_" + desired_language, languages_path)) {
|
if (!qetTranslator.load("qet_" + desired_language, languages_path)) {
|
||||||
// en cas d'echec, on retombe sur les chaines natives pour le francais
|
// en cas d'echec, on retombe sur les chaines natives pour le francais
|
||||||
@@ -176,7 +176,7 @@ void QETApp::setLanguage(const QString &desired_language) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
installTranslator(&qetTranslator);
|
installTranslator(&qetTranslator);
|
||||||
|
|
||||||
QString ltr_special_string = tr(
|
QString ltr_special_string = tr(
|
||||||
"LTR",
|
"LTR",
|
||||||
"Translate this string to RTL if you are translating to a Right-to-Left language, else translate to LTR"
|
"Translate this string to RTL if you are translating to a Right-to-Left language, else translate to LTR"
|
||||||
@@ -316,18 +316,18 @@ ElementsCollection *QETApp::customElementsCollection() {
|
|||||||
*/
|
*/
|
||||||
QList<ElementsCollection *> QETApp::availableCollections() {
|
QList<ElementsCollection *> QETApp::availableCollections() {
|
||||||
QList<ElementsCollection *> coll_list;
|
QList<ElementsCollection *> coll_list;
|
||||||
|
|
||||||
// collection commune
|
// collection commune
|
||||||
coll_list << commonElementsCollection();
|
coll_list << commonElementsCollection();
|
||||||
|
|
||||||
// collection perso
|
// collection perso
|
||||||
coll_list << customElementsCollection();
|
coll_list << customElementsCollection();
|
||||||
|
|
||||||
// collections embarquees
|
// collections embarquees
|
||||||
foreach(QETProject *opened_project, registered_projects_.values()) {
|
foreach(QETProject *opened_project, registered_projects_.values()) {
|
||||||
coll_list << opened_project -> embeddedCollection();
|
coll_list << opened_project -> embeddedCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
return(coll_list);
|
return(coll_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -349,6 +349,8 @@ QStringList QETApp::elementInfoKeys() {
|
|||||||
<< "designation"
|
<< "designation"
|
||||||
<< "manufacturer"
|
<< "manufacturer"
|
||||||
<< "manufacturer-reference"
|
<< "manufacturer-reference"
|
||||||
|
<< "Auxiliary_1-contact-bloc"
|
||||||
|
<< "Auxiliary_2-contact-bloc"
|
||||||
<< "machine-manufacturer-reference"
|
<< "machine-manufacturer-reference"
|
||||||
<< "location"
|
<< "location"
|
||||||
<< "function";
|
<< "function";
|
||||||
@@ -368,6 +370,8 @@ QString QETApp::elementTranslatedInfoKey(QString &info) {
|
|||||||
else if (info == "designation") return tr("Désignation");
|
else if (info == "designation") return tr("Désignation");
|
||||||
else if (info == "manufacturer") return tr("Fabricant");
|
else if (info == "manufacturer") return tr("Fabricant");
|
||||||
else if (info == "manufacturer-reference") return tr("Référence fabricant");
|
else if (info == "manufacturer-reference") return tr("Référence fabricant");
|
||||||
|
else if (info == "Auxiliary_1-contact-bloc") return tr("Bloc auxilliaire 1");
|
||||||
|
else if (info == "Auxiliary_2-contact-bloc") return tr("Bloc auxilliaire 2");
|
||||||
else if (info == "machine-manufacturer-reference") return tr("Référence fabricant machine");
|
else if (info == "machine-manufacturer-reference") return tr("Référence fabricant machine");
|
||||||
else if (info == "location") return tr("Localisation");
|
else if (info == "location") return tr("Localisation");
|
||||||
else if (info == "function") return tr("Fonction");
|
else if (info == "function") return tr("Fonction");
|
||||||
@@ -408,14 +412,14 @@ TitleBlockTemplatesFilesCollection *QETApp::customTitleBlockTemplatesCollection(
|
|||||||
*/
|
*/
|
||||||
QList<TitleBlockTemplatesCollection *> QETApp::availableTitleBlockTemplatesCollections() {
|
QList<TitleBlockTemplatesCollection *> QETApp::availableTitleBlockTemplatesCollections() {
|
||||||
QList<TitleBlockTemplatesCollection *> collections_list;
|
QList<TitleBlockTemplatesCollection *> collections_list;
|
||||||
|
|
||||||
collections_list << common_tbt_collection_;
|
collections_list << common_tbt_collection_;
|
||||||
collections_list << custom_tbt_collection_;
|
collections_list << custom_tbt_collection_;
|
||||||
|
|
||||||
foreach(QETProject *opened_project, registered_projects_) {
|
foreach(QETProject *opened_project, registered_projects_) {
|
||||||
collections_list << opened_project -> embeddedTitleBlockTemplatesCollection();
|
collections_list << opened_project -> embeddedTitleBlockTemplatesCollection();
|
||||||
}
|
}
|
||||||
|
|
||||||
return(collections_list);
|
return(collections_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -630,14 +634,14 @@ QStringList QETApp::handledFiles(const QList<QUrl> &urls) {
|
|||||||
*/
|
*/
|
||||||
QETDiagramEditor *QETApp::diagramEditorForFile(const QString &filepath) {
|
QETDiagramEditor *QETApp::diagramEditorForFile(const QString &filepath) {
|
||||||
if (filepath.isEmpty()) return(0);
|
if (filepath.isEmpty()) return(0);
|
||||||
|
|
||||||
QETApp *qet_app(QETApp::instance());
|
QETApp *qet_app(QETApp::instance());
|
||||||
foreach (QETDiagramEditor *diagram_editor, qet_app -> diagramEditors()) {
|
foreach (QETDiagramEditor *diagram_editor, qet_app -> diagramEditors()) {
|
||||||
if (diagram_editor -> viewForFile(filepath)) {
|
if (diagram_editor -> viewForFile(filepath)) {
|
||||||
return(diagram_editor);
|
return(diagram_editor);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(0);
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -748,11 +752,11 @@ bool QETApp::closeEveryEditor() {
|
|||||||
QFont QETApp::diagramTextsFont(qreal size) {
|
QFont QETApp::diagramTextsFont(qreal size) {
|
||||||
// acces a la configuration de l'application
|
// acces a la configuration de l'application
|
||||||
QSettings &qet_settings = QETApp::settings();
|
QSettings &qet_settings = QETApp::settings();
|
||||||
|
|
||||||
// police a utiliser pour le rendu de texte
|
// police a utiliser pour le rendu de texte
|
||||||
QString diagram_texts_family = qet_settings.value("diagramfont", "Sans Serif").toString();
|
QString diagram_texts_family = qet_settings.value("diagramfont", "Sans Serif").toString();
|
||||||
qreal diagram_texts_size = qet_settings.value("diagramsize", 9.0).toDouble();
|
qreal diagram_texts_size = qet_settings.value("diagramsize", 9.0).toDouble();
|
||||||
|
|
||||||
if (size != -1.0) {
|
if (size != -1.0) {
|
||||||
diagram_texts_size = size;
|
diagram_texts_size = size;
|
||||||
}
|
}
|
||||||
@@ -793,14 +797,14 @@ QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors() {
|
|||||||
QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors(QETProject *project) {
|
QList<QETTitleBlockTemplateEditor *> QETApp::titleBlockTemplateEditors(QETProject *project) {
|
||||||
QList<QETTitleBlockTemplateEditor *> editors;
|
QList<QETTitleBlockTemplateEditor *> editors;
|
||||||
if (!project) return(editors);
|
if (!project) return(editors);
|
||||||
|
|
||||||
// foreach known template editor
|
// foreach known template editor
|
||||||
foreach (QETTitleBlockTemplateEditor *tbt_editor, titleBlockTemplateEditors()) {
|
foreach (QETTitleBlockTemplateEditor *tbt_editor, titleBlockTemplateEditors()) {
|
||||||
if (tbt_editor -> location().parentProject() == project) {
|
if (tbt_editor -> location().parentProject() == project) {
|
||||||
editors << tbt_editor;
|
editors << tbt_editor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(editors);
|
return(editors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -849,20 +853,20 @@ TitleBlockTemplate *QETApp::defaultTitleBlockTemplate() {
|
|||||||
QList<QETElementEditor *> QETApp::elementEditors(QETProject *project) {
|
QList<QETElementEditor *> QETApp::elementEditors(QETProject *project) {
|
||||||
QList<QETElementEditor *> editors;
|
QList<QETElementEditor *> editors;
|
||||||
if (!project) return(editors);
|
if (!project) return(editors);
|
||||||
|
|
||||||
// pour chaque editeur d'element...
|
// pour chaque editeur d'element...
|
||||||
foreach(QETElementEditor *elmt_editor, elementEditors()) {
|
foreach(QETElementEditor *elmt_editor, elementEditors()) {
|
||||||
// on recupere l'emplacement de l'element qu'il edite
|
// on recupere l'emplacement de l'element qu'il edite
|
||||||
ElementsLocation elmt_editor_loc(elmt_editor -> location());
|
ElementsLocation elmt_editor_loc(elmt_editor -> location());
|
||||||
|
|
||||||
// il se peut que l'editeur edite un element non enregistre ou un fichier
|
// il se peut que l'editeur edite un element non enregistre ou un fichier
|
||||||
if (elmt_editor_loc.isNull()) continue;
|
if (elmt_editor_loc.isNull()) continue;
|
||||||
|
|
||||||
if (elmt_editor_loc.project() == project) {
|
if (elmt_editor_loc.project() == project) {
|
||||||
editors << elmt_editor;
|
editors << elmt_editor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return(editors);
|
return(editors);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1030,7 +1034,7 @@ void QETApp::messageReceived(const QString &message) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
Ouvre les fichiers passes en arguments
|
Ouvre les fichiers passes en arguments
|
||||||
@param args Objet contenant des arguments ; les fichiers
|
@param args Objet contenant des arguments ; les fichiers
|
||||||
@see openProjectFiles openElementFiles
|
@see openProjectFiles openElementFiles
|
||||||
*/
|
*/
|
||||||
void QETApp::openFiles(const QETArguments &args) {
|
void QETApp::openFiles(const QETArguments &args) {
|
||||||
@@ -1049,17 +1053,17 @@ void QETApp::openFiles(const QETArguments &args) {
|
|||||||
*/
|
*/
|
||||||
void QETApp::openProjectFiles(const QStringList &files_list) {
|
void QETApp::openProjectFiles(const QStringList &files_list) {
|
||||||
if (files_list.isEmpty()) return;
|
if (files_list.isEmpty()) return;
|
||||||
|
|
||||||
// liste des editeurs de schema ouverts
|
// liste des editeurs de schema ouverts
|
||||||
QList<QETDiagramEditor *> diagrams_editors = diagramEditors();
|
QList<QETDiagramEditor *> diagrams_editors = diagramEditors();
|
||||||
|
|
||||||
// s'il y a des editeur de schemas ouvert, on cherche ceux qui sont visibles
|
// s'il y a des editeur de schemas ouvert, on cherche ceux qui sont visibles
|
||||||
if (diagrams_editors.count()) {
|
if (diagrams_editors.count()) {
|
||||||
QList<QETDiagramEditor *> visible_diagrams_editors;
|
QList<QETDiagramEditor *> visible_diagrams_editors;
|
||||||
foreach(QETDiagramEditor *de, diagrams_editors) {
|
foreach(QETDiagramEditor *de, diagrams_editors) {
|
||||||
if (de -> isVisible()) visible_diagrams_editors << de;
|
if (de -> isVisible()) visible_diagrams_editors << de;
|
||||||
}
|
}
|
||||||
|
|
||||||
// on choisit soit le premier visible soit le premier tout court
|
// on choisit soit le premier visible soit le premier tout court
|
||||||
QETDiagramEditor *de_open;
|
QETDiagramEditor *de_open;
|
||||||
if (visible_diagrams_editors.count()) {
|
if (visible_diagrams_editors.count()) {
|
||||||
@@ -1068,7 +1072,7 @@ void QETApp::openProjectFiles(const QStringList &files_list) {
|
|||||||
de_open = diagrams_editors.first();
|
de_open = diagrams_editors.first();
|
||||||
de_open -> setVisible(true);
|
de_open -> setVisible(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ouvre les fichiers dans l'editeur ainsi choisi
|
// ouvre les fichiers dans l'editeur ainsi choisi
|
||||||
foreach(QString file, files_list) {
|
foreach(QString file, files_list) {
|
||||||
de_open -> openAndAddProject(file);
|
de_open -> openAndAddProject(file);
|
||||||
@@ -1086,7 +1090,7 @@ void QETApp::openProjectFiles(const QStringList &files_list) {
|
|||||||
*/
|
*/
|
||||||
void QETApp::openElementFiles(const QStringList &files_list) {
|
void QETApp::openElementFiles(const QStringList &files_list) {
|
||||||
if (files_list.isEmpty()) return;
|
if (files_list.isEmpty()) return;
|
||||||
|
|
||||||
// evite autant que possible les doublons dans la liste fournie
|
// evite autant que possible les doublons dans la liste fournie
|
||||||
QSet<QString> files_set;
|
QSet<QString> files_set;
|
||||||
foreach(QString file, files_list) {
|
foreach(QString file, files_list) {
|
||||||
@@ -1095,10 +1099,10 @@ void QETApp::openElementFiles(const QStringList &files_list) {
|
|||||||
}
|
}
|
||||||
// a ce stade, tous les fichiers dans le Set existent et sont a priori differents
|
// a ce stade, tous les fichiers dans le Set existent et sont a priori differents
|
||||||
if (files_set.isEmpty()) return;
|
if (files_set.isEmpty()) return;
|
||||||
|
|
||||||
// liste des editeurs d'element ouverts
|
// liste des editeurs d'element ouverts
|
||||||
QList<QETElementEditor *> element_editors = elementEditors();
|
QList<QETElementEditor *> element_editors = elementEditors();
|
||||||
|
|
||||||
// on traite les fichiers a la queue leu leu...
|
// on traite les fichiers a la queue leu leu...
|
||||||
foreach(QString element_file, files_set) {
|
foreach(QString element_file, files_set) {
|
||||||
bool already_opened_in_existing_element_editor = false;
|
bool already_opened_in_existing_element_editor = false;
|
||||||
@@ -1127,10 +1131,10 @@ void QETApp::openElementFiles(const QStringList &files_list) {
|
|||||||
*/
|
*/
|
||||||
void QETApp::openElementLocations(const QList<ElementsLocation> &locations_list) {
|
void QETApp::openElementLocations(const QList<ElementsLocation> &locations_list) {
|
||||||
if (locations_list.isEmpty()) return;
|
if (locations_list.isEmpty()) return;
|
||||||
|
|
||||||
// liste des editeurs d'element ouverts
|
// liste des editeurs d'element ouverts
|
||||||
QList<QETElementEditor *> element_editors = elementEditors();
|
QList<QETElementEditor *> element_editors = elementEditors();
|
||||||
|
|
||||||
// on traite les emplacements a la queue leu leu...
|
// on traite les emplacements a la queue leu leu...
|
||||||
foreach(ElementsLocation element_location, locations_list) {
|
foreach(ElementsLocation element_location, locations_list) {
|
||||||
bool already_opened_in_existing_element_editor = false;
|
bool already_opened_in_existing_element_editor = false;
|
||||||
@@ -1155,7 +1159,7 @@ void QETApp::openElementLocations(const QList<ElementsLocation> &locations_list)
|
|||||||
/**
|
/**
|
||||||
Launch a new title block template editor to edit the given template
|
Launch a new title block template editor to edit the given template
|
||||||
@param location location of the title block template to be edited
|
@param location location of the title block template to be edited
|
||||||
|
|
||||||
@param duplicate if true, the template is opened for duplication, which means
|
@param duplicate if true, the template is opened for duplication, which means
|
||||||
the user will be prompter for a new template name.
|
the user will be prompter for a new template name.
|
||||||
@see QETTitleBlockTemplateEditor::setOpenForDuplication()
|
@see QETTitleBlockTemplateEditor::setOpenForDuplication()
|
||||||
@@ -1184,7 +1188,7 @@ void QETApp::openTitleBlockTemplate(const QString &filepath) {
|
|||||||
*/
|
*/
|
||||||
void QETApp::openTitleBlockTemplateFiles(const QStringList &files_list) {
|
void QETApp::openTitleBlockTemplateFiles(const QStringList &files_list) {
|
||||||
if (files_list.isEmpty()) return;
|
if (files_list.isEmpty()) return;
|
||||||
|
|
||||||
// avoid duplicates in the provided files list
|
// avoid duplicates in the provided files list
|
||||||
QSet<QString> files_set;
|
QSet<QString> files_set;
|
||||||
foreach (QString file, files_list) {
|
foreach (QString file, files_list) {
|
||||||
@@ -1193,10 +1197,10 @@ void QETApp::openTitleBlockTemplateFiles(const QStringList &files_list) {
|
|||||||
}
|
}
|
||||||
// here, we can assume all files in the set exist and are different
|
// here, we can assume all files in the set exist and are different
|
||||||
if (files_set.isEmpty()) return;
|
if (files_set.isEmpty()) return;
|
||||||
|
|
||||||
// opened title block template editors
|
// opened title block template editors
|
||||||
QList<QETTitleBlockTemplateEditor *> tbt_editors = titleBlockTemplateEditors();
|
QList<QETTitleBlockTemplateEditor *> tbt_editors = titleBlockTemplateEditors();
|
||||||
|
|
||||||
foreach(QString tbt_file, files_set) {
|
foreach(QString tbt_file, files_set) {
|
||||||
bool already_opened_in_existing_tbt_editor = false;
|
bool already_opened_in_existing_tbt_editor = false;
|
||||||
foreach(QETTitleBlockTemplateEditor *tbt_editor, tbt_editors) {
|
foreach(QETTitleBlockTemplateEditor *tbt_editor, tbt_editors) {
|
||||||
@@ -1223,7 +1227,7 @@ void QETApp::openTitleBlockTemplateFiles(const QStringList &files_list) {
|
|||||||
void QETApp::configureQET() {
|
void QETApp::configureQET() {
|
||||||
// determine le widget parent a utiliser pour le dialogue
|
// determine le widget parent a utiliser pour le dialogue
|
||||||
QWidget *parent_widget = activeWindow();
|
QWidget *parent_widget = activeWindow();
|
||||||
|
|
||||||
// cree le dialogue
|
// cree le dialogue
|
||||||
ConfigDialog cd;
|
ConfigDialog cd;
|
||||||
cd.setWindowTitle(tr("Configurer QElectroTech", "window title"));
|
cd.setWindowTitle(tr("Configurer QElectroTech", "window title"));
|
||||||
@@ -1231,13 +1235,13 @@ void QETApp::configureQET() {
|
|||||||
cd.addPage(new NewDiagramPage());
|
cd.addPage(new NewDiagramPage());
|
||||||
cd.addPage(new ExportConfigPage());
|
cd.addPage(new ExportConfigPage());
|
||||||
cd.addPage(new PrintConfigPage());
|
cd.addPage(new PrintConfigPage());
|
||||||
|
|
||||||
|
|
||||||
// associe le dialogue a un eventuel widget parent
|
// associe le dialogue a un eventuel widget parent
|
||||||
if (parent_widget) {
|
if (parent_widget) {
|
||||||
cd.setParent(parent_widget, cd.windowFlags());
|
cd.setParent(parent_widget, cd.windowFlags());
|
||||||
}
|
}
|
||||||
|
|
||||||
// affiche le dialogue puis evite de le lier a un quelconque widget parent
|
// affiche le dialogue puis evite de le lier a un quelconque widget parent
|
||||||
cd.exec();
|
cd.exec();
|
||||||
cd.setParent(0, cd.windowFlags());
|
cd.setParent(0, cd.windowFlags());
|
||||||
@@ -1253,12 +1257,12 @@ void QETApp::configureQET() {
|
|||||||
void QETApp::aboutQET() {
|
void QETApp::aboutQET() {
|
||||||
// determine le widget parent a utiliser pour le dialogue
|
// determine le widget parent a utiliser pour le dialogue
|
||||||
QWidget *parent_widget = activeWindow();
|
QWidget *parent_widget = activeWindow();
|
||||||
|
|
||||||
// cree le dialogue si cela n'a pas deja ete fait
|
// cree le dialogue si cela n'a pas deja ete fait
|
||||||
if (!about_dialog_) {
|
if (!about_dialog_) {
|
||||||
about_dialog_ = new AboutQET();
|
about_dialog_ = new AboutQET();
|
||||||
}
|
}
|
||||||
|
|
||||||
// associe le dialogue a un eventuel widget parent
|
// associe le dialogue a un eventuel widget parent
|
||||||
if (parent_widget) {
|
if (parent_widget) {
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MAC
|
||||||
@@ -1266,7 +1270,7 @@ void QETApp::aboutQET() {
|
|||||||
#endif
|
#endif
|
||||||
about_dialog_ -> setParent(parent_widget, about_dialog_ -> windowFlags());
|
about_dialog_ -> setParent(parent_widget, about_dialog_ -> windowFlags());
|
||||||
}
|
}
|
||||||
|
|
||||||
// affiche le dialogue puis evite de le lier a un quelconque widget parent
|
// affiche le dialogue puis evite de le lier a un quelconque widget parent
|
||||||
about_dialog_ -> exec();
|
about_dialog_ -> exec();
|
||||||
about_dialog_ -> setParent(0, about_dialog_ -> windowFlags());
|
about_dialog_ -> setParent(0, about_dialog_ -> windowFlags());
|
||||||
@@ -1302,13 +1306,13 @@ QList<QWidget *> QETApp::floatingToolbarsAndDocksForMainWindow(QMainWindow *wind
|
|||||||
void QETApp::parseArguments() {
|
void QETApp::parseArguments() {
|
||||||
// recupere les arguments
|
// recupere les arguments
|
||||||
QList<QString> arguments_list(arguments());
|
QList<QString> arguments_list(arguments());
|
||||||
|
|
||||||
// enleve le premier argument : il s'agit du fichier binaire
|
// enleve le premier argument : il s'agit du fichier binaire
|
||||||
arguments_list.takeFirst();
|
arguments_list.takeFirst();
|
||||||
|
|
||||||
// analyse les arguments
|
// analyse les arguments
|
||||||
qet_arguments_ = QETArguments(arguments_list);
|
qet_arguments_ = QETArguments(arguments_list);
|
||||||
|
|
||||||
#ifdef QET_ALLOW_OVERRIDE_CED_OPTION
|
#ifdef QET_ALLOW_OVERRIDE_CED_OPTION
|
||||||
if (qet_arguments_.commonElementsDirSpecified()) {
|
if (qet_arguments_.commonElementsDirSpecified()) {
|
||||||
overrideCommonElementsDir(qet_arguments_.commonElementsDir());
|
overrideCommonElementsDir(qet_arguments_.commonElementsDir());
|
||||||
@@ -1324,11 +1328,11 @@ void QETApp::parseArguments() {
|
|||||||
overrideConfigDir(qet_arguments_.configDir());
|
overrideConfigDir(qet_arguments_.configDir());
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (qet_arguments_.langDirSpecified()) {
|
if (qet_arguments_.langDirSpecified()) {
|
||||||
overrideLangDir(qet_arguments_.langDir());
|
overrideLangDir(qet_arguments_.langDir());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (qet_arguments_.printLicenseRequested()) {
|
if (qet_arguments_.printLicenseRequested()) {
|
||||||
printLicense();
|
printLicense();
|
||||||
non_interactive_execution_ = true;
|
non_interactive_execution_ = true;
|
||||||
@@ -1385,7 +1389,7 @@ void QETApp::initStyle() {
|
|||||||
// if (qobject_cast<QPlastiqueStyle *>(style())) {
|
// if (qobject_cast<QPlastiqueStyle *>(style())) {
|
||||||
// setStyle(new QETStyle());
|
// setStyle(new QETStyle());
|
||||||
// }
|
// }
|
||||||
|
|
||||||
// applique ou non les couleurs de l'environnement
|
// applique ou non les couleurs de l'environnement
|
||||||
useSystemPalette(settings().value("usesystemcolors", true).toBool());
|
useSystemPalette(settings().value("usesystemcolors", true).toBool());
|
||||||
}
|
}
|
||||||
@@ -1401,16 +1405,16 @@ void QETApp::initConfiguration() {
|
|||||||
// cree les dossiers de configuration si necessaire
|
// cree les dossiers de configuration si necessaire
|
||||||
QDir config_dir(QETApp::configDir());
|
QDir config_dir(QETApp::configDir());
|
||||||
if (!config_dir.exists()) config_dir.mkpath(QETApp::configDir());
|
if (!config_dir.exists()) config_dir.mkpath(QETApp::configDir());
|
||||||
|
|
||||||
QDir custom_elements_dir(QETApp::customElementsDir());
|
QDir custom_elements_dir(QETApp::customElementsDir());
|
||||||
if (!custom_elements_dir.exists()) custom_elements_dir.mkpath(QETApp::customElementsDir());
|
if (!custom_elements_dir.exists()) custom_elements_dir.mkpath(QETApp::customElementsDir());
|
||||||
|
|
||||||
QDir custom_tbt_dir(QETApp::customTitleBlockTemplatesDir());
|
QDir custom_tbt_dir(QETApp::customTitleBlockTemplatesDir());
|
||||||
if (!custom_tbt_dir.exists()) custom_tbt_dir.mkpath(QETApp::customTitleBlockTemplatesDir());
|
if (!custom_tbt_dir.exists()) custom_tbt_dir.mkpath(QETApp::customTitleBlockTemplatesDir());
|
||||||
|
|
||||||
// lit le fichier de configuration
|
// lit le fichier de configuration
|
||||||
qet_settings = new QSettings(configDir() + "qelectrotech.conf", QSettings::IniFormat, this);
|
qet_settings = new QSettings(configDir() + "qelectrotech.conf", QSettings::IniFormat, this);
|
||||||
|
|
||||||
// fichiers recents
|
// fichiers recents
|
||||||
// note : les icones doivent etre initialisees avant ces instructions (qui creent des menus en interne)
|
// note : les icones doivent etre initialisees avant ces instructions (qui creent des menus en interne)
|
||||||
projects_recent_files_ = new RecentFiles("projects");
|
projects_recent_files_ = new RecentFiles("projects");
|
||||||
@@ -1426,7 +1430,7 @@ void QETApp::initSystemTray() {
|
|||||||
setSplashScreenStep(tr("Chargement... icône du systray", "splash screen caption"));
|
setSplashScreenStep(tr("Chargement... icône du systray", "splash screen caption"));
|
||||||
// initialisation des menus de l'icone dans le systray
|
// initialisation des menus de l'icone dans le systray
|
||||||
menu_systray = new QMenu(tr("QElectroTech", "systray menu title"));
|
menu_systray = new QMenu(tr("QElectroTech", "systray menu title"));
|
||||||
|
|
||||||
quitter_qet = new QAction(QET::Icons::ApplicationExit, tr("&Quitter"), this);
|
quitter_qet = new QAction(QET::Icons::ApplicationExit, tr("&Quitter"), this);
|
||||||
reduce_appli = new QAction(QET::Icons::Hide, tr("&Masquer"), this);
|
reduce_appli = new QAction(QET::Icons::Hide, tr("&Masquer"), this);
|
||||||
restore_appli = new QAction(QET::Icons::Restore, tr("&Restaurer"), this);
|
restore_appli = new QAction(QET::Icons::Restore, tr("&Restaurer"), this);
|
||||||
@@ -1438,11 +1442,11 @@ void QETApp::initSystemTray() {
|
|||||||
restore_templates = new QAction(QET::Icons::Restore, tr("&Restaurer tous les éditeurs de cartouche", "systray submenu entry"), this);
|
restore_templates = new QAction(QET::Icons::Restore, tr("&Restaurer tous les éditeurs de cartouche", "systray submenu entry"), this);
|
||||||
new_diagram = new QAction(QET::Icons::WindowNew, tr("&Nouvel éditeur de schéma"), this);
|
new_diagram = new QAction(QET::Icons::WindowNew, tr("&Nouvel éditeur de schéma"), this);
|
||||||
new_element = new QAction(QET::Icons::WindowNew, tr("&Nouvel éditeur d'élément"), this);
|
new_element = new QAction(QET::Icons::WindowNew, tr("&Nouvel éditeur d'élément"), this);
|
||||||
|
|
||||||
quitter_qet -> setStatusTip(tr("Ferme l'application QElectroTech"));
|
quitter_qet -> setStatusTip(tr("Ferme l'application QElectroTech"));
|
||||||
reduce_appli -> setToolTip(tr("Réduire QElectroTech dans le systray"));
|
reduce_appli -> setToolTip(tr("Réduire QElectroTech dans le systray"));
|
||||||
restore_appli -> setToolTip(tr("Restaurer QElectroTech"));
|
restore_appli -> setToolTip(tr("Restaurer QElectroTech"));
|
||||||
|
|
||||||
connect(quitter_qet, SIGNAL(triggered()), this, SLOT(quitQET()));
|
connect(quitter_qet, SIGNAL(triggered()), this, SLOT(quitQET()));
|
||||||
connect(reduce_appli, SIGNAL(triggered()), this, SLOT(reduceEveryEditor()));
|
connect(reduce_appli, SIGNAL(triggered()), this, SLOT(reduceEveryEditor()));
|
||||||
connect(restore_appli, SIGNAL(triggered()), this, SLOT(restoreEveryEditor()));
|
connect(restore_appli, SIGNAL(triggered()), this, SLOT(restoreEveryEditor()));
|
||||||
@@ -1454,7 +1458,7 @@ void QETApp::initSystemTray() {
|
|||||||
connect(restore_templates,SIGNAL(triggered()), this, SLOT(restoreTitleBlockTemplateEditors()));
|
connect(restore_templates,SIGNAL(triggered()), this, SLOT(restoreTitleBlockTemplateEditors()));
|
||||||
connect(new_diagram, SIGNAL(triggered()), this, SLOT(newDiagramEditor()));
|
connect(new_diagram, SIGNAL(triggered()), this, SLOT(newDiagramEditor()));
|
||||||
connect(new_element, SIGNAL(triggered()), this, SLOT(newElementEditor()));
|
connect(new_element, SIGNAL(triggered()), this, SLOT(newElementEditor()));
|
||||||
|
|
||||||
// initialisation de l'icone du systray
|
// initialisation de l'icone du systray
|
||||||
qsti = new QSystemTrayIcon(QET::Icons::QETLogo, this);
|
qsti = new QSystemTrayIcon(QET::Icons::QETLogo, this);
|
||||||
qsti -> setToolTip(tr("QElectroTech", "systray icon tooltip"));
|
qsti -> setToolTip(tr("QElectroTech", "systray icon tooltip"));
|
||||||
@@ -1515,16 +1519,16 @@ QETProject *QETApp::projectFromString(const QString &url) {
|
|||||||
/// construit le menu de l'icone dans le systray
|
/// construit le menu de l'icone dans le systray
|
||||||
void QETApp::buildSystemTrayMenu() {
|
void QETApp::buildSystemTrayMenu() {
|
||||||
menu_systray -> clear();
|
menu_systray -> clear();
|
||||||
|
|
||||||
// recupere les editeurs
|
// recupere les editeurs
|
||||||
QList<QETDiagramEditor *> diagrams = diagramEditors();
|
QList<QETDiagramEditor *> diagrams = diagramEditors();
|
||||||
QList<QETElementEditor *> elements = elementEditors();
|
QList<QETElementEditor *> elements = elementEditors();
|
||||||
QList<QETTitleBlockTemplateEditor *> tbtemplates = titleBlockTemplateEditors();
|
QList<QETTitleBlockTemplateEditor *> tbtemplates = titleBlockTemplateEditors();
|
||||||
fetchWindowStats(diagrams, elements, tbtemplates);
|
fetchWindowStats(diagrams, elements, tbtemplates);
|
||||||
|
|
||||||
// ajoute le bouton reduire / restaurer au menu
|
// ajoute le bouton reduire / restaurer au menu
|
||||||
menu_systray -> addAction(every_editor_reduced ? restore_appli : reduce_appli);
|
menu_systray -> addAction(every_editor_reduced ? restore_appli : reduce_appli);
|
||||||
|
|
||||||
// ajoute les editeurs de schemas dans un sous-menu
|
// ajoute les editeurs de schemas dans un sous-menu
|
||||||
QMenu *diagrams_submenu = menu_systray -> addMenu(tr("Éditeurs de schémas"));
|
QMenu *diagrams_submenu = menu_systray -> addMenu(tr("Éditeurs de schémas"));
|
||||||
diagrams_submenu -> addAction(reduce_diagrams);
|
diagrams_submenu -> addAction(reduce_diagrams);
|
||||||
@@ -1533,7 +1537,7 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
reduce_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_reduced);
|
reduce_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_reduced);
|
||||||
restore_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_visible);
|
restore_diagrams -> setEnabled(!diagrams.isEmpty() && !every_diagram_visible);
|
||||||
addWindowsListToMenu<QETDiagramEditor>(diagrams_submenu, diagrams);
|
addWindowsListToMenu<QETDiagramEditor>(diagrams_submenu, diagrams);
|
||||||
|
|
||||||
// ajoute les editeurs d'elements au menu
|
// ajoute les editeurs d'elements au menu
|
||||||
QMenu *elements_submenu = menu_systray -> addMenu(tr("Éditeurs d'élément"));
|
QMenu *elements_submenu = menu_systray -> addMenu(tr("Éditeurs d'élément"));
|
||||||
elements_submenu -> addAction(reduce_elements);
|
elements_submenu -> addAction(reduce_elements);
|
||||||
@@ -1543,7 +1547,7 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
restore_elements -> setEnabled(!elements.isEmpty() && !every_element_visible);
|
restore_elements -> setEnabled(!elements.isEmpty() && !every_element_visible);
|
||||||
elements_submenu -> addSeparator();
|
elements_submenu -> addSeparator();
|
||||||
addWindowsListToMenu<QETElementEditor>(elements_submenu, elements);
|
addWindowsListToMenu<QETElementEditor>(elements_submenu, elements);
|
||||||
|
|
||||||
// add title block template editors in a submenu
|
// add title block template editors in a submenu
|
||||||
QMenu *tbtemplates_submenu = menu_systray -> addMenu(tr("Éditeurs de cartouche", "systray menu entry"));
|
QMenu *tbtemplates_submenu = menu_systray -> addMenu(tr("Éditeurs de cartouche", "systray menu entry"));
|
||||||
tbtemplates_submenu -> addAction(reduce_templates);
|
tbtemplates_submenu -> addAction(reduce_templates);
|
||||||
@@ -1551,7 +1555,7 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
reduce_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_reduced);
|
reduce_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_reduced);
|
||||||
restore_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_visible);
|
restore_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_visible);
|
||||||
addWindowsListToMenu<QETTitleBlockTemplateEditor>(tbtemplates_submenu, tbtemplates);
|
addWindowsListToMenu<QETTitleBlockTemplateEditor>(tbtemplates_submenu, tbtemplates);
|
||||||
|
|
||||||
// ajoute le bouton quitter au menu
|
// ajoute le bouton quitter au menu
|
||||||
menu_systray -> addSeparator();
|
menu_systray -> addSeparator();
|
||||||
menu_systray -> addAction(quitter_qet);
|
menu_systray -> addAction(quitter_qet);
|
||||||
@@ -1568,13 +1572,13 @@ void QETApp::fetchWindowStats(
|
|||||||
foreach(QMainWindow *w, diagrams) if (w -> isVisible()) ++ visible_diagrams;
|
foreach(QMainWindow *w, diagrams) if (w -> isVisible()) ++ visible_diagrams;
|
||||||
every_diagram_reduced = !visible_diagrams;
|
every_diagram_reduced = !visible_diagrams;
|
||||||
every_diagram_visible = visible_diagrams == diagrams.count();
|
every_diagram_visible = visible_diagrams == diagrams.count();
|
||||||
|
|
||||||
// compte le nombre de schemas visibles
|
// compte le nombre de schemas visibles
|
||||||
int visible_elements = 0;
|
int visible_elements = 0;
|
||||||
foreach(QMainWindow *w, elements) if (w -> isVisible()) ++ visible_elements;
|
foreach(QMainWindow *w, elements) if (w -> isVisible()) ++ visible_elements;
|
||||||
every_element_reduced = !visible_elements;
|
every_element_reduced = !visible_elements;
|
||||||
every_element_visible = visible_elements == elements.count();
|
every_element_visible = visible_elements == elements.count();
|
||||||
|
|
||||||
// count visible template editors
|
// count visible template editors
|
||||||
int visible_templates = 0;
|
int visible_templates = 0;
|
||||||
foreach(QMainWindow *window, tbtemplates) {
|
foreach(QMainWindow *window, tbtemplates) {
|
||||||
@@ -1582,7 +1586,7 @@ void QETApp::fetchWindowStats(
|
|||||||
}
|
}
|
||||||
every_template_reduced = !visible_templates;
|
every_template_reduced = !visible_templates;
|
||||||
every_template_visible = visible_templates == tbtemplates.count();
|
every_template_visible = visible_templates == tbtemplates.count();
|
||||||
|
|
||||||
// determine si tous les elements sont reduits
|
// determine si tous les elements sont reduits
|
||||||
every_editor_reduced = every_element_reduced && every_diagram_reduced;
|
every_editor_reduced = every_element_reduced && every_diagram_reduced;
|
||||||
}
|
}
|
||||||
@@ -1766,10 +1770,10 @@ QMap<uint, QETProject *> QETApp::registeredProjects() {
|
|||||||
bool QETApp::registerProject(QETProject *project) {
|
bool QETApp::registerProject(QETProject *project) {
|
||||||
// le projet doit sembler valide
|
// le projet doit sembler valide
|
||||||
if (!project) return(false);
|
if (!project) return(false);
|
||||||
|
|
||||||
// si le projet est deja enregistre, renvoie false
|
// si le projet est deja enregistre, renvoie false
|
||||||
if (projectId(project) != -1) return(false);
|
if (projectId(project) != -1) return(false);
|
||||||
|
|
||||||
// enregistre le projet
|
// enregistre le projet
|
||||||
registered_projects_.insert(next_project_id ++, project);
|
registered_projects_.insert(next_project_id ++, project);
|
||||||
return(true);
|
return(true);
|
||||||
@@ -1783,10 +1787,10 @@ bool QETApp::registerProject(QETProject *project) {
|
|||||||
*/
|
*/
|
||||||
bool QETApp::unregisterProject(QETProject *project) {
|
bool QETApp::unregisterProject(QETProject *project) {
|
||||||
int project_id = projectId(project);
|
int project_id = projectId(project);
|
||||||
|
|
||||||
// si le projet n'est pas enregistre, renvoie false
|
// si le projet n'est pas enregistre, renvoie false
|
||||||
if (project_id == -1) return(false);
|
if (project_id == -1) return(false);
|
||||||
|
|
||||||
// annule l'enregistrement du projet
|
// annule l'enregistrement du projet
|
||||||
return(registered_projects_.remove(project_id) == 1);
|
return(registered_projects_.remove(project_id) == 1);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user