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. 15
      src/domain/domain.pri

@ -551,9 +551,13 @@ void UBBoardController::duplicateItem(UBItem *item)
itemSize = commonItem->boundingRect().size(); itemSize = commonItem->boundingRect().size();
} }
UBMimeType::Enum itemMimeType;
QString contentTypeHeader = UBFileSystemUtils::mimeTypeFromFileName(item->sourceUrl().toLocalFile()); QString contentTypeHeader = UBFileSystemUtils::mimeTypeFromFileName(item->sourceUrl().toLocalFile());
if(NULL != qgraphicsitem_cast<UBGraphicsGroupContainerItem*>(commonItem)){
UBMimeType::Enum itemMimeType = UBFileSystemUtils::mimeTypeFromString(contentTypeHeader); itemMimeType = UBMimeType::Group;
}else{
itemMimeType = UBFileSystemUtils::mimeTypeFromString(contentTypeHeader);
}
switch(static_cast<int>(itemMimeType)) switch(static_cast<int>(itemMimeType))
{ {
@ -598,6 +602,29 @@ void UBBoardController::duplicateItem(UBItem *item)
pixitem->pixmap().save(&buffer, format.toLatin1()); pixitem->pixmap().save(&buffer, format.toLatin1());
} }
}break; }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: case UBMimeType::UNKNOWN:
{ {
QGraphicsItem *gitem = dynamic_cast<QGraphicsItem*>(item->deepCopy()); QGraphicsItem *gitem = dynamic_cast<QGraphicsItem*>(item->deepCopy());

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

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

@ -1,4 +1,3 @@
HEADERS += src/domain/UBGraphicsScene.h \ HEADERS += src/domain/UBGraphicsScene.h \
src/domain/UBGraphicsItemUndoCommand.h \ src/domain/UBGraphicsItemUndoCommand.h \
src/domain/UBGraphicsTextItemUndoCommand.h \ src/domain/UBGraphicsTextItemUndoCommand.h \
@ -21,15 +20,13 @@ HEADERS += src/domain/UBGraphicsScene.h \
src/domain/UBGraphicsGroupContainerItem.h \ src/domain/UBGraphicsGroupContainerItem.h \
src/domain/UBGraphicsGroupContainerItemDelegate.h \ src/domain/UBGraphicsGroupContainerItemDelegate.h \
src/domain/UBGraphicsStrokesGroup.h \ src/domain/UBGraphicsStrokesGroup.h \
src/domain/UBGraphicsItemGroupUndoCommand.h src/domain/UBGraphicsItemGroupUndoCommand.h \
src/domain/UBGraphicsItemDelegate.h \
HEADERS += src/domain/UBGraphicsItemDelegate.h \
src/domain/UBGraphicsTextItemDelegate.h \ src/domain/UBGraphicsTextItemDelegate.h \
src/domain/UBGraphicsDelegateFrame.h \ src/domain/UBGraphicsDelegateFrame.h \
src/domain/UBGraphicsWidgetItemDelegate.h \ src/domain/UBGraphicsWidgetItemDelegate.h \
src/domain/UBGraphicsMediaItemDelegate.h src/domain/UBGraphicsMediaItemDelegate.h
SOURCES += src/domain/UBGraphicsScene.cpp \ SOURCES += src/domain/UBGraphicsScene.cpp \
src/domain/UBGraphicsItemUndoCommand.cpp \ src/domain/UBGraphicsItemUndoCommand.cpp \
src/domain/UBGraphicsTextItemUndoCommand.cpp \ src/domain/UBGraphicsTextItemUndoCommand.cpp \
@ -53,11 +50,9 @@ SOURCES += src/domain/UBGraphicsScene.cpp \
src/domain/ubgraphicsgroupcontaineritem.cpp \ src/domain/ubgraphicsgroupcontaineritem.cpp \
src/domain/ubgraphicsgroupcontaineritemdelegate.cpp \ src/domain/ubgraphicsgroupcontaineritemdelegate.cpp \
src/domain/UBGraphicsStrokesGroup.cpp \ src/domain/UBGraphicsStrokesGroup.cpp \
src/domain/UBGraphicsItemGroupUndoCommand.cpp src/domain/UBGraphicsItemGroupUndoCommand.cpp \
src/domain/UBGraphicsItemDelegate.cpp \
SOURCES += src/domain/UBGraphicsItemDelegate.cpp \
src/domain/UBGraphicsTextItemDelegate.cpp \ src/domain/UBGraphicsTextItemDelegate.cpp \
src/domain/UBGraphicsMediaItemDelegate.cpp \ src/domain/UBGraphicsMediaItemDelegate.cpp \
src/domain/UBGraphicsDelegateFrame.cpp \ src/domain/UBGraphicsDelegateFrame.cpp \
src/domain/UBGraphicsWidgetItemDelegate.cpp \ src/domain/UBGraphicsWidgetItemDelegate.cpp

Loading…
Cancel
Save