Commit d4072aae authored by Ilia Ryabokon's avatar Ilia Ryabokon

Search widget in right palette resolved

parent 58bc81c0
......@@ -114,7 +114,7 @@ UBFeaturesController::UBFeaturesController(QWidget *pParentWidget) :
applicationsElement = UBFeature( rootPath, QPixmap(":images/libpalette/ApplicationsCategory.svg"), "Applications" , mUserInteractiveDirectoryPath, FEATURE_CATEGORY);
shapesElement = UBFeature( rootPath, QPixmap(":images/libpalette/ShapesCategory.svg"), "Shapes" , mLibShapesDirectoryPath, FEATURE_CATEGORY );
favoriteElement = UBFeature( rootPath, QPixmap(":images/libpalette/FavoritesCategory.svg"), "Favorites", QUrl("favorites"), FEATURE_FAVORITE );
webSearchElement = UBFeature( rootPath, QPixmap(":images/libpalette/WebSearchCategory.svg"), "Web search", mLibSearchDirectoryPath, FEATURE_SEARCH);
webSearchElement = UBFeature( rootPath, QPixmap(":images/libpalette/WebSearchCategory.svg"), "Web search", mLibSearchDirectoryPath, FEATURE_CATEGORY);
trashElement = UBFeature( rootPath, QPixmap(":images/libpalette/TrashCategory.svg"), "Trash", trashDirectoryPath, FEATURE_TRASH );
......@@ -171,18 +171,25 @@ void UBFeaturesController::scanFS()
}
}
fileSystemScan(mUserInteractiveDirectoryPath, appPath);
fileSystemScan(mUserAudioDirectoryPath, audiosPath);
fileSystemScan(mUserPicturesDirectoryPath, picturesPath);
fileSystemScan(mUserVideoDirectoryPath, moviesPath);
fileSystemScan(mUserAnimationDirectoryPath, flashPath);
//Claudio:
// don't change the order of the scans
fileSystemScan( mLibAudiosDirectoryPath, audiosPath);
fileSystemScan( mLibVideosDirectoryPath, moviesPath);
fileSystemScan( mLibAnimationsDirectoryPath, flashPath);
fileSystemScan( mLibPicturesDirectoryPath, picturesPath );
fileSystemScan( mUserInteractiveDirectoryPath, appPath );
fileSystemScan( mUserAudioDirectoryPath, audiosPath );
fileSystemScan( mUserPicturesDirectoryPath, picturesPath );
fileSystemScan( mUserVideoDirectoryPath, moviesPath );
fileSystemScan( mUserAnimationDirectoryPath, flashPath );
fileSystemScan( mLibApplicationsDirectoryPath, appPath );
fileSystemScan( mLibShapesDirectoryPath, shapesPath );
fileSystemScan( mLibInteractiveDirectoryPath, interactPath );
fileSystemScan( trashDirectoryPath, trashPath );
fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search" );
fileSystemScan(mLibApplicationsDirectoryPath, appPath);
fileSystemScan( mLibPicturesDirectoryPath, picturesPath);
fileSystemScan( mLibShapesDirectoryPath, shapesPath);
fileSystemScan( mLibInteractiveDirectoryPath, interactPath);
fileSystemScan( trashDirectoryPath, trashPath);
fileSystemScan( mLibSearchDirectoryPath, rootPath + "/" + "Web search");
}
void UBFeaturesController::fileSystemScan(const QUrl & currentPath, const QString & currVirtualPath)
......@@ -464,23 +471,29 @@ UBFeature UBFeaturesController::getParentFeatureForUrl( const QUrl &url )
return UBFeature();
}
UBFeature UBFeaturesController::addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData )
void UBFeaturesController::addDownloadedFile(const QUrl &sourceUrl, const QByteArray &pData)
{
UBFeature dest = getParentFeatureForUrl( sourceUrl );
if ( dest == UBFeature() )
return UBFeature();
return;
QString fileName = QFileInfo( sourceUrl.toString() ).fileName();
QString filePath = dest.getFullPath().toLocalFile() + "/" + fileName;
QFile file( filePath );
if( file.open(QIODevice::WriteOnly ))
if ( file.open(QIODevice::WriteOnly ))
{
file.write(pData);
file.close();
return UBFeature( dest.getFullVirtualPath(), thumbnailForFile( filePath ),
fileName, QUrl::fromLocalFile(filePath), FEATURE_ITEM );
UBFeature downloadedFeature = UBFeature( dest.getFullVirtualPath(), thumbnailForFile( filePath ),
fileName, QUrl::fromLocalFile(filePath), FEATURE_ITEM);
if (downloadedFeature != UBFeature()) {
featuresModel->addItem(downloadedFeature);
}
}
return UBFeature();
}
UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeature &destination )
......@@ -523,7 +536,7 @@ UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeatu
void UBFeaturesController::rescanModel()
{
featuresModel->removeRows(0, featuresList->count() - 1);
featuresModel->removeRows(0, featuresList->count());
//Could implement infolder scanning for better perfomance
scanFS();
......
......@@ -101,7 +101,7 @@ public:
void setCurrentElement( const UBFeature &elem ) {currentElement = elem;}
const UBFeature & getTrashElement () const { return trashElement; }
UBFeature addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData );
void addDownloadedFile( const QUrl &sourceUrl, const QByteArray &pData );
UBFeature moveItemToFolder( const QUrl &url, const UBFeature &destination );
UBFeature copyItemToFolder( const QUrl &url, const UBFeature &destination );
......
This diff is collapsed.
......@@ -60,7 +60,6 @@ public:
static const int minThumbnailSize = 20;
static const int maxThumbnailSize = 100;
static const int defaultThumbnailSize = 40;
//<<<<<<< HEAD
public:
int scrollbarHorisontalPadding() const { return 10;}
......@@ -75,90 +74,27 @@ private slots:
void addToFavorite( const UBFeaturesMimeData *);
void removeFromFavorite( const UBFeaturesMimeData * );
void onDisplayMetadata( QMap<QString,QString> );
//=======
//private:
// void switchToListView();
// void switchToProperties();
// void switchToWebView();
// UBFeaturesController *controller;
// UBFeaturesItemDelegate *itemDelegate;
// UBFeaturesPathItemDelegate *pathItemDelegate;
// UBFeaturesModel *featuresModel;
// UBFeaturesProxyModel *featuresProxyModel;
// UBFeaturesSearchProxyModel *featuresSearchModel;
// UBFeaturesPathProxyModel *featuresPathModel;
// UBFeaturesListView *featuresListView;
// UBFeaturesListView *pathListView;
// QSlider *thumbSlider;
// QVBoxLayout *layout;
// //UBFeaturesPathViewer *pathViewer;
// //QGraphicsScene *pathScene;
// UBFeaturesActionBar *mActionBar;
// UBFeatureProperties *featureProperties;
// UBFeaturesWebView *webView;
// QStackedWidget *stackedWidget;
// int currentStackedWidget;
// UBDownloadHttpFile* imageGatherer;
//private slots:
//
// void currentSelected( const QModelIndex & );
// //void currentPathChanged(const QString &);
// void currentPathChanged( const QModelIndex & );
// void searchStarted( const QString & );
// void createNewFolder();
// void deleteElements( const QMimeData & );
// void addToFavorite( const QMimeData & );
// void removeFromFavorite( const QMimeData & );
// void thumbnailSizeChanged( int );
// void onDisplayMetadata( QMap<QString,QString> );
//>>>>>>> e38b24544e8b8b1d5bd41dabdeaf588df7d45185
void onAddDownloadedFileToLibrary(bool, QUrl, QString, QByteArray);
void addElementsToFavorite();
void removeElementsFromFavorite();
void deleteSelectedElements();
//<<<<<<< HEAD
void rescanModel();
private:
void switchToListView();
void switchToProperties();
void switchToWebView();
void updateSliderPosition();
private:
UBFeaturesController *controller;
UBFeaturesItemDelegate *itemDelegate;
UBFeaturesPathItemDelegate *pathItemDelegate;
UBFeaturesModel *featuresModel;
UBFeaturesProxyModel *featuresProxyModel;
UBFeaturesSearchProxyModel *featuresSearchModel;
UBFeaturesPathProxyModel *featuresPathModel;
UBFeaturesNavigatorWidget *mNavigator;
UBFeaturesListView *pathListView;
QVBoxLayout *layout;
UBFeaturesActionBar *mActionBar;
UBFeatureProperties *featureProperties;
UBFeaturesWebView *webView;
QStackedWidget *stackedWidget;
int currentStackedWidget;
UBDownloadHttpFile* imageGatherer;
};
......@@ -175,11 +111,6 @@ public:
private:
QList<UBFeature> mFeatures;
//=======
//protected:
// bool eventFilter(QObject *target, QEvent *event);
//>>>>>>> e38b24544e8b8b1d5bd41dabdeaf588df7d45185
};
......@@ -195,16 +126,9 @@ protected:
virtual void dragEnterEvent( QDragEnterEvent *event );
virtual void dropEvent( QDropEvent *event );
virtual void dragMoveEvent( QDragMoveEvent *event );
/*virtual void mousePressEvent( QMouseEvent *event );
virtual void mouseMoveEvent( QMouseEvent *event );
virtual void mouseReleaseEvent( QMouseEvent *event );*/
private slots:
void thumbnailSizeChanged(int);
private:
//UBRubberBand *rubberBand;
//QPoint rubberOrigin;
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment