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
a3753229
Commit
a3753229
authored
Jan 25, 2012
by
shibakaneki
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Backup
parent
ea818993
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
207 additions
and
141 deletions
+207
-141
ccby.png
resources/images/licenses/ccby.png
+0
-0
ccbync.png
resources/images/licenses/ccbync.png
+0
-0
ccbyncnd.png
resources/images/licenses/ccbyncnd.png
+0
-0
ccbyncsa.png
resources/images/licenses/ccbyncsa.png
+0
-0
ccbynd.png
resources/images/licenses/ccbynd.png
+0
-0
ccbysa.png
resources/images/licenses/ccbysa.png
+0
-0
style.qss
resources/style.qss
+17
-3
UBWidgetList.cpp
src/customWidgets/UBWidgetList.cpp
+1
-1
UBTeacherBarPreviewWidget.cpp
src/gui/UBTeacherBarPreviewWidget.cpp
+137
-108
UBTeacherBarPreviewWidget.h
src/gui/UBTeacherBarPreviewWidget.h
+42
-23
UBTeacherBarWidget.cpp
src/gui/UBTeacherBarWidget.cpp
+10
-6
No files found.
resources/images/licenses/ccby.png
0 → 100644
View file @
a3753229
4.63 KB
resources/images/licenses/ccbync.png
0 → 100644
View file @
a3753229
5.02 KB
resources/images/licenses/ccbyncnd.png
0 → 100644
View file @
a3753229
5.16 KB
resources/images/licenses/ccbyncsa.png
0 → 100644
View file @
a3753229
5.33 KB
resources/images/licenses/ccbynd.png
0 → 100644
View file @
a3753229
4.77 KB
resources/images/licenses/ccbysa.png
0 → 100644
View file @
a3753229
4.96 KB
resources/style.qss
View file @
a3753229
...
...
@@ -13,6 +13,13 @@ QWidget#UBTBMediaContainer
border: 2px solid #999999;
}
QFrame#UBTBSeparator
{
background: #DDDDDD;
border-radius: 2px;
border: 1px solid #DDDDDD;
}
QWidget#UBMediaVideoContainer
{
background: #000000;
...
...
@@ -27,11 +34,17 @@ QWidget#UBTeacherBarPreviewWidget
border: 2px solid #999999;
}
QLabel#UBTBPreviewSessionTitle
{
font-size: 12px;
}
QLabel#UBTeacherBarPreviewTitle
{
color: #555555;
font-size :
18
px;
font-size :
20
px;
font-weight:bold;
padding-left:5px;
}
QLabel#UBMediaPlayerButton
...
...
@@ -44,7 +57,7 @@ QLabel#UBTeacherBarPreviewSubtitle
color: #555555;
font-size : 15px;
font-weight:bold;
padding-
top: 10
px;
padding-
left:5
px;
}
QWidget#UBLibWebView
...
...
@@ -61,7 +74,8 @@ QWidget#UBActionPreviewOwner
font-weight: bold;
}
QWidget#UBTeacherBarPreviewComments
QWidget#UBTeacherBarPreviewComments,
QWidget#UBTeacherBarTargetBox
{
border-radius: 10px;
border: white 2px solid;
...
...
src/customWidgets/UBWidgetList.cpp
View file @
a3753229
...
...
@@ -57,7 +57,7 @@ void UBWidgetList::addWidget(QWidget *widget)
void
UBWidgetList
::
removeWidget
(
QWidget
*
widget
)
{
if
(
NULL
!=
mpLayout
){
if
(
NULL
!=
mpLayout
&&
NULL
!=
widget
){
mpLayout
->
removeWidget
(
widget
);
mWidgetInfo
.
remove
(
widget
);
widget
->
setVisible
(
false
);
...
...
src/gui/UBTeacherBarPreviewWidget.cpp
View file @
a3753229
#include "core/UBApplication.h"
#include "customWidgets/UBGlobals.h"
#include "board/UBBoardController.h"
#include "frameworks/UBFileSystemUtils.h"
#include "UBTeacherBarPreviewWidget.h"
...
...
@@ -84,9 +85,10 @@ UBActionPreview::UBActionPreview(QWidget *parent, const char *name):QWidget(pare
mOwnerLayout
.
addWidget
(
mpOwner
,
0
);
mOwnerLayout
.
addStretch
(
1
);
mLayout
.
addLayout
(
&
mOwnerLayout
);
mpContent
=
new
QLabel
(
this
);
mpContent
=
new
QTextEdit
(
this
);
mpContent
->
setReadOnly
(
true
);
mpContent
->
setObjectName
(
"UBActionPreviewContent"
);
mpContent
->
setWordWrap
(
true
);
//
mpContent->setWordWrap(true);
mLayout
.
addWidget
(
mpContent
);
setContentsMargins
(
-
9
,
-
9
,
-
9
,
-
9
);
}
...
...
@@ -103,10 +105,10 @@ UBActionPreview::~UBActionPreview()
}
}
void
UBActionPreview
::
setOwner
(
const
QString
&
owner
)
void
UBActionPreview
::
setOwner
(
int
owner
)
{
if
(
NULL
!=
mpOwner
&&
NULL
!=
mpContent
){
switch
(
owner
.
toInt
()
){
switch
(
owner
){
case
eActionOwner_Teacher
:
mpOwner
->
setText
(
tr
(
"Teacher"
));
mpContent
->
setStyleSheet
(
"background:lightblue; border:lightblue;"
);
...
...
@@ -124,6 +126,7 @@ void UBActionPreview::setContent(const QString &content)
{
if
(
NULL
!=
mpContent
){
mpContent
->
setText
(
content
);
setMinimumHeight
(
mpOwner
->
height
()
+
mpContent
->
height
());
}
}
...
...
@@ -136,19 +139,30 @@ UBTBPreviewContainer::UBTBPreviewContainer(QWidget *parent, const char *name):UB
UBTBPreviewContainer
::~
UBTBPreviewContainer
()
{
}
// ------------------------------------------------------------------------------------
UBTBPreviewSeparator
::
UBTBPreviewSeparator
(
QWidget
*
parent
,
const
char
*
name
)
:
QFrame
(
parent
)
{
setObjectName
(
"UBTBSeparator"
);
setMinimumHeight
(
5
);
setMaximumHeight
(
5
);
}
UBTBPreviewSeparator
::~
UBTBPreviewSeparator
()
{
}
// ------------------------------------------------------------------------------------
UBTeacherBarPreviewWidget
::
UBTeacherBarPreviewWidget
(
UBTeacherBarDataMgr
*
pDataMgr
,
QWidget
*
parent
,
const
char
*
name
)
:
QWidget
(
parent
)
,
mpEditButton
(
NULL
)
,
mpSessionTitle
(
NULL
)
,
mpTitle
(
NULL
)
,
mpDuration
(
NULL
)
,
mpActionsLabel
(
NULL
)
,
mpMediaLabel
(
NULL
)
,
mpCommentsLabel
(
NULL
)
,
mpComments
(
NULL
)
,
mpLinksLabel
(
NULL
)
,
mpTitleLabel
(
NULL
)
,
mpPageNbrLabel
(
NULL
)
,
mpContentContainer
(
NULL
)
,
mpScheduleLabel
(
NULL
)
,
mpLicenseLabel
(
NULL
)
{
setObjectName
(
name
);
mpDataMgr
=
pDataMgr
;
...
...
@@ -158,23 +172,45 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
setStyleSheet
(
UBApplication
::
globalStyleSheet
());
// Build the Preview widget
// Title + duration
mpTitle
=
new
QLabel
(
this
);
// Session Title
mTitleContainer
.
setLayout
(
&
mTitleLayout
);
mpSessionTitle
=
new
QLabel
(
this
);
mpSessionTitle
->
setText
(
tr
(
"Session: "
));
mpSessionTitle
->
setWordWrap
(
true
);
mpSessionTitle
->
setAlignment
(
Qt
::
AlignRight
);
mpSessionTitle
->
setObjectName
(
"UBTBPreviewSessionTitle"
);
mLayout
.
addWidget
(
mpSessionTitle
);
// Title
mTitleContainer
.
setLayout
(
&
mTitleLayout
);
mTitleLayout
.
setContentsMargins
(
0
,
0
,
0
,
0
);
mpTitleLabel
=
new
QLabel
(
&
mTitleContainer
);
mpTitleLabel
->
setText
(
tr
(
"Activity"
));
mpTitleLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mTitleLayout
.
addWidget
(
mpTitleLabel
,
0
);
mpTitle
=
new
QLabel
(
&
mTitleContainer
);
mpTitle
->
setObjectName
(
"UBTeacherBarPreviewTitle"
);
mpTitle
->
setWordWrap
(
true
);
mpTitle
->
setAlignment
(
Qt
::
AlignCenter
);
mpDuration
=
new
QLabel
(
this
);
mTitleDurationLayout
.
addWidget
(
mpTitle
,
0
);
mTitleDurationLayout
.
addWidget
(
mpDuration
,
1
);
mLayout
.
addLayout
(
&
mTitleDurationLayout
,
0
);
mpTitle
->
setAlignment
(
Qt
::
AlignLeft
);
mTitleLayout
.
addWidget
(
mpTitle
,
1
);
mpPageNbrLabel
=
new
QLabel
(
tr
(
"Page n° "
),
&
mTitleContainer
);
mpPageNbrLabel
->
setAlignment
(
Qt
::
AlignRight
);
mpPageNbrLabel
->
setObjectName
(
"UBTBPreviewSessionTitle"
);
mTitleLayout
.
addWidget
(
mpPageNbrLabel
);
mTitleLayout
.
addWidget
(
&
mTitleSeparator
);
mLayout
.
addWidget
(
&
mTitleContainer
);
// Content
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
mMediaViewer
.
setContentsMargins
(
-
9
,
-
9
,
-
9
,
-
9
);
hideElements
();
// License
mLayout
.
addWidget
(
&
mLicenseSeparator
);
mpLicenseLabel
=
new
QLabel
(
tr
(
"License"
),
this
);
mpLicenseLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mLayout
.
addWidget
(
mpLicenseLabel
);
// TODO : Add the license field here
// Edit button
mpEditButton
=
new
QPushButton
(
tr
(
"Edit infos"
),
this
);
...
...
@@ -186,128 +222,121 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(UBTeacherBarDataMgr* pDataM
connect
(
mpEditButton
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
onEdit
()));
connect
(
UBApplication
::
boardController
,
SIGNAL
(
activeSceneChanged
()),
this
,
SLOT
(
onActiveSceneChanged
()));
}
UBTeacherBarPreviewWidget
::~
UBTeacherBarPreviewWidget
()
{
DELETEPTR
(
mpLinksLabel
);
DELETEPTR
(
mpComments
);
DELETEPTR
(
mpTitle
);
DELETEPTR
(
mpDuration
);
DELETEPTR
(
mpActionsLabel
);
DELETEPTR
(
mpMediaLabel
);
DELETEPTR
(
mpCommentsLabel
);
DELETEPTR
(
mpContentContainer
);
DELETEPTR
(
mpEditButton
);
DELETEPTR
(
mpLicenseLabel
);
DELETEPTR
(
mpScheduleLabel
);
DELETEPTR
(
mpPageNbrLabel
);
DELETEPTR
(
mpTitle
);
DELETEPTR
(
mpTitleLabel
);
DELETEPTR
(
mpSessionTitle
);
}
void
UBTeacherBarPreviewWidget
::
on
Edit
()
void
UBTeacherBarPreviewWidget
::
on
ActiveSceneChanged
()
{
emit
showEditMode
(
);
mpPageNbrLabel
->
setText
(
tr
(
"Page n° %0"
).
arg
(
UBApplication
::
boardController
->
activeSceneIndex
())
);
}
void
UBTeacherBarPreviewWidget
::
setTitle
(
const
QString
&
title
)
void
UBTeacherBarPreviewWidget
::
onEdit
(
)
{
if
(
NULL
!=
mpTitle
){
mpTitle
->
setText
(
title
);
}
emit
showEditMode
();
}
void
UBTeacherBarPreviewWidget
::
setComments
(
const
QString
&
comments
)
void
UBTeacherBarPreviewWidget
::
updateFields
(
)
{
if
(
""
!=
comments
){
mWidgets
.
clear
();
mpComments
->
setText
(
comments
);
mpComments
->
setVisible
(
true
);
mpCommentsLabel
->
setVisible
(
true
);
mWidgets
<<
mpCommentsLabel
;
mMediaViewer
.
loadWidgets
(
mWidgets
,
false
);
mWidgets
.
clear
();
mWidgets
<<
mpComments
;
mMediaViewer
.
loadWidgets
(
mWidgets
,
true
);
// First, remove the previous elements
if
(
!
mStoredWidgets
.
empty
()){
foreach
(
QWidget
*
pW
,
mStoredWidgets
){
mpContentContainer
->
removeWidget
(
pW
);
if
(
pW
->
objectName
()
==
"UBActionPreview"
||
pW
->
objectName
()
==
"UBLinkPreview"
||
pW
->
objectName
()
==
"UBCommentsPreview"
){
// Here we delete all preview widget excepting the media because they are handled by the data manager
delete
pW
;
pW
=
NULL
;
}
}
mStoredWidgets
.
clear
();
}
}
void
UBTeacherBarPreviewWidget
::
clean
()
{
mMediaViewer
.
cleanMedia
();
// Session Title
mpSessionTitle
->
setText
(
mpDataMgr
->
sessionTitle
());
foreach
(
QWidget
*
eachWidget
,
mStoredWidgets
){
delete
eachWidget
;
eachWidget
=
NULL
;
// Page Title
if
(
""
!=
mpDataMgr
->
pageTitle
()){
mpTitle
->
setText
(
mpDataMgr
->
pageTitle
());
mpPageNbrLabel
->
setText
(
tr
(
"Page n° %0"
).
arg
(
UBApplication
::
boardController
->
activeSceneIndex
()));
mTitleContainer
.
setVisible
(
true
);
}
else
{
mTitleContainer
.
setVisible
(
false
);
}
mStoredWidgets
.
clear
();
hideElements
();
// Actions
generateActions
();
// Media
generateMedias
();
// Links
generateLinks
();
// Comments
generateComments
();
}
void
UBTeacherBarPreviewWidget
::
hideElement
s
()
void
UBTeacherBarPreviewWidget
::
clearField
s
()
{
mpActionsLabel
=
new
QLabel
(
tr
(
"Actions"
),
this
);
mpActionsLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mpMediaLabel
=
new
QLabel
(
tr
(
"Medias"
),
this
);
mpMediaLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mpCommentsLabel
=
new
QLabel
(
tr
(
"Comments"
),
this
);
mpCommentsLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mpComments
=
new
QLabel
(
this
);
mpComments
->
setWordWrap
(
true
);
mpComments
->
setObjectName
(
"UBTeacherBarPreviewComments"
);
mpLinksLabel
=
new
QLabel
(
tr
(
"Links"
),
this
);
mpLinksLabel
->
setObjectName
(
"UBTeacherBarPreviewSubtitle"
);
mpActionsLabel
->
setVisible
(
false
);
mpMediaLabel
->
setVisible
(
false
);
mpCommentsLabel
->
setVisible
(
false
);
mpComments
->
setVisible
(
false
);
mpLinksLabel
->
setVisible
(
false
);
}
void
UBTeacherBarPreviewWidget
::
setActions
(
QStringList
actions
)
void
UBTeacherBarPreviewWidget
::
generateActions
(
)
{
if
(
!
actions
.
empty
()){
mWidgets
.
clear
();
mpActionsLabel
->
setVisible
(
true
);
mWidgets
<<
mpActionsLabel
;
mediaViewer
()
->
loadWidgets
(
mWidgets
,
false
);
mWidgets
.
clear
();
foreach
(
QString
action
,
actions
){
QStringList
desc
=
action
.
split
(
';'
);
if
(
2
<=
desc
.
size
()){
QString
owner
=
desc
.
at
(
0
);
QString
act
=
desc
.
at
(
1
);
mpTmpAction
=
new
UBActionPreview
(
this
);
mpTmpAction
->
setOwner
(
owner
);
mpTmpAction
->
setContent
(
act
);
mWidgets
<<
mpTmpAction
;
}
if
(
!
mpDataMgr
->
actions
()
->
empty
()){
foreach
(
sAction
act
,
*
mpDataMgr
->
actions
()){
mpTmpAction
=
new
UBActionPreview
(
this
);
mpTmpAction
->
setOwner
(
act
.
type
);
mpTmpAction
->
setContent
(
act
.
content
);
mpContentContainer
->
addWidget
(
mpTmpAction
);
mStoredWidgets
<<
mpTmpAction
;
}
mMediaViewer
.
loadWidgets
(
mWidgets
,
true
);
}
}
void
UBTeacherBarPreviewWidget
::
setLinks
(
QStringList
links
)
void
UBTeacherBarPreviewWidget
::
generateMedias
(
)
{
if
(
!
links
.
empty
()){
mWidgets
.
clear
();
mpLinksLabel
->
setVisible
(
true
);
mWidgets
<<
mpLinksLabel
;
mMediaViewer
.
loadWidgets
(
mWidgets
,
false
);
mWidgets
.
clear
();
foreach
(
QString
link
,
links
){
mpTmpLink
=
new
QLabel
(
link
,
this
);
mpTmpLink
->
setOpenExternalLinks
(
true
);
mWidgets
<<
mpTmpLink
;
foreach
(
QWidget
*
pMedia
,
*
mpDataMgr
->
medias
()){
if
(
NULL
!=
pMedia
){
mpContentContainer
->
addWidget
(
pMedia
);
mStoredWidgets
<<
pMedia
;
}
mMediaViewer
.
loadWidgets
(
mWidgets
,
true
);
}
}
void
UBTeacherBarPreviewWidget
::
updateField
s
()
void
UBTeacherBarPreviewWidget
::
generateLink
s
()
{
if
(
!
mpDataMgr
->
urls
()
->
empty
()){
foreach
(
sLink
link
,
*
mpDataMgr
->
urls
()){
mpTmpLink
=
new
QLabel
(
QString
(
"<a href='%0'>%1</a>"
).
arg
(
link
.
link
).
arg
(
link
.
title
),
this
);
mpTmpLink
->
setObjectName
(
"UBLinkPreview"
);
mpContentContainer
->
addWidget
(
mpTmpLink
);
mStoredWidgets
<<
mpTmpLink
;
}
}
}
void
UBTeacherBarPreviewWidget
::
clearField
s
()
void
UBTeacherBarPreviewWidget
::
generateComment
s
()
{
if
(
""
!=
mpDataMgr
->
comments
()){
mpTmpComment
=
new
QTextEdit
(
this
);
mpTmpComment
->
setObjectName
(
"UBCommentPreview"
);
mpTmpComment
->
setPlainText
(
mpDataMgr
->
comments
());
mpTmpComment
->
setReadOnly
(
true
);
mpContentContainer
->
addWidget
(
mpTmpComment
);
mStoredWidgets
<<
mpTmpComment
;
}
}
src/gui/UBTeacherBarPreviewWidget.h
View file @
a3753229
...
...
@@ -4,6 +4,7 @@
#include <QLabel>
#include <QVBoxLayout>
#include <QPushButton>
#include <QFrame>
#include "core/UBPersistenceManager.h"
#include "customWidgets/UBWidgetList.h"
...
...
@@ -30,12 +31,12 @@ class UBActionPreview : public QWidget
public
:
UBActionPreview
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBActionPreview"
);
~
UBActionPreview
();
void
setOwner
(
const
QString
&
owner
);
void
setOwner
(
int
owner
);
void
setContent
(
const
QString
&
content
);
private
:
QLabel
*
mpOwner
;
Q
Label
*
mpContent
;
Q
TextEdit
*
mpContent
;
QVBoxLayout
mLayout
;
QHBoxLayout
mOwnerLayout
;
...
...
@@ -48,19 +49,19 @@ public:
~
UBTBPreviewContainer
();
};
class
UBTBPreviewSeparator
:
public
QFrame
{
public
:
UBTBPreviewSeparator
(
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTBPreviewSeparator"
);
~
UBTBPreviewSeparator
();
};
class
UBTeacherBarPreviewWidget
:
public
QWidget
{
Q_OBJECT
public
:
UBTeacherBarPreviewWidget
(
UBTeacherBarDataMgr
*
pDataMgr
,
QWidget
*
parent
=
0
,
const
char
*
name
=
"UBTeacherBarPreviewWidget"
);
~
UBTeacherBarPreviewWidget
();
UBTeacherBarPreviewMedia
*
mediaViewer
()
{
return
&
mMediaViewer
;}
void
setTitle
(
const
QString
&
title
);
void
setComments
(
const
QString
&
comments
);
void
setActions
(
QStringList
actions
);
void
setLinks
(
QStringList
links
);
void
clean
();
QLabel
*
mediaLabel
()
{
return
mpMediaLabel
;}
void
updateFields
();
void
clearFields
();
...
...
@@ -69,29 +70,47 @@ signals:
private
slots
:
void
onEdit
();
void
onActiveSceneChanged
();
private
:
void
hideElements
();
void
generateActions
();
void
generateMedias
();
void
generateLinks
();
void
generateComments
();
QVBoxLayout
mLayout
;
QHBoxLayout
mEditLayout
;
QHBoxLayout
mTitleDurationLayout
;
UBTeacherBarPreviewMedia
mMediaViewer
;
QList
<
QWidget
*>
mWidgets
;
QList
<
QWidget
*>
mStoredWidgets
;
QPushButton
*
mpEditButton
;
// Titles
QVBoxLayout
mTitleLayout
;
UBTBPreviewSeparator
mTitleSeparator
;
QWidget
mTitleContainer
;
QLabel
*
mpSessionTitle
;
QLabel
*
mpTitle
;
QLabel
*
mpDuration
;
QLabel
*
mpActionsLabel
;
QLabel
*
mpMediaLabel
;
QLabel
*
mpCommentsLabel
;
QLabel
*
mpComments
;
QLabel
*
mpLinksLabel
;
QLabel
*
mpTmpLink
;
UBActionPreview
*
mpTmpAction
;
QLabel
*
mpTitleLabel
;
QLabel
*
mpPageNbrLabel
;
UBTBPreviewContainer
*
mpContentContainer
;
// Schedule
QLabel
*
mpScheduleLabel
;
// License
UBTBPreviewSeparator
mLicenseSeparator
;
QLabel
*
mpLicenseLabel
;
/** Pointer to the datas */
UBTeacherBarDataMgr
*
mpDataMgr
;
/** The list of stored widgets */
QList
<
QWidget
*>
mStoredWidgets
;
/** A temporary action widget */
UBActionPreview
*
mpTmpAction
;
/** A temporary media widget */
UBTeacherBarPreviewMedia
*
mpTmpMedia
;
/** A temporary link */
QLabel
*
mpTmpLink
;
/** A temporary comments field */
QTextEdit
*
mpTmpComment
;
};
#endif // UBTEACHERBARPREVIEWWIDGET_H
src/gui/UBTeacherBarWidget.cpp
View file @
a3753229
...
...
@@ -39,13 +39,13 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock
// Create the GUI
setLayout
(
&
mLayout
);
mpPageEditWidget
=
new
UBTBPageEditWidget
(
&
mData
,
this
);
mpPreview
=
new
UBTeacherBarPreviewWidget
(
&
mData
,
this
);
mpDocPreviewWidget
=
new
UBTBDocumentPreviewWidget
(
&
mData
,
this
);
mpDocEditWidget
=
new
UBTBDocumentEditWidget
(
&
mData
,
this
);
mpStackWidget
=
new
QStackedWidget
(
this
);
mLayout
.
addWidget
(
mpStackWidget
);
mpPageEditWidget
=
new
UBTBPageEditWidget
(
&
mData
,
mpStackWidget
);
mpPreview
=
new
UBTeacherBarPreviewWidget
(
&
mData
,
mpStackWidget
);
mpDocPreviewWidget
=
new
UBTBDocumentPreviewWidget
(
&
mData
,
mpStackWidget
);
mpDocEditWidget
=
new
UBTBDocumentEditWidget
(
&
mData
,
mpStackWidget
);
mpStackWidget
->
addWidget
(
mpPageEditWidget
);
mpStackWidget
->
addWidget
(
mpPreview
);
mpStackWidget
->
addWidget
(
mpDocPreviewWidget
);
...
...
@@ -120,7 +120,7 @@ void UBTeacherBarWidget::loadContent(bool docChanged)
// Update the fields
mpPageEditWidget
->
updateFields
();
mpPreview
->
updateFields
();
//
mpPreview->updateFields();
if
(
docChanged
){
mpDocEditWidget
->
updateFields
();
mpDocPreviewWidget
->
updateFields
();
...
...
@@ -155,15 +155,19 @@ void UBTeacherBarWidget::onTBStateChanged(eTeacherBarState state)
{
switch
(
state
){
case
eTeacherBarState_DocumentEdit
:
//mpDocEditWidget->updateFields();
mpStackWidget
->
setCurrentWidget
(
mpDocEditWidget
);
break
;
case
eTeacherBarState_DocumentPreview
:
//mpDocPreviewWidget->updateFields();
mpStackWidget
->
setCurrentWidget
(
mpDocPreviewWidget
);
break
;
case
eTeacherBarState_PageEdit
:
mpPageEditWidget
->
updateFields
();
mpStackWidget
->
setCurrentWidget
(
mpPageEditWidget
);
break
;
case
eTeacherBarState_PagePreview
:
mpPreview
->
updateFields
();
mpStackWidget
->
setCurrentWidget
(
mpPreview
);
break
;
}
...
...
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