|
|
@ -119,7 +119,7 @@ UBTeacherBarWidget::UBTeacherBarWidget(QWidget *parent, const char *name):UBDock |
|
|
|
mpLayout->addLayout(mpActionLayout, 0); |
|
|
|
mpLayout->addLayout(mpActionLayout, 0); |
|
|
|
|
|
|
|
|
|
|
|
// Media
|
|
|
|
// Media
|
|
|
|
mpMediaLabel = new QLabel(tr("Media"), mpContainer); |
|
|
|
mpMediaLabel = new QLabel(tr("Medias"), mpContainer); |
|
|
|
mpLayout->addWidget(mpMediaLabel, 0); |
|
|
|
mpLayout->addWidget(mpMediaLabel, 0); |
|
|
|
mpDropMediaZone = new UBTeacherBarDropMediaZone(mpContainer); |
|
|
|
mpDropMediaZone = new UBTeacherBarDropMediaZone(mpContainer); |
|
|
|
mpLayout->addWidget(mpDropMediaZone, 1); |
|
|
|
mpLayout->addWidget(mpDropMediaZone, 1); |
|
|
@ -380,7 +380,15 @@ void UBTeacherBarWidget::loadContent() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Add the media
|
|
|
|
// Add the media
|
|
|
|
mpPreview->mediaViewer()->loadMedia(nextInfos.medias); |
|
|
|
if(nextInfos.medias.count() > 0){ |
|
|
|
|
|
|
|
QList<QWidget*> widgetList; |
|
|
|
|
|
|
|
widgetList.append(mpPreview->mediaLabel()); |
|
|
|
|
|
|
|
mpPreview->mediaViewer()->loadWidgets(widgetList,false); |
|
|
|
|
|
|
|
int loadedMedia = mpPreview->mediaViewer()->loadMedia(nextInfos.medias); |
|
|
|
|
|
|
|
if(loadedMedia) |
|
|
|
|
|
|
|
mpPreview->mediaLabel()->setVisible(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Add the links
|
|
|
|
// Add the links
|
|
|
|
if(!mUrlList.empty()){ |
|
|
|
if(!mUrlList.empty()){ |
|
|
@ -879,8 +887,10 @@ void UBTeacherBarPreviewWidget::setComments(const QString &comments) |
|
|
|
mpComments->setVisible(true); |
|
|
|
mpComments->setVisible(true); |
|
|
|
mpCommentsLabel->setVisible(true); |
|
|
|
mpCommentsLabel->setVisible(true); |
|
|
|
mWidgets << mpCommentsLabel; |
|
|
|
mWidgets << mpCommentsLabel; |
|
|
|
|
|
|
|
mMediaViewer.loadWidgets(mWidgets, false); |
|
|
|
|
|
|
|
mWidgets.clear(); |
|
|
|
mWidgets << mpComments; |
|
|
|
mWidgets << mpComments; |
|
|
|
mMediaViewer.loadWidgets(mWidgets); |
|
|
|
mMediaViewer.loadWidgets(mWidgets, true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -894,7 +904,7 @@ void UBTeacherBarPreviewWidget::hideElements() |
|
|
|
{ |
|
|
|
{ |
|
|
|
mpActionsLabel = new QLabel(tr("Actions"), this); |
|
|
|
mpActionsLabel = new QLabel(tr("Actions"), this); |
|
|
|
mpActionsLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mpActionsLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mpMediaLabel = new QLabel(tr("Media"), this); |
|
|
|
mpMediaLabel = new QLabel(tr("Medias"), this); |
|
|
|
mpMediaLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mpMediaLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mpCommentsLabel = new QLabel(tr("Comments"), this); |
|
|
|
mpCommentsLabel = new QLabel(tr("Comments"), this); |
|
|
|
mpCommentsLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
|
mpCommentsLabel->setObjectName("UBTeacherBarPreviewSubtitle"); |
|
|
@ -917,6 +927,8 @@ void UBTeacherBarPreviewWidget::setActions(QStringList actions) |
|
|
|
mWidgets.clear(); |
|
|
|
mWidgets.clear(); |
|
|
|
mpActionsLabel->setVisible(true); |
|
|
|
mpActionsLabel->setVisible(true); |
|
|
|
mWidgets << mpActionsLabel; |
|
|
|
mWidgets << mpActionsLabel; |
|
|
|
|
|
|
|
mediaViewer()->loadWidgets(mWidgets,false); |
|
|
|
|
|
|
|
mWidgets.clear(); |
|
|
|
foreach(QString action, actions){ |
|
|
|
foreach(QString action, actions){ |
|
|
|
QStringList desc = action.split(';'); |
|
|
|
QStringList desc = action.split(';'); |
|
|
|
if(2 <= desc.size()){ |
|
|
|
if(2 <= desc.size()){ |
|
|
@ -928,7 +940,7 @@ void UBTeacherBarPreviewWidget::setActions(QStringList actions) |
|
|
|
mWidgets << mpTmpAction; |
|
|
|
mWidgets << mpTmpAction; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
mMediaViewer.loadWidgets(mWidgets); |
|
|
|
mMediaViewer.loadWidgets(mWidgets, true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -938,12 +950,14 @@ void UBTeacherBarPreviewWidget::setLinks(QStringList links) |
|
|
|
mWidgets.clear(); |
|
|
|
mWidgets.clear(); |
|
|
|
mpLinksLabel->setVisible(true); |
|
|
|
mpLinksLabel->setVisible(true); |
|
|
|
mWidgets << mpLinksLabel; |
|
|
|
mWidgets << mpLinksLabel; |
|
|
|
|
|
|
|
mMediaViewer.loadWidgets(mWidgets, false); |
|
|
|
|
|
|
|
mWidgets.clear(); |
|
|
|
foreach(QString link, links){ |
|
|
|
foreach(QString link, links){ |
|
|
|
mpTmpLink = new QLabel(link, this); |
|
|
|
mpTmpLink = new QLabel(link, this); |
|
|
|
mpTmpLink->setOpenExternalLinks(true); |
|
|
|
mpTmpLink->setOpenExternalLinks(true); |
|
|
|
mWidgets << mpTmpLink; |
|
|
|
mWidgets << mpTmpLink; |
|
|
|
} |
|
|
|
} |
|
|
|
mMediaViewer.loadWidgets(mWidgets); |
|
|
|
mMediaViewer.loadWidgets(mWidgets, true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -983,17 +997,18 @@ void UBTeacherBarPreviewMedia::cleanMedia() |
|
|
|
mWidgetList.clear(); |
|
|
|
mWidgetList.clear(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewMedia::loadWidgets(QList<QWidget*> pWidgetsList) |
|
|
|
void UBTeacherBarPreviewMedia::loadWidgets(QList<QWidget*> pWidgetsList, bool isResizable) |
|
|
|
{ |
|
|
|
{ |
|
|
|
foreach(QWidget*eachWidget, pWidgetsList){ |
|
|
|
foreach(QWidget*eachWidget, pWidgetsList){ |
|
|
|
mWidget->addWidget(eachWidget); |
|
|
|
mWidget->addWidget(eachWidget,isResizable); |
|
|
|
mWidgetList[eachWidget]="DRAG UNAVAILABLE"; |
|
|
|
mWidgetList[eachWidget]="DRAG UNAVAILABLE"; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias) |
|
|
|
int UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
int addedMedia = 0; |
|
|
|
foreach(QString eachString, pMedias){ |
|
|
|
foreach(QString eachString, pMedias){ |
|
|
|
if(!eachString.isEmpty()){ |
|
|
|
if(!eachString.isEmpty()){ |
|
|
|
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString); |
|
|
|
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(eachString); |
|
|
@ -1002,12 +1017,14 @@ void UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias) |
|
|
|
label->loadImage(eachString); |
|
|
|
label->loadImage(eachString); |
|
|
|
mWidget->addWidget(label); |
|
|
|
mWidget->addWidget(label); |
|
|
|
mWidgetList[label]=eachString; |
|
|
|
mWidgetList[label]=eachString; |
|
|
|
|
|
|
|
addedMedia += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
else if(mimeType.contains("video") || mimeType.contains("audio")){ |
|
|
|
else if(mimeType.contains("video") || mimeType.contains("audio")){ |
|
|
|
UBDraggableMediaPlayer* mediaPlayer = new UBDraggableMediaPlayer(); |
|
|
|
UBDraggableMediaPlayer* mediaPlayer = new UBDraggableMediaPlayer(); |
|
|
|
mediaPlayer->setFile(eachString); |
|
|
|
mediaPlayer->setFile(eachString); |
|
|
|
mWidget->addWidget(mediaPlayer); |
|
|
|
mWidget->addWidget(mediaPlayer); |
|
|
|
mWidgetList[mediaPlayer] = eachString; |
|
|
|
mWidgetList[mediaPlayer] = eachString; |
|
|
|
|
|
|
|
addedMedia += 1; |
|
|
|
} |
|
|
|
} |
|
|
|
else{ |
|
|
|
else{ |
|
|
|
qWarning() << "pMediaPath" << eachString; |
|
|
|
qWarning() << "pMediaPath" << eachString; |
|
|
@ -1015,6 +1032,7 @@ void UBTeacherBarPreviewMedia::loadMedia(QStringList pMedias) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return addedMedia; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------------------------
|
|
|
|
// -----------------------------------------------------------------------------------------------
|
|
|
|