mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-23 10:30:53 +01:00
Implementation d'un menu pour editer un conducteur deja pose
git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@151 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
24
conducer.cpp
24
conducer.cpp
@@ -57,7 +57,6 @@ Conducer::Conducer(Terminal *p1, Terminal* p2, Element *parent, QGraphicsScene *
|
|||||||
text_item -> setPlainText("_");
|
text_item -> setPlainText("_");
|
||||||
text_item -> previous_text = "_";
|
text_item -> previous_text = "_";
|
||||||
calculateTextItemPosition();
|
calculateTextItemPosition();
|
||||||
//setSingleLine(true);
|
|
||||||
text_item -> setParentItem(this);
|
text_item -> setParentItem(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1004,11 +1003,30 @@ bool Conducer::isSingleLine() const {
|
|||||||
return(is_single_line);
|
return(is_single_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
Definit le conducteur comme etant unifilaire ou multifilaire
|
||||||
|
Un conducteur unifilaire peut arborer des symboles mais pas de texte
|
||||||
|
et vice-versa.
|
||||||
|
@param sl true pour un conducteur unifilaire, false pour un conducteur multifilaire
|
||||||
|
*/
|
||||||
void Conducer::setSingleLine(bool sl) {
|
void Conducer::setSingleLine(bool sl) {
|
||||||
is_single_line = sl;
|
is_single_line = sl;
|
||||||
text_item -> setVisible(!is_single_line);
|
text_item -> setVisible(!is_single_line);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// @return le texte du conducteur
|
||||||
|
QString Conducer::text() const {
|
||||||
|
return(text_item -> toPlainText());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@param t Nouveau texte du conducteur
|
||||||
|
*/
|
||||||
|
void Conducer::setText(const QString &t) {
|
||||||
|
text_item -> setPlainText(t);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur par defaut
|
Constructeur par defaut
|
||||||
*/
|
*/
|
||||||
@@ -1058,7 +1076,7 @@ void SingleLineProperties::draw(QPainter *painter, QET::ConducerSegmentType dire
|
|||||||
qreal interleave;
|
qreal interleave;
|
||||||
qreal symbol_width;
|
qreal symbol_width;
|
||||||
if (direction == QET::Horizontal) {
|
if (direction == QET::Horizontal) {
|
||||||
interleave = rect.width() / symbols_count;
|
interleave = rect.width() / (symbols_count + 1);
|
||||||
symbol_width = rect.width() / 12;
|
symbol_width = rect.width() / 12;
|
||||||
for (uint i = 1 ; i <= symbols_count ; ++ i) {
|
for (uint i = 1 ; i <= symbols_count ; ++ i) {
|
||||||
// dessine le tronc du symbole
|
// dessine le tronc du symbole
|
||||||
@@ -1074,7 +1092,7 @@ void SingleLineProperties::draw(QPainter *painter, QET::ConducerSegmentType dire
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
interleave = rect.height() / symbols_count;
|
interleave = rect.height() / (symbols_count + 1);
|
||||||
symbol_width = rect.height() / 12;
|
symbol_width = rect.height() / 12;
|
||||||
for (uint i = 1 ; i <= symbols_count ; ++ i) {
|
for (uint i = 1 ; i <= symbols_count ; ++ i) {
|
||||||
// dessine le tronc du symbole
|
// dessine le tronc du symbole
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ class Conducer : public QGraphicsPathItem {
|
|||||||
virtual QPainterPath shape() const;
|
virtual QPainterPath shape() const;
|
||||||
qreal length();
|
qreal length();
|
||||||
ConducerSegment *middleSegment();
|
ConducerSegment *middleSegment();
|
||||||
|
QString text() const;
|
||||||
|
void setText(const QString &);
|
||||||
static bool valideXml(QDomElement &);
|
static bool valideXml(QDomElement &);
|
||||||
bool fromXml(QDomElement &);
|
bool fromXml(QDomElement &);
|
||||||
QDomElement toXml(QDomDocument &, QHash<Terminal *, int> &) const;
|
QDomElement toXml(QDomDocument &, QHash<Terminal *, int> &) const;
|
||||||
|
|||||||
158
conducerproperties.cpp
Normal file
158
conducerproperties.cpp
Normal file
@@ -0,0 +1,158 @@
|
|||||||
|
#include "conducerproperties.h"
|
||||||
|
#include "conducer.h"
|
||||||
|
|
||||||
|
ConducerPropertiesWidget::ConducerPropertiesWidget(QWidget *parent) :
|
||||||
|
QWidget(parent)
|
||||||
|
{
|
||||||
|
buildInterface();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConducerPropertiesWidget::buildInterface() {
|
||||||
|
|
||||||
|
setFixedSize(380, 245);
|
||||||
|
|
||||||
|
QVBoxLayout *main_layout = new QVBoxLayout(this);
|
||||||
|
|
||||||
|
QGroupBox *groupbox = new QGroupBox(tr("Type de conducteur"));
|
||||||
|
main_layout -> addWidget(groupbox);
|
||||||
|
|
||||||
|
QVBoxLayout *groupbox_layout = new QVBoxLayout();
|
||||||
|
groupbox -> setLayout(groupbox_layout);
|
||||||
|
|
||||||
|
multiline = new QRadioButton(tr("Multifilaire"));
|
||||||
|
|
||||||
|
QHBoxLayout *multiline_layout = new QHBoxLayout();
|
||||||
|
QLabel *text = new QLabel(tr("Texte :"));
|
||||||
|
text_field = new QLineEdit();
|
||||||
|
multiline_layout -> addWidget(text);
|
||||||
|
multiline_layout -> addWidget(text_field);
|
||||||
|
|
||||||
|
singleline = new QRadioButton(tr("Unifilaire"));
|
||||||
|
|
||||||
|
QHBoxLayout *singleline_layout3 = new QHBoxLayout();
|
||||||
|
phase_checkbox = new QCheckBox(tr("phase"));
|
||||||
|
phase_checkbox -> setIcon(QIcon(":/ico/phase.png"));
|
||||||
|
phase_slider = new QSlider(Qt::Horizontal);
|
||||||
|
phase_slider -> setRange(1, 3);
|
||||||
|
phase_spinbox = new QSpinBox();
|
||||||
|
phase_spinbox -> setRange(1, 3);
|
||||||
|
singleline_layout3 -> addWidget(phase_checkbox);
|
||||||
|
singleline_layout3 -> addWidget(phase_slider);
|
||||||
|
singleline_layout3 -> addWidget(phase_spinbox);
|
||||||
|
|
||||||
|
QVBoxLayout *singleline_layout2 = new QVBoxLayout();
|
||||||
|
ground_checkbox = new QCheckBox(tr("terre"));
|
||||||
|
ground_checkbox -> setIcon(QIcon(":/ico/ground.png"));
|
||||||
|
neutral_checkbox = new QCheckBox(tr("neutre"));
|
||||||
|
neutral_checkbox -> setIcon(QIcon(":/ico/neutral.png"));
|
||||||
|
singleline_layout2 -> addWidget(ground_checkbox);
|
||||||
|
singleline_layout2 -> addWidget(neutral_checkbox);
|
||||||
|
singleline_layout2 -> addLayout(singleline_layout3);
|
||||||
|
|
||||||
|
QHBoxLayout *singleline_layout1 = new QHBoxLayout();
|
||||||
|
preview = new QLabel();
|
||||||
|
preview -> setFixedSize(96, 96);
|
||||||
|
singleline_layout1 -> addWidget(preview);
|
||||||
|
singleline_layout1 -> addLayout(singleline_layout2);
|
||||||
|
|
||||||
|
groupbox_layout -> addWidget(multiline);
|
||||||
|
groupbox_layout -> addLayout(multiline_layout);
|
||||||
|
groupbox_layout -> addWidget(singleline);
|
||||||
|
groupbox_layout -> addLayout(singleline_layout1);
|
||||||
|
|
||||||
|
buildConnections();
|
||||||
|
setSingleLine(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConducerPropertiesWidget::buildConnections() {
|
||||||
|
connect(phase_slider, SIGNAL(valueChanged(int)), phase_spinbox, SLOT(setValue(int)));
|
||||||
|
connect(phase_spinbox, SIGNAL(valueChanged(int)), phase_slider, SLOT(setValue(int)));
|
||||||
|
connect(ground_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
connect(neutral_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
connect(phase_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
connect(phase_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
connect(singleline, SIGNAL(toggled(bool)), this, SLOT(setSingleLine(bool)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConducerPropertiesWidget::destroyConnections() {
|
||||||
|
disconnect(phase_slider, SIGNAL(valueChanged(int)), phase_spinbox, SLOT(setValue(int)));
|
||||||
|
disconnect(phase_spinbox, SIGNAL(valueChanged(int)), phase_slider, SLOT(setValue(int)));
|
||||||
|
disconnect(ground_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
disconnect(neutral_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
disconnect(phase_checkbox, SIGNAL(toggled(bool)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
disconnect(phase_slider, SIGNAL(valueChanged(int)), this, SLOT(updateSingleLineConfig()));
|
||||||
|
disconnect(singleline, SIGNAL(toggled(bool)), this, SLOT(setSingleLine(bool)));
|
||||||
|
}
|
||||||
|
|
||||||
|
ConducerPropertiesWidget::~ConducerPropertiesWidget() {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ConducerPropertiesWidget::updateSingleLineConfig() {
|
||||||
|
slp.hasGround = ground_checkbox -> isChecked();
|
||||||
|
slp.hasNeutral = neutral_checkbox -> isChecked();
|
||||||
|
slp.setPhasesCount(phase_checkbox -> isChecked() ? phase_spinbox -> value() : 0);
|
||||||
|
updatePreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConducerPropertiesWidget::updateSingleLineDisplay() {
|
||||||
|
destroyConnections();
|
||||||
|
ground_checkbox -> setChecked(slp.hasGround);
|
||||||
|
neutral_checkbox -> setChecked(slp.hasNeutral);
|
||||||
|
phase_spinbox -> setValue(slp.phasesCount());
|
||||||
|
phase_checkbox -> setChecked(slp.phasesCount());
|
||||||
|
buildConnections();
|
||||||
|
updatePreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConducerPropertiesWidget::updatePreview() {
|
||||||
|
const QRect pixmap_rect(0, 0, 96, 96);
|
||||||
|
QPixmap pixmap(pixmap_rect.width(), pixmap_rect.height());
|
||||||
|
QPainter painter;
|
||||||
|
painter.begin(&pixmap);
|
||||||
|
painter.eraseRect(pixmap_rect);
|
||||||
|
painter.drawRect(pixmap_rect.adjusted(0,0,-1,-1));
|
||||||
|
painter.drawLine(QLineF(0, pixmap_rect.height() / 2, pixmap_rect.width(), pixmap_rect.height() / 2));
|
||||||
|
slp.draw(&painter, QET::Horizontal, pixmap_rect);
|
||||||
|
painter.end();
|
||||||
|
preview -> setPixmap(pixmap);
|
||||||
|
}
|
||||||
|
|
||||||
|
bool ConducerPropertiesWidget::isSingleLine() const {
|
||||||
|
return(singleline -> isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ConducerPropertiesWidget::setSingleLine(bool sl) {
|
||||||
|
singleline -> setChecked(sl);
|
||||||
|
multiline -> setChecked(!sl);
|
||||||
|
text_field -> setEnabled(!sl);
|
||||||
|
preview -> setEnabled(sl);
|
||||||
|
phase_checkbox -> setEnabled(sl);
|
||||||
|
phase_slider -> setEnabled(sl);
|
||||||
|
phase_spinbox -> setEnabled(sl);
|
||||||
|
ground_checkbox -> setEnabled(sl);
|
||||||
|
neutral_checkbox -> setEnabled(sl);
|
||||||
|
updateSingleLineDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @param prop Les nouvelles proprietes unifilaires de ce conducteur
|
||||||
|
void ConducerPropertiesWidget::setSingleLineProperties(const SingleLineProperties &prop) {
|
||||||
|
slp = prop;
|
||||||
|
updateSingleLineDisplay();
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @return les proprietes unifilaires de ce conducteur
|
||||||
|
SingleLineProperties ConducerPropertiesWidget::singleLineProperties() const {
|
||||||
|
return(slp);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @param text Le texte de ce conducteur
|
||||||
|
void ConducerPropertiesWidget::setConducerText(const QString &text) {
|
||||||
|
text_field -> setText(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// @return Le texte de ce conducteur
|
||||||
|
QString ConducerPropertiesWidget::conducerText() const {
|
||||||
|
return(text_field -> text());
|
||||||
|
}
|
||||||
49
conducerproperties.h
Normal file
49
conducerproperties.h
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
#ifndef CONDUCER_PROPERTIES_WIDGET_H
|
||||||
|
#define CONDUCER_PROPERTIES_WIDGET_H
|
||||||
|
#include "conducer.h"
|
||||||
|
#include <QtGui>
|
||||||
|
class ConducerPropertiesWidget : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
// constructeurs, destructeur
|
||||||
|
public:
|
||||||
|
ConducerPropertiesWidget(QWidget * = 0);
|
||||||
|
virtual ~ConducerPropertiesWidget();
|
||||||
|
|
||||||
|
private:
|
||||||
|
ConducerPropertiesWidget(const ConducerPropertiesWidget &);
|
||||||
|
|
||||||
|
// methodes
|
||||||
|
public:
|
||||||
|
bool isSingleLine() const;
|
||||||
|
void setSingleLineProperties(const SingleLineProperties &);
|
||||||
|
SingleLineProperties singleLineProperties() const;
|
||||||
|
QString conducerText() const;
|
||||||
|
void setConducerText(const QString &);
|
||||||
|
|
||||||
|
public slots:
|
||||||
|
void updatePreview();
|
||||||
|
void updateSingleLineConfig();
|
||||||
|
void updateSingleLineDisplay();
|
||||||
|
void setSingleLine(bool);
|
||||||
|
|
||||||
|
// attributs prives
|
||||||
|
private:
|
||||||
|
QRadioButton *multiline;
|
||||||
|
QLineEdit *text_field;
|
||||||
|
QRadioButton *singleline;
|
||||||
|
QCheckBox *phase_checkbox;
|
||||||
|
QSlider *phase_slider;
|
||||||
|
QSpinBox *phase_spinbox;
|
||||||
|
QCheckBox *ground_checkbox;
|
||||||
|
QCheckBox *neutral_checkbox;
|
||||||
|
QLabel *preview;
|
||||||
|
|
||||||
|
SingleLineProperties slp;
|
||||||
|
QString conducer_text;
|
||||||
|
|
||||||
|
// methodes privees
|
||||||
|
void buildInterface();
|
||||||
|
void buildConnections();
|
||||||
|
void destroyConnections();
|
||||||
|
};
|
||||||
|
#endif
|
||||||
10
diagram.cpp
10
diagram.cpp
@@ -486,3 +486,13 @@ void Diagram::setDrawTerminals(bool dt) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QSet<Conducer *> Diagram::selectedConducers() const {
|
||||||
|
QSet<Conducer *> conducers_set;
|
||||||
|
foreach(QGraphicsItem *qgi, selectedItems()) {
|
||||||
|
if (Conducer *c = qgraphicsitem_cast<Conducer *>(qgi)) {
|
||||||
|
conducers_set << c;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return(conducers_set);
|
||||||
|
}
|
||||||
|
|||||||
@@ -75,6 +75,7 @@ class Diagram : public QGraphicsScene {
|
|||||||
const QSet<Element *> &elementsToMove();
|
const QSet<Element *> &elementsToMove();
|
||||||
const QSet<Conducer *> &conducersToMove();
|
const QSet<Conducer *> &conducersToMove();
|
||||||
const QHash<Conducer *, Terminal *> &conducersToUpdate();
|
const QHash<Conducer *, Terminal *> &conducersToUpdate();
|
||||||
|
QSet<Conducer *> selectedConducers() const;
|
||||||
|
|
||||||
QUndoStack &undoStack();
|
QUndoStack &undoStack();
|
||||||
QGIManager &qgiManager();
|
QGIManager &qgiManager();
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "exportdialog.h"
|
#include "exportdialog.h"
|
||||||
#include "conducer.h"
|
#include "conducer.h"
|
||||||
#include "diagramcommands.h"
|
#include "diagramcommands.h"
|
||||||
|
#include "conducerproperties.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
Constructeur
|
Constructeur
|
||||||
@@ -314,6 +315,7 @@ bool DiagramView::open(QString n_fichier, int *erreur) {
|
|||||||
if (erreur != NULL) *erreur = 0;
|
if (erreur != NULL) *erreur = 0;
|
||||||
file_name = n_fichier;
|
file_name = n_fichier;
|
||||||
scene -> undoStack().setClean();
|
scene -> undoStack().setClean();
|
||||||
|
updateWindowTitle();
|
||||||
return(true);
|
return(true);
|
||||||
} else {
|
} else {
|
||||||
if (erreur != NULL) *erreur = 4;
|
if (erreur != NULL) *erreur = 4;
|
||||||
@@ -602,3 +604,34 @@ QRectF DiagramView::viewedSceneRect() const {
|
|||||||
// en deduit le rectangle visualise par la scene
|
// en deduit le rectangle visualise par la scene
|
||||||
return(QRectF(scene_left_top, scene_right_bottom));
|
return(QRectF(scene_left_top, scene_right_bottom));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void DiagramView::editConducer() {
|
||||||
|
QList<Conducer *> selected_conducers(scene -> selectedConducers().toList());
|
||||||
|
|
||||||
|
// on ne peut editer qu'un conducteur a la fois
|
||||||
|
if (selected_conducers.count() != 1) return;
|
||||||
|
Conducer *edited_conducer = selected_conducers.first();
|
||||||
|
|
||||||
|
// initialise l'editeur de proprietes pour le conducteur
|
||||||
|
ConducerPropertiesWidget *cpw = new ConducerPropertiesWidget();
|
||||||
|
cpw -> setSingleLine(edited_conducer -> isSingleLine());
|
||||||
|
cpw -> setConducerText(edited_conducer -> text());
|
||||||
|
cpw -> setSingleLineProperties(edited_conducer -> singleLineProperties);
|
||||||
|
|
||||||
|
// l'insere dans un dialogue
|
||||||
|
QDialog conducer_dialog;
|
||||||
|
QVBoxLayout *dialog_layout = new QVBoxLayout(&conducer_dialog);
|
||||||
|
dialog_layout -> addWidget(cpw);
|
||||||
|
QDialogButtonBox *dbb = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||||
|
dialog_layout -> addWidget(dbb);
|
||||||
|
connect(dbb, SIGNAL(accepted()), &conducer_dialog, SLOT(accept()));
|
||||||
|
connect(dbb, SIGNAL(rejected()), &conducer_dialog, SLOT(reject()));
|
||||||
|
|
||||||
|
// execute le dialogue et met a jour le conducteur
|
||||||
|
if (conducer_dialog.exec() == QDialog::Accepted) {
|
||||||
|
edited_conducer -> setSingleLine(cpw -> isSingleLine());
|
||||||
|
edited_conducer -> setText(cpw -> conducerText());
|
||||||
|
edited_conducer -> singleLineProperties = cpw -> singleLineProperties();
|
||||||
|
edited_conducer -> update();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ class DiagramView : public QGraphicsView {
|
|||||||
void paste();
|
void paste();
|
||||||
void adjustSceneRect();
|
void adjustSceneRect();
|
||||||
void updateWindowTitle();
|
void updateWindowTitle();
|
||||||
|
void editConducer();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void slot_selectionChanged();
|
void slot_selectionChanged();
|
||||||
|
|||||||
BIN
ico/conductor.png
Normal file
BIN
ico/conductor.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 305 B |
BIN
ico/ground.png
Normal file
BIN
ico/ground.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
ico/neutral.png
Normal file
BIN
ico/neutral.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.7 KiB |
BIN
ico/phase.png
Normal file
BIN
ico/phase.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
@@ -66,7 +66,8 @@ HEADERS += aboutqet.h \
|
|||||||
editor/textfieldeditor.h \
|
editor/textfieldeditor.h \
|
||||||
diagramcommands.h \
|
diagramcommands.h \
|
||||||
diagramtextitem.h \
|
diagramtextitem.h \
|
||||||
insetproperties.h
|
insetproperties.h \
|
||||||
|
conducerproperties.h
|
||||||
SOURCES += aboutqet.cpp \
|
SOURCES += aboutqet.cpp \
|
||||||
borderinset.cpp \
|
borderinset.cpp \
|
||||||
conducer.cpp \
|
conducer.cpp \
|
||||||
@@ -124,7 +125,8 @@ SOURCES += aboutqet.cpp \
|
|||||||
editor/texteditor.cpp \
|
editor/texteditor.cpp \
|
||||||
editor/textfieldeditor.cpp \
|
editor/textfieldeditor.cpp \
|
||||||
diagramcommands.cpp \
|
diagramcommands.cpp \
|
||||||
diagramtextitem.cpp
|
diagramtextitem.cpp \
|
||||||
|
conducerproperties.cpp
|
||||||
RESOURCES += qelectrotech.qrc
|
RESOURCES += qelectrotech.qrc
|
||||||
TRANSLATIONS += lang/qet_en.ts lang/qt_fr.ts
|
TRANSLATIONS += lang/qet_en.ts lang/qt_fr.ts
|
||||||
RC_FILE = ico/windows_icon/application_icon/qelectrotech.rc
|
RC_FILE = ico/windows_icon/application_icon/qelectrotech.rc
|
||||||
|
|||||||
@@ -12,6 +12,7 @@
|
|||||||
<file>ico/category_edit.png</file>
|
<file>ico/category_edit.png</file>
|
||||||
<file>ico/category_new.png</file>
|
<file>ico/category_new.png</file>
|
||||||
<file>ico/circle.png</file>
|
<file>ico/circle.png</file>
|
||||||
|
<file>ico/conductor.png</file>
|
||||||
<file>ico/configure.png</file>
|
<file>ico/configure.png</file>
|
||||||
<file>ico/copy.png</file>
|
<file>ico/copy.png</file>
|
||||||
<file>ico/cut.png</file>
|
<file>ico/cut.png</file>
|
||||||
@@ -25,16 +26,19 @@
|
|||||||
<file>ico/export.png</file>
|
<file>ico/export.png</file>
|
||||||
<file>ico/fileclose.png</file>
|
<file>ico/fileclose.png</file>
|
||||||
<file>ico/forbidden.png</file>
|
<file>ico/forbidden.png</file>
|
||||||
|
<file>ico/ground.png</file>
|
||||||
<file>ico/import.png</file>
|
<file>ico/import.png</file>
|
||||||
<file>ico/info.png</file>
|
<file>ico/info.png</file>
|
||||||
<file>ico/line.png</file>
|
<file>ico/line.png</file>
|
||||||
<file>ico/masquer.png</file>
|
<file>ico/masquer.png</file>
|
||||||
<file>ico/move.png</file>
|
<file>ico/move.png</file>
|
||||||
|
<file>ico/neutral.png</file>
|
||||||
<file>ico/new.png</file>
|
<file>ico/new.png</file>
|
||||||
<file>ico/north.png</file>
|
<file>ico/north.png</file>
|
||||||
<file>ico/open.png</file>
|
<file>ico/open.png</file>
|
||||||
<file>ico/orientations.png</file>
|
<file>ico/orientations.png</file>
|
||||||
<file>ico/paste.png</file>
|
<file>ico/paste.png</file>
|
||||||
|
<file>ico/phase.png</file>
|
||||||
<file>ico/pivoter.png</file>
|
<file>ico/pivoter.png</file>
|
||||||
<file>ico/polygon.png</file>
|
<file>ico/polygon.png</file>
|
||||||
<file>ico/print.png</file>
|
<file>ico/print.png</file>
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "diagram.h"
|
#include "diagram.h"
|
||||||
#include "elementspanelwidget.h"
|
#include "elementspanelwidget.h"
|
||||||
#include "aboutqet.h"
|
#include "aboutqet.h"
|
||||||
|
#include "conducerproperties.h"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
constructeur
|
constructeur
|
||||||
@@ -160,6 +161,7 @@ void QETDiagramEditor::actions() {
|
|||||||
select_invert = new QAction( tr("Inverser la s\351lection"), this);
|
select_invert = new QAction( tr("Inverser la s\351lection"), this);
|
||||||
delete_selection = new QAction(QIcon(":/ico/delete.png"), tr("Supprimer"), this);
|
delete_selection = new QAction(QIcon(":/ico/delete.png"), tr("Supprimer"), this);
|
||||||
rotate_selection = new QAction(QIcon(":/ico/pivoter.png"), tr("Pivoter"), this);
|
rotate_selection = new QAction(QIcon(":/ico/pivoter.png"), tr("Pivoter"), this);
|
||||||
|
conducer_prop = new QAction(QIcon(":/ico/conductor.png"), tr("Propri\351t\351s du conducteur"), this);
|
||||||
infos_diagram = new QAction(QIcon(":/ico/info.png"), tr("Informations sur le sch\351ma"), this);
|
infos_diagram = new QAction(QIcon(":/ico/info.png"), tr("Informations sur le sch\351ma"), this);
|
||||||
add_column = new QAction(QIcon(":/ico/add_col.png"), tr("Ajouter une colonne"), this);
|
add_column = new QAction(QIcon(":/ico/add_col.png"), tr("Ajouter une colonne"), this);
|
||||||
remove_column = new QAction(QIcon(":/ico/remove_col.png"), tr("Enlever une colonne"), this);
|
remove_column = new QAction(QIcon(":/ico/remove_col.png"), tr("Enlever une colonne"), this);
|
||||||
@@ -240,6 +242,7 @@ void QETDiagramEditor::actions() {
|
|||||||
select_invert -> setStatusTip(tr("D\351s\351lectionne les \351l\351ments s\351lectionn\351s et s\351lectionne les \351l\351ments non s\351lectionn\351s"));
|
select_invert -> setStatusTip(tr("D\351s\351lectionne les \351l\351ments s\351lectionn\351s et s\351lectionne les \351l\351ments non s\351lectionn\351s"));
|
||||||
delete_selection -> setStatusTip(tr("Enl\350ve les \351l\351ments s\351lectionn\351s du sch\351ma"));
|
delete_selection -> setStatusTip(tr("Enl\350ve les \351l\351ments s\351lectionn\351s du sch\351ma"));
|
||||||
rotate_selection -> setStatusTip(tr("Pivote les \351l\351ments s\351lectionn\351s"));
|
rotate_selection -> setStatusTip(tr("Pivote les \351l\351ments s\351lectionn\351s"));
|
||||||
|
conducer_prop -> setStatusTip(tr("\311dite les propri\351t\351s du conducteur s\351lectionn\351"));
|
||||||
infos_diagram -> setStatusTip(tr("\311dite les informations affich\351es par le cartouche"));
|
infos_diagram -> setStatusTip(tr("\311dite les informations affich\351es par le cartouche"));
|
||||||
add_column -> setStatusTip(tr("Ajoute une colonne au sch\351ma"));
|
add_column -> setStatusTip(tr("Ajoute une colonne au sch\351ma"));
|
||||||
remove_column -> setStatusTip(tr("Enl\350ve une colonne au sch\351ma"));
|
remove_column -> setStatusTip(tr("Enl\350ve une colonne au sch\351ma"));
|
||||||
@@ -309,6 +312,7 @@ void QETDiagramEditor::actions() {
|
|||||||
connect(arrange_window, SIGNAL(triggered()), &workspace, SLOT(arrangeIcons()) );
|
connect(arrange_window, SIGNAL(triggered()), &workspace, SLOT(arrangeIcons()) );
|
||||||
connect(next_window, SIGNAL(triggered()), &workspace, SLOT(activateNextWindow()) );
|
connect(next_window, SIGNAL(triggered()), &workspace, SLOT(activateNextWindow()) );
|
||||||
connect(prev_window, SIGNAL(triggered()), &workspace, SLOT(activatePreviousWindow()) );
|
connect(prev_window, SIGNAL(triggered()), &workspace, SLOT(activatePreviousWindow()) );
|
||||||
|
connect(conducer_prop, SIGNAL(triggered()), this, SLOT(slot_editConducer()) );
|
||||||
connect(infos_diagram, SIGNAL(triggered()), this, SLOT(slot_editInfos()) );
|
connect(infos_diagram, SIGNAL(triggered()), this, SLOT(slot_editInfos()) );
|
||||||
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()) );
|
||||||
@@ -366,6 +370,8 @@ void QETDiagramEditor::menus() {
|
|||||||
menu_edition -> addAction(delete_selection);
|
menu_edition -> addAction(delete_selection);
|
||||||
menu_edition -> addAction(rotate_selection);
|
menu_edition -> addAction(rotate_selection);
|
||||||
menu_edition -> addSeparator();
|
menu_edition -> addSeparator();
|
||||||
|
menu_edition -> addAction(conducer_prop);
|
||||||
|
menu_edition -> addSeparator();
|
||||||
menu_edition -> addAction(infos_diagram);
|
menu_edition -> addAction(infos_diagram);
|
||||||
menu_edition -> addAction(add_column);
|
menu_edition -> addAction(add_column);
|
||||||
menu_edition -> addAction(remove_column);
|
menu_edition -> addAction(remove_column);
|
||||||
@@ -660,6 +666,7 @@ void QETDiagramEditor::slot_updateActions() {
|
|||||||
zoom_out -> setEnabled(opened_document);
|
zoom_out -> setEnabled(opened_document);
|
||||||
zoom_fit -> setEnabled(opened_document);
|
zoom_fit -> setEnabled(opened_document);
|
||||||
zoom_reset -> setEnabled(opened_document);
|
zoom_reset -> setEnabled(opened_document);
|
||||||
|
conducer_prop -> setEnabled(opened_document && sv -> diagram() -> selectedConducers().count() == 1);
|
||||||
infos_diagram -> setEnabled(opened_document);
|
infos_diagram -> setEnabled(opened_document);
|
||||||
add_column -> setEnabled(opened_document);
|
add_column -> setEnabled(opened_document);
|
||||||
remove_column -> setEnabled(opened_document);
|
remove_column -> setEnabled(opened_document);
|
||||||
@@ -822,3 +829,9 @@ void QETDiagramEditor::slot_shrink() {
|
|||||||
if (!sv) return;
|
if (!sv) return;
|
||||||
sv -> shrink();
|
sv -> shrink();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QETDiagramEditor::slot_editConducer() {
|
||||||
|
if (DiagramView *dv = currentDiagram()) {
|
||||||
|
dv -> editConducer();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ class QETDiagramEditor : public QMainWindow {
|
|||||||
void slot_removeColumn();
|
void slot_removeColumn();
|
||||||
void slot_expand();
|
void slot_expand();
|
||||||
void slot_shrink();
|
void slot_shrink();
|
||||||
|
void slot_editConducer();
|
||||||
|
|
||||||
// attributs
|
// attributs
|
||||||
protected:
|
protected:
|
||||||
@@ -90,6 +91,7 @@ class QETDiagramEditor : public QMainWindow {
|
|||||||
QAction *select_invert;
|
QAction *select_invert;
|
||||||
QAction *delete_selection;
|
QAction *delete_selection;
|
||||||
QAction *rotate_selection;
|
QAction *rotate_selection;
|
||||||
|
QAction *conducer_prop;
|
||||||
QAction *infos_diagram;
|
QAction *infos_diagram;
|
||||||
QAction *add_column;
|
QAction *add_column;
|
||||||
QAction *remove_column;
|
QAction *remove_column;
|
||||||
|
|||||||
Reference in New Issue
Block a user