Your ROOT_URL in app.ini is http://git.osmesh.ru/ but you are visiting http://91.221.70.94:3000/MOS/OpenBoard/commit/fa65eafefeeca7fa22f2b4ecc17b4c292691b70a?style=unified&whitespace=ignore-all You should set ROOT_URL correctly, otherwise the web may not work correctly.

bugs of persistance of unwanted media on disk. First step fixed the undo manager

preferencesAboutTextFull
Claudio Valerio 12 years ago
parent 000f1a9c01
commit fa65eafefe
  1. 12
      src/board/UBBoardController.cpp
  2. 2
      src/board/UBBoardController.h
  3. 9
      src/core/UB.h
  4. 7
      src/domain/UBGraphicsItemGroupUndoCommand.cpp
  5. 6
      src/domain/UBGraphicsItemGroupUndoCommand.h
  6. 2
      src/domain/UBGraphicsItemTransformUndoCommand.cpp
  7. 6
      src/domain/UBGraphicsItemTransformUndoCommand.h
  8. 10
      src/domain/UBGraphicsItemUndoCommand.cpp
  9. 6
      src/domain/UBGraphicsItemUndoCommand.h
  10. 6
      src/domain/UBGraphicsTextItemUndoCommand.h
  11. 6
      src/domain/UBPageSizeUndoCommand.h
  12. 19
      src/domain/UBUndoCommand.cpp
  13. 24
      src/domain/UBUndoCommand.h
  14. 8
      src/domain/domain.pri

@ -1550,11 +1550,11 @@ void UBBoardController::moveSceneToIndex(int source, int target)
}
}
void UBBoardController::fitUniqIems(const QUndoCommand *parent, QSet<QGraphicsItem*> &itms)
void UBBoardController::findUniquesItems(const QUndoCommand *parent, QSet<QGraphicsItem*> &itms)
{
if (parent->childCount()) {
for (int i = 0; i < parent->childCount(); i++) {
fitUniqIems(parent->child(i), itms);
findUniquesItems(parent->child(i), itms);
}
}
@ -1563,11 +1563,11 @@ void UBBoardController::fitUniqIems(const QUndoCommand *parent, QSet<QGraphicsIt
return;
}
const UBAbstractUndoCommand *abstractCmd = static_cast<const UBAbstractUndoCommand*>(parent);
if(abstractCmd->getType() != UBAbstractUndoCommand::undotype_GRAPHICITEM)
const UBUndoCommand *undoCmd = static_cast<const UBUndoCommand*>(parent);
if(undoCmd->getType() != UBUndoType::undotype_GRAPHICITEM)
return;
const UBGraphicsItemUndoCommand *cmd = static_cast<const UBGraphicsItemUndoCommand*>(parent);
const UBGraphicsItemUndoCommand *cmd = dynamic_cast<const UBGraphicsItemUndoCommand*>(parent);
// go through all added and removed objects, for create list of unique objects
// grouped items will be deleted by groups, so we don't need do delete that items.
@ -1593,7 +1593,7 @@ void UBBoardController::ClearUndoStack()
QSet<QGraphicsItem*> uniqueItems;
// go through all stack command
for (int i = 0; i < UBApplication::undoStack->count(); i++) {
fitUniqIems(UBApplication::undoStack->command(i), uniqueItems);
findUniquesItems(UBApplication::undoStack->command(i), uniqueItems);
}
// go through all unique items, and check, if they are on scene, or not.

@ -160,7 +160,7 @@ class UBBoardController : public UBDocumentContainer
void notifyPageChanged();
void displayMetaData(QMap<QString, QString> metadatas);
void fitUniqIems(const QUndoCommand *parent, QSet<QGraphicsItem *> &itms);
void findUniquesItems(const QUndoCommand *parent, QSet<QGraphicsItem *> &itms);
void ClearUndoStack();
void setActiveDocumentScene(UBDocumentProxy* pDocumentProxy, int pSceneIndex = 0, bool forceReload = false);

@ -195,4 +195,13 @@ struct DocumentSizeRatio
};
};
struct UBUndoType
{
enum Enum
{
undotype_UNKNOWN = 0, undotype_DOCUMENT, undotype_GRAPHICITEMTRANSFORM, undotype_GRAPHICITEM, undotype_GRAPHICTEXTITEM, undotype_PAGESIZE, undotype_GRAPHICSGROUPITEM
};
};
#endif /* UB_H_ */

@ -28,9 +28,10 @@
#include "core/memcheck.h"
UBGraphicsItemGroupUndoCommand::UBGraphicsItemGroupUndoCommand(UBGraphicsScene *pScene, UBGraphicsGroupContainerItem *pGroupCreated) :
mScene (pScene), mGroup(pGroupCreated), mFirstRedo(true)
UBGraphicsItemGroupUndoCommand::UBGraphicsItemGroupUndoCommand(UBGraphicsScene *pScene, UBGraphicsGroupContainerItem *pGroupCreated) : UBUndoCommand()
, mScene (pScene)
, mGroup(pGroupCreated)
, mFirstRedo(true)
{
if (pGroupCreated->childItems().count()) {
foreach (QGraphicsItem *item, pGroupCreated->childItems()) {

@ -25,18 +25,18 @@
#define UBGRAPHICSITEMGROUPUNDOCOMMAND_H
#include <QList>
#include "UBAbstractUndoCommand.h"
#include "UBUndoCommand.h"
class UBGraphicsScene;
class UBGraphicsGroupContainerItem;
class UBGraphicsItemGroupUndoCommand : public UBAbstractUndoCommand
class UBGraphicsItemGroupUndoCommand : public UBUndoCommand
{
public:
UBGraphicsItemGroupUndoCommand(UBGraphicsScene *pScene, UBGraphicsGroupContainerItem *pGroupCreated);
virtual ~UBGraphicsItemGroupUndoCommand();
virtual UndoType getType() { return undotype_GRAPHICSGROUPITEM; }
virtual int getType() const { return UBUndoType::undotype_GRAPHICSGROUPITEM; }
protected:
virtual void undo();

@ -29,7 +29,7 @@
UBGraphicsItemTransformUndoCommand::UBGraphicsItemTransformUndoCommand(QGraphicsItem* pItem,
const QPointF& prevPos, const QTransform& prevTransform, const qreal& prevZValue,
const QSizeF& prevSize)
const QSizeF& prevSize):UBUndoCommand()
{
mItem = pItem;
mPreviousTransform = prevTransform;

@ -27,10 +27,10 @@
#include <QtGui>
#include "UBResizableGraphicsItem.h"
#include "UBAbstractUndoCommand.h"
#include "UBUndoCommand.h"
class UBGraphicsItemTransformUndoCommand : public UBAbstractUndoCommand
class UBGraphicsItemTransformUndoCommand : public UBUndoCommand
{
public:
UBGraphicsItemTransformUndoCommand(QGraphicsItem* pItem,
@ -40,7 +40,7 @@ class UBGraphicsItemTransformUndoCommand : public UBAbstractUndoCommand
const QSizeF& prevSize = QSizeF());
virtual ~UBGraphicsItemTransformUndoCommand();
virtual UndoType getType() { return undotype_GRAPHICITEMTRANSFORM; }
virtual int getType() const { return UBUndoType::undotype_GRAPHICITEMTRANSFORM; }
protected:
virtual void undo();

@ -35,9 +35,8 @@
#include "domain/UBGraphicsGroupContainerItem.h"
#include "domain/UBGraphicsPolygonItem.h"
UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, const QSet<QGraphicsItem*>& pRemovedItems,
const QSet<QGraphicsItem*>& pAddedItems, const GroupDataTable &groupsMap)
: mScene(pScene)
UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, const QSet<QGraphicsItem*>& pRemovedItems, const QSet<QGraphicsItem*>& pAddedItems, const GroupDataTable &groupsMap): UBUndoCommand()
, mScene(pScene)
, mRemovedItems(pRemovedItems - pAddedItems)
, mAddedItems(pAddedItems - pRemovedItems)
, mExcludedFromGroup(groupsMap)
@ -57,9 +56,8 @@ UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, co
}
}
UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, QGraphicsItem* pRemovedItem,
QGraphicsItem* pAddedItem) :
mScene(pScene)
UBGraphicsItemUndoCommand::UBGraphicsItemUndoCommand(UBGraphicsScene* pScene, QGraphicsItem* pRemovedItem, QGraphicsItem* pAddedItem) : UBUndoCommand()
, mScene(pScene)
{
if (pRemovedItem)

@ -25,14 +25,14 @@
#define UBGRAPHICSITEMUNDOCOMMAND_H_
#include <QtGui>
#include "UBAbstractUndoCommand.h"
#include "UBUndoCommand.h"
#include "UBGraphicsGroupContainerItem.h"
class UBGraphicsScene;
class UBGraphicsItemUndoCommand : public UBAbstractUndoCommand
class UBGraphicsItemUndoCommand : public UBUndoCommand
{
public:
typedef QMultiMap<UBGraphicsGroupContainerItem*, QUuid> GroupDataTable;
@ -48,7 +48,7 @@ class UBGraphicsItemUndoCommand : public UBAbstractUndoCommand
QSet<QGraphicsItem*> GetAddedList() const { return mAddedItems; }
QSet<QGraphicsItem*> GetRemovedList() const { return mRemovedItems; }
virtual UndoType getType() { return undotype_GRAPHICITEM; }
virtual int getType() const { return UBUndoType::undotype_GRAPHICITEM; }
protected:
virtual void undo();

@ -25,18 +25,18 @@
#define UBGRAPHICSTEXTITEMUNDOCOMMAND_H_
#include <QtGui>
#include "UBAbstractUndoCommand.h"
#include "UBUndoCommand.h"
#include "UBGraphicsTextItem.h"
class UBGraphicsTextItemUndoCommand : public UBAbstractUndoCommand
class UBGraphicsTextItemUndoCommand : public UBUndoCommand
{
public:
UBGraphicsTextItemUndoCommand(UBGraphicsTextItem *textItem);
virtual ~UBGraphicsTextItemUndoCommand();
virtual UndoType getType() { return undotype_GRAPHICTEXTITEM; };
virtual int getType() const { return UBUndoType::undotype_GRAPHICTEXTITEM; };
protected:
virtual void undo();

@ -25,18 +25,18 @@
#define UBPageSizeUndoCommand_H_
#include <QtGui>
#include "UBAbstractUndoCommand.h"
#include "UBUndoCommand.h"
class UBGraphicsScene;
class UBPageSizeUndoCommand : public UBAbstractUndoCommand
class UBPageSizeUndoCommand : public UBUndoCommand
{
public:
UBPageSizeUndoCommand(UBGraphicsScene* pScene, const QSize& previousSize, const QSize& newSize);
virtual ~UBPageSizeUndoCommand();
virtual UndoType getType() { return undotype_PAGESIZE; };
virtual int getType() { return UBUndoType::undotype_PAGESIZE; };
protected:
virtual void undo();

@ -21,30 +21,17 @@
#include "UBAbstractUndoCommand.h"
#include "UBUndoCommand.h"
#include "core/memcheck.h"
UBAbstractUndoCommand::UBAbstractUndoCommand()
UBUndoCommand::UBUndoCommand(QUndoCommand* parent):QUndoCommand(parent)
{
// NOOP
}
UBAbstractUndoCommand::~UBAbstractUndoCommand()
UBUndoCommand::~UBUndoCommand()
{
// NOOP
}
void UBAbstractUndoCommand::undo()
{
// NOOP
}
void UBAbstractUndoCommand::redo()
{
// NOOP
}
//void UBAbstractUndoCommand::UndoType getType(UndoType type);

@ -25,30 +25,16 @@
#define UBABSTRACTUNDOCOMMAND_H_
#include <QtGui>
#include <core/UB.h>
class UBAbstractUndoCommand : public QUndoCommand
class UBUndoCommand : public QUndoCommand
{
public:
UBAbstractUndoCommand();
~UBAbstractUndoCommand();
UBUndoCommand(QUndoCommand *parent = 0);
~UBUndoCommand();
enum UndoType
{
undotype_UNKNOWN = 0,
undotype_DOCUMENT = 1,
undotype_GRAPHICITEMTRANSFORM = 2,
undotype_GRAPHICITEM = 3,
undotype_GRAPHICTEXTITEM = 4,
undotype_PAGESIZE = 5,
undotype_GRAPHICSGROUPITEM = 6
};
virtual UndoType getType() const { return undotype_UNKNOWN; }
protected:
virtual void undo();
virtual void redo();
virtual int getType() const { return UBUndoType::undotype_UNKNOWN; }
};

@ -14,7 +14,6 @@ HEADERS += src/domain/UBGraphicsScene.h \
src/domain/UBResizableGraphicsItem.h \
src/domain/UBGraphicsStroke.h \
src/domain/UBGraphicsMediaItem.h \
src/domain/UBAbstractUndoCommand.h \
src/domain/UBGraphicsGroupContainerItem.h \
src/domain/UBGraphicsGroupContainerItemDelegate.h \
src/domain/UBGraphicsStrokesGroup.h \
@ -24,7 +23,8 @@ HEADERS += src/domain/UBGraphicsScene.h \
src/domain/UBGraphicsDelegateFrame.h \
src/domain/UBGraphicsWidgetItemDelegate.h \
src/domain/UBGraphicsMediaItemDelegate.h \
src/domain/UBSelectionFrame.h
src/domain/UBSelectionFrame.h \
src/domain/UBUndoCommand.h
SOURCES += src/domain/UBGraphicsScene.cpp \
src/domain/UBGraphicsItemUndoCommand.cpp \
@ -42,7 +42,6 @@ SOURCES += src/domain/UBGraphicsScene.cpp \
src/domain/UBResizableGraphicsItem.cpp \
src/domain/UBGraphicsStroke.cpp \
src/domain/UBGraphicsMediaItem.cpp \
src/domain/UBAbstractUndoCommand.cpp \
src/domain/UBGraphicsGroupContainerItem.cpp \
src/domain/UBGraphicsGroupContainerItemDelegate.cpp \
src/domain/UBGraphicsStrokesGroup.cpp \
@ -52,4 +51,5 @@ SOURCES += src/domain/UBGraphicsScene.cpp \
src/domain/UBGraphicsMediaItemDelegate.cpp \
src/domain/UBGraphicsDelegateFrame.cpp \
src/domain/UBGraphicsWidgetItemDelegate.cpp \
src/domain/UBSelectionFrame.cpp
src/domain/UBSelectionFrame.cpp \
src/domain/UBUndoCommand.cpp

Loading…
Cancel
Save