1 /***************************************************************************
2 addtransitioncommand.cpp - description
5 copyright : (C) 2008 by Marco Gittler
6 email : g.marco@freenet.de
7 ***************************************************************************/
9 /***************************************************************************
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
16 ***************************************************************************/
19 #include "addmarkercommand.h"
20 #include "customtrackview.h"
24 AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const CommentedTime &oldMarker, const CommentedTime &newMarker, const QString &id, QUndoCommand * parent) :
27 m_oldMarker(oldMarker),
28 m_newMarker(newMarker),
31 if (m_newMarker.markerType() < 0) setText(i18n("Delete marker"));
32 else if (m_oldMarker.comment().isEmpty()) setText(i18n("Add marker"));
33 else setText(i18n("Edit marker"));
38 void AddMarkerCommand::undo()
40 m_view->addMarker(m_id, m_oldMarker);
43 void AddMarkerCommand::redo()
45 m_view->addMarker(m_id, m_newMarker);