Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpenBoard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
lifo
Nicolas Ollinger
OpenBoard
Commits
cb2608fd
Commit
cb2608fd
authored
Oct 12, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
zero warning build on linux
parent
9aa11485
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
45 additions
and
56 deletions
+45
-56
UBSvgSubsetAdaptor.cpp
src/adaptors/UBSvgSubsetAdaptor.cpp
+0
-3
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+15
-16
UBGraphicsDelegateFrame.cpp
src/domain/UBGraphicsDelegateFrame.cpp
+23
-28
UBGraphicsDelegateFrame.h
src/domain/UBGraphicsDelegateFrame.h
+0
-1
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+0
-3
UBToolWidget.cpp
src/gui/UBToolWidget.cpp
+7
-5
No files found.
src/adaptors/UBSvgSubsetAdaptor.cpp
View file @
cb2608fd
...
...
@@ -1002,9 +1002,6 @@ UBGraphicsGroupContainerItem* UBSvgSubsetAdaptor::UBSvgSubsetReader::readGroup()
UBGraphicsGroupContainerItem
*
group
=
new
UBGraphicsGroupContainerItem
();
QMultiMap
<
QString
,
UBGraphicsPolygonItem
*>
strokesGroupsContainer
;
QList
<
QGraphicsItem
*>
groupContainer
;
QString
currentStrokeIdentifier
;
QUuid
groupUuid
=
QUuid
(
mXmlReader
.
attributes
().
value
(
aId
).
toString
());
mXmlReader
.
readNext
();
while
(
!
mXmlReader
.
atEnd
())
...
...
src/board/UBBoardPaletteManager.cpp
View file @
cb2608fd
...
...
@@ -148,8 +148,8 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
// RIGHT palette widgets
#ifndef USE_WEB_WIDGET
mpFeaturesWidget
=
new
UBFeaturesWidget
();
mRightPalette
->
registerWidget
(
mpFeaturesWidget
);
mRightPalette
->
addTab
(
mpFeaturesWidget
);
mRightPalette
->
registerWidget
(
mpFeaturesWidget
);
mRightPalette
->
addTab
(
mpFeaturesWidget
);
#endif
//Do not show deprecated lib widget to prevent collisions. Uncomment to return lib widget
...
...
@@ -332,15 +332,15 @@ void UBBoardPaletteManager::pagePaletteButtonReleased()
{
if
(
mPageButtonPressedTime
.
msecsTo
(
QTime
::
currentTime
())
>
900
)
{
// The palette is reinstanciated because the duplication depends on the current scene
delete
(
mPagePalette
);
mPagePalette
=
0
;
QList
<
QAction
*>
pageActions
;
pageActions
<<
UBApplication
::
mainWindow
->
actionNewPage
;
UBBoardController
*
boardController
=
UBApplication
::
boardController
;
if
(
UBApplication
::
documentController
->
pageCanBeDuplicated
(
UBDocumentContainer
::
pageFromSceneIndex
(
boardController
->
activeSceneIndex
()))){
pageActions
<<
UBApplication
::
mainWindow
->
actionDuplicatePage
;
}
// The palette is reinstanciated because the duplication depends on the current scene
delete
(
mPagePalette
);
mPagePalette
=
0
;
QList
<
QAction
*>
pageActions
;
pageActions
<<
UBApplication
::
mainWindow
->
actionNewPage
;
UBBoardController
*
boardController
=
UBApplication
::
boardController
;
if
(
UBApplication
::
documentController
->
pageCanBeDuplicated
(
UBDocumentContainer
::
pageFromSceneIndex
(
boardController
->
activeSceneIndex
()))){
pageActions
<<
UBApplication
::
mainWindow
->
actionDuplicatePage
;
}
pageActions
<<
UBApplication
::
mainWindow
->
actionImportPage
;
mPagePalette
=
new
UBActionPalette
(
pageActions
,
Qt
::
Horizontal
,
mContainer
);
...
...
@@ -351,9 +351,9 @@ void UBBoardPaletteManager::pagePaletteButtonReleased()
// As we recreate the pagePalette every time, we must reconnect the slots
connect
(
UBApplication
::
mainWindow
->
actionNewPage
,
SIGNAL
(
triggered
()),
mPagePalette
,
SLOT
(
close
()));
connect
(
UBApplication
::
mainWindow
->
actionDuplicatePage
,
SIGNAL
(
triggered
()),
mPagePalette
,
SLOT
(
close
()));
connect
(
UBApplication
::
mainWindow
->
actionImportPage
,
SIGNAL
(
triggered
()),
mPagePalette
,
SLOT
(
close
()));
connect
(
mPagePalette
,
SIGNAL
(
closed
()),
this
,
SLOT
(
pagePaletteClosed
()));
connect
(
UBApplication
::
mainWindow
->
actionDuplicatePage
,
SIGNAL
(
triggered
()),
mPagePalette
,
SLOT
(
close
()));
connect
(
UBApplication
::
mainWindow
->
actionImportPage
,
SIGNAL
(
triggered
()),
mPagePalette
,
SLOT
(
close
()));
connect
(
mPagePalette
,
SIGNAL
(
closed
()),
this
,
SLOT
(
pagePaletteClosed
()));
togglePagePalette
(
true
);
}
...
...
@@ -955,7 +955,7 @@ void UBBoardPaletteManager::changeStylusPaletteOrientation(QVariant var)
bool
bVertical
=
var
.
toBool
();
bool
bVisible
=
mStylusPalette
->
isVisible
();
// Clean the old palette
// Clean the old palette
if
(
NULL
!=
mStylusPalette
)
{
// TODO : check why this line creates a crash in the application.
...
...
@@ -995,7 +995,6 @@ void UBBoardPaletteManager::startDownloads()
mDownloadInProgress
=
true
;
mpDownloadWidget
->
setVisibleState
(
true
);
mRightPalette
->
addTab
(
mpDownloadWidget
);
mpDownloadWidget
;
}
}
...
...
src/domain/UBGraphicsDelegateFrame.cpp
View file @
cb2608fd
...
...
@@ -243,7 +243,7 @@ void UBGraphicsDelegateFrame::setCursorFromAngle(QString angle)
QSize
cursorSize
(
45
,
30
);
QImage
mask_img
(
cursorSize
,
QImage
::
Format_Mono
);
mask_img
.
fill
(
0xff
);
QPainter
mask_ptr
(
&
mask_img
);
...
...
@@ -252,7 +252,7 @@ void UBGraphicsDelegateFrame::setCursorFromAngle(QString angle)
QBitmap
bmpMask
=
QBitmap
::
fromImage
(
mask_img
);
QPixmap
pixCursor
(
cursorSize
);
QPixmap
pixCursor
(
cursorSize
);
pixCursor
.
fill
(
QColor
(
Qt
::
white
));
QPainter
painter
(
&
pixCursor
);
...
...
@@ -293,12 +293,12 @@ QPointF UBGraphicsDelegateFrame::getFixedPointFromPos()
QPointF
fixedPoint
;
if
(
!
moving
()
&&
!
rotating
())
{
if
(
resizingTop
())
if
(
resizingTop
())
{
if
(
mMirrorX
&&
mMirrorY
)
{
if
((
0
<
mAngle
)
&&
(
mAngle
<
90
))
fixedPoint
=
delegated
()
->
sceneBoundingRect
().
topLeft
();
fixedPoint
=
delegated
()
->
sceneBoundingRect
().
topLeft
();
else
fixedPoint
=
delegated
()
->
sceneBoundingRect
().
topRight
();
}
...
...
@@ -310,12 +310,12 @@ QPointF UBGraphicsDelegateFrame::getFixedPointFromPos()
fixedPoint
=
delegated
()
->
sceneBoundingRect
().
bottomLeft
();
}
}
else
if
(
resizingLeft
())
else
if
(
resizingLeft
())
{
if
(
mMirrorX
&&
mMirrorY
)
{
if
((
0
<
mAngle
)
&&
(
mAngle
<
90
))
fixedPoint
=
delegated
()
->
sceneBoundingRect
().
bottomLeft
();
fixedPoint
=
delegated
()
->
sceneBoundingRect
().
bottomLeft
();
else
fixedPoint
=
delegated
()
->
sceneBoundingRect
().
topLeft
();
}
...
...
@@ -337,14 +337,14 @@ QSizeF UBGraphicsDelegateFrame::getResizeVector(qreal moveX, qreal moveY)
qreal
dPosX
=
0
;
qreal
dPosY
=
0
;
if
(
resizingTop
())
if
(
resizingTop
())
{
if
(
mMirrorX
&&
mMirrorY
)
dPosY
=
moveY
;
else
dPosY
=
-
moveY
;
}
else
if
(
resizingLeft
())
else
if
(
resizingLeft
())
{
if
(
mMirrorX
&&
mMirrorY
)
dPosX
=
moveX
;
...
...
@@ -354,7 +354,7 @@ QSizeF UBGraphicsDelegateFrame::getResizeVector(qreal moveX, qreal moveY)
else
if
(
resizingRight
())
dPosX
=
(
mMirrorX
)
?
-
moveX
:
moveX
;
else
if
(
resizingBottom
())
else
if
(
resizingBottom
())
dPosY
=
mMirrorY
?
-
moveY
:
moveY
;
return
QSizeF
(
dPosX
,
dPosY
);
...
...
@@ -363,7 +363,7 @@ QSizeF UBGraphicsDelegateFrame::getResizeVector(qreal moveX, qreal moveY)
QSizeF
UBGraphicsDelegateFrame
::
resizeDelegate
(
qreal
moveX
,
qreal
moveY
)
{
QSizeF
incVector
;
mFixedPoint
=
getFixedPointFromPos
();
mFixedPoint
=
getFixedPointFromPos
();
UBResizableGraphicsItem
*
resizableItem
=
dynamic_cast
<
UBResizableGraphicsItem
*>
(
delegated
());
if
(
resizableItem
)
...
...
@@ -382,15 +382,10 @@ QSizeF UBGraphicsDelegateFrame::resizeDelegate(qreal moveX, qreal moveY)
}
void
UBGraphicsDelegateFrame
::
scaleByPos
(
qreal
scaleX
,
qreal
scaleY
)
{
}
void
UBGraphicsDelegateFrame
::
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
)
{
if
(
None
==
mCurrentTool
)
return
;
return
;
QLineF
move
=
QLineF
(
mStartingPoint
,
event
->
scenePos
());
qreal
moveX
=
move
.
length
()
*
cos
((
move
.
angle
()
-
mAngle
)
*
PI
/
180
);
...
...
@@ -399,7 +394,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
qreal
height
=
delegated
()
->
boundingRect
().
height
()
*
mTotalScaleY
;
if
(
mOperationMode
==
Scaling
)
{
{
if
(
!
rotating
())
{
mTranslateX
=
moveX
;
...
...
@@ -504,7 +499,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
}
}
}
if
(
rotating
())
{
mTranslateX
=
0
;
...
...
@@ -597,7 +592,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
delegated
()
->
setTransform
(
buildTransform
());
}
else
// resizing/resizing horizontally
{
{
if
(
resizingBottomRight
())
{
...
...
@@ -609,9 +604,9 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
else
mCurrentTool
=
ResizeBottom
;
incV
=
resizeDelegate
(
moveX
,
moveY
);
incV
=
resizeDelegate
(
moveX
,
moveY
);
mOriginalSize
+=
incV
;
if
(
mMirrorX
&&
mMirrorY
)
mCurrentTool
=
ResizeLeft
;
else
...
...
@@ -623,7 +618,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mFixedPoint
=
getFixedPointFromPos
();
incH
=
resizeDelegate
(
moveX
,
moveY
);
incH
=
resizeDelegate
(
moveX
,
moveY
);
mOriginalSize
-=
incV
;
mOriginalSize
+=
incH
;
...
...
@@ -631,7 +626,7 @@ void UBGraphicsDelegateFrame::mouseMoveEvent(QGraphicsSceneMouseEvent *event)
mCurrentTool
=
ResizeBottomRight
;
}
else
resizeDelegate
(
moveX
,
moveY
);
resizeDelegate
(
moveX
,
moveY
);
}
event
->
accept
();
}
...
...
@@ -660,11 +655,11 @@ void UBGraphicsDelegateFrame::prepareFramesToMove(QList<UBGraphicsDelegateFrame
foreach
(
UBGraphicsDelegateFrame
*
frame
,
mLinkedFrames
)
{
frame
->
prepareLinkedFrameToMove
();
}
}
}
void
UBGraphicsDelegateFrame
::
prepareLinkedFrameToMove
()
{
{
mDelegate
->
startUndoStep
();
mStartingPoint
=
QPointF
(
0
,
0
);
...
...
@@ -685,12 +680,12 @@ void UBGraphicsDelegateFrame::prepareLinkedFrameToMove()
void
UBGraphicsDelegateFrame
::
moveLinkedItems
(
QLineF
movingVector
,
bool
bLinked
)
{
if
(
bLinked
)
{
{
mCurrentTool
=
Move
;
mTranslateX
=
movingVector
.
dx
();
mTranslateY
=
movingVector
.
dy
();
delegated
()
->
setTransform
(
buildTransform
(),
false
);
}
else
...
...
@@ -777,7 +772,7 @@ void UBGraphicsDelegateFrame::setVisible(bool visible)
void
UBGraphicsDelegateFrame
::
positionHandles
()
{
QRectF
itemRect
=
delegated
()
->
boundingRect
();
if
(
mDelegate
->
getToolBarItem
()
&&
mDelegate
->
getToolBarItem
()
->
isVisibleOnBoard
()
&&
mDelegate
->
getToolBarItem
()
->
isShifting
())
{
...
...
src/domain/UBGraphicsDelegateFrame.h
View file @
cb2608fd
...
...
@@ -40,7 +40,6 @@ class UBGraphicsDelegateFrame: public QGraphicsRectItem, public QObject
QPointF
getFixedPointFromPos
();
QSizeF
getResizeVector
(
qreal
moveX
,
qreal
moveY
);
QSizeF
resizeDelegate
(
qreal
moveX
,
qreal
moveY
);
void
scaleByPos
(
qreal
scaleX
,
qreal
scaleY
);
virtual
void
mouseMoveEvent
(
QGraphicsSceneMouseEvent
*
event
);
virtual
void
mouseReleaseEvent
(
QGraphicsSceneMouseEvent
*
event
);
...
...
src/gui/UBFeaturesWidget.cpp
View file @
cb2608fd
...
...
@@ -234,9 +234,6 @@ void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )
QString
widgetsUrl
=
QUrl
::
fromEncoded
(
metadata
[
"Url"
].
toAscii
()).
toString
()
/*metadata.value("Url", QString())*/
;
QString
widgetsThumbsUrl
=
QUrl
::
fromEncoded
(
metadata
[
"thumbnailUrl"
].
toAscii
()).
toString
();
bool
isLocal
=
QFileInfo
(
widgetsUrl
).
exists
();
QString
strType
=
UBFileSystemUtils
::
mimeTypeFromFileName
(
widgetsUrl
);
UBMimeType
::
Enum
thumbType
=
UBFileSystemUtils
::
mimeTypeFromString
(
strType
);
...
...
src/gui/UBToolWidget.cpp
View file @
cb2608fd
...
...
@@ -34,11 +34,12 @@ QPixmap* UBToolWidget::sUnpinPixmap = 0;
UBToolWidget
::
UBToolWidget
(
const
QUrl
&
pUrl
,
QWidget
*
pParent
)
:
QWidget
(
pParent
,
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
)
,
mWebView
(
0
)
,
mToolWidget
(
0
)
,
mShouldMoveWidget
(
false
)
,
mContentMargin
(
0
)
,
mFrameWidth
(
0
)
,
mWebView
(
0
)
,
mToolWidget
(
0
)
{
int
widgetType
=
UBGraphicsWidgetItem
::
widgetType
(
pUrl
);
if
(
widgetType
==
UBWidgetType
::
Apple
)
...
...
@@ -53,11 +54,12 @@ UBToolWidget::UBToolWidget(const QUrl& pUrl, QWidget *pParent)
UBToolWidget
::
UBToolWidget
(
UBGraphicsWidgetItem
*
pWidget
,
QWidget
*
pParent
)
:
QWidget
(
pParent
,
Qt
::
FramelessWindowHint
|
Qt
::
WindowStaysOnTopHint
)
,
mWebView
(
0
)
,
mToolWidget
(
pWidget
)
,
mShouldMoveWidget
(
false
)
,
mContentMargin
(
0
)
,
mFrameWidth
(
0
)
,
mWebView
(
0
)
,
mToolWidget
(
pWidget
)
{
initialize
();
javaScriptWindowObjectCleared
();
...
...
@@ -92,7 +94,7 @@ void UBToolWidget::initialize()
mWebView
->
installEventFilter
(
this
);
mFrameWidth
=
UBSettings
::
settings
()
->
objectFrameWidth
;
mContentMargin
=
sClosePixmap
->
width
()
/
2
+
mFrameWidth
;
setLayout
(
new
QVBoxLayout
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment