summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--newmoviewizard.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/newmoviewizard.cpp b/newmoviewizard.cpp
index 137f7c2..1989e64 100644
--- a/newmoviewizard.cpp
+++ b/newmoviewizard.cpp
@@ -308,6 +308,7 @@ void MovieInfoPage::setupGui(){
mFileView->setItemDelegateForColumn(WizardTreeModel::FilePart, new FileNoDelegate(mFileView));
mFileView->setSortingEnabled(true);
mFileView->header()->moveSection(1, 3);
+ mFileView->setSelectionMode(QAbstractItemView::ExtendedSelection);
//add + remove files
QHBoxLayout *fileButtonLayout = new QHBoxLayout;
@@ -318,7 +319,7 @@ void MovieInfoPage::setupGui(){
mAddFile = new QPushButton(tr("Add files..."));
fileButtonLayout->addWidget(mAddFile);
connect(mAddFile, SIGNAL(clicked()), this, SLOT(addFiles()));
- mRemoveFile = new QPushButton(tr("Remove file"));
+ mRemoveFile = new QPushButton(tr("Remove from list"));
fileButtonLayout->addWidget(mRemoveFile);
connect(mRemoveFile, SIGNAL(clicked()), this, SLOT(removeFile()));
@@ -467,11 +468,20 @@ void MovieInfoPage::addFiles(){
}
void MovieInfoPage::removeFile(){
- QModelIndexList selected = mFileView->selectionModel()->selectedRows();
+ QModelIndexList selected = mFileView->selectionModel()->selectedRows();
+ QList<QPersistentModelIndex> curSel;
+ foreach(QModelIndex idx, selected){
+ curSel << QPersistentModelIndex(idx);
+ }
if(selected.isEmpty()){
return;
}
- mFileModel->removeRows(selected.at(0).row(), 1, selected.at(0).parent());
+ foreach(QPersistentModelIndex pi, curSel){
+ QModelIndex cur = mProxy->mapToSource(pi);
+ if(cur.isValid()){
+ mFileModel->removeRow(cur.row(), cur.parent());
+ }
+ }
}
MovieMappingPage::MovieMappingPage(const QString &table, QWidget *parent) : QWizardPage(parent), mTable(table){