Merge remote-tracking branch 'origin/master' into claudio-dev

preferencesAboutTextFull
Claudio Valerio 12 years ago
commit 9b33509036
  1. 31
      src/board/UBBoardController.cpp
  2. 1
      src/core/UB.h
  3. 1
      src/domain/UBGraphicsGroupContainerItemDelegate.cpp
  4. 121
      src/domain/domain.pri

@ -551,9 +551,13 @@ void UBBoardController::duplicateItem(UBItem *item)
itemSize = commonItem->boundingRect().size();
}
UBMimeType::Enum itemMimeType;
QString contentTypeHeader = UBFileSystemUtils::mimeTypeFromFileName(item->sourceUrl().toLocalFile());
UBMimeType::Enum itemMimeType = UBFileSystemUtils::mimeTypeFromString(contentTypeHeader);
if(NULL != qgraphicsitem_cast<UBGraphicsGroupContainerItem*>(commonItem)){
itemMimeType = UBMimeType::Group;
}else{
itemMimeType = UBFileSystemUtils::mimeTypeFromString(contentTypeHeader);
}
switch(static_cast<int>(itemMimeType))
{
@ -598,6 +602,29 @@ void UBBoardController::duplicateItem(UBItem *item)
pixitem->pixmap().save(&buffer, format.toLatin1());
}
}break;
case UBMimeType::Group:
{
UBGraphicsGroupContainerItem* groupItem = dynamic_cast<UBGraphicsGroupContainerItem*>(item);
if(groupItem){
QList<QGraphicsItem*> children = groupItem->childItems();
foreach(QGraphicsItem* pIt, children){
UBItem* pItem = dynamic_cast<UBItem*>(pIt);
if(NULL != pItem){
duplicateItem(pItem); // The duplication already copies the item parameters
QGraphicsItem* pDuplicatedItem = dynamic_cast<QGraphicsItem*>((mActiveScene->children().last()));
if(NULL != pDuplicatedItem){
pDuplicatedItem->setSelected(true);
}
}
}
groupItem->setSelected(false);
UBApplication::mainWindow->actionGroupItems->trigger();
}
return;
break;
}
case UBMimeType::UNKNOWN:
{
QGraphicsItem *gitem = dynamic_cast<QGraphicsItem*>(item->deepCopy());

@ -33,6 +33,7 @@ struct UBMimeType
Flash,
PDF,
UniboardTool,
Group,
UNKNOWN
};
};

@ -19,6 +19,7 @@ UBGraphicsGroupContainerItemDelegate::UBGraphicsGroupContainerItemDelegate(QGrap
//Wrapper function. Use it to set correct data() to QGraphicsItem as well
setFlippable(false);
setRotatable(false);
setCanDuplicate(true);
}
UBGraphicsGroupContainerItem *UBGraphicsGroupContainerItemDelegate::delegated()

@ -1,63 +1,58 @@
HEADERS += src/domain/UBGraphicsScene.h \
src/domain/UBGraphicsItemUndoCommand.h \
src/domain/UBGraphicsTextItemUndoCommand.h \
src/domain/UBGraphicsItemTransformUndoCommand.h \
src/domain/UBGraphicsPixmapItem.h \
src/domain/UBDocumentUndoCommand.h \
src/domain/UBPageSizeUndoCommand.h \
src/domain/UBGraphicsProxyWidget.h \
src/domain/UBGraphicsWebView.h \
src/domain/UBGraphicsSvgItem.h \
src/domain/UBGraphicsPolygonItem.h \
src/domain/UBItem.h \
src/domain/UBGraphicsWidgetItem.h \
src/domain/UBGraphicsPDFItem.h \
src/domain/UBGraphicsTextItem.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 \
src/domain/UBGraphicsItemGroupUndoCommand.h
HEADERS += src/domain/UBGraphicsItemDelegate.h \
src/domain/UBGraphicsTextItemDelegate.h \
src/domain/UBGraphicsDelegateFrame.h \
src/domain/UBGraphicsWidgetItemDelegate.h \
src/domain/UBGraphicsMediaItemDelegate.h
SOURCES += src/domain/UBGraphicsScene.cpp \
src/domain/UBGraphicsItemUndoCommand.cpp \
src/domain/UBGraphicsTextItemUndoCommand.cpp \
src/domain/UBGraphicsItemTransformUndoCommand.cpp \
src/domain/UBGraphicsPixmapItem.cpp \
src/domain/UBDocumentUndoCommand.cpp \
src/domain/UBPageSizeUndoCommand.cpp \
src/domain/UBGraphicsProxyWidget.cpp \
src/domain/UBGraphicsWebView.cpp \
src/domain/UBGraphicsSvgItem.cpp \
src/domain/UBGraphicsPolygonItem.cpp \
src/domain/UBItem.cpp \
src/domain/UBGraphicsVideoItem.cpp \
src/domain/UBGraphicsWidgetItem.cpp \
src/domain/UBGraphicsPDFItem.cpp \
src/domain/UBGraphicsTextItem.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 \
src/domain/UBGraphicsItemGroupUndoCommand.cpp
SOURCES += src/domain/UBGraphicsItemDelegate.cpp \
src/domain/UBGraphicsTextItemDelegate.cpp \
src/domain/UBGraphicsMediaItemDelegate.cpp \
src/domain/UBGraphicsDelegateFrame.cpp \
src/domain/UBGraphicsWidgetItemDelegate.cpp \
HEADERS += src/domain/UBGraphicsScene.h \
src/domain/UBGraphicsItemUndoCommand.h \
src/domain/UBGraphicsTextItemUndoCommand.h \
src/domain/UBGraphicsItemTransformUndoCommand.h \
src/domain/UBGraphicsPixmapItem.h \
src/domain/UBDocumentUndoCommand.h \
src/domain/UBPageSizeUndoCommand.h \
src/domain/UBGraphicsProxyWidget.h \
src/domain/UBGraphicsWebView.h \
src/domain/UBGraphicsSvgItem.h \
src/domain/UBGraphicsPolygonItem.h \
src/domain/UBItem.h \
src/domain/UBGraphicsWidgetItem.h \
src/domain/UBGraphicsPDFItem.h \
src/domain/UBGraphicsTextItem.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 \
src/domain/UBGraphicsItemGroupUndoCommand.h \
src/domain/UBGraphicsItemDelegate.h \
src/domain/UBGraphicsTextItemDelegate.h \
src/domain/UBGraphicsDelegateFrame.h \
src/domain/UBGraphicsWidgetItemDelegate.h \
src/domain/UBGraphicsMediaItemDelegate.h
SOURCES += src/domain/UBGraphicsScene.cpp \
src/domain/UBGraphicsItemUndoCommand.cpp \
src/domain/UBGraphicsTextItemUndoCommand.cpp \
src/domain/UBGraphicsItemTransformUndoCommand.cpp \
src/domain/UBGraphicsPixmapItem.cpp \
src/domain/UBDocumentUndoCommand.cpp \
src/domain/UBPageSizeUndoCommand.cpp \
src/domain/UBGraphicsProxyWidget.cpp \
src/domain/UBGraphicsWebView.cpp \
src/domain/UBGraphicsSvgItem.cpp \
src/domain/UBGraphicsPolygonItem.cpp \
src/domain/UBItem.cpp \
src/domain/UBGraphicsVideoItem.cpp \
src/domain/UBGraphicsWidgetItem.cpp \
src/domain/UBGraphicsPDFItem.cpp \
src/domain/UBGraphicsTextItem.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 \
src/domain/UBGraphicsItemGroupUndoCommand.cpp \
src/domain/UBGraphicsItemDelegate.cpp \
src/domain/UBGraphicsTextItemDelegate.cpp \
src/domain/UBGraphicsMediaItemDelegate.cpp \
src/domain/UBGraphicsDelegateFrame.cpp \
src/domain/UBGraphicsWidgetItemDelegate.cpp

Loading…
Cancel
Save