Exemplo n.º 1
0
 void start() {
     _redoStack.clear();
     if (_undoStack.size() == _undoLevels) {
         _undoStack.pop_front();
     }
     startUndo();
     trackersBegin();
 }
Exemplo n.º 2
0
    // Sets the size of the undoStack
    void setLevels(std::size_t levels) {
        if (levels > MAX_UNDO_LEVELS) {
            levels = MAX_UNDO_LEVELS;
        }

        while (_undoStack.size() > levels) {
            _undoStack.pop_front();
        }
        _undoLevels = levels;
    }
Exemplo n.º 3
0
QStringList UndoManager::getLastFromStack( int count, UndoStack & stack )
{
	QStringList ret;
	for( int i = stack.size() - 1; i >= 0 && count > 0; i--, count-- )
	{
		UndoBlock * ub = stack[i];
		QString ttl = ub->title();
		ret += ttl.isEmpty() ? "Unknown Operation" : ttl;
	}
	return ret;
}
Exemplo n.º 4
0
 std::size_t size() const {
     return _undoStack.size();
 }