first draft of handling example files

preferencesAboutTextFull
Claudio Valerio 13 years ago
parent 2860788bc5
commit 9a7c2f8471
  1. 8
      src/board/UBFeaturesController.cpp
  2. 7
      src/board/UBFeaturesController.h
  3. 11
      src/board/UBLibraryController.cpp
  4. 46
      src/core/UBSettings.cpp
  5. 4
      src/core/UBSettings.h

@ -71,11 +71,15 @@ void UBFeaturesController::initDirectoryTree()
mUserAnimationDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->userAnimationDirectory() ); mUserAnimationDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->userAnimationDirectory() );
mLibPicturesDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationImageLibraryDirectory() ); mLibPicturesDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationImageLibraryDirectory() );
qDebug() << mLibPicturesDirectoryPath;
mLibInteractiveDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationInteractivesDirectory() ); mLibInteractiveDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationInteractivesDirectory() );
mLibApplicationsDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationApplicationsLibraryDirectory() ); mLibApplicationsDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationApplicationsLibraryDirectory() );
mLibShapesDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationShapeLibraryDirectory() ); mLibShapesDirectoryPath = QUrl::fromLocalFile( UBSettings::settings()->applicationShapeLibraryDirectory() );
mLibSearchDirectoryPath =QUrl::fromLocalFile( UBSettings::settings()->userSearchDirectory() ); mLibSearchDirectoryPath =QUrl::fromLocalFile( UBSettings::settings()->userSearchDirectory() );
trashDirectoryPath = QUrl::fromLocalFile( UBSettings::userTrashDirPath() ); 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 <UBFeature>(); featuresList = new QList <UBFeature>();
@ -135,7 +139,9 @@ void UBFeaturesController::initDirectoryTree()
fileSystemScan( trashDirectoryPath, trashPath ); fileSystemScan( trashDirectoryPath, trashPath );
fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search" ); fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search" );
fileSystemScan( mLibAudiosDirectoryPath, audiosPath);
fileSystemScan( mLibVideosDirectoryPath, moviesPath);
fileSystemScan( mLibAnimationsDirectoryPath, flashPath);
} }
void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QString & currVirtualPath) void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QString & currVirtualPath)

@ -112,13 +112,14 @@ private:
QUrl mUserAnimationDirectoryPath; QUrl mUserAnimationDirectoryPath;
QString libraryPath; QString libraryPath;
QUrl mLibAudioDirectoryPath;
QUrl mLibVideoDirectoryPath;
QUrl mLibPicturesDirectoryPath; QUrl mLibPicturesDirectoryPath;
QUrl mLibAudiosDirectoryPath;
QUrl mLibVideosDirectoryPath;
QUrl mLibInteractiveDirectoryPath; QUrl mLibInteractiveDirectoryPath;
QUrl mLibAnimationDirectoryPath; QUrl mLibAnimationsDirectoryPath;
QUrl mLibApplicationsDirectoryPath; QUrl mLibApplicationsDirectoryPath;
QUrl mLibShapesDirectoryPath; QUrl mLibShapesDirectoryPath;
QUrl trashDirectoryPath; QUrl trashDirectoryPath;
QUrl mLibSearchDirectoryPath; QUrl mLibSearchDirectoryPath;

@ -268,7 +268,6 @@ QList<UBLibElement*> UBLibraryController::rootCategoriesList()
element->setMoveable(false); element->setMoveable(false);
categories << element; categories << element;
// Note : FEATURE IN DEVELOPMENT, DO NOT ERASE (or you will get problems) !!!!
mSearchCategoryPath = QUrl::fromLocalFile(UBSettings::userSearchDirectory()); mSearchCategoryPath = QUrl::fromLocalFile(UBSettings::userSearchDirectory());
element = new UBLibElement(eUBLibElementType_Folder, mSearchCategoryPath, tr("Web Search", "Web search category element")); element = new UBLibElement(eUBLibElementType_Folder, mSearchCategoryPath, tr("Web Search", "Web search category element"));
element->setThumbnail(QImage(":images/libpalette/WebSearchCategory.svg")); element->setThumbnail(QImage(":images/libpalette/WebSearchCategory.svg"));
@ -357,8 +356,18 @@ QList<UBLibElement*> UBLibraryController::addVirtualElementsForItemPath(const QS
else if (pPath == mInteractiveCategoryPath.toLocalFile()){ else if (pPath == mInteractiveCategoryPath.toLocalFile()){
content << listElementsInPath(UBSettings::settings()->applicationInteractivesDirectory()); 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; return content;
} }
QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPath) QList<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPath)

@ -946,9 +946,9 @@ QString UBSettings::userSearchDirectory()
QString UBSettings::applicationImageLibraryDirectory() 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(".")) { if (configPath.startsWith(".")) {
return UBPlatformUtils::applicationResourcesDirectory() + configPath.right(configPath.size() - 1); 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() QString UBSettings::userInteractiveFavoritesDirectory()
{ {
static QString dirPath = ""; static QString dirPath = "";

@ -121,7 +121,9 @@ class UBSettings : public QObject
QString applicationInteractivesDirectory(); QString applicationInteractivesDirectory();
QString applicationCustomizationDirectory(); QString applicationCustomizationDirectory();
QString applicationCustomFontDirectory(); QString applicationCustomFontDirectory();
QString applicationAudiosLibraryDirectory();
QString applicationVideosLibraryDirectory();
QString applicationAnimationsLibraryDirectory();
QNetworkProxy* httpProxy(); QNetworkProxy* httpProxy();

Loading…
Cancel
Save