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()); mInteractiveUserDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->uniboardInteractiveUserDirectory());
mAnimationUserDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->animationUserDirectory());
createInternalWidgetItems(); createInternalWidgetItems();
} }
@ -103,8 +105,12 @@ void UBLibraryController::routeItem(QString& pItem, QString pMiddleDirectory)
destination = mVideoStandardDirectoryPath.toLocalFile(); destination = mVideoStandardDirectoryPath.toLocalFile();
else if (mimetype.contains("image")) else if (mimetype.contains("image"))
destination = mPicturesStandardDirectoryPath.toLocalFile(); destination = mPicturesStandardDirectoryPath.toLocalFile();
else if (mimetype.contains("application")) else if (mimetype.contains("application")){
destination = UBSettings::settings()->uniboardInteractiveUserDirectory(); if (mimetype.contains("x-shockwave-flash"))
destination = mAnimationUserDirectoryPath.toLocalFile();
else
destination = mInteractiveUserDirectoryPath.toLocalFile();
}
else{ else{
return; return;
} }
@ -225,6 +231,13 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
element->setMoveable(false); element->setMoveable(false);
categories << element; 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(); categories << UBLibElement::trashElement();

@ -139,6 +139,7 @@ class UBLibraryController : public QObject
QUrl mPicturesStandardDirectoryPath; QUrl mPicturesStandardDirectoryPath;
QUrl mInteractiveUserDirectoryPath; QUrl mInteractiveUserDirectoryPath;
QUrl mInteractiveCategoryPath; QUrl mInteractiveCategoryPath;
QUrl mAnimationUserDirectoryPath;
QStringList addItemsToCurrentLibrary(const QDir& pSelectedFolder, const QStringList& pExtensions); 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 UBSettings::uniboardInteractiveUserDirectory()
{ {
QString valideUserInteractiveDirectory = uniboardDataDirectory() + "/interactive content"; QString valideUserInteractiveDirectory = uniboardDataDirectory() + "/interactive content";

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

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

Loading…
Cancel
Save