diff --git a/OpenBoard.pro b/OpenBoard.pro index f413da0a..60be1ebf 100644 --- a/OpenBoard.pro +++ b/OpenBoard.pro @@ -11,7 +11,7 @@ CONFIG += debug_and_release \ VERSION_MAJ = 0 VERSION_MIN = 08 VERSION_TYPE = b # a = alpha, b = beta, r = release, other => error -VERSION_PATCH = 01 +VERSION_PATCH = 02 VERSION = "$${VERSION_MAJ}.$${VERSION_MIN}.$${VERSION_TYPE}.$${VERSION_PATCH}" VERSION = $$replace(VERSION, "\\.r", "") diff --git a/buildDebianPackage.sh b/buildDebianPackage.sh index 09690e6f..be70cfd5 100755 --- a/buildDebianPackage.sh +++ b/buildDebianPackage.sh @@ -132,6 +132,14 @@ buildImporter(){ IMPORTER_NAME="OpenBoardImporter" checkDir $IMPORTER_DIR cd ${IMPORTER_DIR} + + rm moc_* + rm -rf debug release + rm *.o + + git reset --hard + git pull + $QMAKE_PATH ${IMPORTER_NAME}.pro make clean make -j4 diff --git a/release.macx.sh b/release.macx.sh index 1ea9576d..edd15daf 100755 --- a/release.macx.sh +++ b/release.macx.sh @@ -90,6 +90,12 @@ function addImporter { fi cd ${importerDir} + git reset --hard + git pull + rm -rf ${importerName}.app + rm moc_* + rm MakeFile* + rm *.o $QMAKE ${importerName}.pro make -j4 $MACDEPLOYQT ${importerName}.app @@ -218,7 +224,7 @@ notify "Creating dmg ..." umount "$VOLUME" 2> /dev/null $DMGUTIL --open --volume="$APPLICATION_NAME" "$DMG" -cp *.pdf "$VOLUME" +#cp *.pdf "$VOLUME" cp -R "$APP" "$VOLUME" ln -s /Applications "$VOLUME" @@ -226,8 +232,7 @@ $DMGUTIL --set --iconsize=96 --toolbar=false --icon=resources/macx/OpenBoard.icn $DMGUTIL --set --x=20 --y=60 --width=580 --height=440 "$VOLUME" $DMGUTIL --set --x=180 --y=120 "$VOLUME/`basename \"$APP\"`" $DMGUTIL --set --x=400 --y=120 "$VOLUME/Applications" -$DMGUTIL --set --x=180 --y=280 "$VOLUME/ReleaseNotes.pdf" -$DMGUTIL --set --x=400 --y=280 "$VOLUME/JournalDesModifications.pdf" +#$DMGUTIL --set --x=180 --y=280 "$VOLUME/ReleaseNotes.pdf" $DMGUTIL --close --volume="$APPLICATION_NAME" "$DMG" diff --git a/release.win7.vc9.bat b/release.win7.vc9.bat index aa5db2b2..22d2fea4 100644 --- a/release.win7.vc9.bat +++ b/release.win7.vc9.bat @@ -44,6 +44,10 @@ IF NOT EXIST "%IMPORTER_PATH%" GOTO EXIT_WITH_ERROR set HOME_DIR="%cd%" cd %IMPORTER_PATH% IF EXIST "release" (del "release\*.*" /Q) +IF EXIST "debug" (del "debug\*.*" /Q) +IF EXIST "MakeFile" (del "MakeFile*" /Q) +IF EXIST "MakeFile" (del "MakeFile*" /Q) +IF EXIST "%IMPORTER_NAME%.exe" (del "%IMPORTER_NAME%.exe" /Q) "%QT_BIN%\qmake.exe" %IMPORTER_NAME%.pro nmake release cd %HOME_DIR% diff --git a/src/board/UBBoardView.cpp b/src/board/UBBoardView.cpp index 003af1f4..7b8ef369 100644 --- a/src/board/UBBoardView.cpp +++ b/src/board/UBBoardView.cpp @@ -349,18 +349,17 @@ void UBBoardView::tabletEvent (QTabletEvent * event) } } - // if event are not Pen events, we drop the tablet stuff and route everything through mouse event - if (currentTool != UBStylusTool::Pen && currentTool != UBStylusTool::Line && currentTool != UBStylusTool::Marker && !mMarkerPressureSensitive){ - event->setAccepted (false); - return; - } - QPointF scenePos = viewportTransform ().inverted ().map (tabletPos); qreal pressure = 1.0; - if (((currentTool == UBStylusTool::Pen || currentTool == UBStylusTool::Line) && mPenPressureSensitive) || (currentTool == UBStylusTool::Marker && mMarkerPressureSensitive)) + if (((currentTool == UBStylusTool::Pen || currentTool == UBStylusTool::Line) && mPenPressureSensitive) || + (currentTool == UBStylusTool::Marker && mMarkerPressureSensitive)) pressure = event->pressure (); - + else{ + //Explanation: rerouting to mouse event + event->setAccepted (false); + return; + } bool acceptEvent = true; #ifdef Q_WS_MAC @@ -534,18 +533,28 @@ Here we determines cases when items should to get mouse press event at pressing case UBGraphicsTriangle::Type: case UBGraphicsCompass::Type: case UBGraphicsCache::Type: + return true; case UBGraphicsDelegateFrame::Type: + if (currentTool == UBStylusTool::Play) + return false; + return true; + case UBGraphicsPixmapItem::Type: + case UBGraphicsSvgItem::Type: + if (currentTool == UBStylusTool::Play) + return true; + if (item->isSelected()) + return true; + else + return false; case DelegateButton::Type: return true; case UBGraphicsMediaItem::Type: return false; - case UBGraphicsSvgItem::Type: - case UBGraphicsPixmapItem::Type: case UBGraphicsTextItem::Type: if (currentTool == UBStylusTool::Play) - return false; + return true; if ((currentTool == UBStylusTool::Selector) && item->isSelected()) return true; if ((currentTool == UBStylusTool::Selector) && item->parentItem() && item->parentItem()->isSelected()) @@ -553,8 +562,13 @@ Here we determines cases when items should to get mouse press event at pressing if (currentTool != UBStylusTool::Selector) return false; break; + + case UBGraphicsItemType::StrokeItemType: + if (currentTool == UBStylusTool::Play) + return true; + break; + // Groups shouldn't reacts on any presses and moves for Play tool. case UBGraphicsGroupContainerItem::Type: - // Groups shouldn't reacts on any presses and moves for Play tool. if(currentTool == UBStylusTool::Play) { movingItem = NULL; @@ -594,6 +608,7 @@ bool UBBoardView::itemShouldReceiveSuspendedMousePressEvent(QGraphicsItem *item) case QGraphicsWebView::Type: return false; case UBGraphicsPixmapItem::Type: + case UBGraphicsSvgItem::Type: case UBGraphicsTextItem::Type: case UBGraphicsWidgetItem::Type: if (currentTool == UBStylusTool::Selector && !item->isSelected() && item->parentItem()) @@ -644,6 +659,8 @@ bool UBBoardView::itemShouldBeMoved(QGraphicsItem *item) case UBGraphicsSvgItem::Type: case UBGraphicsPixmapItem::Type: + if (currentTool == UBStylusTool::Play || !item->isSelected()) + return true; if (item->isSelected()) return false; case UBGraphicsMediaItem::Type: @@ -943,9 +960,6 @@ void UBBoardView::mousePressEvent (QMouseEvent *event) mMouseDownPos = event->pos (); movingItem = scene()->itemAt(this->mapToScene(event->posF().toPoint())); - if (!movingItem) - emit clickOnBoard(); - if (event->button () == Qt::LeftButton && isInteractive()) { int currentTool = (UBStylusTool::Enum)UBDrawingController::drawingController ()->stylusTool (); diff --git a/src/board/UBBoardView.h b/src/board/UBBoardView.h index 7d252c82..641dc01a 100644 --- a/src/board/UBBoardView.h +++ b/src/board/UBBoardView.h @@ -63,7 +63,6 @@ public: signals: void resized(QResizeEvent* event); void shown(); - void clickOnBoard(); void mouseReleased(); protected: diff --git a/src/core/UBDisplayManager.cpp b/src/core/UBDisplayManager.cpp index f1d3a865..ef618193 100644 --- a/src/core/UBDisplayManager.cpp +++ b/src/core/UBDisplayManager.cpp @@ -29,6 +29,7 @@ #include "core/UBSettings.h" #include "board/UBBoardView.h" +#include "board/UBBoardController.h" #include "gui/UBBlackoutWidget.h" @@ -277,7 +278,6 @@ void UBDisplayManager::blackout() } } - void UBDisplayManager::unBlackout() { while (!mBlackoutWidgets.isEmpty()) @@ -287,6 +287,9 @@ void UBDisplayManager::unBlackout() } UBPlatformUtils::fadeDisplayIn(); + + UBApplication::boardController->freezeW3CWidgets(false); + } diff --git a/src/domain/UBGraphicsDelegateFrame.cpp b/src/domain/UBGraphicsDelegateFrame.cpp index dcb36249..3dc2f24c 100644 --- a/src/domain/UBGraphicsDelegateFrame.cpp +++ b/src/domain/UBGraphicsDelegateFrame.cpp @@ -237,9 +237,6 @@ void UBGraphicsDelegateFrame::mousePressEvent(QGraphicsSceneMouseEvent *event) mCurrentTool = toolFromPos(event->pos()); setCursorFromAngle(QString::number((int)mAngle % 360)); event->accept(); - -// if (moving()) -// prepareFramesToMove(getLinkedFrames()); } void UBGraphicsDelegateFrame::setCursorFromAngle(QString angle) diff --git a/src/domain/UBGraphicsItemDelegate.cpp b/src/domain/UBGraphicsItemDelegate.cpp index 0e015cc2..ab73d0ad 100644 --- a/src/domain/UBGraphicsItemDelegate.cpp +++ b/src/domain/UBGraphicsItemDelegate.cpp @@ -1120,8 +1120,7 @@ void MediaTimer::addPoint(QPolygon &a, const QPoint &p) a.setPoint(n, p); } -void MediaTimer::paint(QPainter *p, - const QStyleOptionGraphicsItem *option, QWidget *widget) +void MediaTimer::paint(QPainter *p, const QStyleOptionGraphicsItem *option, QWidget *widget) { Q_UNUSED(option); Q_UNUSED(widget); @@ -1300,10 +1299,6 @@ QPainterPath DelegateMediaControl::shape() const void DelegateMediaControl::positionHandles() { - QRectF selfRect = rect(); - selfRect.setHeight(parentItem()->boundingRect().height()); - setRect(selfRect); - QTime tTotal; tTotal = tTotal.addMSecs(mTotalTimeInMs); mLCDTimerArea.setHeight(parentItem()->boundingRect().height()); @@ -1312,12 +1307,11 @@ void DelegateMediaControl::positionHandles() mDisplayFormat = "ss"; - if (tTotal.minute() > 0) - { - mDisplayFormat = "mm:" + mDisplayFormat; - digitsCount += 3; - timerWidth += mLCDTimerArea.height()*0.5; - } + + //Explanation at least the second and minutes are diplayed + mDisplayFormat = "mm:" + mDisplayFormat; + digitsCount += 3; + timerWidth += mLCDTimerArea.height(); if (tTotal.hour() > 0) { @@ -1330,10 +1324,6 @@ void DelegateMediaControl::positionHandles() mLCDTimerArea.setWidth(timerWidth); lcdTimer->setRect(mLCDTimerArea); - // not the best solution, but it works. - lcdTimer->positionHandles(); - mLCDTimerArea = lcdTimer->rect(); - // ------------------------------------- lcdTimer->setPos(rect().width() - mLCDTimerArea.width(), 0); @@ -1348,6 +1338,7 @@ void DelegateMediaControl::update() QTime tCurrent; tCurrent = tCurrent.addMSecs(mCurrentTimeInMs < 0 ? 0 : mCurrentTimeInMs); + lcdTimer->display(tCurrent.toString(mDisplayFormat)); QGraphicsRectItem::update(); diff --git a/src/domain/UBGraphicsItemDelegate.h b/src/domain/UBGraphicsItemDelegate.h index af776187..fed5ac3b 100644 --- a/src/domain/UBGraphicsItemDelegate.h +++ b/src/domain/UBGraphicsItemDelegate.h @@ -174,7 +174,6 @@ class DelegateMediaControl: public QObject, public QGraphicsRectItem void positionHandles(); void updateTicker(qint64 time); void totalTimeChanged(qint64 newTotalTime); - QSizeF lcdAreaSize() {return mLCDTimerArea.size();} signals: void used(); @@ -286,7 +285,6 @@ class UBGraphicsItemDelegate : public QObject UBGraphicsFlags ubflags() const {return mFlags;} bool testUBFlags(UBGraphicsFlags pf) const {return mFlags & pf;} void setUBFlags(UBGraphicsFlags pf); -// void addUBFlags(UBGraphicsFlags pf) {setUBFlags(ubflags() | pf);} void setUBFlag(UBGraphicsFlags pf, bool set = true); signals: diff --git a/src/domain/UBGraphicsMediaItemDelegate.cpp b/src/domain/UBGraphicsMediaItemDelegate.cpp index 46f5b402..80a97842 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.cpp +++ b/src/domain/UBGraphicsMediaItemDelegate.cpp @@ -44,6 +44,7 @@ UBGraphicsMediaItemDelegate::UBGraphicsMediaItemDelegate(UBGraphicsMediaItem* pD | GF_RESPECT_RATIO | GF_TOOLBAR_USED | GF_SHOW_CONTENT_SOURCE) + , mPlayPauseButton(NULL) , mMedia(pMedia) , mToolBarShowTimer(NULL) , m_iToolBarShowingInterval(5000) @@ -73,6 +74,7 @@ bool UBGraphicsMediaItemDelegate::mousePressEvent(QGraphicsSceneMouseEvent *even { Q_UNUSED(event); mToolBarItem->show(); + positionHandles(); if (mToolBarShowTimer) mToolBarShowTimer->start(); @@ -87,52 +89,50 @@ void UBGraphicsMediaItemDelegate::hideToolBar() void UBGraphicsMediaItemDelegate::buildButtons() { - mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); - connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause())); + if(!mPlayPauseButton){ + mPlayPauseButton = new DelegateButton(":/images/play.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + connect(mPlayPauseButton, SIGNAL(clicked(bool)), this, SLOT(togglePlayPause())); - mStopButton = new DelegateButton(":/images/stop.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); - connect(mStopButton, SIGNAL(clicked(bool)), mMedia, SLOT(stop())); + mStopButton = new DelegateButton(":/images/stop.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + connect(mStopButton, SIGNAL(clicked(bool)), mMedia, SLOT(stop())); - mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem); - mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true); - UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue()); + mMediaControl = new DelegateMediaControl(delegated(), mToolBarItem); + mMediaControl->setFlag(QGraphicsItem::ItemIsSelectable, true); + UBGraphicsItem::assignZValue(mMediaControl, delegated()->zValue()); - if (delegated()->isMuted()) - mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); - else - mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + if (delegated()->isMuted()) + mMuteButton = new DelegateButton(":/images/soundOff.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); + else + mMuteButton = new DelegateButton(":/images/soundOn.svg", mDelegated, mToolBarItem, Qt::TitleBarArea); - connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); - connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image + connect(mMuteButton, SIGNAL(clicked(bool)), delegated(), SLOT(toggleMute())); + connect(mMuteButton, SIGNAL(clicked(bool)), this, SLOT(toggleMute())); // for changing button image - mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton; + mToolBarButtons << mPlayPauseButton << mStopButton << mMuteButton; - mToolBarItem->setItemsOnToolBar(QList() << mPlayPauseButton << mStopButton << mMediaControl << mMuteButton); - mToolBarItem->setVisibleOnBoard(true); - mToolBarItem->setShifting(false); + mToolBarItem->setItemsOnToolBar(QList() << mPlayPauseButton << mStopButton << mMediaControl << mMuteButton ); + mToolBarItem->setVisibleOnBoard(true); + mToolBarItem->setShifting(false); - if (mToolBarShowTimer) - { - connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); - connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); - connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start())); - connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); - } + if (mToolBarShowTimer) + { + connect(mPlayPauseButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); + connect(mStopButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); + connect(mMediaControl, SIGNAL(used()), mToolBarShowTimer, SLOT(start())); + connect(mMuteButton, SIGNAL(clicked(bool)), mToolBarShowTimer, SLOT(start())); + } -// UBGraphicsMediaItem *audioItem = dynamic_cast(mDelegated); -// if (audioItem) -// { -// if (audioItem->getMediaType() == UBGraphicsMediaItem::mediaType_Audio) -// { - positionHandles(); -// } -// } + + positionHandles(); + } } UBGraphicsMediaItemDelegate::~UBGraphicsMediaItemDelegate() { - if (mToolBarShowTimer) + if (mToolBarShowTimer){ delete mToolBarShowTimer; + mToolBarShowTimer = NULL; + } } void UBGraphicsMediaItemDelegate::positionHandles() @@ -144,32 +144,20 @@ void UBGraphicsMediaItemDelegate::positionHandles() { QRectF toolBarRect = mToolBarItem->rect(); - mToolBarItem->setPos(0, delegated()->boundingRect().height()-mToolBarItem->rect().height()); + mToolBarItem->setPos(0, mediaItem->boundingRect().height()-mToolBarItem->rect().height()); - toolBarRect.setWidth(delegated()->boundingRect().width()); + toolBarRect.setWidth(mediaItem->boundingRect().width()); mToolBarItem->show(); - mToolBarItem->setRect(toolBarRect); } - int toolBarMinimumWidth = 0; - int mediaItemWidth = mToolBarItem->boundingRect().width(); + int toolBarButtonsWidth = 0; foreach (DelegateButton* button, mToolBarButtons) - { - mediaItemWidth -= button->boundingRect().width() + mToolBarItem->getElementsPadding(); - toolBarMinimumWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding(); - } - toolBarMinimumWidth += mToolBarItem->boundingRect().height(); - - QWidget* pAudioWidget = delegated()->widget(); - if (pAudioWidget) - { - pAudioWidget->setMinimumSize(toolBarMinimumWidth + (int)mMediaControl->lcdAreaSize().width() + (int)mMediaControl->rect().height(),26); - } + toolBarButtonsWidth += button->boundingRect().width() + mToolBarItem->getElementsPadding(); QRectF mediaItemRect = mMediaControl->rect(); - mediaItemRect.setWidth(mediaItemWidth); + mediaItemRect.setWidth(mediaItem->boundingRect().width() - toolBarButtonsWidth); mediaItemRect.setHeight(mToolBarItem->boundingRect().height()); mMediaControl->setRect(mediaItemRect); diff --git a/src/domain/UBGraphicsMediaItemDelegate.h b/src/domain/UBGraphicsMediaItemDelegate.h index 9ac65c93..5fe8038a 100644 --- a/src/domain/UBGraphicsMediaItemDelegate.h +++ b/src/domain/UBGraphicsMediaItemDelegate.h @@ -81,4 +81,4 @@ class UBGraphicsMediaItemDelegate : public UBGraphicsItemDelegate int m_iToolBarShowingInterval; }; -#endif /* UBGRAPHICSMEDIAITEMDELEGATE_H_ */ \ No newline at end of file +#endif /* UBGRAPHICSMEDIAITEMDELEGATE_H_ */ diff --git a/src/tools/UBGraphicsCompass.cpp b/src/tools/UBGraphicsCompass.cpp index 54fc8758..569a6926 100644 --- a/src/tools/UBGraphicsCompass.cpp +++ b/src/tools/UBGraphicsCompass.cpp @@ -122,6 +122,9 @@ void UBGraphicsCompass::paint(QPainter *painter, const QStyleOptionGraphicsItem Q_UNUSED(styleOption); Q_UNUSED(widget); + painter->setBrush(edgeFillColor()); + + mAntiScaleRatio = 1 / (UBApplication::boardController->systemScaleFactor() * UBApplication::boardController->currentZoom()); QTransform antiScaleTransform; antiScaleTransform.scale(mAntiScaleRatio, mAntiScaleRatio); diff --git a/src/tools/UBGraphicsProtractor.cpp b/src/tools/UBGraphicsProtractor.cpp index e7cd626d..821d1e8e 100644 --- a/src/tools/UBGraphicsProtractor.cpp +++ b/src/tools/UBGraphicsProtractor.cpp @@ -488,7 +488,6 @@ void UBGraphicsProtractor::paintButtons(QPainter *painter) void UBGraphicsProtractor::paintAngleMarker(QPainter *painter) { painter->save(); - painter->translate(rect().center()); painter->rotate(-mStartAngle); painter->translate(-rect().center().x(), -rect().center().y()); diff --git a/src/tools/UBGraphicsRuler.cpp b/src/tools/UBGraphicsRuler.cpp index 1ecaaf2a..7d00d8a5 100644 --- a/src/tools/UBGraphicsRuler.cpp +++ b/src/tools/UBGraphicsRuler.cpp @@ -121,6 +121,7 @@ void UBGraphicsRuler::paint(QPainter *painter, const QStyleOptionGraphicsItem *s painter->setPen(drawColor()); + painter->setBrush(edgeFillColor()); painter->setRenderHint(QPainter::Antialiasing, true); painter->drawRoundedRect(rect(), sRoundingRadius, sRoundingRadius); fillBackground(painter);