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. 44
      src/core/UBSettings.cpp
  5. 4
      src/core/UBSettings.h

@ -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 <UBFeature>();
@ -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)

@ -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;

@ -268,7 +268,6 @@ QList<UBLibElement*> 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<UBLibElement*> 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<UBLibElement*> UBLibraryController::listElementsInPath(const QString& pPath)

@ -946,7 +946,7 @@ QString UBSettings::userSearchDirectory()
QString UBSettings::applicationImageLibraryDirectory()
{
QString defaultRelativePath = QString("./library/image");
QString defaultRelativePath = QString("./library/pictures");
QString configPath = value("Library/ImageDirectory", QVariant(defaultRelativePath)).toString();
@ -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 = "";

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

Loading…
Cancel
Save