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)
32 setText(i18n("Delete marker"));
33 else if (m_oldMarker.comment().isEmpty())
34 setText(i18n("Add marker"));
36 setText(i18n("Edit marker"));
40 void AddMarkerCommand::undo()
42 m_view->addMarker(m_id, m_oldMarker);
45 void AddMarkerCommand::redo()
47 m_view->addMarker(m_id, m_newMarker);