mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-17 12:40:35 +01:00
Merge Qt5 branch sources folder to trunk
-Cette ligne, et les suivantes ci-dessous, seront ignorées-- M sources/aboutqet.cpp M sources/bordertitleblock.cpp M sources/conductorproperties.h M sources/configdialog.cpp M sources/configpages.cpp M sources/configpages.h M sources/createdxf.h M sources/diagram.cpp M sources/diagram.h M sources/diagramcommands.cpp M sources/diagramcommands.h M sources/diagramprintdialog.cpp M sources/diagramprintdialog.h M sources/diagramschooser.cpp M sources/diagramschooser.h M sources/diagramview.cpp M sources/diagramview.h M sources/dvevent/dveventaddimage.cpp M sources/dvevent/dveventaddshape.cpp M sources/editor/arceditor.cpp M sources/editor/arceditor.h M sources/editor/editorcommands.cpp M sources/editor/editorcommands.h M sources/editor/elementitemeditor.h M sources/editor/elementprimitivedecorator.cpp M sources/editor/elementscene.cpp M sources/editor/elementscene.h M sources/editor/elementview.cpp M sources/editor/ellipseeditor.cpp M sources/editor/ellipseeditor.h M sources/editor/esevent/eseventaddtext.cpp M sources/editor/esevent/eseventaddtextfield.cpp M sources/editor/esevent/eseventinterface.cpp M sources/editor/graphicspart/customelementpart.h M sources/editor/graphicspart/parttext.cpp M sources/editor/graphicspart/parttext.h M sources/editor/graphicspart/parttextfield.cpp M sources/editor/graphicspart/parttextfield.h M sources/editor/lineeditor.cpp M sources/editor/lineeditor.h M sources/editor/polygoneditor.cpp M sources/editor/qetelementeditor.cpp M sources/editor/qetelementeditor.h M sources/editor/rectangleeditor.cpp M sources/editor/rectangleeditor.h M sources/editor/styleeditor.cpp M sources/editor/styleeditor.h M sources/editor/terminaleditor.cpp M sources/editor/terminaleditor.h M sources/editor/texteditor.cpp M sources/editor/texteditor.h M sources/editor/textfieldeditor.cpp M sources/editor/textfieldeditor.h M sources/editor/ui/elementpropertieseditorwidget.cpp M sources/elementdefinition.cpp M sources/elementdeleter.cpp M sources/elementdeleter.h M sources/elementdialog.cpp M sources/elementscategorieslist.h M sources/elementscategorieswidget.cpp M sources/elementscategorieswidget.h M sources/elementscategory.cpp M sources/elementscategorydeleter.cpp M sources/elementscategorydeleter.h M sources/elementscategoryeditor.cpp M sources/elementscategoryeditor.h M sources/elementscollection.cpp M sources/elementscollectioncache.cpp M sources/elementspanel.cpp M sources/elementspanel.h M sources/elementspanelwidget.cpp M sources/elementspanelwidget.h M sources/elementtextsmover.h M sources/exportdialog.cpp M sources/exportdialog.h M sources/exportproperties.cpp M sources/exportpropertieswidget.cpp M sources/exportpropertieswidget.h M sources/genericpanel.cpp M sources/integrationmoveelementshandler.cpp M sources/integrationmoveelementshandler.h M sources/interactivemoveelementshandler.cpp M sources/nameslistwidget.cpp M sources/nameslistwidget.h M sources/newelementwizard.cpp M sources/newelementwizard.h M sources/nomenclature.cpp M sources/nomenclature.h M sources/projectconfigpages.cpp M sources/projectview.cpp M sources/projectview.h M sources/qet.cpp M sources/qetapp.cpp M sources/qetapp.h M sources/qetdiagrameditor.cpp M sources/qetdiagrameditor.h M sources/qetgraphicsitem/conductor.cpp M sources/qetgraphicsitem/conductortextitem.cpp M sources/qetgraphicsitem/customelement.cpp M sources/qetgraphicsitem/diagramimageitem.cpp M sources/qetgraphicsitem/diagramtextitem.cpp M sources/qetgraphicsitem/diagramtextitem.h M sources/qetgraphicsitem/element.cpp M sources/qetgraphicsitem/ghostelement.cpp M sources/qetgraphicsitem/qetshapeitem.cpp M sources/qetgraphicsitem/terminal.cpp M sources/qetgraphicsitem/terminal.h M sources/qeticons.cpp M sources/qeticons.h M sources/qetmainwindow.cpp M sources/qetmessagebox.cpp M sources/qetmessagebox.h M sources/qetprintpreviewdialog.cpp M sources/qetprintpreviewdialog.h M sources/qetproject.cpp M sources/qetsingleapplication.cpp M sources/qettabbar.h M sources/qfilenameedit.cpp M sources/qtextorientationspinboxwidget.cpp M sources/qtextorientationspinboxwidget.h M sources/qtextorientationwidget.cpp M sources/qtextorientationwidget.h M sources/richtext/richtexteditor.cpp M sources/richtext/richtexteditor_p.h M sources/richtext/ui_addlinkdialog.h M sources/titleblock/dimensionwidget.h M sources/titleblock/gridlayoutanimation.h M sources/titleblock/helpercell.h M sources/titleblock/integrationmovetemplateshandler.cpp M sources/titleblock/integrationmovetemplateshandler.h M sources/titleblock/qettemplateeditor.cpp M sources/titleblock/qettemplateeditor.h M sources/titleblock/templatecellsset.h M sources/titleblock/templatecellwidget.cpp M sources/titleblock/templatecellwidget.h M sources/titleblock/templatecommands.cpp M sources/titleblock/templatedeleter.cpp M sources/titleblock/templatedeleter.h M sources/titleblock/templatelocationchooser.cpp M sources/titleblock/templatelocationchooser.h M sources/titleblock/templatelocationsaver.cpp M sources/titleblock/templatelocationsaver.h M sources/titleblock/templatelogomanager.cpp M sources/titleblock/templatelogomanager.h M sources/titleblock/templateview.cpp M sources/titleblock/templatevisualcell.h M sources/titleblockcell.cpp M sources/titleblocktemplate.cpp M sources/treecoloranimation.h M sources/ui/conductorpropertieswidget.cpp M sources/ui/diagrampropertiesdialog.cpp M sources/ui/diagramselection.cpp M sources/ui/dialogautonum.cpp M sources/ui/dialogwaiting.cpp M sources/ui/elementpropertieswidget.cpp M sources/ui/elementselectorwidget.cpp M sources/ui/linksingleelementwidget.cpp M sources/ui/masterpropertieswidget.cpp M sources/ui/potentialtextsdialog.cpp M sources/ui/projectpropertiesdialog.cpp M sources/ui/selectautonumw.cpp M sources/ui/titleblockpropertieswidget.cpp M sources/ui/xrefpropertieswidget.cpp M sources/undocommand/changeelementinformationcommand.cpp git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@3783 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -15,7 +15,7 @@
|
|||||||
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/>.
|
||||||
*/
|
*/
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "qettabwidget.h"
|
#include "qettabwidget.h"
|
||||||
#include "aboutqet.h"
|
#include "aboutqet.h"
|
||||||
#include "qet.h"
|
#include "qet.h"
|
||||||
@@ -27,14 +27,14 @@
|
|||||||
*/
|
*/
|
||||||
AboutQET::AboutQET(QWidget *parent) : QDialog(parent) {
|
AboutQET::AboutQET(QWidget *parent) : QDialog(parent) {
|
||||||
// Titre, taille, comportement...
|
// Titre, taille, comportement...
|
||||||
setWindowTitle(tr("\300 propos de QElectrotech", "window title"));
|
setWindowTitle(tr("À propos de QElectrotech", "window title"));
|
||||||
setMinimumWidth(680);
|
setMinimumWidth(680);
|
||||||
setMinimumHeight(690);
|
setMinimumHeight(690);
|
||||||
setModal(true);
|
setModal(true);
|
||||||
|
|
||||||
// Trois onglets
|
// Trois onglets
|
||||||
QETTabWidget *tabs = new QETTabWidget(this);
|
QETTabWidget *tabs = new QETTabWidget(this);
|
||||||
tabs -> addTab(aboutTab(), tr("\300 &propos", "tab title"));
|
tabs -> addTab(aboutTab(), tr("À &propos", "tab title"));
|
||||||
tabs -> addTab(authorsTab(), tr("A&uteurs", "tab title"));
|
tabs -> addTab(authorsTab(), tr("A&uteurs", "tab title"));
|
||||||
tabs -> addTab(translatorsTab(), tr("&Traducteurs", "tab title"));
|
tabs -> addTab(translatorsTab(), tr("&Traducteurs", "tab title"));
|
||||||
tabs -> addTab(contributorsTab(), tr("&Contributeurs", "tab title"));
|
tabs -> addTab(contributorsTab(), tr("&Contributeurs", "tab title"));
|
||||||
@@ -91,13 +91,13 @@ QWidget *AboutQET::title() const {
|
|||||||
*/
|
*/
|
||||||
QWidget *AboutQET::aboutTab() const {
|
QWidget *AboutQET::aboutTab() const {
|
||||||
QLabel *about = new QLabel(
|
QLabel *about = new QLabel(
|
||||||
tr("QElectroTech, une application de r\351alisation de sch\351mas \351lectriques.", "about tab, description line") +
|
tr("QElectroTech, une application de réalisation de schémas électriques.", "about tab, description line") +
|
||||||
"<br><br>" +
|
"<br><br>" +
|
||||||
tr("\251 2006-2014 Les d\351veloppeurs de QElectroTech", "about tab, developers line") +
|
tr("2006-2015 Les développeurs de QElectroTech", "about tab, developers line") +
|
||||||
"<br><br>"
|
"<br><br>"
|
||||||
"<a href=\"http://qelectrotech.org/\">http://qelectrotech.org/</a>"
|
"<a href=\"http://qelectrotech.org/\">http://qelectrotech.org/</a>"
|
||||||
"<br><br>" +
|
"<br><br>" +
|
||||||
tr("Contact\240: <a href=\"mailto:qet@lists.tuxfamily.org\">qet@lists.tuxfamily.org</a>", "about tab, contact line")
|
tr("Contact : <a href=\"mailto:qet@lists.tuxfamily.org\">qet@lists.tuxfamily.org</a>", "about tab, contact line")
|
||||||
);
|
);
|
||||||
about -> setAlignment(Qt::AlignCenter);
|
about -> setAlignment(Qt::AlignCenter);
|
||||||
about -> setOpenExternalLinks(true);
|
about -> setOpenExternalLinks(true);
|
||||||
@@ -110,10 +110,10 @@ QWidget *AboutQET::aboutTab() const {
|
|||||||
*/
|
*/
|
||||||
QWidget *AboutQET::authorsTab() const {
|
QWidget *AboutQET::authorsTab() const {
|
||||||
QLabel *authors = new QLabel();
|
QLabel *authors = new QLabel();
|
||||||
addAuthor(authors, "Beno\356t Ansieau", "benoit@qelectrotech.org", tr("Id\351e originale"));
|
addAuthor(authors, "Benoît Ansieau", "benoit@qelectrotech.org", tr("Idée originale"));
|
||||||
addAuthor(authors, "Laurent Trinques", "scorpio@qelectrotech.org", tr("D\351veloppement"));
|
addAuthor(authors, "Laurent Trinques", "scorpio@qelectrotech.org", tr("Développement"));
|
||||||
addAuthor(authors, "Joshua Claveau", "Joshua@qelectrotech.org", tr("D\351veloppement"));
|
addAuthor(authors, "Joshua Claveau", "Joshua@qelectrotech.org", tr("Développement"));
|
||||||
addAuthor(authors, "Abhishek Bansal", "abhishek@qelectrotech.org", tr("D\351veloppement"));
|
addAuthor(authors, "Abhishek Bansal", "abhishek@qelectrotech.org", tr("Développement"));
|
||||||
|
|
||||||
|
|
||||||
authors -> setOpenExternalLinks(true);
|
authors -> setOpenExternalLinks(true);
|
||||||
@@ -133,8 +133,8 @@ QWidget *AboutQET::translatorsTab() const {
|
|||||||
|
|
||||||
addAuthor(translators, "Alfredo Carreto", "electronicos_mx@yahoo.com.mx",tr("Traduction en espagnol"));
|
addAuthor(translators, "Alfredo Carreto", "electronicos_mx@yahoo.com.mx",tr("Traduction en espagnol"));
|
||||||
addAuthor(translators, "Yuriy Litkevich", "yuriy@qelectrotech.org", tr("Traduction en russe"));
|
addAuthor(translators, "Yuriy Litkevich", "yuriy@qelectrotech.org", tr("Traduction en russe"));
|
||||||
addAuthor(translators, "Jos\351 Carlos Martins", "jose@qelectrotech.org", tr("Traduction en portugais"));
|
addAuthor(translators, "José Carlos Martins", "jose@qelectrotech.org", tr("Traduction en portugais"));
|
||||||
addAuthor(translators, "Pavel Fric", "pavelfric@seznam.cz", tr("Traduction en tch\350que"));
|
addAuthor(translators, "Pavel Fric", "pavelfric@seznam.cz", tr("Traduction en tchèque"));
|
||||||
addAuthor(translators, "Paweł Śmiech", "pawel32640@gmail.com", tr("Traduction en polonais"));
|
addAuthor(translators, "Paweł Śmiech", "pawel32640@gmail.com", tr("Traduction en polonais"));
|
||||||
addAuthor(translators, "Markus Budde", "markus.budde@msn.com", tr("Traduction en allemand"));
|
addAuthor(translators, "Markus Budde", "markus.budde@msn.com", tr("Traduction en allemand"));
|
||||||
addAuthor(translators, "Jonas Stein", "news@jonasstein.de", tr("Traduction en allemand"));
|
addAuthor(translators, "Jonas Stein", "news@jonasstein.de", tr("Traduction en allemand"));
|
||||||
@@ -145,10 +145,10 @@ QWidget *AboutQET::translatorsTab() const {
|
|||||||
addAuthor(translators, "Silvio", "silvio@qelectrotech.org", tr("Traduction en italien"));
|
addAuthor(translators, "Silvio", "silvio@qelectrotech.org", tr("Traduction en italien"));
|
||||||
addAuthor(translators, "Mohamed Souabni", "souabnimohamed@yahoo.fr", tr("Traduction en arabe"));
|
addAuthor(translators, "Mohamed Souabni", "souabnimohamed@yahoo.fr", tr("Traduction en arabe"));
|
||||||
addAuthor(translators, "Antun Maraković", "antun.marakovic@lolaribar.hr",tr("Traduction en croate"));
|
addAuthor(translators, "Antun Maraković", "antun.marakovic@lolaribar.hr",tr("Traduction en croate"));
|
||||||
addAuthor(translators, "Eduard Amor\363s", "amoros@marmenuda.com", tr("Traduction en catalan"));
|
addAuthor(translators, "Eduard Amorós", "amoros@marmenuda.com", tr("Traduction en catalan"));
|
||||||
addAuthor(translators, "Nikos Papadopoylos", "231036448@freemail.gr", tr("Traduction en grec"));
|
addAuthor(translators, "Nikos Papadopoylos", "231036448@freemail.gr", tr("Traduction en grec"));
|
||||||
addAuthor(translators, "Yannis Gyftomitros", "yang@hellug.gr", tr("Traduction en grec"));
|
addAuthor(translators, "Yannis Gyftomitros", "yang@hellug.gr", tr("Traduction en grec"));
|
||||||
addAuthor(translators, "Paul Van Deelen", "shooter@home.nl", tr("Traduction en n\351erlandais"));
|
addAuthor(translators, "Paul Van Deelen", "shooter@home.nl", tr("Traduction en néerlandais"));
|
||||||
addAuthor(translators, "Ronny Desmedt", "r.desmedt@live.be", tr("Traduction en flamand"));
|
addAuthor(translators, "Ronny Desmedt", "r.desmedt@live.be", tr("Traduction en flamand"));
|
||||||
|
|
||||||
|
|
||||||
@@ -178,12 +178,12 @@ QWidget *AboutQET::contributorsTab() const {
|
|||||||
addAuthor(contributors, "zloidemon", "", tr("Paquets FreeBSD"));
|
addAuthor(contributors, "zloidemon", "", tr("Paquets FreeBSD"));
|
||||||
addAuthor(contributors, "Yoann Varenne", "yoann@tuxfamily.org", tr("Paquets MAC OS X"));
|
addAuthor(contributors, "Yoann Varenne", "yoann@tuxfamily.org", tr("Paquets MAC OS X"));
|
||||||
addAuthor(contributors, "Chipsterjulien", "", tr("Paquets Archlinux AUR"));
|
addAuthor(contributors, "Chipsterjulien", "", tr("Paquets Archlinux AUR"));
|
||||||
addAuthor(contributors, "Nuno Pinheiro", "nuno@nuno-icons.com", tr("Ic\364nes"));
|
addAuthor(contributors, "Nuno Pinheiro", "nuno@nuno-icons.com", tr("Icônes"));
|
||||||
addAuthor(contributors, "Cyril Frausti", "cyril@qelectrotech.org", tr("D\351veloppement"));
|
addAuthor(contributors, "Cyril Frausti", "cyril@qelectrotech.org", tr("Développement"));
|
||||||
addAuthor(contributors, "Arun Kishore Eswara", "eswara.arun@gmail.com", tr("Documentation"));
|
addAuthor(contributors, "Arun Kishore Eswara", "eswara.arun@gmail.com", tr("Documentation"));
|
||||||
addAuthor(contributors, "Ren\351 Negre", "runsys@qelectrotech.org", tr("D\351veloppement"));
|
addAuthor(contributors, "René Negre", "runsys@qelectrotech.org", tr("Développement"));
|
||||||
addAuthor(contributors, "Ronny Desmedt", "r.desmedt@live.be", tr("D\351veloppement"));
|
addAuthor(contributors, "Ronny Desmedt", "r.desmedt@live.be", tr("Développement"));
|
||||||
addAuthor(contributors, "Nuri", "nuri@qelectrotech.org", tr("Collection d'\351l\351ments"));
|
addAuthor(contributors, "Nuri", "nuri@qelectrotech.org", tr("Collection d'éléments"));
|
||||||
|
|
||||||
|
|
||||||
contributors -> setOpenExternalLinks(true);
|
contributors -> setOpenExternalLinks(true);
|
||||||
|
|||||||
@@ -680,7 +680,7 @@ QString BorderTitleBlock::incrementLetters(const QString &string) {
|
|||||||
QChar last_digit(string.at(string.count() - 1));
|
QChar last_digit(string.at(string.count() - 1));
|
||||||
if (last_digit != 'Z') {
|
if (last_digit != 'Z') {
|
||||||
// incremente le dernier digit
|
// incremente le dernier digit
|
||||||
last_digit = last_digit.toAscii() + 1;
|
last_digit = last_digit.toLatin1() + 1;
|
||||||
return(first_digits + QString(last_digit));
|
return(first_digits + QString(last_digit));
|
||||||
} else {
|
} else {
|
||||||
return(incrementLetters(first_digits) + "A");
|
return(incrementLetters(first_digits) + "A");
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#ifndef CONDUCTOR_PROPERTIES_H
|
#ifndef CONDUCTOR_PROPERTIES_H
|
||||||
#define CONDUCTOR_PROPERTIES_H
|
#define CONDUCTOR_PROPERTIES_H
|
||||||
#include "qet.h"
|
#include "qet.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include <QtXml>
|
#include <QtXml>
|
||||||
/**
|
/**
|
||||||
This class represents the properties of a singleline conductor.
|
This class represents the properties of a singleline conductor.
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ ConfigDialog::ConfigDialog(QWidget *parent) : QDialog(parent) {
|
|||||||
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
|
connect(buttons, SIGNAL(rejected()), this, SLOT(reject()));
|
||||||
connect(pages_list, SIGNAL(currentRowChanged(int)), pages_widget, SLOT(setCurrentIndex(int)));
|
connect(pages_list, SIGNAL(currentRowChanged(int)), pages_widget, SLOT(setCurrentIndex(int)));
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
if (parent) {
|
if (parent) {
|
||||||
setWindowFlags(Qt::Sheet);
|
setWindowFlags(Qt::Sheet);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,10 +69,10 @@ NewDiagramPage::NewDiagramPage(QETProject *project, QWidget *parent) :
|
|||||||
diagram_layout -> addWidget(bpw);
|
diagram_layout -> addWidget(bpw);
|
||||||
diagram_layout -> addWidget(ipw);
|
diagram_layout -> addWidget(ipw);
|
||||||
|
|
||||||
tab_widget -> addTab (diagram_widget, tr("Sch\351ma"));
|
tab_widget -> addTab (diagram_widget, tr("Schéma"));
|
||||||
tab_widget -> addTab (cpw, tr("Conducteur"));
|
tab_widget -> addTab (cpw, tr("Conducteur"));
|
||||||
tab_widget -> addTab (rpw, tr("Reports de folio"));
|
tab_widget -> addTab (rpw, tr("Reports de folio"));
|
||||||
tab_widget -> addTab (xrefpw, tr("R\351f\351rences crois\351es"));
|
tab_widget -> addTab (xrefpw, tr("Références croisées"));
|
||||||
|
|
||||||
QVBoxLayout *vlayout1 = new QVBoxLayout();
|
QVBoxLayout *vlayout1 = new QVBoxLayout();
|
||||||
vlayout1->addWidget(tab_widget);
|
vlayout1->addWidget(tab_widget);
|
||||||
@@ -169,7 +169,7 @@ QIcon NewDiagramPage::icon() const {
|
|||||||
* @return title of this page
|
* @return title of this page
|
||||||
*/
|
*/
|
||||||
QString NewDiagramPage::title() const {
|
QString NewDiagramPage::title() const {
|
||||||
if (m_project) return(tr("Nouveau sch\351ma", "configuration page title"));
|
if (m_project) return(tr("Nouveau schéma", "configuration page title"));
|
||||||
return(tr("Nouveau projet", "configuration page title"));
|
return(tr("Nouveau projet", "configuration page title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -190,21 +190,21 @@ GeneralConfigurationPage::GeneralConfigurationPage(QWidget *parent) : ConfigPage
|
|||||||
QString default_element_informations = settings.value("elementeditor/default-informations", "").toString();
|
QString default_element_informations = settings.value("elementeditor/default-informations", "").toString();
|
||||||
|
|
||||||
appearance_ = new QGroupBox(tr("Apparence"), this);
|
appearance_ = new QGroupBox(tr("Apparence"), this);
|
||||||
use_system_colors_ = new QCheckBox(tr("Utiliser les couleurs du syst\350me"), appearance_);
|
use_system_colors_ = new QCheckBox(tr("Utiliser les couleurs du système"), appearance_);
|
||||||
|
|
||||||
projects_view_mode_ = new QGroupBox(tr("Projets"), this);
|
projects_view_mode_ = new QGroupBox(tr("Projets"), this);
|
||||||
windowed_mode_ = new QRadioButton(tr("Utiliser des fen\352tres"), projects_view_mode_);
|
windowed_mode_ = new QRadioButton(tr("Utiliser des fenêtres"), projects_view_mode_);
|
||||||
tabbed_mode_ = new QRadioButton(tr("Utiliser des onglets"), projects_view_mode_);
|
tabbed_mode_ = new QRadioButton(tr("Utiliser des onglets"), projects_view_mode_);
|
||||||
use_trackpad_ = new QCheckBox(tr("Utiliser les gestes du pav\351 tactile"), projects_view_mode_);
|
use_trackpad_ = new QCheckBox(tr("Utiliser les gestes du pavé tactile"), projects_view_mode_);
|
||||||
warning_view_mode_ = new QLabel(tr("Ces param\350tres s'appliqueront d\350s la prochaine ouverture d'un \351diteur de sch\351mas."));
|
warning_view_mode_ = new QLabel(tr("Ces paramètres s'appliqueront dès la prochaine ouverture d'un éditeur de schémas."));
|
||||||
|
|
||||||
elements_management_ = new QGroupBox(tr("Gestion des \351l\351ments"), this);
|
elements_management_ = new QGroupBox(tr("Gestion des éléments"), this);
|
||||||
integrate_elements_ = new QCheckBox(tr("Int\351grer automatiquement les \351l\351ments dans les projets (recommand\351)"));
|
integrate_elements_ = new QCheckBox(tr("Intégrer automatiquement les éléments dans les projets (recommandé)"));
|
||||||
highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les \351l\351ments fra\356chement int\351gr\351s", "configuration option"));
|
highlight_integrated_elements_ = new QCheckBox(tr("Mettre en valeur dans le panel les éléments fraîchement intégrés", "configuration option"));
|
||||||
default_element_infos_label_ = new QLabel(
|
default_element_infos_label_ = new QLabel(
|
||||||
tr(
|
tr(
|
||||||
"Chaque \351l\351ment embarque des informations sur ses auteurs, sa licence, ou tout autre renseignement que vous jugerez utile dans un champ libre. "
|
"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\351cifier ici la valeur par d\351faut de ce champ pour les \351l\351ments que vous cr\351erez :"
|
"Vous pouvez spécifier ici la valeur par défaut de ce champ pour les éléments que vous créerez :"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
default_element_infos_label_ -> setWordWrap(true);
|
default_element_infos_label_ -> setWordWrap(true);
|
||||||
@@ -306,7 +306,7 @@ QIcon GeneralConfigurationPage::icon() const {
|
|||||||
|
|
||||||
/// @return le titre de cette page
|
/// @return le titre de cette page
|
||||||
QString GeneralConfigurationPage::title() const {
|
QString GeneralConfigurationPage::title() const {
|
||||||
return(tr("G\351n\351ral", "configuration page title"));
|
return(tr("Général", "configuration page title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -314,25 +314,25 @@ QString GeneralConfigurationPage::title() const {
|
|||||||
* fill all available lang in @lang_combo_box
|
* fill all available lang in @lang_combo_box
|
||||||
*/
|
*/
|
||||||
void GeneralConfigurationPage::fillLang(QSettings &settings) {
|
void GeneralConfigurationPage::fillLang(QSettings &settings) {
|
||||||
lang_combo_box->addItem(QET::Icons::translation, tr("Syst\350me"), "system");
|
lang_combo_box->addItem(QET::Icons::translation, tr("Système"), "system");
|
||||||
lang_combo_box->insertSeparator(1);
|
lang_combo_box->insertSeparator(1);
|
||||||
|
|
||||||
// all lang available on lang directory
|
// all lang available on lang directory
|
||||||
lang_combo_box->addItem(QET::Icons::ar, tr("Arabe"), "ar");
|
lang_combo_box->addItem(QET::Icons::ar, tr("Arabe"), "ar");
|
||||||
lang_combo_box->addItem(QET::Icons::catalonia, tr("Catalan"), "ca");
|
lang_combo_box->addItem(QET::Icons::catalonia, tr("Catalan"), "ca");
|
||||||
lang_combo_box->addItem(QET::Icons::cs, tr("Tch\350que"), "cs");
|
lang_combo_box->addItem(QET::Icons::cs, tr("Tchèque"), "cs");
|
||||||
lang_combo_box->addItem(QET::Icons::de, tr("Allemand"), "de");
|
lang_combo_box->addItem(QET::Icons::de, tr("Allemand"), "de");
|
||||||
lang_combo_box->addItem(QET::Icons::gr, tr("Grec"), "el");
|
lang_combo_box->addItem(QET::Icons::gr, tr("Grec"), "el");
|
||||||
lang_combo_box->addItem(QET::Icons::en, tr("Anglais"), "en");
|
lang_combo_box->addItem(QET::Icons::en, tr("Anglais"), "en");
|
||||||
lang_combo_box->addItem(QET::Icons::es, tr("Espagnol"), "es");
|
lang_combo_box->addItem(QET::Icons::es, tr("Espagnol"), "es");
|
||||||
lang_combo_box->addItem(QET::Icons::fr, tr("Fran\347ais"), "fr");
|
lang_combo_box->addItem(QET::Icons::fr, tr("Français"), "fr");
|
||||||
lang_combo_box->addItem(QET::Icons::hr, tr("Croate"), "hr");
|
lang_combo_box->addItem(QET::Icons::hr, tr("Croate"), "hr");
|
||||||
lang_combo_box->addItem(QET::Icons::it, tr("Italien"), "it");
|
lang_combo_box->addItem(QET::Icons::it, tr("Italien"), "it");
|
||||||
lang_combo_box->addItem(QET::Icons::pl, tr("Polonais"), "pl");
|
lang_combo_box->addItem(QET::Icons::pl, tr("Polonais"), "pl");
|
||||||
lang_combo_box->addItem(QET::Icons::pt, tr("Portugais"), "pt");
|
lang_combo_box->addItem(QET::Icons::pt, tr("Portugais"), "pt");
|
||||||
lang_combo_box->addItem(QET::Icons::ro, tr("Roumains"), "ro");
|
lang_combo_box->addItem(QET::Icons::ro, tr("Roumains"), "ro");
|
||||||
lang_combo_box->addItem(QET::Icons::ru, tr("Russe"), "ru");
|
lang_combo_box->addItem(QET::Icons::ru, tr("Russe"), "ru");
|
||||||
lang_combo_box->addItem(QET::Icons::sl, tr("Slov\350ne"), "sl");
|
lang_combo_box->addItem(QET::Icons::sl, tr("Slovène"), "sl");
|
||||||
lang_combo_box->addItem(QET::Icons::nl, tr("Pays-Bas"), "nl");
|
lang_combo_box->addItem(QET::Icons::nl, tr("Pays-Bas"), "nl");
|
||||||
lang_combo_box->addItem(QET::Icons::be, tr("Belgique-Flemish"), "be");
|
lang_combo_box->addItem(QET::Icons::be, tr("Belgique-Flemish"), "be");
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef CONFIG_PAGES_H
|
#ifndef CONFIG_PAGES_H
|
||||||
#define CONFIG_PAGES_H
|
#define CONFIG_PAGES_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "configpage.h"
|
#include "configpage.h"
|
||||||
class BorderPropertiesWidget;
|
class BorderPropertiesWidget;
|
||||||
class ConductorPropertiesWidget;
|
class ConductorPropertiesWidget;
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#define CREATEDXF_H
|
#define CREATEDXF_H
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
|
|
||||||
|
|
||||||
/* This class exports the project to DXF Format */
|
/* This class exports the project to DXF Format */
|
||||||
|
|||||||
@@ -59,14 +59,16 @@ Diagram::Diagram(QETProject *project) :
|
|||||||
setProject(project);
|
setProject(project);
|
||||||
qgi_manager_ = new QGIManager(this);
|
qgi_manager_ = new QGIManager(this);
|
||||||
setBackgroundBrush(Qt::white);
|
setBackgroundBrush(Qt::white);
|
||||||
conductor_setter_ = new QGraphicsLineItem(0, 0);
|
conductor_setter_ = new QGraphicsLineItem(0);
|
||||||
conductor_setter_ -> setZValue(1000000);
|
conductor_setter_ -> setZValue(1000000);
|
||||||
QPen t;
|
// QPen t;
|
||||||
t.setColor(Qt::black);
|
// t.setColor(Qt::black);
|
||||||
t.setWidthF(1.5);
|
// t.setWidthF(1.5);
|
||||||
t.setStyle(Qt::DashLine);
|
// t.setStyle(Qt::DashLine);
|
||||||
conductor_setter_ -> setPen(t);
|
QPen pen(Qt::NoBrush, 1.5, Qt::DashLine);
|
||||||
conductor_setter_ -> setLine(QLineF(QPointF(0.0, 0.0), QPointF(0.0, 0.0)));
|
pen.setColor(Qt::black);
|
||||||
|
conductor_setter_ -> setPen(pen);
|
||||||
|
//conductor_setter_ -> setLine(QLineF(QPointF(0.0, 0.0), QPointF(0.0, 0.0)));
|
||||||
|
|
||||||
//Init object for manage movement
|
//Init object for manage movement
|
||||||
elements_mover_ = new ElementsMover();
|
elements_mover_ = new ElementsMover();
|
||||||
@@ -123,12 +125,13 @@ void Diagram::drawBackground(QPainter *p, const QRectF &r) {
|
|||||||
p -> drawRect(r);
|
p -> drawRect(r);
|
||||||
|
|
||||||
if (draw_grid_) {
|
if (draw_grid_) {
|
||||||
// dessine les points de la grille
|
//Draw the point of the grid
|
||||||
// if background color is black, then grid spots shall be white, else they shall be black in color.
|
// if background color is black, then grid spots shall be white, else they shall be black in color.
|
||||||
if (Diagram::background_color == Qt::black)
|
QPen pen;
|
||||||
p -> setPen(Qt::white);
|
Diagram::background_color == Qt::black? pen.setColor(Qt::white) : pen.setColor(Qt::black);
|
||||||
else
|
pen.setCosmetic(true);
|
||||||
p -> setPen(Qt::black);
|
p->setPen(pen);
|
||||||
|
|
||||||
p -> setBrush(Qt::NoBrush);
|
p -> setBrush(Qt::NoBrush);
|
||||||
qreal limite_x = r.x() + r.width();
|
qreal limite_x = r.x() + r.width();
|
||||||
qreal limite_y = r.y() + r.height();
|
qreal limite_y = r.y() + r.height();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef DIAGRAM_H
|
#ifndef DIAGRAM_H
|
||||||
#define DIAGRAM_H
|
#define DIAGRAM_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include <QtXml>
|
#include <QtXml>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include "bordertitleblock.h"
|
#include "bordertitleblock.h"
|
||||||
|
|||||||
@@ -316,7 +316,7 @@ MoveElementsCommand::MoveElementsCommand(
|
|||||||
setText(
|
setText(
|
||||||
QString(
|
QString(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"d\351placer %1",
|
"déplacer %1",
|
||||||
"undo caption - %1 is a sentence listing the moved content"
|
"undo caption - %1 is a sentence listing the moved content"
|
||||||
).arg(moved_content_sentence)
|
).arg(moved_content_sentence)
|
||||||
)
|
)
|
||||||
@@ -432,7 +432,7 @@ MoveElementsTextsCommand::MoveElementsTextsCommand(
|
|||||||
setText(
|
setText(
|
||||||
QString(
|
QString(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"d\351placer %1",
|
"déplacer %1",
|
||||||
"undo caption - %1 is a sentence listing the moved content"
|
"undo caption - %1 is a sentence listing the moved content"
|
||||||
).arg(moved_content_sentence)
|
).arg(moved_content_sentence)
|
||||||
)
|
)
|
||||||
@@ -546,7 +546,7 @@ void MoveConductorsTextsCommand::regenerateTextLabel() {
|
|||||||
setText(
|
setText(
|
||||||
QString(
|
QString(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"d\351placer %1",
|
"déplacer %1",
|
||||||
"undo caption - %1 is a sentence listing the moved content"
|
"undo caption - %1 is a sentence listing the moved content"
|
||||||
).arg(moved_content_sentence)
|
).arg(moved_content_sentence)
|
||||||
)
|
)
|
||||||
@@ -733,7 +733,7 @@ void RotateTextsCommand::defineCommandName() {
|
|||||||
setText(
|
setText(
|
||||||
QString(
|
QString(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"orienter %1 \340 %2\260",
|
"orienter %1 à %2°",
|
||||||
"undo caption - %1 looks like '42 texts', %2 is a rotation angle"
|
"undo caption - %1 looks like '42 texts', %2 is a rotation angle"
|
||||||
)
|
)
|
||||||
).arg(QET::ElementsAndConductorsSentence(0, 0, texts_to_rotate.count()))
|
).arg(QET::ElementsAndConductorsSentence(0, 0, texts_to_rotate.count()))
|
||||||
@@ -814,7 +814,7 @@ ResetConductorCommand::ResetConductorCommand(
|
|||||||
{
|
{
|
||||||
setText(
|
setText(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"R\351initialiser %1",
|
"Réinitialiser %1",
|
||||||
"undo caption - %1 is a sentence listing the reset content"
|
"undo caption - %1 is a sentence listing the reset content"
|
||||||
).arg(QET::ElementsAndConductorsSentence(0, cp.count()))
|
).arg(QET::ElementsAndConductorsSentence(0, cp.count()))
|
||||||
);
|
);
|
||||||
@@ -894,7 +894,7 @@ void ChangeTitleBlockCommand::redo() {
|
|||||||
@param parent QUndoCommand parent
|
@param parent QUndoCommand parent
|
||||||
*/
|
*/
|
||||||
ChangeBorderCommand::ChangeBorderCommand(Diagram *dia, const BorderProperties &old_bp, const BorderProperties &new_bp, QUndoCommand *parent) :
|
ChangeBorderCommand::ChangeBorderCommand(Diagram *dia, const BorderProperties &old_bp, const BorderProperties &new_bp, QUndoCommand *parent) :
|
||||||
QUndoCommand(QObject::tr("modifier les dimensions du sch\351ma", "undo caption"), parent),
|
QUndoCommand(QObject::tr("modifier les dimensions du schéma", "undo caption"), parent),
|
||||||
diagram(dia),
|
diagram(dia),
|
||||||
old_properties(old_bp),
|
old_properties(old_bp),
|
||||||
new_properties(new_bp)
|
new_properties(new_bp)
|
||||||
@@ -923,7 +923,7 @@ void ChangeBorderCommand::redo() {
|
|||||||
@param parent QUndoCommand parent
|
@param parent QUndoCommand parent
|
||||||
*/
|
*/
|
||||||
ChangeConductorPropertiesCommand::ChangeConductorPropertiesCommand(Conductor *c, QUndoCommand *parent) :
|
ChangeConductorPropertiesCommand::ChangeConductorPropertiesCommand(Conductor *c, QUndoCommand *parent) :
|
||||||
QUndoCommand(QObject::tr("modifier les propri\351t\351s d'un conducteur", "undo caption"), parent),
|
QUndoCommand(QObject::tr("modifier les propriétés d'un conducteur", "undo caption"), parent),
|
||||||
conductor(c),
|
conductor(c),
|
||||||
old_settings_set(false),
|
old_settings_set(false),
|
||||||
new_settings_set(false)
|
new_settings_set(false)
|
||||||
@@ -976,7 +976,7 @@ void ChangeConductorPropertiesCommand::redo() {
|
|||||||
@param parent QUndoCommand parent
|
@param parent QUndoCommand parent
|
||||||
*/
|
*/
|
||||||
ChangeSeveralConductorsPropertiesCommand::ChangeSeveralConductorsPropertiesCommand(QList<Conductor *>c, QUndoCommand *parent) :
|
ChangeSeveralConductorsPropertiesCommand::ChangeSeveralConductorsPropertiesCommand(QList<Conductor *>c, QUndoCommand *parent) :
|
||||||
QUndoCommand(QObject::tr("modifier les propri\351t\351s de plusieurs conducteurs", "undo caption"), parent),
|
QUndoCommand(QObject::tr("modifier les propriétés de plusieurs conducteurs", "undo caption"), parent),
|
||||||
conductors(c),
|
conductors(c),
|
||||||
old_settings_set(false),
|
old_settings_set(false),
|
||||||
new_settings_set(false)
|
new_settings_set(false)
|
||||||
@@ -1091,8 +1091,8 @@ void ItemResizerCommand::undo() {
|
|||||||
*/
|
*/
|
||||||
void ItemResizerCommand::redo() {
|
void ItemResizerCommand::redo() {
|
||||||
diagram -> showMe();
|
diagram -> showMe();
|
||||||
if (old_size<new_size) setText(QObject::tr("Agrandire %1 \340 %2 %").arg(m_text).arg(new_size*100));
|
if (old_size<new_size) setText(QObject::tr("Agrandire %1 à %2 %").arg(m_text).arg(new_size*100));
|
||||||
else setText(QObject::tr("R\351duire %1 \340 %2 %").arg(m_text).arg(new_size*100));
|
else setText(QObject::tr("Réduire %1 à %2 %").arg(m_text).arg(new_size*100));
|
||||||
m_qgi -> setScale(new_size);
|
m_qgi -> setScale(new_size);
|
||||||
QUndoCommand::redo();
|
QUndoCommand::redo();
|
||||||
}
|
}
|
||||||
@@ -1158,7 +1158,7 @@ LinkElementsCommand::LinkElementsCommand(Element *elmt1, Element *elmt2, QUndoCo
|
|||||||
"title for undo LinkElementsCommand if two elements are folio report"));
|
"title for undo LinkElementsCommand if two elements are folio report"));
|
||||||
}
|
}
|
||||||
else if (element_->linkType() & (Element::Master|Element::Slave))
|
else if (element_->linkType() & (Element::Master|Element::Slave))
|
||||||
setText(QObject::tr("Editer les r\351f\351rence crois\351", "edite the cross reference"));
|
setText(QObject::tr("Editer les référence croisé", "edite the cross reference"));
|
||||||
else setText(QObject::tr("Lier deux éléments"));
|
else setText(QObject::tr("Lier deux éléments"));
|
||||||
|
|
||||||
previous_linked = elmt1->linkedElements();
|
previous_linked = elmt1->linkedElements();
|
||||||
@@ -1172,7 +1172,7 @@ LinkElementsCommand::LinkElementsCommand(Element *elmt1, QList<Element *> &elmtL
|
|||||||
first_redo(true)
|
first_redo(true)
|
||||||
{
|
{
|
||||||
if (element_->linkType() & (Element::Master|Element::Slave))
|
if (element_->linkType() & (Element::Master|Element::Slave))
|
||||||
setText(QObject::tr("Editer les r\351f\351rence crois\351"));
|
setText(QObject::tr("Editer les référence croisé"));
|
||||||
else setText(QObject::tr("Lier deux éléments"));
|
else setText(QObject::tr("Lier deux éléments"));
|
||||||
previous_linked = elmt1->linkedElements();
|
previous_linked = elmt1->linkedElements();
|
||||||
}
|
}
|
||||||
@@ -1233,7 +1233,7 @@ unlinkElementsCommand::unlinkElementsCommand(Element *elmt1, Element *elmt2, QUn
|
|||||||
{
|
{
|
||||||
if (elmt2) elmt_list << elmt2;
|
if (elmt2) elmt_list << elmt2;
|
||||||
else elmt_list << elmt1->linkedElements();
|
else elmt_list << elmt1->linkedElements();
|
||||||
setText(QObject::tr("D\351lier %n \351l\351ment(s)", "", elmt_list.size()));
|
setText(QObject::tr("Délier %n élément(s)", "", elmt_list.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1248,7 +1248,7 @@ unlinkElementsCommand::unlinkElementsCommand(Element *elmt1, QList<Element *> &e
|
|||||||
element_(elmt1),
|
element_(elmt1),
|
||||||
elmt_list(elmtList)
|
elmt_list(elmtList)
|
||||||
{
|
{
|
||||||
setText(QObject::tr("D\351lier %n \351l\351ment(s)", "", elmt_list.size()));
|
setText(QObject::tr("Délier %n élément(s)", "", elmt_list.size()));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef DIAGRAM_COMMANDS_H
|
#ifndef DIAGRAM_COMMANDS_H
|
||||||
#define DIAGRAM_COMMANDS_H
|
#define DIAGRAM_COMMANDS_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "borderproperties.h"
|
#include "borderproperties.h"
|
||||||
#include "qetgraphicsitem/conductor.h"
|
#include "qetgraphicsitem/conductor.h"
|
||||||
#include "conductorproperties.h"
|
#include "conductorproperties.h"
|
||||||
|
|||||||
@@ -24,6 +24,9 @@
|
|||||||
#include "qeticons.h"
|
#include "qeticons.h"
|
||||||
#include "qetmessagebox.h"
|
#include "qetmessagebox.h"
|
||||||
|
|
||||||
|
#include <QPrinter>
|
||||||
|
#include <QPrintDialog>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur
|
Constructeur
|
||||||
@param project Schema a imprimer
|
@param project Schema a imprimer
|
||||||
@@ -119,24 +122,31 @@ void DiagramPrintDialog::exec() {
|
|||||||
if (printer_choice_ -> isChecked()) {
|
if (printer_choice_ -> isChecked()) {
|
||||||
// affichage du dialogue d'impression standard pour parametrer l'imprimante
|
// affichage du dialogue d'impression standard pour parametrer l'imprimante
|
||||||
QPrintDialog print_dialog(printer_, parentWidget());
|
QPrintDialog print_dialog(printer_, parentWidget());
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
print_dialog.setWindowFlags(Qt::Sheet);
|
print_dialog.setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
print_dialog.setWindowTitle(tr("Options d'impression", "window title"));
|
print_dialog.setWindowTitle(tr("Options d'impression", "window title"));
|
||||||
print_dialog.setEnabledOptions(QAbstractPrintDialog::PrintShowPageSize);
|
print_dialog.setEnabledOptions(QAbstractPrintDialog::PrintShowPageSize);
|
||||||
if (print_dialog.exec() == QDialog::Rejected) return;
|
if (print_dialog.exec() == QDialog::Rejected) return;
|
||||||
} else if (pdf_choice_ -> isChecked()) {
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
printer_ -> setOutputFormat(QPrinter::PdfFormat);
|
printer_ -> setOutputFormat(QPrinter::PdfFormat);
|
||||||
printer_ -> setOutputFileName(filepath_field_ -> text());
|
printer_ -> setOutputFileName(filepath_field_ -> text());
|
||||||
} else {
|
|
||||||
printer_ -> setOutputFormat(QPrinter::PostScriptFormat);
|
|
||||||
printer_ -> setOutputFileName(filepath_field_ -> text());
|
|
||||||
}
|
}
|
||||||
|
//@TODO remove code below
|
||||||
|
//post script isn't suported anymore in Qt5
|
||||||
|
// else
|
||||||
|
// {
|
||||||
|
// printer_ -> setOutputFormat(QPrinter::PostScriptFormat);
|
||||||
|
// printer_ -> setOutputFileName(filepath_field_ -> text());
|
||||||
|
// }
|
||||||
loadPageSetupForCurrentPrinter();
|
loadPageSetupForCurrentPrinter();
|
||||||
|
|
||||||
// Apercu avant impression
|
//Preview before print
|
||||||
#if defined Q_WS_X11
|
#if defined Q_OS_LINUX
|
||||||
// suite a quelques soucis avec xfwm, on se contente d'une fenetre sous X11
|
//Due to some bug with xfwm, we display this dialog has a windows on linux os (X11)
|
||||||
|
//@TODO see if we must this line with graphic server wayland
|
||||||
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget(), Qt::Window);
|
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget(), Qt::Window);
|
||||||
#else
|
#else
|
||||||
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget());
|
QETPrintPreviewDialog preview_dialog(project_, printer_, parentWidget());
|
||||||
@@ -211,18 +221,18 @@ int DiagramPrintDialog::verticalPagesCount(Diagram *diagram, const ExportPropert
|
|||||||
void DiagramPrintDialog::buildPrintTypeDialog() {
|
void DiagramPrintDialog::buildPrintTypeDialog() {
|
||||||
// initialisation des widgets
|
// initialisation des widgets
|
||||||
dialog_ = new QDialog(parentWidget());
|
dialog_ = new QDialog(parentWidget());
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
dialog_ -> setWindowFlags(Qt::Sheet);
|
dialog_ -> setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
printtype_label_ = new QLabel(tr("Quel type d'impression d\351sirez-vous effectuer ?"));
|
printtype_label_ = new QLabel(tr("Quel type d'impression désirez-vous effectuer ?"));
|
||||||
printer_icon_ = new QLabel();
|
printer_icon_ = new QLabel();
|
||||||
pdf_icon_ = new QLabel();
|
pdf_icon_ = new QLabel();
|
||||||
ps_icon_ = new QLabel();
|
// ps_icon_ = new QLabel();
|
||||||
printtype_choice_ = new QButtonGroup();
|
printtype_choice_ = new QButtonGroup();
|
||||||
printer_choice_ = new QRadioButton(tr("Impression sur une imprimante physique", "Print type choice"));
|
printer_choice_ = new QRadioButton(tr("Impression sur une imprimante physique", "Print type choice"));
|
||||||
pdf_choice_ = new QRadioButton(tr("Impression vers un fichier au format PDF", "Print type choice"));
|
pdf_choice_ = new QRadioButton(tr("Impression vers un fichier au format PDF", "Print type choice"));
|
||||||
ps_choice_ = new QRadioButton(tr("Impression vers un fichier au format PostScript (PS)", "Print type choice"));
|
// ps_choice_ = new QRadioButton(tr("Impression vers un fichier au format PostScript (PS)", "Print type choice"));
|
||||||
filepath_field_ = new QLineEdit();
|
filepath_field_ = new QLineEdit();
|
||||||
browse_button_ = new QPushButton("...");
|
browse_button_ = new QPushButton("...");
|
||||||
buttons_ = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
buttons_ = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
@@ -230,17 +240,17 @@ void DiagramPrintDialog::buildPrintTypeDialog() {
|
|||||||
dialog_ -> setWindowTitle(tr("Choix du type d'impression"));
|
dialog_ -> setWindowTitle(tr("Choix du type d'impression"));
|
||||||
printer_icon_ -> setPixmap(QET::Icons::Printer.pixmap(32, 32));
|
printer_icon_ -> setPixmap(QET::Icons::Printer.pixmap(32, 32));
|
||||||
pdf_icon_ -> setPixmap(QET::Icons::PDF.pixmap(32, 32));
|
pdf_icon_ -> setPixmap(QET::Icons::PDF.pixmap(32, 32));
|
||||||
ps_icon_ -> setPixmap(QET::Icons::EPS.pixmap(32, 32));
|
// ps_icon_ -> setPixmap(QET::Icons::EPS.pixmap(32, 32));
|
||||||
printtype_choice_ -> addButton(printer_choice_);
|
printtype_choice_ -> addButton(printer_choice_);
|
||||||
printtype_choice_ -> addButton(pdf_choice_);
|
printtype_choice_ -> addButton(pdf_choice_);
|
||||||
printtype_choice_ -> addButton(ps_choice_);
|
// printtype_choice_ -> addButton(ps_choice_);
|
||||||
printer_choice_ -> setChecked(true);
|
printer_choice_ -> setChecked(true);
|
||||||
if (!file_name_.isEmpty()) filepath_field_ -> setText(file_name_ + ".pdf");
|
if (!file_name_.isEmpty()) filepath_field_ -> setText(file_name_ + ".pdf");
|
||||||
|
|
||||||
// connexions signaux / slots
|
// connexions signaux / slots
|
||||||
connect(printer_choice_, SIGNAL(toggled(bool)), this, SLOT(updatePrintTypeDialog()));
|
connect(printer_choice_, SIGNAL(toggled(bool)), this, SLOT(updatePrintTypeDialog()));
|
||||||
connect(pdf_choice_, SIGNAL(toggled(bool)), this, SLOT(updatePrintTypeDialog()));
|
connect(pdf_choice_, SIGNAL(toggled(bool)), this, SLOT(updatePrintTypeDialog()));
|
||||||
connect(ps_choice_, SIGNAL(toggled(bool)), this, SLOT(updatePrintTypeDialog()));
|
// connect(ps_choice_, SIGNAL(toggled(bool)), this, SLOT(updatePrintTypeDialog()));
|
||||||
connect(browse_button_, SIGNAL(clicked(bool)), this, SLOT(browseFilePrintTypeDialog()));
|
connect(browse_button_, SIGNAL(clicked(bool)), this, SLOT(browseFilePrintTypeDialog()));
|
||||||
connect(buttons_, SIGNAL(accepted()), this, SLOT(acceptPrintTypeDialog()));
|
connect(buttons_, SIGNAL(accepted()), this, SLOT(acceptPrintTypeDialog()));
|
||||||
connect(buttons_, SIGNAL(rejected()), dialog_, SLOT(reject()));
|
connect(buttons_, SIGNAL(rejected()), dialog_, SLOT(reject()));
|
||||||
@@ -256,8 +266,8 @@ void DiagramPrintDialog::buildPrintTypeDialog() {
|
|||||||
glayout0_ -> addWidget(printer_choice_, 0, 1);
|
glayout0_ -> addWidget(printer_choice_, 0, 1);
|
||||||
glayout0_ -> addWidget(pdf_icon_, 1, 0);
|
glayout0_ -> addWidget(pdf_icon_, 1, 0);
|
||||||
glayout0_ -> addWidget(pdf_choice_, 1, 1);
|
glayout0_ -> addWidget(pdf_choice_, 1, 1);
|
||||||
glayout0_ -> addWidget(ps_icon_, 2, 0);
|
// glayout0_ -> addWidget(ps_icon_, 2, 0);
|
||||||
glayout0_ -> addWidget(ps_choice_, 2, 1);
|
// glayout0_ -> addWidget(ps_choice_, 2, 1);
|
||||||
glayout0_ -> addLayout(hlayout0_, 3, 1);
|
glayout0_ -> addLayout(hlayout0_, 3, 1);
|
||||||
|
|
||||||
vlayout0_ -> addWidget(printtype_label_);
|
vlayout0_ -> addWidget(printtype_label_);
|
||||||
@@ -281,18 +291,23 @@ void DiagramPrintDialog::updatePrintTypeDialog() {
|
|||||||
browse_button_ -> setEnabled(file_print);
|
browse_button_ -> setEnabled(file_print);
|
||||||
|
|
||||||
// on corrige eventuellement l'extension du fichier deja selectionne
|
// on corrige eventuellement l'extension du fichier deja selectionne
|
||||||
if (file_print) {
|
if (file_print)
|
||||||
|
{
|
||||||
QString filepath = filepath_field_ -> text();
|
QString filepath = filepath_field_ -> text();
|
||||||
if (!filepath.isEmpty()) {
|
if (!filepath.isEmpty())
|
||||||
if (pdf_choice_ -> isChecked() && filepath.endsWith(".ps")) {
|
{
|
||||||
|
if (pdf_choice_ -> isChecked() && filepath.endsWith(".ps"))
|
||||||
|
{
|
||||||
QRegExp re("\\.ps$", Qt::CaseInsensitive);
|
QRegExp re("\\.ps$", Qt::CaseInsensitive);
|
||||||
filepath.replace(re, ".pdf");
|
filepath.replace(re, ".pdf");
|
||||||
filepath_field_ -> setText(filepath);
|
filepath_field_ -> setText(filepath);
|
||||||
} else if (ps_choice_ -> isChecked() && filepath.endsWith(".pdf")) {
|
|
||||||
QRegExp re("\\.pdf$", Qt::CaseInsensitive);
|
|
||||||
filepath.replace(re, ".ps");
|
|
||||||
filepath_field_ -> setText(filepath);
|
|
||||||
}
|
}
|
||||||
|
// else if (ps_choice_ -> isChecked() && filepath.endsWith(".pdf"))
|
||||||
|
// {
|
||||||
|
// QRegExp re("\\.pdf$", Qt::CaseInsensitive);
|
||||||
|
// filepath.replace(re, ".ps");
|
||||||
|
// filepath_field_ -> setText(filepath);
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -306,10 +321,10 @@ void DiagramPrintDialog::acceptPrintTypeDialog() {
|
|||||||
if (file_print) {
|
if (file_print) {
|
||||||
// un fichier doit avoir ete entre
|
// un fichier doit avoir ete entre
|
||||||
if (filepath_field_ -> text().isEmpty()) {
|
if (filepath_field_ -> text().isEmpty()) {
|
||||||
QET::MessageBox::information(
|
QET::QetMessageBox::information(
|
||||||
parentWidget(),
|
parentWidget(),
|
||||||
tr("Fichier manquant", "message box title"),
|
tr("Fichier manquant", "message box title"),
|
||||||
tr("Vous devez indiquer le chemin du fichier PDF/PS \340 cr\351er.", "message box content")
|
tr("Vous devez indiquer le chemin du fichier PDF/PS à créer.", "message box content")
|
||||||
);
|
);
|
||||||
} else dialog_ -> accept();
|
} else dialog_ -> accept();
|
||||||
} else {
|
} else {
|
||||||
@@ -326,14 +341,16 @@ void DiagramPrintDialog::browseFilePrintTypeDialog() {
|
|||||||
QString extension;
|
QString extension;
|
||||||
QString filter;
|
QString filter;
|
||||||
if (printer_choice_ -> isChecked()) return;
|
if (printer_choice_ -> isChecked()) return;
|
||||||
else if (pdf_choice_ -> isChecked()) {
|
else if (pdf_choice_ -> isChecked())
|
||||||
|
{
|
||||||
extension = ".pdf";
|
extension = ".pdf";
|
||||||
filter = tr("Fichiers PDF (*.pdf)", "file filter");
|
filter = tr("Fichiers PDF (*.pdf)", "file filter");
|
||||||
}
|
}
|
||||||
else if (ps_choice_ -> isChecked()) {
|
// else if (ps_choice_ -> isChecked())
|
||||||
extension = ".ps";
|
// {
|
||||||
filter = tr("Fichiers PostScript (*.ps)", "file filter");
|
// extension = ".ps";
|
||||||
}
|
// filter = tr("Fichiers PostScript (*.ps)", "file filter");
|
||||||
|
// }
|
||||||
|
|
||||||
QString filepath = QFileDialog::getSaveFileName(
|
QString filepath = QFileDialog::getSaveFileName(
|
||||||
parentWidget(),
|
parentWidget(),
|
||||||
@@ -609,8 +626,10 @@ QString DiagramPrintDialog::settingsSectionName(const QPrinter *printer) {
|
|||||||
return(printer -> printerName().replace(" ", "_"));
|
return(printer -> printerName().replace(" ", "_"));
|
||||||
} else if (printer_format == QPrinter::PdfFormat) {
|
} else if (printer_format == QPrinter::PdfFormat) {
|
||||||
return("QET_PDF_Printing");
|
return("QET_PDF_Printing");
|
||||||
} else if (printer_format == QPrinter::PostScriptFormat) {
|
|
||||||
return("QET_PS_Printing");
|
|
||||||
}
|
}
|
||||||
|
//@TODO remove code below
|
||||||
|
// else if (printer_format == QPrinter::PostScriptFormat) {
|
||||||
|
// return("QET_PS_Printing");
|
||||||
|
// }
|
||||||
return(QString());
|
return(QString());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,15 +17,22 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef DIAGRAM_PRINT_DIALOG_H
|
#ifndef DIAGRAM_PRINT_DIALOG_H
|
||||||
#define DIAGRAM_PRINT_DIALOG_H
|
#define DIAGRAM_PRINT_DIALOG_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
|
|
||||||
#include "qetproject.h"
|
#include "qetproject.h"
|
||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include "exportproperties.h"
|
#include "exportproperties.h"
|
||||||
|
|
||||||
|
class QPrinter;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
This class implements both the dialog allowing users to configure the printing
|
This class implements both the dialog allowing users to configure the printing
|
||||||
of a project file and the printing itself.
|
of a project file and the printing itself.
|
||||||
*/
|
*/
|
||||||
class DiagramPrintDialog : public QWidget {
|
class DiagramPrintDialog : public QWidget
|
||||||
|
{
|
||||||
|
//@TODO Remove definitely the commented lines in this class related to post script
|
||||||
|
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
// Constructors, destructor
|
// Constructors, destructor
|
||||||
public:
|
public:
|
||||||
@@ -75,11 +82,11 @@ class DiagramPrintDialog : public QWidget {
|
|||||||
QHBoxLayout *hlayout0_;
|
QHBoxLayout *hlayout0_;
|
||||||
QLabel *printer_icon_;
|
QLabel *printer_icon_;
|
||||||
QLabel *pdf_icon_;
|
QLabel *pdf_icon_;
|
||||||
QLabel *ps_icon_;
|
// QLabel *ps_icon_;
|
||||||
QButtonGroup *printtype_choice_;
|
QButtonGroup *printtype_choice_;
|
||||||
QRadioButton *printer_choice_;
|
QRadioButton *printer_choice_;
|
||||||
QRadioButton *pdf_choice_;
|
QRadioButton *pdf_choice_;
|
||||||
QRadioButton *ps_choice_;
|
// QRadioButton *ps_choice_;
|
||||||
QLineEdit *filepath_field_;
|
QLineEdit *filepath_field_;
|
||||||
QPushButton *browse_button_;
|
QPushButton *browse_button_;
|
||||||
QDialogButtonBox *buttons_;
|
QDialogButtonBox *buttons_;
|
||||||
|
|||||||
@@ -162,7 +162,7 @@ void DiagramsChooser::updateList() {
|
|||||||
foreach(Diagram *diagram, project_ -> diagrams()) {
|
foreach(Diagram *diagram, project_ -> diagrams()) {
|
||||||
// titre du schema
|
// titre du schema
|
||||||
QString diagram_title = diagram -> title();
|
QString diagram_title = diagram -> title();
|
||||||
if (diagram_title.isEmpty()) diagram_title = tr("Sch\351ma sans titre");
|
if (diagram_title.isEmpty()) diagram_title = tr("Schéma sans titre");
|
||||||
|
|
||||||
QCheckBox *checkbox = new QCheckBox(diagram_title);
|
QCheckBox *checkbox = new QCheckBox(diagram_title);
|
||||||
checkbox -> setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum));
|
checkbox -> setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum));
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef DIAGRAMS_CHOOSER_H
|
#ifndef DIAGRAMS_CHOOSER_H
|
||||||
#define DIAGRAMS_CHOOSER_H
|
#define DIAGRAMS_CHOOSER_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
class QETProject;
|
class QETProject;
|
||||||
class Diagram;
|
class Diagram;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -58,9 +58,9 @@ DiagramView::DiagramView(Diagram *diagram, QWidget *parent) :
|
|||||||
setInteractive(true);
|
setInteractive(true);
|
||||||
|
|
||||||
QString whatsthis = tr(
|
QString whatsthis = tr(
|
||||||
"Ceci est la zone dans laquelle vous concevez vos sch\351mas en y ajoutant"
|
"Ceci est la zone dans laquelle vous concevez vos schémas en y ajoutant"
|
||||||
" des \351l\351ments et en posant des conducteurs entre leurs bornes. Il est"
|
" des éléments et en posant des conducteurs entre leurs bornes. Il est"
|
||||||
" \351galement possible d'ajouter des textes ind\351pendants.",
|
" également possible d'ajouter des textes indépendants.",
|
||||||
"\"What's this?\" tip"
|
"\"What's this?\" tip"
|
||||||
);
|
);
|
||||||
setWhatsThis(whatsthis);
|
setWhatsThis(whatsthis);
|
||||||
@@ -194,10 +194,10 @@ void DiagramView::rotateTexts() {
|
|||||||
// demande un angle a l'utilisateur
|
// demande un angle a l'utilisateur
|
||||||
QDialog ori_text_dialog(diagramEditor());
|
QDialog ori_text_dialog(diagramEditor());
|
||||||
ori_text_dialog.setSizeGripEnabled(false);
|
ori_text_dialog.setSizeGripEnabled(false);
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
ori_text_dialog.setWindowFlags(Qt::Sheet);
|
ori_text_dialog.setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
ori_text_dialog.setWindowTitle(tr("Orienter les textes s\351lectionn\351s", "window title"));
|
ori_text_dialog.setWindowTitle(tr("Orienter les textes sélectionnés", "window title"));
|
||||||
// ori_text_dialog.setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
// ori_text_dialog.setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
|
||||||
|
|
||||||
|
|
||||||
@@ -911,12 +911,12 @@ void DiagramView::editSelectionProperties() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
QET::MessageBox::information(
|
QET::QetMessageBox::information(
|
||||||
this,
|
this,
|
||||||
tr("Propri\351t\351s de la s\351lection"),
|
tr("Propriétés de la sélection"),
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"La s\351lection contient %1.",
|
"La sélection contient %1.",
|
||||||
"%1 is a sentence listing the selected objects"
|
"%1 is a sentence listing the selected objects"
|
||||||
)
|
)
|
||||||
).arg(selection.sentence(DiagramContent::All | DiagramContent::SelectedOnly))
|
).arg(selection.sentence(DiagramContent::All | DiagramContent::SelectedOnly))
|
||||||
@@ -952,7 +952,7 @@ void DiagramView::editConductorColor(Conductor *edited_conductor) {
|
|||||||
// prepare a color dialog showing the initial conductor color
|
// prepare a color dialog showing the initial conductor color
|
||||||
QColorDialog *color_dialog = new QColorDialog(this);
|
QColorDialog *color_dialog = new QColorDialog(this);
|
||||||
color_dialog -> setWindowTitle(tr("Choisir la nouvelle couleur de ce conducteur"));
|
color_dialog -> setWindowTitle(tr("Choisir la nouvelle couleur de ce conducteur"));
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
color_dialog -> setWindowFlags(Qt::Sheet);
|
color_dialog -> setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
color_dialog -> setCurrentColor(initial_properties.color);
|
color_dialog -> setCurrentColor(initial_properties.color);
|
||||||
@@ -1105,9 +1105,9 @@ void DiagramView::editSelection() {
|
|||||||
* @brief DiagramView::setEventInterface
|
* @brief DiagramView::setEventInterface
|
||||||
* Set an event interface to diagram view.
|
* Set an event interface to diagram view.
|
||||||
*/
|
*/
|
||||||
void DiagramView::setEventInterface(DVEventInterface *interface) {
|
void DiagramView::setEventInterface(DVEventInterface *event_interface) {
|
||||||
if (m_event_interface) delete m_event_interface;
|
if (m_event_interface) delete m_event_interface;
|
||||||
m_event_interface = interface;
|
m_event_interface = event_interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1115,7 +1115,7 @@ void DiagramView::setEventInterface(DVEventInterface *interface) {
|
|||||||
@param e Evenement decrivant la demande de menu contextuel
|
@param e Evenement decrivant la demande de menu contextuel
|
||||||
*/
|
*/
|
||||||
void DiagramView::contextMenuEvent(QContextMenuEvent *e) {
|
void DiagramView::contextMenuEvent(QContextMenuEvent *e) {
|
||||||
if (QGraphicsItem *qgi = scene -> itemAt(mapToScene(e -> pos()))) {
|
if (QGraphicsItem *qgi = scene -> itemAt(mapToScene(e -> pos()), transform())) {
|
||||||
if (!qgi -> isSelected()) scene -> clearSelection();
|
if (!qgi -> isSelected()) scene -> clearSelection();
|
||||||
qgi -> setSelected(true);
|
qgi -> setSelected(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef DIAGRAMVIEW_H
|
#ifndef DIAGRAMVIEW_H
|
||||||
#define DIAGRAMVIEW_H
|
#define DIAGRAMVIEW_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include "templatelocation.h"
|
#include "templatelocation.h"
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ class DiagramView : public QGraphicsView {
|
|||||||
bool hasCopiableItems();
|
bool hasCopiableItems();
|
||||||
bool hasDeletableItems();
|
bool hasDeletableItems();
|
||||||
void editSelection();
|
void editSelection();
|
||||||
void setEventInterface (DVEventInterface *interface);
|
void setEventInterface (DVEventInterface *event_interface);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual void mouseDoubleClickEvent(QMouseEvent *);
|
virtual void mouseDoubleClickEvent(QMouseEvent *);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "diagramview.h"
|
#include "diagramview.h"
|
||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief DVEventAddImage::DVEventAddImage
|
* @brief DVEventAddImage::DVEventAddImage
|
||||||
@@ -142,7 +143,7 @@ void DVEventAddImage::openDialog() {
|
|||||||
if (m_diagram -> isReadOnly()) return;
|
if (m_diagram -> isReadOnly()) return;
|
||||||
|
|
||||||
//Open dialog for select image
|
//Open dialog for select image
|
||||||
QString pathPictures = QDesktopServices::storageLocation ( QDesktopServices::PicturesLocation );
|
QString pathPictures = QStandardPaths::writableLocation(QStandardPaths::PicturesLocation);
|
||||||
QString fileName = QFileDialog::getOpenFileName(m_dv, QObject::tr("Selectionner une image..."), pathPictures, QObject::tr("Image Files (*.png *.jpg *.bmp *.svg)"));
|
QString fileName = QFileDialog::getOpenFileName(m_dv, QObject::tr("Selectionner une image..."), pathPictures, QObject::tr("Image Files (*.png *.jpg *.bmp *.svg)"));
|
||||||
|
|
||||||
if (fileName.isEmpty()) return;
|
if (fileName.isEmpty()) return;
|
||||||
|
|||||||
@@ -194,17 +194,17 @@ void DVEventAddShape::updateHelpCross(const QPoint &p)
|
|||||||
if (!m_help_horiz)
|
if (!m_help_horiz)
|
||||||
{
|
{
|
||||||
m_help_horiz = new QGraphicsLineItem(m_diagram -> border_and_titleblock.rowsHeaderWidth() + 5, 0,
|
m_help_horiz = new QGraphicsLineItem(m_diagram -> border_and_titleblock.rowsHeaderWidth() + 5, 0,
|
||||||
m_diagram -> border_and_titleblock.diagramWidth() + 5, 0,
|
m_diagram -> border_and_titleblock.diagramWidth() + 5, 0);
|
||||||
0, m_diagram);
|
|
||||||
m_help_horiz->setPen(pen);
|
m_help_horiz->setPen(pen);
|
||||||
|
m_diagram -> addItem(m_help_horiz);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_help_verti)
|
if (!m_help_verti)
|
||||||
{
|
{
|
||||||
m_help_verti = new QGraphicsLineItem(0, m_diagram -> border_and_titleblock.columnsHeaderHeight() + 5,
|
m_help_verti = new QGraphicsLineItem(0, m_diagram -> border_and_titleblock.columnsHeaderHeight() + 5,
|
||||||
0, m_diagram -> border_and_titleblock.diagramHeight() + 5,
|
0, m_diagram -> border_and_titleblock.diagramHeight() + 5);
|
||||||
0, m_diagram);
|
|
||||||
m_help_verti->setPen(pen);
|
m_help_verti->setPen(pen);
|
||||||
|
m_diagram -> addItem(m_help_verti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -52,12 +52,12 @@ ArcEditor::ArcEditor(QETElementEditor *editor, PartArc *arc, QWidget *parent) :
|
|||||||
grid -> addWidget(x, 1, 1);
|
grid -> addWidget(x, 1, 1);
|
||||||
grid -> addWidget(new QLabel("y"), 1, 2);
|
grid -> addWidget(new QLabel("y"), 1, 2);
|
||||||
grid -> addWidget(y, 1, 3);
|
grid -> addWidget(y, 1, 3);
|
||||||
grid -> addWidget(new QLabel(tr("Diam\350tres : ")), 2, 0);
|
grid -> addWidget(new QLabel(tr("Diamètres : ")), 2, 0);
|
||||||
grid -> addWidget(new QLabel(tr("horizontal :")), 3, 0);
|
grid -> addWidget(new QLabel(tr("horizontal :")), 3, 0);
|
||||||
grid -> addWidget(h, 3, 1);
|
grid -> addWidget(h, 3, 1);
|
||||||
grid -> addWidget(new QLabel(tr("vertical :")), 4, 0);
|
grid -> addWidget(new QLabel(tr("vertical :")), 4, 0);
|
||||||
grid -> addWidget(v, 4, 1);
|
grid -> addWidget(v, 4, 1);
|
||||||
grid -> addWidget(new QLabel(tr("Angle de d\351part :")), 5, 0);
|
grid -> addWidget(new QLabel(tr("Angle de départ :")), 5, 0);
|
||||||
grid -> addWidget(start_angle, 5, 1);
|
grid -> addWidget(start_angle, 5, 1);
|
||||||
grid -> addWidget(new QLabel(tr("Angle :")), 6, 0);
|
grid -> addWidget(new QLabel(tr("Angle :")), 6, 0);
|
||||||
grid -> addWidget(angle, 6, 1);
|
grid -> addWidget(angle, 6, 1);
|
||||||
@@ -121,13 +121,13 @@ void ArcEditor::updateArc() {
|
|||||||
/// Met a jour l'abscisse du centre de l'arc et cree un objet d'annulation
|
/// Met a jour l'abscisse du centre de l'arc et cree un objet d'annulation
|
||||||
void ArcEditor::updateArcX() { addChangePartCommand(tr("abscisse"), part, "centerX", x -> value()); }
|
void ArcEditor::updateArcX() { addChangePartCommand(tr("abscisse"), part, "centerX", x -> value()); }
|
||||||
/// Met a jour l'ordonnee du centre de l'arc et cree un objet d'annulation
|
/// Met a jour l'ordonnee du centre de l'arc et cree un objet d'annulation
|
||||||
void ArcEditor::updateArcY() { addChangePartCommand(tr("ordonn\351e"), part, "centerY", y -> value()); }
|
void ArcEditor::updateArcY() { addChangePartCommand(tr("ordonnée"), part, "centerY", y -> value()); }
|
||||||
/// Met a jour le diametre horizontal de l'arc et cree un objet d'annulation
|
/// Met a jour le diametre horizontal de l'arc et cree un objet d'annulation
|
||||||
void ArcEditor::updateArcH() { addChangePartCommand(tr("diam\350tre horizontal"), part, "diameter_h", h -> value()); }
|
void ArcEditor::updateArcH() { addChangePartCommand(tr("diamètre horizontal"), part, "diameter_h", h -> value()); }
|
||||||
/// Met a jour le diametre vertical de l'arc et cree un objet d'annulation
|
/// Met a jour le diametre vertical de l'arc et cree un objet d'annulation
|
||||||
void ArcEditor::updateArcV() { addChangePartCommand(tr("diam\350tre vertical"), part, "diameter_v", v -> value()); }
|
void ArcEditor::updateArcV() { addChangePartCommand(tr("diamètre vertical"), part, "diameter_v", v -> value()); }
|
||||||
/// Met a jour l'angle de depart de l'arc et cree un objet d'annulation
|
/// Met a jour l'angle de depart de l'arc et cree un objet d'annulation
|
||||||
void ArcEditor::updateArcS() { addChangePartCommand(tr("angle de d\351part"), part, "startAngle", ((start_angle -> value() * -1) + 90) * 16); }
|
void ArcEditor::updateArcS() { addChangePartCommand(tr("angle de départ"), part, "startAngle", ((start_angle -> value() * -1) + 90) * 16); }
|
||||||
/// Met a jour l'etendue de l'arc et cree un objet d'annulation
|
/// Met a jour l'etendue de l'arc et cree un objet d'annulation
|
||||||
void ArcEditor::updateArcA() { addChangePartCommand(tr("angle"), part, "spanAngle", angle -> value() * -16); }
|
void ArcEditor::updateArcA() { addChangePartCommand(tr("angle"), part, "spanAngle", angle -> value() * -16); }
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ARC_EDITOR_H
|
#ifndef ARC_EDITOR_H
|
||||||
#define ARC_EDITOR_H
|
#define ARC_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class PartArc;
|
class PartArc;
|
||||||
class StyleEditor;
|
class StyleEditor;
|
||||||
|
|||||||
@@ -227,7 +227,7 @@ MovePartsCommand::MovePartsCommand(
|
|||||||
const QList<QGraphicsItem *> parts,
|
const QList<QGraphicsItem *> parts,
|
||||||
QUndoCommand *parent
|
QUndoCommand *parent
|
||||||
) :
|
) :
|
||||||
ElementEditionCommand(QObject::tr("d\351placement", "undo caption"), scene, 0, parent),
|
ElementEditionCommand(QObject::tr("déplacement", "undo caption"), scene, 0, parent),
|
||||||
movement(m),
|
movement(m),
|
||||||
first_redo(true)
|
first_redo(true)
|
||||||
{
|
{
|
||||||
@@ -444,7 +444,7 @@ ChangeZValueCommand::ChangeZValueCommand(
|
|||||||
setText(QObject::tr("rapprocher", "undo caption"));
|
setText(QObject::tr("rapprocher", "undo caption"));
|
||||||
applyRaise(items_list);
|
applyRaise(items_list);
|
||||||
} else if (option == Lower) {
|
} else if (option == Lower) {
|
||||||
setText(QObject::tr("\351loigner", "undo caption"));
|
setText(QObject::tr("éloigner", "undo caption"));
|
||||||
applyLower(items_list);
|
applyLower(items_list);
|
||||||
} else if (option == SendBackward) {
|
} else if (option == SendBackward) {
|
||||||
setText(QObject::tr("envoyer au fond", "undo caption"));
|
setText(QObject::tr("envoyer au fond", "undo caption"));
|
||||||
@@ -679,7 +679,7 @@ ChangePropertiesCommand::ChangePropertiesCommand(ElementScene *scene, QString ty
|
|||||||
{
|
{
|
||||||
m_type << scene->m_elmt_type << type;
|
m_type << scene->m_elmt_type << type;
|
||||||
m_info << scene->m_elmt_kindInfo << info;
|
m_info << scene->m_elmt_kindInfo << info;
|
||||||
setText(QObject::tr("Modifier les propri\351t\351s"));
|
setText(QObject::tr("Modifier les propriétés"));
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangePropertiesCommand::~ChangePropertiesCommand() {}
|
ChangePropertiesCommand::~ChangePropertiesCommand() {}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include "elementscene.h"
|
#include "elementscene.h"
|
||||||
#include "elementcontent.h"
|
#include "elementcontent.h"
|
||||||
#include "qgimanager.h"
|
#include "qgimanager.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief The ElementEditionCommand class
|
* @brief The ElementEditionCommand class
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENT_ITEM_EDITOR_H
|
#ifndef ELEMENT_ITEM_EDITOR_H
|
||||||
#define ELEMENT_ITEM_EDITOR_H
|
#define ELEMENT_ITEM_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
class QETElementEditor;
|
class QETElementEditor;
|
||||||
class ElementScene;
|
class ElementScene;
|
||||||
class CustomElementPart;
|
class CustomElementPart;
|
||||||
|
|||||||
@@ -88,8 +88,10 @@ void ElementPrimitiveDecorator::paint(QPainter *painter, const QStyleOptionGraph
|
|||||||
Q_UNUSED(widget)
|
Q_UNUSED(widget)
|
||||||
painter -> save();
|
painter -> save();
|
||||||
|
|
||||||
// paint the original bounding rect
|
// paint the original bounding rect
|
||||||
painter -> setPen(Qt::DashLine);
|
QPen pen(Qt::DashLine);
|
||||||
|
pen.setCosmetic(true);
|
||||||
|
painter -> setPen(pen);
|
||||||
//QGraphicsItemGroup::paint(painter, option, widget);
|
//QGraphicsItemGroup::paint(painter, option, widget);
|
||||||
painter -> drawRect(modified_bounding_rect_);
|
painter -> drawRect(modified_bounding_rect_);
|
||||||
drawSquares(painter, option, widget);
|
drawSquares(painter, option, widget);
|
||||||
|
|||||||
@@ -187,7 +187,9 @@ void ElementScene::drawForeground(QPainter *p, const QRectF &rect) {
|
|||||||
p -> setRenderHint(QPainter::TextAntialiasing, true);
|
p -> setRenderHint(QPainter::TextAntialiasing, true);
|
||||||
p -> setRenderHint(QPainter::SmoothPixmapTransform, false);
|
p -> setRenderHint(QPainter::SmoothPixmapTransform, false);
|
||||||
|
|
||||||
p -> setPen(Qt::red);
|
QPen pen(Qt::red);
|
||||||
|
pen.setCosmetic(true);
|
||||||
|
p -> setPen(pen);
|
||||||
p -> setBrush(Qt::NoBrush);
|
p -> setBrush(Qt::NoBrush);
|
||||||
p -> drawLine(-20, 0, 20, 0);
|
p -> drawLine(-20, 0, 20, 0);
|
||||||
p -> drawLine(0, -20, 0, 20);
|
p -> drawLine(0, -20, 0, 20);
|
||||||
@@ -199,14 +201,14 @@ void ElementScene::drawForeground(QPainter *p, const QRectF &rect) {
|
|||||||
* Set a new event interface
|
* Set a new event interface
|
||||||
* @param interface
|
* @param interface
|
||||||
*/
|
*/
|
||||||
void ElementScene::setEventInterface(ESEventInterface *interface) {
|
void ElementScene::setEventInterface(ESEventInterface *event_interface) {
|
||||||
if (m_event_interface) {
|
if (m_event_interface) {
|
||||||
delete m_event_interface;
|
delete m_event_interface;
|
||||||
//We must to re-init because previous interface
|
//We must to re-init because previous interface
|
||||||
//Reset his own init when deleted
|
//Reset his own init when deleted
|
||||||
interface->init();
|
event_interface->init();
|
||||||
}
|
}
|
||||||
m_event_interface = interface;
|
m_event_interface = event_interface;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -530,15 +532,15 @@ void ElementScene::slot_editAuthorInformations() {
|
|||||||
// cree un dialogue
|
// cree un dialogue
|
||||||
QDialog dialog_author(element_editor);
|
QDialog dialog_author(element_editor);
|
||||||
dialog_author.setModal(true);
|
dialog_author.setModal(true);
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
dialog_author.setWindowFlags(Qt::Sheet);
|
dialog_author.setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
dialog_author.setMinimumSize(400, 260);
|
dialog_author.setMinimumSize(400, 260);
|
||||||
dialog_author.setWindowTitle(tr("\311diter les informations sur l'auteur", "window title"));
|
dialog_author.setWindowTitle(tr("Éditer les informations sur l'auteur", "window title"));
|
||||||
QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_author);
|
QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog_author);
|
||||||
|
|
||||||
// ajoute un champ explicatif au dialogue
|
// ajoute un champ explicatif au dialogue
|
||||||
QLabel *information_label = new QLabel(tr("Vous pouvez utiliser ce champ libre pour mentionner les auteurs de l'\351l\351ment, sa licence, ou tout autre renseignement que vous jugerez utile."));
|
QLabel *information_label = new QLabel(tr("Vous pouvez utiliser ce champ libre pour mentionner les auteurs de l'élément, sa licence, ou tout autre renseignement que vous jugerez utile."));
|
||||||
information_label -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
information_label -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
||||||
information_label -> setWordWrap(true);
|
information_label -> setWordWrap(true);
|
||||||
dialog_layout -> addWidget(information_label);
|
dialog_layout -> addWidget(information_label);
|
||||||
@@ -586,16 +588,16 @@ void ElementScene::slot_editNames() {
|
|||||||
|
|
||||||
// cree un dialogue
|
// cree un dialogue
|
||||||
QDialog dialog(element_editor);
|
QDialog dialog(element_editor);
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
dialog.setWindowFlags(Qt::Sheet);
|
dialog.setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
dialog.setModal(true);
|
dialog.setModal(true);
|
||||||
dialog.setMinimumSize(400, 330);
|
dialog.setMinimumSize(400, 330);
|
||||||
dialog.setWindowTitle(tr("\311diter les noms", "window title"));
|
dialog.setWindowTitle(tr("Éditer les noms", "window title"));
|
||||||
QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog);
|
QVBoxLayout *dialog_layout = new QVBoxLayout(&dialog);
|
||||||
|
|
||||||
// ajoute un champ explicatif au dialogue
|
// ajoute un champ explicatif au dialogue
|
||||||
QLabel *information_label = new QLabel(tr("Vous pouvez sp\351cifier le nom de l'\351l\351ment dans plusieurs langues."));
|
QLabel *information_label = new QLabel(tr("Vous pouvez spécifier le nom de l'élément dans plusieurs langues."));
|
||||||
information_label -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
information_label -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
||||||
information_label -> setWordWrap(true);
|
information_label -> setWordWrap(true);
|
||||||
dialog_layout -> addWidget(information_label);
|
dialog_layout -> addWidget(information_label);
|
||||||
@@ -792,7 +794,7 @@ bool ElementScene::applyInformations(const QDomDocument &xml_document, QString *
|
|||||||
QDomElement root = xml_document.documentElement();
|
QDomElement root = xml_document.documentElement();
|
||||||
if (root.tagName() != "definition" || root.attribute("type") != "element") {
|
if (root.tagName() != "definition" || root.attribute("type") != "element") {
|
||||||
if (error_message) {
|
if (error_message) {
|
||||||
*error_message = tr("Ce document XML n'est pas une d\351finition d'\351l\351ment.", "error message");
|
*error_message = tr("Ce document XML n'est pas une définition d'élément.", "error message");
|
||||||
}
|
}
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@@ -832,7 +834,7 @@ ElementContent ElementScene::loadContent(const QDomDocument &xml_document, QStri
|
|||||||
QDomElement root = xml_document.documentElement();
|
QDomElement root = xml_document.documentElement();
|
||||||
if (root.tagName() != "definition" || root.attribute("type") != "element") {
|
if (root.tagName() != "definition" || root.attribute("type") != "element") {
|
||||||
if (error_message) {
|
if (error_message) {
|
||||||
*error_message = tr("Ce document XML n'est pas une d\351finition d'\351l\351ment.", "error message");
|
*error_message = tr("Ce document XML n'est pas une définition d'élément.", "error message");
|
||||||
}
|
}
|
||||||
return(loaded_parts);
|
return(loaded_parts);
|
||||||
}
|
}
|
||||||
@@ -968,9 +970,9 @@ void ElementScene::centerElementToOrigine() {
|
|||||||
int center_y = qRound(size.center().y());
|
int center_y = qRound(size.center().y());
|
||||||
|
|
||||||
//define the movement of translation
|
//define the movement of translation
|
||||||
int move_x = center_x - (qRound(center_x) %10);
|
int move_x = center_x - (center_x %10);
|
||||||
if (center_x < 0) move_x -= 10;
|
if (center_x < 0) move_x -= 10;
|
||||||
int move_y = center_y - (qRound(center_y) %10);
|
int move_y = center_y - (center_y %10);
|
||||||
if (center_y < 0) move_y -= 10;
|
if (center_y < 0) move_y -= 10;
|
||||||
|
|
||||||
//move each primitive by @move
|
//move each primitive by @move
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENT_SCENE_H
|
#ifndef ELEMENT_SCENE_H
|
||||||
#define ELEMENT_SCENE_H
|
#define ELEMENT_SCENE_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include <QtXml>
|
#include <QtXml>
|
||||||
#include "nameslistwidget.h"
|
#include "nameslistwidget.h"
|
||||||
#include "qgimanager.h"
|
#include "qgimanager.h"
|
||||||
@@ -104,7 +104,7 @@ class ElementScene : public QGraphicsScene {
|
|||||||
|
|
||||||
// methods
|
// methods
|
||||||
public:
|
public:
|
||||||
void setEventInterface (ESEventInterface *interface);
|
void setEventInterface (ESEventInterface *event_interface);
|
||||||
QPointF snapToGrid(QPointF point);
|
QPointF snapToGrid(QPointF point);
|
||||||
void setNames(const NamesList &);
|
void setNames(const NamesList &);
|
||||||
NamesList names() const;
|
NamesList names() const;
|
||||||
|
|||||||
@@ -507,7 +507,9 @@ void ElementView::drawBackground(QPainter *p, const QRectF &r) {
|
|||||||
|
|
||||||
if (draw_grid) {
|
if (draw_grid) {
|
||||||
// draw the dot of the grid
|
// draw the dot of the grid
|
||||||
p -> setPen(Qt::black);
|
QPen pen(Qt::black);
|
||||||
|
pen.setCosmetic(true);
|
||||||
|
p -> setPen(pen);
|
||||||
p -> setBrush(Qt::NoBrush);
|
p -> setBrush(Qt::NoBrush);
|
||||||
qreal limite_x = r.x() + r.width();
|
qreal limite_x = r.x() + r.width();
|
||||||
qreal limite_y = r.y() + r.height();
|
qreal limite_y = r.y() + r.height();
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ EllipseEditor::EllipseEditor(QETElementEditor *editor, PartEllipse *ellipse, QWi
|
|||||||
grid -> addWidget(x, 1, 1);
|
grid -> addWidget(x, 1, 1);
|
||||||
grid -> addWidget(new QLabel("y"), 1, 2);
|
grid -> addWidget(new QLabel("y"), 1, 2);
|
||||||
grid -> addWidget(y, 1, 3);
|
grid -> addWidget(y, 1, 3);
|
||||||
grid -> addWidget(new QLabel(tr("Diam\350tres : ")), 2, 0);
|
grid -> addWidget(new QLabel(tr("Diamètres : ")), 2, 0);
|
||||||
grid -> addWidget(new QLabel(tr("horizontal :")), 3, 0);
|
grid -> addWidget(new QLabel(tr("horizontal :")), 3, 0);
|
||||||
grid -> addWidget(h, 3, 1);
|
grid -> addWidget(h, 3, 1);
|
||||||
grid -> addWidget(new QLabel(tr("vertical :")), 4, 0);
|
grid -> addWidget(new QLabel(tr("vertical :")), 4, 0);
|
||||||
@@ -111,11 +111,11 @@ void EllipseEditor::updateEllipse() {
|
|||||||
/// Met a jour l'abscisse du centre de l'ellipse et cree un objet d'annulation
|
/// Met a jour l'abscisse du centre de l'ellipse et cree un objet d'annulation
|
||||||
void EllipseEditor::updateEllipseX() { addChangePartCommand(tr("abscisse"), part, "centerX", x -> value()); }
|
void EllipseEditor::updateEllipseX() { addChangePartCommand(tr("abscisse"), part, "centerX", x -> value()); }
|
||||||
/// Met a jour l'ordonnee du centre de l'ellipse et cree un objet d'annulation
|
/// Met a jour l'ordonnee du centre de l'ellipse et cree un objet d'annulation
|
||||||
void EllipseEditor::updateEllipseY() { addChangePartCommand(tr("ordonn\351e"), part, "centerY", y -> value()); }
|
void EllipseEditor::updateEllipseY() { addChangePartCommand(tr("ordonnée"), part, "centerY", y -> value()); }
|
||||||
/// Met a jour le diametre horizontal de l'ellipse et cree un objet d'annulation
|
/// Met a jour le diametre horizontal de l'ellipse et cree un objet d'annulation
|
||||||
void EllipseEditor::updateEllipseH() { addChangePartCommand(tr("diam\350tre horizontal"), part, "diameter_h", h -> value()); }
|
void EllipseEditor::updateEllipseH() { addChangePartCommand(tr("diamètre horizontal"), part, "diameter_h", h -> value()); }
|
||||||
/// Met a jour le diametre vertical de l'ellipse et cree un objet d'annulation
|
/// Met a jour le diametre vertical de l'ellipse et cree un objet d'annulation
|
||||||
void EllipseEditor::updateEllipseV() { addChangePartCommand(tr("diam\350tre vertical"), part, "diameter_v", v -> value()); }
|
void EllipseEditor::updateEllipseV() { addChangePartCommand(tr("diamètre vertical"), part, "diameter_v", v -> value()); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Met a jour le formulaire d'edition
|
Met a jour le formulaire d'edition
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELLIPSE_EDITOR_H
|
#ifndef ELLIPSE_EDITOR_H
|
||||||
#define ELLIPSE_EDITOR_H
|
#define ELLIPSE_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class PartEllipse;
|
class PartEllipse;
|
||||||
class StyleEditor;
|
class StyleEditor;
|
||||||
|
|||||||
@@ -29,7 +29,8 @@
|
|||||||
ESEventAddText::ESEventAddText(ElementScene *scene) :
|
ESEventAddText::ESEventAddText(ElementScene *scene) :
|
||||||
ESEventInterface(scene)
|
ESEventInterface(scene)
|
||||||
{
|
{
|
||||||
m_text = new PartText(m_editor, 0, m_scene);
|
m_text = new PartText(m_editor);
|
||||||
|
m_scene -> addItem(m_text);
|
||||||
m_running = true;
|
m_running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +63,8 @@ bool ESEventAddText::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
|||||||
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Texte"), m_scene, m_text));
|
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Texte"), m_scene, m_text));
|
||||||
|
|
||||||
//Set new text
|
//Set new text
|
||||||
m_text = new PartText(m_editor, 0, m_scene);
|
m_text = new PartText(m_editor);
|
||||||
|
m_scene -> addItem(m_text);
|
||||||
m_text -> setPos(m_scene -> snapToGrid(event -> scenePos()));
|
m_text -> setPos(m_scene -> snapToGrid(event -> scenePos()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -29,7 +29,8 @@
|
|||||||
ESEventAddTextField::ESEventAddTextField(ElementScene *scene) :
|
ESEventAddTextField::ESEventAddTextField(ElementScene *scene) :
|
||||||
ESEventInterface(scene)
|
ESEventInterface(scene)
|
||||||
{
|
{
|
||||||
m_text = new PartTextField(m_editor, 0, m_scene);
|
m_text = new PartTextField(m_editor);
|
||||||
|
m_scene -> addItem(m_text);
|
||||||
m_running = true;
|
m_running = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -62,7 +63,8 @@ bool ESEventAddTextField::mouseReleaseEvent(QGraphicsSceneMouseEvent *event) {
|
|||||||
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Champ texte"), m_scene, m_text));
|
m_scene -> undoStack().push(new AddPartCommand(QObject::tr("Champ texte"), m_scene, m_text));
|
||||||
|
|
||||||
//Set new text
|
//Set new text
|
||||||
m_text = new PartTextField(m_editor, 0, m_scene);
|
m_text = new PartTextField(m_editor);
|
||||||
|
m_scene -> addItem(m_text);
|
||||||
m_text -> setPos(m_scene -> snapToGrid(event -> scenePos()));
|
m_text -> setPos(m_scene -> snapToGrid(event -> scenePos()));
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -109,12 +109,14 @@ void ESEventInterface::updateHelpCross(const QPointF &p) {
|
|||||||
pen.setCosmetic(true);
|
pen.setCosmetic(true);
|
||||||
pen.setColor(Qt::darkGray);
|
pen.setColor(Qt::darkGray);
|
||||||
if (!m_help_horiz) {
|
if (!m_help_horiz) {
|
||||||
m_help_horiz = new QGraphicsLineItem(-10000, 0, 10000, 0, 0, m_scene);
|
m_help_horiz = new QGraphicsLineItem(-10000, 0, 10000, 0);
|
||||||
m_help_horiz -> setPen(pen);
|
m_help_horiz -> setPen(pen);
|
||||||
|
m_scene -> addItem(m_help_horiz);
|
||||||
}
|
}
|
||||||
if (!m_help_verti) {
|
if (!m_help_verti) {
|
||||||
m_help_verti = new QGraphicsLineItem(0, -10000, 0, 10000, 0, m_scene);
|
m_help_verti = new QGraphicsLineItem(0, -10000, 0, 10000);
|
||||||
m_help_verti -> setPen(pen);
|
m_help_verti -> setPen(pen);
|
||||||
|
m_scene -> addItem(m_help_verti);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef CUSTOM_ELEMENT_PART_H
|
#ifndef CUSTOM_ELEMENT_PART_H
|
||||||
#define CUSTOM_ELEMENT_PART_H
|
#define CUSTOM_ELEMENT_PART_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include <QtXml>
|
#include <QtXml>
|
||||||
#include <QImage>
|
#include <QImage>
|
||||||
#include "qet.h"
|
#include "qet.h"
|
||||||
|
|||||||
@@ -29,11 +29,12 @@
|
|||||||
@param scene La scene sur laquelle figure ce texte statique
|
@param scene La scene sur laquelle figure ce texte statique
|
||||||
*/
|
*/
|
||||||
PartText::PartText(QETElementEditor *editor, QGraphicsItem *parent, ElementScene *scene) :
|
PartText::PartText(QETElementEditor *editor, QGraphicsItem *parent, ElementScene *scene) :
|
||||||
QGraphicsTextItem(parent, scene),
|
QGraphicsTextItem(parent),
|
||||||
CustomElementPart(editor),
|
CustomElementPart(editor),
|
||||||
previous_text(),
|
previous_text(),
|
||||||
decorator_(0)
|
decorator_(0)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(scene)
|
||||||
#if QT_VERSION >= 0x040500
|
#if QT_VERSION >= 0x040500
|
||||||
document() -> setDocumentMargin(1.0);
|
document() -> setDocumentMargin(1.0);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef PART_TEXT_H
|
#ifndef PART_TEXT_H
|
||||||
#define PART_TEXT_H
|
#define PART_TEXT_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "customelementpart.h"
|
#include "customelementpart.h"
|
||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
class TextEditor;
|
class TextEditor;
|
||||||
|
|||||||
@@ -28,13 +28,14 @@
|
|||||||
@param scene La scene sur laquelle figure ce champ de texte
|
@param scene La scene sur laquelle figure ce champ de texte
|
||||||
*/
|
*/
|
||||||
PartTextField::PartTextField(QETElementEditor *editor, QGraphicsItem *parent, QGraphicsScene *scene) :
|
PartTextField::PartTextField(QETElementEditor *editor, QGraphicsItem *parent, QGraphicsScene *scene) :
|
||||||
QGraphicsTextItem(parent, scene),
|
QGraphicsTextItem(parent),
|
||||||
CustomElementPart(editor),
|
CustomElementPart(editor),
|
||||||
follow_parent_rotations(true),
|
follow_parent_rotations(true),
|
||||||
m_tagg("none"),
|
m_tagg("none"),
|
||||||
previous_text(),
|
previous_text(),
|
||||||
decorator_(0)
|
decorator_(0)
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(scene);
|
||||||
setDefaultTextColor(Qt::black);
|
setDefaultTextColor(Qt::black);
|
||||||
setFont(QETApp::diagramTextsFont());
|
setFont(QETApp::diagramTextsFont());
|
||||||
real_font_size_ = font().pointSize();
|
real_font_size_ = font().pointSize();
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef PART_TEXTFIELD_H
|
#ifndef PART_TEXTFIELD_H
|
||||||
#define PART_TEXTFIELD_H
|
#define PART_TEXTFIELD_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "customelementpart.h"
|
#include "customelementpart.h"
|
||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
class TextFieldEditor;
|
class TextFieldEditor;
|
||||||
|
|||||||
@@ -45,16 +45,16 @@ LineEditor::LineEditor(QETElementEditor *editor, PartLine *line, QWidget *parent
|
|||||||
|
|
||||||
end1_type = new QComboBox();
|
end1_type = new QComboBox();
|
||||||
end1_type -> addItem(QET::Icons::EndLineNone, tr("Normale", "type of the 1st end of a line"), Qet::None );
|
end1_type -> addItem(QET::Icons::EndLineNone, tr("Normale", "type of the 1st end of a line"), Qet::None );
|
||||||
end1_type -> addItem(QET::Icons::EndLineSimple, tr("Fl\350che simple", "type of the 1st end of a line"), Qet::Simple );
|
end1_type -> addItem(QET::Icons::EndLineSimple, tr("Flèche simple", "type of the 1st end of a line"), Qet::Simple );
|
||||||
end1_type -> addItem(QET::Icons::EndLineTriangle, tr("Fl\350che triangulaire", "type of the 1st end of a line"), Qet::Triangle);
|
end1_type -> addItem(QET::Icons::EndLineTriangle, tr("Flèche triangulaire", "type of the 1st end of a line"), Qet::Triangle);
|
||||||
end1_type -> addItem(QET::Icons::EndLineCircle, tr("Cercle", "type of the 1st end of a line"), Qet::Circle );
|
end1_type -> addItem(QET::Icons::EndLineCircle, tr("Cercle", "type of the 1st end of a line"), Qet::Circle );
|
||||||
end1_type -> addItem(QET::Icons::EndLineDiamond, tr("Carr\351", "type of the 1st end of a line"), Qet::Diamond );
|
end1_type -> addItem(QET::Icons::EndLineDiamond, tr("Carré", "type of the 1st end of a line"), Qet::Diamond );
|
||||||
end2_type = new QComboBox();
|
end2_type = new QComboBox();
|
||||||
end2_type -> addItem(QET::Icons::EndLineNone, tr("Normale", "type of the 2nd end of a line"), Qet::None );
|
end2_type -> addItem(QET::Icons::EndLineNone, tr("Normale", "type of the 2nd end of a line"), Qet::None );
|
||||||
end2_type -> addItem(QET::Icons::EndLineSimple, tr("Fl\350che simple", "type of the 2nd end of a line"), Qet::Simple );
|
end2_type -> addItem(QET::Icons::EndLineSimple, tr("Flèche simple", "type of the 2nd end of a line"), Qet::Simple );
|
||||||
end2_type -> addItem(QET::Icons::EndLineTriangle, tr("Fl\350che triangulaire", "type of the 2nd end of a line"), Qet::Triangle);
|
end2_type -> addItem(QET::Icons::EndLineTriangle, tr("Flèche triangulaire", "type of the 2nd end of a line"), Qet::Triangle);
|
||||||
end2_type -> addItem(QET::Icons::EndLineCircle, tr("Cercle", "type of the 2nd end of a line"), Qet::Circle );
|
end2_type -> addItem(QET::Icons::EndLineCircle, tr("Cercle", "type of the 2nd end of a line"), Qet::Circle );
|
||||||
end2_type -> addItem(QET::Icons::EndLineDiamond, tr("Carr\351", "type of the 2nd end of a line"), Qet::Diamond );
|
end2_type -> addItem(QET::Icons::EndLineDiamond, tr("Carré", "type of the 2nd end of a line"), Qet::Diamond );
|
||||||
|
|
||||||
end1_length = new QDoubleSpinBox();
|
end1_length = new QDoubleSpinBox();
|
||||||
end2_length = new QDoubleSpinBox();
|
end2_length = new QDoubleSpinBox();
|
||||||
@@ -151,11 +151,11 @@ void LineEditor::updateLine() {
|
|||||||
/// Met a jour l'abscisse du premier point de la ligne et cree un objet d'annulation
|
/// Met a jour l'abscisse du premier point de la ligne et cree un objet d'annulation
|
||||||
void LineEditor::updateLineX1() { addChangePartCommand(tr("abscisse point 1"), part, "p1", editedP1()); }
|
void LineEditor::updateLineX1() { addChangePartCommand(tr("abscisse point 1"), part, "p1", editedP1()); }
|
||||||
/// Met a jour l'ordonnee du premier point de la ligne et cree un objet d'annulation
|
/// Met a jour l'ordonnee du premier point de la ligne et cree un objet d'annulation
|
||||||
void LineEditor::updateLineY1() { addChangePartCommand(tr("ordonn\351e point 1"), part, "p1", editedP1()); }
|
void LineEditor::updateLineY1() { addChangePartCommand(tr("ordonnée point 1"), part, "p1", editedP1()); }
|
||||||
/// Met a jour l'abscisse du second point de la ligne et cree un objet d'annulation
|
/// Met a jour l'abscisse du second point de la ligne et cree un objet d'annulation
|
||||||
void LineEditor::updateLineX2() { addChangePartCommand(tr("abscisse point 2"), part, "p2", editedP2()); }
|
void LineEditor::updateLineX2() { addChangePartCommand(tr("abscisse point 2"), part, "p2", editedP2()); }
|
||||||
/// Met a jour l'ordonnee du second point de la ligne et cree un objet d'annulation
|
/// Met a jour l'ordonnee du second point de la ligne et cree un objet d'annulation
|
||||||
void LineEditor::updateLineY2() { addChangePartCommand(tr("ordonn\351e point 2"), part, "p2", editedP2()); }
|
void LineEditor::updateLineY2() { addChangePartCommand(tr("ordonnée point 2"), part, "p2", editedP2()); }
|
||||||
/// Met a jour le type de la premiere extremite
|
/// Met a jour le type de la premiere extremite
|
||||||
void LineEditor::updateLineEndType1() { addChangePartCommand(tr("type fin 1"), part, "end1", end1_type -> itemData(end1_type->currentIndex())); }
|
void LineEditor::updateLineEndType1() { addChangePartCommand(tr("type fin 1"), part, "end1", end1_type -> itemData(end1_type->currentIndex())); }
|
||||||
/// Met a jour la longueur de la premiere extremite
|
/// Met a jour la longueur de la premiere extremite
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef LINE_EDITOR_H
|
#ifndef LINE_EDITOR_H
|
||||||
#define LINE_EDITOR_H
|
#define LINE_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class PartLine;
|
class PartLine;
|
||||||
class StyleEditor;
|
class StyleEditor;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ PolygonEditor::PolygonEditor(QETElementEditor *editor, PartPolygon *p, QWidget *
|
|||||||
ElementItemEditor(editor, parent),
|
ElementItemEditor(editor, parent),
|
||||||
part(p),
|
part(p),
|
||||||
points_list(this),
|
points_list(this),
|
||||||
close_polygon(tr("Polygone ferm\351"), this)
|
close_polygon(tr("Polygone fermé"), this)
|
||||||
{
|
{
|
||||||
style_ = new StyleEditor(editor);
|
style_ = new StyleEditor(editor);
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ void PolygonEditor::updatePolygonPoints() {
|
|||||||
if (!part) return;
|
if (!part) return;
|
||||||
QVector<QPointF> points = getPointsFromTree();
|
QVector<QPointF> points = getPointsFromTree();
|
||||||
if (points.count() < 2) {
|
if (points.count() < 2) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Le polygone doit comporter au moins deux points.", "message box content")
|
tr("Le polygone doit comporter au moins deux points.", "message box content")
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
QETElementEditor::QETElementEditor(QWidget *parent) :
|
QETElementEditor::QETElementEditor(QWidget *parent) :
|
||||||
QETMainWindow(parent),
|
QETMainWindow(parent),
|
||||||
read_only(false),
|
read_only(false),
|
||||||
min_title(tr("QElectroTech - \311diteur d'\351l\351ment", "window title")),
|
min_title(tr("QElectroTech - Éditeur d'élément", "window title")),
|
||||||
opened_from_file(false)
|
opened_from_file(false)
|
||||||
{
|
{
|
||||||
setWindowTitle(min_title);
|
setWindowTitle(min_title);
|
||||||
@@ -143,19 +143,19 @@ void QETElementEditor::setupActions() {
|
|||||||
save_as_file = new QAction(QET::Icons::DocumentSaveAs, tr("Enregistrer dans un fichier"), this);
|
save_as_file = new QAction(QET::Icons::DocumentSaveAs, tr("Enregistrer dans un fichier"), this);
|
||||||
reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger"), this);
|
reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger"), this);
|
||||||
quit = new QAction(QET::Icons::ApplicationExit, tr("&Quitter"), this);
|
quit = new QAction(QET::Icons::ApplicationExit, tr("&Quitter"), this);
|
||||||
selectall = new QAction(QET::Icons::EditSelectAll, tr("Tout s\351lectionner"), this);
|
selectall = new QAction(QET::Icons::EditSelectAll, tr("Tout sélectionner"), this);
|
||||||
deselectall = new QAction( tr("D\351s\351lectionner tout"), this);
|
deselectall = new QAction( tr("Désélectionner tout"), this);
|
||||||
cut = new QAction(QET::Icons::EditCut, tr("Co&uper"), this);
|
cut = new QAction(QET::Icons::EditCut, tr("Co&uper"), this);
|
||||||
copy = new QAction(QET::Icons::EditCopy, tr("Cop&ier"), this);
|
copy = new QAction(QET::Icons::EditCopy, tr("Cop&ier"), this);
|
||||||
paste = new QAction(QET::Icons::EditPaste, tr("C&oller"), this);
|
paste = new QAction(QET::Icons::EditPaste, tr("C&oller"), this);
|
||||||
paste_in_area = new QAction(QET::Icons::EditPaste, tr("C&oller dans la zone..."), this);
|
paste_in_area = new QAction(QET::Icons::EditPaste, tr("C&oller dans la zone..."), this);
|
||||||
paste_from_file = new QAction(QET::Icons::XmlTextFile, tr("un fichier"), this);
|
paste_from_file = new QAction(QET::Icons::XmlTextFile, tr("un fichier"), this);
|
||||||
paste_from_elmt = new QAction(QET::Icons::Element, tr("un \351l\351ment"), this);
|
paste_from_elmt = new QAction(QET::Icons::Element, tr("un élément"), this);
|
||||||
inv_select = new QAction( tr("Inverser la s\351lection"), this);
|
inv_select = new QAction( tr("Inverser la sélection"), this);
|
||||||
edit_delete = new QAction(QET::Icons::EditDelete, tr("&Supprimer"), this);
|
edit_delete = new QAction(QET::Icons::EditDelete, tr("&Supprimer"), this);
|
||||||
edit_names = new QAction(QET::Icons::Names, tr("\311diter le nom et les traductions de l'\351l\351ment"), this);
|
edit_names = new QAction(QET::Icons::Names, tr("Éditer le nom et les traductions de l'élément"), this);
|
||||||
edit_author = new QAction(QET::Icons::UserInformations, tr("\311diter les informations sur l'auteur"), this);
|
edit_author = new QAction(QET::Icons::UserInformations, tr("Éditer les informations sur l'auteur"), this);
|
||||||
m_edit_properties = new QAction(QET::Icons::ElementEdit, tr("\311diter les propri\351t\351s de l'\351l\351ment"), this);
|
m_edit_properties = new QAction(QET::Icons::ElementEdit, tr("Éditer les propriétés de l'élément"), this);
|
||||||
|
|
||||||
undo = ce_scene -> undoStack().createUndoAction(this, tr("Annuler"));
|
undo = ce_scene -> undoStack().createUndoAction(this, tr("Annuler"));
|
||||||
redo = ce_scene -> undoStack().createRedoAction(this, tr("Refaire"));
|
redo = ce_scene -> undoStack().createRedoAction(this, tr("Refaire"));
|
||||||
@@ -178,7 +178,7 @@ void QETElementEditor::setupActions() {
|
|||||||
copy -> setShortcut(QKeySequence::Copy);
|
copy -> setShortcut(QKeySequence::Copy);
|
||||||
paste -> setShortcut(QKeySequence::Paste);
|
paste -> setShortcut(QKeySequence::Paste);
|
||||||
paste_in_area -> setShortcut(tr("Ctrl+Shift+V"));
|
paste_in_area -> setShortcut(tr("Ctrl+Shift+V"));
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_OS_MAC
|
||||||
edit_delete -> setShortcut(QKeySequence(Qt::Key_Delete));
|
edit_delete -> setShortcut(QKeySequence(Qt::Key_Delete));
|
||||||
#else
|
#else
|
||||||
edit_delete -> setShortcut(QKeySequence(tr("Backspace")));
|
edit_delete -> setShortcut(QKeySequence(tr("Backspace")));
|
||||||
@@ -217,7 +217,7 @@ void QETElementEditor::setupActions() {
|
|||||||
|
|
||||||
QAction *edit_forward = new QAction(QET::Icons::BringForward, tr("Amener au premier plan"), m_depth_ag);
|
QAction *edit_forward = new QAction(QET::Icons::BringForward, tr("Amener au premier plan"), m_depth_ag);
|
||||||
QAction *edit_raise = new QAction(QET::Icons::Raise, tr("Rapprocher"), m_depth_ag);
|
QAction *edit_raise = new QAction(QET::Icons::Raise, tr("Rapprocher"), m_depth_ag);
|
||||||
QAction *edit_lower = new QAction(QET::Icons::Lower, tr("\311loigner"), m_depth_ag);
|
QAction *edit_lower = new QAction(QET::Icons::Lower, tr("Éloigner"), m_depth_ag);
|
||||||
QAction *edit_backward = new QAction(QET::Icons::SendBackward, tr("Envoyer au fond"), m_depth_ag);
|
QAction *edit_backward = new QAction(QET::Icons::SendBackward, tr("Envoyer au fond"), m_depth_ag);
|
||||||
|
|
||||||
edit_raise -> setShortcut(QKeySequence(tr("Ctrl+Shift+Up")));
|
edit_raise -> setShortcut(QKeySequence(tr("Ctrl+Shift+Up")));
|
||||||
@@ -242,8 +242,8 @@ void QETElementEditor::setupActions() {
|
|||||||
m_zoom_ag = new QActionGroup(this);
|
m_zoom_ag = new QActionGroup(this);
|
||||||
|
|
||||||
QAction *zoom_in = new QAction(QET::Icons::ZoomIn, tr("Zoom avant"), m_zoom_ag);
|
QAction *zoom_in = new QAction(QET::Icons::ZoomIn, tr("Zoom avant"), m_zoom_ag);
|
||||||
QAction *zoom_out = new QAction(QET::Icons::ZoomOut, tr("Zoom arri\350re"), m_zoom_ag);
|
QAction *zoom_out = new QAction(QET::Icons::ZoomOut, tr("Zoom arrière"), m_zoom_ag);
|
||||||
QAction *zoom_fit = new QAction(QET::Icons::ZoomFitBest, tr("Zoom adapt\351"), m_zoom_ag);
|
QAction *zoom_fit = new QAction(QET::Icons::ZoomFitBest, tr("Zoom adapté"), m_zoom_ag);
|
||||||
QAction *zoom_reset = new QAction(QET::Icons::ZoomOriginal, tr("Pas de zoom"), m_zoom_ag);
|
QAction *zoom_reset = new QAction(QET::Icons::ZoomOriginal, tr("Pas de zoom"), m_zoom_ag);
|
||||||
|
|
||||||
zoom_in -> setShortcut(QKeySequence::ZoomIn);
|
zoom_in -> setShortcut(QKeySequence::ZoomIn);
|
||||||
@@ -295,7 +295,7 @@ void QETElementEditor::setupActions() {
|
|||||||
main_toolbar -> setObjectName("main_toolbar");
|
main_toolbar -> setObjectName("main_toolbar");
|
||||||
view_toolbar = new QToolBar(tr("Affichage", "toolbar title"), this);
|
view_toolbar = new QToolBar(tr("Affichage", "toolbar title"), this);
|
||||||
view_toolbar -> setObjectName("display");
|
view_toolbar -> setObjectName("display");
|
||||||
element_toolbar = new QToolBar(tr("\311l\351ment", "toolbar title"), this);
|
element_toolbar = new QToolBar(tr("Élément", "toolbar title"), this);
|
||||||
element_toolbar -> setObjectName("element_toolbar");
|
element_toolbar -> setObjectName("element_toolbar");
|
||||||
|
|
||||||
main_toolbar -> addAction(new_element);
|
main_toolbar -> addAction(new_element);
|
||||||
@@ -339,7 +339,7 @@ void QETElementEditor::setupActions() {
|
|||||||
*/
|
*/
|
||||||
void QETElementEditor::setupMenus() {
|
void QETElementEditor::setupMenus() {
|
||||||
file_menu = new QMenu(tr("&Fichier"), this);
|
file_menu = new QMenu(tr("&Fichier"), this);
|
||||||
edit_menu = new QMenu(tr("&\311dition"), this);
|
edit_menu = new QMenu(tr("&Édition"), this);
|
||||||
display_menu = new QMenu(tr("Afficha&ge"), this);
|
display_menu = new QMenu(tr("Afficha&ge"), this);
|
||||||
tools_menu = new QMenu(tr("O&utils"), this);
|
tools_menu = new QMenu(tr("O&utils"), this);
|
||||||
|
|
||||||
@@ -351,7 +351,7 @@ void QETElementEditor::setupMenus() {
|
|||||||
file_menu -> addAction(new_element);
|
file_menu -> addAction(new_element);
|
||||||
file_menu -> addAction(open);
|
file_menu -> addAction(open);
|
||||||
file_menu -> addAction(open_file);
|
file_menu -> addAction(open_file);
|
||||||
QMenu *recentfile = file_menu -> addMenu(QET::Icons::DocumentOpenRecent, tr("&R\351cemment ouverts"));
|
QMenu *recentfile = file_menu -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
|
||||||
recentfile->addActions(QETApp::elementsRecentFiles()->menu()->actions());
|
recentfile->addActions(QETApp::elementsRecentFiles()->menu()->actions());
|
||||||
connect(QETApp::elementsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
|
connect(QETApp::elementsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
|
||||||
file_menu -> addAction(save);
|
file_menu -> addAction(save);
|
||||||
@@ -462,7 +462,7 @@ void QETElementEditor::slot_updateTitle() {
|
|||||||
QString title = min_title;
|
QString title = min_title;
|
||||||
title += " - " + ce_scene -> names().name() + " ";
|
title += " - " + ce_scene -> names().name() + " ";
|
||||||
if (!filename_.isEmpty() || !location_.isNull()) {
|
if (!filename_.isEmpty() || !location_.isNull()) {
|
||||||
if (!ce_scene -> undoStack().isClean()) title += tr("[Modifi\351]", "window title tag");
|
if (!ce_scene -> undoStack().isClean()) title += tr("[Modifié]", "window title tag");
|
||||||
}
|
}
|
||||||
if (isReadOnly()) title += tr(" [lecture seule]", "window title tag");
|
if (isReadOnly()) title += tr(" [lecture seule]", "window title tag");
|
||||||
setWindowTitle(title);
|
setWindowTitle(title);
|
||||||
@@ -542,7 +542,7 @@ void QETElementEditor::setupInterface() {
|
|||||||
slot_createPartsList();
|
slot_createPartsList();
|
||||||
|
|
||||||
// barre d'etat
|
// barre d'etat
|
||||||
statusBar() -> showMessage(tr("\311diteur d'\351l\351ments", "status bar message"));
|
statusBar() -> showMessage(tr("Éditeur d'éléments", "status bar message"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -631,7 +631,7 @@ void QETElementEditor::slot_updateInformations() {
|
|||||||
//Else we only display the number of selected items
|
//Else we only display the number of selected items
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
default_informations -> setText(tr("%n partie(s) s\351lectionn\351e(s).",
|
default_informations -> setText(tr("%n partie(s) sélectionnée(s).",
|
||||||
"",
|
"",
|
||||||
selected_qgis.size()));
|
selected_qgis.size()));
|
||||||
default_informations -> setAlignment(Qt::AlignHCenter | Qt::AlignTop);
|
default_informations -> setAlignment(Qt::AlignHCenter | Qt::AlignTop);
|
||||||
@@ -644,7 +644,7 @@ void QETElementEditor::slot_updateInformations() {
|
|||||||
une boite de dialogue.
|
une boite de dialogue.
|
||||||
*/
|
*/
|
||||||
void QETElementEditor::xmlPreview() {
|
void QETElementEditor::xmlPreview() {
|
||||||
QET::MessageBox::information(
|
QET::QetMessageBox::information(
|
||||||
this,
|
this,
|
||||||
"Export XML",
|
"Export XML",
|
||||||
ce_scene -> toXml().toString(4)
|
ce_scene -> toXml().toString(4)
|
||||||
@@ -670,8 +670,8 @@ bool QETElementEditor::checkElement()
|
|||||||
warnings << qMakePair(
|
warnings << qMakePair(
|
||||||
tr("Absence de borne", "warning title"),
|
tr("Absence de borne", "warning title"),
|
||||||
tr(
|
tr(
|
||||||
"<br>En l'absence de borne, l'\351l\351ment ne pourra \352tre"
|
"<br>En l'absence de borne, l'élément ne pourra être"
|
||||||
" reli\351 \340 d'autres \351l\351ments par l'interm\351diaire de conducteurs.",
|
" relié à d'autres éléments par l'intermédiaire de conducteurs.",
|
||||||
"warning description"
|
"warning description"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -691,10 +691,10 @@ bool QETElementEditor::checkElement()
|
|||||||
if (wrng) {
|
if (wrng) {
|
||||||
errors << qMakePair(
|
errors << qMakePair(
|
||||||
tr("Absence de champ texte 'label'", "warning title"),
|
tr("Absence de champ texte 'label'", "warning title"),
|
||||||
tr("<br><b>Erreur</b \240> :"
|
tr("<br><b>Erreur</b > :"
|
||||||
"<br>Les \351l\351ments de type ma\356tres, esclaves, simple et renvoie de folio doivent poss\351der un champ texte comportant le tagg 'label'."
|
"<br>Les éléments de type maîtres, esclaves, simple et renvoie de folio doivent posséder un champ texte comportant le tagg 'label'."
|
||||||
"<br><b>Solution</b> :"
|
"<br><b>Solution</b> :"
|
||||||
"<br>Ins\351rer un champ texte et lui attribuer le tagg 'label'", "warning description"));
|
"<br>Insérer un champ texte et lui attribuer le tagg 'label'", "warning description"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -714,16 +714,16 @@ bool QETElementEditor::checkElement()
|
|||||||
{
|
{
|
||||||
errors << qMakePair (tr("Absence de borne"),
|
errors << qMakePair (tr("Absence de borne"),
|
||||||
tr("<br><b>Erreur</b> :"
|
tr("<br><b>Erreur</b> :"
|
||||||
"<br>Les reports de folio doivent poss\351der une seul borne."
|
"<br>Les reports de folio doivent posséder une seul borne."
|
||||||
"<br><b>Solution</b> :"
|
"<br><b>Solution</b> :"
|
||||||
"<br>Verifier que l'\351l\351ment ne poss\350de qu'une seul borne"));
|
"<br>Verifier que l'élément ne possède qu'une seul borne"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!errors.count() && !warnings.count()) return(true);
|
if (!errors.count() && !warnings.count()) return(true);
|
||||||
|
|
||||||
// Display warnings
|
// Display warnings
|
||||||
QString dialog_message = tr("La v\351rification de cet \351l\351ment a g\351n\351r\351", "message box content");
|
QString dialog_message = tr("La vérification de cet élément a généré", "message box content");
|
||||||
|
|
||||||
if (errors.size())
|
if (errors.size())
|
||||||
dialog_message += QString(tr(" %n erreur(s)", "errors", errors.size()));
|
dialog_message += QString(tr(" %n erreur(s)", "errors", errors.size()));
|
||||||
@@ -742,7 +742,7 @@ bool QETElementEditor::checkElement()
|
|||||||
foreach(QETWarning warning, total) {
|
foreach(QETWarning warning, total) {
|
||||||
dialog_message += "<li>";
|
dialog_message += "<li>";
|
||||||
dialog_message += QString(
|
dialog_message += QString(
|
||||||
tr("<b>%1</b>\240: %2", "warning title: warning description")
|
tr("<b>%1</b> : %2", "warning title: warning description")
|
||||||
).arg(warning.first).arg(warning.second);
|
).arg(warning.first).arg(warning.second);
|
||||||
dialog_message += "</li>";
|
dialog_message += "</li>";
|
||||||
}
|
}
|
||||||
@@ -793,7 +793,7 @@ void QETElementEditor::fromFile(const QString &filepath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!state) {
|
if (!state) {
|
||||||
QET::MessageBox::critical(this, tr("Erreur", "toolbar title"), error_message);
|
QET::QetMessageBox::critical(this, tr("Erreur", "toolbar title"), error_message);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -803,10 +803,10 @@ void QETElementEditor::fromFile(const QString &filepath) {
|
|||||||
|
|
||||||
// gestion de la lecture seule
|
// gestion de la lecture seule
|
||||||
if (!infos_file.isWritable()) {
|
if (!infos_file.isWritable()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("\311dition en lecture seule", "message box title"),
|
tr("Édition en lecture seule", "message box title"),
|
||||||
tr("Vous n'avez pas les privil\350ges n\351cessaires pour modifier cet \351lement. Il sera donc ouvert en lecture seule.", "message box content")
|
tr("Vous n'avez pas les privilèges nécessaires pour modifier cet élement. Il sera donc ouvert en lecture seule.", "message box content")
|
||||||
);
|
);
|
||||||
setReadOnly(true);
|
setReadOnly(true);
|
||||||
} else {
|
} else {
|
||||||
@@ -828,10 +828,10 @@ bool QETElementEditor::toFile(const QString &fn) {
|
|||||||
QDomDocument element_xml = ce_scene -> toXml();
|
QDomDocument element_xml = ce_scene -> toXml();
|
||||||
bool writing = QET::writeXmlFile(element_xml, fn);
|
bool writing = QET::writeXmlFile(element_xml, fn);
|
||||||
if (!writing) {
|
if (!writing) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Impossible d'\351crire dans ce fichier", "message box content")
|
tr("Impossible d'écrire dans ce fichier", "message box content")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return(writing);
|
return(writing);
|
||||||
@@ -854,10 +854,10 @@ bool QETElementEditor::toLocation(const ElementsLocation &location) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!element) {
|
if (!element) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Impossible d'atteindre l'\351l\351ment", "message box content")
|
tr("Impossible d'atteindre l'élément", "message box content")
|
||||||
);
|
);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@@ -865,10 +865,10 @@ bool QETElementEditor::toLocation(const ElementsLocation &location) {
|
|||||||
// enregistre l'element
|
// enregistre l'element
|
||||||
element -> setXml(ce_scene -> toXml().documentElement());
|
element -> setXml(ce_scene -> toXml().documentElement());
|
||||||
if (!element -> write()) {
|
if (!element -> write()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Impossible d'enregistrer l'\351l\351ment", "message box content")
|
tr("Impossible d'enregistrer l'élément", "message box content")
|
||||||
);
|
);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
@@ -1066,7 +1066,7 @@ void QETElementEditor::openElement(const QString &filepath) {
|
|||||||
// we have to test the file existence here because QETApp::openElementFiles()
|
// we have to test the file existence here because QETApp::openElementFiles()
|
||||||
// will discard non-existent files through QFileInfo::canonicalFilePath()
|
// will discard non-existent files through QFileInfo::canonicalFilePath()
|
||||||
if (!QFile::exists(filepath)) {
|
if (!QFile::exists(filepath)) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Impossible d'ouvrir le fichier", "message box title"),
|
tr("Impossible d'ouvrir le fichier", "message box title"),
|
||||||
QString(
|
QString(
|
||||||
@@ -1085,10 +1085,10 @@ void QETElementEditor::slot_reload() {
|
|||||||
// s'il ya des modifications, on demande a l'utilisateur s'il est certain
|
// s'il ya des modifications, on demande a l'utilisateur s'il est certain
|
||||||
// de vouloir recharger
|
// de vouloir recharger
|
||||||
if (!ce_scene -> undoStack().isClean()) {
|
if (!ce_scene -> undoStack().isClean()) {
|
||||||
QMessageBox::StandardButton answer = QET::MessageBox::question(
|
QMessageBox::StandardButton answer = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
tr("Recharger l'\351l\351ment", "dialog title"),
|
tr("Recharger l'élément", "dialog title"),
|
||||||
tr("Vous avez efffectu\351 des modifications sur cet \351l\351ment. Si vous le rechargez, ces modifications seront perdues. Voulez-vous vraiment recharger l'\351l\351ment ?", "dialog content"),
|
tr("Vous avez efffectué des modifications sur cet élément. Si vous le rechargez, ces modifications seront perdues. Voulez-vous vraiment recharger l'élément ?", "dialog content"),
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
||||||
QMessageBox::Cancel
|
QMessageBox::Cancel
|
||||||
);
|
);
|
||||||
@@ -1135,7 +1135,7 @@ bool QETElementEditor::slot_save() {
|
|||||||
return(result_save);
|
return(result_save);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
QMessageBox::critical(this, tr("Echec de l'enregistrement"), tr("L'enregistrement \340 \351chou\351,\nles conditions requises ne sont pas valides"));
|
QMessageBox::critical(this, tr("Echec de l'enregistrement"), tr("L'enregistrement à échoué,\nles conditions requises ne sont pas valides"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1159,7 +1159,7 @@ bool QETElementEditor::slot_saveAs() {
|
|||||||
// retourne un booleen representatif de la reussite de l'enregistrement
|
// retourne un booleen representatif de la reussite de l'enregistrement
|
||||||
return(result_save);
|
return(result_save);
|
||||||
}
|
}
|
||||||
QMessageBox::critical(this, tr("Echec de l'enregistrement"), tr("L'enregistrement \340 \351chou\351,\nles conditions requises ne sont pas valides"));
|
QMessageBox::critical(this, tr("Echec de l'enregistrement"), tr("L'enregistrement à échoué,\nles conditions requises ne sont pas valides"));
|
||||||
return (false);
|
return (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1175,7 +1175,7 @@ bool QETElementEditor::slot_saveAsFile() {
|
|||||||
tr("Enregistrer sous", "dialog title"),
|
tr("Enregistrer sous", "dialog title"),
|
||||||
filename_.isEmpty() ? QETApp::customElementsDir() : QDir(filename_).absolutePath(),
|
filename_.isEmpty() ? QETApp::customElementsDir() : QDir(filename_).absolutePath(),
|
||||||
tr(
|
tr(
|
||||||
"\311l\351ments QElectroTech (*.elmt)",
|
"Éléments QElectroTech (*.elmt)",
|
||||||
"filetypes allowed when saving an element file"
|
"filetypes allowed when saving an element file"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -1194,7 +1194,7 @@ bool QETElementEditor::slot_saveAsFile() {
|
|||||||
// retourne un booleen representatif de la reussite de l'enregistrement
|
// retourne un booleen representatif de la reussite de l'enregistrement
|
||||||
return(result_save);
|
return(result_save);
|
||||||
}
|
}
|
||||||
QMessageBox::critical(this, tr("Echec de l'enregistrement"), tr("L'enregistrement \340 \351chou\351,\nles conditions requises ne sont pas valides"));
|
QMessageBox::critical(this, tr("Echec de l'enregistrement"), tr("L'enregistrement à échoué,\nles conditions requises ne sont pas valides"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1207,12 +1207,12 @@ bool QETElementEditor::slot_saveAsFile() {
|
|||||||
bool QETElementEditor::canClose() {
|
bool QETElementEditor::canClose() {
|
||||||
if (ce_scene -> undoStack().isClean()) return(true);
|
if (ce_scene -> undoStack().isClean()) return(true);
|
||||||
// demande d'abord a l'utilisateur s'il veut enregistrer l'element en cours
|
// demande d'abord a l'utilisateur s'il veut enregistrer l'element en cours
|
||||||
QMessageBox::StandardButton answer = QET::MessageBox::question(
|
QMessageBox::StandardButton answer = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
tr("Enregistrer l'\351l\351ment en cours ?", "dialog title"),
|
tr("Enregistrer l'élément en cours ?", "dialog title"),
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"Voulez-vous enregistrer l'\351l\351ment %1 ?",
|
"Voulez-vous enregistrer l'élément %1 ?",
|
||||||
"dialog content - %1 is an element name"
|
"dialog content - %1 is an element name"
|
||||||
)
|
)
|
||||||
).arg(ce_scene -> names().name()),
|
).arg(ce_scene -> names().name()),
|
||||||
@@ -1310,7 +1310,7 @@ void QETElementEditor::slot_createPartsList() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
parts_list -> addItem(new QListWidgetItem(tr("Trop de primitives, liste non g\351n\351r\351e.")));
|
parts_list -> addItem(new QListWidgetItem(tr("Trop de primitives, liste non générée.")));
|
||||||
}
|
}
|
||||||
parts_list -> blockSignals(false);
|
parts_list -> blockSignals(false);
|
||||||
}
|
}
|
||||||
@@ -1404,7 +1404,7 @@ QString QETElementEditor::getOpenElementFileName(QWidget *parent, const QString
|
|||||||
tr("Ouvrir un fichier", "dialog title"),
|
tr("Ouvrir un fichier", "dialog title"),
|
||||||
initial_dir.isEmpty() ? QETApp::customElementsDir() : initial_dir,
|
initial_dir.isEmpty() ? QETApp::customElementsDir() : initial_dir,
|
||||||
tr(
|
tr(
|
||||||
"\311l\351ments QElectroTech (*.elmt);;"
|
"Éléments QElectroTech (*.elmt);;"
|
||||||
"Fichiers XML (*.xml);;"
|
"Fichiers XML (*.xml);;"
|
||||||
"Tous les fichiers (*)",
|
"Tous les fichiers (*)",
|
||||||
"filetypes allowed when opening an element file"
|
"filetypes allowed when opening an element file"
|
||||||
@@ -1422,19 +1422,19 @@ void QETElementEditor::fromLocation(const ElementsLocation &location) {
|
|||||||
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
||||||
ElementDefinition *element = 0;
|
ElementDefinition *element = 0;
|
||||||
if (!item) {
|
if (!item) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("\311l\351ment inexistant.", "message box title"),
|
tr("Élément inexistant.", "message box title"),
|
||||||
tr("L'\351l\351ment n'existe pas.", "message box content")
|
tr("L'élément n'existe pas.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item -> isElement() || !(element = qobject_cast<ElementDefinition *>(item)) || element -> isNull()) {
|
if (!item -> isElement() || !(element = qobject_cast<ElementDefinition *>(item)) || element -> isNull()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("\311l\351ment inexistant.", "message box title"),
|
tr("Élément inexistant.", "message box title"),
|
||||||
tr("Le chemin virtuel choisi ne correspond pas \340 un \351l\351ment.", "message box content")
|
tr("Le chemin virtuel choisi ne correspond pas à un élément.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -1450,10 +1450,10 @@ void QETElementEditor::fromLocation(const ElementsLocation &location) {
|
|||||||
|
|
||||||
// gestion de la lecture seule
|
// gestion de la lecture seule
|
||||||
if (!element -> isWritable()) {
|
if (!element -> isWritable()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("\311dition en lecture seule", "message box title"),
|
tr("Édition en lecture seule", "message box title"),
|
||||||
tr("Vous n'avez pas les privil\350ges n\351cessaires pour modifier cet \351lement. Il sera donc ouvert en lecture seule.", "message box content")
|
tr("Vous n'avez pas les privilèges nécessaires pour modifier cet élement. Il sera donc ouvert en lecture seule.", "message box content")
|
||||||
);
|
);
|
||||||
setReadOnly(true);
|
setReadOnly(true);
|
||||||
} else {
|
} else {
|
||||||
@@ -1489,7 +1489,7 @@ void QETElementEditor::pasteFromFile() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!error_message.isEmpty()) {
|
if (!error_message.isEmpty()) {
|
||||||
QET::MessageBox::critical(this, tr("Erreur", "toolbar title"), error_message);
|
QET::QetMessageBox::critical(this, tr("Erreur", "toolbar title"), error_message);
|
||||||
}
|
}
|
||||||
copyAndPasteXml(xml_document);
|
copyAndPasteXml(xml_document);
|
||||||
}
|
}
|
||||||
@@ -1507,19 +1507,19 @@ void QETElementEditor::pasteFromElement() {
|
|||||||
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
||||||
ElementDefinition *element = 0;
|
ElementDefinition *element = 0;
|
||||||
if (!item) {
|
if (!item) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("\311l\351ment inexistant.", "message box title"),
|
tr("Élément inexistant.", "message box title"),
|
||||||
tr("L'\351l\351ment n'existe pas.", "message box content")
|
tr("L'élément n'existe pas.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!item -> isElement() || !(element = qobject_cast<ElementDefinition *>(item)) || element -> isNull()) {
|
if (!item -> isElement() || !(element = qobject_cast<ElementDefinition *>(item)) || element -> isNull()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("\311l\351ment inexistant.", "message box title"),
|
tr("Élément inexistant.", "message box title"),
|
||||||
tr("Le chemin virtuel choisi ne correspond pas \340 un \351l\351ment.", "message box content")
|
tr("Le chemin virtuel choisi ne correspond pas à un élément.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef CUSTOM_ELEMENT_EDITOR_H
|
#ifndef CUSTOM_ELEMENT_EDITOR_H
|
||||||
#define CUSTOM_ELEMENT_EDITOR_H
|
#define CUSTOM_ELEMENT_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "qetmainwindow.h"
|
#include "qetmainwindow.h"
|
||||||
#include "qet.h"
|
#include "qet.h"
|
||||||
#include "elementscene.h"
|
#include "elementscene.h"
|
||||||
|
|||||||
@@ -44,15 +44,15 @@ RectangleEditor::RectangleEditor(QETElementEditor *editor, PartRectangle *rect,
|
|||||||
QVBoxLayout *v_layout = new QVBoxLayout(this);
|
QVBoxLayout *v_layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
QGridLayout *grid = new QGridLayout();
|
QGridLayout *grid = new QGridLayout();
|
||||||
grid -> addWidget(new QLabel(tr("Coin sup\351rieur gauche\240: ")), 0, 0, 1, 4);
|
grid -> addWidget(new QLabel(tr("Coin supérieur gauche : ")), 0, 0, 1, 4);
|
||||||
grid -> addWidget(new QLabel("x"), 1, 0, Qt::AlignRight);
|
grid -> addWidget(new QLabel("x"), 1, 0, Qt::AlignRight);
|
||||||
grid -> addWidget(x, 1, 1);
|
grid -> addWidget(x, 1, 1);
|
||||||
grid -> addWidget(new QLabel("y"), 1, 2);
|
grid -> addWidget(new QLabel("y"), 1, 2);
|
||||||
grid -> addWidget(y, 1, 3);
|
grid -> addWidget(y, 1, 3);
|
||||||
grid -> addWidget(new QLabel(tr("Dimensions\240: ")), 2, 0, 1, 4);
|
grid -> addWidget(new QLabel(tr("Dimensions : ")), 2, 0, 1, 4);
|
||||||
grid -> addWidget(new QLabel(tr("Largeur\240:")), 3, 0);
|
grid -> addWidget(new QLabel(tr("Largeur :")), 3, 0);
|
||||||
grid -> addWidget(w, 3, 1);
|
grid -> addWidget(w, 3, 1);
|
||||||
grid -> addWidget(new QLabel(tr("Hauteur\240:")), 4, 0);
|
grid -> addWidget(new QLabel(tr("Hauteur :")), 4, 0);
|
||||||
grid -> addWidget(h, 4, 1);
|
grid -> addWidget(h, 4, 1);
|
||||||
|
|
||||||
v_layout -> addWidget(style_);
|
v_layout -> addWidget(style_);
|
||||||
@@ -118,7 +118,7 @@ void RectangleEditor::updateRectangle() {
|
|||||||
/// Met a jour l'abscisse du coin superieur gauche du rectangle et cree un objet d'annulation
|
/// Met a jour l'abscisse du coin superieur gauche du rectangle et cree un objet d'annulation
|
||||||
void RectangleEditor::updateRectangleX() { addChangePartCommand(tr("abscisse"), part, "rectTopLeft", editedTopLeft());}
|
void RectangleEditor::updateRectangleX() { addChangePartCommand(tr("abscisse"), part, "rectTopLeft", editedTopLeft());}
|
||||||
/// Met a jour l'ordonnee du coin superieur gauche du rectangle et cree un objet d'annulation
|
/// Met a jour l'ordonnee du coin superieur gauche du rectangle et cree un objet d'annulation
|
||||||
void RectangleEditor::updateRectangleY() { addChangePartCommand(tr("ordonn\351e"), part, "rectTopLeft", editedTopLeft());}
|
void RectangleEditor::updateRectangleY() { addChangePartCommand(tr("ordonnée"), part, "rectTopLeft", editedTopLeft());}
|
||||||
/// Met a jour la largeur du rectangle et cree un objet d'annulation
|
/// Met a jour la largeur du rectangle et cree un objet d'annulation
|
||||||
void RectangleEditor::updateRectangleW() { addChangePartCommand(tr("largeur"), part, "width", w -> value());}
|
void RectangleEditor::updateRectangleW() { addChangePartCommand(tr("largeur"), part, "width", w -> value());}
|
||||||
/// Met a jour la hauteur du rectangle et cree un objet d'annulation
|
/// Met a jour la hauteur du rectangle et cree un objet d'annulation
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef RECTANGLE_EDITOR_H
|
#ifndef RECTANGLE_EDITOR_H
|
||||||
#define RECTANGLE_EDITOR_H
|
#define RECTANGLE_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class PartRectangle;
|
class PartRectangle;
|
||||||
class StyleEditor;
|
class StyleEditor;
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
|||||||
line_style = new QComboBox(this);
|
line_style = new QComboBox(this);
|
||||||
line_style -> addItem(tr("Normal", "element part line style"), CustomElementGraphicPart::NormalStyle);
|
line_style -> addItem(tr("Normal", "element part line style"), CustomElementGraphicPart::NormalStyle);
|
||||||
line_style -> addItem(tr("Tiret", "element part line style"), CustomElementGraphicPart::DashedStyle);
|
line_style -> addItem(tr("Tiret", "element part line style"), CustomElementGraphicPart::DashedStyle);
|
||||||
line_style -> addItem(tr("Pointill\351", "element part line style"), CustomElementGraphicPart::DottedStyle);
|
line_style -> addItem(tr("Pointillé", "element part line style"), CustomElementGraphicPart::DottedStyle);
|
||||||
line_style -> addItem(tr("Traits et points", "element part line style"), CustomElementGraphicPart::DashdottedStyle);
|
line_style -> addItem(tr("Traits et points", "element part line style"), CustomElementGraphicPart::DashdottedStyle);
|
||||||
//normal_style -> setChecked(true);
|
//normal_style -> setChecked(true);
|
||||||
|
|
||||||
@@ -50,7 +50,7 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
|||||||
size_weight -> addItem(tr("Fine", "element part weight"), CustomElementGraphicPart::ThinWeight);
|
size_weight -> addItem(tr("Fine", "element part weight"), CustomElementGraphicPart::ThinWeight);
|
||||||
size_weight -> addItem(tr("Normale", "element part weight"), CustomElementGraphicPart::NormalWeight);
|
size_weight -> addItem(tr("Normale", "element part weight"), CustomElementGraphicPart::NormalWeight);
|
||||||
size_weight -> addItem(tr("Forte", "element part weight"), CustomElementGraphicPart::UltraWeight);
|
size_weight -> addItem(tr("Forte", "element part weight"), CustomElementGraphicPart::UltraWeight);
|
||||||
size_weight -> addItem(tr("\311lev\351", "element part weight"), CustomElementGraphicPart::BigWeight);
|
size_weight -> addItem(tr("Élevé", "element part weight"), CustomElementGraphicPart::BigWeight);
|
||||||
|
|
||||||
// remplissage
|
// remplissage
|
||||||
filling_color = new QComboBox (this);
|
filling_color = new QComboBox (this);
|
||||||
@@ -83,14 +83,14 @@ StyleEditor::StyleEditor(QETElementEditor *editor, CustomElementGraphicPart *p,
|
|||||||
style_layout -> addWidget(new QLabel(tr("Style : ")), 0, Qt::AlignRight);
|
style_layout -> addWidget(new QLabel(tr("Style : ")), 0, Qt::AlignRight);
|
||||||
style_layout -> addWidget(line_style);
|
style_layout -> addWidget(line_style);
|
||||||
style_layout -> addSpacing(10);
|
style_layout -> addSpacing(10);
|
||||||
style_layout -> addWidget(new QLabel(tr("\311paisseur : ")), 0, Qt::AlignRight);
|
style_layout -> addWidget(new QLabel(tr("Épaisseur : ")), 0, Qt::AlignRight);
|
||||||
style_layout -> addWidget(size_weight);
|
style_layout -> addWidget(size_weight);
|
||||||
main_layout -> addLayout(style_layout);
|
main_layout -> addLayout(style_layout);
|
||||||
|
|
||||||
main_layout -> addWidget(antialiasing);
|
main_layout -> addWidget(antialiasing);
|
||||||
|
|
||||||
main_layout -> addSpacing(10);
|
main_layout -> addSpacing(10);
|
||||||
main_layout -> addWidget(new QLabel("<u>" + tr("G\351om\351trie :") + "</u> "));
|
main_layout -> addWidget(new QLabel("<u>" + tr("Géométrie :") + "</u> "));
|
||||||
main_layout -> addStretch();
|
main_layout -> addStretch();
|
||||||
setLayout(main_layout);
|
setLayout(main_layout);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef STYLE_EDITOR_H
|
#ifndef STYLE_EDITOR_H
|
||||||
#define STYLE_EDITOR_H
|
#define STYLE_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class CustomElementGraphicPart;
|
class CustomElementGraphicPart;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -115,7 +115,7 @@ void TerminalEditor::updateTerminal() {
|
|||||||
/// Met a jour l'abscisse de la position de la borne et cree un objet d'annulation
|
/// Met a jour l'abscisse de la position de la borne et cree un objet d'annulation
|
||||||
void TerminalEditor::updateTerminalX() { addChangePartCommand(tr("abscisse"), part, "x", qle_x -> value()); }
|
void TerminalEditor::updateTerminalX() { addChangePartCommand(tr("abscisse"), part, "x", qle_x -> value()); }
|
||||||
/// Met a jour l'ordonnee de la position de la borne et cree un objet d'annulation
|
/// Met a jour l'ordonnee de la position de la borne et cree un objet d'annulation
|
||||||
void TerminalEditor::updateTerminalY() { addChangePartCommand(tr("ordonn\351e"), part, "y", qle_y -> value()); }
|
void TerminalEditor::updateTerminalY() { addChangePartCommand(tr("ordonnée"), part, "y", qle_y -> value()); }
|
||||||
/// Met a jour l'orientation de la borne et cree un objet d'annulation
|
/// Met a jour l'orientation de la borne et cree un objet d'annulation
|
||||||
void TerminalEditor::updateTerminalO() { addChangePartCommand(tr("orientation"), part, "orientation", orientation -> itemData(orientation -> currentIndex())); }
|
void TerminalEditor::updateTerminalO() { addChangePartCommand(tr("orientation"), part, "orientation", orientation -> itemData(orientation -> currentIndex())); }
|
||||||
/// update Number and name, create cancel object
|
/// update Number and name, create cancel object
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef TERMINAL_EDITOR_H
|
#ifndef TERMINAL_EDITOR_H
|
||||||
#define TERMINAL_EDITOR_H
|
#define TERMINAL_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class PartTerminal;
|
class PartTerminal;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -134,7 +134,7 @@ void TextEditor::updateText() {
|
|||||||
/// Met a jour l'abscisse de la position du texte et cree un objet d'annulation
|
/// Met a jour l'abscisse de la position du texte et cree un objet d'annulation
|
||||||
void TextEditor::updateTextX() { addChangePartCommand(tr("abscisse"), part, "x", qle_x -> value()); }
|
void TextEditor::updateTextX() { addChangePartCommand(tr("abscisse"), part, "x", qle_x -> value()); }
|
||||||
/// Met a jour l'ordonnee de la position du texte et cree un objet d'annulation
|
/// Met a jour l'ordonnee de la position du texte et cree un objet d'annulation
|
||||||
void TextEditor::updateTextY() { addChangePartCommand(tr("ordonn\351e"), part, "y", qle_y -> value()); }
|
void TextEditor::updateTextY() { addChangePartCommand(tr("ordonnée"), part, "y", qle_y -> value()); }
|
||||||
/// Met a jour le texte et cree un objet d'annulation
|
/// Met a jour le texte et cree un objet d'annulation
|
||||||
void TextEditor::updateTextT() { addChangePartCommand(tr("contenu"), part, "text", qle_text -> text()); }
|
void TextEditor::updateTextT() { addChangePartCommand(tr("contenu"), part, "text", qle_text -> text()); }
|
||||||
/// Met a jour la taille du texte et cree un objet d'annulation
|
/// Met a jour la taille du texte et cree un objet d'annulation
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef TEXT_EDITOR_H
|
#ifndef TEXT_EDITOR_H
|
||||||
#define TEXT_EDITOR_H
|
#define TEXT_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class PartText;
|
class PartText;
|
||||||
class QTextOrientationSpinBoxWidget;
|
class QTextOrientationSpinBoxWidget;
|
||||||
|
|||||||
@@ -34,9 +34,9 @@ TextFieldEditor::TextFieldEditor(QETElementEditor *editor, PartTextField *textfi
|
|||||||
qle_text = new QLineEdit();
|
qle_text = new QLineEdit();
|
||||||
font_size = new QSpinBox();
|
font_size = new QSpinBox();
|
||||||
font_size -> setRange(0, 144);
|
font_size -> setRange(0, 144);
|
||||||
rotate = new QCheckBox(tr("Ne pas subir les rotations de l'\351l\351ment parent"));
|
rotate = new QCheckBox(tr("Ne pas subir les rotations de l'élément parent"));
|
||||||
rotate -> setChecked(true);
|
rotate -> setChecked(true);
|
||||||
QLabel *rotation_angle_label = new QLabel(tr("Angle de rotation par d\351faut : "));
|
QLabel *rotation_angle_label = new QLabel(tr("Angle de rotation par défaut : "));
|
||||||
rotation_angle_label -> setWordWrap(true);
|
rotation_angle_label -> setWordWrap(true);
|
||||||
rotation_angle_ = QETApp::createTextOrientationSpinBoxWidget();
|
rotation_angle_ = QETApp::createTextOrientationSpinBoxWidget();
|
||||||
|
|
||||||
@@ -59,7 +59,7 @@ TextFieldEditor::TextFieldEditor(QETElementEditor *editor, PartTextField *textfi
|
|||||||
main_layout -> addLayout(fs);
|
main_layout -> addLayout(fs);
|
||||||
|
|
||||||
QHBoxLayout *t = new QHBoxLayout();
|
QHBoxLayout *t = new QHBoxLayout();
|
||||||
t -> addWidget(new QLabel(tr("Texte par d\351faut : ")));
|
t -> addWidget(new QLabel(tr("Texte par défaut : ")));
|
||||||
t -> addWidget(qle_text);
|
t -> addWidget(qle_text);
|
||||||
main_layout -> addLayout(t);
|
main_layout -> addLayout(t);
|
||||||
|
|
||||||
@@ -133,13 +133,13 @@ void TextFieldEditor::updateTextField() {
|
|||||||
/// Met a jour l'abscisse de la position du champ de texte et cree un objet d'annulation
|
/// Met a jour l'abscisse de la position du champ de texte et cree un objet d'annulation
|
||||||
void TextFieldEditor::updateTextFieldX() { addChangePartCommand(tr("abscisse"), part, "x", qle_x -> value()); }
|
void TextFieldEditor::updateTextFieldX() { addChangePartCommand(tr("abscisse"), part, "x", qle_x -> value()); }
|
||||||
/// Met a jour l'ordonnee de la position du champ de texte et cree un objet d'annulation
|
/// Met a jour l'ordonnee de la position du champ de texte et cree un objet d'annulation
|
||||||
void TextFieldEditor::updateTextFieldY() { addChangePartCommand(tr("ordonn\351e"), part, "y", qle_y -> value()); }
|
void TextFieldEditor::updateTextFieldY() { addChangePartCommand(tr("ordonnée"), part, "y", qle_y -> value()); }
|
||||||
/// Met a jour le texte du champ de texte et cree un objet d'annulation
|
/// Met a jour le texte du champ de texte et cree un objet d'annulation
|
||||||
void TextFieldEditor::updateTextFieldT() { addChangePartCommand(tr("contenu"), part, "text", qle_text -> text()); }
|
void TextFieldEditor::updateTextFieldT() { addChangePartCommand(tr("contenu"), part, "text", qle_text -> text()); }
|
||||||
/// Met a jour la taille du champ de texte et cree un objet d'annulation
|
/// Met a jour la taille du champ de texte et cree un objet d'annulation
|
||||||
void TextFieldEditor::updateTextFieldS() { addChangePartCommand(tr("taille"), part, "size", font_size -> value()); }
|
void TextFieldEditor::updateTextFieldS() { addChangePartCommand(tr("taille"), part, "size", font_size -> value()); }
|
||||||
/// Met a jour la taille du champ de texte et cree un objet d'annulation
|
/// Met a jour la taille du champ de texte et cree un objet d'annulation
|
||||||
void TextFieldEditor::updateTextFieldR() { addChangePartCommand(tr("propri\351t\351"), part, "rotate", !rotate -> isChecked()); }
|
void TextFieldEditor::updateTextFieldR() { addChangePartCommand(tr("propriété"), part, "rotate", !rotate -> isChecked()); }
|
||||||
/// Met a jour l'angle de rotation du champ de texte et cree un objet d'annulation
|
/// Met a jour l'angle de rotation du champ de texte et cree un objet d'annulation
|
||||||
void TextFieldEditor::updateTextFieldRotationAngle() { addChangePartCommand(tr("angle de rotation"), part, "rotation_angle", rotation_angle_ -> value()); }
|
void TextFieldEditor::updateTextFieldRotationAngle() { addChangePartCommand(tr("angle de rotation"), part, "rotation_angle", rotation_angle_ -> value()); }
|
||||||
void TextFieldEditor::updateTagg() { addChangePartCommand(tr("tagg"), part, "tagg", m_tagg_cb->itemData(m_tagg_cb->currentIndex()).toString());}
|
void TextFieldEditor::updateTagg() { addChangePartCommand(tr("tagg"), part, "tagg", m_tagg_cb->itemData(m_tagg_cb->currentIndex()).toString());}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef TEXTFIELD_EDITOR_H
|
#ifndef TEXTFIELD_EDITOR_H
|
||||||
#define TEXTFIELD_EDITOR_H
|
#define TEXTFIELD_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementitemeditor.h"
|
#include "elementitemeditor.h"
|
||||||
class PartTextField;
|
class PartTextField;
|
||||||
class QTextOrientationSpinBoxWidget;
|
class QTextOrientationSpinBoxWidget;
|
||||||
|
|||||||
@@ -71,20 +71,20 @@ void ElementPropertiesEditorWidget::upDateInterface() {
|
|||||||
void ElementPropertiesEditorWidget::setUpInterface() {
|
void ElementPropertiesEditorWidget::setUpInterface() {
|
||||||
// Type combo box
|
// Type combo box
|
||||||
ui -> m_base_type_cb -> addItem (tr("Simple"), QVariant("simple"));
|
ui -> m_base_type_cb -> addItem (tr("Simple"), QVariant("simple"));
|
||||||
ui -> m_base_type_cb -> addItem (tr("Ma\356tre"), QVariant("master"));
|
ui -> m_base_type_cb -> addItem (tr("Maître"), QVariant("master"));
|
||||||
ui -> m_base_type_cb -> addItem (tr("Esclave"), QVariant("slave"));
|
ui -> m_base_type_cb -> addItem (tr("Esclave"), QVariant("slave"));
|
||||||
ui -> m_base_type_cb -> addItem (tr("Renvoi de folio suivant"), QVariant("next_report"));
|
ui -> m_base_type_cb -> addItem (tr("Renvoi de folio suivant"), QVariant("next_report"));
|
||||||
ui -> m_base_type_cb -> addItem (tr("Renvoi de folio pr\351c\351dent"), QVariant("previous_report"));
|
ui -> m_base_type_cb -> addItem (tr("Renvoi de folio précédent"), QVariant("previous_report"));
|
||||||
ui -> m_base_type_cb -> addItem (tr("Bornier"), QVariant("terminal"));
|
ui -> m_base_type_cb -> addItem (tr("Bornier"), QVariant("terminal"));
|
||||||
|
|
||||||
// Slave option
|
// Slave option
|
||||||
ui -> m_state_cb -> addItem(tr("Normalement ouvert"), QVariant("NO"));
|
ui -> m_state_cb -> addItem(tr("Normalement ouvert"), QVariant("NO"));
|
||||||
ui -> m_state_cb -> addItem(tr("Normalement ferm\351"), QVariant("NC"));
|
ui -> m_state_cb -> addItem(tr("Normalement fermé"), QVariant("NC"));
|
||||||
ui -> m_state_cb -> addItem(tr("Inverseur"), QVariant("SW"));
|
ui -> m_state_cb -> addItem(tr("Inverseur"), QVariant("SW"));
|
||||||
ui -> m_type_cb -> addItem(tr("Simple"), QVariant("simple"));
|
ui -> m_type_cb -> addItem(tr("Simple"), QVariant("simple"));
|
||||||
ui -> m_type_cb -> addItem(tr("Puissance"), QVariant("power"));
|
ui -> m_type_cb -> addItem(tr("Puissance"), QVariant("power"));
|
||||||
ui -> m_type_cb -> addItem(tr("Temporis\351 travail"), QVariant("delayOn"));
|
ui -> m_type_cb -> addItem(tr("Temporisé travail"), QVariant("delayOn"));
|
||||||
ui -> m_type_cb -> addItem(tr("Temporis\351 repos"), QVariant("delayOff"));
|
ui -> m_type_cb -> addItem(tr("Temporisé repos"), QVariant("delayOff"));
|
||||||
|
|
||||||
//Master option
|
//Master option
|
||||||
ui -> m_master_type_cb -> addItem(tr("Bobine"), QVariant("coil"));
|
ui -> m_master_type_cb -> addItem(tr("Bobine"), QVariant("coil"));
|
||||||
|
|||||||
@@ -381,7 +381,7 @@ void ElementDefinition::copy(MoveElementsDescription *mvt_desc) {
|
|||||||
element_copy = target_category -> createElement(mvt_desc -> finalDestinationInternalName());
|
element_copy = target_category -> createElement(mvt_desc -> finalDestinationInternalName());
|
||||||
if (!element_copy) {
|
if (!element_copy) {
|
||||||
if (handler) {
|
if (handler) {
|
||||||
handler -> errorWithAnElement(this, tr("L'\351l\351ment cible n'a pu \352tre cr\351\351."));
|
handler -> errorWithAnElement(this, tr("L'élément cible n'a pu être créé."));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -463,7 +463,7 @@ void ElementDefinition::move(MoveElementsDescription *mvt_desc) {
|
|||||||
bool element_deletion = remove();
|
bool element_deletion = remove();
|
||||||
mvt_desc -> setSourceItemDeleted(element_deletion);
|
mvt_desc -> setSourceItemDeleted(element_deletion);
|
||||||
if (!element_deletion && handler) {
|
if (!element_deletion && handler) {
|
||||||
handler -> errorWithAnElement(this, tr("La suppression de cet \351l\351ment a \351chou\351."));
|
handler -> errorWithAnElement(this, tr("La suppression de cet élément a échoué."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -51,10 +51,10 @@ bool ElementDeleter::exec() {
|
|||||||
if (!element || !element -> isElement()) return(false);
|
if (!element || !element -> isElement()) return(false);
|
||||||
|
|
||||||
// confirmation #1
|
// confirmation #1
|
||||||
QMessageBox::StandardButton answer_1 = QET::MessageBox::question(
|
QMessageBox::StandardButton answer_1 = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
tr("Supprimer l'\351l\351ment ?", "message box title"),
|
tr("Supprimer l'élément ?", "message box title"),
|
||||||
tr("\312tes-vous s\373r de vouloir supprimer cet \351l\351ment ?\n", "message box content"),
|
tr("Êtes-vous s\373r de vouloir supprimer cet élément ?\n", "message box content"),
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel
|
||||||
);
|
);
|
||||||
if (answer_1 != QMessageBox::Yes) return(false);
|
if (answer_1 != QMessageBox::Yes) return(false);
|
||||||
@@ -65,10 +65,10 @@ bool ElementDeleter::exec() {
|
|||||||
|
|
||||||
// supprime l'element
|
// supprime l'element
|
||||||
if (!element -> remove()) {
|
if (!element -> remove()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Suppression de l'\351l\351ment", "message box title"),
|
tr("Suppression de l'élément", "message box title"),
|
||||||
tr("La suppression de l'\351l\351ment a \351chou\351.", "message box content")
|
tr("La suppression de l'élément a échoué.", "message box content")
|
||||||
);
|
);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#define ELEMENT_DELETER_H
|
#define ELEMENT_DELETER_H
|
||||||
#include "elementscategory.h"
|
#include "elementscategory.h"
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
/**
|
/**
|
||||||
This class provides an abstract way to delete an element from its parent
|
This class provides an abstract way to delete an element from its parent
|
||||||
collection. Especially, it requires a confirmation from users.
|
collection. Especially, it requires a confirmation from users.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "elementdialog.h"
|
#include "elementdialog.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
#include "elementscategorieslist.h"
|
#include "elementscategorieslist.h"
|
||||||
#include "elementscollectionitem.h"
|
#include "elementscollectionitem.h"
|
||||||
@@ -41,7 +41,7 @@ ElementDialog::ElementDialog(uint mode, QWidget *parentWidget, QObject *parent)
|
|||||||
{
|
{
|
||||||
dialog_ = new QDialog(parentWidget);
|
dialog_ = new QDialog(parentWidget);
|
||||||
dialog_ -> setWindowModality(Qt::WindowModal);
|
dialog_ -> setWindowModality(Qt::WindowModal);
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
dialog_ -> setWindowFlags(Qt::Sheet);
|
dialog_ -> setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
buttons_ = new QDialogButtonBox();
|
buttons_ = new QDialogButtonBox();
|
||||||
@@ -60,17 +60,17 @@ ElementDialog::ElementDialog(uint mode, QWidget *parentWidget, QObject *parent)
|
|||||||
|
|
||||||
// titre et label
|
// titre et label
|
||||||
if (!mode) {
|
if (!mode) {
|
||||||
title_ = tr("Ouvrir un \351l\351ment", "dialog title");
|
title_ = tr("Ouvrir un élément", "dialog title");
|
||||||
label_ = tr("Choisissez l'\351l\351ment que vous souhaitez ouvrir.", "dialog content");
|
label_ = tr("Choisissez l'élément que vous souhaitez ouvrir.", "dialog content");
|
||||||
} else if (mode == 1) {
|
} else if (mode == 1) {
|
||||||
title_ = tr("Enregistrer un \351l\351ment", "dialog title");
|
title_ = tr("Enregistrer un élément", "dialog title");
|
||||||
label_ = tr("Choisissez l'\351l\351ment dans lequel vous souhaitez enregistrer votre d\351finition.", "dialog content");
|
label_ = tr("Choisissez l'élément dans lequel vous souhaitez enregistrer votre définition.", "dialog content");
|
||||||
} else if (mode == 2) {
|
} else if (mode == 2) {
|
||||||
title_ = tr("Ouvrir une cat\351gorie", "dialog title");
|
title_ = tr("Ouvrir une catégorie", "dialog title");
|
||||||
label_ = tr("Choisissez une cat\351gorie.", "dialog content");
|
label_ = tr("Choisissez une catégorie.", "dialog content");
|
||||||
} else {
|
} else {
|
||||||
title_ = tr("Enregistrer une cat\351gorie", "dialog title");
|
title_ = tr("Enregistrer une catégorie", "dialog title");
|
||||||
label_ = tr("Choisissez une cat\351gorie.", "dialog content");
|
label_ = tr("Choisissez une catégorie.", "dialog content");
|
||||||
}
|
}
|
||||||
|
|
||||||
// mode ouverture / enregistrement
|
// mode ouverture / enregistrement
|
||||||
@@ -240,10 +240,10 @@ void ElementDialog::checkDialog() {
|
|||||||
// on verifie d'abord que l'utilisateur a choisi quelque chose
|
// on verifie d'abord que l'utilisateur a choisi quelque chose
|
||||||
ElementsLocation location = list_ -> selectedLocation();
|
ElementsLocation location = list_ -> selectedLocation();
|
||||||
if (location.isNull()) {
|
if (location.isNull()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("Pas de s\351lection", "message box title"),
|
tr("Pas de sélection", "message box title"),
|
||||||
tr("Vous devez s\351lectionner un \351l\351ment.", "message box content")
|
tr("Vous devez sélectionner un élément.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -251,20 +251,20 @@ void ElementDialog::checkDialog() {
|
|||||||
// on verifie donc que la selection existe
|
// on verifie donc que la selection existe
|
||||||
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("S\351lection inexistante", "message box title"),
|
tr("Sélection inexistante", "message box title"),
|
||||||
tr("La s\351lection n'existe pas.", "message box content")
|
tr("La sélection n'existe pas.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// puis on verifie qu'il s'agit bien d'un element
|
// puis on verifie qu'il s'agit bien d'un element
|
||||||
if (!item -> isElement()) {
|
if (!item -> isElement()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("S\351lection incorrecte", "message box title"),
|
tr("Sélection incorrecte", "message box title"),
|
||||||
tr("La s\351lection n'est pas un \351l\351ment.", "message box content")
|
tr("La sélection n'est pas un élément.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -278,10 +278,10 @@ void ElementDialog::checkDialog() {
|
|||||||
*/
|
*/
|
||||||
ElementsLocation location = list_ -> selectedLocation();
|
ElementsLocation location = list_ -> selectedLocation();
|
||||||
if (location.isNull()) {
|
if (location.isNull()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("Pas de s\351lection", "message box title"),
|
tr("Pas de sélection", "message box title"),
|
||||||
tr("Vous devez s\351lectionner une cat\351gorie ou un \351l\351ment.", "message box content")
|
tr("Vous devez sélectionner une catégorie ou un élément.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -289,10 +289,10 @@ void ElementDialog::checkDialog() {
|
|||||||
// on verifie donc que la selection existe
|
// on verifie donc que la selection existe
|
||||||
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
ElementsCollectionItem *item = QETApp::collectionItem(location);
|
||||||
if (!item) {
|
if (!item) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("S\351lection inexistante", "message box title"),
|
tr("Sélection inexistante", "message box title"),
|
||||||
tr("La s\351lection n'existe pas.", "message box content")
|
tr("La sélection n'existe pas.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -302,23 +302,23 @@ void ElementDialog::checkDialog() {
|
|||||||
QString element_name(textfield_ -> text());
|
QString element_name(textfield_ -> text());
|
||||||
// si on a une categorie (ou une collection), il nous faut un nom d'element
|
// si on a une categorie (ou une collection), il nous faut un nom d'element
|
||||||
if (element_name.isEmpty()) {
|
if (element_name.isEmpty()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("Nom manquant", "message box title"),
|
tr("Nom manquant", "message box title"),
|
||||||
tr("Vous devez entrer un nom pour l'\351l\351ment", "message box content")
|
tr("Vous devez entrer un nom pour l'élément", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ce nom d'element doit etre valide
|
// ce nom d'element doit etre valide
|
||||||
if (QET::containsForbiddenCharacters(element_name)) {
|
if (QET::containsForbiddenCharacters(element_name)) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("Nom invalide", "message box title"),
|
tr("Nom invalide", "message box title"),
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"Vous ne pouvez pas utiliser les caract\350res "
|
"Vous ne pouvez pas utiliser les caractères "
|
||||||
"suivants dans le nom de l'\351l\351ment : %1"
|
"suivants dans le nom de l'élément : %1"
|
||||||
)
|
)
|
||||||
).arg(QET::forbiddenCharactersString(true))
|
).arg(QET::forbiddenCharactersString(true))
|
||||||
);
|
);
|
||||||
@@ -340,10 +340,10 @@ void ElementDialog::checkDialog() {
|
|||||||
|
|
||||||
// si l'element existe, on demande confirmation pour son ecrasement
|
// si l'element existe, on demande confirmation pour son ecrasement
|
||||||
if (element_already_exists) {
|
if (element_already_exists) {
|
||||||
QMessageBox::StandardButton answer = QET::MessageBox::question(
|
QMessageBox::StandardButton answer = QET::QetMessageBox::question(
|
||||||
dialog_,
|
dialog_,
|
||||||
tr("\311craser l'\351l\351ment ?", "message box title"),
|
tr("Écraser l'élément ?", "message box title"),
|
||||||
tr("L'\351l\351ment existe d\351j\340. Voulez-vous l'\351craser ?", "message box content"),
|
tr("L'élément existe déjà. Voulez-vous l'écraser ?", "message box content"),
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
||||||
QMessageBox::No
|
QMessageBox::No
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENTS_CATEGORIES_LIST_H
|
#ifndef ELEMENTS_CATEGORIES_LIST_H
|
||||||
#define ELEMENTS_CATEGORIES_LIST_H
|
#define ELEMENTS_CATEGORIES_LIST_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "qet.h"
|
#include "qet.h"
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include "genericpanel.h"
|
#include "genericpanel.h"
|
||||||
|
|||||||
@@ -31,10 +31,10 @@ ElementsCategoriesWidget::ElementsCategoriesWidget(QWidget *parent) : QWidget(pa
|
|||||||
elementscategorieslist = new ElementsCategoriesList(false, QET::All, this);
|
elementscategorieslist = new ElementsCategoriesList(false, QET::All, this);
|
||||||
|
|
||||||
// actions
|
// actions
|
||||||
action_reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger les cat\351gories"), this);
|
action_reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger les catégories"), this);
|
||||||
action_new = new QAction(QET::Icons::FolderNew, tr("Nouvelle cat\351gorie"), this);
|
action_new = new QAction(QET::Icons::FolderNew, tr("Nouvelle catégorie"), this);
|
||||||
action_open = new QAction(QET::Icons::FolderEdit, tr("\311diter la cat\351gorie"), this);
|
action_open = new QAction(QET::Icons::FolderEdit, tr("Éditer la catégorie"), this);
|
||||||
action_delete = new QAction(QET::Icons::FolderDelete, tr("Supprimer la cat\351gorie"), this);
|
action_delete = new QAction(QET::Icons::FolderDelete, tr("Supprimer la catégorie"), this);
|
||||||
|
|
||||||
// initialise la barre d'outils
|
// initialise la barre d'outils
|
||||||
toolbar = new QToolBar(this);
|
toolbar = new QToolBar(this);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENTS_CATEGORIES_WIDGET_H
|
#ifndef ELEMENTS_CATEGORIES_WIDGET_H
|
||||||
#define ELEMENTS_CATEGORIES_WIDGET_H
|
#define ELEMENTS_CATEGORIES_WIDGET_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
class ElementsCategoriesList;
|
class ElementsCategoriesList;
|
||||||
/**
|
/**
|
||||||
This class provides a widget listing available elements categories along
|
This class provides a widget listing available elements categories along
|
||||||
|
|||||||
@@ -280,7 +280,7 @@ void ElementsCategory::copy(MoveElementsDescription *mvt_desc) {
|
|||||||
// verifie que la source et la destination ne sont pas identiques
|
// verifie que la source et la destination ne sont pas identiques
|
||||||
if (target_category == this || target_category -> isChildOf(this)) {
|
if (target_category == this || target_category -> isChildOf(this)) {
|
||||||
if (handler) {
|
if (handler) {
|
||||||
handler -> errorWithACategory(this, tr("La copie d'une cat\351gorie vers elle-m\352me ou vers l'une de ses sous-cat\351gories n\'est pas g\351r\351e."));
|
handler -> errorWithACategory(this, tr("La copie d'une catégorie vers elle-même ou vers l'une de ses sous-catégories n\'est pas gérée."));
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -469,13 +469,13 @@ void ElementsCategory::move(MoveElementsDescription *mvt_desc) {
|
|||||||
|
|
||||||
// empeche le deplacement s'il s'agit d'une categorie racine
|
// empeche le deplacement s'il s'agit d'une categorie racine
|
||||||
if (isRootCategory()) {
|
if (isRootCategory()) {
|
||||||
if (handler) handler -> errorWithACategory(this, tr("Il n'est pas possible de d\351placer une collection."));
|
if (handler) handler -> errorWithACategory(this, tr("Il n'est pas possible de déplacer une collection."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// empeche le deplacement de la categorie dans une sous-categorie
|
// empeche le deplacement de la categorie dans une sous-categorie
|
||||||
if (target_category == this || target_category -> isChildOf(this)) {
|
if (target_category == this || target_category -> isChildOf(this)) {
|
||||||
if (handler) handler -> errorWithACategory(this, tr("Le d\351placement d'une cat\351gorie dans une de ses sous-cat\351gories n'est pas possible."));
|
if (handler) handler -> errorWithACategory(this, tr("Le déplacement d'une catégorie dans une de ses sous-catégories n'est pas possible."));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -553,7 +553,7 @@ void ElementsCategory::move(MoveElementsDescription *mvt_desc) {
|
|||||||
bool category_deletion = remove();
|
bool category_deletion = remove();
|
||||||
mvt_desc -> setSourceItemDeleted(category_deletion);
|
mvt_desc -> setSourceItemDeleted(category_deletion);
|
||||||
if (!category_deletion && handler) {
|
if (!category_deletion && handler) {
|
||||||
handler -> errorWithACategory(this, tr("La suppression de cette cat\351gorie a \351chou\351."));
|
handler -> errorWithACategory(this, tr("La suppression de cette catégorie a échoué."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -580,7 +580,7 @@ void ElementsCategory::deleteUnusedElements(MoveElementsHandler *handler) {
|
|||||||
if (!parent_project -> usesElement(element -> location())) {
|
if (!parent_project -> usesElement(element -> location())) {
|
||||||
bool element_deletion = element -> remove();
|
bool element_deletion = element -> remove();
|
||||||
if (!element_deletion && handler) {
|
if (!element_deletion && handler) {
|
||||||
handler -> errorWithAnElement(element, tr("Impossible de supprimer l'\351l\351ment"));
|
handler -> errorWithAnElement(element, tr("Impossible de supprimer l'élément"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -601,7 +601,7 @@ void ElementsCategory::deleteEmptyCategories(MoveElementsHandler *handler) {
|
|||||||
if (!sub_category -> isEmpty()) {
|
if (!sub_category -> isEmpty()) {
|
||||||
bool category_deletion = sub_category -> remove();
|
bool category_deletion = sub_category -> remove();
|
||||||
if (!category_deletion && handler) {
|
if (!category_deletion && handler) {
|
||||||
handler -> errorWithACategory(sub_category, tr("Impossible de supprimer la cat\351gorie"));
|
handler -> errorWithACategory(sub_category, tr("Impossible de supprimer la catégorie"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -54,10 +54,10 @@ bool ElementsCategoryDeleter::exec() {
|
|||||||
|
|
||||||
// gere le cas ou la suppression d'une collection est demandee
|
// gere le cas ou la suppression d'une collection est demandee
|
||||||
if (category -> isCollection()) {
|
if (category -> isCollection()) {
|
||||||
QMessageBox::StandardButton answer_0 = QET::MessageBox::question(
|
QMessageBox::StandardButton answer_0 = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
tr("Vider la collection ?", "message box title"),
|
tr("Vider la collection ?", "message box title"),
|
||||||
tr("\312tes-vous s\373r de vouloir vider cette collection ?", "message box content"),
|
tr("Êtes-vous s\373r de vouloir vider cette collection ?", "message box content"),
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel
|
||||||
);
|
);
|
||||||
if (answer_0 != QMessageBox::Yes) return(false);
|
if (answer_0 != QMessageBox::Yes) return(false);
|
||||||
@@ -71,13 +71,13 @@ bool ElementsCategoryDeleter::exec() {
|
|||||||
|
|
||||||
// avertissement pour la suppression d'une collection
|
// avertissement pour la suppression d'une collection
|
||||||
// confirmation #1
|
// confirmation #1
|
||||||
QMessageBox::StandardButton answer_1 = QET::MessageBox::question(
|
QMessageBox::StandardButton answer_1 = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
tr("Supprimer la cat\351gorie ?", "message box title"),
|
tr("Supprimer la catégorie ?", "message box title"),
|
||||||
tr(
|
tr(
|
||||||
"\312tes-vous s\373r de vouloir supprimer la cat\351gorie ?\nTous "
|
"Êtes-vous s\373r de vouloir supprimer la catégorie ?\nTous "
|
||||||
"les \351l\351ments et les cat\351gories contenus dans cette "
|
"les éléments et les catégories contenus dans cette "
|
||||||
"cat\351gorie seront supprim\351s.",
|
"catégorie seront supprimés.",
|
||||||
"message box content"
|
"message box content"
|
||||||
),
|
),
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel
|
||||||
@@ -85,12 +85,12 @@ bool ElementsCategoryDeleter::exec() {
|
|||||||
if (answer_1 != QMessageBox::Yes) return(false);
|
if (answer_1 != QMessageBox::Yes) return(false);
|
||||||
|
|
||||||
// confirmation #2
|
// confirmation #2
|
||||||
QMessageBox::StandardButton answer_2 = QET::MessageBox::question(
|
QMessageBox::StandardButton answer_2 = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
tr("Supprimer la cat\351gorie ?", "message box title"),
|
tr("Supprimer la catégorie ?", "message box title"),
|
||||||
tr(
|
tr(
|
||||||
"\312tes-vous vraiment s\373r de vouloir supprimer cette "
|
"Êtes-vous vraiment s\373r de vouloir supprimer cette "
|
||||||
"cat\351gorie ?\nLes changements seront d\351finitifs.",
|
"catégorie ?\nLes changements seront définitifs.",
|
||||||
"message box content"
|
"message box content"
|
||||||
),
|
),
|
||||||
QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel
|
QMessageBox::Yes|QMessageBox::No|QMessageBox::Cancel
|
||||||
@@ -99,10 +99,10 @@ bool ElementsCategoryDeleter::exec() {
|
|||||||
|
|
||||||
// supprime la categorie
|
// supprime la categorie
|
||||||
if (!category -> remove()) {
|
if (!category -> remove()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Suppression de la cat\351gorie", "message box title"),
|
tr("Suppression de la catégorie", "message box title"),
|
||||||
tr("La suppression de la cat\351gorie a \351chou\351.", "message box content")
|
tr("La suppression de la catégorie a échoué.", "message box content")
|
||||||
);
|
);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#define ELEMENTS_CATEGORY_DELETER_H
|
#define ELEMENTS_CATEGORY_DELETER_H
|
||||||
#include "fileelementscategory.h"
|
#include "fileelementscategory.h"
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
/**
|
/**
|
||||||
This class provide an abstract way to delete an elements category along with
|
This class provide an abstract way to delete an elements category along with
|
||||||
its child elements and subcategories. It always requires a double confirmation
|
its child elements and subcategories. It always requires a double confirmation
|
||||||
|
|||||||
@@ -42,10 +42,10 @@ ElementsCategoryEditor::ElementsCategoryEditor(const ElementsLocation &category_
|
|||||||
if (category_item) category_item = category_item -> toCategory();
|
if (category_item) category_item = category_item -> toCategory();
|
||||||
|
|
||||||
if (!category_item || !category_item -> isCategory()) {
|
if (!category_item || !category_item -> isCategory()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Cat\351gorie inexistante", "message box title"),
|
tr("Catégorie inexistante", "message box title"),
|
||||||
tr("La cat\351gorie demand\351e n'existe pas. Abandon.", "message box content")
|
tr("La catégorie demandée n'existe pas. Abandon.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
@@ -53,7 +53,7 @@ ElementsCategoryEditor::ElementsCategoryEditor(const ElementsLocation &category_
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mode_edit) {
|
if (mode_edit) {
|
||||||
setWindowTitle(tr("\311diter une cat\351gorie", "window title"));
|
setWindowTitle(tr("Éditer une catégorie", "window title"));
|
||||||
connect(buttons, SIGNAL(accepted()), this, SLOT(acceptUpdate()));
|
connect(buttons, SIGNAL(accepted()), this, SLOT(acceptUpdate()));
|
||||||
|
|
||||||
// edition de categorie = affichage des noms deja existants
|
// edition de categorie = affichage des noms deja existants
|
||||||
@@ -61,21 +61,21 @@ ElementsCategoryEditor::ElementsCategoryEditor(const ElementsLocation &category_
|
|||||||
internal_name_ -> setText(category -> pathName());
|
internal_name_ -> setText(category -> pathName());
|
||||||
internal_name_ -> setReadOnly(true);
|
internal_name_ -> setReadOnly(true);
|
||||||
} else {
|
} else {
|
||||||
setWindowTitle(tr("Cr\351er une nouvelle cat\351gorie", "window title"));
|
setWindowTitle(tr("Créer une nouvelle catégorie", "window title"));
|
||||||
connect(buttons, SIGNAL(accepted()), this, SLOT(acceptCreation()));
|
connect(buttons, SIGNAL(accepted()), this, SLOT(acceptCreation()));
|
||||||
|
|
||||||
// nouvelle categorie = une ligne pre-machee
|
// nouvelle categorie = une ligne pre-machee
|
||||||
NamesList cat_names;
|
NamesList cat_names;
|
||||||
cat_names.addName(QLocale::system().name().left(2), tr("Nom de la nouvelle cat\351gorie", "default name when creating a new category"));
|
cat_names.addName(QLocale::system().name().left(2), tr("Nom de la nouvelle catégorie", "default name when creating a new category"));
|
||||||
names_list -> setNames(cat_names);
|
names_list -> setNames(cat_names);
|
||||||
}
|
}
|
||||||
|
|
||||||
// gestion de la lecture seule
|
// gestion de la lecture seule
|
||||||
if (!category -> isWritable()) {
|
if (!category -> isWritable()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("\311dition en lecture seule", "message box title"),
|
tr("Édition en lecture seule", "message box title"),
|
||||||
tr("Vous n'avez pas les privil\350ges n\351cessaires pour modifier cette cat\351gorie. Elle sera donc ouverte en lecture seule.", "message box content")
|
tr("Vous n'avez pas les privilèges nécessaires pour modifier cette catégorie. Elle sera donc ouverte en lecture seule.", "message box content")
|
||||||
);
|
);
|
||||||
names_list -> setReadOnly(true);
|
names_list -> setReadOnly(true);
|
||||||
internal_name_ -> setReadOnly(true);
|
internal_name_ -> setReadOnly(true);
|
||||||
@@ -107,7 +107,7 @@ void ElementsCategoryEditor::buildDialog() {
|
|||||||
internal_name_layout -> addWidget(internal_name_);
|
internal_name_layout -> addWidget(internal_name_);
|
||||||
|
|
||||||
editor_layout -> addLayout(internal_name_layout);
|
editor_layout -> addLayout(internal_name_layout);
|
||||||
editor_layout -> addWidget(new QLabel(tr("Vous pouvez sp\351cifier un nom par langue pour la cat\351gorie.")));
|
editor_layout -> addWidget(new QLabel(tr("Vous pouvez spécifier un nom par langue pour la catégorie.")));
|
||||||
editor_layout -> addWidget(names_list);
|
editor_layout -> addWidget(names_list);
|
||||||
editor_layout -> addWidget(buttons);
|
editor_layout -> addWidget(buttons);
|
||||||
}
|
}
|
||||||
@@ -124,10 +124,10 @@ void ElementsCategoryEditor::acceptCreation() {
|
|||||||
|
|
||||||
// exige un nom de dossier de la part de l'utilisateur
|
// exige un nom de dossier de la part de l'utilisateur
|
||||||
if (!internal_name_ -> isValid()) {
|
if (!internal_name_ -> isValid()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Nom interne manquant", "message box title"),
|
tr("Nom interne manquant", "message box title"),
|
||||||
tr("Vous devez sp\351cifier un nom interne.", "message box content")
|
tr("Vous devez spécifier un nom interne.", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -135,12 +135,12 @@ void ElementsCategoryEditor::acceptCreation() {
|
|||||||
|
|
||||||
// verifie que le nom interne n'est pas deja pris
|
// verifie que le nom interne n'est pas deja pris
|
||||||
if (category -> category(dirname)) {
|
if (category -> category(dirname)) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Nom interne d\351j\340 utilis\351", "message box title"),
|
tr("Nom interne déjà utilisé", "message box title"),
|
||||||
tr(
|
tr(
|
||||||
"Le nom interne que vous avez choisi est d\351j\340 utilis\351 "
|
"Le nom interne que vous avez choisi est déjà utilisé "
|
||||||
"par une cat\351gorie existante. Veuillez en choisir un autre.",
|
"par une catégorie existante. Veuillez en choisir un autre.",
|
||||||
"message box content"
|
"message box content"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -150,10 +150,10 @@ void ElementsCategoryEditor::acceptCreation() {
|
|||||||
// cree la nouvelle categorie
|
// cree la nouvelle categorie
|
||||||
ElementsCategory *new_category = category -> createCategory(dirname);
|
ElementsCategory *new_category = category -> createCategory(dirname);
|
||||||
if (!new_category) {
|
if (!new_category) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Impossible de cr\351er la cat\351gorie", "message box content")
|
tr("Impossible de créer la catégorie", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -166,10 +166,10 @@ void ElementsCategoryEditor::acceptCreation() {
|
|||||||
|
|
||||||
// ecriture de la
|
// ecriture de la
|
||||||
if (!new_category -> write()) {
|
if (!new_category -> write()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Impossible d'enregistrer la cat\351gorie", "message box content")
|
tr("Impossible d'enregistrer la catégorie", "message box content")
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENTS_CATEGORY_EDITOR_H
|
#ifndef ELEMENTS_CATEGORY_EDITOR_H
|
||||||
#define ELEMENTS_CATEGORY_EDITOR_H
|
#define ELEMENTS_CATEGORY_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
class ElementsCategory;
|
class ElementsCategory;
|
||||||
class NamesListWidget;
|
class NamesListWidget;
|
||||||
|
|||||||
@@ -148,7 +148,7 @@ ElementsCollectionItem *ElementsCollection::copy(ElementsCategory *target_catego
|
|||||||
ElementsCollectionItem *ElementsCollection::move(ElementsCategory *, MoveElementsHandler *handler) {
|
ElementsCollectionItem *ElementsCollection::move(ElementsCategory *, MoveElementsHandler *handler) {
|
||||||
if (ElementsCategory *root = rootCategory()) {
|
if (ElementsCategory *root = rootCategory()) {
|
||||||
if (handler) {
|
if (handler) {
|
||||||
handler -> errorWithACategory(root, tr("Il n'est pas possible de d\351placer une collection."));
|
handler -> errorWithACategory(root, tr("Il n'est pas possible de déplacer une collection."));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return(0);
|
return(0);
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ QString ElementsCollectionCache::locale() const {
|
|||||||
@return True if the format change was accepted, false otherwise.
|
@return True if the format change was accepted, false otherwise.
|
||||||
*/
|
*/
|
||||||
bool ElementsCollectionCache::setPixmapStorageFormat(const QString &format) {
|
bool ElementsCollectionCache::setPixmapStorageFormat(const QString &format) {
|
||||||
if (QImageWriter::supportedImageFormats().contains(format.toAscii())) {
|
if (QImageWriter::supportedImageFormats().contains(format.toLatin1())) {
|
||||||
pixmap_storage_format_= format;
|
pixmap_storage_format_= format;
|
||||||
return(true);
|
return(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -287,10 +287,10 @@ void ElementsPanel::startElementDrag(const ElementsLocation &location) {
|
|||||||
mimeData -> setText(location_string);
|
mimeData -> setText(location_string);
|
||||||
|
|
||||||
if (selected_item -> isCategory() || selected_item -> isCollection()) {
|
if (selected_item -> isCategory() || selected_item -> isCollection()) {
|
||||||
mimeData -> setData("application/x-qet-category-uri", location_string.toAscii());
|
mimeData -> setData("application/x-qet-category-uri", location_string.toLatin1());
|
||||||
drag -> setPixmap(QET::Icons::Folder.pixmap(22, 22));
|
drag -> setPixmap(QET::Icons::Folder.pixmap(22, 22));
|
||||||
} else if (selected_item -> isElement()) {
|
} else if (selected_item -> isElement()) {
|
||||||
mimeData -> setData("application/x-qet-element-uri", location_string.toAscii());
|
mimeData -> setData("application/x-qet-element-uri", location_string.toLatin1());
|
||||||
|
|
||||||
// element temporaire pour fournir un apercu
|
// element temporaire pour fournir un apercu
|
||||||
int elmt_creation_state;
|
int elmt_creation_state;
|
||||||
@@ -335,7 +335,7 @@ void ElementsPanel::startTitleBlockTemplateDrag(const TitleBlockTemplateLocation
|
|||||||
|
|
||||||
QMimeData *mime_data = new QMimeData();
|
QMimeData *mime_data = new QMimeData();
|
||||||
mime_data -> setText(location_string);
|
mime_data -> setText(location_string);
|
||||||
mime_data -> setData("application/x-qet-titleblock-uri", location_string.toAscii());
|
mime_data -> setData("application/x-qet-titleblock-uri", location_string.toLatin1());
|
||||||
|
|
||||||
QDrag *drag = new QDrag(this);
|
QDrag *drag = new QDrag(this);
|
||||||
drag -> setMimeData(mime_data);
|
drag -> setMimeData(mime_data);
|
||||||
@@ -415,7 +415,7 @@ QTreeWidgetItem *ElementsPanel::addProject(QETProject *project) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
qtwi_project -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper ce projet", "Status tip"));
|
qtwi_project -> setStatusTip(0, tr("Double-cliquez pour réduire ou développer ce projet", "Status tip"));
|
||||||
|
|
||||||
return(qtwi_project);
|
return(qtwi_project);
|
||||||
}
|
}
|
||||||
@@ -438,8 +438,8 @@ QTreeWidgetItem *ElementsPanel::addCollection(ElementsCollection *collection) {
|
|||||||
QTreeWidgetItem *ElementsPanel::updateTemplatesCollectionItem(QTreeWidgetItem *tbt_collection_qtwi, TitleBlockTemplatesCollection *tbt_collection, PanelOptions options, bool freshly_created) {
|
QTreeWidgetItem *ElementsPanel::updateTemplatesCollectionItem(QTreeWidgetItem *tbt_collection_qtwi, TitleBlockTemplatesCollection *tbt_collection, PanelOptions options, bool freshly_created) {
|
||||||
QTreeWidgetItem *tbtc_qtwi = GenericPanel::updateTemplatesCollectionItem(tbt_collection_qtwi, tbt_collection, options, freshly_created);
|
QTreeWidgetItem *tbtc_qtwi = GenericPanel::updateTemplatesCollectionItem(tbt_collection_qtwi, tbt_collection, options, freshly_created);
|
||||||
if (tbt_collection && tbt_collection -> parentProject()) {
|
if (tbt_collection && tbt_collection -> parentProject()) {
|
||||||
tbtc_qtwi -> setText(0, tr("Cartouches embarqu\351s"));
|
tbtc_qtwi -> setText(0, tr("Cartouches embarqués"));
|
||||||
tbtc_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection de cartouches embarqu\351e", "Status tip"));
|
tbtc_qtwi -> setStatusTip(0, tr("Double-cliquez pour réduire ou développer cette collection de cartouches embarquée", "Status tip"));
|
||||||
}
|
}
|
||||||
return(tbtc_qtwi);
|
return(tbtc_qtwi);
|
||||||
}
|
}
|
||||||
@@ -449,7 +449,7 @@ QTreeWidgetItem *ElementsPanel::updateTemplateItem(QTreeWidgetItem *tb_template_
|
|||||||
item -> setStatusTip(
|
item -> setStatusTip(
|
||||||
0,
|
0,
|
||||||
tr(
|
tr(
|
||||||
"Cliquer-d\351posez ce mod\350le de cartouche sur un sch\351ma pour l'y appliquer.",
|
"Cliquer-déposez ce modèle de cartouche sur un schéma pour l'y appliquer.",
|
||||||
"Status tip displayed when selecting a title block template"
|
"Status tip displayed when selecting a title block template"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -461,7 +461,7 @@ QTreeWidgetItem *ElementsPanel::updateElementsCategoryItem(QTreeWidgetItem *cate
|
|||||||
item -> setStatusTip(
|
item -> setStatusTip(
|
||||||
0,
|
0,
|
||||||
tr(
|
tr(
|
||||||
"Double-cliquez pour r\351duire ou d\351velopper cette cat\351gorie d'\351l\351ments",
|
"Double-cliquez pour réduire ou développer cette catégorie d'éléments",
|
||||||
"Status tip displayed by elements category"
|
"Status tip displayed by elements category"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -472,8 +472,8 @@ QTreeWidgetItem *ElementsPanel::updateElementsCategoryItem(QTreeWidgetItem *cate
|
|||||||
QTreeWidgetItem *ElementsPanel::updateElementsCollectionItem(QTreeWidgetItem *collection_qtwi, ElementsCollection *collection, PanelOptions options, bool freshly_created) {
|
QTreeWidgetItem *ElementsPanel::updateElementsCollectionItem(QTreeWidgetItem *collection_qtwi, ElementsCollection *collection, PanelOptions options, bool freshly_created) {
|
||||||
QTreeWidgetItem *c_qtwi = GenericPanel::updateElementsCollectionItem(collection_qtwi, collection, options, freshly_created);
|
QTreeWidgetItem *c_qtwi = GenericPanel::updateElementsCollectionItem(collection_qtwi, collection, options, freshly_created);
|
||||||
if (collection && collection -> project()) {
|
if (collection && collection -> project()) {
|
||||||
c_qtwi -> setText(0, tr("Collection embarqu\351e"));
|
c_qtwi -> setText(0, tr("Collection embarquée"));
|
||||||
c_qtwi -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper cette collection d'\351l\351ments embarqu\351e", "Status tip"));
|
c_qtwi -> setStatusTip(0, tr("Double-cliquez pour réduire ou développer cette collection d'éléments embarquée", "Status tip"));
|
||||||
}
|
}
|
||||||
return(c_qtwi);
|
return(c_qtwi);
|
||||||
}
|
}
|
||||||
@@ -482,7 +482,7 @@ QTreeWidgetItem *ElementsPanel::updateElementItem(QTreeWidgetItem *element_qtwi,
|
|||||||
QTreeWidgetItem *item = GenericPanel::updateElementItem(element_qtwi, element, options, freshly_created);
|
QTreeWidgetItem *item = GenericPanel::updateElementItem(element_qtwi, element, options, freshly_created);
|
||||||
|
|
||||||
QString status_tip = tr(
|
QString status_tip = tr(
|
||||||
"Cliquer-d\351posez cet \351l\351ment sur un sch\351ma pour y ins\351rer un \351l\351ment \253 %1 \273, double-cliquez dessus pour l'\351diter",
|
"Cliquer-déposez cet élément sur un schéma pour y insérer un élément « %1 », double-cliquez dessus pour l'éditer",
|
||||||
"Status tip displayed in the status bar when selecting an element"
|
"Status tip displayed in the status bar when selecting an element"
|
||||||
);
|
);
|
||||||
item -> setStatusTip(0, status_tip.arg(item -> text(0)));
|
item -> setStatusTip(0, status_tip.arg(item -> text(0)));
|
||||||
@@ -587,8 +587,8 @@ void ElementsPanel::reload(bool reload_collections) {
|
|||||||
TitleBlockTemplatesCollection *common_tbt_collection = QETApp::commonTitleBlockTemplatesCollection();
|
TitleBlockTemplatesCollection *common_tbt_collection = QETApp::commonTitleBlockTemplatesCollection();
|
||||||
common_tbt_collection_item_ = addTemplatesCollection(common_tbt_collection, invisibleRootItem());
|
common_tbt_collection_item_ = addTemplatesCollection(common_tbt_collection, invisibleRootItem());
|
||||||
common_tbt_collection_item_ -> setIcon(0, system_icon);
|
common_tbt_collection_item_ -> setIcon(0, system_icon);
|
||||||
common_tbt_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper la collection de cartouches QElectroTech", "Status tip"));
|
common_tbt_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour réduire ou développer la collection de cartouches QElectroTech", "Status tip"));
|
||||||
common_tbt_collection_item_ -> setWhatsThis(0, tr("Ceci est la collection de cartouches fournie avec QElectroTech. Install\351e en tant que composant syst\350me, vous ne pouvez normalement pas la personnaliser.", "\"What's this\" tip"));
|
common_tbt_collection_item_ -> setWhatsThis(0, tr("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"));
|
||||||
if (first_reload_) common_tbt_collection_item_ -> setExpanded(true);
|
if (first_reload_) common_tbt_collection_item_ -> setExpanded(true);
|
||||||
|
|
||||||
// load the common elements collection
|
// load the common elements collection
|
||||||
@@ -596,8 +596,8 @@ void ElementsPanel::reload(bool reload_collections) {
|
|||||||
// first check local
|
// first check local
|
||||||
QETApp::commonElementsCollection()->cache()->setLocale(QETApp::langFromSetting());
|
QETApp::commonElementsCollection()->cache()->setLocale(QETApp::langFromSetting());
|
||||||
common_collection_item_ = addCollection(QETApp::commonElementsCollection());
|
common_collection_item_ = addCollection(QETApp::commonElementsCollection());
|
||||||
common_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper la collection d'\351l\351ments QElectroTech", "Status tip"));
|
common_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour réduire ou développer la collection d'éléments QElectroTech", "Status tip"));
|
||||||
common_collection_item_ -> setWhatsThis(0, tr("Ceci est la collection d'\351l\351ments fournie avec QElectroTech. Install\351e en tant que composant syst\350me, vous ne pouvez normalement pas la personnaliser.", "\"What's this\" tip"));
|
common_collection_item_ -> setWhatsThis(0, tr("Ceci est la collection d'éléments fournie avec QElectroTech. Installée en tant que composant système, vous ne pouvez normalement pas la personnaliser.", "\"What's this\" tip"));
|
||||||
if (first_reload_) common_collection_item_ -> setExpanded(true);
|
if (first_reload_) common_collection_item_ -> setExpanded(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -605,8 +605,8 @@ void ElementsPanel::reload(bool reload_collections) {
|
|||||||
TitleBlockTemplatesCollection *custom_tbt_collection = QETApp::customTitleBlockTemplatesCollection();
|
TitleBlockTemplatesCollection *custom_tbt_collection = QETApp::customTitleBlockTemplatesCollection();
|
||||||
custom_tbt_collection_item_ = addTemplatesCollection(custom_tbt_collection, invisibleRootItem());
|
custom_tbt_collection_item_ = addTemplatesCollection(custom_tbt_collection, invisibleRootItem());
|
||||||
custom_tbt_collection_item_ -> setIcon(0, user_icon);
|
custom_tbt_collection_item_ -> setIcon(0, user_icon);
|
||||||
custom_tbt_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper votre collection personnelle de cartouches", "Status tip"));
|
custom_tbt_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour réduire ou développer votre collection personnelle de cartouches", "Status tip"));
|
||||||
custom_tbt_collection_item_ -> setWhatsThis(0, tr("Ceci est votre collection personnelle de cartouches -- utilisez-la pour cr\351er, stocker et \351diter vos propres cartouches.", "\"What's this\" tip"));
|
custom_tbt_collection_item_ -> setWhatsThis(0, tr("Ceci est votre collection personnelle de cartouches -- utilisez-la pour créer, stocker et éditer vos propres cartouches.", "\"What's this\" tip"));
|
||||||
if (first_reload_) custom_tbt_collection_item_ -> setExpanded(true);
|
if (first_reload_) custom_tbt_collection_item_ -> setExpanded(true);
|
||||||
|
|
||||||
// load the custom elements collection
|
// load the custom elements collection
|
||||||
@@ -614,8 +614,8 @@ void ElementsPanel::reload(bool reload_collections) {
|
|||||||
// first check local
|
// first check local
|
||||||
QETApp::customElementsCollection()->cache()->setLocale(QETApp::langFromSetting());
|
QETApp::customElementsCollection()->cache()->setLocale(QETApp::langFromSetting());
|
||||||
custom_collection_item_ = addCollection(QETApp::customElementsCollection());
|
custom_collection_item_ = addCollection(QETApp::customElementsCollection());
|
||||||
custom_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour r\351duire ou d\351velopper votre collection personnelle d'\351l\351ments", "Status tip"));
|
custom_collection_item_ -> setStatusTip(0, tr("Double-cliquez pour réduire ou développer votre collection personnelle d'éléments", "Status tip"));
|
||||||
custom_collection_item_ -> setWhatsThis(0, tr("Ceci est votre collection personnelle d'\351l\351ments -- utilisez-la pour cr\351er, stocker et \351diter vos propres \351l\351ments.", "\"What's this\" tip"));
|
custom_collection_item_ -> setWhatsThis(0, tr("Ceci est votre collection personnelle d'éléments -- utilisez-la pour créer, stocker et éditer vos propres éléments.", "\"What's this\" tip"));
|
||||||
if (first_reload_) custom_collection_item_ -> setExpanded(true);
|
if (first_reload_) custom_collection_item_ -> setExpanded(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef PANELAPPAREILS_H
|
#ifndef PANELAPPAREILS_H
|
||||||
#define PANELAPPAREILS_H
|
#define PANELAPPAREILS_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "genericpanel.h"
|
#include "genericpanel.h"
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include "templatelocation.h"
|
#include "templatelocation.h"
|
||||||
|
|||||||
@@ -54,31 +54,31 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
|
|||||||
|
|
||||||
// initialise les actions
|
// initialise les actions
|
||||||
open_directory = new QAction(QET::Icons::DocumentOpen, tr("Ouvrir le dossier correspondant"), this);
|
open_directory = new QAction(QET::Icons::DocumentOpen, tr("Ouvrir le dossier correspondant"), this);
|
||||||
copy_path = new QAction(QET::Icons::CopyFile, tr("Copier le chemin"), this);
|
copy_path = new QAction(QET::Icons::IC_CopyFile, tr("Copier le chemin"), this);
|
||||||
reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger les collections"), this);
|
reload = new QAction(QET::Icons::ViewRefresh, tr("Recharger les collections"), this);
|
||||||
new_category = new QAction(QET::Icons::FolderNew, tr("Nouvelle cat\351gorie"), this);
|
new_category = new QAction(QET::Icons::FolderNew, tr("Nouvelle catégorie"), this);
|
||||||
edit_category = new QAction(QET::Icons::FolderEdit, tr("\311diter la cat\351gorie"), this);
|
edit_category = new QAction(QET::Icons::FolderEdit, tr("Éditer la catégorie"), this);
|
||||||
delete_category = new QAction(QET::Icons::FolderDelete, tr("Supprimer la cat\351gorie"), this);
|
delete_category = new QAction(QET::Icons::FolderDelete, tr("Supprimer la catégorie"), this);
|
||||||
delete_collection = new QAction(QET::Icons::FolderDelete, tr("Vider la collection"), this);
|
delete_collection = new QAction(QET::Icons::FolderDelete, tr("Vider la collection"), this);
|
||||||
new_element = new QAction(QET::Icons::ElementNew, tr("Nouvel \351l\351ment"), this);
|
new_element = new QAction(QET::Icons::ElementNew, tr("Nouvel élément"), this);
|
||||||
edit_element = new QAction(QET::Icons::ElementEdit, tr("\311diter l'\351l\351ment"), this);
|
edit_element = new QAction(QET::Icons::ElementEdit, tr("Éditer l'élément"), this);
|
||||||
delete_element = new QAction(QET::Icons::ElementDelete, tr("Supprimer l'\351l\351ment"), this);
|
delete_element = new QAction(QET::Icons::ElementDelete, tr("Supprimer l'élément"), this);
|
||||||
open_element = new QAction(QET::Icons::DocumentImport, tr("Ouvrir un fichier \351l\351ment"), this);
|
open_element = new QAction(QET::Icons::DocumentImport, tr("Ouvrir un fichier élément"), this);
|
||||||
prj_activate = new QAction(QET::Icons::ProjectFile, tr("Basculer vers ce projet"), this);
|
prj_activate = new QAction(QET::Icons::ProjectFile, tr("Basculer vers ce projet"), this);
|
||||||
prj_close = new QAction(QET::Icons::DocumentClose, tr("Fermer ce projet"), this);
|
prj_close = new QAction(QET::Icons::DocumentClose, tr("Fermer ce projet"), this);
|
||||||
prj_edit_prop = new QAction(QET::Icons::DialogInformation, tr("Propri\351t\351s du projet"), this);
|
prj_edit_prop = new QAction(QET::Icons::DialogInformation, tr("Propriétés du projet"), this);
|
||||||
prj_prop_diagram = new QAction(QET::Icons::DialogInformation, tr("Propri\351t\351s du sch\351ma"), this);
|
prj_prop_diagram = new QAction(QET::Icons::DialogInformation, tr("Propriétés du schéma"), this);
|
||||||
prj_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un sch\351ma"), this);
|
prj_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un schéma"), this);
|
||||||
prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer ce sch\351ma"), this);
|
prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer ce schéma"), this);
|
||||||
prj_move_diagram_up = new QAction(QET::Icons::GoUp, tr("Remonter ce sch\351ma"), this);
|
prj_move_diagram_up = new QAction(QET::Icons::GoUp, tr("Remonter ce schéma"), this);
|
||||||
prj_move_diagram_down = new QAction(QET::Icons::GoDown, tr("Abaisser ce sch\351ma"), this);
|
prj_move_diagram_down = new QAction(QET::Icons::GoDown, tr("Abaisser ce schéma"), this);
|
||||||
prj_move_diagram_upx10 = new QAction(QET::Icons::GoUp, tr("Remonter ce sch\351ma x10"), this);
|
prj_move_diagram_upx10 = new QAction(QET::Icons::GoUp, tr("Remonter ce schéma x10"), this);
|
||||||
prj_move_diagram_downx10 = new QAction(QET::Icons::GoDown, tr("Abaisser ce sch\351ma x10"), this);
|
prj_move_diagram_downx10 = new QAction(QET::Icons::GoDown, tr("Abaisser ce schéma x10"), this);
|
||||||
tbt_add = new QAction(QET::Icons::TitleBlock, tr("Nouveau mod\350le"), this);
|
tbt_add = new QAction(QET::Icons::TitleBlock, tr("Nouveau modèle"), this);
|
||||||
tbt_edit = new QAction(QET::Icons::TitleBlock, tr("\311diter ce mod\350le"), this);
|
tbt_edit = new QAction(QET::Icons::TitleBlock, tr("Éditer ce modèle"), this);
|
||||||
tbt_remove = new QAction(QET::Icons::TitleBlock, tr("Supprimer ce mod\350le"), this);
|
tbt_remove = new QAction(QET::Icons::TitleBlock, tr("Supprimer ce modèle"), this);
|
||||||
move_elements_ = new QAction(QET::Icons::MoveFile, tr("D\351placer dans cette cat\351gorie"), this);
|
move_elements_ = new QAction(QET::Icons::IC_MoveFile, tr("Déplacer dans cette catégorie"), this);
|
||||||
copy_elements_ = new QAction(QET::Icons::CopyFile, tr("Copier dans cette cat\351gorie"), this);
|
copy_elements_ = new QAction(QET::Icons::IC_CopyFile, tr("Copier dans cette catégorie"), this);
|
||||||
cancel_elements_ = new QAction(QET::Icons::Cancel, tr("Annuler"), this);
|
cancel_elements_ = new QAction(QET::Icons::Cancel, tr("Annuler"), this);
|
||||||
erase_textfield = new QAction(QET::Icons::EditClearLocationBar, tr("Effacer le filtre"), this);
|
erase_textfield = new QAction(QET::Icons::EditClearLocationBar, tr("Effacer le filtre"), this);
|
||||||
|
|
||||||
@@ -92,12 +92,13 @@ ElementsPanelWidget::ElementsPanelWidget(QWidget *parent) : QWidget(parent) {
|
|||||||
filter_toolbar -> addWidget(filter_label);
|
filter_toolbar -> addWidget(filter_label);
|
||||||
filter_toolbar -> addWidget(filter_textfield);
|
filter_toolbar -> addWidget(filter_textfield);
|
||||||
|
|
||||||
|
//@TODO remove the commented code below
|
||||||
// ajoute une petite marge a la droite du champ pour filtrer lorsque le style CleanLooks est utilise
|
// ajoute une petite marge a la droite du champ pour filtrer lorsque le style CleanLooks est utilise
|
||||||
if (qobject_cast<QCleanlooksStyle *>(QApplication::style())) {
|
// if (qobject_cast<QCleanlooksStyle *>(QApplication::style())) {
|
||||||
int l, t, r, b;
|
// int l, t, r, b;
|
||||||
filter_toolbar -> getContentsMargins(&l, &t, &r, &b);
|
// filter_toolbar -> getContentsMargins(&l, &t, &r, &b);
|
||||||
filter_toolbar -> setContentsMargins (l, t, r + 4, b);
|
// filter_toolbar -> setContentsMargins (l, t, r + 4, b);
|
||||||
}
|
// }
|
||||||
|
|
||||||
context_menu = new QMenu(this);
|
context_menu = new QMenu(this);
|
||||||
|
|
||||||
@@ -497,10 +498,10 @@ void ElementsPanelWidget::setElementsActionEnabled(bool enable) {
|
|||||||
int ElementsPanelWidget::launchCategoriesManager() {
|
int ElementsPanelWidget::launchCategoriesManager() {
|
||||||
QDialog new_category_dialog(this);
|
QDialog new_category_dialog(this);
|
||||||
new_category_dialog.setMinimumSize(480, 280);
|
new_category_dialog.setMinimumSize(480, 280);
|
||||||
new_category_dialog.setWindowTitle(tr("Gestionnaire de cat\351gories", "window title"));
|
new_category_dialog.setWindowTitle(tr("Gestionnaire de catégories", "window title"));
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout(&new_category_dialog);
|
QVBoxLayout *layout = new QVBoxLayout(&new_category_dialog);
|
||||||
QLabel *explication = new QLabel(tr("Vous pouvez utiliser ce gestionnaire pour ajouter, supprimer ou modifier les cat\351gories."));
|
QLabel *explication = new QLabel(tr("Vous pouvez utiliser ce gestionnaire pour ajouter, supprimer ou modifier les catégories."));
|
||||||
explication -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
explication -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
||||||
explication -> setWordWrap(true);
|
explication -> setWordWrap(true);
|
||||||
layout -> addWidget(explication);
|
layout -> addWidget(explication);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENTS_PANEL_WIDGET_H
|
#ifndef ELEMENTS_PANEL_WIDGET_H
|
||||||
#define ELEMENTS_PANEL_WIDGET_H
|
#define ELEMENTS_PANEL_WIDGET_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementspanel.h"
|
#include "elementspanel.h"
|
||||||
/**
|
/**
|
||||||
This class embeds an elements panel under a toolbar providing various actions
|
This class embeds an elements panel under a toolbar providing various actions
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef ELEMENT_TEXTS_MOVER_H
|
#ifndef ELEMENT_TEXTS_MOVER_H
|
||||||
#define ELEMENT_TEXTS_MOVER_H
|
#define ELEMENT_TEXTS_MOVER_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "diagramcontent.h"
|
#include "diagramcontent.h"
|
||||||
class ElementTextItem;
|
class ElementTextItem;
|
||||||
class Diagram;
|
class Diagram;
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ ExportDialog::ExportDialog(QETProject *project, QWidget *parent) : QDialog(paren
|
|||||||
// la taille minimale du dialogue est fixee
|
// la taille minimale du dialogue est fixee
|
||||||
setMinimumSize(800, 390);
|
setMinimumSize(800, 390);
|
||||||
resize(minimumSize());
|
resize(minimumSize());
|
||||||
setWindowTitle(tr("Exporter les sch\351mas du projet", "window title"));
|
setWindowTitle(tr("Exporter les schémas du projet", "window title"));
|
||||||
|
|
||||||
// options d'export, dans le widget epw
|
// options d'export, dans le widget epw
|
||||||
epw = new ExportPropertiesWidget(default_export_properties);
|
epw = new ExportPropertiesWidget(default_export_properties);
|
||||||
@@ -72,11 +72,11 @@ ExportDialog::ExportDialog(QETProject *project, QWidget *parent) : QDialog(paren
|
|||||||
// disposition des elements
|
// disposition des elements
|
||||||
|
|
||||||
QHBoxLayout *hLayout = new QHBoxLayout();
|
QHBoxLayout *hLayout = new QHBoxLayout();
|
||||||
hLayout -> addWidget(new QLabel(tr("Choisissez les sch\351mas que vous d\351sirez exporter ainsi que leurs dimensions :")));
|
hLayout -> addWidget(new QLabel(tr("Choisissez les schémas que vous désirez exporter ainsi que leurs dimensions :")));
|
||||||
selectAll = new QPushButton();
|
selectAll = new QPushButton();
|
||||||
deSelectAll = new QPushButton();
|
deSelectAll = new QPushButton();
|
||||||
selectAll -> setText(tr("Tout cocher"));
|
selectAll -> setText(tr("Tout cocher"));
|
||||||
deSelectAll -> setText(tr("Tout d\351cocher"));
|
deSelectAll -> setText(tr("Tout décocher"));
|
||||||
hLayout -> addWidget(selectAll);
|
hLayout -> addWidget(selectAll);
|
||||||
hLayout -> addWidget(deSelectAll);
|
hLayout -> addWidget(deSelectAll);
|
||||||
connect(selectAll, SIGNAL(clicked()), this, SLOT(slot_selectAllClicked()));
|
connect(selectAll, SIGNAL(clicked()), this, SLOT(slot_selectAllClicked()));
|
||||||
@@ -138,7 +138,7 @@ QWidget *ExportDialog::initDiagramsListPart() {
|
|||||||
diagrams_list_layout_ = new QGridLayout();
|
diagrams_list_layout_ = new QGridLayout();
|
||||||
|
|
||||||
int line_count = 0;
|
int line_count = 0;
|
||||||
diagrams_list_layout_ -> addWidget(new QLabel(tr("Sch\351ma")), line_count, 1, Qt::AlignHCenter | Qt::AlignVCenter);
|
diagrams_list_layout_ -> addWidget(new QLabel(tr("Schéma")), line_count, 1, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
diagrams_list_layout_ -> addWidget(new QLabel(tr("Nom de fichier")), line_count, 2, Qt::AlignHCenter | Qt::AlignVCenter);
|
diagrams_list_layout_ -> addWidget(new QLabel(tr("Nom de fichier")), line_count, 2, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
diagrams_list_layout_ -> addWidget(new QLabel(tr("Dimensions")), line_count, 3, Qt::AlignHCenter | Qt::AlignVCenter);
|
diagrams_list_layout_ -> addWidget(new QLabel(tr("Dimensions")), line_count, 3, Qt::AlignHCenter | Qt::AlignVCenter);
|
||||||
|
|
||||||
@@ -764,12 +764,12 @@ void ExportDialog::slot_export() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (filenames.count() != diagrams_to_export.count()) {
|
if (filenames.count() != diagrams_to_export.count()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Noms des fichiers cibles", "message box title"),
|
tr("Noms des fichiers cibles", "message box title"),
|
||||||
tr(
|
tr(
|
||||||
"Vous devez entrer un nom de fichier non vide et unique pour chaque "
|
"Vous devez entrer un nom de fichier non vide et unique pour chaque "
|
||||||
"sch\351ma \340 exporter.",
|
"schéma à exporter.",
|
||||||
"message box content"
|
"message box content"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -780,10 +780,10 @@ void ExportDialog::slot_export() {
|
|||||||
|
|
||||||
QDir target_dir_path(epw -> exportProperties().destination_directory);
|
QDir target_dir_path(epw -> exportProperties().destination_directory);
|
||||||
if (!target_dir_path.exists()) {
|
if (!target_dir_path.exists()) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Dossier non sp\351cifi\351", "message box title"),
|
tr("Dossier non spécifié", "message box title"),
|
||||||
tr("Vous devez sp\351cifier le chemin du dossier dans lequel seront enregistr\351s les fichiers images.", "message box content"),
|
tr("Vous devez spécifier le chemin du dossier dans lequel seront enregistrés les fichiers images.", "message box content"),
|
||||||
QMessageBox::Ok
|
QMessageBox::Ok
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
@@ -822,13 +822,13 @@ void ExportDialog::exportDiagram(ExportDiagramLine *diagram_line) {
|
|||||||
|
|
||||||
// verifie qu'il est possible d'ecrire dans le fichier en question
|
// verifie qu'il est possible d'ecrire dans le fichier en question
|
||||||
if (file_infos.exists() && !file_infos.isWritable()) {
|
if (file_infos.exists() && !file_infos.isWritable()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Impossible d'\351crire dans ce fichier", "message box title"),
|
tr("Impossible d'écrire dans ce fichier", "message box title"),
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"Il semblerait que vous n'ayez pas les permissions "
|
"Il semblerait que vous n'ayez pas les permissions "
|
||||||
"n\351cessaires pour \351crire dans le fichier %1.",
|
"nécessaires pour écrire dans le fichier %1.",
|
||||||
"message box content"
|
"message box content"
|
||||||
)
|
)
|
||||||
).arg(diagram_path),
|
).arg(diagram_path),
|
||||||
@@ -942,7 +942,7 @@ void ExportDialog::slot_previewDiagram(int diagram_id) {
|
|||||||
|
|
||||||
// initialise un dialogue
|
// initialise un dialogue
|
||||||
QDialog preview_dialog;
|
QDialog preview_dialog;
|
||||||
preview_dialog.setWindowTitle(tr("Aper\347u"));
|
preview_dialog.setWindowTitle(tr("Aperçu"));
|
||||||
preview_dialog.setWindowState(preview_dialog.windowState() | Qt::WindowMaximized);
|
preview_dialog.setWindowState(preview_dialog.windowState() | Qt::WindowMaximized);
|
||||||
|
|
||||||
QGraphicsScene *preview_scene = new QGraphicsScene();
|
QGraphicsScene *preview_scene = new QGraphicsScene();
|
||||||
@@ -1031,7 +1031,7 @@ ExportDialog::ExportDiagramLine::ExportDiagramLine(Diagram *dia, QSize diagram_s
|
|||||||
|
|
||||||
// titre et nom de fichier du schema
|
// titre et nom de fichier du schema
|
||||||
QString diagram_title = diagram -> title();
|
QString diagram_title = diagram -> title();
|
||||||
if (diagram_title.isEmpty()) diagram_title = QObject::tr("Sch\351ma sans titre");
|
if (diagram_title.isEmpty()) diagram_title = QObject::tr("Schéma sans titre");
|
||||||
QString diagram_filename = diagram -> title();
|
QString diagram_filename = diagram -> title();
|
||||||
if (diagram_filename.isEmpty()) diagram_filename = QObject::tr("schema");
|
if (diagram_filename.isEmpty()) diagram_filename = QObject::tr("schema");
|
||||||
diagram_filename = QET::stringToFileName(diagram_filename);
|
diagram_filename = QET::stringToFileName(diagram_filename);
|
||||||
@@ -1062,14 +1062,14 @@ ExportDialog::ExportDiagramLine::ExportDiagramLine(Diagram *dia, QSize diagram_s
|
|||||||
|
|
||||||
reset_size = new QPushButton();
|
reset_size = new QPushButton();
|
||||||
reset_size -> setIcon(QET::Icons::Start);
|
reset_size -> setIcon(QET::Icons::Start);
|
||||||
reset_size -> setToolTip(QObject::tr("R\351initialiser les dimensions"));
|
reset_size -> setToolTip(QObject::tr("Réinitialiser les dimensions"));
|
||||||
|
|
||||||
preview = new QPushButton();
|
preview = new QPushButton();
|
||||||
preview -> setIcon(QET::Icons::ZoomOriginal);
|
preview -> setIcon(QET::Icons::ZoomOriginal);
|
||||||
preview -> setToolTip(QObject::tr("Aper\347u"));
|
preview -> setToolTip(QObject::tr("Aperçu"));
|
||||||
|
|
||||||
clipboard = new QPushButton();
|
clipboard = new QPushButton();
|
||||||
clipboard -> setIcon(QET::Icons::CopyFile);
|
clipboard -> setIcon(QET::Icons::IC_CopyFile);
|
||||||
clipboard -> setToolTip(QObject::tr("Exporter vers le presse-papier"));
|
clipboard -> setToolTip(QObject::tr("Exporter vers le presse-papier"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef EXPORTDIALOG_H
|
#ifndef EXPORTDIALOG_H
|
||||||
#define EXPORTDIALOG_H
|
#define EXPORTDIALOG_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include "qetproject.h"
|
#include "qetproject.h"
|
||||||
class QSvgGenerator;
|
class QSvgGenerator;
|
||||||
|
|||||||
@@ -16,9 +16,10 @@
|
|||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "exportproperties.h"
|
#include "exportproperties.h"
|
||||||
#include <QDesktopServices>
|
|
||||||
#include "qetapp.h"
|
#include "qetapp.h"
|
||||||
|
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur par defaut :
|
Constructeur par defaut :
|
||||||
* le repertoire de destination est le Bureau de l'utilisateur
|
* le repertoire de destination est le Bureau de l'utilisateur
|
||||||
@@ -28,7 +29,7 @@
|
|||||||
* la zone exportee est le schema avec son cadre et son cartouche
|
* la zone exportee est le schema avec son cadre et son cartouche
|
||||||
*/
|
*/
|
||||||
ExportProperties::ExportProperties() :
|
ExportProperties::ExportProperties() :
|
||||||
destination_directory(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation)),
|
destination_directory(QStandardPaths::writableLocation(QStandardPaths::DesktopLocation)),
|
||||||
format("PNG"),
|
format("PNG"),
|
||||||
draw_grid(false),
|
draw_grid(false),
|
||||||
draw_border(true),
|
draw_border(true),
|
||||||
@@ -67,7 +68,7 @@ void ExportProperties::toSettings(QSettings &settings, const QString &prefix) co
|
|||||||
@param prefix prefixe a ajouter devant les noms des parametres
|
@param prefix prefixe a ajouter devant les noms des parametres
|
||||||
*/
|
*/
|
||||||
void ExportProperties::fromSettings(QSettings &settings, const QString &prefix) {
|
void ExportProperties::fromSettings(QSettings &settings, const QString &prefix) {
|
||||||
QString desktop_path = QDesktopServices::storageLocation(QDesktopServices::DesktopLocation);
|
QString desktop_path = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
|
||||||
destination_directory.setPath(settings.value(prefix + "path", desktop_path).toString());
|
destination_directory.setPath(settings.value(prefix + "path", desktop_path).toString());
|
||||||
if (!destination_directory.exists()) destination_directory.setPath(desktop_path);
|
if (!destination_directory.exists()) destination_directory.setPath(desktop_path);
|
||||||
|
|
||||||
|
|||||||
@@ -157,7 +157,7 @@ void ExportPropertiesWidget::build() {
|
|||||||
export_border = new QRadioButton(tr("Exporter le cadre"), groupbox_options);
|
export_border = new QRadioButton(tr("Exporter le cadre"), groupbox_options);
|
||||||
optionshlayout -> addWidget(export_border, 0, 0);
|
optionshlayout -> addWidget(export_border, 0, 0);
|
||||||
exported_content_choices -> addButton(export_border);
|
exported_content_choices -> addButton(export_border);
|
||||||
export_elements = new QRadioButton(tr("Exporter les \351l\351ments"), groupbox_options);
|
export_elements = new QRadioButton(tr("Exporter les éléments"), groupbox_options);
|
||||||
optionshlayout -> addWidget(export_elements, 0, 1);
|
optionshlayout -> addWidget(export_elements, 0, 1);
|
||||||
exported_content_choices -> addButton(export_elements);
|
exported_content_choices -> addButton(export_elements);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef EXPORT_PROPERTIES_WIDGET_H
|
#ifndef EXPORT_PROPERTIES_WIDGET_H
|
||||||
#define EXPORT_PROPERTIES_WIDGET_H
|
#define EXPORT_PROPERTIES_WIDGET_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "exportproperties.h"
|
#include "exportproperties.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -239,7 +239,7 @@ QTreeWidgetItem *GenericPanel::updateProjectItem(QTreeWidgetItem *project_qtwi,
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
project_qtwi -> setToolTip(0, final_tooltip);
|
project_qtwi -> setToolTip(0, final_tooltip);
|
||||||
QString project_whatsthis = tr("Ceci est un projet QElectroTech, c'est-\340-dire un fichier d'extension .qet regroupant plusieurs sch\351mas/folios. Il embarque \351galement les \351l\351ments et mod\350les de cartouches utilis\351s dans ces sch\351mas/folios.", "\"What's this\" tip");
|
QString project_whatsthis = tr("Ceci est un projet QElectroTech, c'est-à-dire un fichier d'extension .qet regroupant plusieurs schémas/folios. Il embarque également les éléments et modèles de cartouches utilisés dans ces schémas/folios.", "\"What's this\" tip");
|
||||||
project_qtwi -> setWhatsThis(0, project_whatsthis);
|
project_qtwi -> setWhatsThis(0, project_whatsthis);
|
||||||
return(updateItem(project_qtwi, options, freshly_created));
|
return(updateItem(project_qtwi, options, freshly_created));
|
||||||
}
|
}
|
||||||
@@ -301,12 +301,12 @@ QTreeWidgetItem *GenericPanel::fillProjectItem(QTreeWidgetItem *project_qtwi, QE
|
|||||||
project_qtwi,
|
project_qtwi,
|
||||||
options
|
options
|
||||||
);
|
);
|
||||||
QString collection_whatsthis = tr("Ceci est une collection embarqu\351e dans un fichier projet. Elle permet de stocker et g\351rer les \351l\351ments utilis\351s dans les sch\351mas du projet parent.", "\"What's this\" tip");
|
QString collection_whatsthis = tr("Ceci est une collection embarquée dans un fichier projet. Elle permet de stocker et gérer les éléments utilisés dans les schémas du projet parent.", "\"What's this\" tip");
|
||||||
collection_qtwi -> setWhatsThis(0, collection_whatsthis);
|
collection_qtwi -> setWhatsThis(0, collection_whatsthis);
|
||||||
|
|
||||||
// special instructions for the integration category
|
// special instructions for the integration category
|
||||||
if (QTreeWidgetItem *integration_qtwi = itemForElementsCategory(project -> integrationCategory())) {
|
if (QTreeWidgetItem *integration_qtwi = itemForElementsCategory(project -> integrationCategory())) {
|
||||||
QString integration_whats_this = tr("Cette cat\351gorie d'\351l\351ments est utilis\351e pour int\351grer automatiquement dans le projet tout \351l\351ment utilis\351 sur un des sch\351mas de ce projet.", "\"What's this\" tip");
|
QString integration_whats_this = tr("Cette catégorie d'éléments est utilisée pour intégrer automatiquement dans le projet tout élément utilisé sur un des schémas de ce projet.", "\"What's this\" tip");
|
||||||
integration_qtwi -> setWhatsThis(0, integration_whats_this);
|
integration_qtwi -> setWhatsThis(0, integration_whats_this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -365,7 +365,7 @@ QTreeWidgetItem *GenericPanel::updateDiagramItem(QTreeWidgetItem *diagram_qtwi,
|
|||||||
|
|
||||||
QString displayed_title = diagram -> title();
|
QString displayed_title = diagram -> title();
|
||||||
if (displayed_title.isEmpty()) {
|
if (displayed_title.isEmpty()) {
|
||||||
displayed_title = tr("Sch\351ma sans titre", "Fallback label when a diagram has no title");
|
displayed_title = tr("Schéma sans titre", "Fallback label when a diagram has no title");
|
||||||
}
|
}
|
||||||
|
|
||||||
QString displayed_label;
|
QString displayed_label;
|
||||||
@@ -451,7 +451,7 @@ QTreeWidgetItem *GenericPanel::getItemForTemplatesCollection(TitleBlockTemplates
|
|||||||
QTreeWidgetItem *GenericPanel::updateTemplatesCollectionItem(QTreeWidgetItem *tbt_collection_qtwi, TitleBlockTemplatesCollection *tbt_collection, PanelOptions options, bool freshly_created) {
|
QTreeWidgetItem *GenericPanel::updateTemplatesCollectionItem(QTreeWidgetItem *tbt_collection_qtwi, TitleBlockTemplatesCollection *tbt_collection, PanelOptions options, bool freshly_created) {
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
QString label = tbt_collection -> title();
|
QString label = tbt_collection -> title();
|
||||||
if (label.isEmpty()) label = tr("Mod\350les de cartouche");
|
if (label.isEmpty()) label = tr("Modèles de cartouche");
|
||||||
|
|
||||||
tbt_collection_qtwi -> setText(0, label);
|
tbt_collection_qtwi -> setText(0, label);
|
||||||
tbt_collection_qtwi -> setToolTip(0, tbt_collection -> location().toString());
|
tbt_collection_qtwi -> setToolTip(0, tbt_collection -> location().toString());
|
||||||
@@ -541,9 +541,9 @@ QTreeWidgetItem *GenericPanel::getItemForTemplate(const TitleBlockTemplateLocati
|
|||||||
*/
|
*/
|
||||||
QTreeWidgetItem *GenericPanel::updateTemplateItem(QTreeWidgetItem *tb_template_qtwi, const TitleBlockTemplateLocation &tb_template, PanelOptions options, bool freshly_created) {
|
QTreeWidgetItem *GenericPanel::updateTemplateItem(QTreeWidgetItem *tb_template_qtwi, const TitleBlockTemplateLocation &tb_template, PanelOptions options, bool freshly_created) {
|
||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
tb_template_qtwi -> setText(0, tr("Mod\350le \"%1\"", "used to display a title block template").arg(tb_template.name()));
|
tb_template_qtwi -> setText(0, tr("Modèle \"%1\"", "used to display a title block template").arg(tb_template.name()));
|
||||||
QString tbt_whatsthis = tr(
|
QString tbt_whatsthis = tr(
|
||||||
"Ceci est un mod\350le de cartouche, qui peut \352tre appliqu\351 \340 un sch\351ma.",
|
"Ceci est un modèle de cartouche, qui peut être appliqué à un schéma.",
|
||||||
"\"What's this\" tip"
|
"\"What's this\" tip"
|
||||||
);
|
);
|
||||||
tb_template_qtwi -> setWhatsThis(0, tbt_whatsthis);
|
tb_template_qtwi -> setWhatsThis(0, tbt_whatsthis);
|
||||||
@@ -728,7 +728,7 @@ QTreeWidgetItem *GenericPanel::updateElementsCategoryItem(QTreeWidgetItem *categ
|
|||||||
Q_UNUSED(options)
|
Q_UNUSED(options)
|
||||||
if (!category || !category_qtwi) return(0);
|
if (!category || !category_qtwi) return(0);
|
||||||
QString category_whatsthis = tr(
|
QString category_whatsthis = tr(
|
||||||
"Ceci est une cat\351gorie d'\351l\351ments, un simple container permettant d'organiser les collections d'\351l\351ments",
|
"Ceci est une catégorie d'éléments, un simple container permettant d'organiser les collections d'éléments",
|
||||||
"\"What's this\" tip"
|
"\"What's this\" tip"
|
||||||
);
|
);
|
||||||
category_qtwi -> setWhatsThis(0, category_whatsthis);
|
category_qtwi -> setWhatsThis(0, category_whatsthis);
|
||||||
@@ -881,7 +881,7 @@ QTreeWidgetItem *GenericPanel::updateElementItem(QTreeWidgetItem *element_qtwi,
|
|||||||
|
|
||||||
ElementsLocation element_location = element -> location();
|
ElementsLocation element_location = element -> location();
|
||||||
element_qtwi -> setText(0, cache -> name());
|
element_qtwi -> setText(0, cache -> name());
|
||||||
QString element_whatsthis = tr("Ceci est un \351l\351ment que vous pouvez ins\351rer dans un sch\351ma.", "\"What's this\" tip");
|
QString element_whatsthis = tr("Ceci est un élément que vous pouvez insérer dans un schéma.", "\"What's this\" tip");
|
||||||
element_qtwi -> setWhatsThis(0, element_whatsthis);
|
element_qtwi -> setWhatsThis(0, element_whatsthis);
|
||||||
if (options & DisplayElementsPreview) {
|
if (options & DisplayElementsPreview) {
|
||||||
element_qtwi -> setIcon(0, QIcon(cache -> pixmap()));
|
element_qtwi -> setIcon(0, QIcon(cache -> pixmap()));
|
||||||
@@ -1167,7 +1167,7 @@ void GenericPanel::markItemAsUnused(QTreeWidgetItem *qtwi) {
|
|||||||
t.setColorAt(0, QColor("#ffc0c0"));
|
t.setColorAt(0, QColor("#ffc0c0"));
|
||||||
t.setColorAt(1, QColor("#ffffff"));
|
t.setColorAt(1, QColor("#ffffff"));
|
||||||
qtwi -> setBackground(0, QBrush(t));
|
qtwi -> setBackground(0, QBrush(t));
|
||||||
qtwi -> setToolTip(0, QString(tr("%1 [non utilis\351 dans le projet]")).arg(qtwi -> toolTip(0)));
|
qtwi -> setToolTip(0, QString(tr("%1 [non utilisé dans le projet]")).arg(qtwi -> toolTip(0)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1226,7 +1226,7 @@ void GenericPanel::removeObsoleteItems(const QList<T> &expected_items, QTreeWidg
|
|||||||
*/
|
*/
|
||||||
template<typename T>
|
template<typename T>
|
||||||
T GenericPanel::valueForItem(QTreeWidgetItem *item) const {
|
T GenericPanel::valueForItem(QTreeWidgetItem *item) const {
|
||||||
return(qVariantValue<T>(item -> data(0, GenericPanel::Item)));
|
return item -> data(0, GenericPanel::Item).value<T>();
|
||||||
}
|
}
|
||||||
template TitleBlockTemplateLocation
|
template TitleBlockTemplateLocation
|
||||||
GenericPanel::valueForItem(QTreeWidgetItem *item) const;
|
GenericPanel::valueForItem(QTreeWidgetItem *item) const;
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "integrationmoveelementshandler.h"
|
#include "integrationmoveelementshandler.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementscategory.h"
|
#include "elementscategory.h"
|
||||||
#include "elementdefinition.h"
|
#include "elementdefinition.h"
|
||||||
#include "qfilenameedit.h"
|
#include "qfilenameedit.h"
|
||||||
@@ -118,14 +118,14 @@ QET::Action IntegrationMoveElementsHandler::askUser(ElementDefinition *src, Elem
|
|||||||
void IntegrationMoveElementsHandler::initDialog() {
|
void IntegrationMoveElementsHandler::initDialog() {
|
||||||
if (integ_dialog_) return;
|
if (integ_dialog_) return;
|
||||||
integ_dialog_ = new QDialog(parent_widget_);
|
integ_dialog_ = new QDialog(parent_widget_);
|
||||||
integ_dialog_ -> setWindowTitle(tr("Int\351gration d'un \351l\351ment"));
|
integ_dialog_ -> setWindowTitle(tr("Intégration d'un élément"));
|
||||||
|
|
||||||
dialog_label_ = new QLabel(
|
dialog_label_ = new QLabel(
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"L'\351l\351ment a d\351j\340 \351t\351 "
|
"L'élément a déjà été "
|
||||||
"int\351gr\351 dans le projet. Toutefois, la version que vous "
|
"intégré dans le projet. Toutefois, la version que vous "
|
||||||
"tentez de poser semble diff\351rente. Que souhaitez-vous "
|
"tentez de poser semble différente. Que souhaitez-vous "
|
||||||
"faire ?",
|
"faire ?",
|
||||||
"dialog content - %1 is an element's path name"
|
"dialog content - %1 is an element's path name"
|
||||||
)
|
)
|
||||||
@@ -135,7 +135,7 @@ void IntegrationMoveElementsHandler::initDialog() {
|
|||||||
use_existing_elmt_ = new QRadioButton(
|
use_existing_elmt_ = new QRadioButton(
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"Utiliser l'\351l\351ment d\351j\340 int\351gr\351",
|
"Utiliser l'élément déjà intégré",
|
||||||
"dialog content"
|
"dialog content"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -144,7 +144,7 @@ void IntegrationMoveElementsHandler::initDialog() {
|
|||||||
integrate_new_element_ = new QRadioButton(
|
integrate_new_element_ = new QRadioButton(
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"Int\351grer l'\351l\351ment d\351pos\351",
|
"Intégrer l'élément déposé",
|
||||||
"dialog content"
|
"dialog content"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -154,7 +154,7 @@ void IntegrationMoveElementsHandler::initDialog() {
|
|||||||
erase_element_ = new QRadioButton(
|
erase_element_ = new QRadioButton(
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"\311craser l'\351l\351ment d\351j\340 int\351gr\351",
|
"Écraser l'élément déjà intégré",
|
||||||
"dialog content"
|
"dialog content"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -164,7 +164,7 @@ void IntegrationMoveElementsHandler::initDialog() {
|
|||||||
integrate_both_ = new QRadioButton(
|
integrate_both_ = new QRadioButton(
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"Faire cohabiter les deux \351l\351ments",
|
"Faire cohabiter les deux éléments",
|
||||||
"dialog content"
|
"dialog content"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#ifndef INTEGRATION_MOVE_ELEMENTS_HANDLER_H
|
#ifndef INTEGRATION_MOVE_ELEMENTS_HANDLER_H
|
||||||
#define INTEGRATION_MOVE_ELEMENTS_HANDLER_H
|
#define INTEGRATION_MOVE_ELEMENTS_HANDLER_H
|
||||||
#include "basicmoveelementshandler.h"
|
#include "basicmoveelementshandler.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
/**
|
/**
|
||||||
This class implements the MoveElementsHandler Strategy class.
|
This class implements the MoveElementsHandler Strategy class.
|
||||||
It acts like a BasiMoveElementsHandler configured to answer QET::Abort to any question.
|
It acts like a BasiMoveElementsHandler configured to answer QET::Abort to any question.
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
along with QElectroTech. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
#include "interactivemoveelementshandler.h"
|
#include "interactivemoveelementshandler.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementscategory.h"
|
#include "elementscategory.h"
|
||||||
#include "elementdefinition.h"
|
#include "elementdefinition.h"
|
||||||
#include "qfilenameedit.h"
|
#include "qfilenameedit.h"
|
||||||
@@ -68,7 +68,7 @@ QET::Action InteractiveMoveElementsHandler::categoryAlreadyExists(ElementsCatego
|
|||||||
QLabel *question_label = new QLabel(
|
QLabel *question_label = new QLabel(
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"La cat\351gorie \253\240%1\240\273 (%2) existe d\351j\340. "
|
"La catégorie « %1 » (%2) existe déjà. "
|
||||||
"Que souhaitez-vous faire ?",
|
"Que souhaitez-vous faire ?",
|
||||||
"dialog content"
|
"dialog content"
|
||||||
)
|
)
|
||||||
@@ -116,7 +116,7 @@ QET::Action InteractiveMoveElementsHandler::elementAlreadyExists(ElementDefiniti
|
|||||||
QLabel *question_label = new QLabel(
|
QLabel *question_label = new QLabel(
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"L'\351l\351ment \253\240%1\240\273 existe d\351j\340. "
|
"L'élément « %1 » existe déjà. "
|
||||||
"Que souhaitez-vous faire ?",
|
"Que souhaitez-vous faire ?",
|
||||||
"dialog content"
|
"dialog content"
|
||||||
)
|
)
|
||||||
@@ -149,7 +149,7 @@ QET::Action InteractiveMoveElementsHandler::elementAlreadyExists(ElementDefiniti
|
|||||||
@return QET::Retry, QET::Ignore ou QET::Abort
|
@return QET::Retry, QET::Ignore ou QET::Abort
|
||||||
*/
|
*/
|
||||||
QET::Action InteractiveMoveElementsHandler::categoryIsNotReadable(ElementsCategory *category) {
|
QET::Action InteractiveMoveElementsHandler::categoryIsNotReadable(ElementsCategory *category) {
|
||||||
QString message = QString(tr("La cat\351gorie %1 n'est pas accessible en lecture.", "message box content")).arg(category -> location().toString());
|
QString message = QString(tr("La catégorie %1 n'est pas accessible en lecture.", "message box content")).arg(category -> location().toString());
|
||||||
return(retryErrorMessage(message));
|
return(retryErrorMessage(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -159,7 +159,7 @@ QET::Action InteractiveMoveElementsHandler::categoryIsNotReadable(ElementsCatego
|
|||||||
@return QET::Retry, QET::Ignore ou QET::Abort
|
@return QET::Retry, QET::Ignore ou QET::Abort
|
||||||
*/
|
*/
|
||||||
QET::Action InteractiveMoveElementsHandler::elementIsNotReadable(ElementDefinition *element) {
|
QET::Action InteractiveMoveElementsHandler::elementIsNotReadable(ElementDefinition *element) {
|
||||||
QString message = QString(tr("L'\351l\351ment %1 n'est pas accessible en lecture.", "message box content")).arg(element -> location().toString());
|
QString message = QString(tr("L'élément %1 n'est pas accessible en lecture.", "message box content")).arg(element -> location().toString());
|
||||||
return(retryErrorMessage(message));
|
return(retryErrorMessage(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -169,7 +169,7 @@ QET::Action InteractiveMoveElementsHandler::elementIsNotReadable(ElementDefiniti
|
|||||||
@return QET::Retry, QET::Ignore ou QET::Abort
|
@return QET::Retry, QET::Ignore ou QET::Abort
|
||||||
*/
|
*/
|
||||||
QET::Action InteractiveMoveElementsHandler::categoryIsNotWritable(ElementsCategory *category) {
|
QET::Action InteractiveMoveElementsHandler::categoryIsNotWritable(ElementsCategory *category) {
|
||||||
QString message = QString(tr("La cat\351gorie %1 n'est pas accessible en \351criture.", "message box content")).arg(category -> location().toString());
|
QString message = QString(tr("La catégorie %1 n'est pas accessible en écriture.", "message box content")).arg(category -> location().toString());
|
||||||
return(retryErrorMessage(message));
|
return(retryErrorMessage(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -179,7 +179,7 @@ QET::Action InteractiveMoveElementsHandler::categoryIsNotWritable(ElementsCatego
|
|||||||
@return QET::Retry, QET::Ignore ou QET::Abort
|
@return QET::Retry, QET::Ignore ou QET::Abort
|
||||||
*/
|
*/
|
||||||
QET::Action InteractiveMoveElementsHandler::elementIsNotWritable(ElementDefinition *element) {
|
QET::Action InteractiveMoveElementsHandler::elementIsNotWritable(ElementDefinition *element) {
|
||||||
QString message = QString(tr("L'\351l\351ment %1 n'est pas accessible en \351criture.", "message box content")).arg(element -> location().toString());
|
QString message = QString(tr("L'élément %1 n'est pas accessible en écriture.", "message box content")).arg(element -> location().toString());
|
||||||
return(retryErrorMessage(message));
|
return(retryErrorMessage(message));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -191,7 +191,7 @@ QET::Action InteractiveMoveElementsHandler::elementIsNotWritable(ElementDefiniti
|
|||||||
*/
|
*/
|
||||||
QET::Action InteractiveMoveElementsHandler::errorWithACategory(ElementsCategory *category, const QString &message) {
|
QET::Action InteractiveMoveElementsHandler::errorWithACategory(ElementsCategory *category, const QString &message) {
|
||||||
QString category_location = category -> location().toString();
|
QString category_location = category -> location().toString();
|
||||||
QString error_message = QString("Une erreur s'est produite avec la cat\351gorie %1\240: %2").arg(category_location).arg(message);
|
QString error_message = QString("Une erreur s'est produite avec la catégorie %1 : %2").arg(category_location).arg(message);
|
||||||
simpleErrorMessage(error_message);
|
simpleErrorMessage(error_message);
|
||||||
return(QET::Ignore);
|
return(QET::Ignore);
|
||||||
}
|
}
|
||||||
@@ -204,7 +204,7 @@ QET::Action InteractiveMoveElementsHandler::errorWithACategory(ElementsCategory
|
|||||||
*/
|
*/
|
||||||
QET::Action InteractiveMoveElementsHandler::errorWithAnElement(ElementDefinition *element, const QString &message) {
|
QET::Action InteractiveMoveElementsHandler::errorWithAnElement(ElementDefinition *element, const QString &message) {
|
||||||
QString element_location = element -> location().toString();
|
QString element_location = element -> location().toString();
|
||||||
QString error_message = QString("Une erreur s'est produite avec l'\351l\351ment %1\240: %2").arg(element_location).arg(message);
|
QString error_message = QString("Une erreur s'est produite avec l'élément %1 : %2").arg(element_location).arg(message);
|
||||||
simpleErrorMessage(error_message);
|
simpleErrorMessage(error_message);
|
||||||
return(QET::Ignore);
|
return(QET::Ignore);
|
||||||
}
|
}
|
||||||
@@ -240,8 +240,8 @@ void InteractiveMoveElementsHandler::initConflictDialog() {
|
|||||||
|
|
||||||
// initialisation des boutons
|
// initialisation des boutons
|
||||||
rename_button_ = new QPushButton(tr("Renommer"));
|
rename_button_ = new QPushButton(tr("Renommer"));
|
||||||
erase_button_ = new QPushButton(tr("\311craser"));
|
erase_button_ = new QPushButton(tr("Écraser"));
|
||||||
erase_all_button_ = new QPushButton(tr("\311craser tout"));
|
erase_all_button_ = new QPushButton(tr("Écraser tout"));
|
||||||
ignore_button_ = new QPushButton(tr("Ignorer"));
|
ignore_button_ = new QPushButton(tr("Ignorer"));
|
||||||
ignore_all_button_ = new QPushButton(tr("Ignorer tout"));
|
ignore_all_button_ = new QPushButton(tr("Ignorer tout"));
|
||||||
abort_button_ = new QPushButton(tr("Annuler"));
|
abort_button_ = new QPushButton(tr("Annuler"));
|
||||||
@@ -357,7 +357,7 @@ QWidget *InteractiveMoveElementsHandler::conflictDialogMainWidget() const {
|
|||||||
@return L'action choisie par l'utilisateur
|
@return L'action choisie par l'utilisateur
|
||||||
*/
|
*/
|
||||||
QET::Action InteractiveMoveElementsHandler::retryErrorMessage(const QString &message) const {
|
QET::Action InteractiveMoveElementsHandler::retryErrorMessage(const QString &message) const {
|
||||||
int todo = QET::MessageBox::critical(
|
int todo = QET::QetMessageBox::critical(
|
||||||
parent_widget_,
|
parent_widget_,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
message,
|
message,
|
||||||
@@ -379,7 +379,7 @@ QET::Action InteractiveMoveElementsHandler::retryErrorMessage(const QString &mes
|
|||||||
@param message Message d'erreur a afficher
|
@param message Message d'erreur a afficher
|
||||||
*/
|
*/
|
||||||
void InteractiveMoveElementsHandler::simpleErrorMessage(const QString &message) const {
|
void InteractiveMoveElementsHandler::simpleErrorMessage(const QString &message) const {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
parent_widget_,
|
parent_widget_,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
message,
|
message,
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ NamesListWidget::NamesListWidget(QWidget *parent) : QWidget(parent), read_only(f
|
|||||||
tree_names -> setHeaderLabels(headers);
|
tree_names -> setHeaderLabels(headers);
|
||||||
tree_names -> setWhatsThis(
|
tree_names -> setWhatsThis(
|
||||||
tr(
|
tr(
|
||||||
"Cette liste vous permet de saisir un court texte de fa\347on \340 ce"
|
"Cette liste vous permet de saisir un court texte de façon à ce"
|
||||||
" qu'il soit traduisible dans d'autres langues. Pour ce faire, elle"
|
" qu'il soit traduisible dans d'autres langues. Pour ce faire, elle"
|
||||||
" associe des codes ISO 639-1 de langues (ex. : \"fr\" pour"
|
" associe des codes ISO 639-1 de langues (ex. : \"fr\" pour"
|
||||||
" fran\347ais) aux traductions du texte en question dans ces"
|
" français) aux traductions du texte en question dans ces"
|
||||||
" m\352mes langues.",
|
" mêmes langues.",
|
||||||
"\"What's this\" tip"
|
"\"What's this\" tip"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -83,7 +83,7 @@ void NamesListWidget::addLine() {
|
|||||||
bool NamesListWidget::checkOneName() {
|
bool NamesListWidget::checkOneName() {
|
||||||
updateHash();
|
updateHash();
|
||||||
if (!hash_names.count()) {
|
if (!hash_names.count()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Il doit y avoir au moins un nom.", "message box title"),
|
tr("Il doit y avoir au moins un nom.", "message box title"),
|
||||||
tr("Vous devez entrer au moins un nom.", "message box content")
|
tr("Vous devez entrer au moins un nom.", "message box content")
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef NAMES_LIST_WIDGET_H
|
#ifndef NAMES_LIST_WIDGET_H
|
||||||
#define NAMES_LIST_WIDGET_H
|
#define NAMES_LIST_WIDGET_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "nameslist.h"
|
#include "nameslist.h"
|
||||||
/**
|
/**
|
||||||
This class provides a widget enabling users to enter localized names for
|
This class provides a widget enabling users to enter localized names for
|
||||||
|
|||||||
@@ -39,14 +39,14 @@ NewElementWizard::NewElementWizard(QWidget *parent, Qt::WindowFlags f) :
|
|||||||
{
|
{
|
||||||
setOptions(options() & ~QWizard::NoCancelButton);
|
setOptions(options() & ~QWizard::NoCancelButton);
|
||||||
|
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_OS_WIN
|
||||||
setWizardStyle(QWizard::AeroStyle);
|
setWizardStyle(QWizard::AeroStyle);
|
||||||
#elif defined(Q_WS_MAC)
|
#elif defined(Q_OS_MAC)
|
||||||
setWizardStyle(QWizard::MacStyle);
|
setWizardStyle(QWizard::MacStyle);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setPixmap(LogoPixmap, QPixmap(":/ico/256x256/qelectrotech.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
setPixmap(LogoPixmap, QPixmap(":/ico/256x256/qelectrotech.png").scaled(64, 64, Qt::KeepAspectRatio, Qt::SmoothTransformation));
|
||||||
setWindowTitle(tr("Cr\351er un nouvel \351l\351ment : Assistant", "window title"));
|
setWindowTitle(tr("Créer un nouvel élément : Assistant", "window title"));
|
||||||
setButtonText(QWizard::NextButton, tr("&Suivant >"));
|
setButtonText(QWizard::NextButton, tr("&Suivant >"));
|
||||||
addPage(buildStep1());
|
addPage(buildStep1());
|
||||||
addPage(buildStep2());
|
addPage(buildStep2());
|
||||||
@@ -94,8 +94,8 @@ bool NewElementWizard::preselectCategory(ElementsCategory *category) {
|
|||||||
QWizardPage *NewElementWizard::buildStep1() {
|
QWizardPage *NewElementWizard::buildStep1() {
|
||||||
QWizardPage *page = new QWizardPage();
|
QWizardPage *page = new QWizardPage();
|
||||||
page -> setProperty("WizardState", Category);
|
page -> setProperty("WizardState", Category);
|
||||||
page -> setTitle(tr("\311tape 1/3 : Cat\351gorie parente", "wizard page title"));
|
page -> setTitle(tr("Étape 1/3 : Catégorie parente", "wizard page title"));
|
||||||
page -> setSubTitle(tr("S\351lectionnez une cat\351gorie dans laquelle enregistrer le nouvel \351l\351ment.", "wizard page subtitle"));
|
page -> setSubTitle(tr("Sélectionnez une catégorie dans laquelle enregistrer le nouvel élément.", "wizard page subtitle"));
|
||||||
QVBoxLayout *layout = new QVBoxLayout();
|
QVBoxLayout *layout = new QVBoxLayout();
|
||||||
|
|
||||||
categories_list = new ElementsCategoriesWidget();
|
categories_list = new ElementsCategoriesWidget();
|
||||||
@@ -111,13 +111,13 @@ QWizardPage *NewElementWizard::buildStep1() {
|
|||||||
QWizardPage *NewElementWizard::buildStep2() {
|
QWizardPage *NewElementWizard::buildStep2() {
|
||||||
QWizardPage *page = new QWizardPage();
|
QWizardPage *page = new QWizardPage();
|
||||||
page -> setProperty("WizardState", Filename);
|
page -> setProperty("WizardState", Filename);
|
||||||
page -> setTitle(tr("\311tape 2/3 : Nom du fichier", "wizard page title"));
|
page -> setTitle(tr("Étape 2/3 : Nom du fichier", "wizard page title"));
|
||||||
page -> setSubTitle(tr("Indiquez le nom du fichier dans lequel enregistrer le nouvel \351l\351ment.", "wizard page subtitle"));
|
page -> setSubTitle(tr("Indiquez le nom du fichier dans lequel enregistrer le nouvel élément.", "wizard page subtitle"));
|
||||||
QVBoxLayout *layout = new QVBoxLayout();
|
QVBoxLayout *layout = new QVBoxLayout();
|
||||||
|
|
||||||
qle_filename = new QFileNameEdit(tr("nouvel_element"));
|
qle_filename = new QFileNameEdit(tr("nouvel_element"));
|
||||||
qle_filename -> selectAll();
|
qle_filename -> selectAll();
|
||||||
QLabel *explication2 = new QLabel(tr("Vous n'\352tes pas oblig\351 de pr\351ciser l'extension *.elmt. Elle sera ajout\351e automatiquement."));
|
QLabel *explication2 = new QLabel(tr("Vous n'êtes pas obligé de préciser l'extension *.elmt. Elle sera ajoutée automatiquement."));
|
||||||
explication2 -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
explication2 -> setAlignment(Qt::AlignJustify | Qt::AlignVCenter);
|
||||||
explication2 -> setWordWrap(true);
|
explication2 -> setWordWrap(true);
|
||||||
layout -> addWidget(qle_filename);
|
layout -> addWidget(qle_filename);
|
||||||
@@ -134,13 +134,13 @@ QWizardPage *NewElementWizard::buildStep2() {
|
|||||||
QWizardPage *NewElementWizard::buildStep3() {
|
QWizardPage *NewElementWizard::buildStep3() {
|
||||||
QWizardPage *page = new QWizardPage();
|
QWizardPage *page = new QWizardPage();
|
||||||
page -> setProperty("WizardState", Names);
|
page -> setProperty("WizardState", Names);
|
||||||
page -> setTitle(tr("\311tape 3/3 : Noms de l'\351l\351ment", "wizard page title"));
|
page -> setTitle(tr("Étape 3/3 : Noms de l'élément", "wizard page title"));
|
||||||
page -> setSubTitle(tr("Indiquez le ou les noms de l'\351l\351ment.", "wizard page subtitle"));
|
page -> setSubTitle(tr("Indiquez le ou les noms de l'élément.", "wizard page subtitle"));
|
||||||
QVBoxLayout *layout = new QVBoxLayout();
|
QVBoxLayout *layout = new QVBoxLayout();
|
||||||
|
|
||||||
element_names = new NamesListWidget();
|
element_names = new NamesListWidget();
|
||||||
NamesList hash_name;
|
NamesList hash_name;
|
||||||
hash_name.addName(QLocale::system().name().left(2), tr("Nom du nouvel \351l\351ment", "default name when creating a new element"));
|
hash_name.addName(QLocale::system().name().left(2), tr("Nom du nouvel élément", "default name when creating a new element"));
|
||||||
element_names -> setNames(hash_name);
|
element_names -> setNames(hash_name);
|
||||||
layout -> addWidget(element_names);
|
layout -> addWidget(element_names);
|
||||||
|
|
||||||
@@ -179,10 +179,10 @@ bool NewElementWizard::validStep1() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!step1_ok) {
|
if (!step1_ok) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
parentWidget(),
|
parentWidget(),
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Vous devez s\351lectionner une cat\351gorie.", "message box content")
|
tr("Vous devez sélectionner une catégorie.", "message box content")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return(step1_ok);
|
return(step1_ok);
|
||||||
@@ -199,7 +199,7 @@ bool NewElementWizard::validStep2() {
|
|||||||
|
|
||||||
// un nom doit avoir ete entre
|
// un nom doit avoir ete entre
|
||||||
if (file_name.isEmpty()) {
|
if (file_name.isEmpty()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Vous devez entrer un nom de fichier", "message box content")
|
tr("Vous devez entrer un nom de fichier", "message box content")
|
||||||
@@ -211,20 +211,20 @@ bool NewElementWizard::validStep2() {
|
|||||||
|
|
||||||
// le nom de fichier contient peut etre des caracteres interdits
|
// le nom de fichier contient peut etre des caracteres interdits
|
||||||
if (QET::containsForbiddenCharacters(file_name)) {
|
if (QET::containsForbiddenCharacters(file_name)) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Erreur", "message box title"),
|
tr("Erreur", "message box title"),
|
||||||
tr("Merci de ne pas utiliser les caract\350res suivants : \\ / : * ? \" < > |", "message box content")
|
tr("Merci de ne pas utiliser les caractères suivants : \\ / : * ? \" < > |", "message box content")
|
||||||
);
|
);
|
||||||
return(false);
|
return(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
// le fichier existe peut etre deja
|
// le fichier existe peut etre deja
|
||||||
if (chosen_category -> element(file_name)) {
|
if (chosen_category -> element(file_name)) {
|
||||||
QMessageBox::StandardButton answer = QET::MessageBox::question(
|
QMessageBox::StandardButton answer = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
"\311craser le fichier ?",
|
"Écraser le fichier ?",
|
||||||
"Le fichier existe d\351j\340. Souhaitez-vous l'\351craser ?",
|
"Le fichier existe déjà. Souhaitez-vous l'écraser ?",
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
||||||
QMessageBox::No
|
QMessageBox::No
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef NEW_ELEMENT_WIZARD_H
|
#ifndef NEW_ELEMENT_WIZARD_H
|
||||||
#define NEW_ELEMENT_WIZARD_H
|
#define NEW_ELEMENT_WIZARD_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
class ElementsCategoriesWidget;
|
class ElementsCategoriesWidget;
|
||||||
class ElementsCategory;
|
class ElementsCategory;
|
||||||
class NamesListWidget;
|
class NamesListWidget;
|
||||||
|
|||||||
@@ -81,7 +81,7 @@ bool nomenclature::saveToCSVFile() {
|
|||||||
QString nomenclature::getNomenclature() {
|
QString nomenclature::getNomenclature() {
|
||||||
//Process...
|
//Process...
|
||||||
QString data = tr("NOMENCLATURE : ") + m_project -> title() + "\n\n";
|
QString data = tr("NOMENCLATURE : ") + m_project -> title() + "\n\n";
|
||||||
data += tr("Folio") +";"+ tr("Sch\351ma") +";"+ tr("D\351signation qet")+";"+ tr("Label") +";"+ tr("D\351signation")+";"+ tr("Commentaire") +";"+ tr("Fabricant") +";"+ tr("Reference") +";"+ tr("Machine-reference")+"\n";
|
data += tr("Folio") +";"+ tr("Schéma") +";"+ tr("Désignation qet")+";"+ tr("Label") +";"+ tr("Désignation")+";"+ tr("Commentaire") +";"+ tr("Fabricant") +";"+ tr("Reference") +";"+ tr("Machine-reference")+"\n";
|
||||||
|
|
||||||
if(m_list_diagram.isEmpty()) return data;
|
if(m_list_diagram.isEmpty()) return data;
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#ifndef NOMENCLATURE_H
|
#ifndef NOMENCLATURE_H
|
||||||
#define NOMENCLATURE_H
|
#define NOMENCLATURE_H
|
||||||
|
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
|
|
||||||
#include "qetproject.h"
|
#include "qetproject.h"
|
||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include "conductorpropertieswidget.h"
|
#include "conductorpropertieswidget.h"
|
||||||
#include "diagramcontextwidget.h"
|
#include "diagramcontextwidget.h"
|
||||||
#include "titleblockpropertieswidget.h"
|
#include "titleblockpropertieswidget.h"
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "ui/reportpropertiewidget.h"
|
#include "ui/reportpropertiewidget.h"
|
||||||
#include "ui/xrefpropertieswidget.h"
|
#include "ui/xrefpropertieswidget.h"
|
||||||
#include "selectautonumw.h"
|
#include "selectautonumw.h"
|
||||||
@@ -114,7 +114,7 @@ ProjectMainConfigPage::~ProjectMainConfigPage() {
|
|||||||
@return the title for this page
|
@return the title for this page
|
||||||
*/
|
*/
|
||||||
QString ProjectMainConfigPage::title() const {
|
QString ProjectMainConfigPage::title() const {
|
||||||
return(tr("G\351n\351ral", "configuration page title"));
|
return(tr("Général", "configuration page title"));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -158,12 +158,12 @@ QString ProjectMainConfigPage::projectTitle() const {
|
|||||||
Initialize widgets displayed by the page.
|
Initialize widgets displayed by the page.
|
||||||
*/
|
*/
|
||||||
void ProjectMainConfigPage::initWidgets() {
|
void ProjectMainConfigPage::initWidgets() {
|
||||||
title_label_ = new QLabel(tr("Titre du projet\240:", "label when configuring"));
|
title_label_ = new QLabel(tr("Titre du projet :", "label when configuring"));
|
||||||
title_value_ = new QLineEdit();
|
title_value_ = new QLineEdit();
|
||||||
title_information_ = new QLabel(tr("Ce titre sera disponible pour tous les sch\351mas de ce projet en tant que %projecttitle.", "informative label"));
|
title_information_ = new QLabel(tr("Ce titre sera disponible pour tous les schémas de ce projet en tant que %projecttitle.", "informative label"));
|
||||||
project_variables_label_ = new QLabel(
|
project_variables_label_ = new QLabel(
|
||||||
tr(
|
tr(
|
||||||
"Vous pouvez d\351finir ci-dessous des propri\351t\351s personnalis\351es qui seront disponibles pour tous les sch\351mas de ce projet (typiquement pour les cartouches).",
|
"Vous pouvez définir ci-dessous des propriétés personnalisées qui seront disponibles pour tous les schémas de ce projet (typiquement pour les cartouches).",
|
||||||
"informative label"
|
"informative label"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -250,14 +250,14 @@ void ProjectAutoNumConfigPage::applyProjectConf() {}
|
|||||||
* Init some widget of this page
|
* Init some widget of this page
|
||||||
*/
|
*/
|
||||||
void ProjectAutoNumConfigPage::initWidgets() {
|
void ProjectAutoNumConfigPage::initWidgets() {
|
||||||
m_label = new QLabel(tr("Num\351rotations disponibles :", "availables numerotations"), this);
|
m_label = new QLabel(tr("Numérotations disponibles :", "availables numerotations"), this);
|
||||||
|
|
||||||
m_context_cb = new QComboBox(this);
|
m_context_cb = new QComboBox(this);
|
||||||
m_context_cb->setEditable(true);
|
m_context_cb->setEditable(true);
|
||||||
m_context_cb->addItem(tr("Nom de la nouvelle num\351rotation"));
|
m_context_cb->addItem(tr("Nom de la nouvelle numérotation"));
|
||||||
|
|
||||||
m_remove_pb = new QPushButton(QET::Icons::EditDelete, QString(), this);
|
m_remove_pb = new QPushButton(QET::Icons::EditDelete, QString(), this);
|
||||||
m_remove_pb -> setToolTip(tr("Supprimer la num\351rotation"));
|
m_remove_pb -> setToolTip(tr("Supprimer la numérotation"));
|
||||||
|
|
||||||
m_saw = new SelectAutonumW(this);
|
m_saw = new SelectAutonumW(this);
|
||||||
}
|
}
|
||||||
@@ -311,7 +311,7 @@ void ProjectAutoNumConfigPage::buildConnections() {
|
|||||||
* @param str, key of context stored in project
|
* @param str, key of context stored in project
|
||||||
*/
|
*/
|
||||||
void ProjectAutoNumConfigPage::updateContext(QString str) {
|
void ProjectAutoNumConfigPage::updateContext(QString str) {
|
||||||
if (str == tr("Nom de la nouvelle num\351rotation")) m_saw -> setContext(NumerotationContext());
|
if (str == tr("Nom de la nouvelle numérotation")) m_saw -> setContext(NumerotationContext());
|
||||||
else m_saw ->setContext(project_->conductorAutoNum(str));
|
else m_saw ->setContext(project_->conductorAutoNum(str));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -322,7 +322,7 @@ void ProjectAutoNumConfigPage::updateContext(QString str) {
|
|||||||
void ProjectAutoNumConfigPage::saveContext() {
|
void ProjectAutoNumConfigPage::saveContext() {
|
||||||
// If the text is the default text "Name of new numerotation" save the edited context
|
// If the text is the default text "Name of new numerotation" save the edited context
|
||||||
// With the the name "No name"
|
// With the the name "No name"
|
||||||
if (m_context_cb -> currentText() == tr("Nom de la nouvelle num\351rotation")) {
|
if (m_context_cb -> currentText() == tr("Nom de la nouvelle numérotation")) {
|
||||||
project_->addConductorAutoNum (tr("Sans nom"), m_saw -> toNumContext());
|
project_->addConductorAutoNum (tr("Sans nom"), m_saw -> toNumContext());
|
||||||
m_context_cb -> addItem(tr("Sans nom"));
|
m_context_cb -> addItem(tr("Sans nom"));
|
||||||
}
|
}
|
||||||
@@ -343,7 +343,7 @@ void ProjectAutoNumConfigPage::saveContext() {
|
|||||||
*/
|
*/
|
||||||
void ProjectAutoNumConfigPage::removeContext() {
|
void ProjectAutoNumConfigPage::removeContext() {
|
||||||
//if default text, return
|
//if default text, return
|
||||||
if ( m_context_cb -> currentText() == tr("Nom de la nouvelle num\351rotation") ) return;
|
if ( m_context_cb -> currentText() == tr("Nom de la nouvelle numérotation") ) return;
|
||||||
project_ -> removeConductorAutonum (m_context_cb -> currentText() );
|
project_ -> removeConductorAutonum (m_context_cb -> currentText() );
|
||||||
m_context_cb -> removeItem (m_context_cb -> currentIndex() );
|
m_context_cb -> removeItem (m_context_cb -> currentIndex() );
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ int ProjectView::tryClosingDiagrams() {
|
|||||||
if (title.isEmpty()) title = "QElectroTech ";
|
if (title.isEmpty()) title = "QElectroTech ";
|
||||||
|
|
||||||
int close_dialog = QMessageBox::question(this, title,
|
int close_dialog = QMessageBox::question(this, title,
|
||||||
tr("Le projet \340 \351t\351 modifi\351.\n"
|
tr("Le projet à été modifié.\n"
|
||||||
"Voulez-vous enregistrer les modifications ?"),
|
"Voulez-vous enregistrer les modifications ?"),
|
||||||
QMessageBox::Save | QMessageBox::Discard
|
QMessageBox::Save | QMessageBox::Discard
|
||||||
| QMessageBox::Cancel,
|
| QMessageBox::Cancel,
|
||||||
@@ -260,7 +260,7 @@ QString ProjectView::askUserForFilePath(bool assign) {
|
|||||||
this,
|
this,
|
||||||
tr("Enregistrer sous", "dialog title"),
|
tr("Enregistrer sous", "dialog title"),
|
||||||
project_ -> currentDir(),
|
project_ -> currentDir(),
|
||||||
tr("Sch\351ma QElectroTech (*.qet)", "filetypes allowed when saving a diagram file")
|
tr("Schéma QElectroTech (*.qet)", "filetypes allowed when saving a diagram file")
|
||||||
);
|
);
|
||||||
|
|
||||||
// if no filepath is provided, return an empty string
|
// if no filepath is provided, return an empty string
|
||||||
@@ -282,7 +282,7 @@ QString ProjectView::askUserForFilePath(bool assign) {
|
|||||||
view is not associated to any project.
|
view is not associated to any project.
|
||||||
*/
|
*/
|
||||||
QETResult ProjectView::noProjectResult() const {
|
QETResult ProjectView::noProjectResult() const {
|
||||||
QETResult no_project(tr("aucun projet affich\351", "error message"), false);
|
QETResult no_project(tr("aucun projet affiché", "error message"), false);
|
||||||
return(no_project);
|
return(no_project);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -366,10 +366,10 @@ void ProjectView::removeDiagram(DiagramView *diagram_view) {
|
|||||||
|
|
||||||
|
|
||||||
//Ask confirmation to user.
|
//Ask confirmation to user.
|
||||||
int answer = QET::MessageBox::question(
|
int answer = QET::QetMessageBox::question(
|
||||||
this,
|
this,
|
||||||
tr("Supprimer le sch\351ma ?", "message box title"),
|
tr("Supprimer le schéma ?", "message box title"),
|
||||||
tr("\312tes-vous s\373r de vouloir supprimer ce sch\351ma du projet ? Ce changement est irr\351versible.", "message box content"),
|
tr("Êtes-vous s\373r de vouloir supprimer ce schéma du projet ? Ce changement est irréversible.", "message box content"),
|
||||||
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
QMessageBox::Yes | QMessageBox::No | QMessageBox::Cancel,
|
||||||
QMessageBox::No
|
QMessageBox::No
|
||||||
);
|
);
|
||||||
@@ -581,7 +581,7 @@ void ProjectView::exportProject() {
|
|||||||
if (!project_) return;
|
if (!project_) return;
|
||||||
|
|
||||||
ExportDialog ed(project_, parentWidget());
|
ExportDialog ed(project_, parentWidget());
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
ed.setWindowFlags(Qt::Sheet);
|
ed.setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
ed.exec();
|
ed.exec();
|
||||||
@@ -668,7 +668,7 @@ int ProjectView::cleanProject() {
|
|||||||
|
|
||||||
// s'assure que le schema n'est pas en lecture seule
|
// s'assure que le schema n'est pas en lecture seule
|
||||||
if (project_ -> isReadOnly()) {
|
if (project_ -> isReadOnly()) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Projet en lecture seule", "message box title"),
|
tr("Projet en lecture seule", "message box title"),
|
||||||
tr("Ce projet est en lecture seule. Il n'est donc pas possible de le nettoyer.", "message box content")
|
tr("Ce projet est en lecture seule. Il n'est donc pas possible de le nettoyer.", "message box content")
|
||||||
@@ -677,9 +677,9 @@ int ProjectView::cleanProject() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// construit un petit dialogue pour parametrer le nettoyage
|
// construit un petit dialogue pour parametrer le nettoyage
|
||||||
QCheckBox *clean_tbt = new QCheckBox(tr("Supprimer les mod\350les de cartouche inutilis\351s dans le projet"));
|
QCheckBox *clean_tbt = new QCheckBox(tr("Supprimer les modèles de cartouche inutilisés dans le projet"));
|
||||||
QCheckBox *clean_elements = new QCheckBox(tr("Supprimer les \351l\351ments inutilis\351s dans le projet"));
|
QCheckBox *clean_elements = new QCheckBox(tr("Supprimer les éléments inutilisés dans le projet"));
|
||||||
QCheckBox *clean_categories = new QCheckBox(tr("Supprimer les cat\351gories vides"));
|
QCheckBox *clean_categories = new QCheckBox(tr("Supprimer les catégories vides"));
|
||||||
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
QDialogButtonBox *buttons = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
|
|
||||||
clean_tbt -> setChecked(true);
|
clean_tbt -> setChecked(true);
|
||||||
@@ -687,7 +687,7 @@ int ProjectView::cleanProject() {
|
|||||||
clean_categories -> setChecked(true);
|
clean_categories -> setChecked(true);
|
||||||
|
|
||||||
QDialog clean_dialog(parentWidget());
|
QDialog clean_dialog(parentWidget());
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
clean_dialog.setWindowFlags(Qt::Sheet);
|
clean_dialog.setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -727,7 +727,7 @@ int ProjectView::cleanProject() {
|
|||||||
Initialize actions for this widget.
|
Initialize actions for this widget.
|
||||||
*/
|
*/
|
||||||
void ProjectView::initActions() {
|
void ProjectView::initActions() {
|
||||||
add_new_diagram_ = new QAction(QET::Icons::Add, tr("Ajouter un sch\351ma"), this);
|
add_new_diagram_ = new QAction(QET::Icons::Add, tr("Ajouter un schéma"), this);
|
||||||
connect(add_new_diagram_, SIGNAL(triggered()), this, SLOT(addNewDiagram()));
|
connect(add_new_diagram_, SIGNAL(triggered()), this, SLOT(addNewDiagram()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -742,7 +742,7 @@ void ProjectView::initWidgets() {
|
|||||||
fallback_widget_ = new QWidget();
|
fallback_widget_ = new QWidget();
|
||||||
fallback_label_ = new QLabel(
|
fallback_label_ = new QLabel(
|
||||||
tr(
|
tr(
|
||||||
"Ce projet ne contient aucun sch\351ma",
|
"Ce projet ne contient aucun schéma",
|
||||||
"label displayed when a project contains no diagram"
|
"label displayed when a project contains no diagram"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@@ -775,7 +775,7 @@ void ProjectView::initLayout() {
|
|||||||
fallback_widget_layout_ -> addWidget(fallback_label_);
|
fallback_widget_layout_ -> addWidget(fallback_label_);
|
||||||
|
|
||||||
layout_ = new QVBoxLayout(this);
|
layout_ = new QVBoxLayout(this);
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
layout_ -> setContentsMargins(0, 8, 0, 0);
|
layout_ -> setContentsMargins(0, 8, 0, 0);
|
||||||
#else
|
#else
|
||||||
layout_ -> setContentsMargins(0, 0, 0, 0);
|
layout_ -> setContentsMargins(0, 0, 0, 0);
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef PROJECT_VIEW_H
|
#ifndef PROJECT_VIEW_H
|
||||||
#define PROJECT_VIEW_H
|
#define PROJECT_VIEW_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "templatelocation.h"
|
#include "templatelocation.h"
|
||||||
#include "qetresult.h"
|
#include "qetresult.h"
|
||||||
class QETProject;
|
class QETProject;
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ QString QET::ElementsAndConductorsSentence(int elements_count, int conductors_co
|
|||||||
QString text;
|
QString text;
|
||||||
if (elements_count) {
|
if (elements_count) {
|
||||||
text += QObject::tr(
|
text += QObject::tr(
|
||||||
"%n \351l\351ment(s)",
|
"%n élément(s)",
|
||||||
"part of a sentence listing the content of a diagram",
|
"part of a sentence listing the content of a diagram",
|
||||||
elements_count
|
elements_count
|
||||||
);
|
);
|
||||||
@@ -359,11 +359,11 @@ QString QET::license() {
|
|||||||
QString txt_license;
|
QString txt_license;
|
||||||
// verifie que le fichier existe
|
// verifie que le fichier existe
|
||||||
if (!file_license -> exists()) {
|
if (!file_license -> exists()) {
|
||||||
txt_license = QString(QObject::tr("Le fichier texte contenant la licence GNU/GPL est introuvable - bon bah de toute fa\347on, vous la connaissez par coeur non ?"));
|
txt_license = QString(QObject::tr("Le fichier texte contenant la licence GNU/GPL est introuvable - bon bah de toute façon, vous la connaissez par coeur non ?"));
|
||||||
} else {
|
} else {
|
||||||
// ouvre le fichier en mode texte et en lecture seule
|
// ouvre le fichier en mode texte et en lecture seule
|
||||||
if (!file_license -> open(QIODevice::ReadOnly | QIODevice::Text)) {
|
if (!file_license -> open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||||
txt_license = QString(QObject::tr("Le fichier texte contenant la licence GNU/GPL existe mais n'a pas pu \352tre ouvert - bon bah de toute fa\347on, vous la connaissez par coeur non ?"));
|
txt_license = QString(QObject::tr("Le fichier texte contenant la licence GNU/GPL existe mais n'a pas pu être ouvert - bon bah de toute façon, vous la connaissez par coeur non ?"));
|
||||||
} else {
|
} else {
|
||||||
// charge le contenu du fichier dans une QString
|
// charge le contenu du fichier dans une QString
|
||||||
QTextStream in(file_license);
|
QTextStream in(file_license);
|
||||||
@@ -602,7 +602,7 @@ bool QET::compareCanonicalFilePaths(const QString &first, const QString &second)
|
|||||||
QString second_canonical_path = QFileInfo(second).canonicalFilePath();
|
QString second_canonical_path = QFileInfo(second).canonicalFilePath();
|
||||||
if (second_canonical_path.isEmpty()) return(false);
|
if (second_canonical_path.isEmpty()) return(false);
|
||||||
|
|
||||||
#ifdef Q_WS_WIN
|
#ifdef Q_OS_WIN
|
||||||
// sous Windows, on ramene les chemins en minuscules
|
// sous Windows, on ramene les chemins en minuscules
|
||||||
first_canonical_path = first_canonical_path.toLower();
|
first_canonical_path = first_canonical_path.toLower();
|
||||||
second_canonical_path = second_canonical_path.toLower();
|
second_canonical_path = second_canonical_path.toLower();
|
||||||
@@ -642,7 +642,7 @@ bool QET::writeXmlFile(QDomDocument &xml_doc, const QString &filepath, QString *
|
|||||||
if (error_message) {
|
if (error_message) {
|
||||||
*error_message = QString(
|
*error_message = QString(
|
||||||
QObject::tr(
|
QObject::tr(
|
||||||
"Impossible d'ouvrir le fichier %1 en \351criture, erreur %2 rencontr\351e.",
|
"Impossible d'ouvrir le fichier %1 en écriture, erreur %2 rencontrée.",
|
||||||
"error message when attempting to write an XML file"
|
"error message when attempting to write an XML file"
|
||||||
)
|
)
|
||||||
).arg(filepath).arg(file.error());
|
).arg(filepath).arg(file.error());
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ QETApp::QETApp(int &argc, char **argv) :
|
|||||||
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'\351l\351ments", "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);
|
||||||
@@ -111,14 +111,14 @@ QETApp::QETApp(int &argc, char **argv) :
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 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'\351l\351ments", "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... \311diteur de sch\351mas", "splash screen caption"));
|
setSplashScreenStep(tr("Chargement... Éditeur de schémas", "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"));
|
||||||
@@ -363,10 +363,10 @@ QStringList QETApp::elementInfoKeys() {
|
|||||||
QString QETApp::elementTranslatedInfoKey(QString &info) {
|
QString QETApp::elementTranslatedInfoKey(QString &info) {
|
||||||
if (info == "label") return tr("Label");
|
if (info == "label") return tr("Label");
|
||||||
else if (info == "comment") return tr("Commentaire");
|
else if (info == "comment") return tr("Commentaire");
|
||||||
else if (info == "designation") return tr("D\351signation");
|
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\351f\351rence fabricant");
|
else if (info == "manufacturer-reference") return tr("Référence fabricant");
|
||||||
else if (info == "machine-manufacturer-reference") return tr("R\351f\351rence fabricant machine");
|
else if (info == "machine-manufacturer-reference") return tr("Référence fabricant machine");
|
||||||
return (info);
|
return (info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -943,9 +943,9 @@ void QETApp::invertMainWindowVisibility(QWidget *window) {
|
|||||||
Autodetec Windows style
|
Autodetec Windows style
|
||||||
@param Windows style
|
@param Windows style
|
||||||
*/
|
*/
|
||||||
#if defined(Q_WS_WIN) && defined(Q_WS_WINCE)
|
#if defined(Q_OS_WIN) && defined(Q_OS_WINCE)
|
||||||
|
|
||||||
if defined(Q_WS_WIN)
|
if defined(Q_OS_WIN)
|
||||||
if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
|
if ((QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA
|
||||||
&& QSysInfo::WindowsVersion < QSysInfo::WV_NT_based))
|
&& QSysInfo::WindowsVersion < QSysInfo::WV_NT_based))
|
||||||
style = QLatin1String("WindowsVista");
|
style = QLatin1String("WindowsVista");
|
||||||
@@ -1255,7 +1255,7 @@ void QETApp::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_WS_MAC
|
#ifdef Q_OS_MAC
|
||||||
about_dialog_ -> setWindowFlags(Qt::Sheet);
|
about_dialog_ -> setWindowFlags(Qt::Sheet);
|
||||||
#endif
|
#endif
|
||||||
about_dialog_ -> setParent(parent_widget, about_dialog_ -> windowFlags());
|
about_dialog_ -> setParent(parent_widget, about_dialog_ -> windowFlags());
|
||||||
@@ -1373,11 +1373,12 @@ void QETApp::initLanguage() {
|
|||||||
*/
|
*/
|
||||||
void QETApp::initStyle() {
|
void QETApp::initStyle() {
|
||||||
initial_palette_ = palette();
|
initial_palette_ = palette();
|
||||||
|
|
||||||
// lorsque le style Plastique est active, on le remplace par une version amelioree
|
//@TODO remove the code below
|
||||||
if (qobject_cast<QPlastiqueStyle *>(style())) {
|
// // lorsque le style Plastique est active, on le remplace par une version amelioree
|
||||||
setStyle(new QETStyle());
|
// if (qobject_cast<QPlastiqueStyle *>(style())) {
|
||||||
}
|
// 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());
|
||||||
@@ -1416,24 +1417,24 @@ void QETApp::initConfiguration() {
|
|||||||
Construit l'icone dans le systray et son menu
|
Construit l'icone dans le systray et son menu
|
||||||
*/
|
*/
|
||||||
void QETApp::initSystemTray() {
|
void QETApp::initSystemTray() {
|
||||||
setSplashScreenStep(tr("Chargement... ic\364ne 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);
|
||||||
reduce_diagrams = new QAction(QET::Icons::Hide, tr("&Masquer tous les \351diteurs de sch\351ma"), this);
|
reduce_diagrams = new QAction(QET::Icons::Hide, tr("&Masquer tous les éditeurs de schéma"), this);
|
||||||
restore_diagrams = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs de sch\351ma"), this);
|
restore_diagrams = new QAction(QET::Icons::Restore, tr("&Restaurer tous les éditeurs de schéma"), this);
|
||||||
reduce_elements = new QAction(QET::Icons::Hide, tr("&Masquer tous les \351diteurs d'\351l\351ment"), this);
|
reduce_elements = new QAction(QET::Icons::Hide, tr("&Masquer tous les éditeurs d'élément"), this);
|
||||||
restore_elements = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs d'\351l\351ment"), this);
|
restore_elements = new QAction(QET::Icons::Restore, tr("&Restaurer tous les éditeurs d'élément"), this);
|
||||||
reduce_templates = new QAction(QET::Icons::Hide, tr("&Masquer tous les \351diteurs de cartouche", "systray submenu entry"), this);
|
reduce_templates = new QAction(QET::Icons::Hide, tr("&Masquer tous les éditeurs de cartouche", "systray submenu entry"), this);
|
||||||
restore_templates = new QAction(QET::Icons::Restore, tr("&Restaurer tous les \351diteurs 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 \351diteur de sch\351ma"), this);
|
new_diagram = new QAction(QET::Icons::WindowNew, tr("&Nouvel éditeur de schéma"), this);
|
||||||
new_element = new QAction(QET::Icons::WindowNew, tr("&Nouvel \351diteur d'\351l\351ment"), 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\351duire 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()));
|
||||||
@@ -1519,7 +1520,7 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
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("\311diteurs de sch\351mas"));
|
QMenu *diagrams_submenu = menu_systray -> addMenu(tr("Éditeurs de schémas"));
|
||||||
diagrams_submenu -> addAction(reduce_diagrams);
|
diagrams_submenu -> addAction(reduce_diagrams);
|
||||||
diagrams_submenu -> addAction(restore_diagrams);
|
diagrams_submenu -> addAction(restore_diagrams);
|
||||||
diagrams_submenu -> addAction(new_diagram);
|
diagrams_submenu -> addAction(new_diagram);
|
||||||
@@ -1528,7 +1529,7 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
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("\311diteurs d'\351l\351ment"));
|
QMenu *elements_submenu = menu_systray -> addMenu(tr("Éditeurs d'élément"));
|
||||||
elements_submenu -> addAction(reduce_elements);
|
elements_submenu -> addAction(reduce_elements);
|
||||||
elements_submenu -> addAction(restore_elements);
|
elements_submenu -> addAction(restore_elements);
|
||||||
elements_submenu -> addAction(new_element);
|
elements_submenu -> addAction(new_element);
|
||||||
@@ -1538,7 +1539,7 @@ void QETApp::buildSystemTrayMenu() {
|
|||||||
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("\311diteurs 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);
|
||||||
tbtemplates_submenu -> addAction(restore_templates);
|
tbtemplates_submenu -> addAction(restore_templates);
|
||||||
reduce_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_reduced);
|
reduce_templates -> setEnabled(!tbtemplates.isEmpty() && !every_template_reduced);
|
||||||
@@ -1604,7 +1605,7 @@ bool QETApp::event(QEvent *e) {
|
|||||||
void QETApp::printHelp() {
|
void QETApp::printHelp() {
|
||||||
QString help(
|
QString help(
|
||||||
tr("Usage : ") + QFileInfo(applicationFilePath()).fileName() + tr(" [options] [fichier]...\n\n") +
|
tr("Usage : ") + QFileInfo(applicationFilePath()).fileName() + tr(" [options] [fichier]...\n\n") +
|
||||||
tr("QElectroTech, une application de r\351alisation de sch\351mas \351lectriques.\n\n"
|
tr("QElectroTech, une application de réalisation de schémas électriques.\n\n"
|
||||||
"Options disponibles : \n"
|
"Options disponibles : \n"
|
||||||
" --help Afficher l'aide sur les options\n"
|
" --help Afficher l'aide sur les options\n"
|
||||||
" -v, --version Afficher la version\n"
|
" -v, --version Afficher la version\n"
|
||||||
@@ -1637,50 +1638,51 @@ void QETApp::printLicense() {
|
|||||||
std::cout << qPrintable(QET::license()) << std::endl;
|
std::cout << qPrintable(QET::license()) << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Constructeur
|
//@TODO remove code below
|
||||||
QETStyle::QETStyle() : QPlastiqueStyle() {
|
///// Constructeur
|
||||||
}
|
//QETStyle::QETStyle() : QPlastiqueStyle() {
|
||||||
|
//}
|
||||||
|
|
||||||
/// Destructeur
|
///// Destructeur
|
||||||
QETStyle::~QETStyle() {
|
//QETStyle::~QETStyle() {
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// Gere les parametres de style
|
///// Gere les parametres de style
|
||||||
int QETStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returndata) const {
|
//int QETStyle::styleHint(StyleHint hint, const QStyleOption *option, const QWidget *widget, QStyleHintReturn *returndata) const {
|
||||||
if (hint == QStyle::SH_DialogButtonBox_ButtonsHaveIcons) {
|
// if (hint == QStyle::SH_DialogButtonBox_ButtonsHaveIcons) {
|
||||||
return(int(true));
|
// return(int(true));
|
||||||
} else {
|
// } else {
|
||||||
return(QPlastiqueStyle::styleHint(hint, option, widget, returndata));
|
// return(QPlastiqueStyle::styleHint(hint, option, widget, returndata));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// Gere les icones standard
|
///// Gere les icones standard
|
||||||
QIcon QETStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget* widget) const {
|
//QIcon QETStyle::standardIconImplementation(StandardPixmap standardIcon, const QStyleOption *option, const QWidget* widget) const {
|
||||||
switch(standardIcon) {
|
// switch(standardIcon) {
|
||||||
case QStyle::SP_DialogSaveButton:
|
// case QStyle::SP_DialogSaveButton:
|
||||||
return(QET::Icons::DocumentSave);
|
// return(QET::Icons::DocumentSave);
|
||||||
case QStyle::SP_DialogOpenButton:
|
// case QStyle::SP_DialogOpenButton:
|
||||||
return(QET::Icons::DocumentOpen);
|
// return(QET::Icons::DocumentOpen);
|
||||||
case QStyle::SP_DialogCancelButton:
|
// case QStyle::SP_DialogCancelButton:
|
||||||
return(QET::Icons::DialogCancel);
|
// return(QET::Icons::DialogCancel);
|
||||||
case QStyle::SP_DialogOkButton:
|
// case QStyle::SP_DialogOkButton:
|
||||||
case QStyle::SP_DialogApplyButton:
|
// case QStyle::SP_DialogApplyButton:
|
||||||
return(QET::Icons::DialogOk);
|
// return(QET::Icons::DialogOk);
|
||||||
case QStyle::SP_DialogCloseButton:
|
// case QStyle::SP_DialogCloseButton:
|
||||||
return(QET::Icons::DocumentClose);
|
// return(QET::Icons::DocumentClose);
|
||||||
case QStyle::SP_DialogYesButton:
|
// case QStyle::SP_DialogYesButton:
|
||||||
return(QET::Icons::Allowed);
|
// return(QET::Icons::Allowed);
|
||||||
case QStyle::SP_DialogNoButton:
|
// case QStyle::SP_DialogNoButton:
|
||||||
return(QET::Icons::Forbidden);
|
// return(QET::Icons::Forbidden);
|
||||||
case QStyle::SP_DialogResetButton:
|
// case QStyle::SP_DialogResetButton:
|
||||||
return(QET::Icons::EditUndo);
|
// return(QET::Icons::EditUndo);
|
||||||
case QStyle::SP_DialogHelpButton:
|
// case QStyle::SP_DialogHelpButton:
|
||||||
case QStyle::SP_DialogDiscardButton:
|
// case QStyle::SP_DialogDiscardButton:
|
||||||
return(QIcon());
|
// return(QIcon());
|
||||||
default:
|
// default:
|
||||||
return(QPlastiqueStyle::standardIconImplementation(standardIcon, option, widget));
|
// return(QPlastiqueStyle::standardIconImplementation(standardIcon, option, widget));
|
||||||
}
|
// }
|
||||||
}
|
//}
|
||||||
|
|
||||||
/// @return une reference vers les parametres de QElectroTEch
|
/// @return une reference vers les parametres de QElectroTEch
|
||||||
QSettings &QETApp::settings() {
|
QSettings &QETApp::settings() {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#define QET_APP_H
|
#define QET_APP_H
|
||||||
#include "qetsingleapplication.h"
|
#include "qetsingleapplication.h"
|
||||||
#include <QTranslator>
|
#include <QTranslator>
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "elementslocation.h"
|
#include "elementslocation.h"
|
||||||
#include "templatelocation.h"
|
#include "templatelocation.h"
|
||||||
#include "qetarguments.h"
|
#include "qetarguments.h"
|
||||||
@@ -236,18 +236,19 @@ class QETApp : public QETSingleApplication {
|
|||||||
static QETProject *projectFromString(const QString &);
|
static QETProject *projectFromString(const QString &);
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
//TODO remove code below
|
||||||
This class represents the custom QElectroTech style.
|
///**
|
||||||
It implements simple modification such as extra standard icons.
|
// This class represents the custom QElectroTech style.
|
||||||
*/
|
// It implements simple modification such as extra standard icons.
|
||||||
class QETStyle : public QPlastiqueStyle {
|
//*/
|
||||||
Q_OBJECT
|
//class QETStyle : public QPlastiqueStyle {
|
||||||
public:
|
// Q_OBJECT
|
||||||
QETStyle();
|
// public:
|
||||||
virtual ~QETStyle();
|
// QETStyle();
|
||||||
virtual int styleHint(StyleHint hint, const QStyleOption * = 0, const QWidget * = 0, QStyleHintReturn * = 0) const;
|
// virtual ~QETStyle();
|
||||||
|
// virtual int styleHint(StyleHint hint, const QStyleOption * = 0, const QWidget * = 0, QStyleHintReturn * = 0) const;
|
||||||
|
|
||||||
protected slots:
|
// protected slots:
|
||||||
virtual QIcon standardIconImplementation(StandardPixmap, const QStyleOption * = 0, const QWidget * = 0) const;
|
// virtual QIcon standardIconImplementation(StandardPixmap, const QStyleOption * = 0, const QWidget * = 0) const;
|
||||||
};
|
//};
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -43,6 +43,7 @@
|
|||||||
#include "ui/dialogautonum.h"
|
#include "ui/dialogautonum.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QStandardPaths>
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -59,7 +60,7 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
|
|||||||
m_selection_actions_group (this),
|
m_selection_actions_group (this),
|
||||||
m_row_column_actions_group (this),
|
m_row_column_actions_group (this),
|
||||||
m_file_actions_group (this),
|
m_file_actions_group (this),
|
||||||
open_dialog_dir (QDesktopServices::storageLocation(QDesktopServices::DesktopLocation))
|
open_dialog_dir (QStandardPaths::writableLocation(QStandardPaths::DesktopLocation))
|
||||||
{
|
{
|
||||||
//Setup the mdi area at center of application
|
//Setup the mdi area at center of application
|
||||||
setCentralWidget(&workspace);
|
setCentralWidget(&workspace);
|
||||||
@@ -123,7 +124,7 @@ QETDiagramEditor::~QETDiagramEditor() {
|
|||||||
*/
|
*/
|
||||||
void QETDiagramEditor::setUpElementsPanel() {
|
void QETDiagramEditor::setUpElementsPanel() {
|
||||||
//Add the element panel as a QDockWidget
|
//Add the element panel as a QDockWidget
|
||||||
qdw_pa = new QDockWidget(tr("Panel d'\351l\351ments", "dock title"), this);
|
qdw_pa = new QDockWidget(tr("Panel d'éléments", "dock title"), this);
|
||||||
|
|
||||||
qdw_pa -> setObjectName ("elements panel");
|
qdw_pa -> setObjectName ("elements panel");
|
||||||
qdw_pa -> setAllowedAreas (Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
qdw_pa -> setAllowedAreas (Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||||
@@ -156,8 +157,8 @@ void QETDiagramEditor::setUpUndoStack() {
|
|||||||
QUndoView *undo_view = new QUndoView(&undo_group, this);
|
QUndoView *undo_view = new QUndoView(&undo_group, this);
|
||||||
|
|
||||||
undo_view -> setEmptyLabel (tr("Aucune modification"));
|
undo_view -> setEmptyLabel (tr("Aucune modification"));
|
||||||
undo_view -> setStatusTip (tr("Cliquez sur une action pour revenir en arri\350re dans l'\351dition de votre sch\351ma", "Status tip"));
|
undo_view -> setStatusTip (tr("Cliquez sur une action pour revenir en arrière dans l'édition de votre schéma", "Status tip"));
|
||||||
undo_view -> setWhatsThis (tr("Ce panneau liste les diff\351rentes actions effectu\351es sur le sch\351ma courant. Cliquer sur une action permet de revenir \340 l'\351tat du sch\351ma juste apr\350s son application.", "\"What's this\" tip"));
|
undo_view -> setWhatsThis (tr("Ce panneau liste les différentes actions effectuées sur le schéma courant. Cliquer sur une action permet de revenir à l'état du schéma juste après son application.", "\"What's this\" tip"));
|
||||||
|
|
||||||
qdw_undo = new QDockWidget(tr("Annulations", "dock title"), this);
|
qdw_undo = new QDockWidget(tr("Annulations", "dock title"), this);
|
||||||
qdw_undo -> setObjectName("diagram_undo");
|
qdw_undo -> setObjectName("diagram_undo");
|
||||||
@@ -187,29 +188,29 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
cut = new QAction(QET::Icons::EditCut, tr("Co&uper"), this);
|
cut = new QAction(QET::Icons::EditCut, tr("Co&uper"), this);
|
||||||
copy = new QAction(QET::Icons::EditCopy, tr("Cop&ier"), this);
|
copy = new QAction(QET::Icons::EditCopy, tr("Cop&ier"), this);
|
||||||
paste = new QAction(QET::Icons::EditPaste, tr("C&oller"), this);
|
paste = new QAction(QET::Icons::EditPaste, tr("C&oller"), this);
|
||||||
conductor_reset = new QAction(QET::Icons::ConductorSettings, tr("R\351initialiser les conducteurs"), this);
|
conductor_reset = new QAction(QET::Icons::ConductorSettings, tr("Réinitialiser les conducteurs"), this);
|
||||||
|
|
||||||
m_auto_conductor = new QAction (QET::Icons::Autoconnect, tr("Cr\351ation automatique de conducteur(s)","Tool tip of auto conductor"), this);
|
m_auto_conductor = new QAction (QET::Icons::Autoconnect, tr("Création automatique de conducteur(s)","Tool tip of auto conductor"), this);
|
||||||
m_auto_conductor -> setStatusTip (tr("Utiliser la cr\351ation automatique de conducteur(s) quand cela est possible", "Status tip of auto conductor"));
|
m_auto_conductor -> setStatusTip (tr("Utiliser la création automatique de conducteur(s) quand cela est possible", "Status tip of auto conductor"));
|
||||||
m_auto_conductor -> setCheckable (true);
|
m_auto_conductor -> setCheckable (true);
|
||||||
m_auto_conductor -> setDisabled (true);
|
m_auto_conductor -> setDisabled (true);
|
||||||
connect(m_auto_conductor, SIGNAL(triggered(bool)), this, SLOT(slot_autoConductor(bool)));
|
connect(m_auto_conductor, SIGNAL(triggered(bool)), this, SLOT(slot_autoConductor(bool)));
|
||||||
|
|
||||||
infos_diagram = new QAction(QET::Icons::DialogInformation, tr("Propri\351t\351s du sch\351ma"), this);
|
infos_diagram = new QAction(QET::Icons::DialogInformation, tr("Propriétés du schéma"), this);
|
||||||
prj_edit_prop = new QAction(QET::Icons::DialogInformation, tr("Propri\351t\351s du projet"), this);
|
prj_edit_prop = new QAction(QET::Icons::DialogInformation, tr("Propriétés du projet"), this);
|
||||||
prj_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un sch\351ma"), this);
|
prj_add_diagram = new QAction(QET::Icons::DiagramAdd, tr("Ajouter un schéma"), this);
|
||||||
prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer le sch\351ma"), this);
|
prj_del_diagram = new QAction(QET::Icons::DiagramDelete, tr("Supprimer le schéma"), this);
|
||||||
prj_clean = new QAction(QET::Icons::EditClear, tr("Nettoyer le projet"), this);
|
prj_clean = new QAction(QET::Icons::EditClear, tr("Nettoyer le projet"), this);
|
||||||
prj_diagramList = new QAction(QET::Icons::listDrawings, tr("Ajouter un sommaire"), this);
|
prj_diagramList = new QAction(QET::Icons::listDrawings, tr("Ajouter un sommaire"), this);
|
||||||
prj_nomenclature = new QAction(QET::Icons::DocumentExport, tr("Exporter une nomenclature"), this);
|
prj_nomenclature = new QAction(QET::Icons::DocumentExport, tr("Exporter une nomenclature"), this);
|
||||||
tabbed_view_mode = new QAction( tr("en utilisant des onglets"), this);
|
tabbed_view_mode = new QAction( tr("en utilisant des onglets"), this);
|
||||||
windowed_view_mode= new QAction( tr("en utilisant des fen\352tres"), this);
|
windowed_view_mode= new QAction( tr("en utilisant des fenêtres"), this);
|
||||||
mode_selection = new QAction(QET::Icons::PartSelect, tr("Mode Selection"), this);
|
mode_selection = new QAction(QET::Icons::PartSelect, tr("Mode Selection"), this);
|
||||||
mode_visualise = new QAction(QET::Icons::ViewMove, tr("Mode Visualisation"), this);
|
mode_visualise = new QAction(QET::Icons::ViewMove, tr("Mode Visualisation"), this);
|
||||||
tile_window = new QAction( tr("&Mosa\357que"), this);
|
tile_window = new QAction( tr("&Mosaïque"), this);
|
||||||
cascade_window = new QAction( tr("&Cascade"), this);
|
cascade_window = new QAction( tr("&Cascade"), this);
|
||||||
next_window = new QAction( tr("Projet suivant"), this);
|
next_window = new QAction( tr("Projet suivant"), this);
|
||||||
prev_window = new QAction( tr("Projet pr\351c\351dent"), this);
|
prev_window = new QAction( tr("Projet précédent"), this);
|
||||||
|
|
||||||
///Files action///
|
///Files action///
|
||||||
QAction *new_file = m_file_actions_group.addAction( QET::Icons::DocumentNew, tr("&Nouveau") );
|
QAction *new_file = m_file_actions_group.addAction( QET::Icons::DocumentNew, tr("&Nouveau") );
|
||||||
@@ -223,10 +224,10 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
close_file -> setShortcut( QKeySequence::Close );
|
close_file -> setShortcut( QKeySequence::Close );
|
||||||
save_file -> setShortcut( QKeySequence::Save );
|
save_file -> setShortcut( QKeySequence::Save );
|
||||||
|
|
||||||
new_file -> setStatusTip( tr("Cr\351e un nouveau sch\351ma", "status bar tip") );
|
new_file -> setStatusTip( tr("Crée un nouveau schéma", "status bar tip") );
|
||||||
open_file -> setStatusTip( tr("Ouvre un sch\351ma existant", "status bar tip") );
|
open_file -> setStatusTip( tr("Ouvre un schéma existant", "status bar tip") );
|
||||||
close_file -> setStatusTip( tr("Ferme le sch\351ma courant", "status bar tip") );
|
close_file -> setStatusTip( tr("Ferme le schéma courant", "status bar tip") );
|
||||||
save_file -> setStatusTip( tr("Enregistre le projet courant et tous ses sch\351mas", "status bar tip") );
|
save_file -> setStatusTip( tr("Enregistre le projet courant et tous ses schémas", "status bar tip") );
|
||||||
save_file_as -> setStatusTip( tr("Enregistre le project courant avec un autre nom de fichier", "status bar tip") );
|
save_file_as -> setStatusTip( tr("Enregistre le project courant avec un autre nom de fichier", "status bar tip") );
|
||||||
|
|
||||||
connect(save_file_as, SIGNAL( triggered() ), this, SLOT( saveAs() ) );
|
connect(save_file_as, SIGNAL( triggered() ), this, SLOT( saveAs() ) );
|
||||||
@@ -241,10 +242,10 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
QAction *add_row = m_row_column_actions_group.addAction( QET::Icons::EditTableInsertRowUnder, tr("Ajouter une ligne") );
|
QAction *add_row = m_row_column_actions_group.addAction( QET::Icons::EditTableInsertRowUnder, tr("Ajouter une ligne") );
|
||||||
QAction *remove_row = m_row_column_actions_group.addAction( QET::Icons::EditTableDeleteRow, tr("Enlever une ligne") );
|
QAction *remove_row = m_row_column_actions_group.addAction( QET::Icons::EditTableDeleteRow, tr("Enlever une ligne") );
|
||||||
|
|
||||||
add_column -> setStatusTip( tr("Ajoute une colonne au sch\351ma", "status bar tip") );
|
add_column -> setStatusTip( tr("Ajoute une colonne au schéma", "status bar tip") );
|
||||||
remove_column -> setStatusTip( tr("Enl\350ve une colonne au sch\351ma", "status bar tip") );
|
remove_column -> setStatusTip( tr("Enlève une colonne au schéma", "status bar tip") );
|
||||||
add_row -> setStatusTip( tr("Agrandit le sch\351ma en hauteur", "status bar tip") );
|
add_row -> setStatusTip( tr("Agrandit le schéma en hauteur", "status bar tip") );
|
||||||
remove_row -> setStatusTip( tr("R\351tr\351cit le sch\351ma en hauteur", "status bar tip") );
|
remove_row -> setStatusTip( tr("Rétrécit le schéma en hauteur", "status bar tip") );
|
||||||
|
|
||||||
connect(add_column, SIGNAL( triggered() ), this, SLOT( slot_addColumn() ) );
|
connect(add_column, SIGNAL( triggered() ), this, SLOT( slot_addColumn() ) );
|
||||||
connect(remove_column, SIGNAL( triggered() ), this, SLOT( slot_removeColumn() ) );
|
connect(remove_column, SIGNAL( triggered() ), this, SLOT( slot_removeColumn() ) );
|
||||||
@@ -256,9 +257,9 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
rotate_selection = m_selection_actions_group.addAction( QET::Icons::ObjectRotateRight, tr("Pivoter") );
|
rotate_selection = m_selection_actions_group.addAction( QET::Icons::ObjectRotateRight, tr("Pivoter") );
|
||||||
rotate_texts = m_selection_actions_group.addAction( QET::Icons::ObjectRotateRight, tr("Orienter les textes") );
|
rotate_texts = m_selection_actions_group.addAction( QET::Icons::ObjectRotateRight, tr("Orienter les textes") );
|
||||||
find_element = m_selection_actions_group.addAction( tr("Retrouver dans le panel") );
|
find_element = m_selection_actions_group.addAction( tr("Retrouver dans le panel") );
|
||||||
edit_selection = m_selection_actions_group.addAction( QET::Icons::ElementEdit, tr("\311diter l'item s\351lectionn\351") );
|
edit_selection = m_selection_actions_group.addAction( QET::Icons::ElementEdit, tr("Éditer l'item sélectionné") );
|
||||||
|
|
||||||
#ifndef Q_WS_MAC
|
#ifndef Q_OS_MAC
|
||||||
delete_selection -> setShortcut( QKeySequence( Qt::Key_Delete) );
|
delete_selection -> setShortcut( QKeySequence( Qt::Key_Delete) );
|
||||||
#else
|
#else
|
||||||
delete_selection -> setShortcut( QKeySequence( tr("Backspace") ) );
|
delete_selection -> setShortcut( QKeySequence( tr("Backspace") ) );
|
||||||
@@ -270,10 +271,10 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
infos_diagram -> setShortcut( QKeySequence( tr("Ctrl+L") ) );
|
infos_diagram -> setShortcut( QKeySequence( tr("Ctrl+L") ) );
|
||||||
edit_selection -> setShortcut( QKeySequence( tr("Ctrl+E") ) );
|
edit_selection -> setShortcut( QKeySequence( tr("Ctrl+E") ) );
|
||||||
|
|
||||||
delete_selection -> setStatusTip( tr("Enl\350ve les \351l\351ments s\351lectionn\351s du sch\351ma", "status bar tip") );
|
delete_selection -> setStatusTip( tr("Enlève les éléments sélectionnés du schéma", "status bar tip") );
|
||||||
rotate_selection -> setStatusTip( tr("Pivote les \351l\351ments et textes s\351lectionn\351s", "status bar tip") );
|
rotate_selection -> setStatusTip( tr("Pivote les éléments et textes sélectionnés", "status bar tip") );
|
||||||
rotate_texts -> setStatusTip( tr("Pivote les textes s\351lectionn\351s \340 un angle pr\351cis", "status bar tip") );
|
rotate_texts -> setStatusTip( tr("Pivote les textes sélectionnés à un angle précis", "status bar tip") );
|
||||||
find_element -> setStatusTip( tr("Retrouve l'\351l\351ment s\351lectionn\351 dans le panel", "status bar tip") );
|
find_element -> setStatusTip( tr("Retrouve l'élément sélectionné dans le panel", "status bar tip") );
|
||||||
|
|
||||||
connect(delete_selection, SIGNAL( triggered() ), this, SLOT( slot_delete() ) );
|
connect(delete_selection, SIGNAL( triggered() ), this, SLOT( slot_delete() ) );
|
||||||
connect(rotate_selection, SIGNAL( triggered() ), this, SLOT( slot_rotate() ) );
|
connect(rotate_selection, SIGNAL( triggered() ), this, SLOT( slot_rotate() ) );
|
||||||
@@ -282,17 +283,17 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
connect(edit_selection, SIGNAL( triggered() ), this, SLOT( slot_editSelection() ) );
|
connect(edit_selection, SIGNAL( triggered() ), this, SLOT( slot_editSelection() ) );
|
||||||
|
|
||||||
///Select Action///
|
///Select Action///
|
||||||
QAction *select_all = m_select_actions_group.addAction( QET::Icons::EditSelectAll, tr("Tout s\351lectionner") );
|
QAction *select_all = m_select_actions_group.addAction( QET::Icons::EditSelectAll, tr("Tout sélectionner") );
|
||||||
QAction *select_nothing = m_select_actions_group.addAction( tr("D\351s\351lectionner tout") );
|
QAction *select_nothing = m_select_actions_group.addAction( tr("Désélectionner tout") );
|
||||||
QAction *select_invert = m_select_actions_group.addAction( tr("Inverser la s\351lection") );
|
QAction *select_invert = m_select_actions_group.addAction( tr("Inverser la sélection") );
|
||||||
|
|
||||||
select_all -> setShortcut( QKeySequence::SelectAll );
|
select_all -> setShortcut( QKeySequence::SelectAll );
|
||||||
select_nothing -> setShortcut( QKeySequence( tr("Ctrl+Shift+A") ) );
|
select_nothing -> setShortcut( QKeySequence( tr("Ctrl+Shift+A") ) );
|
||||||
select_invert -> setShortcut( QKeySequence( tr("Ctrl+I") ) );
|
select_invert -> setShortcut( QKeySequence( tr("Ctrl+I") ) );
|
||||||
|
|
||||||
select_all -> setStatusTip( tr("S\351lectionne tous les \351l\351ments du sch\351ma", "status bar tip") );
|
select_all -> setStatusTip( tr("Sélectionne tous les éléments du schéma", "status bar tip") );
|
||||||
select_nothing -> setStatusTip( tr("D\351s\351lectionne tous les \351l\351ments du sch\351ma", "status bar tip") );
|
select_nothing -> setStatusTip( tr("Désélectionne tous les éléments du schéma", "status bar tip") );
|
||||||
select_invert -> setStatusTip( tr("D\351s\351lectionne les \351l\351ments s\351lectionn\351s et s\351lectionne les \351l\351ments non s\351lectionn\351s", "status bar tip") );
|
select_invert -> setStatusTip( tr("Désélectionne les éléments sélectionnés et sélectionne les éléments non sélectionnés", "status bar tip") );
|
||||||
|
|
||||||
connect(select_all, SIGNAL( triggered() ), this, SLOT( slot_selectAll() ) );
|
connect(select_all, SIGNAL( triggered() ), this, SLOT( slot_selectAll() ) );
|
||||||
connect(select_nothing, SIGNAL( triggered() ), this, SLOT( slot_selectNothing() ) );
|
connect(select_nothing, SIGNAL( triggered() ), this, SLOT( slot_selectNothing() ) );
|
||||||
@@ -300,9 +301,9 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
|
|
||||||
///Zoom actions///
|
///Zoom actions///
|
||||||
QAction *zoom_in = m_zoom_actions_group.addAction( QET::Icons::ZoomIn, tr("Zoom avant") );
|
QAction *zoom_in = m_zoom_actions_group.addAction( QET::Icons::ZoomIn, tr("Zoom avant") );
|
||||||
QAction *zoom_out = m_zoom_actions_group.addAction( QET::Icons::ZoomOut, tr("Zoom arri\350re") );
|
QAction *zoom_out = m_zoom_actions_group.addAction( QET::Icons::ZoomOut, tr("Zoom arrière") );
|
||||||
QAction *zoom_content = m_zoom_actions_group.addAction( QET::Icons::ZoomDraw, tr("Zoom sur le contenu") );
|
QAction *zoom_content = m_zoom_actions_group.addAction( QET::Icons::ZoomDraw, tr("Zoom sur le contenu") );
|
||||||
QAction *zoom_fit = m_zoom_actions_group.addAction( QET::Icons::ZoomFitBest, tr("Zoom adapt\351") );
|
QAction *zoom_fit = m_zoom_actions_group.addAction( QET::Icons::ZoomFitBest, tr("Zoom adapté") );
|
||||||
QAction *zoom_reset = m_zoom_actions_group.addAction( QET::Icons::ZoomOriginal, tr("Pas de zoom") );
|
QAction *zoom_reset = m_zoom_actions_group.addAction( QET::Icons::ZoomOriginal, tr("Pas de zoom") );
|
||||||
m_zoom_action_toolBar << zoom_content << zoom_fit << zoom_reset;
|
m_zoom_action_toolBar << zoom_content << zoom_fit << zoom_reset;
|
||||||
|
|
||||||
@@ -312,11 +313,11 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
zoom_fit -> setShortcut( QKeySequence( tr("Ctrl+9") ) );
|
zoom_fit -> setShortcut( QKeySequence( tr("Ctrl+9") ) );
|
||||||
zoom_reset -> setShortcut( QKeySequence( tr("Ctrl+0") ) );
|
zoom_reset -> setShortcut( QKeySequence( tr("Ctrl+0") ) );
|
||||||
|
|
||||||
zoom_in -> setStatusTip(tr("Agrandit le sch\351ma", "status bar tip"));
|
zoom_in -> setStatusTip(tr("Agrandit le schéma", "status bar tip"));
|
||||||
zoom_out -> setStatusTip(tr("R\351tr\351cit le sch\351ma", "status bar tip"));
|
zoom_out -> setStatusTip(tr("Rétrécit le schéma", "status bar tip"));
|
||||||
zoom_content -> setStatusTip(tr("Adapte le zoom de fa\347on \340 afficher tout le contenu ind\351pendamment du cadre"));
|
zoom_content -> setStatusTip(tr("Adapte le zoom de façon à afficher tout le contenu indépendamment du cadre"));
|
||||||
zoom_fit -> setStatusTip(tr("Adapte la taille du sch\351ma afin qu'il soit enti\350rement visible", "status bar tip"));
|
zoom_fit -> setStatusTip(tr("Adapte la taille du schéma afin qu'il soit entièrement visible", "status bar tip"));
|
||||||
zoom_reset -> setStatusTip(tr("Restaure le zoom par d\351faut", "status bar tip"));
|
zoom_reset -> setStatusTip(tr("Restaure le zoom par défaut", "status bar tip"));
|
||||||
|
|
||||||
connect( zoom_in, SIGNAL( triggered() ), this, SLOT( slot_zoomIn() ) );
|
connect( zoom_in, SIGNAL( triggered() ), this, SLOT( slot_zoomIn() ) );
|
||||||
connect( zoom_out, SIGNAL( triggered() ), this, SLOT( slot_zoomOut() ) );
|
connect( zoom_out, SIGNAL( triggered() ), this, SLOT( slot_zoomOut() ) );
|
||||||
@@ -359,27 +360,27 @@ void QETDiagramEditor::setUpActions() {
|
|||||||
prev_window -> setShortcut(QKeySequence::PreviousChild);
|
prev_window -> setShortcut(QKeySequence::PreviousChild);
|
||||||
|
|
||||||
// affichage dans la barre de statut
|
// affichage dans la barre de statut
|
||||||
export_diagram -> setStatusTip(tr("Exporte le sch\351ma courant dans un autre format", "status bar tip"));
|
export_diagram -> setStatusTip(tr("Exporte le schéma courant dans un autre format", "status bar tip"));
|
||||||
print -> setStatusTip(tr("Imprime le sch\351ma courant", "status bar tip"));
|
print -> setStatusTip(tr("Imprime le schéma courant", "status bar tip"));
|
||||||
quit_editor -> setStatusTip(tr("Ferme l'application QElectroTech", "status bar tip"));
|
quit_editor -> setStatusTip(tr("Ferme l'application QElectroTech", "status bar tip"));
|
||||||
undo -> setStatusTip(tr("Annule l'action pr\351c\351dente", "status bar tip"));
|
undo -> setStatusTip(tr("Annule l'action précédente", "status bar tip"));
|
||||||
redo -> setStatusTip(tr("Restaure l'action annul\351e", "status bar tip"));
|
redo -> setStatusTip(tr("Restaure l'action annulée", "status bar tip"));
|
||||||
cut -> setStatusTip(tr("Transf\350re les \351l\351ments s\351lectionn\351s dans le presse-papier", "status bar tip"));
|
cut -> setStatusTip(tr("Transfère les éléments sélectionnés dans le presse-papier", "status bar tip"));
|
||||||
copy -> setStatusTip(tr("Copie les \351l\351ments s\351lectionn\351s dans le presse-papier", "status bar tip"));
|
copy -> setStatusTip(tr("Copie les éléments sélectionnés dans le presse-papier", "status bar tip"));
|
||||||
paste -> setStatusTip(tr("Place les \351l\351ments du presse-papier sur le sch\351ma", "status bar tip"));
|
paste -> setStatusTip(tr("Place les éléments du presse-papier sur le schéma", "status bar tip"));
|
||||||
conductor_reset -> setStatusTip(tr("Recalcule les chemins des conducteurs sans tenir compte des modifications", "status bar tip"));
|
conductor_reset -> setStatusTip(tr("Recalcule les chemins des conducteurs sans tenir compte des modifications", "status bar tip"));
|
||||||
infos_diagram -> setStatusTip(tr("\311dite les informations affich\351es par le cartouche", "status bar tip"));
|
infos_diagram -> setStatusTip(tr("Édite les informations affichées par le cartouche", "status bar tip"));
|
||||||
|
|
||||||
windowed_view_mode -> setStatusTip(tr("Pr\351sente les diff\351rents projets ouverts dans des sous-fen\352tres", "status bar tip"));
|
windowed_view_mode -> setStatusTip(tr("Présente les différents projets ouverts dans des sous-fenêtres", "status bar tip"));
|
||||||
tabbed_view_mode -> setStatusTip(tr("Pr\351sente les diff\351rents projets ouverts des onglets", "status bar tip"));
|
tabbed_view_mode -> setStatusTip(tr("Présente les différents projets ouverts des onglets", "status bar tip"));
|
||||||
|
|
||||||
mode_selection -> setStatusTip(tr("Permet de s\351lectionner les \351l\351ments", "status bar tip"));
|
mode_selection -> setStatusTip(tr("Permet de sélectionner les éléments", "status bar tip"));
|
||||||
mode_visualise -> setStatusTip(tr("Permet de visualiser le sch\351ma sans pouvoir le modifier", "status bar tip"));
|
mode_visualise -> setStatusTip(tr("Permet de visualiser le schéma sans pouvoir le modifier", "status bar tip"));
|
||||||
|
|
||||||
tile_window -> setStatusTip(tr("Dispose les fen\352tres en mosa\357que", "status bar tip"));
|
tile_window -> setStatusTip(tr("Dispose les fenêtres en mosaïque", "status bar tip"));
|
||||||
cascade_window -> setStatusTip(tr("Dispose les fen\352tres en cascade", "status bar tip"));
|
cascade_window -> setStatusTip(tr("Dispose les fenêtres en cascade", "status bar tip"));
|
||||||
next_window -> setStatusTip(tr("Active le projet suivant", "status bar tip"));
|
next_window -> setStatusTip(tr("Active le projet suivant", "status bar tip"));
|
||||||
prev_window -> setStatusTip(tr("Active le projet pr\351c\351dent", "status bar tip"));
|
prev_window -> setStatusTip(tr("Active le projet précédent", "status bar tip"));
|
||||||
//mode_visualise -> setShortcut( QKeySequence( tr("Ctrl+Shift") ) );
|
//mode_visualise -> setShortcut( QKeySequence( tr("Ctrl+Shift") ) );
|
||||||
|
|
||||||
// traitements speciaux
|
// traitements speciaux
|
||||||
@@ -434,7 +435,7 @@ void QETDiagramEditor::setUpToolBar() {
|
|||||||
view_bar = new QToolBar(tr("Affichage"), this);
|
view_bar = new QToolBar(tr("Affichage"), this);
|
||||||
view_bar -> setObjectName("display");
|
view_bar -> setObjectName("display");
|
||||||
|
|
||||||
diagram_bar = new QToolBar(tr("Sch\351ma"), this);
|
diagram_bar = new QToolBar(tr("Schéma"), this);
|
||||||
diagram_bar -> setObjectName("diagram");
|
diagram_bar -> setObjectName("diagram");
|
||||||
|
|
||||||
main_bar -> addActions(m_file_actions_group.actions());
|
main_bar -> addActions(m_file_actions_group.actions());
|
||||||
@@ -477,11 +478,11 @@ void QETDiagramEditor::setUpToolBar() {
|
|||||||
void QETDiagramEditor::setUpMenu() {
|
void QETDiagramEditor::setUpMenu() {
|
||||||
|
|
||||||
QMenu *menu_fichier = new QMenu(tr("&Fichier"));
|
QMenu *menu_fichier = new QMenu(tr("&Fichier"));
|
||||||
QMenu *menu_edition = new QMenu(tr("&\311dition"));
|
QMenu *menu_edition = new QMenu(tr("&Édition"));
|
||||||
QMenu *menu_project = new QMenu(tr("&Projet"));
|
QMenu *menu_project = new QMenu(tr("&Projet"));
|
||||||
QMenu *menu_affichage = new QMenu(tr("Afficha&ge"));
|
QMenu *menu_affichage = new QMenu(tr("Afficha&ge"));
|
||||||
//QMenu *menu_outils = new QMenu(tr("O&utils"));
|
//QMenu *menu_outils = new QMenu(tr("O&utils"));
|
||||||
windows_menu = new QMenu(tr("Fe&n\352tres"));
|
windows_menu = new QMenu(tr("Fe&nêtres"));
|
||||||
|
|
||||||
insertMenu(settings_menu_, menu_fichier);
|
insertMenu(settings_menu_, menu_fichier);
|
||||||
insertMenu(settings_menu_, menu_edition);
|
insertMenu(settings_menu_, menu_edition);
|
||||||
@@ -490,7 +491,7 @@ void QETDiagramEditor::setUpMenu() {
|
|||||||
insertMenu(help_menu_, windows_menu);
|
insertMenu(help_menu_, windows_menu);
|
||||||
|
|
||||||
// File menu
|
// File menu
|
||||||
QMenu *recentfile = menu_fichier -> addMenu(QET::Icons::DocumentOpenRecent, tr("&R\351cemment ouverts"));
|
QMenu *recentfile = menu_fichier -> addMenu(QET::Icons::DocumentOpenRecent, tr("&Récemment ouverts"));
|
||||||
recentfile->addActions(QETApp::projectsRecentFiles()->menu()->actions());
|
recentfile->addActions(QETApp::projectsRecentFiles()->menu()->actions());
|
||||||
connect(QETApp::projectsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
|
connect(QETApp::projectsRecentFiles(), SIGNAL(fileOpeningRequested(const QString &)), this, SLOT(openRecentFile(const QString &)));
|
||||||
menu_fichier -> addActions(m_file_actions_group.actions());
|
menu_fichier -> addActions(m_file_actions_group.actions());
|
||||||
@@ -530,7 +531,7 @@ void QETDiagramEditor::setUpMenu() {
|
|||||||
|
|
||||||
main_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils principale"));
|
main_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils principale"));
|
||||||
view_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils Affichage"));
|
view_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils Affichage"));
|
||||||
diagram_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils Sch\351ma"));
|
diagram_bar -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la barre d'outils Schéma"));
|
||||||
qdw_pa -> toggleViewAction() -> setStatusTip(tr("Affiche ou non le panel d'appareils"));
|
qdw_pa -> toggleViewAction() -> setStatusTip(tr("Affiche ou non le panel d'appareils"));
|
||||||
qdw_undo -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la liste des modifications"));
|
qdw_undo -> toggleViewAction() -> setStatusTip(tr("Affiche ou non la liste des modifications"));
|
||||||
|
|
||||||
@@ -630,7 +631,7 @@ void QETDiagramEditor::save() {
|
|||||||
QString title = (project_view -> project() -> title ());
|
QString title = (project_view -> project() -> title ());
|
||||||
if (title.isEmpty()) title = "QElectroTech ";
|
if (title.isEmpty()) title = "QElectroTech ";
|
||||||
QString filePath = (project_view -> project() -> filePath ());
|
QString filePath = (project_view -> project() -> filePath ());
|
||||||
statusBar()-> showMessage(tr("Projet %1 enregistr\351 dans le repertoire: %2.").arg(title).arg (filePath), 2000);
|
statusBar()-> showMessage(tr("Projet %1 enregistré dans le repertoire: %2.").arg(title).arg (filePath), 2000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
showError(saved);
|
showError(saved);
|
||||||
@@ -651,7 +652,7 @@ void QETDiagramEditor::saveAs() {
|
|||||||
QString title = (project_view -> project() -> title ());
|
QString title = (project_view -> project() -> title ());
|
||||||
if (title.isEmpty()) title = "QElectroTech ";
|
if (title.isEmpty()) title = "QElectroTech ";
|
||||||
QString filePath = (project_view -> project() -> filePath ());
|
QString filePath = (project_view -> project() -> filePath ());
|
||||||
statusBar()->showMessage(tr("Projet %1 enregistr\351 dans le repertoire: %2.").arg(title).arg (filePath), 2000);
|
statusBar()->showMessage(tr("Projet %1 enregistré dans le repertoire: %2.").arg(title).arg (filePath), 2000);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
showError(save_file);
|
showError(save_file);
|
||||||
@@ -705,7 +706,7 @@ bool QETDiagramEditor::openProject() {
|
|||||||
this,
|
this,
|
||||||
tr("Ouvrir un fichier"),
|
tr("Ouvrir un fichier"),
|
||||||
open_dialog_dir.absolutePath(),
|
open_dialog_dir.absolutePath(),
|
||||||
tr("Sch\351mas QElectroTech (*.qet);;Fichiers XML (*.xml);;Tous les fichiers (*)")
|
tr("Schémas QElectroTech (*.qet);;Fichiers XML (*.xml);;Tous les fichiers (*)")
|
||||||
);
|
);
|
||||||
if (filepath.isEmpty()) return(false);
|
if (filepath.isEmpty()) return(false);
|
||||||
|
|
||||||
@@ -788,7 +789,7 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
|||||||
// check the file exists
|
// check the file exists
|
||||||
if (!filepath_info.exists()) {
|
if (!filepath_info.exists()) {
|
||||||
if (interactive) {
|
if (interactive) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Impossible d'ouvrir le fichier", "message box title"),
|
tr("Impossible d'ouvrir le fichier", "message box title"),
|
||||||
QString(
|
QString(
|
||||||
@@ -803,12 +804,12 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
|||||||
// verifie que le fichier est accessible en lecture
|
// verifie que le fichier est accessible en lecture
|
||||||
if (!filepath_info.isReadable()) {
|
if (!filepath_info.isReadable()) {
|
||||||
if (interactive) {
|
if (interactive) {
|
||||||
QET::MessageBox::critical(
|
QET::QetMessageBox::critical(
|
||||||
this,
|
this,
|
||||||
tr("Impossible d'ouvrir le fichier", "message box title"),
|
tr("Impossible d'ouvrir le fichier", "message box title"),
|
||||||
tr("Il semblerait que le fichier que vous essayez d'ouvrir ne "
|
tr("Il semblerait que le fichier que vous essayez d'ouvrir ne "
|
||||||
"soit pas accessible en lecture. Il est donc impossible de "
|
"soit pas accessible en lecture. Il est donc impossible de "
|
||||||
"l'ouvrir. Veuillez v\351rifier les permissions du fichier.")
|
"l'ouvrir. Veuillez vérifier les permissions du fichier.")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
return(false);
|
return(false);
|
||||||
@@ -817,11 +818,11 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
|||||||
// gere le fait que le fichier puisse etre en lecture seule
|
// gere le fait que le fichier puisse etre en lecture seule
|
||||||
if (!filepath_info.isWritable()) {
|
if (!filepath_info.isWritable()) {
|
||||||
if (interactive) {
|
if (interactive) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("Ouverture du projet en lecture seule", "message box title"),
|
tr("Ouverture du projet en lecture seule", "message box title"),
|
||||||
tr("Il semblerait que le projet que vous essayez d'ouvrir ne "
|
tr("Il semblerait que le projet que vous essayez d'ouvrir ne "
|
||||||
"soit pas accessible en \351criture. Il sera donc ouvert en "
|
"soit pas accessible en écriture. Il sera donc ouvert en "
|
||||||
"lecture seule.")
|
"lecture seule.")
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -831,13 +832,13 @@ bool QETDiagramEditor::openAndAddProject(const QString &filepath, bool interacti
|
|||||||
QETProject *project = new QETProject(filepath);
|
QETProject *project = new QETProject(filepath);
|
||||||
if (project -> state() != QETProject::Ok) {
|
if (project -> state() != QETProject::Ok) {
|
||||||
if (interactive && project -> state() != QETProject::FileOpenDiscard) {
|
if (interactive && project -> state() != QETProject::FileOpenDiscard) {
|
||||||
QET::MessageBox::warning(
|
QET::QetMessageBox::warning(
|
||||||
this,
|
this,
|
||||||
tr("\311chec de l'ouverture du projet", "message box title"),
|
tr("Échec de l'ouverture du projet", "message box title"),
|
||||||
QString(
|
QString(
|
||||||
tr(
|
tr(
|
||||||
"Il semblerait que le fichier %1 ne soit pas un fichier"
|
"Il semblerait que le fichier %1 ne soit pas un fichier"
|
||||||
" projet QElectroTech. Il ne peut donc \352tre ouvert.",
|
" projet QElectroTech. Il ne peut donc être ouvert.",
|
||||||
"message box content"
|
"message box content"
|
||||||
)
|
)
|
||||||
).arg(filepath)
|
).arg(filepath)
|
||||||
@@ -1254,32 +1255,32 @@ void QETDiagramEditor::slot_updateComplexActions() {
|
|||||||
//edit element
|
//edit element
|
||||||
if (selected_elements_count)
|
if (selected_elements_count)
|
||||||
{
|
{
|
||||||
edit_selection -> setText(tr("\311diter l'\351lement", "edit element"));
|
edit_selection -> setText(tr("Éditer l'élement", "edit element"));
|
||||||
edit_selection -> setIcon(QET::Icons::ElementEdit);
|
edit_selection -> setIcon(QET::Icons::ElementEdit);
|
||||||
}
|
}
|
||||||
//edit text field
|
//edit text field
|
||||||
else if (selected_texts)
|
else if (selected_texts)
|
||||||
{
|
{
|
||||||
edit_selection -> setText(tr("\311diter le champ de texte", "edit text field"));
|
edit_selection -> setText(tr("Éditer le champ de texte", "edit text field"));
|
||||||
edit_selection -> setIcon(QET::Icons::EditText);
|
edit_selection -> setIcon(QET::Icons::EditText);
|
||||||
}
|
}
|
||||||
//edit image
|
//edit image
|
||||||
else if (selected_image)
|
else if (selected_image)
|
||||||
{
|
{
|
||||||
edit_selection -> setText(tr("\311diter l'image", "edit image"));
|
edit_selection -> setText(tr("Éditer l'image", "edit image"));
|
||||||
edit_selection -> setIcon(QET::Icons::resize_image);
|
edit_selection -> setIcon(QET::Icons::resize_image);
|
||||||
}
|
}
|
||||||
//edit conductor
|
//edit conductor
|
||||||
else if (selected_conductors_count)
|
else if (selected_conductors_count)
|
||||||
{
|
{
|
||||||
edit_selection -> setText(tr("\311diter le conducteur", "edit conductor"));
|
edit_selection -> setText(tr("Éditer le conducteur", "edit conductor"));
|
||||||
edit_selection -> setIcon(QET::Icons::ElementEdit);
|
edit_selection -> setIcon(QET::Icons::ElementEdit);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//not an editable item
|
//not an editable item
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
edit_selection -> setText(tr("\311diter l'objet s\351lectionn\351", "edit selected item"));
|
edit_selection -> setText(tr("Éditer l'objet sélectionné", "edit selected item"));
|
||||||
edit_selection -> setIcon(QET::Icons::ElementEdit);
|
edit_selection -> setIcon(QET::Icons::ElementEdit);
|
||||||
edit_selection -> setEnabled(false);
|
edit_selection -> setEnabled(false);
|
||||||
}
|
}
|
||||||
@@ -1450,7 +1451,7 @@ void QETDiagramEditor::slot_updateWindowsMenu() {
|
|||||||
QString pv_title = project_view -> windowTitle();
|
QString pv_title = project_view -> windowTitle();
|
||||||
QAction *action = windows_menu -> addAction(pv_title);
|
QAction *action = windows_menu -> addAction(pv_title);
|
||||||
windows_actions -> addAction(action);
|
windows_actions -> addAction(action);
|
||||||
action -> setStatusTip(QString(tr("Active le projet \253\240%1\240\273")).arg(pv_title));
|
action -> setStatusTip(QString(tr("Active le projet « %1 »")).arg(pv_title));
|
||||||
action -> setCheckable(true);
|
action -> setCheckable(true);
|
||||||
action -> setChecked(project_view == currentProject());
|
action -> setChecked(project_view == currentProject());
|
||||||
connect(action, SIGNAL(triggered()), &windowMapper, SLOT(map()));
|
connect(action, SIGNAL(triggered()), &windowMapper, SLOT(map()));
|
||||||
@@ -1961,13 +1962,13 @@ void QETDiagramEditor::findElementInPanel(const ElementsLocation &location) {
|
|||||||
// peut-etre vient-il d'un projet ouvert dans un autre editeur ?
|
// peut-etre vient-il d'un projet ouvert dans un autre editeur ?
|
||||||
if (location.project() && !findProject(location.project())) {
|
if (location.project() && !findProject(location.project())) {
|
||||||
statusBar() -> showMessage(
|
statusBar() -> showMessage(
|
||||||
tr("Impossible de retrouver cet \351l\351ment dans le panel car il semble \351dit\351 dans une autre fen\352tre"),
|
tr("Impossible de retrouver cet élément dans le panel car il semble édité dans une autre fenêtre"),
|
||||||
10000
|
10000
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
// il devrait etre affiche : on tente de recharger le panel
|
// il devrait etre affiche : on tente de recharger le panel
|
||||||
statusBar() -> showMessage(
|
statusBar() -> showMessage(
|
||||||
tr("Impossible de retrouver cet \351l\351ment dans le panel... rechargement du panel..."),
|
tr("Impossible de retrouver cet élément dans le panel... rechargement du panel..."),
|
||||||
10000
|
10000
|
||||||
);
|
);
|
||||||
pa -> reloadAndFilter();
|
pa -> reloadAndFilter();
|
||||||
@@ -1979,7 +1980,7 @@ void QETDiagramEditor::findElementInPanel(const ElementsLocation &location) {
|
|||||||
|
|
||||||
if (!element_found) {
|
if (!element_found) {
|
||||||
statusBar() -> showMessage(
|
statusBar() -> showMessage(
|
||||||
tr("Impossible de retrouver cet \351l\351ment dans le panel"),
|
tr("Impossible de retrouver cet élément dans le panel"),
|
||||||
10000
|
10000
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@@ -2026,7 +2027,7 @@ void QETDiagramEditor::showError(const QETResult &result) {
|
|||||||
*/
|
*/
|
||||||
void QETDiagramEditor::showError(const QString &error) {
|
void QETDiagramEditor::showError(const QString &error) {
|
||||||
if (error.isEmpty()) return;
|
if (error.isEmpty()) return;
|
||||||
QET::MessageBox::critical(this, tr("Erreur", "message box title"), error);
|
QET::QetMessageBox::critical(this, tr("Erreur", "message box title"), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
*/
|
*/
|
||||||
#ifndef QET_DIAGRAM_EDITOR_H
|
#ifndef QET_DIAGRAM_EDITOR_H
|
||||||
#define QET_DIAGRAM_EDITOR_H
|
#define QET_DIAGRAM_EDITOR_H
|
||||||
#include <QtGui>
|
#include <QtWidgets>
|
||||||
#include "qetmainwindow.h"
|
#include "qetmainwindow.h"
|
||||||
|
|
||||||
class QETProject;
|
class QETProject;
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ Conductor::Conductor(Terminal *p1, Terminal* p2) :
|
|||||||
// calcul du rendu du conducteur
|
// calcul du rendu du conducteur
|
||||||
generateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
generateConductorPath(terminal1 -> dockConductor(), terminal1 -> orientation(), terminal2 -> dockConductor(), terminal2 -> orientation());
|
||||||
setFlags(QGraphicsItem::ItemIsSelectable);
|
setFlags(QGraphicsItem::ItemIsSelectable);
|
||||||
setAcceptsHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
|
|
||||||
// ajout du champ de texte editable
|
// ajout du champ de texte editable
|
||||||
text_item = new ConductorTextItem(properties_.text, this);
|
text_item = new ConductorTextItem(properties_.text, this);
|
||||||
@@ -477,7 +477,7 @@ void Conductor::paint(QPainter *qp, const QStyleOptionGraphicsItem *options, QWi
|
|||||||
}
|
}
|
||||||
|
|
||||||
// decalage ideal pour le rendu centre d'un carre / cercle de 2.0 px de cote / diametre
|
// decalage ideal pour le rendu centre d'un carre / cercle de 2.0 px de cote / diametre
|
||||||
qreal pretty_offset = (options -> levelOfDetail == 1 ? 1.0 : 1.0);
|
qreal pretty_offset = 1.0;
|
||||||
|
|
||||||
// dessin des points d'accroche du conducteur si celui-ci est selectionne
|
// dessin des points d'accroche du conducteur si celui-ci est selectionne
|
||||||
if (isSelected()) {
|
if (isSelected()) {
|
||||||
@@ -1396,7 +1396,7 @@ void Conductor::displayedTextChanged() {
|
|||||||
{
|
{
|
||||||
qmbreturn = QMessageBox::question(diagramEditor(), tr("Textes de conducteurs"),
|
qmbreturn = QMessageBox::question(diagramEditor(), tr("Textes de conducteurs"),
|
||||||
tr("Voulez-vous appliquer le nouveau texte \n"
|
tr("Voulez-vous appliquer le nouveau texte \n"
|
||||||
"\340 l'ensemble des conducteurs de ce potentiel ?"),
|
"à l'ensemble des conducteurs de ce potentiel ?"),
|
||||||
QMessageBox::No| QMessageBox::Yes, QMessageBox::Yes);
|
QMessageBox::No| QMessageBox::Yes, QMessageBox::Yes);
|
||||||
if (qmbreturn == QMessageBox::Yes)
|
if (qmbreturn == QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ ConductorTextItem::ConductorTextItem(Conductor *parent_conductor) :
|
|||||||
moved_by_user_(false),
|
moved_by_user_(false),
|
||||||
rotate_by_user_(false)
|
rotate_by_user_(false)
|
||||||
{
|
{
|
||||||
setAcceptsHoverEvents(true);
|
setAcceptHoverEvents(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,13 +208,13 @@ void ConductorTextItem::mouseReleaseEvent(QGraphicsSceneMouseEvent *e) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
When mouse over element
|
When mouse over element
|
||||||
change bMouseOver to true (used in paint() function )
|
change m_mouse_hover to true (used in paint() function )
|
||||||
@param e QGraphicsSceneHoverEvent
|
@param e QGraphicsSceneHoverEvent
|
||||||
*/
|
*/
|
||||||
void ConductorTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
|
void ConductorTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
|
||||||
Q_UNUSED(e);
|
Q_UNUSED(e);
|
||||||
|
|
||||||
bMouseOver = true;
|
m_mouse_hover = true;
|
||||||
QString str_ToolTip = toPlainText();
|
QString str_ToolTip = toPlainText();
|
||||||
setToolTip( str_ToolTip );
|
setToolTip( str_ToolTip );
|
||||||
update();
|
update();
|
||||||
@@ -222,13 +222,13 @@ void ConductorTextItem::hoverEnterEvent(QGraphicsSceneHoverEvent *e) {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
When mouse over element leave the position
|
When mouse over element leave the position
|
||||||
change bMouseOver to false(used in paint() function )
|
change m_mouse_hover to false(used in paint() function )
|
||||||
@param e QGraphicsSceneHoverEvent
|
@param e QGraphicsSceneHoverEvent
|
||||||
*/
|
*/
|
||||||
void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
|
void ConductorTextItem::hoverLeaveEvent(QGraphicsSceneHoverEvent *e) {
|
||||||
Q_UNUSED(e);
|
Q_UNUSED(e);
|
||||||
//qDebug() << "Leave mouse over";
|
//qDebug() << "Leave mouse over";
|
||||||
bMouseOver = false;
|
m_mouse_hover = false;
|
||||||
update();
|
update();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -117,9 +117,9 @@ bool CustomElement::buildFromXml(const QDomElement &xml_def_elmt, int *state) {
|
|||||||
qreal element_version = xml_def_elmt.attribute("version").toDouble(&conv_ok);
|
qreal element_version = xml_def_elmt.attribute("version").toDouble(&conv_ok);
|
||||||
if (conv_ok && QET::version.toDouble() < element_version) {
|
if (conv_ok && QET::version.toDouble() < element_version) {
|
||||||
std::cerr << qPrintable(
|
std::cerr << qPrintable(
|
||||||
QObject::tr("Avertissement : l'\351l\351ment "
|
QObject::tr("Avertissement : l'élément "
|
||||||
" a \351t\351 enregistr\351 avec une version"
|
" a été enregistré avec une version"
|
||||||
" ult\351rieure de QElectroTech.")
|
" ultérieure de QElectroTech.")
|
||||||
) << std::endl;
|
) << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -108,7 +108,7 @@ void DiagramImageItem::editProperty() {
|
|||||||
|
|
||||||
//the dialog
|
//the dialog
|
||||||
QDialog property_dialog(diagram()->views().at(0));
|
QDialog property_dialog(diagram()->views().at(0));
|
||||||
property_dialog.setWindowTitle(tr("\311diter les propri\351t\351s d'une image", "window title"));
|
property_dialog.setWindowTitle(tr("Éditer les propriétés d'une image", "window title"));
|
||||||
//the main layout
|
//the main layout
|
||||||
QVBoxLayout dialog_layout(&property_dialog);
|
QVBoxLayout dialog_layout(&property_dialog);
|
||||||
|
|
||||||
@@ -201,7 +201,7 @@ bool DiagramImageItem::fromXml(const QDomElement &e) {
|
|||||||
|
|
||||||
//load xml image to QByteArray
|
//load xml image to QByteArray
|
||||||
QByteArray array;
|
QByteArray array;
|
||||||
array = QByteArray::fromBase64(e.text().toAscii());
|
array = QByteArray::fromBase64(e.text().toLatin1());
|
||||||
|
|
||||||
//Set QPixmap from the @array
|
//Set QPixmap from the @array
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user