Progressing with the medias into the new teacherbar

preferencesAboutTextFull
shibakaneki 13 years ago
parent b8e1516698
commit 628f213f1b
  1. 13
      src/gui/UBTBPageEditWidget.cpp
  2. 3
      src/gui/UBTeacherBarDataMgr.cpp
  3. 2
      src/gui/UBTeacherBarDataMgr.h
  4. 2
      src/gui/UBTeacherBarPreviewWidget.cpp

@ -179,7 +179,7 @@ void UBTBPageEditWidget::saveFields()
{
mpDataMgr->actions()->clear();
mpDataMgr->urls()->clear();
mpDataMgr->mediaUrls().clear();
mpDataMgr->mediaUrls()->clear();
mpDataMgr->medias()->clear();
foreach(UBTeacherStudentAction* pAct, mActions){
@ -195,7 +195,8 @@ void UBTBPageEditWidget::saveFields()
mpDataMgr->urls()->append(link);
}
foreach(QString url, mMediaUrls){
mpDataMgr->mediaUrls().append(url);
qDebug() << "saving media :" << url;
mpDataMgr->mediaUrls()->append(url);
}
foreach(QWidget* pMedia, mMedias){
mpDataMgr->medias()->append(pMedia);
@ -215,15 +216,17 @@ void UBTBPageEditWidget::updateFields()
mpActions->addWidget(pAction);
}
// Medias
foreach(QString url, mpDataMgr->mediaUrls()){
if(url.isEmpty())
continue;
foreach(QString url, *mpDataMgr->mediaUrls()){
if(!url.isEmpty()){
mMediaUrls << url;
QWidget* pWidget = mpMediaContainer->generateMediaWidget(url);
if(pWidget != NULL){
mMedias << pWidget;
mpMediaContainer->addWidget(pWidget);
}
}
}
// Links
foreach(sLink link, *mpDataMgr->urls()){
UBUrlWidget* urlWidget = new UBUrlWidget(this);

@ -111,8 +111,5 @@ void UBTeacherBarDataMgr::loadContent(bool docChanged)
// Comments
mComments = nextInfos.comments;
// TODO : Read the document metadata file and populate the metadata infos here
}

@ -60,7 +60,7 @@ public:
// Medias
QVector<QWidget*>* medias(){return &mMediaList;}
void addMediaUrl(const QString& url){mMediaUrls << url;}
QStringList mediaUrls(){return mMediaUrls;}
QStringList* mediaUrls(){return &mMediaUrls;}
// Urls
QVector<sLink>* urls(){return &mUrlList;}

@ -313,7 +313,7 @@ void UBTeacherBarPreviewWidget::generateActions()
void UBTeacherBarPreviewWidget::generateMedias()
{
if(isVisible()){
foreach(QString mediaUrl, mpDataMgr->mediaUrls()){
foreach(QString mediaUrl, *mpDataMgr->mediaUrls()){
QString mimeType = UBFileSystemUtils::mimeTypeFromFileName(mediaUrl);
if(mimeType.contains("image")){
QPixmap pix = QPixmap(mediaUrl);

Loading…
Cancel
Save