|
|
@ -365,9 +365,33 @@ void UBTeacherBarWidget::loadContent() |
|
|
|
}else{ |
|
|
|
}else{ |
|
|
|
mpPreview->setDuration(eDuration_ThreeQuarter); |
|
|
|
mpPreview->setDuration(eDuration_ThreeQuarter); |
|
|
|
} |
|
|
|
} |
|
|
|
mpPreview->setComments(mpComments->document()->toPlainText()); |
|
|
|
|
|
|
|
mpPreview->mediaViewer()->cleanMedia(); |
|
|
|
mpPreview->clean(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the actions
|
|
|
|
|
|
|
|
if(!mActionList.empty()){ |
|
|
|
|
|
|
|
QStringList actions; |
|
|
|
|
|
|
|
foreach(UBTeacherStudentAction* action, mActionList){ |
|
|
|
|
|
|
|
QString desc = QString("%0;%1").arg(action->comboValue()).arg(action->text()); |
|
|
|
|
|
|
|
actions << desc; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mpPreview->setActions(actions); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the media
|
|
|
|
mpPreview->mediaViewer()->loadMedia(nextInfos.medias); |
|
|
|
mpPreview->mediaViewer()->loadMedia(nextInfos.medias); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the links
|
|
|
|
|
|
|
|
if(!mUrlList.empty()){ |
|
|
|
|
|
|
|
QStringList links; |
|
|
|
|
|
|
|
foreach(UBUrlWidget* url, mUrlList){ |
|
|
|
|
|
|
|
links << url->url(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mpPreview->setLinks(links); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the comments
|
|
|
|
|
|
|
|
mpPreview->setComments(mpComments->document()->toPlainText()); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
@ -697,6 +721,7 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char |
|
|
|
, mpMediaLabel(NULL) |
|
|
|
, mpMediaLabel(NULL) |
|
|
|
, mpCommentsLabel(NULL) |
|
|
|
, mpCommentsLabel(NULL) |
|
|
|
, mpComments(NULL) |
|
|
|
, mpComments(NULL) |
|
|
|
|
|
|
|
, mpLinksLabel(NULL) |
|
|
|
{ |
|
|
|
{ |
|
|
|
setObjectName(name); |
|
|
|
setObjectName(name); |
|
|
|
|
|
|
|
|
|
|
@ -733,6 +758,8 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char |
|
|
|
//mLayout.addLayout(&mMediaLabelLayout, 0);
|
|
|
|
//mLayout.addLayout(&mMediaLabelLayout, 0);
|
|
|
|
mLayout.addWidget(&mMediaViewer, 1); |
|
|
|
mLayout.addWidget(&mMediaViewer, 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mpLinksLabel = new QLabel(tr("Links"), this); |
|
|
|
|
|
|
|
mpLinksLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
|
|
|
|
|
|
|
|
// Comments
|
|
|
|
// Comments
|
|
|
|
mpCommentsLabel = new QLabel(tr("Comments"), this); |
|
|
|
mpCommentsLabel = new QLabel(tr("Comments"), this); |
|
|
@ -760,6 +787,10 @@ UBTeacherBarPreviewWidget::UBTeacherBarPreviewWidget(QWidget *parent, const char |
|
|
|
|
|
|
|
|
|
|
|
UBTeacherBarPreviewWidget::~UBTeacherBarPreviewWidget() |
|
|
|
UBTeacherBarPreviewWidget::~UBTeacherBarPreviewWidget() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if(NULL != mpLinksLabel){ |
|
|
|
|
|
|
|
delete mpLinksLabel; |
|
|
|
|
|
|
|
mpLinksLabel = NULL; |
|
|
|
|
|
|
|
} |
|
|
|
if(NULL != mpComments){ |
|
|
|
if(NULL != mpComments){ |
|
|
|
delete mpComments; |
|
|
|
delete mpComments; |
|
|
|
mpComments = NULL; |
|
|
|
mpComments = NULL; |
|
|
@ -825,8 +856,64 @@ void UBTeacherBarPreviewWidget::setDuration(eDuration duration) |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewWidget::setComments(const QString &comments) |
|
|
|
void UBTeacherBarPreviewWidget::setComments(const QString &comments) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if(NULL != mpComments){ |
|
|
|
if("" != comments){ |
|
|
|
|
|
|
|
mWidgets.clear(); |
|
|
|
mpComments->setText(comments); |
|
|
|
mpComments->setText(comments); |
|
|
|
|
|
|
|
mpComments->setVisible(true); |
|
|
|
|
|
|
|
mpCommentsLabel->setVisible(true); |
|
|
|
|
|
|
|
mWidgets << mpCommentsLabel; |
|
|
|
|
|
|
|
mWidgets << mpComments; |
|
|
|
|
|
|
|
mMediaViewer.loadWidgets(mWidgets); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewWidget::clean() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mMediaViewer.cleanMedia(); |
|
|
|
|
|
|
|
hideElements(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewWidget::hideElements() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
mpActionsLabel->setVisible(false); |
|
|
|
|
|
|
|
mpMediaLabel->setVisible(false); |
|
|
|
|
|
|
|
mpCommentsLabel->setVisible(false); |
|
|
|
|
|
|
|
mpComments->setVisible(false); |
|
|
|
|
|
|
|
mpLinksLabel->setVisible(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewWidget::setActions(QStringList actions) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(!actions.empty()){ |
|
|
|
|
|
|
|
mWidgets.clear(); |
|
|
|
|
|
|
|
mpActionsLabel->setVisible(true); |
|
|
|
|
|
|
|
mWidgets << mpActionsLabel; |
|
|
|
|
|
|
|
foreach(QString action, actions){ |
|
|
|
|
|
|
|
QStringList desc = action.split(';'); |
|
|
|
|
|
|
|
if(2 <= desc.size()){ |
|
|
|
|
|
|
|
QString owner = desc.at(0); |
|
|
|
|
|
|
|
QString act = desc.at(1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// TODO : Create the action widget here and add it to mWidgets
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mMediaViewer.loadWidgets(mWidgets); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewWidget::setLinks(QStringList links) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(!links.empty()){ |
|
|
|
|
|
|
|
mWidgets.clear(); |
|
|
|
|
|
|
|
mpLinksLabel->setVisible(true); |
|
|
|
|
|
|
|
mWidgets << mpLinksLabel; |
|
|
|
|
|
|
|
foreach(QString link, links){ |
|
|
|
|
|
|
|
mpTmpLink = new QLabel(link, this); |
|
|
|
|
|
|
|
mpTmpLink->setOpenExternalLinks(true); |
|
|
|
|
|
|
|
mWidgets << mpTmpLink; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
mMediaViewer.loadWidgets(mWidgets); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -853,9 +940,11 @@ UBTeacherBarPreviewMedia::~UBTeacherBarPreviewMedia() |
|
|
|
void UBTeacherBarPreviewMedia::cleanMedia() |
|
|
|
void UBTeacherBarPreviewMedia::cleanMedia() |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach(QWidget* eachWidget, mWidgetList.keys()){ |
|
|
|
foreach(QWidget* eachWidget, mWidgetList.keys()){ |
|
|
|
|
|
|
|
if(QString(eachWidget->metaObject()->className()).contains("UBDraggable")){ |
|
|
|
delete eachWidget; |
|
|
|
delete eachWidget; |
|
|
|
eachWidget = NULL; |
|
|
|
eachWidget = NULL; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
mWidgetList.clear(); |
|
|
|
mWidgetList.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|