Commit 38d759fd authored by Ilia Ryabokon's avatar Ilia Ryabokon

Merge branch 'master' of github.com:Sankore/Sankore-3.1

Not necessary merge
parents 21ac264c ac1c9314
...@@ -327,6 +327,25 @@ macx { ...@@ -327,6 +327,25 @@ macx {
TRANSLATION_ca.path = "$$RESOURCES_DIR/ca.lproj" TRANSLATION_ca.path = "$$RESOURCES_DIR/ca.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_ca QMAKE_BUNDLE_DATA += TRANSLATION_ca
} }
exists(resources/i18n/sankore_el.qm) {
TRANSLATION_el.files = resources/i18n/sankore_el.qm \
resources/i18n/Localizable.strings
TRANSLATION_el.path = "$$RESOURCES_DIR/el.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_el
}
exists(resources/i18n/sankore_tr.qm) {
TRANSLATION_tr.files = resources/i18n/sankore_tr.qm \
resources/i18n/Localizable.strings
TRANSLATION_tr.path = "$$RESOURCES_DIR/tr.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_tr
}
exists(resources/i18n/sankore_cs.qm) {
TRANSLATION_cs.files = resources/i18n/sankore_cs.qm \
resources/i18n/Localizable.strings
TRANSLATION_cs.path = "$$RESOURCES_DIR/cs.lproj"
QMAKE_BUNDLE_DATA += TRANSLATION_cs
}
QMAKE_BUNDLE_DATA += UB_ETC \ QMAKE_BUNDLE_DATA += UB_ETC \
UB_LIBRARY \ UB_LIBRARY \
...@@ -391,7 +410,10 @@ TRANSLATIONS = resources/i18n/sankore_en.ts \ ...@@ -391,7 +410,10 @@ TRANSLATIONS = resources/i18n/sankore_en.ts \
resources/i18n/sankore_pt.ts \ resources/i18n/sankore_pt.ts \
resources/i18n/sankore_sk.ts \ resources/i18n/sankore_sk.ts \
resources/i18n/sankore_bg.ts \ resources/i18n/sankore_bg.ts \
resources/i18n/sankore_ca.ts resources/i18n/sankore_ca.ts \
resources/i18n/sankore_el.ts \
resources/i18n/sankore_tr.ts \
resources/i18n/sankore_cs.ts
INSTALLS = UB_ETC \ INSTALLS = UB_ETC \
UB_I18N \ UB_I18N \
......
...@@ -1632,6 +1632,9 @@ ...@@ -1632,6 +1632,9 @@
</property> </property>
</action> </action>
<action name="actionGroupItems"> <action name="actionGroupItems">
<property name="checkable">
<bool>true</bool>
</property>
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>false</bool>
</property> </property>
...@@ -1641,7 +1644,7 @@ ...@@ -1641,7 +1644,7 @@
<normalon>:/images/toolbar/ungroup.png</normalon>:/images/toolbar/group.png</iconset> <normalon>:/images/toolbar/ungroup.png</normalon>:/images/toolbar/group.png</iconset>
</property> </property>
<property name="text"> <property name="text">
<string>Group Items</string> <string>Group</string>
</property> </property>
<property name="toolTip"> <property name="toolTip">
<string>Group items</string> <string>Group items</string>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
resources/images/toolbar/group.png

1.95 KB | W: | H:

resources/images/toolbar/group.png

1.19 KB | W: | H:

resources/images/toolbar/group.png
resources/images/toolbar/group.png
resources/images/toolbar/group.png
resources/images/toolbar/group.png
  • 2-up
  • Swipe
  • Onion skin
resources/images/toolbar/ungroup.png

2.21 KB | W: | H:

resources/images/toolbar/ungroup.png

1.46 KB | W: | H:

resources/images/toolbar/ungroup.png
resources/images/toolbar/ungroup.png
resources/images/toolbar/ungroup.png
resources/images/toolbar/ungroup.png
  • 2-up
  • Swipe
  • Onion skin
...@@ -32,6 +32,7 @@ ...@@ -32,6 +32,7 @@
#include "domain/UBGraphicsTextItem.h" #include "domain/UBGraphicsTextItem.h"
#include "domain/UBGraphicsTextItemDelegate.h" #include "domain/UBGraphicsTextItemDelegate.h"
#include "domain/UBGraphicsWidgetItem.h" #include "domain/UBGraphicsWidgetItem.h"
#include "domain/UBGraphicsGroupContainerItem.h"
#include "frameworks/UBFileSystemUtils.h" #include "frameworks/UBFileSystemUtils.h"
...@@ -128,8 +129,9 @@ bool UBCFFSubsetAdaptor::ConvertCFFFileToUbz(QString &cffSourceFile, UBDocumentP ...@@ -128,8 +129,9 @@ bool UBCFFSubsetAdaptor::ConvertCFFFileToUbz(QString &cffSourceFile, UBDocumentP
return result; return result;
} }
UBCFFSubsetAdaptor::UBCFFSubsetReader::UBCFFSubsetReader(UBDocumentProxy *proxy, QFile *content): UBCFFSubsetAdaptor::UBCFFSubsetReader::UBCFFSubsetReader(UBDocumentProxy *proxy, QFile *content)
mProxy(proxy) : mProxy(proxy)
, mGSectionContainer(NULL)
{ {
int errorLine, errorColumn; int errorLine, errorColumn;
QString errorStr; QString errorStr;
...@@ -168,6 +170,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parse() ...@@ -168,6 +170,8 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parse()
bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseGSection(const QDomElement &element) bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseGSection(const QDomElement &element)
{ {
mGSectionContainer = new UBGraphicsGroupContainerItem();
QDomElement currentSvgElement = element.firstChildElement(); QDomElement currentSvgElement = element.firstChildElement();
while (!currentSvgElement.isNull()) { while (!currentSvgElement.isNull()) {
if (!parseSvgElement(currentSvgElement)) if (!parseSvgElement(currentSvgElement))
...@@ -176,6 +180,16 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseGSection(const QDomElement &ele ...@@ -176,6 +180,16 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseGSection(const QDomElement &ele
currentSvgElement = currentSvgElement.nextSiblingElement(); currentSvgElement = currentSvgElement.nextSiblingElement();
} }
if (mGSectionContainer->childItems().count())
{
mCurrentScene->addGroup(mGSectionContainer);
}
else
{
delete mGSectionContainer;
mGSectionContainer = NULL;
}
return true; return true;
} }
bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgSwitchSection(const QDomElement &element) bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgSwitchSection(const QDomElement &element)
...@@ -247,6 +261,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgRect(const QDomElement &elem ...@@ -247,6 +261,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgRect(const QDomElement &elem
repositionSvgItem(svgItem, width, height, x1, y1, transform); repositionSvgItem(svgItem, width, height, x1, y1, transform);
hashSceneItem(element, svgItem); hashSceneItem(element, svgItem);
if (mGSectionContainer)
{
addItemToGSection(svgItem);
}
delete generator; delete generator;
return true; return true;
...@@ -293,6 +312,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgEllipse(const QDomElement &e ...@@ -293,6 +312,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgEllipse(const QDomElement &e
repositionSvgItem(svgItem, rx * 2, ry * 2, cx - 2*rx, cy+ry, transform); repositionSvgItem(svgItem, rx * 2, ry * 2, cx - 2*rx, cy+ry, transform);
hashSceneItem(element, svgItem); hashSceneItem(element, svgItem);
if (mGSectionContainer)
{
addItemToGSection(svgItem);
}
delete generator; delete generator;
return true; return true;
...@@ -375,6 +399,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &e ...@@ -375,6 +399,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolygon(const QDomElement &e
repositionSvgItem(svgItem, width +strokeWidth, height + strokeWidth, x1 - strokeWidth/2 + transform.m31(), y1 + strokeWidth/2 + transform.m32(), transform); repositionSvgItem(svgItem, width +strokeWidth, height + strokeWidth, x1 - strokeWidth/2 + transform.m31(), y1 + strokeWidth/2 + transform.m32(), transform);
hashSceneItem(element, svgItem); hashSceneItem(element, svgItem);
if (mGSectionContainer)
{
addItemToGSection(svgItem);
}
delete generator; delete generator;
return true; return true;
...@@ -454,6 +483,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolyline(const QDomElement & ...@@ -454,6 +483,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgPolyline(const QDomElement &
repositionSvgItem(svgItem, width +strokeWidth, height + strokeWidth, x1 + transform.m31() - strokeWidth/2, y1 + transform.m32() + strokeWidth/2, transform); repositionSvgItem(svgItem, width +strokeWidth, height + strokeWidth, x1 + transform.m31() - strokeWidth/2, y1 + transform.m32() + strokeWidth/2, transform);
hashSceneItem(element, svgItem); hashSceneItem(element, svgItem);
if (mGSectionContainer)
{
addItemToGSection(svgItem);
}
delete generator; delete generator;
return true; return true;
...@@ -593,6 +627,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgText(const QDomElement &elem ...@@ -593,6 +627,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgText(const QDomElement &elem
repositionSvgItem(svgItem, width, height, x + transform.m31(), y + transform.m32(), transform); repositionSvgItem(svgItem, width, height, x + transform.m31(), y + transform.m32(), transform);
hashSceneItem(element, svgItem); hashSceneItem(element, svgItem);
if (mGSectionContainer)
{
addItemToGSection(svgItem);
}
delete generator; delete generator;
return true; return true;
} }
...@@ -712,6 +751,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement & ...@@ -712,6 +751,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgTextarea(const QDomElement &
repositionSvgItem(svgItem, width, height, x + transform.m31(), y + transform.m32(), transform); repositionSvgItem(svgItem, width, height, x + transform.m31(), y + transform.m32(), transform);
hashSceneItem(element, svgItem); hashSceneItem(element, svgItem);
if (mGSectionContainer)
{
addItemToGSection(svgItem);
}
return true; return true;
} }
bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &element) bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &element)
...@@ -749,6 +793,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele ...@@ -749,6 +793,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgImage(const QDomElement &ele
repositionSvgItem(pixItem, width, height, x + transform.m31(), y + transform.m32(), transform); repositionSvgItem(pixItem, width, height, x + transform.m31(), y + transform.m32(), transform);
hashSceneItem(element, pixItem); hashSceneItem(element, pixItem);
if (mGSectionContainer)
{
addItemToGSection(pixItem);
}
return true; return true;
} }
bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgFlash(const QDomElement &element) bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgFlash(const QDomElement &element)
...@@ -791,6 +840,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgFlash(const QDomElement &ele ...@@ -791,6 +840,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgFlash(const QDomElement &ele
repositionSvgItem(flashItem, width, height, x + transform.m31(), y + transform.m32(), transform); repositionSvgItem(flashItem, width, height, x + transform.m31(), y + transform.m32(), transform);
hashSceneItem(element, flashItem); hashSceneItem(element, flashItem);
if (mGSectionContainer)
{
addItemToGSection(flashItem);
}
return true; return true;
} }
...@@ -829,6 +883,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgAudio(const QDomElement &ele ...@@ -829,6 +883,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgAudio(const QDomElement &ele
repositionSvgItem(audioItem, audioItem->boundingRect().width(), audioItem->boundingRect().height(), x + transform.m31(), y + transform.m32(), transform); repositionSvgItem(audioItem, audioItem->boundingRect().width(), audioItem->boundingRect().height(), x + transform.m31(), y + transform.m32(), transform);
hashSceneItem(element, audioItem); hashSceneItem(element, audioItem);
if (mGSectionContainer)
{
addItemToGSection(audioItem);
}
return true; return true;
} }
bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &element) bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &element)
...@@ -867,6 +926,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &ele ...@@ -867,6 +926,11 @@ bool UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgVideo(const QDomElement &ele
repositionSvgItem(videoItem, videoItem->boundingRect().width(), videoItem->boundingRect().height(), x + transform.m31(), y + transform.m32(), transform); repositionSvgItem(videoItem, videoItem->boundingRect().width(), videoItem->boundingRect().height(), x + transform.m31(), y + transform.m32(), transform);
hashSceneItem(element, videoItem); hashSceneItem(element, videoItem);
if (mGSectionContainer)
{
addItemToGSection(videoItem);
}
return true; return true;
} }
...@@ -877,6 +941,11 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgSectionAttr(const QDomElemen ...@@ -877,6 +941,11 @@ void UBCFFSubsetAdaptor::UBCFFSubsetReader::parseSvgSectionAttr(const QDomElemen
svgSection.attribute(aHeight).toInt()); svgSection.attribute(aHeight).toInt());
} }
void UBCFFSubsetAdaptor::UBCFFSubsetReader::addItemToGSection(QGraphicsItem *item)
{
mGSectionContainer->addToGroup(item);
}
void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSceneItem(const QDomElement &element, UBGraphicsItem *item) void UBCFFSubsetAdaptor::UBCFFSubsetReader::hashSceneItem(const QDomElement &element, UBGraphicsItem *item)
{ {
// adding element pointer to hash to refer if needed // adding element pointer to hash to refer if needed
......
...@@ -35,6 +35,7 @@ class QGraphicsItem; ...@@ -35,6 +35,7 @@ class QGraphicsItem;
class QTextBlockFormat; class QTextBlockFormat;
class QTextCharFormat; class QTextCharFormat;
class QTextCursor; class QTextCursor;
class UBGraphicsStrokesGroup;
class UBCFFSubsetAdaptor class UBCFFSubsetAdaptor
...@@ -66,6 +67,8 @@ private: ...@@ -66,6 +67,8 @@ private:
QPointF mViewBoxCenter; QPointF mViewBoxCenter;
QSize mSize; QSize mSize;
QPointF mShiftVector; QPointF mShiftVector;
bool mSvgGSectionIsOpened;
UBGraphicsGroupContainerItem *mGSectionContainer;
private: private:
QDomDocument mDOMdoc; QDomDocument mDOMdoc;
...@@ -73,6 +76,7 @@ private: ...@@ -73,6 +76,7 @@ private:
QHash<QString, UBGraphicsItem*> persistedItems; QHash<QString, UBGraphicsItem*> persistedItems;
QDir mTmpFlashDir; QDir mTmpFlashDir;
void addItemToGSection(QGraphicsItem *item);
bool hashElements(); bool hashElements();
void addExtentionsToHash(QDomElement *parent, QDomElement *topGroup); void addExtentionsToHash(QDomElement *parent, QDomElement *topGroup);
......
...@@ -396,6 +396,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -396,6 +396,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
if (!mScene) if (!mScene)
{ {
mScene = new UBGraphicsScene(mProxy); mScene = new UBGraphicsScene(mProxy);
mScene->setURStackEnable(false);
} }
// introduced in UB 4.2 // introduced in UB 4.2
...@@ -1013,6 +1014,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene() ...@@ -1013,6 +1014,7 @@ UBGraphicsScene* UBSvgSubsetAdaptor::UBSvgSubsetReader::loadScene()
delete annotationGroup; delete annotationGroup;
} }
mScene->setURStackEnable(true);
return mScene; return mScene;
} }
......
...@@ -880,7 +880,7 @@ void UBBoardController::groupButtonClicked() ...@@ -880,7 +880,7 @@ void UBBoardController::groupButtonClicked()
} }
if (groupAction->text() == UBSettings::settings()->actionGroupText) { //The only way to get information from item, considering using smth else if (groupAction->text() == UBSettings::settings()->actionGroupText) { //The only way to get information from item, considering using smth else
UBGraphicsGroupContainerItem *groupItem = activeScene()->createGroup(selItems); UBGraphicsGroupContainerItem *groupItem = activeScene()->createGroup(selItems);
groupItem->setSelected(true); groupItem->setSelected(true);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector); UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
...@@ -1102,7 +1102,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri ...@@ -1102,7 +1102,7 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
QUuid uuid = QUuid::createUuid(); QUuid uuid = QUuid::createUuid();
QUrl url = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager() QUrl url = QUrl::fromLocalFile(UBPersistenceManager::persistenceManager()
->addVideoFileToDocument(selectedDocument(), sourceUrl, pData, uuid)); ->addAudioFileToDocument(selectedDocument(), sourceUrl, pData, uuid));
audioMediaItem = mActiveScene->addMedia(url, false, pPos); audioMediaItem = mActiveScene->addMedia(url, false, pPos);
......
...@@ -106,8 +106,7 @@ UBBoardView::~UBBoardView () { ...@@ -106,8 +106,7 @@ UBBoardView::~UBBoardView () {
delete suspendedMousePressEvent; delete suspendedMousePressEvent;
} }
void void UBBoardView::init ()
UBBoardView::init ()
{ {
connect (UBSettings::settings ()->boardPenPressureSensitive, SIGNAL (changed (QVariant)), connect (UBSettings::settings ()->boardPenPressureSensitive, SIGNAL (changed (QVariant)),
this, SLOT (settingChanged (QVariant))); this, SLOT (settingChanged (QVariant)));
...@@ -144,8 +143,6 @@ UBBoardView::init () ...@@ -144,8 +143,6 @@ UBBoardView::init ()
movingItem = NULL; movingItem = NULL;
mWidgetMoved = false; mWidgetMoved = false;
connectToStylusPalette();
} }
UBGraphicsScene* UBGraphicsScene*
...@@ -1441,28 +1438,3 @@ UBBoardView::setToolCursor (int tool) ...@@ -1441,28 +1438,3 @@ UBBoardView::setToolCursor (int tool)
controlViewport->setCursor (UBResources::resources ()->penCursor); controlViewport->setCursor (UBResources::resources ()->penCursor);
} }
} }
void UBBoardView::connectToStylusPalette()
{
connect(UBApplication::mainWindow->actionPen, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionEraser, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionMarker, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPointer, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionPlay, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomIn, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionZoomOut, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionCapture, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionHand, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionLine, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionText, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
connect(UBApplication::mainWindow->actionSelector, SIGNAL(triggered(bool)), this, SLOT(onTriggeredAction(bool)));
}
void UBBoardView::onTriggeredAction(bool checked)
{
Q_UNUSED(checked);
QList<QGraphicsItem*> it = scene()->selectedItems();
foreach(QGraphicsItem* i, it){
i->setSelected(false);
}
}
...@@ -94,7 +94,6 @@ class UBBoardView : public QGraphicsView ...@@ -94,7 +94,6 @@ class UBBoardView : public QGraphicsView
private: private:
void init(); void init();
void connectToStylusPalette();
inline bool shouldDisplayItem(QGraphicsItem *item) inline bool shouldDisplayItem(QGraphicsItem *item)
{ {
...@@ -152,7 +151,6 @@ class UBBoardView : public QGraphicsView ...@@ -152,7 +151,6 @@ class UBBoardView : public QGraphicsView
private slots: private slots:
void settingChanged(QVariant newValue); void settingChanged(QVariant newValue);
void onTriggeredAction(bool checked);
public slots: public slots:
......
...@@ -18,8 +18,10 @@ ...@@ -18,8 +18,10 @@
#include "core/UBSettings.h" #include "core/UBSettings.h"
#include "core/UBApplication.h" #include "core/UBApplication.h"
#include "gui/UBMainWindow.h" #include "domain/UBGraphicsScene.h"
#include "board/UBBoardController.h"
#include "gui/UBMainWindow.h"
#include "core/memcheck.h" #include "core/memcheck.h"
UBDrawingController* UBDrawingController::sDrawingController = 0; UBDrawingController* UBDrawingController::sDrawingController = 0;
...@@ -87,6 +89,7 @@ void UBDrawingController::setStylusTool(int tool) ...@@ -87,6 +89,7 @@ void UBDrawingController::setStylusTool(int tool)
{ {
if (tool != mStylusTool) if (tool != mStylusTool)
{ {
UBApplication::boardController->activeScene()->deselectAllItems();
if (mStylusTool == UBStylusTool::Pen || mStylusTool == UBStylusTool::Marker if (mStylusTool == UBStylusTool::Pen || mStylusTool == UBStylusTool::Marker
|| mStylusTool == UBStylusTool::Line) || mStylusTool == UBStylusTool::Line)
{ {
......
...@@ -399,8 +399,8 @@ void UBSettings::init() ...@@ -399,8 +399,8 @@ void UBSettings::init()
libIconSize = new UBSetting(this, "Library", "LibIconSize", defaultLibraryIconSize); libIconSize = new UBSetting(this, "Library", "LibIconSize", defaultLibraryIconSize);
actionGroupText = "Group items"; actionGroupText = tr("Group");
actionUngroupText = "Ungroup items"; actionUngroupText = tr("Ungroup");
} }
......
...@@ -178,6 +178,18 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria ...@@ -178,6 +178,18 @@ QVariant UBGraphicsMediaItem::itemChange(GraphicsItemChange change, const QVaria
return UBGraphicsProxyWidget::itemChange(change, value); return UBGraphicsProxyWidget::itemChange(change, value);
} }
void UBGraphicsMediaItem::setSourceUrl(const QUrl &pSourceUrl)
{
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toString()));
}
UBItem::setSourceUrl(pSourceUrl);
}
void UBGraphicsMediaItem::clearSource() void UBGraphicsMediaItem::clearSource()
{ {
QString path = mediaFileUrl().toLocalFile(); QString path = mediaFileUrl().toLocalFile();
......
...@@ -97,16 +97,7 @@ public: ...@@ -97,16 +97,7 @@ public:
virtual void copyItemParameters(UBItem *copy) const; virtual void copyItemParameters(UBItem *copy) const;
virtual void setSourceUrl(const QUrl &pSourceUrl) virtual void setSourceUrl(const QUrl &pSourceUrl);
{
UBAudioPresentationWidget* pAudioWidget = dynamic_cast<UBAudioPresentationWidget*>(mAudioWidget);
if (pAudioWidget)
{
pAudioWidget->setTitle(UBFileSystemUtils::lastPathComponent(pSourceUrl.toLocalFile()));
}
UBItem::setSourceUrl(pSourceUrl);
}
public slots: public slots:
......
...@@ -2351,6 +2351,7 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent) ...@@ -2351,6 +2351,7 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
default: default:
{ {
item->setSelected(false);
UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item); UBGraphicsItem *ubgi = dynamic_cast<UBGraphicsItem*>(item);
if (0 != ubgi) if (0 != ubgi)
ubgi->remove(); ubgi->remove();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment