summaryrefslogtreecommitdiffstats
path: root/covereditor.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'covereditor.cpp')
-rw-r--r--covereditor.cpp28
1 files changed, 26 insertions, 2 deletions
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){