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
15f89fc7
Commit
15f89fc7
authored
13 years ago
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Partial commit
parent
f5f1f835
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
244 additions
and
240 deletions
+244
-240
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+178
-234
UBTeacherBarWidget.h
src/gui/UBTeacherBarWidget.h
+66
-6
No files found.
src/gui/UBTeacherBarWidget.cpp
View file @
15f89fc7
...
@@ -17,23 +17,18 @@
...
@@ -17,23 +17,18 @@
#include "customWidgets/UBDraggableLabel.h"
#include "customWidgets/UBDraggableLabel.h"
#include "customWidgets/UBMediaWidget.h"
#include "customWidgets/UBMediaWidget.h"
#include "customWidgets/UBGlobals.h"
#include "core/memcheck.h"
#include "core/memcheck.h"
UBTeacherBarWidget
::
UBTeacherBarWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
)
UBTeacherBarWidget
::
UBTeacherBarWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
UBDockPaletteWidget
(
parent
)
,
mpLayout
(
NULL
)
,
mpLayout
(
NULL
)
,
mpTitleLayout
(
NULL
)
,
mpTitleLayout
(
NULL
)
,
mpDurationLayout
(
NULL
)
,
mpTitleLabel
(
NULL
)
,
mpTitleLabel
(
NULL
)
,
mpDurationLabel
(
NULL
)
,
mpTitle
(
NULL
)
,
mpTitle
(
NULL
)
,
mpMediaLabel
(
NULL
)
,
mpMediaLabel
(
NULL
)
,
mpContainer
(
NULL
)
,
mpContainer
(
NULL
)
,
mpContainerLayout
(
NULL
)
,
mpContainerLayout
(
NULL
)
,
mpDuration1
(
NULL
)
,
mpDuration2
(
NULL
)
,
mpDuration3
(
NULL
)
,
mpDurationButtons
(
NULL
)
,
mpActionLabel
(
NULL
)
,
mpActionLabel
(
NULL
)
,
mpActions
(
NULL
)
,
mpActions
(
NULL
)
,
mpActionButton
(
NULL
)
,
mpActionButton
(
NULL
)
...
@@ -47,6 +42,8 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
...
@@ -47,6 +42,8 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
,
mpStackWidget
(
NULL
)
,
mpStackWidget
(
NULL
)
,
mpPreview
(
NULL
)
,
mpPreview
(
NULL
)
,
mpMediaContainer
(
NULL
)
,
mpMediaContainer
(
NULL
)
,
mpDocPreviewWidget
(
NULL
)
,
mpDocEditWidget
(
NULL
)
{
{
setObjectName
(
name
);
setObjectName
(
name
);
mName
=
"TeacherBarWidget"
;
mName
=
"TeacherBarWidget"
;
...
@@ -68,11 +65,15 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
...
@@ -68,11 +65,15 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpContainer
->
setObjectName
(
"DockPaletteWidgetBox"
);
mpContainer
->
setObjectName
(
"DockPaletteWidgetBox"
);
mpPreview
=
new
UBTeacherBarPreviewWidget
(
this
);
mpPreview
=
new
UBTeacherBarPreviewWidget
(
this
);
mpDocPreviewWidget
=
new
UBTBDocumentPreviewWidget
(
this
);
mpDocEditWidget
=
new
UBTBDocumentEditWidget
(
this
);
mpStackWidget
=
new
QStackedWidget
(
this
);
mpStackWidget
=
new
QStackedWidget
(
this
);
mpContainerLayout
->
addWidget
(
mpStackWidget
);
mpContainerLayout
->
addWidget
(
mpStackWidget
);
mpStackWidget
->
addWidget
(
mpContainer
);
mpStackWidget
->
addWidget
(
mpContainer
);
mpStackWidget
->
addWidget
(
mpPreview
);
mpStackWidget
->
addWidget
(
mpPreview
);
mpStackWidget
->
addWidget
(
mpDocPreviewWidget
);
mpStackWidget
->
addWidget
(
mpDocEditWidget
);
mpLayout
=
new
QVBoxLayout
(
mpContainer
);
mpLayout
=
new
QVBoxLayout
(
mpContainer
);
mpContainer
->
setLayout
(
mpLayout
);
mpContainer
->
setLayout
(
mpLayout
);
...
@@ -85,26 +86,6 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
...
@@ -85,26 +86,6 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
mpLayout
->
addWidget
(
mpTitleLabel
,
0
);
mpLayout
->
addWidget
(
mpTitleLabel
,
0
);
mpLayout
->
addWidget
(
mpTitle
,
0
);
mpLayout
->
addWidget
(
mpTitle
,
0
);
// Duration
mpDurationLabel
=
new
QLabel
(
tr
(
"Duration"
),
mpContainer
);
mpLayout
->
addWidget
(
mpDurationLabel
,
0
);
mpDurationLayout
=
new
QHBoxLayout
();
mpDuration1
=
new
QCheckBox
(
this
);
mpDuration1
->
setIcon
(
QIcon
(
":images/duration1.png"
));
mpDuration1
->
setChecked
(
true
);
mpDurationLayout
->
addWidget
(
mpDuration1
,
0
);
mpDuration2
=
new
QCheckBox
(
this
);
mpDuration2
->
setIcon
(
QIcon
(
":images/duration2.png"
));
mpDurationLayout
->
addWidget
(
mpDuration2
,
0
);
mpDuration3
=
new
QCheckBox
(
this
);
mpDuration3
->
setIcon
(
QIcon
(
":images/duration3.png"
));
mpDurationLayout
->
addWidget
(
mpDuration3
,
0
);
mpDurationButtons
=
new
QButtonGroup
(
mpContainer
);
mpDurationButtons
->
addButton
(
mpDuration1
);
mpDurationButtons
->
addButton
(
mpDuration2
);
mpDurationButtons
->
addButton
(
mpDuration3
);
mpLayout
->
addLayout
(
mpDurationLayout
,
0
);
// Actions
// Actions
mpActionLabel
=
new
QLabel
(
tr
(
"Actions"
),
mpContainer
);
mpActionLabel
=
new
QLabel
(
tr
(
"Actions"
),
mpContainer
);
mpLayout
->
addWidget
(
mpActionLabel
,
0
);
mpLayout
->
addWidget
(
mpActionLabel
,
0
);
...
@@ -154,110 +135,35 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
...
@@ -154,110 +135,35 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
connect
(
mpLinkButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onLinkButton
()));
connect
(
mpLinkButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onLinkButton
()));
connect
(
mpPreview
,
SIGNAL
(
showEditMode
()),
this
,
SLOT
(
onShowEditMode
()));
connect
(
mpPreview
,
SIGNAL
(
showEditMode
()),
this
,
SLOT
(
onShowEditMode
()));
connect
(
mpMediaContainer
,
SIGNAL
(
mediaDropped
(
QString
)),
this
,
SLOT
(
onMediaDropped
(
QString
)));
connect
(
mpMediaContainer
,
SIGNAL
(
mediaDropped
(
QString
)),
this
,
SLOT
(
onMediaDropped
(
QString
)));
connect
(
mpDocPreviewWidget
,
SIGNAL
(
onEditClicked
()),
this
,
SLOT
(
onTBStateChanged
(
eTeacherBarState
)));
connect
(
mpDocPreviewWidget
,
SIGNAL
(
onPageViewClicked
()),
this
,
SLOT
(
onTBStateChanged
(
eTeacherBarState
)));
connect
(
mpDocEditWidget
,
SIGNAL
(
onPageViewClicked
()),
this
,
SLOT
(
onTBStateChanged
(
eTeacherBarState
)));
connect
(
mpDocEditWidget
,
SIGNAL
(
onPreviewClicked
()),
this
,
SLOT
(
onTBStateChanged
(
eTeacherBarState
)));
}
}
UBTeacherBarWidget
::~
UBTeacherBarWidget
()
UBTeacherBarWidget
::~
UBTeacherBarWidget
()
{
{
if
(
NULL
!=
mpMediaContainer
){
DELETEPTR
(
mpDocPreviewWidget
);
delete
mpMediaContainer
;
DELETEPTR
(
mpDocEditWidget
);
mpMediaContainer
=
NULL
;
DELETEPTR
(
mpMediaContainer
);
}
DELETEPTR
(
mpComments
);
if
(
NULL
!=
mpComments
){
DELETEPTR
(
mpCommentLabel
);
delete
mpComments
;
DELETEPTR
(
mpLinks
);
mpComments
=
NULL
;
DELETEPTR
(
mpLinkLabel
);
}
DELETEPTR
(
mpLinkButton
);
if
(
NULL
!=
mpCommentLabel
){
DELETEPTR
(
mpLinkLayout
);
delete
mpCommentLabel
;
DELETEPTR
(
mpMediaLabel
);
mpCommentLabel
=
NULL
;
DELETEPTR
(
mpActionButton
);
}
DELETEPTR
(
mpActionLayout
);
if
(
NULL
!=
mpLinks
){
DELETEPTR
(
mpActionLabel
);
delete
mpLinks
;
DELETEPTR
(
mpTitleLabel
);
mpLinks
=
NULL
;
DELETEPTR
(
mpTitle
);
}
DELETEPTR
(
mpTitleLayout
);
if
(
NULL
!=
mpLinkLabel
){
DELETEPTR
(
mpLayout
);
delete
mpLinkLabel
;
DELETEPTR
(
mpContainer
);
mpLinkLabel
=
NULL
;
DELETEPTR
(
mpContainerLayout
);
}
DELETEPTR
(
mpPreview
);
if
(
NULL
!=
mpLinkButton
){
DELETEPTR
(
mpStackWidget
);
delete
mpLinkButton
;
mpLinkButton
=
NULL
;
}
if
(
NULL
!=
mpLinkLayout
){
delete
mpLinkLayout
;
mpLinkLayout
=
NULL
;
}
if
(
NULL
!=
mpMediaLabel
){
delete
mpMediaLabel
;
mpMediaLabel
=
NULL
;
}
if
(
NULL
!=
mpActionButton
){
delete
mpActionButton
;
mpActionButton
=
NULL
;
}
if
(
NULL
!=
mpActionLayout
){
delete
mpActionLayout
;
mpActionLayout
=
NULL
;
}
if
(
NULL
!=
mpActionLabel
){
delete
mpActionLabel
;
mpActionLabel
=
NULL
;
}
if
(
NULL
!=
mpDurationLabel
){
delete
mpDurationLabel
;
mpDurationLabel
=
NULL
;
}
if
(
NULL
!=
mpDuration1
){
delete
mpDuration1
;
mpDuration1
=
NULL
;
}
if
(
NULL
!=
mpDuration2
){
delete
mpDuration2
;
mpDuration2
=
NULL
;
}
if
(
NULL
!=
mpDuration3
){
delete
mpDuration3
;
mpDuration3
=
NULL
;
}
if
(
NULL
!=
mpDurationButtons
){
delete
mpDurationButtons
;
mpDurationButtons
=
NULL
;
}
if
(
NULL
!=
mpDurationLayout
){
delete
mpDurationLayout
;
mpDurationLayout
=
NULL
;
}
if
(
NULL
!=
mpTitleLabel
){
delete
mpTitleLabel
;
mpTitleLabel
=
NULL
;
}
if
(
NULL
!=
mpTitle
){
delete
mpTitle
;
mpTitle
=
NULL
;
}
if
(
NULL
!=
mpTitleLayout
){
delete
mpTitleLayout
;
mpTitleLayout
=
NULL
;
}
if
(
NULL
!=
mpLayout
){
delete
mpLayout
;
mpLayout
=
NULL
;
}
if
(
NULL
!=
mpContainer
){
delete
mpContainer
;
mpContainer
=
NULL
;
}
if
(
NULL
!=
mpContainerLayout
){
delete
mpContainerLayout
;
mpContainerLayout
=
NULL
;
}
if
(
NULL
!=
mpPreview
){
delete
mpPreview
;
mpPreview
=
NULL
;
}
if
(
NULL
!=
mpStackWidget
){
delete
mpStackWidget
;
mpStackWidget
=
NULL
;
}
}
}
void
UBTeacherBarWidget
::
onValueChanged
()
void
UBTeacherBarWidget
::
onValueChanged
()
...
@@ -281,14 +187,7 @@ void UBTeacherBarWidget::saveContent()
...
@@ -281,14 +187,7 @@ void UBTeacherBarWidget::saveContent()
sTeacherBarInfos
infos
;
sTeacherBarInfos
infos
;
// Title
// Title
infos
.
title
=
mpTitle
->
text
();
infos
.
title
=
mpTitle
->
text
();
// Duration
if
(
mpDuration1
->
isChecked
()){
infos
.
Duration
=
eDuration_Quarter
;
}
else
if
(
mpDuration2
->
isChecked
()){
infos
.
Duration
=
eDuration_Half
;
}
else
{
infos
.
Duration
=
eDuration_ThreeQuarter
;
}
// Actions
// Actions
for
(
int
i
=
0
;
i
<
mActionList
.
size
();
i
++
){
for
(
int
i
=
0
;
i
<
mActionList
.
size
();
i
++
){
infos
.
actions
<<
QString
(
"%0;%1"
).
arg
(
mActionList
.
at
(
i
)
->
comboValue
()).
arg
(
mActionList
.
at
(
i
)
->
text
());
infos
.
actions
<<
QString
(
"%0;%1"
).
arg
(
mActionList
.
at
(
i
)
->
comboValue
()).
arg
(
mActionList
.
at
(
i
)
->
text
());
...
@@ -316,17 +215,7 @@ void UBTeacherBarWidget::loadContent()
...
@@ -316,17 +215,7 @@ void UBTeacherBarWidget::loadContent()
sTeacherBarInfos
nextInfos
=
UBPersistenceManager
::
persistenceManager
()
->
getTeacherBarInfos
(
UBApplication
::
boardController
->
activeDocument
(),
UBApplication
::
boardController
->
activeSceneIndex
());
sTeacherBarInfos
nextInfos
=
UBPersistenceManager
::
persistenceManager
()
->
getTeacherBarInfos
(
UBApplication
::
boardController
->
activeDocument
(),
UBApplication
::
boardController
->
activeSceneIndex
());
// Title
// Title
mpTitle
->
setText
(
nextInfos
.
title
);
mpTitle
->
setText
(
nextInfos
.
title
);
// Duration
switch
(
nextInfos
.
Duration
){
case
eDuration_Quarter
:
mpDuration1
->
setChecked
(
true
);
break
;
case
eDuration_Half
:
mpDuration2
->
setChecked
(
true
);
break
;
case
eDuration_ThreeQuarter
:
mpDuration3
->
setChecked
(
true
);
break
;
default
:
mpDuration1
->
setChecked
(
true
);
break
;
}
// Actions
// Actions
for
(
int
i
=
0
;
i
<
nextInfos
.
actions
.
size
();
i
++
){
for
(
int
i
=
0
;
i
<
nextInfos
.
actions
.
size
();
i
++
){
QStringList
qslAction
=
nextInfos
.
actions
.
at
(
i
).
split
(
";"
);
QStringList
qslAction
=
nextInfos
.
actions
.
at
(
i
).
split
(
";"
);
...
@@ -372,13 +261,6 @@ void UBTeacherBarWidget::loadContent()
...
@@ -372,13 +261,6 @@ void UBTeacherBarWidget::loadContent()
mpPreview
->
mediaViewer
()
->
loadMedia
(
nextInfos
.
medias
);
mpPreview
->
mediaViewer
()
->
loadMedia
(
nextInfos
.
medias
);
mpStackWidget
->
setCurrentWidget
(
mpPreview
);
mpStackWidget
->
setCurrentWidget
(
mpPreview
);
if
(
mpDuration1
->
isChecked
()){
mpPreview
->
setDuration
(
eDuration_Quarter
);
}
else
if
(
mpDuration2
->
isChecked
()){
mpPreview
->
setDuration
(
eDuration_Half
);
}
else
{
mpPreview
->
setDuration
(
eDuration_ThreeQuarter
);
}
mpPreview
->
clean
();
mpPreview
->
clean
();
// Add the actions
// Add the actions
...
@@ -498,6 +380,24 @@ void UBTeacherBarWidget::onMediaDropped(const QString &url)
...
@@ -498,6 +380,24 @@ void UBTeacherBarWidget::onMediaDropped(const QString &url)
}
}
}
}
void
UBTeacherBarWidget
::
onTBStateChanged
(
eTeacherBarState
state
)
{
switch
(
state
){
case
eTeacherBarState_DocumentEdit
:
mpStackWidget
->
setCurrentWidget
(
mpDocEditWidget
);
break
;
case
eTeacherBarState_DocumentPreview
:
mpStackWidget
->
setCurrentWidget
(
mpDocPreviewWidget
);
break
;
case
eTeacherBarState_PageEdit
:
mpStackWidget
->
setCurrentWidget
(
mpContainer
);
break
;
case
eTeacherBarState_PagePreview
:
mpStackWidget
->
setCurrentWidget
(
mpPreview
);
break
;
}
}
// ---------------------------------------------------------------------------------------------
// ---------------------------------------------------------------------------------------------
UBTeacherStudentAction
::
UBTeacherStudentAction
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
UBTeacherStudentAction
::
UBTeacherStudentAction
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpText
(
NULL
)
,
mpText
(
NULL
)
...
@@ -536,22 +436,10 @@ UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name
...
@@ -536,22 +436,10 @@ UBTeacherStudentAction::UBTeacherStudentAction(QWidget *parent, const char *name
UBTeacherStudentAction
::~
UBTeacherStudentAction
()
UBTeacherStudentAction
::~
UBTeacherStudentAction
()
{
{
if
(
NULL
!=
mpCombo
){
DELETEPTR
(
mpCombo
);
delete
mpCombo
;
DELETEPTR
(
mpText
);
mpCombo
=
NULL
;
DELETEPTR
(
mpComboLayout
);
}
DELETEPTR
(
mpLayout
);
if
(
NULL
!=
mpText
){
delete
mpText
;
mpText
=
NULL
;
}
if
(
NULL
!=
mpComboLayout
){
delete
mpComboLayout
;
mpComboLayout
=
NULL
;
}
if
(
NULL
!=
mpLayout
){
delete
mpLayout
;
mpLayout
=
NULL
;
}
}
}
QString
UBTeacherStudentAction
::
text
()
QString
UBTeacherStudentAction
::
text
()
...
@@ -623,34 +511,13 @@ UBUrlWidget::UBUrlWidget(QWidget *parent, const char *name):QWidget(parent)
...
@@ -623,34 +511,13 @@ UBUrlWidget::UBUrlWidget(QWidget *parent, const char *name):QWidget(parent)
UBUrlWidget
::~
UBUrlWidget
()
UBUrlWidget
::~
UBUrlWidget
()
{
{
if
(
NULL
!=
mpTitle
){
DELETEPTR
(
mpTitle
);
delete
mpTitle
;
DELETEPTR
(
mpTitleLabel
);
mpTitle
=
NULL
;
DELETEPTR
(
mpUrlLabel
);
}
DELETEPTR
(
mpUrl
);
if
(
NULL
!=
mpTitleLabel
){
DELETEPTR
(
mpTitleLayout
);
delete
mpTitleLabel
;
DELETEPTR
(
mpLabelLayout
);
mpTitleLabel
=
NULL
;
DELETEPTR
(
mpLayout
);
}
if
(
NULL
!=
mpUrlLabel
){
delete
mpUrlLabel
;
mpUrlLabel
=
NULL
;
}
if
(
NULL
!=
mpUrl
){
delete
mpUrl
;
mpUrl
=
NULL
;
}
if
(
NULL
!=
mpTitleLayout
){
delete
mpTitleLayout
;
mpTitleLayout
=
NULL
;
}
if
(
NULL
!=
mpLabelLayout
){
delete
mpLabelLayout
;
mpLabelLayout
=
NULL
;
}
if
(
NULL
!=
mpLayout
){
delete
mpLayout
;
mpLayout
=
NULL
;
}
}
}
QString
UBUrlWidget
::
url
()
QString
UBUrlWidget
::
url
()
...
@@ -683,6 +550,7 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char
...
@@ -683,6 +550,7 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char
,
mpCommentsLabel
(
NULL
)
,
mpCommentsLabel
(
NULL
)
,
mpComments
(
NULL
)
,
mpComments
(
NULL
)
,
mpLinksLabel
(
NULL
)
,
mpLinksLabel
(
NULL
)
,
mpContentContainer
(
NULL
)
{
{
setObjectName
(
name
);
setObjectName
(
name
);
...
@@ -702,7 +570,9 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char
...
@@ -702,7 +570,9 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char
mTitleDurationLayout
.
addWidget
(
mpDuration
,
1
);
mTitleDurationLayout
.
addWidget
(
mpDuration
,
1
);
mLayout
.
addLayout
(
&
mTitleDurationLayout
,
0
);
mLayout
.
addLayout
(
&
mTitleDurationLayout
,
0
);
mLayout
.
addWidget
(
&
mMediaViewer
,
1
);
mpContentContainer
=
new
UBTBPreviewContainer
(
this
);
mLayout
.
addWidget
(
mpContentContainer
,
1
);
//mLayout.addWidget(&mMediaViewer, 1);
// The next line is disgusting. This is a quickfix that must be reworked later
// The next line is disgusting. This is a quickfix that must be reworked later
mMediaViewer
.
setContentsMargins
(
-
9
,
-
9
,
-
9
,
-
9
);
mMediaViewer
.
setContentsMargins
(
-
9
,
-
9
,
-
9
,
-
9
);
...
@@ -722,38 +592,15 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char
...
@@ -722,38 +592,15 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char
UBTeacherBarPreviewWidget
::~
UBTeacherBarPreviewWidget
()
UBTeacherBarPreviewWidget
::~
UBTeacherBarPreviewWidget
()
{
{
if
(
NULL
!=
mpLinksLabel
){
DELETEPTR
(
mpLinksLabel
);
delete
mpLinksLabel
;
DELETEPTR
(
mpComments
);
mpLinksLabel
=
NULL
;
DELETEPTR
(
mpTitle
);
}
DELETEPTR
(
mpDuration
);
if
(
NULL
!=
mpComments
){
DELETEPTR
(
mpActionsLabel
);
delete
mpComments
;
DELETEPTR
(
mpMediaLabel
);
mpComments
=
NULL
;
DELETEPTR
(
mpCommentsLabel
);
}
DELETEPTR
(
mpContentContainer
);
if
(
NULL
!=
mpTitle
){
DELETEPTR
(
mpEditButton
);
delete
mpTitle
;
mpTitle
=
NULL
;
}
if
(
NULL
!=
mpDuration
){
delete
mpDuration
;
mpDuration
=
NULL
;
}
if
(
NULL
!=
mpActionsLabel
){
delete
mpActionsLabel
;
mpActionsLabel
=
NULL
;
}
if
(
NULL
!=
mpMediaLabel
){
delete
mpMediaLabel
;
mpMediaLabel
=
NULL
;
}
if
(
NULL
!=
mpCommentsLabel
){
delete
mpCommentsLabel
;
mpCommentsLabel
=
NULL
;
}
if
(
NULL
!=
mpEditButton
){
delete
mpEditButton
;
mpEditButton
=
NULL
;
}
}
}
void
UBTeacherBarPreviewWidget
::
onEdit
()
void
UBTeacherBarPreviewWidget
::
onEdit
()
...
@@ -807,6 +654,13 @@ void UBTeacherBarPreviewWidget::setComments(const QString &comments)
...
@@ -807,6 +654,13 @@ void UBTeacherBarPreviewWidget::setComments(const QString &comments)
void
UBTeacherBarPreviewWidget
::
clean
()
void
UBTeacherBarPreviewWidget
::
clean
()
{
{
mMediaViewer
.
cleanMedia
();
mMediaViewer
.
cleanMedia
();
foreach
(
QWidget
*
eachWidget
,
mStoredWidgets
){
delete
eachWidget
;
eachWidget
=
NULL
;
}
mStoredWidgets
.
clear
();
hideElements
();
hideElements
();
}
}
...
@@ -883,11 +737,7 @@ UBTeacherBarPreviewMedia::UBTeacherBarPreviewMedia(QWidget* parent, const char*
...
@@ -883,11 +737,7 @@ UBTeacherBarPreviewMedia::UBTeacherBarPreviewMedia(QWidget* parent, const char*
UBTeacherBarPreviewMedia
::~
UBTeacherBarPreviewMedia
()
UBTeacherBarPreviewMedia
::~
UBTeacherBarPreviewMedia
()
{
{
if
(
mWidget
){
DELETEPTR
(
mWidget
);
delete
mWidget
;
mWidget
=
NULL
;
}
}
}
void
UBTeacherBarPreviewMedia
::
cleanMedia
()
void
UBTeacherBarPreviewMedia
::
cleanMedia
()
...
@@ -1119,3 +969,97 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
...
@@ -1119,3 +969,97 @@ QWidget* UBTBMediaContainer::generateMediaWidget(const QString& url)
return
pW
;
return
pW
;
}
}
// -------------------------------------------------------------------------------------------------------------------
UBTBPreviewContainer
::
UBTBPreviewContainer
(
QWidget
*
parent
,
const
char
*
name
)
:
UBWidgetList
(
parent
)
{
setObjectName
(
name
);
}
UBTBPreviewContainer
::~
UBTBPreviewContainer
()
{
}
// -------------------------------------------------------------------------------------------------------------------
UBTBDocumentEditWidget
::
UBTBDocumentEditWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpPageViewButton
(
NULL
)
,
mpPreviewButton
(
NULL
)
,
mpTitleLabel
(
NULL
)
,
mpTitle
(
NULL
)
,
mpTargetLabel
(
NULL
)
,
mpTarget
(
NULL
)
,
mpMetadataLabel
(
NULL
)
,
mpLicenseLabel
(
NULL
)
{
setObjectName
(
name
);
setLayout
(
&
mLayout
);
mpPageViewButton
=
new
QPushButton
(
tr
(
"Page View"
),
this
);
mPageLayout
.
addStretch
(
1
);
mPageLayout
.
addWidget
(
mpPageViewButton
,
0
);
mPageLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mPageLayout
);
mpTitleLabel
=
new
QLabel
(
tr
(
"Session Title:"
),
this
);
mpTitleLabel
->
setAlignment
(
Qt
::
AlignLeft
);
mLayout
.
addWidget
(
mpTitleLabel
);
mpTitle
=
new
QLineEdit
(
this
);
mLayout
.
addWidget
(
mpTitle
);
mpPreviewButton
=
new
QPushButton
(
tr
(
"Preview"
),
this
);
mPreviewLayout
.
addStretch
(
1
);
mPreviewLayout
.
addWidget
(
mpPreviewButton
,
0
);
mPreviewLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mPreviewLayout
);
connect
(
mpPageViewButton
,
SIGNAL
(
clicked
()),
this
,
SIGNAL
(
onPageViewClicked
()));
connect
(
mpPreviewButton
,
SIGNAL
(
clicked
()),
this
,
SIGNAL
(
onPreviewClicked
()));
}
UBTBDocumentEditWidget
::~
UBTBDocumentEditWidget
()
{
DELETEPTR
(
mpTitleLabel
);
DELETEPTR
(
mpTitle
);
DELETEPTR
(
mpTargetLabel
);
DELETEPTR
(
mpTarget
);
DELETEPTR
(
mpMetadataLabel
);
DELETEPTR
(
mpLicenseLabel
);
DELETEPTR
(
mpPageViewButton
);
DELETEPTR
(
mpPreviewButton
);
}
// -------------------------------------------------------------------------------------------------------------------
UBTBDocumentPreviewWidget
::
UBTBDocumentPreviewWidget
(
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpPageViewButton
(
NULL
)
,
mpEditButton
(
NULL
)
{
setObjectName
(
name
);
setLayout
(
&
mLayout
);
mpPageViewButton
=
new
QPushButton
(
tr
(
"Page View"
),
this
);
mPageLayout
.
addStretch
(
1
);
mPageLayout
.
addWidget
(
mpPageViewButton
,
0
);
mPageLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mPageLayout
);
// TODO : Add the elements here
mpEditButton
=
new
QPushButton
(
tr
(
"Edit"
),
this
);
mPreviewLayout
.
addStretch
(
1
);
mPreviewLayout
.
addWidget
(
mpEditButton
,
0
);
mPreviewLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mPreviewLayout
);
connect
(
mpPageViewButton
,
SIGNAL
(
clicked
()),
this
,
SIGNAL
(
onPageViewClicked
()));
connect
(
mpEditButton
,
SIGNAL
(
clicked
()),
this
,
SIGNAL
(
onEditClicked
()));
}
UBTBDocumentPreviewWidget
::~
UBTBDocumentPreviewWidget
()
{
DELETEPTR
(
mpPageViewButton
);
DELETEPTR
(
mpEditButton
);
}
This diff is collapsed.
Click to expand it.
src/gui/UBTeacherBarWidget.h
View file @
15f89fc7
...
@@ -22,6 +22,13 @@ class UBMediaPlayer;
...
@@ -22,6 +22,13 @@ class UBMediaPlayer;
#define LABEL_MINWIDHT 80
#define LABEL_MINWIDHT 80
typedef
enum
{
eTeacherBarState_DocumentEdit
,
eTeacherBarState_DocumentPreview
,
eTeacherBarState_PageEdit
,
eTeacherBarState_PagePreview
}
eTeacherBarState
;
typedef
enum
{
typedef
enum
{
eDuration_Quarter
,
eDuration_Quarter
,
eDuration_Half
,
eDuration_Half
,
...
@@ -104,6 +111,13 @@ private:
...
@@ -104,6 +111,13 @@ private:
QHBoxLayout
mOwnerLayout
;
QHBoxLayout
mOwnerLayout
;
};
};
class
UBTBPreviewContainer
:
public
UBWidgetList
{
public
:
UBTBPreviewContainer
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTBPreviewContainer"
);
~
UBTBPreviewContainer
();
};
class
UBTeacherBarPreviewWidget
:
public
QWidget
class
UBTeacherBarPreviewWidget
:
public
QWidget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -133,6 +147,7 @@ private:
...
@@ -133,6 +147,7 @@ private:
QHBoxLayout
mTitleDurationLayout
;
QHBoxLayout
mTitleDurationLayout
;
UBTeacherBarPreviewMedia
mMediaViewer
;
UBTeacherBarPreviewMedia
mMediaViewer
;
QList
<
QWidget
*>
mWidgets
;
QList
<
QWidget
*>
mWidgets
;
QList
<
QWidget
*>
mStoredWidgets
;
QPushButton
*
mpEditButton
;
QPushButton
*
mpEditButton
;
QLabel
*
mpTitle
;
QLabel
*
mpTitle
;
...
@@ -144,6 +159,7 @@ private:
...
@@ -144,6 +159,7 @@ private:
QLabel
*
mpLinksLabel
;
QLabel
*
mpLinksLabel
;
QLabel
*
mpTmpLink
;
QLabel
*
mpTmpLink
;
UBActionPreview
*
mpTmpAction
;
UBActionPreview
*
mpTmpAction
;
UBTBPreviewContainer
*
mpContentContainer
;
};
};
class
UBTBMediaContainer
:
public
UBWidgetList
class
UBTBMediaContainer
:
public
UBWidgetList
...
@@ -172,6 +188,51 @@ private:
...
@@ -172,6 +188,51 @@ private:
QStringList
mMediaList
;
QStringList
mMediaList
;
};
};
class
UBTBDocumentEditWidget
:
public
QWidget
{
Q_OBJECT
public
:
UBTBDocumentEditWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTBDocumentEditWidget"
);
~
UBTBDocumentEditWidget
();
signals
:
void
onPreviewClicked
();
void
onPageViewClicked
();
private
:
QVBoxLayout
mLayout
;
QHBoxLayout
mPageLayout
;
QHBoxLayout
mPreviewLayout
;
QPushButton
*
mpPageViewButton
;
QPushButton
*
mpPreviewButton
;
QLabel
*
mpTitleLabel
;
QLineEdit
*
mpTitle
;
QLabel
*
mpTargetLabel
;
QTextEdit
*
mpTarget
;
QLabel
*
mpMetadataLabel
;
QLabel
*
mpLicenseLabel
;
};
class
UBTBDocumentPreviewWidget
:
public
QWidget
{
Q_OBJECT
public
:
UBTBDocumentPreviewWidget
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTBDocumentPreviewWidget"
);
~
UBTBDocumentPreviewWidget
();
signals
:
void
onEditClicked
();
void
onPageViewClicked
();
private
:
QVBoxLayout
mLayout
;
QHBoxLayout
mPageLayout
;
QHBoxLayout
mPreviewLayout
;
QPushButton
*
mpPageViewButton
;
QPushButton
*
mpEditButton
;
};
class
UBTeacherBarWidget
:
public
UBDockPaletteWidget
class
UBTeacherBarWidget
:
public
UBDockPaletteWidget
{
{
Q_OBJECT
Q_OBJECT
...
@@ -188,23 +249,18 @@ private slots:
...
@@ -188,23 +249,18 @@ private slots:
void
onLinkButton
();
void
onLinkButton
();
void
onShowEditMode
();
void
onShowEditMode
();
void
onMediaDropped
(
const
QString
&
url
);
void
onMediaDropped
(
const
QString
&
url
);
void
onTBStateChanged
(
eTeacherBarState
state
);
private
:
private
:
void
clearWidgetLists
();
void
clearWidgetLists
();
bool
isEmpty
();
bool
isEmpty
();
QVBoxLayout
*
mpLayout
;
QVBoxLayout
*
mpLayout
;
QHBoxLayout
*
mpTitleLayout
;
QHBoxLayout
*
mpTitleLayout
;
QHBoxLayout
*
mpDurationLayout
;
QLabel
*
mpTitleLabel
;
QLabel
*
mpTitleLabel
;
QLabel
*
mpDurationLabel
;
QLineEdit
*
mpTitle
;
QLineEdit
*
mpTitle
;
QLabel
*
mpMediaLabel
;
QLabel
*
mpMediaLabel
;
QWidget
*
mpContainer
;
QWidget
*
mpContainer
;
QVBoxLayout
*
mpContainerLayout
;
QVBoxLayout
*
mpContainerLayout
;
QCheckBox
*
mpDuration1
;
QCheckBox
*
mpDuration2
;
QCheckBox
*
mpDuration3
;
QButtonGroup
*
mpDurationButtons
;
QLabel
*
mpActionLabel
;
QLabel
*
mpActionLabel
;
UBWidgetList
*
mpActions
;
UBWidgetList
*
mpActions
;
QPushButton
*
mpActionButton
;
QPushButton
*
mpActionButton
;
...
@@ -223,6 +279,10 @@ private:
...
@@ -223,6 +279,10 @@ private:
QVector
<
QWidget
*>
mMediaList
;
QVector
<
QWidget
*>
mMediaList
;
UBTBMediaContainer
*
mpMediaContainer
;
UBTBMediaContainer
*
mpMediaContainer
;
eTeacherBarState
mState
;
UBTBDocumentPreviewWidget
*
mpDocPreviewWidget
;
UBTBDocumentEditWidget
*
mpDocEditWidget
;
};
};
#endif // UBTEACHERBARWIDGET_H
#endif // UBTEACHERBARWIDGET_H
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