From 80bf76dc318276f67eeec32b8f68e82cf4bb7e62 Mon Sep 17 00:00:00 2001 From: am Date: Sat, 18 Jul 2009 17:54:27 +0000 Subject: Again huge changes (should go on vacation more often :)) -turned archive tab into a QDialog -fixed duplicate handling in ListModel -fixed html output in archive dialog -actually made archiving work -changed covertype to text in database -fixed bug with covertype in coveritem git-svn-id: file:///var/svn/repos2/shemov/trunk@390 f440f766-f032-0410-8965-dc7d17de2ca0 --- covereditor.cpp | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) (limited to 'covereditor.cpp') diff --git a/covereditor.cpp b/covereditor.cpp index 13bd461..618c0a9 100644 --- a/covereditor.cpp +++ b/covereditor.cpp @@ -26,17 +26,21 @@ CoverEditor::CoverEditor(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f mCovers = new QComboBox; mainLayout->addWidget(l3, 2, 0); mainLayout->addWidget(mCovers, 2, 1); + QLabel *l4 = new QLabel(tr("Movie file")); + mMovie = new QComboBox; + mainLayout->addWidget(l4, 3, 0); + mainLayout->addWidget(mMovie, 3, 1); setLayout(mainLayout); } void CoverEditor::setCovers(const QStringList &covers){ mCoverPaths = covers; QStringList coverNames("-"); - QString front, back; + QString front, back, movie; int idx(-1); foreach(QString c, mCoverPaths){ if((idx = c.lastIndexOf('/')) != -1){ - c.remove(0, idx); + c.remove(0, idx + 1); } if(c.toLower().contains("front")){ front = c; @@ -44,6 +48,9 @@ void CoverEditor::setCovers(const QStringList &covers){ if(c.toLower().contains("back")){ back = c; } + if(c.toLower().endsWith(".avi")){ + movie = c; + } coverNames << c; } mFrontCover->clear(); @@ -52,6 +59,8 @@ void CoverEditor::setCovers(const QStringList &covers){ mBackCover->addItems(coverNames); mCovers->clear(); mCovers->addItems(coverNames); + mMovie->clear(); + mMovie->addItems(coverNames); if(!front.isEmpty()){ int idx = mFrontCover->findText(front); if(idx != -1){ @@ -64,6 +73,12 @@ void CoverEditor::setCovers(const QStringList &covers){ mBackCover->setCurrentIndex(idx); } } + if(!movie.isEmpty()){ + int idx = mMovie->findText(movie); + if(idx != -1){ + mMovie->setCurrentIndex(idx); + } + } } const QString CoverEditor::frontCover() const{ @@ -91,6 +106,15 @@ const QString CoverEditor::covers() const{ } +const QString CoverEditor::movie() const{ + QString sel = mMovie->currentText(); + if(sel.isEmpty() || (sel == "-")){ + return QString(); + } + return findPath(sel); + +} + const QString CoverEditor::findPath(const QString &name) const{ QString retval; foreach(QString s, mCoverPaths){ -- cgit v1.2.3-70-g09d2