summaryrefslogtreecommitdiffstats
path: root/covereditor.cpp
diff options
context:
space:
mode:
authoram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-20 17:37:08 +0000
committeram <am@f440f766-f032-0410-8965-dc7d17de2ca0>2009-07-20 17:37:08 +0000
commitec3418479b28ca8e162f84d76c2eed78c27a114c (patch)
treea947550fc9821999baf728dbf33adef71fa67576 /covereditor.cpp
parentd2b854121266e32164290ee4e683c0c8388d7d41 (diff)
downloadSheMov-ec3418479b28ca8e162f84d76c2eed78c27a114c.tar.gz
SheMov-ec3418479b28ca8e162f84d76c2eed78c27a114c.tar.bz2
SheMov-ec3418479b28ca8e162f84d76c2eed78c27a114c.zip
-started on editing the archive
-big probs with the covers, I'll stop for now, can't think straight any more -changes to MovieModel -changes to MovieItem -modified CoverEditor to allow adding files (untested) git-svn-id: file:///var/svn/repos2/shemov/trunk@392 f440f766-f032-0410-8965-dc7d17de2ca0
Diffstat (limited to 'covereditor.cpp')
-rw-r--r--covereditor.cpp32
1 files changed, 31 insertions, 1 deletions
diff --git a/covereditor.cpp b/covereditor.cpp
index 618c0a9..5472f23 100644
--- a/covereditor.cpp
+++ b/covereditor.cpp
@@ -9,10 +9,13 @@
#include <QStringList>
#include <QLabel>
#include <QGridLayout>
+#include <QFileDialog>
+#include <QPushButton>
+#include <QSettings>
#include "covereditor.h"
-CoverEditor::CoverEditor(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f){
+CoverEditor::CoverEditor(Mode mode, QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f), mMode(mode){
QGridLayout *mainLayout = new QGridLayout;
QLabel *l1 = new QLabel(tr("Front cover"));
mFrontCover = new QComboBox;
@@ -30,6 +33,15 @@ CoverEditor::CoverEditor(QWidget *parent, Qt::WindowFlags f) : QWidget(parent, f
mMovie = new QComboBox;
mainLayout->addWidget(l4, 3, 0);
mainLayout->addWidget(mMovie, 3, 1);
+ mAddFile = new QPushButton(tr("Add cover"));
+ if(mode == Archive){
+ mAddFile->setVisible(false);
+ }else{
+ l4->setVisible(false);
+ mMovie->setVisible(false);
+ }
+ connect(mAddFile, SIGNAL(clicked()), this, SLOT(addFile()));
+ mainLayout->addWidget(mAddFile, 4, 1);
setLayout(mainLayout);
}
@@ -115,6 +127,24 @@ const QString CoverEditor::movie() const{
}
+void CoverEditor::addFile(){
+ QSettings s;
+ QString startDir = s.value("ui/selectstartup").toString();
+ QStringList files = QFileDialog::getOpenFileNames(this, "Select covers to add to list", startDir);
+ foreach(QString f, files){
+ if(!mCoverPaths.contains(f)){
+ files << f;
+ int idx(-1);
+ if((idx = f.lastIndexOf('/')) != -1){
+ f.remove(0, idx + 1);
+ mFrontCover->addItem(f);
+ mBackCover->addItem(f);
+ mCovers->addItem(f);
+ }
+ }
+ }
+}
+
const QString CoverEditor::findPath(const QString &name) const{
QString retval;
foreach(QString s, mCoverPaths){