diff --git a/src/board/UBFeaturesController.cpp b/src/board/UBFeaturesController.cpp index 5bd9f5b7..de3631f0 100644 --- a/src/board/UBFeaturesController.cpp +++ b/src/board/UBFeaturesController.cpp @@ -71,11 +71,15 @@ void UBFeaturesController::initDirectoryTree() mUserAnimationDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->userAnimationDirectory() ); mLibPicturesDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationImageLibraryDirectory() ); + qDebug() << mLibPicturesDirectoryPath; mLibInteractiveDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationInteractivesDirectory() ); mLibApplicationsDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationApplicationsLibraryDirectory() ); mLibShapesDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationShapeLibraryDirectory() ); mLibSearchDirectoryPath =QUrl::fromLocalFile( UBSettings::settings()->userSearchDirectory() ); trashDirectoryPath = QUrl::fromLocalFile( UBSettings::userTrashDirPath() ); + mLibAudiosDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationAudiosLibraryDirectory()); + mLibVideosDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationVideosLibraryDirectory()); + mLibAnimationsDirectoryPath = QUrl::fromLocalFile(UBSettings::settings()->applicationAnimationsLibraryDirectory()); featuresList = new QList (); @@ -135,7 +139,9 @@ void UBFeaturesController::initDirectoryTree() fileSystemScan( trashDirectoryPath, trashPath ); fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search" ); - + fileSystemScan( mLibAudiosDirectoryPath, audiosPath); + fileSystemScan( mLibVideosDirectoryPath, moviesPath); + fileSystemScan( mLibAnimationsDirectoryPath, flashPath); } void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QString & currVirtualPath) diff --git a/src/board/UBFeaturesController.h b/src/board/UBFeaturesController.h index 254514a4..e406379e 100644 --- a/src/board/UBFeaturesController.h +++ b/src/board/UBFeaturesController.h @@ -112,13 +112,14 @@ private: QUrl mUserAnimationDirectoryPath; QString libraryPath; - QUrl mLibAudioDirectoryPath; - QUrl mLibVideoDirectoryPath; QUrl mLibPicturesDirectoryPath; + QUrl mLibAudiosDirectoryPath; + QUrl mLibVideosDirectoryPath; QUrl mLibInteractiveDirectoryPath; - QUrl mLibAnimationDirectoryPath; + QUrl mLibAnimationsDirectoryPath; QUrl mLibApplicationsDirectoryPath; QUrl mLibShapesDirectoryPath; + QUrl trashDirectoryPath; QUrl mLibSearchDirectoryPath; diff --git a/src/board/UBLibraryController.cpp b/src/board/UBLibraryController.cpp index 500de569..d874a829 100644 --- a/src/board/UBLibraryController.cpp +++ b/src/board/UBLibraryController.cpp @@ -268,7 +268,6 @@ QList UBLibraryController::rootCategoriesList() element->setMoveable(false); categories << element; -// Note : FEATURE IN DEVELOPMENT, DO NOT ERASE (or you will get problems) !!!! mSearchCategoryPath = QUrl::fromLocalFile(UBSettings::userSearchDirectory()); element = new UBLibElement(eUBLibElementType_Folder, mSearchCategoryPath, tr("Web Search", "Web search category element")); element->setThumbnail(QImage(":images/libpalette/WebSearchCategory.svg")); @@ -357,8 +356,18 @@ QList UBLibraryController::addVirtualElementsForItemPath(const QS else if (pPath == mInteractiveCategoryPath.toLocalFile()){ content << listElementsInPath(UBSettings::settings()->applicationInteractivesDirectory()); } + else if (pPath == mAudioStandardDirectoryPath.toLocalFile()){ + content << listElementsInPath(UBSettings::settings()->applicationAudiosLibraryDirectory()); + } + else if (pPath == mVideoStandardDirectoryPath.toLocalFile()){ + content << listElementsInPath(UBSettings::settings()->applicationVideosLibraryDirectory()); + } + else if (pPath == mAnimationUserDirectoryPath.toLocalFile()){ + content << listElementsInPath(UBSettings::settings()->applicationAnimationsLibraryDirectory()); + } return content; + } QList UBLibraryController::listElementsInPath(const QString& pPath) diff --git a/src/core/UBSettings.cpp b/src/core/UBSettings.cpp index d69a2436..e8992d21 100644 --- a/src/core/UBSettings.cpp +++ b/src/core/UBSettings.cpp @@ -946,9 +946,9 @@ QString UBSettings::userSearchDirectory() QString UBSettings::applicationImageLibraryDirectory() { - QString defaultRelativePath = QString("./library/image"); + QString defaultRelativePath = QString("./library/pictures"); - QString configPath = value("Library/ImageDirectory", QVariant(defaultRelativePath)).toString(); + QString configPath = value("Library/ImageDirectory", QVariant(defaultRelativePath)).toString(); if (configPath.startsWith(".")) { return UBPlatformUtils::applicationResourcesDirectory() + configPath.right(configPath.size() - 1); @@ -1016,6 +1016,48 @@ QString UBSettings::applicationApplicationsLibraryDirectory() } +QString UBSettings::applicationAudiosLibraryDirectory() +{ + QString defaultRelativePath = QString("./library/audios"); + + QString configPath = value("Library/AudiosDirectory", QVariant(defaultRelativePath)).toString(); + + if (configPath.startsWith(".")) { + return UBPlatformUtils::applicationResourcesDirectory() + configPath.right(configPath.size() - 1); + } + else { + return configPath; + } +} + +QString UBSettings::applicationVideosLibraryDirectory() +{ + QString defaultRelativePath = QString("./library/videos"); + + QString configPath = value("Library/VideosDirectory", QVariant(defaultRelativePath)).toString(); + + if (configPath.startsWith(".")) { + return UBPlatformUtils::applicationResourcesDirectory() + configPath.right(configPath.size() - 1); + } + else { + return configPath; + } +} + +QString UBSettings::applicationAnimationsLibraryDirectory() +{ + QString defaultRelativePath = QString("./library/animations"); + + QString configPath = value("Library/AnimationsDirectory", QVariant(defaultRelativePath)).toString(); + + if (configPath.startsWith(".")) { + return UBPlatformUtils::applicationResourcesDirectory() + configPath.right(configPath.size() - 1); + } + else { + return configPath; + } +} + QString UBSettings::userInteractiveFavoritesDirectory() { static QString dirPath = ""; diff --git a/src/core/UBSettings.h b/src/core/UBSettings.h index 115db362..72e05c79 100644 --- a/src/core/UBSettings.h +++ b/src/core/UBSettings.h @@ -121,7 +121,9 @@ class UBSettings : public QObject QString applicationInteractivesDirectory(); QString applicationCustomizationDirectory(); QString applicationCustomFontDirectory(); - + QString applicationAudiosLibraryDirectory(); + QString applicationVideosLibraryDirectory(); + QString applicationAnimationsLibraryDirectory(); QNetworkProxy* httpProxy();