summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArno <arno@disconnect.de>2018-04-04 13:28:28 +0200
committerArno <arno@disconnect.de>2018-04-04 13:28:28 +0200
commit89c3587b8768bb49d7f82aa845781ee485df8370 (patch)
tree1549eb44244b2713bb402f85c44e76737f0a895b
parent519b2392f16adbf179ef7a117513dc7a2b890b6e (diff)
downloadSheMov-89c3587b8768bb49d7f82aa845781ee485df8370.tar.gz
SheMov-89c3587b8768bb49d7f82aa845781ee485df8370.tar.bz2
SheMov-89c3587b8768bb49d7f82aa845781ee485df8370.zip
Fill MoviePropertiesDialog, part 2
Actors and Genres.
-rw-r--r--moviepropertiesdialog.cpp33
-rw-r--r--moviepropertiesdialog.h1
2 files changed, 34 insertions, 0 deletions
diff --git a/moviepropertiesdialog.cpp b/moviepropertiesdialog.cpp
index 6197526..64a21ac 100644
--- a/moviepropertiesdialog.cpp
+++ b/moviepropertiesdialog.cpp
@@ -115,4 +115,37 @@ void MoviePropertiesDialog::init(int seriesPartsId){
mTorrentRB->setChecked(true);
}
}
+ mActorM->clear();
+ mActorM->setHorizontalHeaderLabels(QStringList() << tr("Name"));
+ mActorV->setRootIsDecorated(false);
+ QStandardItem *actorsRootItem = mActorM->invisibleRootItem();
+ QSqlQuery actorsQ(db);
+ actorsQ.prepare("SELECT actors.tactorname, actors.iactors_id FROM actors, seriesparts_actormap WHERE seriesparts_actormap.iseriesparts_id = :id AND seriesparts_actormap.iactors_id = actors.iactors_id ORDER BY actors.tactorname");
+ actorsQ.bindValue(":id", seriesPartsId);
+ actorsQ.exec();
+ while(actorsQ.next()){
+ QStandardItem *i = new QStandardItem;
+ i->setEditable(false);
+ i->setIcon(QIcon(":/diaper.png"));
+ i->setText(actorsQ.value(0).toString());
+ i->setData(actorsQ.value(1), ActorIdRole);
+ actorsRootItem->appendRow(i);
+ }
+ mGenreM->clear();
+ mGenreM->setHorizontalHeaderLabels(QStringList() << tr("Genre"));
+ mGenreV->setRootIsDecorated(false);
+ QStandardItem *genresRootItem = mGenreM->invisibleRootItem();
+ QSqlQuery genresQ(db);
+ genresQ.prepare("SELECT genres.tgenrename, genres.igenres_id FROM genres, seriesparts_genremap WHERE seriesparts_genremap.iseriesparts_id = :id AND seriesparts_genremap.igenres_id = genres.igenres_id ORDER BY genres.tgenrename");
+ genresQ.bindValue(":id", seriesPartsId);
+ genresQ.exec();
+ while(genresQ.next()){
+ QStandardItem *i = new QStandardItem;
+ i->setEditable(false);
+ i->setIcon(QIcon(":/dick_in_cage.png"));
+ i->setText(genresQ.value(0).toString());
+ i->setData(genresQ.value(1), GenreIdRole);
+ genresRootItem->appendRow(i);
+ }
+
}
diff --git a/moviepropertiesdialog.h b/moviepropertiesdialog.h
index a409b0a..2d37b57 100644
--- a/moviepropertiesdialog.h
+++ b/moviepropertiesdialog.h
@@ -10,6 +10,7 @@ class QStandardItemModel;
class MoviePropertiesDialog : public QDialog {
public:
+ enum CustomRoles { ActorIdRole = Qt::UserRole + 1, GenreIdRole = Qt::UserRole + 2 };
explicit MoviePropertiesDialog(QWidget *parent = nullptr);
public slots: