Krita Source Code Documentation
Loading...
Searching...
No Matches
KisUndoActionsUpdateManager Class Reference

#include <KisUndoActionsUpdateManager.h>

+ Inheritance diagram for KisUndoActionsUpdateManager:

Public Slots

void slotRedoTextChanged (const QString &text)
 
void slotUndoTextChanged (const QString &text)
 

Public Member Functions

 KisUndoActionsUpdateManager (QAction *undoAction, QAction *redoAction, QObject *parent=0)
 
void setCurrentDocument (KisDocument *document)
 

Private Attributes

KisSignalAutoConnectionsStore m_documentConnections
 
QAction * m_redoAction
 
QAction * m_undoAction
 

Detailed Description

Definition at line 16 of file KisUndoActionsUpdateManager.h.

Constructor & Destructor Documentation

◆ KisUndoActionsUpdateManager()

KisUndoActionsUpdateManager::KisUndoActionsUpdateManager ( QAction * undoAction,
QAction * redoAction,
QObject * parent = 0 )

Definition at line 15 of file KisUndoActionsUpdateManager.cpp.

16 : QObject(parent),
17 m_undoAction(undoAction),
18 m_redoAction(redoAction)
19{
20
21}

Member Function Documentation

◆ setCurrentDocument()

void KisUndoActionsUpdateManager::setCurrentDocument ( KisDocument * document)

Definition at line 23 of file KisUndoActionsUpdateManager.cpp.

24{
26
27 if (document) {
28
29 KUndo2Stack *stack = document->undoStack();
30
31 m_documentConnections.addConnection(stack, SIGNAL(undoTextChanged(QString)), this, SLOT(slotUndoTextChanged(QString)));
32 m_documentConnections.addConnection(stack, SIGNAL(redoTextChanged(QString)), this, SLOT(slotRedoTextChanged(QString)));
33
36
37 m_undoAction->setEnabled(stack->canUndo());
38 m_redoAction->setEnabled(stack->canRedo());
39 }
40}
QString redoText() const
QString undoText() const
bool canUndo() const
bool canRedo() const
void addConnection(Sender sender, Signal signal, Receiver receiver, Method method, Qt::ConnectionType type=Qt::AutoConnection)
void slotRedoTextChanged(const QString &text)
KisSignalAutoConnectionsStore m_documentConnections
void slotUndoTextChanged(const QString &text)

References KisSignalAutoConnectionsStore::addConnection(), KUndo2QStack::canRedo(), KUndo2QStack::canUndo(), KisSignalAutoConnectionsStore::clear(), m_documentConnections, m_redoAction, m_undoAction, KUndo2QStack::redoText(), slotRedoTextChanged(), slotUndoTextChanged(), and KUndo2QStack::undoText().

◆ slotRedoTextChanged

void KisUndoActionsUpdateManager::slotRedoTextChanged ( const QString & text)
slot

Definition at line 47 of file KisUndoActionsUpdateManager.cpp.

48{
49 m_redoAction->setText(i18n("Redo %1", text));
50}

References m_redoAction.

◆ slotUndoTextChanged

void KisUndoActionsUpdateManager::slotUndoTextChanged ( const QString & text)
slot

Definition at line 42 of file KisUndoActionsUpdateManager.cpp.

43{
44 m_undoAction->setText(i18n("Undo %1", text));
45}

References m_undoAction.

Member Data Documentation

◆ m_documentConnections

KisSignalAutoConnectionsStore KisUndoActionsUpdateManager::m_documentConnections
private

Definition at line 32 of file KisUndoActionsUpdateManager.h.

◆ m_redoAction

QAction* KisUndoActionsUpdateManager::m_redoAction
private

Definition at line 30 of file KisUndoActionsUpdateManager.h.

◆ m_undoAction

QAction* KisUndoActionsUpdateManager::m_undoAction
private

Definition at line 29 of file KisUndoActionsUpdateManager.h.


The documentation for this class was generated from the following files: