summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-08-07 20:19:58 +0200
committerArno <am@disconnect.de>2010-08-07 20:19:58 +0200
commit3af9f3f8b900b9dd5e09300e74d6ce49018be98e (patch)
treefa9012bd0ccaf0e540bdb2b2562e6deddbb72bf0
parent40cedb64e32383f488000f89c2084c2bda98310f (diff)
downloadSheMov-3af9f3f8b900b9dd5e09300e74d6ce49018be98e.tar.gz
SheMov-3af9f3f8b900b9dd5e09300e74d6ce49018be98e.tar.bz2
SheMov-3af9f3f8b900b9dd5e09300e74d6ce49018be98e.zip
Fix doubleclick in FilesTreeWidget
Doubleclicking the DvdNo in FilesWidget did 1. play the movie 2. create an editor event in the widget Now doubleclicking only starts the default player. The quality can be edited via context menu.
-rw-r--r--filestreewidget.cpp9
-rw-r--r--filestreewidget.h1
-rw-r--r--shemov.cpp3
-rw-r--r--shemov.h1
4 files changed, 14 insertions, 0 deletions
diff --git a/filestreewidget.cpp b/filestreewidget.cpp
index 765fc44..c00456d 100644
--- a/filestreewidget.cpp
+++ b/filestreewidget.cpp
@@ -34,6 +34,7 @@ FilesTreeWidget::FilesTreeWidget(QWidget *parent) : QWidget(parent), mSelectedSi
//the view
mView = new FilesTreeView;
mView->setSelectionMode(QAbstractItemView::ExtendedSelection);
+ mView->setEditTriggers(QAbstractItemView::NoEditTriggers);
mModel = static_cast<FilesTreeModel*>(SmGlobals::instance()->model("FilesModel"));
mProxy = new FilesTreeSortModel(this);
mProxy->setSourceModel(mModel);
@@ -191,6 +192,14 @@ void FilesTreeWidget::fileProperties(){
}
+void FilesTreeWidget::editQuality(){
+ QModelIndex current = mView->selectionModel()->currentIndex();
+ if(current.isValid()){
+ QModelIndex qualityIndex = mView->model()->index(current.row(), FilesTreeModel::Quality, current.parent());
+ mView->edit(qualityIndex);
+ }
+}
+
void FilesTreeWidget::fileSelectionChanged(const QModelIndex &current, const QModelIndex &previous){
Q_UNUSED(previous);
int seriesPartId = current.data(FilesTreeModel::SeriesPartIdRole).toInt();
diff --git a/filestreewidget.h b/filestreewidget.h
index e159d5a..eddf344 100644
--- a/filestreewidget.h
+++ b/filestreewidget.h
@@ -36,6 +36,7 @@ class FilesTreeWidget : public QWidget {
void removeFiles();
void moveToDirectory();
void fileProperties();
+ void editQuality();
private slots:
void fileSelectionChanged(const QModelIndex &current, const QModelIndex &previous);
diff --git a/shemov.cpp b/shemov.cpp
index bb45bfb..359d06a 100644
--- a/shemov.cpp
+++ b/shemov.cpp
@@ -374,6 +374,8 @@ void SheMov::createActions(){
connect(mMoveFilesA, SIGNAL(triggered()), mATree->filesWidget(), SLOT(moveToDirectory()));
mSetDvdNoA = new QAction(tr("Set dvd number"), this);
connect(mSetDvdNoA, SIGNAL(triggered()), mATree->filesWidget(), SLOT(setDvdNo()));
+ mSetQualityA = new QAction(tr("Set quality"), this);
+ connect(mSetQualityA, SIGNAL(triggered()), mATree->filesWidget(), SLOT(editQuality()));
mDeleteFilesFromTreeA = new QAction(tr("Delete file(s)..."), this);
connect(mDeleteFilesFromTreeA, SIGNAL(triggered()), mATree->filesWidget(), SLOT(removeFiles()));
mFilePropertiesA = new QAction(tr("Properties..."), this);
@@ -498,6 +500,7 @@ void SheMov::createMenus(){
sep7->setSeparator(true);
mATree->filesWidget()->filesTree()->addAction(sep7);
mATree->filesWidget()->filesTree()->addAction(mSetDvdNoA);
+ mATree->filesWidget()->filesTree()->addAction(mSetQualityA);
QAction *sep8 = new QAction(this);
sep8->setSeparator(true);
mATree->filesWidget()->filesTree()->addAction(sep8);
diff --git a/shemov.h b/shemov.h
index 2d7c94e..5b3d6c7 100644
--- a/shemov.h
+++ b/shemov.h
@@ -104,6 +104,7 @@ class SheMov : public QMainWindow {
QAction *mMoveToBurnA;
QAction *mMoveFilesA;
QAction *mSetDvdNoA;
+ QAction *mSetQualityA;
QAction *mDeleteFilesFromTreeA;
QAction *mFilePropertiesA;