File indexing completed on 2024-05-12 04:03:59

0001 /***************************************************************************
0002                                cmapcmdnotes.cpp
0003                              -------------------
0004     begin                : Sun Mar 9 2003
0005     copyright            : (C) 2003 by Kmud Developer Team
0006     email                : kmud-devel@kmud.de
0007  ***************************************************************************/
0008 
0009 /***************************************************************************
0010  *                                                                         *
0011  *   This program is free software; you can redistribute it and/or modify  *
0012  *   it under the terms of the GNU General Public License as published by  *
0013  *   the Free Software Foundation; either version 2 of the License, or     *
0014  *   (at your option) any later version.                                   *
0015  *                                                                         *
0016  ***************************************************************************/
0017 
0018 #include "cmapcmdnotes.h"
0019 
0020 #include "cmappluginstandard.h"
0021 
0022 #include "../../cmapmanager.h"
0023 #include "../../cmapelement.h"
0024 
0025 #include <KLocalizedString>
0026 
0027 CMapCMDNotes::CMapCMDNotes(CMapPluginStandard *plugin,CMapElement *element,QString note) : CMapCommand (i18n("Change element notes"))
0028 {
0029     m_plugin = plugin;
0030     m_element = element;
0031     m_newNote = note;
0032     m_oldNote = m_plugin->getNote(element);
0033 }
0034 
0035 CMapCMDNotes::~CMapCMDNotes()
0036 {
0037 }
0038 
0039 void CMapCMDNotes::redo()
0040 {
0041     m_plugin->addNote(m_element,m_newNote);
0042 }
0043 
0044 void CMapCMDNotes::undo()
0045 {
0046     m_plugin->addNote(m_element,m_oldNote);
0047 }