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"
22 AddMarkerCommand::AddMarkerCommand(CustomTrackView *view, const QString &oldcomment, const QString &comment, const int id, const GenTime &pos, bool doIt, QUndoCommand * parent) : QUndoCommand(parent), m_view(view), m_oldcomment(oldcomment), m_comment(comment), m_id(id), m_pos(pos), m_doIt(doIt) {
23 if (m_comment.isEmpty()) setText(i18n("Delete marker"));
24 else if (m_oldcomment.isEmpty()) setText(i18n("Add marker"));
25 else setText(i18n("Edit marker"));
30 void AddMarkerCommand::undo() {
31 m_view->addMarker(m_id, m_pos, m_oldcomment);
34 void AddMarkerCommand::redo() {
36 m_view->addMarker(m_id, m_pos, m_comment);
41 #include "addmarkercommand.moc"