shockwave-flash are stored in a new category called Animations. Those file are also automatically routed

preferencesAboutTextFull
Claudio Valerio 14 years ago
parent 62fd63785b
commit 2cd408aa7f
  1. 17
      src/board/UBLibraryController.cpp
  2. 1
      src/board/UBLibraryController.h
  3. 9
      src/core/UBSettings.cpp
  4. 1
      src/core/UBSettings.h
  5. 30
      src/gui/UBLibraryWidget.cpp

@ -50,6 +50,8 @@ UBLibraryController::UBLibraryController(QWidget *pParentWidget, UBBoardControll
mInteractiveUserDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveUserDirectory());
mAnimationUserDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->animationUserDirectory());
createInternalWidgetItems();
}
@ -103,8 +105,12 @@ void UBLibraryController::routeItem(QString& pItem, QString pMiddleDirectory)
destination = mVideoStandardDirectoryPath.toLocalFile();
else if (mimetype.contains("image"))
destination = mPicturesStandardDirectoryPath.toLocalFile();
else if (mimetype.contains("application"))
destination = UBSettings::settings()->uniboardInteractiveUserDirectory();
else if (mimetype.contains("application")){
if (mimetype.contains("x-shockwave-flash"))
destination = mAnimationUserDirectoryPath.toLocalFile();
else
destination = mInteractiveUserDirectoryPath.toLocalFile();
}
else{
return;
}
@ -225,6 +231,13 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
element->setMoveable(false);
categories << element;
categoryImage = new QImage(":images/libpalette/InteractivesCategory.svg");
element = new UBLibElement(eUBLibElementType_Folder, mAnimationUserDirectoryPath, tr("Animations", "Animations category element"));
element->setThumbnail(categoryImage);
element->setMoveable(false);
categories << element;
categories << UBLibElement::trashElement();

@ -139,6 +139,7 @@ class UBLibraryController : public QObject
QUrl mPicturesStandardDirectoryPath;
QUrl mInteractiveUserDirectoryPath;
QUrl mInteractiveCategoryPath;
QUrl mAnimationUserDirectoryPath;
QStringList addItemsToCurrentLibrary(const QDir& pSelectedFolder, const QStringList& pExtensions);

@ -1052,6 +1052,15 @@ QString UBSettings::uniboardDefaultUserImageLibraryDirectory()
}
QString UBSettings::animationUserDirectory()
{
QString animationDirectory = uniboardDataDirectory() + "/animationUserDirectory";
if (!QDir(animationDirectory).exists())
QDir().mkpath(animationDirectory);
return animationDirectory;
}
QString UBSettings::uniboardInteractiveUserDirectory()
{
QString valideUserInteractiveDirectory = uniboardDataDirectory() + "/interactive content";

@ -112,6 +112,7 @@ class UBSettings : public QObject
QString uniboardDefaultUserImageLibraryDirectory();
QString uniboardInteractiveUserDirectory();
QString animationUserDirectory();
QString uniboardInteractiveLibraryDirectory();
QString uniboardInteractiveFavoritesDirectory();
QString sankoreDistributedInteractiveDirectory();

@ -32,21 +32,21 @@ UBLibraryWidget::UBLibraryWidget(QWidget *parent, const char *name):UBThumbnailW
*/
UBLibraryWidget::~UBLibraryWidget()
{
//if(NULL != chainedElements)
//{
// delete chainedElements;
// chainedElements = NULL;
//}
//if(NULL != mpCrntDir)
//{
// delete mpCrntDir;
// mpCrntDir = NULL;
//}
//if(NULL != mpCrntElem)
//{
// delete mpCrntElem;
// mpCrntElem = NULL;
//}
// if(NULL != chainedElements)
// {
// delete chainedElements;
// chainedElements = NULL;
// }
// if(NULL != mpCrntDir)
// {
// delete mpCrntDir;
// mpCrntDir = NULL;
// }
// if(NULL != mpCrntElem)
// {
// delete mpCrntElem;
// mpCrntElem = NULL;
// }
}
/**

Loading…
Cancel
Save