1 #include "CmdSettingsCommon.h"
3 #include "DocumentSerialize.h"
5 #include "MainWindow.h"
6 #include <QXmlStreamReader>
8 const QString CMD_DESCRIPTION (
"Common settings");
17 m_modelCommonBefore (modelCommonBefore),
18 m_modelCommonAfter (modelCommonAfter)
20 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCommon::CmdSettingsCommon";
25 const QString &cmdDescription,
26 QXmlStreamReader &reader) :
31 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCommon::CmdSettingsCommon";
33 m_modelCommonBefore.
loadXml (reader);
34 m_modelCommonAfter.
loadXml (reader);
37 CmdSettingsCommon::~CmdSettingsCommon ()
43 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCommon::cmdRedo";
51 LOG4CPP_INFO_S ((*mainCat)) <<
"CmdSettingsCommon::cmdUndo";
59 writer.writeStartElement(DOCUMENT_SERIALIZE_CMD);
60 writer.writeAttribute(DOCUMENT_SERIALIZE_CMD_TYPE, DOCUMENT_SERIALIZE_CMD_SETTINGS_COMMON);
61 writer.writeAttribute(DOCUMENT_SERIALIZE_CMD_DESCRIPTION, QUndoCommand::text ());
62 m_modelCommonBefore.
saveXml(writer);
63 m_modelCommonAfter.
saveXml(writer);
64 writer.writeEndElement();
virtual void cmdUndo()
Undo method that is called when QUndoStack is moved one command backward.
void updateSettingsCommon(const DocumentModelCommon &modelCommon)
Update with new common properties.
Wrapper around QUndoCommand. This simplifies the more complicated feature set of QUndoCommand.
Model for DlgSettingsCommon and CmdSettingsCommon.
virtual void cmdRedo()
Redo method that is called when QUndoStack is moved one command forward.
virtual void saveXml(QXmlStreamWriter &writer) const
Save commands as xml for later uploading.
CmdSettingsCommon(MainWindow &mainWindow, Document &document, const DocumentModelCommon &modelCommonBefore, const DocumentModelCommon &modelCommonAfter)
Constructor for normal creation.
virtual void saveXml(QXmlStreamWriter &writer) const
Save entire model as xml into stream.
MainWindow & mainWindow()
Return the MainWindow so it can be updated by this command as a last step.
void updateAfterCommand()
See GraphicsScene::updateAfterCommand.
Storage of one imported image and the data attached to that image.
virtual void loadXml(QXmlStreamReader &reader)
Load model from serialized xml.
Main window consisting of menu, graphics scene, status bar and optional toolbars as a Single Document...