|
|
|
@ -121,6 +121,7 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale |
|
|
|
|
connect( mActionBar, SIGNAL( deleteElements(const QMimeData &) ), this, SLOT( deleteElements(const QMimeData &) ) );
|
|
|
|
|
connect( mActionBar, SIGNAL( addToFavorite(const QMimeData &) ), this, SLOT( addToFavorite(const QMimeData &) ) ); |
|
|
|
|
connect( mActionBar, SIGNAL( removeFromFavorite(const QMimeData &) ), this, SLOT( removeFromFavorite(const QMimeData &) ) ); |
|
|
|
|
connect ( mActionBar, SIGNAL( addElementsToFavorite() ), this, SLOT ( addElementsToFavorite() ) );
|
|
|
|
|
connect( pathListView, SIGNAL(clicked( const QModelIndex & ) ), |
|
|
|
|
this, SLOT( currentPathChanged( const QModelIndex & ) ) ); |
|
|
|
|
connect( thumbSlider, SIGNAL( sliderMoved(int) ), this, SLOT(thumbnailSizeChanged( int ) ) ); |
|
|
|
@ -333,6 +334,20 @@ void UBFeaturesWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUr |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBFeaturesWidget::addElementsToFavorite() |
|
|
|
|
{ |
|
|
|
|
QModelIndexList selected = featuresListView->selectionModel()->selectedIndexes(); |
|
|
|
|
for ( int i = 0; i < selected.size(); ++i ) |
|
|
|
|
{ |
|
|
|
|
UBFeature feature = selected.at(i).data( Qt::UserRole + 1 ).value<UBFeature>(); |
|
|
|
|
UBFeature elem = controller->addToFavorite( feature.getFullPath() ); |
|
|
|
|
if ( !elem.getVirtualPath().isEmpty() && !elem.getVirtualPath().isNull() ) |
|
|
|
|
featuresModel->addItem( elem ); |
|
|
|
|
} |
|
|
|
|
QSortFilterProxyModel *model = dynamic_cast<QSortFilterProxyModel *>( featuresListView->model() ); |
|
|
|
|
model->invalidate(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBFeaturesWidget::switchToListView() |
|
|
|
|
{ |
|
|
|
|
stackedWidget->setCurrentIndex(ID_LISTVIEW); |
|
|
|
|