|
|
@ -8,39 +8,37 @@ |
|
|
|
#include <QString> |
|
|
|
#include <QString> |
|
|
|
#include <QPixmap> |
|
|
|
#include <QPixmap> |
|
|
|
|
|
|
|
|
|
|
|
//#include "UBDockPaletteWidget.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
enum UBFeatureElementType |
|
|
|
enum UBFeatureElementType |
|
|
|
{ |
|
|
|
{ |
|
|
|
FEATURE_CATEGORY, |
|
|
|
FEATURE_CATEGORY, |
|
|
|
FEATURE_VIRTUALFOLDER, |
|
|
|
FEATURE_VIRTUALFOLDER, |
|
|
|
FEATURE_FOLDER, |
|
|
|
FEATURE_FOLDER, |
|
|
|
FEATURE_INTERACTIVE, |
|
|
|
FEATURE_INTERACTIVE, |
|
|
|
FEATURE_INTERNAL, |
|
|
|
FEATURE_INTERNAL, |
|
|
|
FEATURE_ITEM, |
|
|
|
FEATURE_ITEM, |
|
|
|
FEATURE_TRASH, |
|
|
|
FEATURE_TRASH, |
|
|
|
FEATURE_FAVORITE |
|
|
|
FEATURE_FAVORITE |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
class UBFeature |
|
|
|
class UBFeature |
|
|
|
{ |
|
|
|
{ |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeature() {;} |
|
|
|
UBFeature() {;} |
|
|
|
//UBFeature(const UBFeature &f);
|
|
|
|
//UBFeature(const UBFeature &f);
|
|
|
|
UBFeature(const QString &url, const QPixmap &icon, const QString &name, const QString &realPath, UBFeatureElementType type = FEATURE_CATEGORY); |
|
|
|
UBFeature(const QString &url, const QPixmap &icon, const QString &name, const QString &realPath, UBFeatureElementType type = FEATURE_CATEGORY); |
|
|
|
virtual ~UBFeature() {;} |
|
|
|
virtual ~UBFeature() {;} |
|
|
|
QString getName() const { return mName; } |
|
|
|
QString getName() const { return mName; } |
|
|
|
QPixmap getThumbnail() const {return mThumbnail;} |
|
|
|
QPixmap getThumbnail() const {return mThumbnail;} |
|
|
|
QString getUrl() const { return virtualPath; } |
|
|
|
QString getUrl() const { return virtualPath; } |
|
|
|
//QString getPath() const { return mPath; };
|
|
|
|
//QString getPath() const { return mPath; };
|
|
|
|
QString getFullPath() const { return mPath; } |
|
|
|
QString getFullPath() const { return mPath; } |
|
|
|
UBFeatureElementType getType() const { return elementType; } |
|
|
|
UBFeatureElementType getType() const { return elementType; } |
|
|
|
bool isFolder() const; |
|
|
|
bool isFolder() const; |
|
|
|
private: |
|
|
|
private: |
|
|
|
QString virtualPath; |
|
|
|
QString virtualPath; |
|
|
|
QPixmap mThumbnail; |
|
|
|
QPixmap mThumbnail; |
|
|
|
QString mName; |
|
|
|
QString mName; |
|
|
|
QString mPath; |
|
|
|
QString mPath; |
|
|
|
UBFeatureElementType elementType; |
|
|
|
UBFeatureElementType elementType; |
|
|
|
}; |
|
|
|
}; |
|
|
|
Q_DECLARE_METATYPE( UBFeature ) |
|
|
|
Q_DECLARE_METATYPE( UBFeature ) |
|
|
@ -50,73 +48,73 @@ class UBFeaturesController : public QObject |
|
|
|
{ |
|
|
|
{ |
|
|
|
Q_OBJECT |
|
|
|
Q_OBJECT |
|
|
|
public: |
|
|
|
public: |
|
|
|
UBFeaturesController(QWidget *parentWidget); |
|
|
|
UBFeaturesController(QWidget *parentWidget); |
|
|
|
virtual ~UBFeaturesController(); |
|
|
|
virtual ~UBFeaturesController(); |
|
|
|
|
|
|
|
|
|
|
|
QList <UBFeature>* getFeatures()const { return featuresList; } |
|
|
|
QList <UBFeature>* getFeatures()const { return featuresList; } |
|
|
|
|
|
|
|
|
|
|
|
const QString& getRootPath()const { return rootPath; } |
|
|
|
const QString& getRootPath()const { return rootPath; } |
|
|
|
|
|
|
|
|
|
|
|
void addItemToPage(const UBFeature &item); |
|
|
|
void addItemToPage(const UBFeature &item); |
|
|
|
const UBFeature& getCurrentElement()const { return currentElement; } |
|
|
|
const UBFeature& getCurrentElement()const { return currentElement; } |
|
|
|
void setCurrentElement( const UBFeature &elem ) { currentElement = elem; } |
|
|
|
void setCurrentElement( const UBFeature &elem ) { currentElement = elem; } |
|
|
|
const UBFeature & getTrashElement () const { return trashElement; } |
|
|
|
const UBFeature & getTrashElement () const { return trashElement; } |
|
|
|
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination ); |
|
|
|
void deleteItem( const QUrl &url ); |
|
|
|
void deleteItem( const QUrl &url ); |
|
|
|
bool isTrash( const QUrl &url ); |
|
|
|
bool isTrash( const QUrl &url ); |
|
|
|
UBFeature newFolder( const QString &name ); |
|
|
|
UBFeature newFolder( const QString &name ); |
|
|
|
UBFeature addToFavorite( const QUrl &path ); |
|
|
|
UBFeature addToFavorite( const QUrl &path ); |
|
|
|
void removeFromFavorite( const QUrl &path ); |
|
|
|
void removeFromFavorite( const QUrl &path ); |
|
|
|
|
|
|
|
|
|
|
|
static QString fileNameFromUrl( const QUrl &url ); |
|
|
|
static QString fileNameFromUrl( const QUrl &url ); |
|
|
|
static QPixmap thumbnailForFile( const QString &path ); |
|
|
|
static QPixmap thumbnailForFile( const QString &path ); |
|
|
|
private: |
|
|
|
private: |
|
|
|
void initDirectoryTree(); |
|
|
|
void initDirectoryTree(); |
|
|
|
void fileSystemScan(const QString &currPath, const QString & currVirtualPath); |
|
|
|
void fileSystemScan(const QString &currPath, const QString & currVirtualPath); |
|
|
|
static QPixmap createThumbnail(const QString &path); |
|
|
|
static QPixmap createThumbnail(const QString &path); |
|
|
|
//void addImageToCurrentPage( const QString &path );
|
|
|
|
//void addImageToCurrentPage( const QString &path );
|
|
|
|
void loadFavoriteList(); |
|
|
|
void loadFavoriteList(); |
|
|
|
void saveFavoriteList(); |
|
|
|
void saveFavoriteList(); |
|
|
|
|
|
|
|
|
|
|
|
static UBFeatureElementType fileTypeFromUrl( const QString &path ); |
|
|
|
static UBFeatureElementType fileTypeFromUrl( const QString &path ); |
|
|
|
|
|
|
|
|
|
|
|
QList <UBFeature> *featuresList; |
|
|
|
QList <UBFeature> *featuresList; |
|
|
|
UBFeature *rootElement; |
|
|
|
UBFeature *rootElement; |
|
|
|
|
|
|
|
|
|
|
|
QString mUserAudioDirectoryPath; |
|
|
|
QString mUserAudioDirectoryPath; |
|
|
|
QString mUserVideoDirectoryPath; |
|
|
|
QString mUserVideoDirectoryPath; |
|
|
|
QString mUserPicturesDirectoryPath; |
|
|
|
QString mUserPicturesDirectoryPath; |
|
|
|
QString mUserInteractiveDirectoryPath; |
|
|
|
QString mUserInteractiveDirectoryPath; |
|
|
|
QString mUserAnimationDirectoryPath; |
|
|
|
QString mUserAnimationDirectoryPath; |
|
|
|
|
|
|
|
|
|
|
|
QString libraryPath; |
|
|
|
QString libraryPath; |
|
|
|
QString mLibAudioDirectoryPath; |
|
|
|
QString mLibAudioDirectoryPath; |
|
|
|
QString mLibVideoDirectoryPath; |
|
|
|
QString mLibVideoDirectoryPath; |
|
|
|
QString mLibPicturesDirectoryPath; |
|
|
|
QString mLibPicturesDirectoryPath; |
|
|
|
QString mLibInteractiveDirectoryPath; |
|
|
|
QString mLibInteractiveDirectoryPath; |
|
|
|
QString mLibAnimationDirectoryPath; |
|
|
|
QString mLibAnimationDirectoryPath; |
|
|
|
QString mLibApplicationsDirectoryPath; |
|
|
|
QString mLibApplicationsDirectoryPath; |
|
|
|
QString mLibShapesDirectoryPath; |
|
|
|
QString mLibShapesDirectoryPath; |
|
|
|
QString trashDirectoryPath; |
|
|
|
QString trashDirectoryPath; |
|
|
|
|
|
|
|
|
|
|
|
QString rootPath; |
|
|
|
QString rootPath; |
|
|
|
QString audiosPath; |
|
|
|
QString audiosPath; |
|
|
|
QString moviesPath; |
|
|
|
QString moviesPath; |
|
|
|
QString picturesPath; |
|
|
|
QString picturesPath; |
|
|
|
QString appPath; |
|
|
|
QString appPath; |
|
|
|
QString flashPath; |
|
|
|
QString flashPath; |
|
|
|
QString shapesPath; |
|
|
|
QString shapesPath; |
|
|
|
QString interactPath; |
|
|
|
QString interactPath; |
|
|
|
QString trashPath; |
|
|
|
QString trashPath; |
|
|
|
QString favoritePath; |
|
|
|
QString favoritePath; |
|
|
|
|
|
|
|
|
|
|
|
int mLastItemOffsetIndex; |
|
|
|
int mLastItemOffsetIndex; |
|
|
|
UBFeature currentElement; |
|
|
|
UBFeature currentElement; |
|
|
|
UBFeature trashElement; |
|
|
|
UBFeature trashElement; |
|
|
|
UBFeature favoriteElement; |
|
|
|
UBFeature favoriteElement; |
|
|
|
|
|
|
|
|
|
|
|
QSet <QString> *favoriteSet; |
|
|
|
QSet <QString> *favoriteSet; |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|