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
fd322cdf
Commit
fd322cdf
authored
13 years ago
by
Mario Izquierdo (mariodebian)
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'upstream/master'
parents
658a1c88
fd9fc419
Changes
10
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
101 additions
and
88 deletions
+101
-88
UBBoardView.cpp
src/board/UBBoardView.cpp
+25
-8
UBBoardView.h
src/board/UBBoardView.h
+2
-0
UBSettings.cpp
src/core/UBSettings.cpp
+1
-0
UBSettings.h
src/core/UBSettings.h
+2
-0
UBGraphicsScene.cpp
src/domain/UBGraphicsScene.cpp
+1
-1
UBGraphicsTextItemDelegate.cpp
src/domain/UBGraphicsTextItemDelegate.cpp
+51
-72
UBGraphicsTextItemDelegate.h
src/domain/UBGraphicsTextItemDelegate.h
+5
-0
UBFileSystemUtils.cpp
src/frameworks/UBFileSystemUtils.cpp
+9
-6
UBDocumentThumbnailWidget.cpp
src/gui/UBDocumentThumbnailWidget.cpp
+2
-0
UBKeyboardPalette.cpp
src/gui/UBKeyboardPalette.cpp
+3
-1
No files found.
src/board/UBBoardView.cpp
View file @
fd322cdf
...
@@ -72,6 +72,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent)
...
@@ -72,6 +72,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent)
,
mController
(
pController
)
,
mController
(
pController
)
,
mIsCreatingTextZone
(
false
)
,
mIsCreatingTextZone
(
false
)
,
mIsCreatingSceneGrabZone
(
false
)
,
mIsCreatingSceneGrabZone
(
false
)
,
mOkOnWidget
(
false
)
{
{
init
();
init
();
...
@@ -738,16 +739,27 @@ void UBBoardView::dragMoveEvent (QDragMoveEvent *event)
...
@@ -738,16 +739,27 @@ void UBBoardView::dragMoveEvent (QDragMoveEvent *event)
QGraphicsItem
*
graphicsItemAtPos
=
itemAt
(
event
->
pos
().
x
(),
event
->
pos
().
y
());
QGraphicsItem
*
graphicsItemAtPos
=
itemAt
(
event
->
pos
().
x
(),
event
->
pos
().
y
());
UBGraphicsWidgetItem
*
graphicsWidget
=
dynamic_cast
<
UBGraphicsWidgetItem
*>
(
graphicsItemAtPos
);
UBGraphicsWidgetItem
*
graphicsWidget
=
dynamic_cast
<
UBGraphicsWidgetItem
*>
(
graphicsItemAtPos
);
if
(
graphicsWidget
&&
graphicsWidget
->
acceptDrops
()){
if
(
graphicsWidget
)
{
if
(
isDropableData
(
event
->
mimeData
()))
{
if
(
graphicsWidget
->
acceptDrops
())
{
if
(
!
mOkOnWidget
)
{
if
(
!
isDropableData
(
event
->
mimeData
()))
{
mOkOnWidget
=
false
;
event
->
ignore
();
return
;
}
else
{
mOkOnWidget
=
true
;
}
}
QPoint
newPoint
(
graphicsWidget
->
mapFromScene
(
mapToScene
(
event
->
pos
())).
toPoint
());
QPoint
newPoint
(
graphicsWidget
->
mapFromScene
(
mapToScene
(
event
->
pos
())).
toPoint
());
QDragMoveEvent
newEvent
(
newPoint
,
event
->
dropAction
(),
event
->
mimeData
(),
event
->
mouseButtons
(),
event
->
keyboardModifiers
());
QDragMoveEvent
newEvent
(
newPoint
,
event
->
dropAction
(),
event
->
mimeData
(),
event
->
mouseButtons
(),
event
->
keyboardModifiers
());
QApplication
::
sendEvent
(
graphicsWidget
->
widgetWebView
(),
&
newEvent
);
QApplication
::
sendEvent
(
graphicsWidget
->
widgetWebView
(),
&
newEvent
);
}
else
{
}
else
{
mOkOnWidget
=
false
;
event
->
ignore
();
event
->
ignore
();
}
}
}
else
{
}
else
{
event
->
acceptProposedAction
();
event
->
acceptProposedAction
();
mOkOnWidget
=
false
;
}
}
}
}
...
@@ -804,6 +816,9 @@ QString UBBoardView::fileExtention(const QString &filename)
...
@@ -804,6 +816,9 @@ QString UBBoardView::fileExtention(const QString &filename)
}
}
QString
UBBoardView
::
typeForExtention
(
const
QString
&
extention
)
QString
UBBoardView
::
typeForExtention
(
const
QString
&
extention
)
{
{
if
(
extention
.
isEmpty
())
return
QString
();
QString
result
=
QString
();
QString
result
=
QString
();
if
(
audioExtentions
.
contains
(
extention
))
{
if
(
audioExtentions
.
contains
(
extention
))
{
...
@@ -812,24 +827,26 @@ QString UBBoardView::typeForExtention(const QString &extention)
...
@@ -812,24 +827,26 @@ QString UBBoardView::typeForExtention(const QString &extention)
result
=
videoAlias
;
result
=
videoAlias
;
}
else
if
(
imageExtentions
.
contains
(
extention
))
{
}
else
if
(
imageExtentions
.
contains
(
extention
))
{
result
=
imageAlias
;
result
=
imageAlias
;
}
else
if
(
htmlExtentions
.
contains
(
extention
))
{
//
} else if (htmlExtentions.contains(extention)) {
result
=
htmlAlias
;
//
result = htmlAlias;
}
}
return
result
;
return
result
;
}
}
bool
UBBoardView
::
isDropableData
(
const
QMimeData
*
pMimeData
)
bool
UBBoardView
::
isDropableData
(
const
QMimeData
*
pMimeData
)
{
{
if
(
pMimeData
->
hasUrls
())
if
(
pMimeData
->
hasUrls
())
{
if
(
!
typeForExtention
(
fileExtention
(
pMimeData
->
urls
().
at
(
0
).
toLocalFile
())).
isNull
())
if
(
!
typeForExtention
(
fileExtention
(
pMimeData
->
urls
().
at
(
0
).
toLocalFile
())).
isNull
())
{
return
true
;
return
true
;
}
}
return
false
;
return
false
;
}
}
void
UBBoardView
::
dropEvent
(
QDropEvent
*
event
)
void
UBBoardView
::
dropEvent
(
QDropEvent
*
event
)
{
{
qDebug
()
<<
event
->
source
()
;
mOkOnWidget
=
false
;
QGraphicsItem
*
graphicsItemAtPos
=
itemAt
(
event
->
pos
().
x
(),
event
->
pos
().
y
());
QGraphicsItem
*
graphicsItemAtPos
=
itemAt
(
event
->
pos
().
x
(),
event
->
pos
().
y
());
UBGraphicsWidgetItem
*
graphicsWidget
=
dynamic_cast
<
UBGraphicsWidgetItem
*>
(
graphicsItemAtPos
);
UBGraphicsWidgetItem
*
graphicsWidget
=
dynamic_cast
<
UBGraphicsWidgetItem
*>
(
graphicsItemAtPos
);
...
...
This diff is collapsed.
Click to expand it.
src/board/UBBoardView.h
View file @
fd322cdf
...
@@ -116,6 +116,8 @@ class UBBoardView : public QGraphicsView
...
@@ -116,6 +116,8 @@ class UBBoardView : public QGraphicsView
bool
isAbsurdPoint
(
QPoint
point
);
bool
isAbsurdPoint
(
QPoint
point
);
bool
mVirtualKeyboardActive
;
bool
mVirtualKeyboardActive
;
bool
mOkOnWidget
;
QString
typeForExtention
(
const
QString
&
extention
);
QString
typeForExtention
(
const
QString
&
extention
);
QString
fileExtention
(
const
QString
&
filename
);
QString
fileExtention
(
const
QString
&
filename
);
...
...
This diff is collapsed.
Click to expand it.
src/core/UBSettings.cpp
View file @
fd322cdf
...
@@ -363,6 +363,7 @@ void UBSettings::init()
...
@@ -363,6 +363,7 @@ void UBSettings::init()
intranetPodcastPublishingUrl
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"PublishingUrl"
,
""
);
intranetPodcastPublishingUrl
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"PublishingUrl"
,
""
);
intranetPodcastAuthor
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"Author"
,
""
);
intranetPodcastAuthor
=
new
UBSetting
(
this
,
"IntranetPodcast"
,
"Author"
,
""
);
KeyboardLocale
=
new
UBSetting
(
this
,
"Board"
,
"StartupKeyboardLocale"
,
0
);
}
}
...
...
This diff is collapsed.
Click to expand it.
src/core/UBSettings.h
View file @
fd322cdf
...
@@ -318,6 +318,8 @@ class UBSettings : public QObject
...
@@ -318,6 +318,8 @@ class UBSettings : public QObject
static int libPaletteWidth;
static int libPaletteWidth;
*/
*/
UBSetting
*
KeyboardLocale
;
public
slots
:
public
slots
:
void
setPenWidthIndex
(
int
index
);
void
setPenWidthIndex
(
int
index
);
...
...
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsScene.cpp
View file @
fd322cdf
...
@@ -1938,7 +1938,7 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
...
@@ -1938,7 +1938,7 @@ void UBGraphicsScene::keyReleaseEvent(QKeyEvent * keyEvent)
QList
<
QGraphicsItem
*>
si
=
selectedItems
();
QList
<
QGraphicsItem
*>
si
=
selectedItems
();
if
(
si
.
size
()
>
0
&&
!
keyEvent
->
isAccepted
(
))
if
(
(
si
.
size
()
>
0
)
&&
(
keyEvent
->
isAccepted
()
))
{
{
#ifdef Q_OS_MAC
#ifdef Q_OS_MAC
if
(
keyEvent
->
key
()
==
Qt
::
Key_Backspace
)
if
(
keyEvent
->
key
()
==
Qt
::
Key_Backspace
)
...
...
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsTextItemDelegate.cpp
View file @
fd322cdf
...
@@ -35,6 +35,7 @@ const int UBGraphicsTextItemDelegate::sMinPointSize = 8;
...
@@ -35,6 +35,7 @@ const int UBGraphicsTextItemDelegate::sMinPointSize = 8;
UBGraphicsTextItemDelegate
::
UBGraphicsTextItemDelegate
(
UBGraphicsTextItem
*
pDelegated
,
QObject
*
parent
)
UBGraphicsTextItemDelegate
::
UBGraphicsTextItemDelegate
(
UBGraphicsTextItem
*
pDelegated
,
QObject
*
parent
)
:
UBGraphicsItemDelegate
(
pDelegated
,
0
,
parent
,
true
)
:
UBGraphicsItemDelegate
(
pDelegated
,
0
,
parent
,
true
)
,
mLastFontPixelSize
(
-
1
)
,
mLastFontPixelSize
(
-
1
)
,
delta
(
5
)
{
{
delegated
()
->
setData
(
UBGraphicsItemData
::
ItemEditable
,
QVariant
(
true
));
delegated
()
->
setData
(
UBGraphicsItemData
::
ItemEditable
,
QVariant
(
true
));
delegated
()
->
setPlainText
(
""
);
delegated
()
->
setPlainText
(
""
);
...
@@ -231,82 +232,12 @@ void UBGraphicsTextItemDelegate::pickColor()
...
@@ -231,82 +232,12 @@ void UBGraphicsTextItemDelegate::pickColor()
void
UBGraphicsTextItemDelegate
::
decreaseSize
()
void
UBGraphicsTextItemDelegate
::
decreaseSize
()
{
{
QTextCursor
cursor
=
delegated
()
->
textCursor
();
ChangeTextSize
(
-
delta
);
QTextCharFormat
textFormat
;
QFont
curFont
=
cursor
.
charFormat
().
font
();
int
pointSize
=
curFont
.
pointSize
();
pointSize
-=
5
;
// QFontInfo fi(delegated()->font());
// int pixelSize = fi.pixelSize();
// if (-1 == mLastFontPixelSize)
// mLastFontPixelSize = pixelSize;
// int newPixelSize = sMinPixelSize;
// while (newPixelSize * 1.5 < pixelSize)
// newPixelSize *= 1.5;
// if (newPixelSize < mLastFontPixelSize && mLastFontPixelSize < pixelSize)
// newPixelSize = mLastFontPixelSize;
// if (pixelSize > newPixelSize)
// {
// QFont font = delegated()->font();
// font.setPixelSize(newPixelSize);
// delegated()->setFont(font);
// UBSettings::settings()->setFontPixelSize(newPixelSize);
// delegated()->document()->adjustSize();
// delegated()->contentsChanged();dddd
// }
curFont
.
setPointSize
(
pointSize
);
textFormat
.
setFont
(
curFont
);
cursor
.
mergeCharFormat
(
textFormat
);
delegated
()
->
setTextCursor
(
cursor
);
UBSettings
::
settings
()
->
setFontPixelSize
(
curFont
.
pixelSize
());
UBSettings
::
settings
()
->
setFontPointSize
(
pointSize
);
delegated
()
->
document
()
->
adjustSize
();
delegated
()
->
setFont
(
curFont
);
}
}
void
UBGraphicsTextItemDelegate
::
increaseSize
()
void
UBGraphicsTextItemDelegate
::
increaseSize
()
{
{
QTextCursor
cursor
=
delegated
()
->
textCursor
();
ChangeTextSize
(
delta
);
QTextCharFormat
textFormat
;
QFont
curFont
=
cursor
.
charFormat
().
font
();
int
pointSize
=
curFont
.
pointSize
();
pointSize
+=
5
;
// QFontInfo fi(cursor.charFormat().font());
// int pixelSize = fi.pixelSize();
// if (-1 == mLastFontPixelSize)
// mLastFontPixelSize = pixelSize;
// int newPixelSize = sMinPixelSize;
// while (newPixelSize <= pixelSize)
// newPixelSize *= 1.5;
// if (pixelSize < mLastFontPixelSize && mLastFontPixelSize < newPixelSize)
// newPixelSize = mLastFontPixelSize;
curFont
.
setPointSize
(
pointSize
);
textFormat
.
setFont
(
curFont
);
cursor
.
mergeCharFormat
(
textFormat
);
delegated
()
->
setTextCursor
(
cursor
);
// UBSettings::settings()->setFontPixelSize(curFont.pixelSize());
UBSettings
::
settings
()
->
setFontPointSize
(
pointSize
);
delegated
()
->
document
()
->
adjustSize
();
delegated
()
->
setFont
(
curFont
);
// delegated()->contentsChanged();
}
}
UBGraphicsTextItem
*
UBGraphicsTextItemDelegate
::
delegated
()
UBGraphicsTextItem
*
UBGraphicsTextItemDelegate
::
delegated
()
...
@@ -349,3 +280,51 @@ void UBGraphicsTextItemDelegate::positionHandles()
...
@@ -349,3 +280,51 @@ void UBGraphicsTextItemDelegate::positionHandles()
UBGraphicsItemDelegate
::
positionHandles
();
UBGraphicsItemDelegate
::
positionHandles
();
setEditable
(
isEditable
());
setEditable
(
isEditable
());
}
}
void
UBGraphicsTextItemDelegate
::
ChangeTextSize
(
int
delta
)
{
if
(
0
==
delta
)
return
;
QTextCursor
cursor
=
delegated
()
->
textCursor
();
QTextCharFormat
textFormat
;
int
anchorPos
=
cursor
.
anchor
();
int
cursorPos
=
cursor
.
position
();
if
(
0
==
anchorPos
-
cursorPos
)
{
cursor
.
setPosition
(
0
,
QTextCursor
::
MoveAnchor
);
cursor
.
setPosition
(
cursor
.
document
()
->
characterCount
()
-
1
,
QTextCursor
::
KeepAnchor
);
}
int
startPos
=
qMin
(
cursor
.
anchor
(),
cursor
.
position
());
int
endPos
=
qMax
(
cursor
.
anchor
(),
cursor
.
position
());
for
(
int
i
=
startPos
;
i
<
endPos
;
i
++
)
{
// selecting single symbol
cursor
.
setPosition
(
i
,
QTextCursor
::
MoveAnchor
);
cursor
.
setPosition
(
i
+
1
,
QTextCursor
::
KeepAnchor
);
//setting new parameners
QFont
curFont
=
cursor
.
charFormat
().
font
();
int
pointSize
=
curFont
.
pointSize
()
+
delta
;
curFont
.
setPointSize
(
pointSize
);
textFormat
.
setFont
(
curFont
);
cursor
.
mergeCharFormat
(
textFormat
);
delegated
()
->
setTextCursor
(
cursor
);
UBSettings
::
settings
()
->
setFontPointSize
(
pointSize
);
delegated
()
->
document
()
->
adjustSize
();
delegated
()
->
setFont
(
curFont
);
}
//returning initial selection
cursor
.
setPosition
(
anchorPos
,
QTextCursor
::
MoveAnchor
);
cursor
.
setPosition
(
cursorPos
,
QTextCursor
::
KeepAnchor
);
delegated
()
->
setTextCursor
(
cursor
);
}
This diff is collapsed.
Click to expand it.
src/domain/UBGraphicsTextItemDelegate.h
View file @
fd322cdf
...
@@ -61,6 +61,8 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
...
@@ -61,6 +61,8 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
private
:
private
:
void
customize
(
QFontDialog
&
fontDialog
);
void
customize
(
QFontDialog
&
fontDialog
);
void
ChangeTextSize
(
int
delta
);
QFont
createDefaultFont
();
QFont
createDefaultFont
();
QAction
*
mEditableAction
;
QAction
*
mEditableAction
;
...
@@ -72,6 +74,9 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
...
@@ -72,6 +74,9 @@ class UBGraphicsTextItemDelegate : public UBGraphicsItemDelegate
void
decreaseSize
();
void
decreaseSize
();
void
increaseSize
();
void
increaseSize
();
private
:
const
int
delta
;
};
};
#endif
/* UBGRAPHICSTEXTITEMDELEGATE_H_ */
#endif
/* UBGRAPHICSTEXTITEMDELEGATE_H_ */
This diff is collapsed.
Click to expand it.
src/frameworks/UBFileSystemUtils.cpp
View file @
fd322cdf
...
@@ -60,20 +60,23 @@ bool UBFileSystemUtils::copyFile(const QString &source, const QString &Destinati
...
@@ -60,20 +60,23 @@ bool UBFileSystemUtils::copyFile(const QString &source, const QString &Destinati
qDebug
()
<<
"file"
<<
source
<<
"does not present in fs"
;
qDebug
()
<<
"file"
<<
source
<<
"does not present in fs"
;
return
false
;
return
false
;
}
}
if
(
QFile
::
exists
(
Destination
))
{
if
(
QFileInfo
(
Destination
).
isFile
()
&&
overwrite
)
{
QString
normalizedDestination
=
Destination
;
QFile
::
remove
(
Destination
);
if
(
QFile
::
exists
(
normalizedDestination
))
{
if
(
QFileInfo
(
normalizedDestination
).
isFile
()
&&
overwrite
)
{
QFile
::
remove
(
normalizedDestination
);
}
}
}
else
{
}
else
{
int
pos
=
Destination
.
lastIndexOf
(
QDir
::
separator
());
normalizedDestination
=
normalizedDestination
.
replace
(
QString
(
"
\\
"
),
QString
(
"/"
));
int
pos
=
normalizedDestination
.
lastIndexOf
(
"/"
);
if
(
pos
!=
-
1
)
{
if
(
pos
!=
-
1
)
{
QString
newpath
=
Destination
.
left
(
pos
);
QString
newpath
=
normalized
Destination
.
left
(
pos
);
if
(
!
QDir
().
mkpath
(
newpath
))
{
if
(
!
QDir
().
mkpath
(
newpath
))
{
qDebug
()
<<
"can't create a new path at "
<<
newpath
;
qDebug
()
<<
"can't create a new path at "
<<
newpath
;
}
}
}
}
}
}
return
QFile
::
copy
(
source
,
Destination
);
return
QFile
::
copy
(
source
,
normalized
Destination
);
}
}
QString
UBFileSystemUtils
::
defaultTempDirPath
()
QString
UBFileSystemUtils
::
defaultTempDirPath
()
...
...
This diff is collapsed.
Click to expand it.
src/gui/UBDocumentThumbnailWidget.cpp
View file @
fd322cdf
...
@@ -254,4 +254,6 @@ void UBDocumentThumbnailWidget::hightlightItem(int index)
...
@@ -254,4 +254,6 @@ void UBDocumentThumbnailWidget::hightlightItem(int index)
if
(
thumbnail
)
if
(
thumbnail
)
thumbnail
->
highlight
();
thumbnail
->
highlight
();
}
}
selectItemAt
(
index
);
}
}
This diff is collapsed.
Click to expand it.
src/gui/UBKeyboardPalette.cpp
View file @
fd322cdf
...
@@ -54,7 +54,7 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
...
@@ -54,7 +54,7 @@ UBKeyboardPalette::UBKeyboardPalette(QWidget *parent)
createCtrlButtons
();
createCtrlButtons
();
nCurrentLocale
=
0
;
nCurrentLocale
=
UBSettings
::
settings
()
->
KeyboardLocale
->
get
().
toInt
()
;
setInput
(
locales
[
nCurrentLocale
]);
setInput
(
locales
[
nCurrentLocale
]);
setContentsMargins
(
22
,
22
,
22
,
22
);
setContentsMargins
(
22
,
22
,
22
,
22
);
...
@@ -166,6 +166,8 @@ void UBKeyboardPalette::setLocale(int nLocale)
...
@@ -166,6 +166,8 @@ void UBKeyboardPalette::setLocale(int nLocale)
setInput
(
locales
[
nCurrentLocale
]);
setInput
(
locales
[
nCurrentLocale
]);
onLocaleChanged
(
locales
[
nCurrentLocale
]);
onLocaleChanged
(
locales
[
nCurrentLocale
]);
update
();
update
();
UBSettings
::
settings
()
->
KeyboardLocale
->
set
(
nCurrentLocale
);
}
}
emit
localeChanged
(
nLocale
);
emit
localeChanged
(
nLocale
);
}
}
...
...
This diff is collapsed.
Click to expand it.
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