Dans l'editeur d'elements, les changements d'orientations sont desormais annulables

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@121 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
xavierqet
2007-09-10 22:11:47 +00:00
parent a2a65b78a8
commit 55c79617e1
5 changed files with 83 additions and 2 deletions

View File

@@ -297,3 +297,38 @@ void ChangeNamesCommand::undo() {
void ChangeNamesCommand::redo() {
element -> setNames(names_after);
}
/**
Constructeur
@param element_scene Element edite
@param before Orientations avant changement
@param after Orientationss apres changement
@param parent QUndoCommand parent
*/
ChangeOrientationsCommand::ChangeOrientationsCommand(
ElementScene *element_scene,
const OrientationSet &before,
const OrientationSet &after,
QUndoCommand *parent
) :
QUndoCommand(QObject::tr("modification orientations"), parent),
ori_before(before),
ori_after(after),
element(element_scene)
{
}
/// Destructeur
ChangeOrientationsCommand::~ChangeOrientationsCommand() {
}
/// Annule le changement
void ChangeOrientationsCommand::undo() {
element -> setOrientations(ori_before);
}
/// Refait le changement
void ChangeOrientationsCommand::redo() {
element -> setOrientations(ori_after);
}