summaryrefslogtreecommitdiffstats
path: root/archiveiteminfoedit.cpp
diff options
context:
space:
mode:
authorArno <am@disconnect.de>2010-05-29 14:54:55 +0200
committerArno <am@disconnect.de>2010-05-29 15:12:41 +0200
commitca84789d9f288e39936a288c17eff247cb0f4a3f (patch)
treee4c70bd2eccd65378edc09fea0b8cdce13d2de3d /archiveiteminfoedit.cpp
parentd95e3f02d6615854547bded419de81395b28c2c5 (diff)
downloadSheMov-ca84789d9f288e39936a288c17eff247cb0f4a3f.tar.gz
SheMov-ca84789d9f288e39936a288c17eff247cb0f4a3f.tar.bz2
SheMov-ca84789d9f288e39936a288c17eff247cb0f4a3f.zip
Implement new ArchiveItemEditDialog
Use ArchiveItemEditDialog instead of EditArchiveItemDialog. The latter will soon be obsolete and removed. Terrible naming, though. This commit is not as atomic as I want it to be, but it can't be helped. I had to fix several bugs in ArchveItemInfoEdit and ArchiveItemCoverEdit on the way: -Fix layout of ArchiveItemCoverEdit -Make white background of warning label in ArchiveItemCoverEdit work -Add function to ArchiveItemInfoEdit to init the ActorModel and FileInfoModel -Add function to ArchiveItemInfoEdit to return selected actors Beware: The update button still does nothing!
Diffstat (limited to 'archiveiteminfoedit.cpp')
-rw-r--r--archiveiteminfoedit.cpp24
1 files changed, 22 insertions, 2 deletions
diff --git a/archiveiteminfoedit.cpp b/archiveiteminfoedit.cpp
index 9d25fb6..4ec7d18 100644
--- a/archiveiteminfoedit.cpp
+++ b/archiveiteminfoedit.cpp
@@ -19,15 +19,14 @@
#include "fileinfomodel.h"
#include "actorwidget.h"
#include "listmodelsingleton.h"
-#include "moviemodelsingleton.h"
#include "listeditor.h"
+#include "moviemodel.h"
ArchiveItemInfoEdit::ArchiveItemInfoEdit(QWidget *parent) : QWidget(parent){
//Models
mGenreModel = ListModelSingleton::instance()->model("genre");
mActorModel = ListModelSingleton::instance()->model("actor");
- mMovieModel = MovieModelSingleton::instance();
//InfoWidget
QWidget *infoWidget = new QWidget;
@@ -132,6 +131,23 @@ ArchiveItemInfoEdit::ArchiveItemInfoEdit(QWidget *parent) : QWidget(parent){
setLayout(mainLayout);
}
+void ArchiveItemInfoEdit::setup(const QModelIndex &idx) {
+ //Movie Info
+ QString title = QString(idx.data().toString());
+ mInfoModel->clear();
+ mInfoModel->addIndex(title, idx);
+ mInfoView->resizeColumnToContents(0);
+ mInfoView->setHeaderHidden(true);
+ mInfoView->expandAll();
+
+ //Actors
+ QStringList actors = idx.data(MovieModel::ActorsRole).toStringList();
+ qSort(actors);
+ foreach(QString a, actors){
+ mActorView->addActor(a);
+ }
+}
+
const QString ArchiveItemInfoEdit::genre() const {
return mGenre->currentText();
}
@@ -140,6 +156,10 @@ const QString ArchiveItemInfoEdit::title() const {
return mTitle->text();
}
+const QStringList ArchiveItemInfoEdit::actors() const {
+ return mActorView->actors();
+}
+
int ArchiveItemInfoEdit::quality() const {
return mQuality->value();
}