Merging last fixes.

preferencesAboutTextFull
Aleksei Kanash 12 years ago
commit d469951de1
  1. 7
      src/board/UBBoardController.cpp
  2. 12
      src/board/UBBoardView.cpp
  3. 2
      src/desktop/UBDesktopAnnotationController.cpp
  4. 19
      src/domain/UBGraphicsMediaItem.cpp

@ -1041,6 +1041,9 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
return NULL;
}
mActiveScene->deselectAllItems();
if (!sourceUrl.toString().startsWith("file://") && !sourceUrl.toString().startsWith("uniboardTool://"))
showMessage(tr("Download finished"));
@ -1070,8 +1073,8 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
else
{
mActiveScene->scaleToFitDocumentSize(pixItem, true, UBSettings::objectInControlViewMargin);
pixItem->setSelected(true);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
pixItem->setSelected(true);
}
return pixItem;
@ -1090,8 +1093,8 @@ UBItem *UBBoardController::downloadFinished(bool pSuccess, QUrl sourceUrl, QStri
else
{
mActiveScene->scaleToFitDocumentSize(svgItem, true, UBSettings::objectInControlViewMargin);
svgItem->setSelected(true);
UBDrawingController::drawingController()->setStylusTool(UBStylusTool::Selector);
svgItem->setSelected(true);
}
return svgItem;

@ -545,7 +545,6 @@ Here we determines cases when items should to get mouse press event at pressing
break;
// Groups shouldn't reacts on any presses and moves for Play tool.
case UBGraphicsStrokesGroup::Type:
case UBGraphicsGroupContainerItem::Type:
if(currentTool == UBStylusTool::Play)
{
@ -631,7 +630,7 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item)
case UBGraphicsGroupContainerItem::Type:
return true;
case UBGraphicsW3CWidgetItem::Type:
case UBGraphicsWidgetItem::Type:
if(currentTool == UBStylusTool::Selector && item->isSelected())
return false;
if(currentTool == UBStylusTool::Play)
@ -658,10 +657,6 @@ QGraphicsItem* UBBoardView::determineItemToPress(QGraphicsItem *item)
{
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool();
// groups should should be moved instead of strokes groups
if (item->parentItem() && UBGraphicsStrokesGroup::Type == item->type())
return item->parentItem();
// if item is on group and group is not selected - group should take press.
if (UBStylusTool::Selector == currentTool
&& item->parentItem()
@ -685,7 +680,7 @@ QGraphicsItem* UBBoardView::determineItemToMove(QGraphicsItem *item)
UBStylusTool::Enum currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController()->stylusTool();
//W3C widgets should take mouse move events from play tool.
if ((UBStylusTool::Play == currentTool) && (UBGraphicsW3CWidgetItem::Type == item->type()))
if ((UBStylusTool::Play == currentTool) && (UBGraphicsWidgetItem::Type == item->type()))
return item;
// if item is in group
@ -754,6 +749,9 @@ void UBBoardView::handleItemMousePress(QMouseEvent *event)
void UBBoardView::handleItemMouseMove(QMouseEvent *event)
{
if (!movingItem)
return;
// determine item to move (maybee we need to move group of item or his parent.
movingItem = determineItemToMove(movingItem);

@ -658,6 +658,7 @@ void UBDesktopAnnotationController::selectorActionPressed()
void UBDesktopAnnotationController::selectorActionReleased()
{
UBApplication::mainWindow->actionSelector->setChecked(true);
switchCursor(UBStylusTool::Selector);
}
@ -669,6 +670,7 @@ void UBDesktopAnnotationController::pointerActionPressed()
void UBDesktopAnnotationController::pointerActionReleased()
{
UBApplication::mainWindow->actionPointer->setChecked(true);
switchCursor(UBStylusTool::Pointer);
}

@ -73,9 +73,6 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
mMediaObject = new Phonon::MediaObject(this);
setDelegate(new UBGraphicsMediaItemDelegate(this, mMediaObject));
Delegate()->init();
if (pMediaFileUrl.toLocalFile().contains("videos"))
{
mMediaType = mediaType_Video;
@ -91,7 +88,6 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
mVideoWidget->setMinimumSize(140,26);
setWidget(mVideoWidget);
haveLinkedImage = true;
}
else
@ -111,7 +107,7 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
mAudioWidget->resize(320,26+3*borderSize);
mAudioWidget->setMinimumSize(150,26+borderSize);
setWidget(mAudioWidget);
haveLinkedImage = false;
}
@ -120,6 +116,19 @@ UBGraphicsMediaItem::UBGraphicsMediaItem(const QUrl& pMediaFileUrl, QGraphicsIte
mSource = Phonon::MediaSource(pMediaFileUrl);
mMediaObject->setCurrentSource(mSource);
// we should create delegate after media objects because delegate uses his properties at creation.
setDelegate(new UBGraphicsMediaItemDelegate(this, mMediaObject));
// delegate should be created earler because we setWidget calls resize event for graphics proxy widgt.
// resize uses delegate.
if (mediaType_Video == mMediaType)
setWidget(mVideoWidget);
else
setWidget(mAudioWidget);
// media widget should be created and placed on proxy widget here.
Delegate()->init();
if (mediaType_Audio == mMediaType)
Delegate()->frame()->setOperationMode(UBGraphicsDelegateFrame::ResizingHorizontally);
else

Loading…
Cancel
Save