kwave  18.07.70
UndoTransactionGuard.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  UndoTransactionGuard.cpp - guard class for undo transactions
3  -------------------
4  begin : Sat May 26, 2001
5  copyright : (C) 2001 by Thomas Eschenbacher
6  email : Thomas Eschenbacher <thomas.eschenbacher@gmx.de>
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  ***************************************************************************/
18 
19 #include "config.h"
20 
21 #include <QString>
22 
23 #include <KLocalizedString>
24 
25 #include "libkwave/Plugin.h"
26 #include "libkwave/PluginManager.h"
27 #include "libkwave/SignalManager.h"
28 #include "libkwave/String.h"
30 
31 //***************************************************************************
33  const QString &name)
34  :m_manager(manager),
35  m_initial_modified(m_manager.isModified())
36 {
38 }
39 
40 //***************************************************************************
42  const QString &name)
43  :m_manager(plugin.manager().signalManager()),
44  m_initial_modified(m_manager.isModified())
45 {
46  QString description = (name.length()) ?
47  name : i18n(UTF8(plugin.name()));
48  m_manager.startUndoTransaction(description);
49 }
50 
51 //***************************************************************************
53 {
55 }
56 
57 //***************************************************************************
59 {
60  return m_manager.registerUndoAction(action);
61 }
62 
63 //***************************************************************************
65 {
69 }
70 
71 //***************************************************************************
72 //***************************************************************************
UndoTransactionGuard(Kwave::SignalManager &manager, const QString &name=QString())
virtual QString name() const
Definition: Plugin.cpp:196
bool registerUndoAction(UndoAction *action)
bool registerUndoAction(Kwave::UndoAction *action)
void setModified(bool mod)
const char name[16]
Definition: memcpy.c:510
void startUndoTransaction(const QString &name=QString())
Kwave::SignalManager & m_manager
#define UTF8(qs)
Definition: String.h:48