From 68ee8c0796a663ec87b913da33d48cf5481ddb35 Mon Sep 17 00:00:00 2001 From: am Date: Fri, 31 Jul 2009 17:31:26 +0000 Subject: -started properties dialog, does nothing atm, but compiles :) git-svn-id: file:///var/svn/repos2/shemov/trunk@396 f440f766-f032-0410-8965-dc7d17de2ca0 --- moviepropertiesdialog.cpp | 65 +++++++++++++++++++++++++++++++++++++++++++++++ moviepropertiesdialog.h | 41 ++++++++++++++++++++++++++++++ shemov.pro | 6 +++-- 3 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 moviepropertiesdialog.cpp create mode 100644 moviepropertiesdialog.h diff --git a/moviepropertiesdialog.cpp b/moviepropertiesdialog.cpp new file mode 100644 index 0000000..26bec8f --- /dev/null +++ b/moviepropertiesdialog.cpp @@ -0,0 +1,65 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "moviepropertiesdialog.h" +#include "helper.h" + +MoviePropertiesDialog::MoviePropertiesDialog(int movid, QWidget *parent, Qt::WindowFlags f) : QDialog(parent, f), mId(movid), mIndex(-1){ + //gather data + covers(); + QSqlQuery q1; + q1.prepare("SELECT ttitle, tfilename, cmd5sum, bisize, genre.tgenrename, iquality, idvd FROM movies, genre WHERE movies.igenreid = genre.igenreid AND movies.imovid = :id"); + q1.bindValue(":id", mId); + q1.exec(); + QString title, filename, md5, genre; + quint64 size(0); + qint32 quality, dvd; + quality = dvd = 0; + q1.exec(); + while(q1.next()){ + title = q1.value(0).toString(); + filename = q1.value(1).toString(); + md5 = q1.value(2).toString(); + genre = q1.value(4).toString(); + size = q1.value(3).toLongLong(); + quality = q1.value(5).toInt(); + dvd = q1.value(6).toInt(); + } + QStringList actors; + QSqlQuery q2; + q2.prepare("SELECT tactorname FROM actor, movieactormap WHERE movieactormap.iactorid = actor.iactorid AND movieactormap.imovid = :id"); + q2.bindValue(":id", mId); + while(q2.next()){ + actors << q2.value(0).toString(); + } + //layout + +} + +void MoviePropertiesDialog::covers(){ + QSqlQuery q; + q.prepare("SELECT tfilename, cmd5sum FROM covers WHERE imovid = :id"); + q.bindValue(":id", mId); + q.exec(); + while(q.next()){ + QString path = Helper::createArchivePath(q.value(0).toString(), q.value(1).toString()); + QFileInfo fi(path); + if(fi.exists()){ + mCovers << path; + } + } +} diff --git a/moviepropertiesdialog.h b/moviepropertiesdialog.h new file mode 100644 index 0000000..457c5e1 --- /dev/null +++ b/moviepropertiesdialog.h @@ -0,0 +1,41 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#ifndef MOVIEPROPERTIESDIALOG_H +#define MOVIEPROPERTIESDIALOG_H + +#include + +class QGraphicsView; +class QGraphicsScene; +class QPushButton; +class QTextEdit; + +class MoviePropertiesDialog : public QDialog { + Q_OBJECT + public: + MoviePropertiesDialog(int movid, QWidget *parent = 0, Qt::WindowFlags f = 0); + ~MoviePropertiesDialog() {}; + + private slots: + void setPic(int index); + + private: + void covers(); + QGraphicsView *mView; + QGraphicsScene *mScene; + QPushButton *mNext; + QPushButton *mPrev; + QPushButton *mClose; + QTextEdit *mActors; + int mId; + int mIndex; + QStringList mCovers; +}; + +#endif + diff --git a/shemov.pro b/shemov.pro index 32b2f83..d32685b 100644 --- a/shemov.pro +++ b/shemov.pro @@ -28,7 +28,8 @@ editarchiveitemdialog.cpp \ sizedelegate.cpp \ archiveddelegate.cpp \ coverarchiveeditor.cpp \ -textenterdialog.cpp +textenterdialog.cpp \ +moviepropertiesdialog.cpp HEADERS = listitem.h \ listmodel.h \ movieitem.h \ @@ -55,7 +56,8 @@ editarchiveitemdialog.h \ sizedelegate.h \ archiveddelegate.h \ coverarchiveeditor.h \ -textenterdialog.h +textenterdialog.h \ +moviepropertiesdialog.h LIBS += -lmagic LIBS += -lcryptopp INCLUDEPATH += /usr/include/cryptopp -- cgit v1.2.3-70-g09d2