.
This commit is contained in:
@@ -46,6 +46,11 @@ cEdit::cEdit(QWidget *parent) :
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
QPalette palette = ui->m_lpDownloadLinkLabel->palette();
|
||||
QColor col = palette.color(QPalette::Window);
|
||||
QString color = QString("background-color: rgb(%1,%2,%3,%4);").arg(col.red()).arg(col.green()).arg(col.blue()).arg(95);
|
||||
ui->m_lpScrollArea->setStyleSheet(color);
|
||||
|
||||
connect(ui->m_lpAllInit, SIGNAL(clicked()), this, SLOT(lpAllInit_clicked()));
|
||||
connect(ui->m_lpAllProgress, SIGNAL(clicked()), this, SLOT(lpAllProgress_clicked()));
|
||||
connect(ui->m_lpAllDone, SIGNAL(clicked()), this, SLOT(lpAllDone_clicked()));
|
||||
@@ -86,7 +91,6 @@ void cEdit::setSerie(cSerie* lpSerie)
|
||||
|
||||
if(!lpSerie)
|
||||
return;
|
||||
|
||||
ui->m_lpName->setText(lpSerie->seriesName());
|
||||
ui->m_lpFirstAired->setDate(lpSerie->firstAired());
|
||||
ui->m_lpCliffhanger->setChecked(lpSerie->cliffhanger());
|
||||
@@ -132,6 +136,7 @@ void cEdit::setSerie(cSerie* lpSerie)
|
||||
m_lpGroup = new QButtonGroup(this);
|
||||
lpEpisode->setGroup(m_lpGroup);
|
||||
m_lpLabel = new QLabel(QString("%1").arg(lpEpisode->episodeNumber()), m_lpGroupBox);
|
||||
|
||||
lpEpisode->setLabel(m_lpLabel);
|
||||
|
||||
if(bFirst)
|
||||
@@ -190,6 +195,11 @@ void cEdit::setSerie(cSerie* lpSerie)
|
||||
|
||||
m_lpVerticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding);
|
||||
ui->m_lpGridLayoutScroll->addItem(m_lpVerticalSpacer, x+1, 0, 1, 1);
|
||||
|
||||
cMovieImage image;
|
||||
//QPixmap backdrop = image.getImage(m_lpSerie->backdropPath());
|
||||
QPixmap poster = image.getImage(m_lpSerie->posterPath());
|
||||
ui->m_lpProgressTab->setPixmap(poster);
|
||||
}
|
||||
|
||||
void cEdit::lpAllInit_clicked()
|
||||
@@ -242,11 +252,8 @@ void cEdit::on_m_lpTabWidget_tabBarClicked(int index)
|
||||
lpDialog->show();
|
||||
|
||||
cMovieImage image;
|
||||
QPixmap backdrop = image.getImage(m_lpSerie->backdropPath());
|
||||
//QPalette palette;
|
||||
//palette.setBrush(this->backgroundRole(), QBrush(backdrop.toImage()));
|
||||
//this->setPalette(palette);
|
||||
// ui->m_lpDetailsBackdrop->setPixmap(backdrop);
|
||||
QPixmap poster = image.getImage(m_lpSerie->posterPath());
|
||||
ui->m_lpDetailsImage->setPixmap(poster.scaledToHeight(200));
|
||||
|
||||
ui->m_lpDetailsOverview->setText(m_lpSerie->overview());
|
||||
ui->m_lpDetailsSeasonTab->clear();
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>804</width>
|
||||
<width>1173</width>
|
||||
<height>732</height>
|
||||
</rect>
|
||||
</property>
|
||||
@@ -21,7 +21,7 @@
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab">
|
||||
<widget class="cPixmapWidget" name="m_lpProgressTab">
|
||||
<attribute name="title">
|
||||
<string>Progress</string>
|
||||
</attribute>
|
||||
@@ -61,7 +61,7 @@
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<widget class="QLabel" name="m_lpDownloadLinkLabel">
|
||||
<property name="text">
|
||||
<string>Download Link:</string>
|
||||
</property>
|
||||
@@ -107,10 +107,13 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>754</width>
|
||||
<width>1123</width>
|
||||
<height>546</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="m_lpGridLayoutScroll"/>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -121,134 +124,130 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="tab_2">
|
||||
<widget class="QWidget" name="m_lpDetailsTab">
|
||||
<attribute name="title">
|
||||
<string>Details</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3" stretch="0,1,1">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpDetailsBackdrop">
|
||||
<property name="minimumSize">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="6">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="cVerticalLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Actors</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="m_lpDetailsActors">
|
||||
<property name="columnCount">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">2</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="5" rowspan="2">
|
||||
<widget class="QTextEdit" name="m_lpDetailsOverview">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>758</width>
|
||||
<height>140</height>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="widgetResizable">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>756</width>
|
||||
<height>241</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_5">
|
||||
<item>
|
||||
<widget class="QTextEdit" name="m_lpDetailsOverview">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_4" stretch="2,1">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||
<item>
|
||||
<widget class="cVerticalLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Actors</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="m_lpDetailsActors">
|
||||
<property name="columnCount">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">2</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="cVerticalLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Genre</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="m_lpDetailsGenre">
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="m_lpDetailsSeasonTab">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
<item row="1" column="6">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="cVerticalLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Genre</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="m_lpDetailsGenre">
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="0" rowspan="2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpDetailsImage">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>0</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="verticalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QTabWidget" name="m_lpDetailsSeasonTab">
|
||||
<property name="currentIndex">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<widget class="QWidget" name="tab_3">
|
||||
<attribute name="title">
|
||||
<string>Tab 1</string>
|
||||
</attribute>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
@@ -273,6 +272,12 @@
|
||||
<extends>QLabel</extends>
|
||||
<header>cverticallabel.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>cPixmapWidget</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>cpixmapwidget.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections>
|
||||
|
||||
+16
-1
@@ -5,6 +5,7 @@
|
||||
#include "cmessageanimatedialog.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QTreeWidgetItem>
|
||||
|
||||
|
||||
cEpisodeDetails::cEpisodeDetails(QWidget *parent) :
|
||||
@@ -26,6 +27,20 @@ void cEpisodeDetails::setEpisode(cEpisode* lpEpisode)
|
||||
m_lpEpisode = lpEpisode;
|
||||
ui->m_lpEpisodeTitle->setText(lpEpisode->name());
|
||||
ui->m_lpOverview->setText(lpEpisode->overview());
|
||||
|
||||
QTreeWidgetItem* lpItem;
|
||||
for(int x = 0;x < lpEpisode->guestStars().count();x++)
|
||||
{
|
||||
QStringList tmp = lpEpisode->guestStars().at(x).split(",");
|
||||
lpItem = new QTreeWidgetItem(ui->m_lpDetailsActors);
|
||||
lpItem->setText(0, tmp.at(0));
|
||||
if(tmp.count() > 1)
|
||||
lpItem->setText(1, tmp.at(1));
|
||||
|
||||
ui->m_lpDetailsActors->addTopLevelItem(lpItem);
|
||||
}
|
||||
ui->m_lpDetailsActors->resizeColumnToContents(0);
|
||||
ui->m_lpDetailsActors->resizeColumnToContents(1);
|
||||
}
|
||||
|
||||
void cEpisodeDetails::loadImages()
|
||||
@@ -42,7 +57,7 @@ void cEpisodeDetails::loadImages()
|
||||
lpDialog->show();
|
||||
|
||||
cMovieImage image;
|
||||
QPixmap pixmap = image.getImage(m_lpEpisode->stillPath()).scaledToHeight(200);
|
||||
QPixmap pixmap = image.getImage(m_lpEpisode->stillPath()).scaledToHeight(100);
|
||||
ui->m_lpEpisodeThumb->setPixmap(pixmap);
|
||||
|
||||
delete lpDialog;
|
||||
|
||||
+66
-21
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
<width>759</width>
|
||||
<height>502</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -15,29 +15,67 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpEpisodeThumb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
<widget class="QLineEdit" name="m_lpEpisodeTitle">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpEpisodeTitle">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpEpisodeThumb">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="cVerticalLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Guest Stars</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeWidget" name="m_lpDetailsActors">
|
||||
<property name="columnCount">
|
||||
<number>2</number>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">1</string>
|
||||
</property>
|
||||
</column>
|
||||
<column>
|
||||
<property name="text">
|
||||
<string notr="true">2</string>
|
||||
</property>
|
||||
</column>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="m_lpScrollArea">
|
||||
@@ -49,8 +87,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>365</width>
|
||||
<height>245</height>
|
||||
<width>363</width>
|
||||
<height>447</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
@@ -71,6 +109,13 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>cVerticalLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>cverticallabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
#include "common.h"
|
||||
|
||||
#include "cimage.h"
|
||||
|
||||
#include <QDir>
|
||||
#include <QFile>
|
||||
#include <QNetworkAccessManager>
|
||||
#include <QNetworkRequest>
|
||||
#include <QNetworkReply>
|
||||
#include <QEventLoop>
|
||||
#include <QUrl>
|
||||
|
||||
|
||||
cImage::cImage()
|
||||
{
|
||||
}
|
||||
|
||||
QPixmap cImage::getImage(const QString& szFileName)
|
||||
{
|
||||
QPixmap pixmap;
|
||||
|
||||
QString szPath = rootPath() + QDir::separator() + szFileName;
|
||||
|
||||
if(szFileName.isEmpty())
|
||||
pixmap.load(rootPath() + QDir::separator() + QDir::separator() + "empty.jpg");
|
||||
else
|
||||
pixmap.load(szPath);
|
||||
|
||||
if(!pixmap.width())
|
||||
return(downloadFile(szFileName));
|
||||
|
||||
return(pixmap);
|
||||
}
|
||||
|
||||
QPixmap cImage::downloadFile(const QString& szFileName)
|
||||
{
|
||||
QPixmap pixmap;
|
||||
|
||||
QString szPath = rootPath() + QDir::separator() + szFileName;
|
||||
// QString szURL = "http://thetvdb.com/banners/" + szFileName;
|
||||
QString szURL = "https://www.thetvdb.com/banners/" + szFileName;
|
||||
|
||||
QNetworkAccessManager networkManager;
|
||||
QUrl url(szURL);
|
||||
QNetworkRequest request(url);
|
||||
request.setHeader(QNetworkRequest::ContentTypeHeader, "application/xml");
|
||||
|
||||
QNetworkReply* reply = networkManager.get(request);
|
||||
QEventLoop loop;
|
||||
|
||||
QObject::connect(reply, SIGNAL(finished()), &loop, SLOT(quit()));
|
||||
loop.exec();
|
||||
|
||||
QByteArray szData = reply->readAll();
|
||||
delete reply;
|
||||
|
||||
pixmap.loadFromData(szData);
|
||||
|
||||
QDir dir(szPath);
|
||||
QFileInfo fileInfo(szPath);
|
||||
dir.mkpath(dir.filePath(fileInfo.absolutePath()));
|
||||
pixmap.save(szPath);
|
||||
|
||||
return(pixmap);
|
||||
}
|
||||
@@ -1,17 +0,0 @@
|
||||
#ifndef CIMAGE_H
|
||||
#define CIMAGE_H
|
||||
|
||||
|
||||
#include <QPixmap>
|
||||
|
||||
|
||||
class cImage
|
||||
{
|
||||
public:
|
||||
cImage();
|
||||
QPixmap getImage(const QString& szFileName);
|
||||
private:
|
||||
QPixmap downloadFile(const QString& szFileName);
|
||||
};
|
||||
|
||||
#endif // CIMAGE_H
|
||||
+82
-19
@@ -10,7 +10,6 @@
|
||||
#include "cmessagedialog.h"
|
||||
#include "cedit.h"
|
||||
#include "cmovieedit.h"
|
||||
#include "cimage.h"
|
||||
|
||||
#include "cthemoviedbv3.h"
|
||||
|
||||
@@ -364,13 +363,71 @@ void cMainWindow::loadSeriesDB()
|
||||
qint32 iSeasonNumber;
|
||||
cSeason* lpSeason;
|
||||
cEpisode* lpEpisode;
|
||||
QString szQuery =
|
||||
" SELECT serie.seriesID seriesID,"
|
||||
" serie.seriesName seriesName,"
|
||||
" serie.originalName originalName,"
|
||||
" serie.backdropPath backdropPath,"
|
||||
" serie.createdBy createdBy,"
|
||||
" serie.homepage homepage,"
|
||||
" serie.lastAired lastAired,"
|
||||
" serie.languages languages,"
|
||||
" serie.networks networks,"
|
||||
" serie.nrEpisodes nrEpisodes,"
|
||||
" serie.nrSeasons nrSeasons,"
|
||||
" serie.originCountries originCountries,"
|
||||
" serie.originalLanguage originalLanguage,"
|
||||
" serie.popularity popularity,"
|
||||
" serie.posterPath posterPath,"
|
||||
" serie.productionCompanies productionCompanies,"
|
||||
" serie.type type,"
|
||||
" serie.voteAverage voteAverage,"
|
||||
" serie.voteCount voteCount,"
|
||||
" serie.overview overview,"
|
||||
" serie.firstAired firstAired,"
|
||||
" serie.cast cast,"
|
||||
" serie.crew crew,"
|
||||
" serie.genre genre,"
|
||||
" serie.status status,"
|
||||
" serie.download download,"
|
||||
" serie.cliffhanger cliffhanger,"
|
||||
" season._id s__id,"
|
||||
" season.airDate s_airDate,"
|
||||
" season.name s_name,"
|
||||
" season.overview s_overview,"
|
||||
" season.id s_id,"
|
||||
" season.posterPath s_posterPath,"
|
||||
" season.seasonNumber s_seasonNumber,"
|
||||
" season.seriesID s_seriesID,"
|
||||
" episode.id e_id,"
|
||||
" episode.name e_name,"
|
||||
" episode.episodeNumber e_episodeNumber,"
|
||||
" episode.airDate e_airDate,"
|
||||
" episode.guestStars e_guestStars,"
|
||||
" episode.overview e_overview,"
|
||||
" episode.productioncode e_productioncode,"
|
||||
" episode.seasonNumber e_seasonNumber,"
|
||||
" episode.seasonID e_seasonID,"
|
||||
" episode.seriesID e_seriesID,"
|
||||
" episode.stillPath e_stillPath,"
|
||||
" episode.voteAverage e_voteAverage,"
|
||||
" episode.voteCount e_voteCount,"
|
||||
" episode.crew e_crew,"
|
||||
" episode.state e_state"
|
||||
" FROM serie"
|
||||
" LEFT JOIN season ON serie.seriesID = season.seriesID"
|
||||
" LEFT JOIN episode ON serie.seriesID = episode.seriesID AND season.seasonNumber = episode.seasonNumber"
|
||||
" ORDER BY serie.seriesName,"
|
||||
" serie.firstAired,"
|
||||
" season.seasonNumber,"
|
||||
" episode.episodeNumber;";
|
||||
|
||||
if(query.exec("SELECT serie.seriesID,serie.seriesName,serie.originalName,serie.backdropPath,serie.createdBy,serie.homepage,serie.lastAired,serie.languages,serie.networks,serie.nrEpisodes,serie.nrSeasons,serie.originCountries,serie.originalLanguage,serie.popularity,serie.posterPath,serie.productionCompanies,serie.type,serie.voteAverage,serie.voteCount,serie.overview,serie.firstAired,serie.cast,serie.crew,serie.genre,serie.status,serie.download,serie.cliffhanger,episode.id eid,episode.name ename,episode.episodeNumber eepisodeNumber,episode.airDate eairDate,episode.guestStars eguestStars,episode.overview eoverview,episode.productioncode eproductioncode,episode.seasonNumber eseasonNumber,episode.seasonID eseasonID,episode.seriesID eseriesID,episode.stillPath estillPath,episode.voteAverage evoteAverage,episode.voteCount evoteCount,episode.crew ecrew,episode.state estate FROM serie LEFT JOIN episode ON serie.seriesID = episode.seriesID ORDER BY serie.seriesName, serie.firstAired, episode.seasonNumber, episode.episodeNumber;"))
|
||||
if(query.exec(szQuery))
|
||||
{
|
||||
while(query.next())
|
||||
{
|
||||
iSeriesID = query.value("seriesID").toInt();
|
||||
iSeasonNumber = query.value("eseasonNumber").toInt();
|
||||
iSeasonNumber = query.value("e_seasonNumber").toInt();
|
||||
|
||||
if(iSeriesID != iOldSeriesID)
|
||||
{
|
||||
@@ -409,27 +466,33 @@ void cMainWindow::loadSeriesDB()
|
||||
|
||||
if(iSeasonNumber != iOldSeasonNumber)
|
||||
{
|
||||
lpSeason = lpSerie->addSeason(query.value("eseasonNumber").toInt());
|
||||
lpSeason = lpSerie->addSeason(query.value("s_seasonNumber").toInt());
|
||||
lpSeason->set_ID(query.value("s__id").toInt());
|
||||
lpSeason->setAirDate(query.value("s_airDate").toString());
|
||||
lpSeason->setName(query.value("s_name").toString());
|
||||
lpSeason->setOverview(query.value("s_overview").toString());
|
||||
lpSeason->setID(query.value("s_id").toInt());
|
||||
lpSeason->setPosterPath(query.value("s_posterPath").toString());
|
||||
iOldSeasonNumber = iSeasonNumber;
|
||||
}
|
||||
|
||||
lpEpisode = lpSeason->addEpisode(iSeasonNumber);
|
||||
|
||||
lpEpisode->setID(query.value("eid").toInt());
|
||||
lpEpisode->setName(query.value("ename").toString());
|
||||
lpEpisode->setEpisodeNumber(query.value("eepisodeNumber").toInt());
|
||||
lpEpisode->setAirDate(query.value("eairDate").toString());
|
||||
lpEpisode->setGuestStars(query.value("eguestStars").toString());
|
||||
lpEpisode->setOverview(query.value("eoverview").toString());
|
||||
lpEpisode->setProductionCode(query.value("eproductioncode").toString());
|
||||
lpEpisode->setSeasonNumber(query.value("eseasonNumber").toInt());
|
||||
lpEpisode->setSeasonID(query.value("eseasonID").toInt());
|
||||
lpEpisode->setSeriesID(query.value("eseriesID").toInt());
|
||||
lpEpisode->setStillPath(query.value("estillPath").toString());
|
||||
lpEpisode->setVoteAverage(query.value("evoteAverage").toDouble());
|
||||
lpEpisode->setVoteCount(query.value("evoteCount").toInt());
|
||||
lpEpisode->setCrew(query.value("ecrew").toString());
|
||||
lpEpisode->setState((cEpisode::State)query.value("estate").toInt());
|
||||
lpEpisode->setID(query.value("e_id").toInt());
|
||||
lpEpisode->setName(query.value("e_name").toString());
|
||||
lpEpisode->setEpisodeNumber(query.value("e_episodeNumber").toInt());
|
||||
lpEpisode->setAirDate(query.value("e_airDate").toString());
|
||||
lpEpisode->setGuestStars(query.value("e_guestStars").toString());
|
||||
lpEpisode->setOverview(query.value("e_overview").toString());
|
||||
lpEpisode->setProductionCode(query.value("e_productioncode").toString());
|
||||
lpEpisode->setSeasonNumber(query.value("e_seasonNumber").toInt());
|
||||
lpEpisode->setSeasonID(query.value("e_seasonID").toInt());
|
||||
lpEpisode->setSeriesID(query.value("e_seriesID").toInt());
|
||||
lpEpisode->setStillPath(query.value("e_stillPath").toString());
|
||||
lpEpisode->setVoteAverage(query.value("e_voteAverage").toDouble());
|
||||
lpEpisode->setVoteCount(query.value("e_voteCount").toInt());
|
||||
lpEpisode->setCrew(query.value("e_crew").toString());
|
||||
lpEpisode->setState((cEpisode::State)query.value("e_state").toInt());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
#include "cpixmapwidget.h"
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
|
||||
cPixmapWidget::cPixmapWidget(QWidget *parent) : QWidget(parent)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void cPixmapWidget::setPixmap(const QPixmap& pixmap)
|
||||
{
|
||||
m_pixmap = pixmap;
|
||||
}
|
||||
|
||||
void cPixmapWidget::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
if(!m_pixmap.isNull())
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.drawPixmap(0, 0, m_pixmap.scaled(width(), height(), Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation));
|
||||
}
|
||||
QWidget::paintEvent(event);
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
#ifndef CPIXMAPWIDGET_H
|
||||
#define CPIXMAPWIDGET_H
|
||||
|
||||
|
||||
#include <QWidget>
|
||||
#include <QPixmap>
|
||||
|
||||
|
||||
class cPixmapWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit cPixmapWidget(QWidget *parent = nullptr);
|
||||
void setPixmap(const QPixmap& pixmap);
|
||||
|
||||
signals:
|
||||
|
||||
public slots:
|
||||
|
||||
protected:
|
||||
QPixmap m_pixmap;
|
||||
void paintEvent(QPaintEvent *event);
|
||||
};
|
||||
|
||||
#endif // CPIXMAPWIDGET_H
|
||||
@@ -0,0 +1,23 @@
|
||||
#include "cscrollarea.h"
|
||||
|
||||
#include <QPainter>
|
||||
|
||||
cScrollArea::cScrollArea(QWidget* parent) :
|
||||
QScrollArea(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void cScrollArea::setPixmap(const QPixmap& pixmap)
|
||||
{
|
||||
m_pixmap = pixmap;
|
||||
}
|
||||
|
||||
void cScrollArea::paintEvent(QPaintEvent *event)
|
||||
{
|
||||
if(!m_pixmap.isNull())
|
||||
{
|
||||
QPainter painter(this);
|
||||
painter.drawPixmap(0, 0, m_pixmap);
|
||||
}
|
||||
QScrollArea::paintEvent(event);
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
#ifndef CSCROLLAREA_H
|
||||
#define CSCROLLAREA_H
|
||||
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QPixmap>
|
||||
|
||||
|
||||
class cScrollArea : public QScrollArea
|
||||
{
|
||||
public:
|
||||
cScrollArea(QWidget* parent = 0);
|
||||
void setPixmap(const QPixmap& pixmap);
|
||||
protected:
|
||||
QPixmap m_pixmap;
|
||||
void paintEvent(QPaintEvent *event);
|
||||
};
|
||||
|
||||
#endif // CSCROLLAREA_H
|
||||
@@ -6,6 +6,8 @@
|
||||
|
||||
#include "cmessageanimatedialog.h"
|
||||
|
||||
#include "cmovieimage.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
|
||||
@@ -23,6 +25,13 @@ cSeasonDetails::~cSeasonDetails()
|
||||
|
||||
void cSeasonDetails::setSeason(cSeason* lpSeason)
|
||||
{
|
||||
ui->m_lpSeasonName->setText(lpSeason->name());
|
||||
ui->m_lpSeasonOverview->setText(lpSeason->overview());
|
||||
|
||||
cMovieImage image;
|
||||
QPixmap poster = image.getImage(lpSeason->posterPath());
|
||||
ui->m_lpSeasonPoster->setPixmap(poster.scaledToHeight(200));
|
||||
|
||||
for(int x = 0;x < lpSeason->episodeList().count();x++)
|
||||
{
|
||||
cEpisode* lpEpisode = lpSeason->episodeList().at(x);
|
||||
|
||||
+44
-5
@@ -15,11 +15,50 @@
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTabWidget" name="m_lpDetailsEpisodeTab">
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpSeasonName">
|
||||
<property name="font">
|
||||
<font>
|
||||
<pointsize>12</pointsize>
|
||||
<weight>75</weight>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTextEdit" name="m_lpSeasonOverview">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpSeasonPoster">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTabWidget" name="m_lpDetailsEpisodeTab">
|
||||
<property name="currentIndex">
|
||||
<number>-1</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
||||
+6
-4
@@ -21,7 +21,6 @@ SOURCES += main.cpp\
|
||||
csearch.cpp \
|
||||
cmessageanimatedialog.cpp \
|
||||
cedit.cpp \
|
||||
cimage.cpp \
|
||||
cseasondetails.cpp \
|
||||
cverticallabel.cpp \
|
||||
cepisodedetails.cpp \
|
||||
@@ -34,7 +33,9 @@ SOURCES += main.cpp\
|
||||
cmovieviewitemdelegate.cpp \
|
||||
common.cpp \
|
||||
cmovieedit.cpp \
|
||||
cmovieimage.cpp
|
||||
cmovieimage.cpp \
|
||||
cscrollarea.cpp \
|
||||
cpixmapwidget.cpp
|
||||
|
||||
HEADERS += cmainwindow.h \
|
||||
cserie.h \
|
||||
@@ -44,7 +45,6 @@ HEADERS += cmainwindow.h \
|
||||
csearch.h \
|
||||
cmessageanimatedialog.h \
|
||||
cedit.h \
|
||||
cimage.h \
|
||||
cseasondetails.h \
|
||||
cverticallabel.h \
|
||||
cepisodedetails.h \
|
||||
@@ -57,7 +57,9 @@ HEADERS += cmainwindow.h \
|
||||
cmovieviewitemdelegate.h \
|
||||
common.h \
|
||||
cmovieedit.h \
|
||||
cmovieimage.h
|
||||
cmovieimage.h \
|
||||
cscrollarea.h \
|
||||
cpixmapwidget.h
|
||||
|
||||
FORMS += cmainwindow.ui \
|
||||
csearch.ui \
|
||||
|
||||
Reference in New Issue
Block a user