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