summaryrefslogtreecommitdiffstats
path: root/covereditor.cpp
diff options
context:
space:
mode:
authoram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-18 17:54:27 +0000
committeram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-18 17:54:27 +0000
commit80bf76dc318276f67eeec32b8f68e82cf4bb7e62 (patch)
tree262a57a754dcbe01f0a21dd9c69513807be3369b /covereditor.cpp
parenta477a1998c03bc0e7251463aff5486e3c0872d23 (diff)
downloadSheMov-80bf76dc318276f67eeec32b8f68e82cf4bb7e62.tar.gz
SheMov-80bf76dc318276f67eeec32b8f68e82cf4bb7e62.tar.bz2
SheMov-80bf76dc318276f67eeec32b8f68e82cf4bb7e62.zip
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
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){