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
ef77c53e
Commit
ef77c53e
authored
Aug 30, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' into shiba-dev
parents
d12a2a80
19d31ccc
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
62 additions
and
81 deletions
+62
-81
UBBoardView.cpp
src/board/UBBoardView.cpp
+29
-25
UBBoardView.h
src/board/UBBoardView.h
+1
-0
UBFeaturesController.cpp
src/board/UBFeaturesController.cpp
+23
-24
UBFeaturesController.h
src/board/UBFeaturesController.h
+4
-4
UBFeaturesWidget.cpp
src/gui/UBFeaturesWidget.cpp
+1
-1
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+2
-2
UBWebController.cpp
src/web/UBWebController.cpp
+1
-2
WBBrowserWindow.cpp
src/web/browser/WBBrowserWindow.cpp
+1
-23
No files found.
src/board/UBBoardView.cpp
View file @
ef77c53e
...
...
@@ -75,6 +75,7 @@ UBBoardView::UBBoardView (UBBoardController* pController, QWidget* pParent, bool
,
mIsDragInProgress
(
false
)
,
mMultipleSelectionIsEnabled
(
false
)
,
isControl
(
pIsControl
)
,
mRubberBandInPlayMode
(
false
)
//enables rubberband with play tool
{
init
();
...
...
@@ -1020,38 +1021,41 @@ UBBoardView::mouseMoveEvent (QMouseEvent *event)
return
;
}
if
(
!
movingItem
&&
(
mMouseButtonIsPressed
||
mTabletStylusIsPressed
)
&&
mUBRubberBand
&&
mUBRubberBand
->
isVisible
()
)
{
if
(
currentTool
!=
UBStylusTool
::
Play
||
mRubberBandInPlayMode
)
{
QRect
bandRect
(
mMouseDownPos
,
event
->
pos
());
if
(
!
movingItem
&&
(
mMouseButtonIsPressed
||
mTabletStylusIsPressed
)
&&
mUBRubberBand
&&
mUBRubberBand
->
isVisible
())
{
bandRect
=
bandRect
.
normalized
(
);
QRect
bandRect
(
mMouseDownPos
,
event
->
pos
()
);
mUBRubberBand
->
setGeometry
(
bandRect
);
bandRect
=
bandRect
.
normalized
(
);
QList
<
QGraphicsItem
*>
rubberItems
=
items
(
bandRect
);
foreach
(
QGraphicsItem
*
item
,
mJustSelectedItems
)
{
if
(
!
rubberItems
.
contains
(
item
))
{
item
->
setSelected
(
false
);
mJustSelectedItems
.
remove
(
item
);
}
}
if
(
currentTool
==
UBStylusTool
::
Selector
)
foreach
(
QGraphicsItem
*
item
,
items
(
bandRect
))
{
mUBRubberBand
->
setGeometry
(
bandRect
);
if
(
item
->
type
()
==
UBGraphicsW3CWidgetItem
::
Type
||
item
->
type
()
==
UBGraphicsPixmapItem
::
Type
||
item
->
type
()
==
UBGraphicsMediaItem
::
Type
||
item
->
type
()
==
UBGraphicsSvgItem
::
Type
||
item
->
type
()
==
UBGraphicsTextItem
::
Type
||
item
->
type
()
==
UBGraphicsStrokesGroup
::
Type
||
item
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
)
{
if
(
!
mJustSelectedItems
.
contains
(
item
))
{
item
->
setSelected
(
true
);
mJustSelectedItems
.
insert
(
item
);
QList
<
QGraphicsItem
*>
rubberItems
=
items
(
bandRect
);
foreach
(
QGraphicsItem
*
item
,
mJustSelectedItems
)
{
if
(
!
rubberItems
.
contains
(
item
))
{
item
->
setSelected
(
false
);
mJustSelectedItems
.
remove
(
item
);
}
}
if
(
currentTool
==
UBStylusTool
::
Selector
)
foreach
(
QGraphicsItem
*
item
,
items
(
bandRect
))
{
if
(
item
->
type
()
==
UBGraphicsW3CWidgetItem
::
Type
||
item
->
type
()
==
UBGraphicsPixmapItem
::
Type
||
item
->
type
()
==
UBGraphicsMediaItem
::
Type
||
item
->
type
()
==
UBGraphicsSvgItem
::
Type
||
item
->
type
()
==
UBGraphicsTextItem
::
Type
||
item
->
type
()
==
UBGraphicsStrokesGroup
::
Type
||
item
->
type
()
==
UBGraphicsGroupContainerItem
::
Type
)
{
if
(
!
mJustSelectedItems
.
contains
(
item
))
{
item
->
setSelected
(
true
);
mJustSelectedItems
.
insert
(
item
);
}
}
}
}
}
...
...
src/board/UBBoardView.h
View file @
ef77c53e
...
...
@@ -154,6 +154,7 @@ class UBBoardView : public QGraphicsView
bool
mIsDragInProgress
;
bool
mMultipleSelectionIsEnabled
;
bool
isControl
;
bool
mRubberBandInPlayMode
;
static
bool
hasSelectedParents
(
QGraphicsItem
*
item
);
...
...
src/board/UBFeaturesController.cpp
View file @
ef77c53e
...
...
@@ -36,7 +36,6 @@ const QString UBFeaturesController::webSearchPath = rootPath + "/Web search";
void
UBFeaturesComputingThread
::
scanFS
(
const
QUrl
&
currentPath
,
const
QString
&
currVirtualPath
,
const
QSet
<
QUrl
>
&
pFavoriteSet
)
{
Q_ASSERT
(
QFileInfo
(
currentPath
.
toLocalFile
()).
exists
());
QFileInfoList
fileInfoList
=
UBFileSystemUtils
::
allElementsInDirectory
(
currentPath
.
toLocalFile
());
...
...
@@ -73,16 +72,16 @@ void UBFeaturesComputingThread::scanFS(const QUrl & currentPath, const QString &
}
}
void
UBFeaturesComputingThread
::
scanAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
,
const
QSet
<
QUrl
>
&
pFavoriteSet
)
void
UBFeaturesComputingThread
::
scanAll
(
QList
<
QPair
<
QUrl
,
UBFeature
>
>
pScanningData
,
const
QSet
<
QUrl
>
&
pFavoriteSet
)
{
for
(
int
i
=
0
;
i
<
pScanningData
.
count
();
i
++
)
{
if
(
abort
)
{
return
;
}
QPair
<
QUrl
,
QString
>
curPair
=
pScanningData
.
at
(
i
);
QPair
<
QUrl
,
UBFeature
>
curPair
=
pScanningData
.
at
(
i
);
emit
scanCategory
(
UBFeaturesController
::
categoryNameForVirtualPath
(
curPair
.
second
));
scanFS
(
curPair
.
first
,
curPair
.
second
,
pFavoriteSet
);
emit
scanCategory
(
curPair
.
second
.
getDisplayName
(
));
scanFS
(
curPair
.
first
,
curPair
.
second
.
getFullVirtualPath
()
,
pFavoriteSet
);
}
}
...
...
@@ -109,11 +108,11 @@ int UBFeaturesComputingThread::featuresCount(const QUrl &pPath)
return
noItems
;
}
int
UBFeaturesComputingThread
::
featuresCountAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
)
int
UBFeaturesComputingThread
::
featuresCountAll
(
QList
<
QPair
<
QUrl
,
UBFeature
>
>
pScanningData
)
{
int
noItems
=
0
;
for
(
int
i
=
0
;
i
<
pScanningData
.
count
();
i
++
)
{
QPair
<
QUrl
,
QString
>
curPair
=
pScanningData
.
at
(
i
);
QPair
<
QUrl
,
UBFeature
>
curPair
=
pScanningData
.
at
(
i
);
noItems
+=
featuresCount
(
curPair
.
first
);
}
...
...
@@ -127,7 +126,7 @@ QThread(parent)
abort
=
false
;
}
void
UBFeaturesComputingThread
::
compute
(
const
QList
<
QPair
<
QUrl
,
QString
>
>
&
pScanningData
,
QSet
<
QUrl
>
*
pFavoritesSet
)
void
UBFeaturesComputingThread
::
compute
(
const
QList
<
QPair
<
QUrl
,
UBFeature
>
>
&
pScanningData
,
QSet
<
QUrl
>
*
pFavoritesSet
)
{
QMutexLocker
curLocker
(
&
mMutex
);
...
...
@@ -148,7 +147,7 @@ void UBFeaturesComputingThread::run()
qDebug
()
<<
"Custom thread started execution"
;
mMutex
.
lock
();
QList
<
QPair
<
QUrl
,
QString
>
>
searchData
=
mScanningData
;
QList
<
QPair
<
QUrl
,
UBFeature
>
>
searchData
=
mScanningData
;
QSet
<
QUrl
>
favoriteSet
=
mFavoriteSet
;
mMutex
.
unlock
();
...
...
@@ -339,24 +338,24 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
void
UBFeaturesController
::
startThread
()
{
QList
<
QPair
<
QUrl
,
QString
>
>
computingData
;
QList
<
QPair
<
QUrl
,
UBFeature
>
>
computingData
;
computingData
<<
QPair
<
QUrl
,
QString
>
(
mLibAudiosDirectoryPath
,
audiosPath
)
<<
QPair
<
QUrl
,
QString
>
(
mLibVideosDirectoryPath
,
moviesPath
)
<<
QPair
<
QUrl
,
QString
>
(
mLibAnimationsDirectoryPath
,
flashPath
)
<<
QPair
<
QUrl
,
QString
>
(
mLibPicturesDirectoryPath
,
picturesPath
)
computingData
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibAudiosDirectoryPath
,
audiosElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibVideosDirectoryPath
,
moviesElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibAnimationsDirectoryPath
,
flashElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibPicturesDirectoryPath
,
picturesElement
)
<<
QPair
<
QUrl
,
QString
>
(
mUserInteractiveDirectoryPath
,
appPath
)
<<
QPair
<
QUrl
,
QString
>
(
mUserAudioDirectoryPath
,
audiosPath
)
<<
QPair
<
QUrl
,
QString
>
(
mUserPicturesDirectoryPath
,
picturesPath
)
<<
QPair
<
QUrl
,
QString
>
(
mUserVideoDirectoryPath
,
moviesPath
)
<<
QPair
<
QUrl
,
QString
>
(
mUserAnimationDirectoryPath
,
flashPath
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mUserInteractiveDirectoryPath
,
applicationsElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mUserAudioDirectoryPath
,
audiosElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mUserPicturesDirectoryPath
,
picturesElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mUserVideoDirectoryPath
,
moviesElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mUserAnimationDirectoryPath
,
flashElement
)
<<
QPair
<
QUrl
,
QString
>
(
mLibApplicationsDirectoryPath
,
appPath
)
<<
QPair
<
QUrl
,
QString
>
(
mLibShapesDirectoryPath
,
shapesPath
)
<<
QPair
<
QUrl
,
QString
>
(
mLibInteractiveDirectoryPath
,
interactPath
)
<<
QPair
<
QUrl
,
QString
>
(
trashDirectoryPath
,
trashPath
)
<<
QPair
<
QUrl
,
QString
>
(
mLibSearchDirectoryPath
,
rootPath
+
"/"
+
"Web search"
);
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibApplicationsDirectoryPath
,
applicationsElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibShapesDirectoryPath
,
shapesElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibInteractiveDirectoryPath
,
interactElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
trashDirectoryPath
,
trashElement
)
<<
QPair
<
QUrl
,
UBFeature
>
(
mLibSearchDirectoryPath
,
webSearchElement
);
mCThread
.
compute
(
computingData
,
favoriteSet
);
}
...
...
src/board/UBFeaturesController.h
View file @
ef77c53e
...
...
@@ -33,7 +33,7 @@ class UBFeaturesComputingThread : public QThread
public
:
explicit
UBFeaturesComputingThread
(
QObject
*
parent
=
0
);
virtual
~
UBFeaturesComputingThread
();
void
compute
(
const
QList
<
QPair
<
QUrl
,
QString
>
>
&
pScanningData
,
QSet
<
QUrl
>
*
pFavoritesSet
);
void
compute
(
const
QList
<
QPair
<
QUrl
,
UBFeature
>
>
&
pScanningData
,
QSet
<
QUrl
>
*
pFavoritesSet
);
protected
:
void
run
();
...
...
@@ -51,16 +51,16 @@ public slots:
private
:
void
scanFS
(
const
QUrl
&
currentPath
,
const
QString
&
currVirtualPath
,
const
QSet
<
QUrl
>
&
pFavoriteSet
);
void
scanAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
,
const
QSet
<
QUrl
>
&
pFavoriteSet
);
void
scanAll
(
QList
<
QPair
<
QUrl
,
UBFeature
>
>
pScanningData
,
const
QSet
<
QUrl
>
&
pFavoriteSet
);
int
featuresCount
(
const
QUrl
&
pPath
);
int
featuresCountAll
(
QList
<
QPair
<
QUrl
,
QString
>
>
pScanningData
);
int
featuresCountAll
(
QList
<
QPair
<
QUrl
,
UBFeature
>
>
pScanningData
);
private
:
QMutex
mMutex
;
QWaitCondition
mWaitCondition
;
QUrl
mScanningPath
;
QString
mScanningVirtualPath
;
QList
<
QPair
<
QUrl
,
QString
>
>
mScanningData
;
QList
<
QPair
<
QUrl
,
UBFeature
>
>
mScanningData
;
QSet
<
QUrl
>
mFavoriteSet
;
bool
restart
;
bool
abort
;
...
...
src/gui/UBFeaturesWidget.cpp
View file @
ef77c53e
...
...
@@ -676,7 +676,7 @@ UBFeaturesProgressInfo::UBFeaturesProgressInfo(QWidget *parent) :
void
UBFeaturesProgressInfo
::
setCommmonInfoText
(
const
QString
&
str
)
{
mProgressBar
->
setFormat
(
str
+
tr
(
" load"
)
+
"
(%p%)"
);
mProgressBar
->
setFormat
(
tr
(
"Loading "
)
+
str
+
"
(%p%)"
);
}
void
UBFeaturesProgressInfo
::
setDetailedInfoText
(
const
QString
&
str
)
...
...
src/gui/UBTeacherGuideWidgetsTools.cpp
View file @
ef77c53e
...
...
@@ -189,9 +189,9 @@ QString UBTGAdaptableText::text()
void
UBTGAdaptableText
::
onTextChanged
()
{
qDebug
()
<<
">> onTextChanged CALLED!"
;
//
qDebug() << ">> onTextChanged CALLED!";
qreal
documentSize
=
document
()
->
size
().
height
();
qDebug
()
<<
">> documentSize: "
<<
documentSize
<<
", height: "
<<
height
();
//
qDebug() << ">> documentSize: " << documentSize << ", height: " << height();
if
(
height
()
==
documentSize
+
mBottomMargin
){
return
;
}
...
...
src/web/UBWebController.cpp
View file @
ef77c53e
...
...
@@ -733,6 +733,7 @@ bool UBWebController::isEduMedia(const QUrl& pUrl)
void
UBWebController
::
loadUrl
(
const
QUrl
&
url
)
{
bool
webBrowserAlreadyInstanciated
=
dynamic_cast
<
WBBrowserWindow
*>
(
mStackedWidget
->
widget
(
WebBrowser
))
!=
NULL
;
UBApplication
::
applicationController
->
showInternet
();
if
(
UBSettings
::
settings
()
->
webUseExternalBrowser
->
get
().
toBool
())
{
...
...
@@ -740,8 +741,6 @@ void UBWebController::loadUrl(const QUrl& url)
}
else
{
bool
webBrowserAlreadyInstanciated
=
mStackedWidget
->
widget
(
WebBrowser
)
!=
NULL
;
if
(
!
webBrowserAlreadyInstanciated
)
{
(
*
mCurrentWebBrowser
)
->
loadUrl
(
url
);
}
...
...
src/web/browser/WBBrowserWindow.cpp
View file @
ef77c53e
...
...
@@ -270,28 +270,6 @@ void WBBrowserWindow::setupToolBarForTutorial()
if
(
tb
&&
tb
->
menu
())
tb
->
setMenu
(
NULL
);
}
// mTabWidget->addWebAction(mUniboardMainWindow->actionWebReload, QWebPage::Reload);
// mTabWidget->addWebAction(mUniboardMainWindow->actionStopLoading, QWebPage::Stop);
// mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mTabWidget->lineEditStack());
// mSearchToolBar = new WBToolbarSearch(mWebToolBar);
// mSearchAction = mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mSearchToolBar);
// connect(mSearchToolBar, SIGNAL(search(const QUrl&)), SLOT(loadUrl(const QUrl&)));
// mChaseWidget = new WBChaseWidget(this);
// mWebToolBar->insertWidget(mUniboardMainWindow->actionWebBigger, mChaseWidget);
// mWebToolBar->insertSeparator(mUniboardMainWindow->actionWebBigger);
// connect(mUniboardMainWindow->actionHome, SIGNAL(triggered()), this , SLOT(slotHome()));
// connect(mUniboardMainWindow->actionBookmarks, SIGNAL(triggered()), this , SLOT(bookmarks()));
// connect(mUniboardMainWindow->actionAddBookmark, SIGNAL(triggered()), this , SLOT(addBookmark()));
// connect(mUniboardMainWindow->actionWebBigger, SIGNAL(triggered()), this , SLOT(slotViewZoomIn()));
// connect(mUniboardMainWindow->actionWebSmaller, SIGNAL(triggered()), this , SLOT(slotViewZoomOut()));
mWebToolBar
->
show
();
}
...
...
@@ -662,4 +640,4 @@ void WBBrowserWindow::openActionUrl(QAction *action)
history
->
goToItem
(
history
->
backItems
(
-
1
*
offset
).
first
());
else
if
(
offset
>
0
)
history
->
goToItem
(
history
->
forwardItems
(
history
->
count
()
-
offset
+
1
).
back
());
}
\ No newline at end of file
}
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