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