|
|
|
@ -336,6 +336,17 @@ void UBFeaturesWidget::onAddDownloadedFileToLibrary(bool pSuccess, QUrl sourceUr |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBFeaturesWidget::addElementsToFavorite() |
|
|
|
|
{ |
|
|
|
|
if ( currentStackedWidget == ID_PROPERTIES ) |
|
|
|
|
{ |
|
|
|
|
UBFeature feature = featureProperties->getCurrentElement(); |
|
|
|
|
if ( feature != UBFeature() && !UBApplication::isFromWeb( feature.getFullPath().toString() ) ) |
|
|
|
|
{ |
|
|
|
|
UBFeature elem = controller->addToFavorite( feature.getFullPath() ); |
|
|
|
|
featuresModel->addItem( elem ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
else if ( currentStackedWidget == ID_LISTVIEW ) |
|
|
|
|
{ |
|
|
|
|
QModelIndexList selected = featuresListView->selectionModel()->selectedIndexes(); |
|
|
|
|
for ( int i = 0; i < selected.size(); ++i ) |
|
|
|
@ -345,6 +356,7 @@ void UBFeaturesWidget::addElementsToFavorite() |
|
|
|
|
if ( !elem.getVirtualPath().isEmpty() && !elem.getVirtualPath().isNull() ) |
|
|
|
|
featuresModel->addItem( elem ); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
QSortFilterProxyModel *model = dynamic_cast<QSortFilterProxyModel *>( featuresListView->model() ); |
|
|
|
|
model->invalidate(); |
|
|
|
|
} |
|
|
|
@ -629,6 +641,13 @@ void UBFeatureProperties::showEvent (QShowEvent *event ) |
|
|
|
|
adaptSize(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
UBFeature UBFeatureProperties::getCurrentElement() const |
|
|
|
|
{ |
|
|
|
|
if ( mpElement ) |
|
|
|
|
return *mpElement; |
|
|
|
|
return UBFeature(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void UBFeatureProperties::adaptSize() |
|
|
|
|
{ |
|
|
|
|
if( NULL != mpOrigPixmap ) |
|
|
|
|