fixed issue af flash not showed

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent a7415550fe
commit 70efd6d93f
  1. 2
      src/gui/UBTeacherGuideWidget.cpp
  2. 13
      src/gui/UBTeacherGuideWidgetsTools.cpp
  3. 1
      src/gui/UBTeacherGuideWidgetsTools.h

@ -343,6 +343,8 @@ void UBTeacherGuideEditionWidget::onAddItemClicked(QTreeWidgetItem* widget, int
}
}
else if(column == 1 && addSubItemWidgetType == eUBTGAddSubItemWidgetType_None){
UBTGMediaWidget* media = dynamic_cast<UBTGMediaWidget*>(mpTreeWidget->itemWidget(widget,0));
if(media) media->removeSource();
int index = mpTreeWidget->currentIndex().row();
QTreeWidgetItem* toBeDeletedWidgetItem = widget->parent()->takeChild(index);
delete toBeDeletedWidgetItem;

@ -342,6 +342,15 @@ void UBTGMediaWidget::initializeWithDom(QDomElement element)
mIsInitializationMode = false;
}
void UBTGMediaWidget::removeSource()
{
QFileInfo fileInfo(mMediaPath);
if(fileInfo.isFile())
QFile(mMediaPath).remove();
else
UBFileSystemUtils::deleteDir(mMediaPath);
}
void UBTGMediaWidget::hideEvent(QHideEvent* event)
{
if(mpWebView)
@ -361,9 +370,11 @@ tUBGEElementNode* UBTGMediaWidget::saveData()
if(!mpTitle)
return 0;
tUBGEElementNode* result = new tUBGEElementNode();
QString relativePath = mMediaPath;
relativePath = relativePath.replace(UBApplication::boardController->activeDocument()->persistencePath()+"/","");
result->name = "media";
result->attributes.insert("title",mpTitle->text());
result->attributes.insert("relativePath",mMediaPath.replace(UBApplication::boardController->activeDocument()->persistencePath()+"/",""));
result->attributes.insert("relativePath",relativePath);
result->attributes.insert("mediaType",mMediaType);
return result;
}

@ -140,6 +140,7 @@ public:
~UBTGMediaWidget();
tUBGEElementNode* saveData();
void initializeWithDom(QDomElement element);
void removeSource();
protected:
void dragEnterEvent(QDragEnterEvent* event);

Loading…
Cancel
Save