Added elements selection

preferencesAboutTextFull
Anna Udovichenko 13 years ago
parent 8be4c32bd8
commit c2b9c6a412
  1. 7
      src/board/UBFeaturesController.cpp
  2. 22
      src/gui/UBFeaturesWidget.cpp

@ -314,9 +314,16 @@ UBFeature UBFeaturesController::newFolder( const QString &name )
} }
void UBFeaturesController::addItemToPage(const UBFeature &item) void UBFeaturesController::addItemToPage(const UBFeature &item)
{
if ( item.getType() == FEATURE_INTERNAL )
{
UBApplication::boardController->downloadURL( QUrl( item.getFullPath() ) );
}
else
{ {
UBApplication::boardController->downloadURL( QUrl::fromLocalFile( item.getFullPath() ) ); UBApplication::boardController->downloadURL( QUrl::fromLocalFile( item.getFullPath() ) );
} }
}
UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeature &destination ) UBFeature UBFeaturesController::moveItemToFolder( const QUrl &url, const UBFeature &destination )
{ {

@ -49,6 +49,7 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
//featuresListView->setStyleSheet( QString("background: #EEEEEE;border-radius: 10px;border: 2px solid #999999;") ); //featuresListView->setStyleSheet( QString("background: #EEEEEE;border-radius: 10px;border: 2px solid #999999;") );
featuresListView->setDragDropMode( QAbstractItemView::DragDrop ); featuresListView->setDragDropMode( QAbstractItemView::DragDrop );
featuresListView->setSelectionMode( QAbstractItemView::ContiguousSelection );
featuresListView->setModel( featuresProxyModel ); featuresListView->setModel( featuresProxyModel );
featuresListView->setResizeMode( QListView::Adjust ); featuresListView->setResizeMode( QListView::Adjust );
@ -72,7 +73,7 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name):UBDockPale
pathListView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn ); pathListView->setHorizontalScrollBarPolicy( Qt::ScrollBarAlwaysOn );
//pathListView->setResizeMode( QListView::Adjust ); //pathListView->setResizeMode( QListView::Adjust );
//pathListView->setMovement( QListView::Static ); //pathListView->setMovement( QListView::Static );
pathListView->setDragDropMode( QAbstractItemView::DragDrop ); pathListView->setDragDropMode( QAbstractItemView::DropOnly );
pathScene = new QGraphicsScene(this); pathScene = new QGraphicsScene(this);
//pathViewer = new UBFeaturesPathViewer( QPixmap(":images/libpalette/home.png"), controller->getRootPath(), pathScene, this ); //pathViewer = new UBFeaturesPathViewer( QPixmap(":images/libpalette/home.png"), controller->getRootPath(), pathScene, this );
@ -629,7 +630,24 @@ Qt::ItemFlags UBFeaturesModel::flags( const QModelIndex &index ) const
return defaultFlags | Qt::ItemIsDropEnabled; return defaultFlags | Qt::ItemIsDropEnabled;
else return defaultFlags; else return defaultFlags;
} }
return defaultFlags | Qt::ItemIsDropEnabled; /*if ( index.isValid() )
{
UBFeature item = index.data( Qt::UserRole + 1 ).value<UBFeature>();
switch( item.getType() )
{
case FEATURE_CATEGORY:
case FEATURE_FOLDER:
case FEATURE_FAVORITE:
case FEATURE_TRASH:
return Qt::ItemIsDropEnabled | Qt::ItemIsEnabled;
case FEATURE_INTERACTIVE:
case FEATURE_INTERNAL:
case FEATURE_ITEM:
return Qt::ItemIsDragEnabled | Qt::ItemIsEnabled | Qt::ItemIsSelectable;
default:;
}
}*/
return defaultFlags;
} }

Loading…
Cancel
Save