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