mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2025-12-21 08:40:53 +01:00
Use QPropertyUndoCommand instead of ChangeSeveralConductorsPropertiesCommand and ChangeConductorsPropertiesCommand.
Remove class ChangeSeveralConductorsPropertiesCommand and ChangeConductorsPropertiesCommand. git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@4092 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
@@ -27,6 +27,8 @@
|
||||
#include "terminal.h"
|
||||
#include "conductorautonumerotation.h"
|
||||
#include "conductorpropertiesdialog.h"
|
||||
#include "QPropertyUndoCommand/qpropertyundocommand.h"
|
||||
|
||||
#define PR(x) qDebug() << #x " = " << x;
|
||||
|
||||
bool Conductor::pen_and_brush_initialized = false;
|
||||
@@ -1371,6 +1373,7 @@ void Conductor::readProperties() {
|
||||
text_item -> setVisible(properties_.m_show_text);
|
||||
}
|
||||
calculateTextItemPosition();
|
||||
update();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1415,14 +1418,15 @@ void Conductor::displayedTextChanged() {
|
||||
|
||||
if (qmbreturn == 0 || qmbreturn == QMessageBox::No)
|
||||
{
|
||||
// initialise l'objet UndoCommand correspondant
|
||||
QVariant old_value, new_value;
|
||||
old_value.setValue(properties_);
|
||||
ConductorProperties new_properties(properties_);
|
||||
new_properties.text = text_item -> toPlainText();
|
||||
new_value.setValue(new_properties);
|
||||
|
||||
ChangeConductorPropertiesCommand *ccpc = new ChangeConductorPropertiesCommand(this);
|
||||
ccpc -> setOldSettings(properties_);
|
||||
ccpc -> setNewSettings(new_properties);
|
||||
my_diagram -> undoStack().push(ccpc);
|
||||
QPropertyUndoCommand *undo = new QPropertyUndoCommand(this, "properties", old_value, new_value);
|
||||
undo->setText(tr("Modifier les propriétés d'un conducteur", "undo caption"));
|
||||
my_diagram -> undoStack().push(undo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user