Commit aced69ce authored by Hugo Beauzée-Luyssen's avatar Hugo Beauzée-Luyssen

UndoStack: HACKING

parent 52718ac0
......@@ -21,15 +21,14 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
*****************************************************************************/
#include <QUndoStack>
#include <QUndoCommand>
#include "UndoStack.h"
#include "project/GuiProjectManager.h"
#include "SettingsManager.h"
#include "KeyboardShortcutHelper.h"
UndoStack::UndoStack( QWidget* parent ) : QUndoView( parent )
#include <QUndoStack>
#include <QUndoCommand>
UndoStack::UndoStack( QWidget *parent ) : QUndoView( parent )
{
setEmptyLabel( tr( "Nothing to undo" ) );
......@@ -40,48 +39,56 @@ UndoStack::UndoStack( QWidget* parent ) : QUndoView( parent )
connect( GUIProjectManager::getInstance(), SIGNAL( projectSaved() ),
m_undoStack, SLOT( setClean() ) );
connect( m_undoStack, SIGNAL( canRedoChanged(bool) ), this, SIGNAL( canRedoChanged(bool) ) );
connect( m_undoStack, SIGNAL( canUndoChanged(bool) ), this, SIGNAL( canUndoChanged(bool) ) );
connect( m_undoStack, SIGNAL( canRedoChanged( bool ) ), this, SIGNAL( canRedoChanged( bool ) ) );
connect( m_undoStack, SIGNAL( canUndoChanged( bool ) ), this, SIGNAL( canUndoChanged( bool ) ) );
connect( GUIProjectManager::getInstance(), SIGNAL( projectClosed() ), this, SLOT( clear() ) );
}
void UndoStack::push( QUndoCommand* command )
void
UndoStack::push( QUndoCommand *command )
{
m_undoStack->push( command );
}
void UndoStack::beginMacro( const QString& text )
void
UndoStack::beginMacro( const QString& text )
{
m_undoStack->beginMacro( text );
}
void UndoStack::endMacro()
void
UndoStack::endMacro()
{
m_undoStack->endMacro();
}
bool UndoStack::canUndo()
bool
UndoStack::canUndo()
{
return m_undoStack->canUndo();
}
bool UndoStack::canRedo()
bool
UndoStack::canRedo()
{
return m_undoStack->canRedo();
}
void UndoStack::clear()
void
UndoStack::clear()
{
m_undoStack->clear();
}
void UndoStack::undo()
void
UndoStack::undo()
{
m_undoStack->undo();
}
void UndoStack::redo()
void
UndoStack::redo()
{
m_undoStack->redo();
}
......@@ -37,8 +37,8 @@ class UndoStack : public QUndoView, public QSingleton<UndoStack>
Q_DISABLE_COPY( UndoStack );
public:
void push( QUndoCommand* command );
void beginMacro( const QString& text );
void push( QUndoCommand *command );
void beginMacro( const QString &text );
void endMacro();
bool canUndo();
bool canRedo();
......@@ -46,7 +46,7 @@ class UndoStack : public QUndoView, public QSingleton<UndoStack>
private:
UndoStack( QWidget* parent );
QUndoStack* m_undoStack;
QUndoStack* m_undoStack;
public slots:
void clear();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment