Merge branch 'OEFUniboard' of github.com:stayonshadow/PrivateBoard into OEFUniboard

preferencesAboutTextFull
Didier Clerc 12 years ago
commit 94407ff160
  1. 2
      OpenBoard.pro
  2. 8
      buildDebianPackage.sh
  3. 11
      release.macx.sh
  4. 4
      release.win7.vc9.bat
  5. 44
      src/board/UBBoardView.cpp
  6. 1
      src/board/UBBoardView.h
  7. 5
      src/core/UBDisplayManager.cpp
  8. 3
      src/domain/UBGraphicsDelegateFrame.cpp
  9. 23
      src/domain/UBGraphicsItemDelegate.cpp
  10. 2
      src/domain/UBGraphicsItemDelegate.h
  11. 88
      src/domain/UBGraphicsMediaItemDelegate.cpp
  12. 3
      src/tools/UBGraphicsCompass.cpp
  13. 1
      src/tools/UBGraphicsProtractor.cpp
  14. 1
      src/tools/UBGraphicsRuler.cpp

@ -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", "")

@ -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

@ -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"

@ -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%

@ -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 ();

@ -63,7 +63,6 @@ public:
signals:
void resized(QResizeEvent* event);
void shown();
void clickOnBoard();
void mouseReleased();
protected:

@ -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);
}

@ -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)

@ -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();

@ -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:

@ -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<QGraphicsItem*>() << mPlayPauseButton << mStopButton << mMediaControl << mMuteButton);
mToolBarItem->setVisibleOnBoard(true);
mToolBarItem->setShifting(false);
mToolBarItem->setItemsOnToolBar(QList<QGraphicsItem*>() << 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<UBGraphicsMediaItem*>(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);

@ -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);

@ -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());

@ -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);

Loading…
Cancel
Save