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
93f69f80
Commit
93f69f80
authored
Apr 10, 2012
by
Claudio Valerio
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
first new teacher guide implementation
parent
e82d5d88
Changes
27
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
27 changed files
with
1318 additions
and
462 deletions
+1318
-462
UBCFFAdaptor.cpp
plugins/cffadaptor/src/UBCFFAdaptor.cpp
+22
-20
UBBoardPaletteManager.cpp
src/board/UBBoardPaletteManager.cpp
+12
-5
UBBoardPaletteManager.h
src/board/UBBoardPaletteManager.h
+4
-0
UBBoardView.cpp
src/board/UBBoardView.cpp
+80
-82
UBBoardView.h
src/board/UBBoardView.h
+1
-0
UBActionableWidget.cpp
src/customWidgets/UBActionableWidget.cpp
+15
-0
UBActionableWidget.h
src/customWidgets/UBActionableWidget.h
+15
-0
UBDraggableLabel.cpp
src/customWidgets/UBDraggableLabel.cpp
+0
-39
UBDraggableLabel.h
src/customWidgets/UBDraggableLabel.h
+0
-23
UBDraggableMedia.cpp
src/customWidgets/UBDraggableMedia.cpp
+0
-42
UBDraggableMedia.h
src/customWidgets/UBDraggableMedia.h
+0
-19
customWidgets.pri
src/customWidgets/customWidgets.pri
+1
-6
UBDesktopAnnotationController.cpp
src/desktop/UBDesktopAnnotationController.cpp
+0
-38
UBGraphicsItemDelegate.cpp
src/domain/UBGraphicsItemDelegate.cpp
+1
-9
UBActionPalette.cpp
src/gui/UBActionPalette.cpp
+1
-0
UBActionPalette.h
src/gui/UBActionPalette.h
+2
-0
UBDockTeacherGuideWidget.cpp
src/gui/UBDockTeacherGuideWidget.cpp
+45
-0
UBDockTeacherGuideWidget.h
src/gui/UBDockTeacherGuideWidget.h
+39
-0
UBMediaPlayer.cpp
src/gui/UBMediaPlayer.cpp
+17
-149
UBMediaPlayer.h
src/gui/UBMediaPlayer.h
+15
-16
UBTeacherGuideDelegate.cpp
src/gui/UBTeacherGuideDelegate.cpp
+5
-0
UBTeacherGuideDelegate.h
src/gui/UBTeacherGuideDelegate.h
+10
-0
UBTeacherGuideWidget.cpp
src/gui/UBTeacherGuideWidget.cpp
+404
-0
UBTeacherGuideWidget.h
src/gui/UBTeacherGuideWidget.h
+114
-0
UBTeacherGuideWidgetsTools.cpp
src/gui/UBTeacherGuideWidgetsTools.cpp
+361
-0
UBTeacherGuideWidgetsTools.h
src/gui/UBTeacherGuideWidgetsTools.h
+144
-0
gui.pri
src/gui/gui.pri
+10
-14
No files found.
plugins/cffadaptor/src/UBCFFAdaptor.cpp
View file @
93f69f80
...
@@ -639,7 +639,7 @@ QDomElement UBCFFAdaptor::UBToCFFConverter::parseSvgPageSection(const QDomElemen
...
@@ -639,7 +639,7 @@ QDomElement UBCFFAdaptor::UBToCFFConverter::parseSvgPageSection(const QDomElemen
void
UBCFFAdaptor
::
UBToCFFConverter
::
writeQDomElementToXML
(
const
QDomNode
&
node
)
void
UBCFFAdaptor
::
UBToCFFConverter
::
writeQDomElementToXML
(
const
QDomNode
&
node
)
{
{
if
(
!
node
.
isNull
())
if
(
!
node
.
isNull
())
{
if
(
node
.
isText
())
if
(
node
.
isText
())
{
{
mIWBContentWriter
->
writeCharacters
(
node
.
nodeValue
());
mIWBContentWriter
->
writeCharacters
(
node
.
nodeValue
());
...
@@ -662,6 +662,7 @@ void UBCFFAdaptor::UBToCFFConverter::writeQDomElementToXML(const QDomNode &node)
...
@@ -662,6 +662,7 @@ void UBCFFAdaptor::UBToCFFConverter::writeQDomElementToXML(const QDomNode &node)
mIWBContentWriter
->
writeEndElement
();
mIWBContentWriter
->
writeEndElement
();
}
}
}
}
}
bool
UBCFFAdaptor
::
UBToCFFConverter
::
writeExtendedIwbSection
()
bool
UBCFFAdaptor
::
UBToCFFConverter
::
writeExtendedIwbSection
()
...
@@ -1322,7 +1323,7 @@ QDomNode UBCFFAdaptor::UBToCFFConverter::findNodeByTagName(const QDomNode &node,
...
@@ -1322,7 +1323,7 @@ QDomNode UBCFFAdaptor::UBToCFFConverter::findNodeByTagName(const QDomNode &node,
if
(
!
iterNode
.
firstChildElement
().
isNull
())
if
(
!
iterNode
.
firstChildElement
().
isNull
())
{
{
QDomNode
foundNode
=
findNodeByTagName
(
iterNode
.
firstChildElement
(),
tagName
);
QDomNode
foundNode
=
findNodeByTagName
(
iterNode
.
firstChildElement
(),
tagName
);
if
(
!
foundNode
.
isNull
())
if
(
!
foundNode
.
isNull
())
{
if
(
foundNode
.
isElement
())
if
(
foundNode
.
isElement
())
{
{
if
(
tagName
==
foundNode
.
toElement
().
tagName
())
if
(
tagName
==
foundNode
.
toElement
().
tagName
())
...
@@ -1332,6 +1333,7 @@ QDomNode UBCFFAdaptor::UBToCFFConverter::findNodeByTagName(const QDomNode &node,
...
@@ -1332,6 +1333,7 @@ QDomNode UBCFFAdaptor::UBToCFFConverter::findNodeByTagName(const QDomNode &node,
break
;
break
;
}
}
}
}
}
if
(
!
iterNode
.
nextSibling
().
isNull
())
if
(
!
iterNode
.
nextSibling
().
isNull
())
iterNode
=
iterNode
.
nextSibling
();
iterNode
=
iterNode
.
nextSibling
();
...
...
src/board/UBBoardPaletteManager.cpp
View file @
93f69f80
...
@@ -31,6 +31,7 @@
...
@@ -31,6 +31,7 @@
#include "gui/UBZoomPalette.h"
#include "gui/UBZoomPalette.h"
#include "gui/UBActionPalette.h"
#include "gui/UBActionPalette.h"
#include "gui/UBFavoriteToolPalette.h"
#include "gui/UBFavoriteToolPalette.h"
#include "gui/UBDockTeacherGuideWidget.h"
#include "web/UBWebPage.h"
#include "web/UBWebPage.h"
...
@@ -84,6 +85,7 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
...
@@ -84,6 +85,7 @@ UBBoardPaletteManager::UBBoardPaletteManager(QWidget* container, UBBoardControll
,
mpCachePropWidget
(
NULL
)
,
mpCachePropWidget
(
NULL
)
,
mpDownloadWidget
(
NULL
)
,
mpDownloadWidget
(
NULL
)
,
mpDesktopLibWidget
(
NULL
)
,
mpDesktopLibWidget
(
NULL
)
,
mpTeacherGuideWidget
(
NULL
)
,
mDownloadInProgress
(
false
)
,
mDownloadInProgress
(
false
)
{
{
setupPalettes
();
setupPalettes
();
...
@@ -135,6 +137,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
...
@@ -135,6 +137,7 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mpCachePropWidget
=
new
UBCachePropertiesWidget
();
mpCachePropWidget
=
new
UBCachePropertiesWidget
();
mpDownloadWidget
=
new
UBDockDownloadWidget
();
mpDownloadWidget
=
new
UBDockDownloadWidget
();
mpTeacherGuideWidget
=
new
UBDockTeacherGuideWidget
();
// Add the dock palettes
// Add the dock palettes
mLeftPalette
=
new
UBLeftPalette
(
mContainer
);
mLeftPalette
=
new
UBLeftPalette
(
mContainer
);
...
@@ -143,6 +146,9 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
...
@@ -143,6 +146,9 @@ void UBBoardPaletteManager::setupDockPaletteWidgets()
mLeftPalette
->
registerWidget
(
mpPageNavigWidget
);
mLeftPalette
->
registerWidget
(
mpPageNavigWidget
);
mLeftPalette
->
addTab
(
mpPageNavigWidget
);
mLeftPalette
->
addTab
(
mpPageNavigWidget
);
mLeftPalette
->
registerWidget
(
mpTeacherGuideWidget
);
mLeftPalette
->
addTab
(
mpTeacherGuideWidget
);
mLeftPalette
->
connectSignals
();
mLeftPalette
->
connectSignals
();
mRightPalette
=
new
UBRightPalette
(
mContainer
);
mRightPalette
=
new
UBRightPalette
(
mContainer
);
...
@@ -232,6 +238,7 @@ void UBBoardPaletteManager::setupPalettes()
...
@@ -232,6 +238,7 @@ void UBBoardPaletteManager::setupPalettes()
#endif
#endif
}
}
setupDockPaletteWidgets
();
setupDockPaletteWidgets
();
...
...
src/board/UBBoardPaletteManager.h
View file @
93f69f80
...
@@ -40,6 +40,7 @@ class UBServerXMLHttpRequest;
...
@@ -40,6 +40,7 @@ class UBServerXMLHttpRequest;
class
UBKeyboardPalette
;
class
UBKeyboardPalette
;
class
UBMainWindow
;
class
UBMainWindow
;
class
UBApplicationController
;
class
UBApplicationController
;
class
UBDockTeacherGuideWidget
;
class
UBBoardPaletteManager
:
public
QObject
class
UBBoardPaletteManager
:
public
QObject
{
{
...
@@ -52,6 +53,7 @@ class UBBoardPaletteManager : public QObject
...
@@ -52,6 +53,7 @@ class UBBoardPaletteManager : public QObject
void
setupLayout
();
void
setupLayout
();
UBLeftPalette
*
leftPalette
(){
return
mLeftPalette
;}
UBLeftPalette
*
leftPalette
(){
return
mLeftPalette
;}
UBRightPalette
*
rightPalette
(){
return
mRightPalette
;}
UBRightPalette
*
rightPalette
(){
return
mRightPalette
;}
UBStylusPalette
*
stylusPalette
(){
return
mStylusPalette
;}
void
showVirtualKeyboard
(
bool
show
=
true
);
void
showVirtualKeyboard
(
bool
show
=
true
);
void
initPalettesPosAtStartup
();
void
initPalettesPosAtStartup
();
void
connectToDocumentController
();
void
connectToDocumentController
();
...
@@ -134,6 +136,8 @@ class UBBoardPaletteManager : public QObject
...
@@ -134,6 +136,8 @@ class UBBoardPaletteManager : public QObject
// lib widget!
// lib widget!
UBLibWidget
*
mpDesktopLibWidget
;
UBLibWidget
*
mpDesktopLibWidget
;
UBDockTeacherGuideWidget
*
mpTeacherGuideWidget
;
bool
mDownloadInProgress
;
bool
mDownloadInProgress
;
private
slots
:
private
slots
:
...
...
src/board/UBBoardView.cpp
View file @
93f69f80
...
@@ -49,9 +49,6 @@
...
@@ -49,9 +49,6 @@
#include "document/UBDocumentProxy.h"
#include "document/UBDocumentProxy.h"
#include "customWidgets/UBDraggableLabel.h"
#include "customWidgets/UBDraggableMedia.h"
#include "tools/UBGraphicsCompass.h"
#include "tools/UBGraphicsCompass.h"
#include "tools/UBGraphicsCache.h"
#include "tools/UBGraphicsCache.h"
...
@@ -378,8 +375,7 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
...
@@ -378,8 +375,7 @@ void UBBoardView::tabletEvent (QTabletEvent * event)
}
}
void
void
UBBoardView
::
mousePressEvent
(
QMouseEvent
*
event
)
UBBoardView
::
mousePressEvent
(
QMouseEvent
*
event
)
{
{
if
(
isAbsurdPoint
(
event
->
pos
()))
if
(
isAbsurdPoint
(
event
->
pos
()))
{
{
...
@@ -389,8 +385,11 @@ UBBoardView::mousePressEvent (QMouseEvent *event)
...
@@ -389,8 +385,11 @@ UBBoardView::mousePressEvent (QMouseEvent *event)
mMouseDownPos
=
event
->
pos
();
mMouseDownPos
=
event
->
pos
();
emit
clickOnBoard
();
if
(
event
->
button
()
==
Qt
::
LeftButton
&&
isInteractive
())
if
(
event
->
button
()
==
Qt
::
LeftButton
&&
isInteractive
())
{
{
UBStylusTool
::
Enum
currentTool
=
(
UBStylusTool
::
Enum
)
UBDrawingController
::
drawingController
()
->
stylusTool
();
UBStylusTool
::
Enum
currentTool
=
(
UBStylusTool
::
Enum
)
UBDrawingController
::
drawingController
()
->
stylusTool
();
if
(
!
mTabletStylusIsPressed
)
if
(
!
mTabletStylusIsPressed
)
...
@@ -809,8 +808,7 @@ void UBBoardView::dropEvent (QDropEvent *event)
...
@@ -809,8 +808,7 @@ void UBBoardView::dropEvent (QDropEvent *event)
event
->
acceptProposedAction
();
event
->
acceptProposedAction
();
}
else
if
(
!
event
->
source
()
||
dynamic_cast
<
UBThumbnailWidget
*>
(
event
->
source
())
}
else
if
(
!
event
->
source
()
||
dynamic_cast
<
UBThumbnailWidget
*>
(
event
->
source
())
||
dynamic_cast
<
QWebView
*>
(
event
->
source
())
||
dynamic_cast
<
UBDraggableMediaPlayer
*>
(
event
->
source
())
||
dynamic_cast
<
QWebView
*>
(
event
->
source
()))
{
||
dynamic_cast
<
UBDraggableLabel
*>
(
event
->
source
())
||
dynamic_cast
<
UBDraggableMedia
*>
(
event
->
source
()))
{
mController
->
processMimeData
(
event
->
mimeData
(),
mapToScene
(
event
->
pos
()));
mController
->
processMimeData
(
event
->
mimeData
(),
mapToScene
(
event
->
pos
()));
event
->
acceptProposedAction
();
event
->
acceptProposedAction
();
...
...
src/board/UBBoardView.h
View file @
93f69f80
...
@@ -46,6 +46,7 @@ class UBBoardView : public QGraphicsView
...
@@ -46,6 +46,7 @@ class UBBoardView : public QGraphicsView
void
resized
(
QResizeEvent
*
event
);
void
resized
(
QResizeEvent
*
event
);
void
hidden
();
void
hidden
();
void
shown
();
void
shown
();
void
clickOnBoard
();
protected
:
protected
:
...
...
src/customWidgets/UBActionableWidget.cpp
View file @
93f69f80
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QPainter>
#include <QPainter>
#include <QDebug>
#include <QDebug>
...
...
src/customWidgets/UBActionableWidget.h
View file @
93f69f80
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBACTIONABLEWIDGET_H
#ifndef UBACTIONABLEWIDGET_H
#define UBACTIONABLEWIDGET_H
#define UBACTIONABLEWIDGET_H
...
...
src/customWidgets/UBDraggableLabel.cpp
deleted
100644 → 0
View file @
e82d5d88
#include <QMimeData>
#include <QDrag>
#include <QUrl>
#include "UBDraggableLabel.h"
UBDraggableLabel
::
UBDraggableLabel
(
QWidget
*
parent
)
:
QLabel
(
parent
)
{
}
UBDraggableLabel
::~
UBDraggableLabel
()
{
//NOOP
}
void
UBDraggableLabel
::
loadImage
(
QString
imagePath
)
{
mSourcePath
=
imagePath
;
QPixmap
pix
=
QPixmap
(
mSourcePath
);
setPixmap
(
pix
);
setScaledContents
(
true
);
}
void
UBDraggableLabel
::
mousePressEvent
(
QMouseEvent
*
event
)
{
Q_UNUSED
(
event
);
QMimeData
*
mimeData
=
new
QMimeData
;
QList
<
QUrl
>
urls
;
urls
<<
QUrl
::
fromLocalFile
(
mSourcePath
);
mimeData
->
setUrls
(
urls
);
mimeData
->
setText
(
mSourcePath
);
QDrag
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
mimeData
);
drag
->
start
();
}
src/customWidgets/UBDraggableLabel.h
deleted
100644 → 0
View file @
e82d5d88
#ifndef UBDRAGGABLELABEL_H
#define UBDRAGGABLELABEL_H
#include <QLabel>
class
UBDraggableLabel
:
public
QLabel
{
Q_OBJECT
public
:
UBDraggableLabel
(
QWidget
*
parent
=
0
);
~
UBDraggableLabel
();
void
loadImage
(
QString
imagePath
);
signals
:
public
slots
:
protected
:
QString
mSourcePath
;
void
mousePressEvent
(
QMouseEvent
*
event
);
};
#endif // UBDRAGGABLELABEL_H
src/customWidgets/UBDraggableMedia.cpp
deleted
100644 → 0
View file @
e82d5d88
#include <QApplication>
#include <QUrl>
#include "UBDraggableMedia.h"
UBDraggableMedia
::
UBDraggableMedia
(
eMediaType
type
,
QWidget
*
parent
,
const
char
*
name
)
:
UBMediaWidget
(
type
,
parent
,
name
)
{
removeAllActions
();
}
UBDraggableMedia
::~
UBDraggableMedia
()
{
}
void
UBDraggableMedia
::
mousePressEvent
(
QMouseEvent
*
ev
)
{
if
(
Qt
::
LeftButton
==
ev
->
button
()){
mDragStartPos
=
ev
->
pos
();
}
}
void
UBDraggableMedia
::
mouseMoveEvent
(
QMouseEvent
*
ev
)
{
if
(
!
(
ev
->
buttons
()
&
Qt
::
LeftButton
)){
return
;
}
if
((
ev
->
pos
()
-
mDragStartPos
).
manhattanLength
()
<
QApplication
::
startDragDistance
()){
return
;
}
QDrag
*
drag
=
new
QDrag
(
this
);
QMimeData
*
mimeData
=
new
QMimeData
;
QList
<
QUrl
>
urls
;
urls
<<
QUrl
(
mFilePath
);
mimeData
->
setText
(
mFilePath
);
mimeData
->
setUrls
(
urls
);
drag
->
setMimeData
(
mimeData
);
drag
->
exec
(
Qt
::
CopyAction
|
Qt
::
MoveAction
);
}
src/customWidgets/UBDraggableMedia.h
deleted
100644 → 0
View file @
e82d5d88
#ifndef UBDRAGGABLEMEDIA_H
#define UBDRAGGABLEMEDIA_H
#include "UBMediaWidget.h"
class
UBDraggableMedia
:
public
UBMediaWidget
{
public
:
UBDraggableMedia
(
eMediaType
type
=
eMediaType_Video
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBDraggableMedia"
);
~
UBDraggableMedia
();
protected
:
void
mousePressEvent
(
QMouseEvent
*
ev
);
void
mouseMoveEvent
(
QMouseEvent
*
ev
);
private
:
QPoint
mDragStartPos
;
};
#endif // UBDRAGGABLEMEDIA_H
src/customWidgets/customWidgets.pri
View file @
93f69f80
HEADERS += src/customWidgets/UBWidgetList.h \
HEADERS += src/customWidgets/UBWidgetList.h \
src/customWidgets/UBDraggableLabel.h \
src/customWidgets/UBMediaWidget.h \
src/customWidgets/UBMediaWidget.h \
src/globals/UBGlobals.h \
src/customWidgets/UBDraggableMedia.h \
src/customWidgets/UBActionableWidget.h
src/customWidgets/UBActionableWidget.h
SOURCES += src/customWidgets/UBWidgetList.cpp \
SOURCES += src/customWidgets/UBWidgetList.cpp \
src/customWidgets/UBDraggableLabel.cpp \
src/customWidgets/UBMediaWidget.cpp \
src/customWidgets/UBMediaWidget.cpp \
src/customWidgets/UBDraggableMedia.cpp \
src/customWidgets/UBActionableWidget.cpp
src/customWidgets/UBActionableWidget.cpp
src/desktop/UBDesktopAnnotationController.cpp
View file @
93f69f80
...
@@ -761,21 +761,6 @@ void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palet
...
@@ -761,21 +761,6 @@ void UBDesktopAnnotationController::togglePropertyPalette(UBActionPalette *palet
void
UBDesktopAnnotationController
::
switchCursor
(
const
int
tool
)
void
UBDesktopAnnotationController
::
switchCursor
(
const
int
tool
)
{
{
// enum Enum
// {
// Pen = 0,
// Eraser,
// Marker,
// Selector,
// Hand,
// ZoomIn,
// ZoomOut,
// Pointer,
// Line,
// Text,
// Capture
// };
mTransparentDrawingScene
->
setToolCursor
(
tool
);
mTransparentDrawingScene
->
setToolCursor
(
tool
);
mTransparentDrawingView
->
setToolCursor
(
tool
);
mTransparentDrawingView
->
setToolCursor
(
tool
);
}
}
...
@@ -825,17 +810,6 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
...
@@ -825,17 +810,6 @@ void UBDesktopAnnotationController::onDesktopPaletteMaximized()
connect
(
pPointerButton
,
SIGNAL
(
pressed
()),
this
,
SLOT
(
pointerActionPressed
()));
connect
(
pPointerButton
,
SIGNAL
(
pressed
()),
this
,
SLOT
(
pointerActionPressed
()));
connect
(
pPointerButton
,
SIGNAL
(
released
()),
this
,
SLOT
(
pointerActionReleased
()));
connect
(
pPointerButton
,
SIGNAL
(
released
()),
this
,
SLOT
(
pointerActionReleased
()));
}
}
// enum Enum
// {
// Hand,
// ZoomIn,
// ZoomOut,
// Line,
// Text,
// Capture
// };
}
}
/**
/**
...
@@ -871,16 +845,6 @@ void UBDesktopAnnotationController::onDesktopPaletteMinimize()
...
@@ -871,16 +845,6 @@ void UBDesktopAnnotationController::onDesktopPaletteMinimize()
void
UBDesktopAnnotationController
::
TransparentWidgetResized
()
void
UBDesktopAnnotationController
::
TransparentWidgetResized
()
{
{
/*
int rW = UBApplication::boardController->paletteManager()->rightPalette()->width();
int rH_ = UBApplication::boardController->paletteManager()->rightPalette()->height();
int rH = mTransparentDrawingView->height();
UBApplication::boardController->paletteManager()->rightPalette()->resize(rW+1, rH);
// UBApplication::boardController->paletteManager()->rightPalette()->resize(500, 500);
*/
onTransparentWidgetResized
();
onTransparentWidgetResized
();
}
}
...
@@ -899,8 +863,6 @@ void UBDesktopAnnotationController::onTransparentWidgetResized()
...
@@ -899,8 +863,6 @@ void UBDesktopAnnotationController::onTransparentWidgetResized()
UBApplication
::
boardController
->
paletteManager
()
->
leftPalette
()
->
resize
(
lW
+
1
,
rH
);
UBApplication
::
boardController
->
paletteManager
()
->
leftPalette
()
->
resize
(
lW
+
1
,
rH
);
UBApplication
::
boardController
->
paletteManager
()
->
leftPalette
()
->
resize
(
lW
,
rH
);
UBApplication
::
boardController
->
paletteManager
()
->
leftPalette
()
->
resize
(
lW
,
rH
);
// mRightPalette->resize(mRightPalette->width(), mTransparentDrawingView->height());
}
}
void
UBDesktopAnnotationController
::
updateMask
(
bool
bTransparent
)
void
UBDesktopAnnotationController
::
updateMask
(
bool
bTransparent
)
...
...
src/domain/UBGraphicsItemDelegate.cpp
View file @
93f69f80
...
@@ -322,16 +322,8 @@ void UBGraphicsItemDelegate::duplicate()
...
@@ -322,16 +322,8 @@ void UBGraphicsItemDelegate::duplicate()
}
}
void
UBGraphicsItemDelegate
::
increaseZLevel
(
int
delta
)
void
UBGraphicsItemDelegate
::
increaseZLevel
(
int
delta
)
{
{
Q_UNUSED
(
delta
)
qDebug
()
<<
delegated
()
->
scene
()
->
items
().
count
();
qDebug
()
<<
delegated
()
->
scene
()
->
items
().
count
();
// UBGraphicsItem::assignZValue(delegated(), )
// int valueCandidate = delegated()->data(UBGraphicsItemData::ItemOwnZValue).toInt();
// if (delta < 0) {
// } else if (delta > 0) {
// }
}
}
void
UBGraphicsItemDelegate
::
lock
(
bool
locked
)
void
UBGraphicsItemDelegate
::
lock
(
bool
locked
)
...
...
src/gui/UBActionPalette.cpp
View file @
93f69f80
...
@@ -231,6 +231,7 @@ void UBActionPalette::mouseReleaseEvent(QMouseEvent * event)
...
@@ -231,6 +231,7 @@ void UBActionPalette::mouseReleaseEvent(QMouseEvent * event)
void
UBActionPalette
::
actionChanged
()
void
UBActionPalette
::
actionChanged
()
{
{
emit
itemOnActionPaletteChanged
();
for
(
int
i
=
0
;
i
<
mActions
.
length
()
&&
i
<
mButtons
.
length
();
i
++
)
for
(
int
i
=
0
;
i
<
mActions
.
length
()
&&
i
<
mButtons
.
length
();
i
++
)
{
{
mButtons
.
at
(
i
)
->
setVisible
(
mActions
.
at
(
i
)
->
isVisible
());
mButtons
.
at
(
i
)
->
setVisible
(
mActions
.
at
(
i
)
->
isVisible
());
...
...
src/gui/UBActionPalette.h
View file @
93f69f80
...
@@ -56,10 +56,12 @@ class UBActionPalette : public UBFloatingPalette
...
@@ -56,10 +56,12 @@ class UBActionPalette : public UBFloatingPalette
public
slots
:
public
slots
:
void
close
();
void
close
();
signals
:
signals
:
void
closed
();
void
closed
();
void
buttonGroupClicked
(
int
id
);
void
buttonGroupClicked
(
int
id
);
void
customMouseReleased
();
void
customMouseReleased
();
void
itemOnActionPaletteChanged
();
protected
:
protected
:
virtual
void
paintEvent
(
QPaintEvent
*
event
);
virtual
void
paintEvent
(
QPaintEvent
*
event
);
...
...
src/gui/UBDockTeacherGuideWidget.cpp
0 → 100644
View file @
93f69f80
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "core/UBApplication.h"
#include "globals/UBGlobals.h"
#include "UBDockTeacherGuideWidget.h"
#include "UBTeacherGuideWidget.h"
UBDockTeacherGuideWidget
::
UBDockTeacherGuideWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
,
name
)
,
mpTeacherGuideWidget
(
NULL
)
{
mName
=
"TeacherGuide"
;
setAttribute
(
Qt
::
WA_StyledBackground
,
true
);
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
mIconToLeft
=
QPixmap
(
":images/teacher_open.png"
);
mIconToRight
=
QPixmap
(
":images/teacher_close.png"
);
mpLayout
=
new
QVBoxLayout
(
this
);
setLayout
(
mpLayout
);
mpTeacherGuideWidget
=
new
UBTeacherGuideWidget
(
this
);
mpLayout
->
addWidget
(
mpTeacherGuideWidget
);
}
UBDockTeacherGuideWidget
::~
UBDockTeacherGuideWidget
()
{
DELETEPTR
(
mpTeacherGuideWidget
);
DELETEPTR
(
mpLayout
);
}
src/gui/UBDockTeacherGuideWidget.h
0 → 100644
View file @
93f69f80
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBDOCKTEACHERGUIDEWIDGET_H
#define UBDOCKTEACHERGUIDEWIDGET_H
class
QVBoxLayout
;
class
UBTeacherGuideWidget
;
#include "UBDockPaletteWidget.h"
class
UBDockTeacherGuideWidget
:
public
UBDockPaletteWidget
{
Q_OBJECT
public
:
UBDockTeacherGuideWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBDockTeacherGuideWidget"
);
~
UBDockTeacherGuideWidget
();
bool
visibleInMode
(
eUBDockPaletteWidgetMode
mode
){
return
mode
==
eUBDockPaletteWidget_BOARD
;
}
private
:
QVBoxLayout
*
mpLayout
;
UBTeacherGuideWidget
*
mpTeacherGuideWidget
;
};
#endif // UBDOCKTEACHERGUIDEWIDGET_H
src/gui/UBMediaPlayer.cpp
View file @
93f69f80
#include "UBMediaPlayer.h"
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include <QtGui>
#include <QtGui>
#include "UBMediaPlayer.h"
#define SLIDER_RANGE 8
#define SLIDER_RANGE 8
MediaVideoWidget
::
MediaVideoWidget
(
UBMediaPlayer
*
player
,
QWidget
*
parent
)
:
MediaVideoWidget
::
MediaVideoWidget
(
UBMediaPlayer
*
player
,
QWidget
*
parent
)
:
Phonon
::
VideoWidget
(
parent
),
m_player
(
player
)
/*, m_action(this)*/
Phonon
::
VideoWidget
(
parent
),
m_player
(
player
)
/*, m_action(this)*/
{
{
// m_action.setCheckable(true);
//NOOP
// m_action.setChecked(false);
// m_action.setShortcut(QKeySequence( Qt::AltModifier + Qt::Key_Return));
// m_action.setShortcutContext(Qt::WindowShortcut);
// connect(&m_action, SIGNAL(toggled(bool)), SLOT(setFullScreen(bool)));
// addAction(&m_action);
// setAcceptDrops(true);
}
}
void
MediaVideoWidget
::
timerEvent
(
QTimerEvent
*
e
)
void
MediaVideoWidget
::
timerEvent
(
QTimerEvent
*
e
)
...
@@ -41,23 +48,6 @@ UBMediaPlayer::UBMediaPlayer() :
...
@@ -41,23 +48,6 @@ UBMediaPlayer::UBMediaPlayer() :
QSize
buttonSize
(
26
,
20
);
QSize
buttonSize
(
26
,
20
);
// QPushButton *openButton = new QPushButton(this);
//// openButton->setIcon(style()->standardIcon(QStyle::SP_DialogOpenButton));
//// QPalette bpal;
//// QColor arrowcolor = bpal.buttonText().color();
//// if (arrowcolor == Qt::black)
//// arrowcolor = QColor(80, 80, 80);
//// bpal.setBrush(QPalette::ButtonText, arrowcolor);
//// openButton->setPalette(bpal);
// rewindButton = new QPushButton(this);
// rewindButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipBackward));
// forwardButton = new QPushButton(this);
// forwardButton->setIcon(style()->standardIcon(QStyle::SP_MediaSkipForward));
// forwardButton->setEnabled(false);
playButton
=
new
QPushButton
(
this
);
playButton
=
new
QPushButton
(
this
);
playIcon
=
style
()
->
standardIcon
(
QStyle
::
SP_MediaPlay
);
playIcon
=
style
()
->
standardIcon
(
QStyle
::
SP_MediaPlay
);
pauseIcon
=
style
()
->
standardIcon
(
QStyle
::
SP_MediaPause
);
pauseIcon
=
style
()
->
standardIcon
(
QStyle
::
SP_MediaPause
);
...
@@ -69,53 +59,18 @@ UBMediaPlayer::UBMediaPlayer() :
...
@@ -69,53 +59,18 @@ UBMediaPlayer::UBMediaPlayer() :
QVBoxLayout
*
vLayout
=
new
QVBoxLayout
(
this
);
QVBoxLayout
*
vLayout
=
new
QVBoxLayout
(
this
);
vLayout
->
setContentsMargins
(
1
,
1
,
1
,
1
);
vLayout
->
setContentsMargins
(
1
,
1
,
1
,
1
);
// QHBoxLayout *layout = new QHBoxLayout();
// info = new QLabel(this);
// info->setMinimumHeight(70);
// info->setAcceptDrops(false);
// info->setMargin(2);
// info->setFrameStyle(QFrame::StyledPanel | QFrame::Sunken);
// info->setLineWidth(2);
// info->setAutoFillBackground(true);
// QPalette palette;
// palette.setBrush(QPalette::WindowText, Qt::white);
#ifndef Q_WS_MAC
// rewindButton->setMinimumSize(buttonSize);
// forwardButton->setMinimumSize(buttonSize);
playButton
->
setMinimumSize
(
buttonSize
);
#endif
// info->setStyleSheet("border-image:url(:/images/screen.png) ; border-width:3px");
// info->setPalette(palette);
// info->setText(tr("<center>No media</center>"));
// layout->addWidget(rewindButton);
// layout->addWidget(playButton);
// layout->addWidget(forwardButton);
// layout->addStretch();
// vLayout->addWidget(info);
initVideoWindow
();
initVideoWindow
();
vLayout
->
addWidget
(
&
m_videoWindow
);
vLayout
->
addWidget
(
&
m_videoWindow
);
// m_videoWidget->setStyleSheet(QString("background:red;"));
QVBoxLayout
*
buttonPanelLayout
=
new
QVBoxLayout
();
QVBoxLayout
*
buttonPanelLayout
=
new
QVBoxLayout
();
#ifndef Q_WS_WIN
#ifndef Q_WS_WIN
m_videoWindow
.
hide
();
m_videoWindow
.
hide
();
#endif
#endif
// buttonPanelLayout->addLayout(layout);
// timeLabel = new QLabel(this);
progressLabel
=
new
QLabel
(
this
);
progressLabel
=
new
QLabel
(
this
);
QWidget
*
sliderPanel
=
new
QWidget
(
this
);
QWidget
*
sliderPanel
=
new
QWidget
(
this
);
// sliderPanel->setStyleSheet(QString("background:green;"));
QHBoxLayout
*
sliderLayout
=
new
QHBoxLayout
();
QHBoxLayout
*
sliderLayout
=
new
QHBoxLayout
();
// playButton->setStyleSheet(QString("background:yellow;"));
sliderLayout
->
addWidget
(
playButton
);
sliderLayout
->
addWidget
(
playButton
);
sliderLayout
->
addWidget
(
slider
);
sliderLayout
->
addWidget
(
slider
);
// sliderLayout->addWidget(timeLabel);
sliderLayout
->
addWidget
(
progressLabel
);
sliderLayout
->
addWidget
(
progressLabel
);
sliderLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
sliderLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
sliderPanel
->
setLayout
(
sliderLayout
);
sliderPanel
->
setLayout
(
sliderLayout
);
...
@@ -123,11 +78,7 @@ UBMediaPlayer::UBMediaPlayer() :
...
@@ -123,11 +78,7 @@ UBMediaPlayer::UBMediaPlayer() :
buttonPanelLayout
->
addWidget
(
sliderPanel
);
buttonPanelLayout
->
addWidget
(
sliderPanel
);
buttonPanelLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
buttonPanelLayout
->
setContentsMargins
(
0
,
0
,
0
,
0
);
#ifdef Q_OS_MAC
#ifdef Q_OS_MAC
// layout->setSpacing(4);
buttonPanelLayout
->
setSpacing
(
0
);
buttonPanelLayout
->
setSpacing
(
0
);
// info->setMinimumHeight(100);
// info->setFont(QFont("verdana", 15));
// openButton->setFocusPolicy(Qt::NoFocus);
#endif
#endif
QWidget
*
buttonPanelWidget
=
new
QWidget
(
this
);
QWidget
*
buttonPanelWidget
=
new
QWidget
(
this
);
buttonPanelWidget
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Fixed
);
buttonPanelWidget
->
setSizePolicy
(
QSizePolicy
::
Preferred
,
QSizePolicy
::
Fixed
);
...
@@ -138,23 +89,13 @@ UBMediaPlayer::UBMediaPlayer() :
...
@@ -138,23 +89,13 @@ UBMediaPlayer::UBMediaPlayer() :
vLayout
->
addLayout
(
labelLayout
);
vLayout
->
addLayout
(
labelLayout
);
setLayout
(
vLayout
);
setLayout
(
vLayout
);
// Setup signal connections:
// connect(rewindButton, SIGNAL(clicked()), this, SLOT(rewind()));
connect
(
playButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
playPause
()));
connect
(
playButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
playPause
()));
// connect(forwardButton, SIGNAL(clicked()), this, SLOT(forward()));
// connect(&m_MediaObject, SIGNAL(totalTimeChanged(qint64)), this, SLOT(updateTime()));
// connect(&m_MediaObject, SIGNAL(tick(qint64)), this, SLOT(updateTime()));
connect
(
&
m_MediaObject
,
SIGNAL
(
finished
()),
this
,
SLOT
(
finished
()));
connect
(
&
m_MediaObject
,
SIGNAL
(
finished
()),
this
,
SLOT
(
finished
()));
connect
(
&
m_MediaObject
,
SIGNAL
(
stateChanged
(
Phonon
::
State
,
Phonon
::
State
)),
this
,
SLOT
(
stateChanged
(
Phonon
::
State
,
Phonon
::
State
)));
connect
(
&
m_MediaObject
,
SIGNAL
(
stateChanged
(
Phonon
::
State
,
Phonon
::
State
)),
this
,
SLOT
(
stateChanged
(
Phonon
::
State
,
Phonon
::
State
)));
connect
(
&
m_MediaObject
,
SIGNAL
(
bufferStatus
(
int
)),
this
,
SLOT
(
bufferStatus
(
int
)));
connect
(
&
m_MediaObject
,
SIGNAL
(
bufferStatus
(
int
)),
this
,
SLOT
(
bufferStatus
(
int
)));
connect
(
&
m_MediaObject
,
SIGNAL
(
hasVideoChanged
(
bool
)),
this
,
SLOT
(
hasVideoChanged
(
bool
)));
connect
(
&
m_MediaObject
,
SIGNAL
(
hasVideoChanged
(
bool
)),
this
,
SLOT
(
hasVideoChanged
(
bool
)));
// rewindButton->setEnabled(false);
playButton
->
setEnabled
(
false
);
playButton
->
setEnabled
(
false
);
// setAcceptDrops(true);
m_audioOutputPath
=
Phonon
::
createPath
(
&
m_MediaObject
,
&
m_AudioOutput
);
m_audioOutputPath
=
Phonon
::
createPath
(
&
m_MediaObject
,
&
m_AudioOutput
);
Phonon
::
createPath
(
&
m_MediaObject
,
m_videoWidget
);
Phonon
::
createPath
(
&
m_MediaObject
,
m_videoWidget
);
...
@@ -180,7 +121,6 @@ void UBMediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
...
@@ -180,7 +121,6 @@ void UBMediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
case
Phonon
:
:
ErrorState
:
case
Phonon
:
:
ErrorState
:
if
(
m_MediaObject
.
errorType
()
==
Phonon
::
FatalError
)
{
if
(
m_MediaObject
.
errorType
()
==
Phonon
::
FatalError
)
{
playButton
->
setEnabled
(
false
);
playButton
->
setEnabled
(
false
);
// rewindButton->setEnabled(false);
}
else
{
}
else
{
m_MediaObject
.
pause
();
m_MediaObject
.
pause
();
}
}
...
@@ -188,16 +128,13 @@ void UBMediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
...
@@ -188,16 +128,13 @@ void UBMediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
break
;
break
;
case
Phonon
:
:
StoppedState
:
case
Phonon
:
:
StoppedState
:
// m_videoWidget-> (false);
// Fall through
// Fall through
case
Phonon
:
:
PausedState
:
case
Phonon
:
:
PausedState
:
playButton
->
setIcon
(
playIcon
);
playButton
->
setIcon
(
playIcon
);
if
(
m_MediaObject
.
currentSource
().
type
()
!=
Phonon
::
MediaSource
::
Invalid
){
if
(
m_MediaObject
.
currentSource
().
type
()
!=
Phonon
::
MediaSource
::
Invalid
){
playButton
->
setEnabled
(
true
);
playButton
->
setEnabled
(
true
);
// rewindButton->setEnabled(true);
}
else
{
}
else
{
playButton
->
setEnabled
(
false
);
playButton
->
setEnabled
(
false
);
// rewindButton->setEnabled(false);
}
}
break
;
break
;
case
Phonon
:
:
PlayingState
:
case
Phonon
:
:
PlayingState
:
...
@@ -207,10 +144,8 @@ void UBMediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
...
@@ -207,10 +144,8 @@ void UBMediaPlayer::stateChanged(Phonon::State newstate, Phonon::State oldstate)
m_videoWindow
.
show
();
m_videoWindow
.
show
();
// Fall through
// Fall through
case
Phonon
:
:
BufferingState
:
case
Phonon
:
:
BufferingState
:
// rewindButton->setEnabled(true);
break
;
break
;
case
Phonon
:
:
LoadingState
:
case
Phonon
:
:
LoadingState
:
// rewindButton->setEnabled(false);
break
;
break
;
}
}
...
@@ -280,35 +215,6 @@ void UBMediaPlayer::bufferStatus(int percent)
...
@@ -280,35 +215,6 @@ void UBMediaPlayer::bufferStatus(int percent)
}
}
}
}
//void UBMediaPlayer::updateTime()
//{
// long len = m_MediaObject.totalTime();
// long pos = m_MediaObject.currentTime();
// QString timeString;
// if (pos || len)
// {
// int sec = pos/1000;
// int min = sec/60;
// int hour = min/60;
// int msec = pos;
// QTime playTime(hour%60, min%60, sec%60, msec%1000);
// sec = len / 1000;
// min = sec / 60;
// hour = min / 60;
// msec = len;
// QTime stopTime(hour%60, min%60, sec%60, msec%1000);
// QString timeFormat = "m:ss";
// if (hour > 0)
// timeFormat = "h:mm:ss";
// timeString = playTime.toString(timeFormat);
// if (len)
// timeString += " / " + stopTime.toString(timeFormat);
// }
// timeLabel->setText(timeString);
//}
void
UBMediaPlayer
::
rewind
()
void
UBMediaPlayer
::
rewind
()
{
{
m_MediaObject
.
seek
(
0
);
m_MediaObject
.
seek
(
0
);
...
@@ -319,7 +225,6 @@ void UBMediaPlayer::forward()
...
@@ -319,7 +225,6 @@ void UBMediaPlayer::forward()
QList
<
Phonon
::
MediaSource
>
queue
=
m_MediaObject
.
queue
();
QList
<
Phonon
::
MediaSource
>
queue
=
m_MediaObject
.
queue
();
if
(
queue
.
size
()
>
0
)
{
if
(
queue
.
size
()
>
0
)
{
m_MediaObject
.
setCurrentSource
(
queue
[
0
]);
m_MediaObject
.
setCurrentSource
(
queue
[
0
]);
// forwardButton->setEnabled(queue.size() > 1);
m_MediaObject
.
play
();
m_MediaObject
.
play
();
}
}
}
}
...
@@ -343,47 +248,10 @@ void UBMediaPlayer::finished()
...
@@ -343,47 +248,10 @@ void UBMediaPlayer::finished()
void
UBMediaPlayer
::
hasVideoChanged
(
bool
bHasVideo
)
void
UBMediaPlayer
::
hasVideoChanged
(
bool
bHasVideo
)
{
{
// info->setVisible(!bHasVideo);
m_videoWindow
.
setVisible
(
bHasVideo
);
m_videoWindow
.
setVisible
(
bHasVideo
);
}
}
void
UBMediaPlayer
::
resizeEvent
(
QResizeEvent
*
pEvent
)
void
UBMediaPlayer
::
resizeEvent
(
QResizeEvent
*
pEvent
)
{
{
Q_UNUSED
(
pEvent
);
Q_UNUSED
(
pEvent
);
// int origWidth = m_videoWindow.width();
// int origHeight = m_videoWindow.height();
// float scaleFactor = (float)origWidth / (float)width();
// int newWidth = width();
// int newHeigth = origHeight/scaleFactor;
// m_videoWindow.resize(newWidth, newHeigth);
}
//*************************************************************************
UBDraggableMediaPlayer
::
UBDraggableMediaPlayer
()
:
UBMediaPlayer
()
{
// setAcceptDrops(true);
}
void
UBDraggableMediaPlayer
::
setFile
(
const
QString
&
text
)
{
mSourcePath
=
text
;
UBMediaPlayer
::
setFile
(
text
);
}
void
UBDraggableMediaPlayer
::
mousePressEvent
(
QMouseEvent
*
event
)
{
Q_UNUSED
(
event
);
QMimeData
*
mimeData
=
new
QMimeData
;
QList
<
QUrl
>
urls
;
urls
<<
QUrl
::
fromLocalFile
(
mSourcePath
);
mimeData
->
setUrls
(
urls
);
mimeData
->
setText
(
mSourcePath
);
QDrag
*
drag
=
new
QDrag
(
this
);
drag
->
setMimeData
(
mimeData
);
drag
->
start
();
}
}
src/gui/UBMediaPlayer.h
View file @
93f69f80
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBUBMediaPlayer_H
#ifndef UBUBMediaPlayer_H
#define UBUBMediaPlayer_H
#define UBUBMediaPlayer_H
...
@@ -41,7 +56,6 @@ protected:
...
@@ -41,7 +56,6 @@ protected:
private
:
private
:
UBMediaPlayer
*
m_player
;
UBMediaPlayer
*
m_player
;
QBasicTimer
m_timer
;
QBasicTimer
m_timer
;
// QAction m_action;
};
};
class
UBMediaPlayer
:
public
QWidget
class
UBMediaPlayer
:
public
QWidget
...
@@ -58,7 +72,6 @@ public slots:
...
@@ -58,7 +72,6 @@ public slots:
void
openFile
();
void
openFile
();
void
rewind
();
void
rewind
();
void
forward
();
void
forward
();
// void updateTime();
void
finished
();
void
finished
();
void
playPause
();
void
playPause
();
...
@@ -78,12 +91,8 @@ private:
...
@@ -78,12 +91,8 @@ private:
QIcon
playIcon
;
QIcon
playIcon
;
QIcon
pauseIcon
;
QIcon
pauseIcon
;
QPushButton
*
playButton
;
QPushButton
*
playButton
;
// QPushButton *rewindButton;
// QPushButton *forwardButton;
Phonon
::
SeekSlider
*
slider
;
Phonon
::
SeekSlider
*
slider
;
// QLabel *timeLabel;
QLabel
*
progressLabel
;
QLabel
*
progressLabel
;
// QLabel *info;
QWidget
m_videoWindow
;
QWidget
m_videoWindow
;
Phonon
::
MediaObject
m_MediaObject
;
Phonon
::
MediaObject
m_MediaObject
;
...
@@ -92,16 +101,6 @@ private:
...
@@ -92,16 +101,6 @@ private:
Phonon
::
Path
m_audioOutputPath
;
Phonon
::
Path
m_audioOutputPath
;
};
};
class
UBDraggableMediaPlayer
:
public
UBMediaPlayer
{
Q_OBJECT
public
:
UBDraggableMediaPlayer
();
void
setFile
(
const
QString
&
text
);
protected
:
QString
mSourcePath
;
void
mousePressEvent
(
QMouseEvent
*
event
);
};
#endif // UBUBMediaPlayer_H
#endif // UBUBMediaPlayer_H
src/gui/UBTeacherGuideDelegate.cpp
0 → 100644
View file @
93f69f80
#include "UBTeacherGuideDelegate.h"
UBTeacherGuideDelegate
::
UBTeacherGuideDelegate
()
{
}
src/gui/UBTeacherGuideDelegate.h
0 → 100644
View file @
93f69f80
#ifndef UBTEACHERGUIDEDELEGATE_H
#define UBTEACHERGUIDEDELEGATE_H
class
UBTeacherGuideDelegate
{
public
:
UBTeacherGuideDelegate
();
};
#endif // UBTEACHERGUIDEDELEGATE_H
src/gui/UBTeacherGuideWidget.cpp
0 → 100644
View file @
93f69f80
This diff is collapsed.
Click to expand it.
src/gui/UBTeacherGuideWidget.h
0 → 100644
View file @
93f69f80
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBTEACHERGUIDEWIDGET_H
#define UBTEACHERGUIDEWIDGET_H
class
QTreeWidget
;
class
QHeaderView
;
class
QLabel
;
class
QVBoxLayout
;
class
QPushButton
;
#include "UBTeacherGuideWidgetsTools.h"
/***************************************************************************
* class UBTeacherGuideEditionWidget *
***************************************************************************/
class
UBTeacherGuideEditionWidget
:
public
QWidget
{
Q_OBJECT
public
:
explicit
UBTeacherGuideEditionWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTeacherGuideEditionWidget"
);
~
UBTeacherGuideEditionWidget
();
void
cleanData
();
QVector
<
tUBGEElementNode
*>
getData
();
public
slots
:
void
onAddItemClicked
(
QTreeWidgetItem
*
widget
,
int
column
);
private
:
QList
<
QTreeWidgetItem
*>
getChildrenList
(
QTreeWidgetItem
*
widgetItem
);
QVector
<
tUBGEElementNode
*>
getPageAndCommentData
();
QVBoxLayout
*
mpLayout
;
QLabel
*
mpDocumentTitle
;
UBTGAdaptableText
*
mpPageTitle
;
UBTGAdaptableText
*
mpComment
;
QTreeWidget
*
mpTreeWidget
;
QTreeWidgetItem
*
mpRootWidgetItem
;
UBAddItem
*
mpAddAnActionItem
;
UBAddItem
*
mpAddAMediaItem
;
UBAddItem
*
mpAddALinkItem
;
};
/***************************************************************************
* class UBTeacherGuidePresentationWidget *
***************************************************************************/
class
UBTeacherGuidePresentationWidget
:
public
QWidget
{
Q_OBJECT
public
:
explicit
UBTeacherGuidePresentationWidget
(
QWidget
*
parent
,
const
char
*
name
=
"UBTeacherGuidePresentationName"
);
~
UBTeacherGuidePresentationWidget
();
void
showData
(
QVector
<
tUBGEElementNode
*>
data
);
public
slots
:
void
onAddItemClicked
(
QTreeWidgetItem
*
widget
,
int
column
);
private
:
void
createMediaButtonItem
();
UBTGAdaptableText
*
mpPageTitle
;
UBTGAdaptableText
*
mpComment
;
QVBoxLayout
*
mpLayout
;
QHBoxLayout
*
mpButtonTitleLayout
;
QLabel
*
mpDocumentTile
;
QPushButton
*
mpModePushButton
;
QTreeWidget
*
mpTreeWidget
;
QTreeWidgetItem
*
mpRootWidgetItem
;
QTreeWidgetItem
*
mpMediaSwitchItem
;
};
/***************************************************************************
* class UBTeacherGuideWidget *
***************************************************************************/
class
UBTeacherGuideWidget
:
public
QStackedWidget
{
Q_OBJECT
public
:
explicit
UBTeacherGuideWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTeacherGuideWidget"
);
~
UBTeacherGuideWidget
();
public
slots
:
void
changeMode
();
void
showPresentationMode
();
void
connectToStylusPalette
();
private
:
UBTeacherGuideEditionWidget
*
mpEditionWidget
;
UBTeacherGuidePresentationWidget
*
mpPresentationWidget
;
QVector
<
tUBGEElementNode
*>
currentData
;
};
#endif // UBTEACHERGUIDEWIDGET_H
src/gui/UBTeacherGuideWidgetsTools.cpp
0 → 100644
View file @
93f69f80
This diff is collapsed.
Click to expand it.
src/gui/UBTeacherGuideWidgetsTools.h
0 → 100644
View file @
93f69f80
/*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef UBTEACHERGUIDEWIDGETSTOOLS_H
#define UBTEACHERGUIDEWIDGETSTOOLS_H
#include <QObject>
#include <QTreeWidgetItem>
#include <QTextEdit>
#include <QLabel>
#include <QDragEnterEvent>
#include <QDropEvent>
#include <QLineEdit>
#include <QMimeData>
#include <QStackedWidget>
#include <QWebView>
#include "customWidgets/UBMediaWidget.h"
class
QTreeWidget
;
class
QVBoxLayout
;
class
QComboBox
;
class
QTextEdit
;
class
QWidget
;
class
UBTGAdaptableText
;
class
QDomElement
;
typedef
struct
{
QString
type
;
QMap
<
QString
,
QString
>
attributes
;
}
tUBGEElementNode
;
class
iUBTGSavableData
{
public
:
virtual
tUBGEElementNode
*
saveData
()
=
0
;
};
class
UBAddItem
:
public
QTreeWidgetItem
{
public
:
explicit
UBAddItem
(
const
QString
&
strings
,
int
addSubItemWidgetType
,
QTreeWidget
*
parent
=
0
);
~
UBAddItem
();
signals
:
public
slots
:
};
class
UBTGActionWidget
:
public
QWidget
,
public
iUBTGSavableData
{
Q_OBJECT
public
:
explicit
UBTGActionWidget
(
QTreeWidgetItem
*
widget
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBActionWidget"
);
~
UBTGActionWidget
();
void
update
();
tUBGEElementNode
*
saveData
();
public
slots
:
void
onOwnerChange
(
int
ownerId
);
private
:
QVBoxLayout
*
mpLayout
;
QComboBox
*
mpOwner
;
UBTGAdaptableText
*
mpTask
;
protected
:
QTreeWidgetItem
*
mpTreeWidgetItem
;
};
class
UBTGAdaptableText
:
public
QTextEdit
{
Q_OBJECT
public
:
explicit
UBTGAdaptableText
(
QTreeWidgetItem
*
widget
=
0
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTGAdaptableText"
);
void
showText
(
const
QString
&
text
);
void
bottomMargin
(
int
newValue
);
signals
:
public
slots
:
void
onTextChanged
();
private
:
int
mBottomMargin
;
QTreeWidgetItem
*
mpTreeWidgetItem
;
};
class
UBTGMediaWidget
:
public
QStackedWidget
,
public
iUBTGSavableData
{
Q_OBJECT
public
:
UBTGMediaWidget
(
QTreeWidgetItem
*
widget
=
0
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTGMediaWidget"
);
UBTGMediaWidget
(
QString
relativePath
,
QTreeWidgetItem
*
widget
=
0
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTGMediaWidget"
);
~
UBTGMediaWidget
();
tUBGEElementNode
*
saveData
();
protected
:
void
dragEnterEvent
(
QDragEnterEvent
*
event
);
void
dropEvent
(
QDropEvent
*
event
);
void
mousePressEvent
(
QMouseEvent
*
event
);
private
:
void
parseMimeData
(
const
QMimeData
*
pMimeData
);
void
createWorkWidget
(
QString
&
path
);
void
updateSize
();
QTreeWidgetItem
*
mpTreeWidgetItem
;
QLabel
*
mpDropMeWidget
;
QWidget
*
mpWorkWidget
;
QVBoxLayout
*
mpLayout
;
UBTGAdaptableText
*
mpTitle
;
QLabel
*
mpMediaLabelWidget
;
UBMediaWidget
*
mpMediaWidget
;
QWebView
*
mpWebView
;
QString
mRelativePath
;
bool
mIsPresentationMode
;
};
class
UBTGUrlWidget
:
public
QWidget
,
public
iUBTGSavableData
{
Q_OBJECT
public
:
UBTGUrlWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTGUrlWidget"
);
~
UBTGUrlWidget
();
tUBGEElementNode
*
saveData
();
private
:
QVBoxLayout
*
mpLayout
;
QLineEdit
*
mpTitle
;
QLineEdit
*
mpUrl
;
};
#endif // UBTEACHERGUIDEWIDGETSTOOLS_H
src/gui/gui.pri
View file @
93f69f80
...
@@ -46,7 +46,11 @@ HEADERS += src/gui/UBThumbnailView.h \
...
@@ -46,7 +46,11 @@ HEADERS += src/gui/UBThumbnailView.h \
src/gui/UBLibWebView.h \
src/gui/UBLibWebView.h \
src/gui/UBDownloadWidget.h \
src/gui/UBDownloadWidget.h \
src/gui/UBDockDownloadWidget.h \
src/gui/UBDockDownloadWidget.h \
src/gui/UBMediaPlayer.h
src/gui/UBMediaPlayer.h \
src/gui/UBDockTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidget.h \
src/gui/UBTeacherGuideWidgetsTools.h \
src/gui/UBTeacherGuideDelegate.h
SOURCES += src/gui/UBThumbnailView.cpp \
SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBFloatingPalette.cpp \
src/gui/UBFloatingPalette.cpp \
...
@@ -95,7 +99,11 @@ SOURCES += src/gui/UBThumbnailView.cpp \
...
@@ -95,7 +99,11 @@ SOURCES += src/gui/UBThumbnailView.cpp \
src/gui/UBLibWebView.cpp \
src/gui/UBLibWebView.cpp \
src/gui/UBDownloadWidget.cpp \
src/gui/UBDownloadWidget.cpp \
src/gui/UBDockDownloadWidget.cpp \
src/gui/UBDockDownloadWidget.cpp \
src/gui/UBMediaPlayer.cpp
src/gui/UBMediaPlayer.cpp \
src/gui/UBDockTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidget.cpp \
src/gui/UBTeacherGuideWidgetsTools.cpp \
src/gui/UBTeacherGuideDelegate.cpp
win32 {
win32 {
...
@@ -123,15 +131,3 @@ linux-g++-64 {
...
@@ -123,15 +131,3 @@ linux-g++-64 {
SOURCES += src/gui/UBKeyboardPalette_linux.cpp
SOURCES += src/gui/UBKeyboardPalette_linux.cpp
}
}
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