Movie & Serie Discover
This commit is contained in:
+10
-6
@@ -126,15 +126,19 @@ void cDiscover::on_m_lpYearEnable_clicked(bool checked)
|
||||
|
||||
void cDiscover::on_m_lpSeries_clicked(const QModelIndex &index)
|
||||
{
|
||||
setCursor(Qt::WaitCursor);
|
||||
|
||||
QStandardItem* lpItem = m_lpSeriesModel->itemFromIndex(index);
|
||||
cSerie* lpSerie = lpItem->data().value<cSerie*>();
|
||||
|
||||
// if(lpSerie->cast().isEmpty())
|
||||
// {
|
||||
// cTheMovieDBV3 theMovieDB;
|
||||
// theMovieDB.loadCastSerie(lpSerie);
|
||||
// }
|
||||
// ui->m_lpMovieDetails->setMovie(lpMovie);
|
||||
if(lpSerie->cast().isEmpty())
|
||||
{
|
||||
cTheMovieDBV3 theMovieDB;
|
||||
theMovieDB.loadCastSerie(lpSerie);
|
||||
}
|
||||
ui->m_lpSerieDetails->setSerie(lpSerie);
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
QList<qint32> cDiscover::id()
|
||||
|
||||
+33
-34
@@ -131,40 +131,39 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_4" stretch="1,2">
|
||||
<item>
|
||||
<widget class="QTreeView" name="m_lpSeries">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QTreeView" name="m_lpSeries">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QScrollArea" name="m_lpMovieDetailsScroller">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>90</width>
|
||||
<height>304</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="cSerieDetails" name="m_lpSerieDetails" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="m_lpMovieDetailsScroller">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>579</width>
|
||||
<height>302</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<widget class="cMovieDetails" name="m_lpSerieDetails" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
@@ -187,9 +186,9 @@
|
||||
<header>qxtspanslider.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>cMovieDetails</class>
|
||||
<class>cSerieDetails</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>cmoviedetails.h</header>
|
||||
<header>cseriedetails.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
|
||||
@@ -127,6 +127,8 @@ void cMovieDiscover::on_m_lpYearEnable_clicked(bool checked)
|
||||
|
||||
void cMovieDiscover::on_m_lpMovies_clicked(const QModelIndex &index)
|
||||
{
|
||||
setCursor(Qt::WaitCursor);
|
||||
|
||||
QStandardItem* lpItem = m_lpMoviesModel->itemFromIndex(index);
|
||||
cMovie* lpMovie = lpItem->data().value<cMovie*>();
|
||||
|
||||
@@ -136,6 +138,8 @@ void cMovieDiscover::on_m_lpMovies_clicked(const QModelIndex &index)
|
||||
theMovieDB.loadCastMovie(lpMovie);
|
||||
}
|
||||
ui->m_lpMovieDetails->setMovie(lpMovie);
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
QList<qint32> cMovieDiscover::id()
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
<string>Discover Movie</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
|
||||
+14
-4
@@ -9,7 +9,6 @@
|
||||
#include <QList>
|
||||
|
||||
|
||||
|
||||
cMovieSearch::cMovieSearch(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::cMovieSearch),
|
||||
@@ -42,6 +41,8 @@ void cMovieSearch::on_m_lpSearch_textChanged(const QString &/*arg1*/)
|
||||
|
||||
void cMovieSearch::on_m_lpSearchButton_clicked()
|
||||
{
|
||||
setCursor(Qt::WaitCursor);
|
||||
|
||||
cMessageAnimateDialog* lpDialog = new cMessageAnimateDialog(this);
|
||||
lpDialog->setTitle("Search");
|
||||
lpDialog->setMessage("Searching");
|
||||
@@ -66,6 +67,8 @@ void cMovieSearch::on_m_lpSearchButton_clicked()
|
||||
QList<cMovie*> movieList = theMovieDBV3.searchMovie(szSearchText, iYear, "de-DE");
|
||||
|
||||
m_lpResultsModel->clear();
|
||||
QStringList headerLabels = QStringList() << tr("Title") << tr("Year");
|
||||
m_lpResultsModel->setHorizontalHeaderLabels(headerLabels);
|
||||
|
||||
for(int z = 0;z < movieList.count();z++)
|
||||
{
|
||||
@@ -77,16 +80,19 @@ void cMovieSearch::on_m_lpSearchButton_clicked()
|
||||
items.append(new QStandardItem(QString::number(lpMovie->releaseDate().year())));
|
||||
items[0]->setData(QVariant::fromValue(lpMovie));
|
||||
items[1]->setData(QVariant::fromValue(lpMovie));
|
||||
items[0]->setCheckState(Qt::Unchecked);
|
||||
items[0]->setCheckable(true);
|
||||
|
||||
m_lpResultsModel->appendRow(items);
|
||||
}
|
||||
ui->m_lpResults->resizeColumnToContents(0);
|
||||
ui->m_lpResults->resizeColumnToContents(1);
|
||||
|
||||
for(int x = 0;x < headerLabels.count();x++)
|
||||
ui->m_lpResults->resizeColumnToContents(x);
|
||||
|
||||
m_lpResultsModel->sort(0, Qt::AscendingOrder);
|
||||
|
||||
delete lpDialog;
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
QList<qint32> cMovieSearch::id()
|
||||
@@ -129,6 +135,8 @@ qint16 cMovieSearch::year()
|
||||
|
||||
void cMovieSearch::on_m_lpResults_clicked(const QModelIndex& index)
|
||||
{
|
||||
setCursor(Qt::WaitCursor);
|
||||
|
||||
cMovie* lpMovie = m_lpResultsModel->itemFromIndex(index)->data().value<cMovie*>();
|
||||
|
||||
if(lpMovie->cast().isEmpty())
|
||||
@@ -139,6 +147,8 @@ void cMovieSearch::on_m_lpResults_clicked(const QModelIndex& index)
|
||||
ui->m_lpMovieDetails->setMovie(lpMovie);
|
||||
|
||||
setButtonBox();
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
void cMovieSearch::on_m_lpPlaceholderName_textChanged(const QString &/*arg1*/)
|
||||
|
||||
+36
-37
@@ -11,7 +11,7 @@
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
<string>Search Movies</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="1" column="0">
|
||||
@@ -35,7 +35,7 @@
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,10">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
@@ -51,43 +51,42 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,2">
|
||||
<item>
|
||||
<widget class="QTreeView" name="m_lpResults">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
<widget class="QSplitter" name="m_lpSplitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QTreeView" name="m_lpResults">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::SingleSelection</enum>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QScrollArea" name="m_lpMovieDetailsScroller">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>87</width>
|
||||
<height>363</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="cMovieDetails" name="m_lpMovieDetails" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QScrollArea" name="m_lpMovieDetailsScroller">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>590</width>
|
||||
<height>372</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="cMovieDetails" name="m_lpMovieDetails" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
+22
-7
@@ -42,6 +42,8 @@ void cSearch::on_m_lpSearch_textChanged(const QString& /*arg1*/)
|
||||
|
||||
void cSearch::on_m_lpSearchButton_clicked()
|
||||
{
|
||||
setCursor(Qt::WaitCursor);
|
||||
|
||||
cMessageAnimateDialog* lpDialog = new cMessageAnimateDialog(this);
|
||||
lpDialog->setTitle("Search");
|
||||
lpDialog->setMessage("Searching");
|
||||
@@ -56,11 +58,6 @@ void cSearch::on_m_lpSearchButton_clicked()
|
||||
for(int z = 0;z < serieList3.count();z++)
|
||||
{
|
||||
cSerie* lpSerie = serieList3.at(z);
|
||||
// QTreeWidgetItem* lpNew = new QTreeWidgetItem(ui->m_lpResults);
|
||||
// lpNew->setText(0, lpSerie->seriesName());
|
||||
// lpNew->setText(2, QString("%1").arg(lpSerie->firstAired().year()));
|
||||
// lpNew->setData(0, Qt::UserRole, QVariant::fromValue(lpSerie->seriesID()));
|
||||
// ui->m_lpResults->addTopLevelItem(lpNew);
|
||||
|
||||
QList<QStandardItem*> items;
|
||||
|
||||
@@ -77,6 +74,8 @@ void cSearch::on_m_lpSearchButton_clicked()
|
||||
m_lpResultsModel->sort(0);
|
||||
|
||||
delete lpDialog;
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
qint32 cSearch::id()
|
||||
@@ -88,7 +87,10 @@ qint32 cSearch::id()
|
||||
return(iID);
|
||||
return(-1);
|
||||
}
|
||||
return(m_lpResultsModel->itemFromIndex(ui->m_lpResults->selectionModel()->selectedRows().at(0))->data(Qt::UserRole).value<cSerie*>()->seriesID());
|
||||
|
||||
QStandardItem* lpItem = m_lpResultsModel->itemFromIndex(ui->m_lpResults->selectionModel()->selectedRows().at(0));
|
||||
cSerie* lpSerie = lpItem->data().value<cSerie*>();
|
||||
return(lpSerie->seriesID());
|
||||
}
|
||||
|
||||
QString cSearch::placeholderName()
|
||||
@@ -106,9 +108,22 @@ qint16 cSearch::year()
|
||||
return(ui->m_lpYear->value());
|
||||
}
|
||||
|
||||
void cSearch::on_m_lpResults_clicked(const QModelIndex &/*index*/)
|
||||
void cSearch::on_m_lpResults_clicked(const QModelIndex& index)
|
||||
{
|
||||
setCursor(Qt::WaitCursor);
|
||||
QStandardItem* lpItem = m_lpResultsModel->itemFromIndex(index);
|
||||
cSerie* lpSerie = lpItem->data().value<cSerie*>();
|
||||
|
||||
if(lpSerie->cast().isEmpty())
|
||||
{
|
||||
cTheMovieDBV3 theMovieDB;
|
||||
theMovieDB.loadCastSerie(lpSerie);
|
||||
}
|
||||
ui->m_lpSerieDetails->setSerie(lpSerie);
|
||||
|
||||
setButtonBox();
|
||||
|
||||
setCursor(Qt::ArrowCursor);
|
||||
}
|
||||
|
||||
void cSearch::on_m_lpPlaceholderName_textChanged(const QString& /*arg1*/)
|
||||
|
||||
+54
-22
@@ -6,8 +6,8 @@
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>334</width>
|
||||
<height>460</height>
|
||||
<width>900</width>
|
||||
<height>500</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
@@ -35,35 +35,59 @@
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,10">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpSearch"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QPushButton" name="m_lpSearchButton">
|
||||
<property name="text">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QLineEdit" name="m_lpSearch"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QTreeView" name="m_lpResults">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
<widget class="QPushButton" name="m_lpSearchButton">
|
||||
<property name="text">
|
||||
<string>Search</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QSplitter" name="splitter">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<widget class="QTreeView" name="m_lpResults">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
<widget class="QScrollArea" name="m_lpMovieDetailsScroller">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>589</width>
|
||||
<height>363</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<widget class="cSerieDetails" name="m_lpSerieDetails" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
@@ -127,6 +151,14 @@
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>cSerieDetails</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>cseriedetails.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<tabstops>
|
||||
<tabstop>m_lpSearch</tabstop>
|
||||
<tabstop>m_lpSearchButton</tabstop>
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
#include "cseriedetails.h"
|
||||
#include "ui_cseriedetails.h"
|
||||
|
||||
#include "cmovieimage.h"
|
||||
|
||||
|
||||
cSerieDetails::cSerieDetails(QWidget *parent) :
|
||||
QWidget(parent),
|
||||
ui(new Ui::cSerieDetails),
|
||||
m_lpActorsModel(0),
|
||||
m_lpGenreModel(0)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
|
||||
m_lpActorsModel = new QStandardItemModel(0, 0);
|
||||
ui->m_lpDetailsActors->setModel(m_lpActorsModel);
|
||||
|
||||
m_lpGenreModel = new QStandardItemModel(0, 9);
|
||||
ui->m_lpDetailsGenre->setModel(m_lpGenreModel);
|
||||
}
|
||||
|
||||
cSerieDetails::~cSerieDetails()
|
||||
{
|
||||
delete m_lpActorsModel;
|
||||
delete m_lpGenreModel;
|
||||
|
||||
delete ui;
|
||||
}
|
||||
|
||||
void cSerieDetails::setSerie(cSerie* lpSerie)
|
||||
{
|
||||
ui->m_lpName->setText(lpSerie->seriesName());
|
||||
ui->m_lpFirstAired->setDate(lpSerie->firstAired());
|
||||
|
||||
ui->m_lpDetailsBanner->clear();
|
||||
if(!lpSerie->backdropPath().isEmpty())
|
||||
{
|
||||
cMovieImage image;
|
||||
QPixmap banner = image.getImage(lpSerie->backdropPath());
|
||||
ui->m_lpDetailsBanner->setPixmap(banner);
|
||||
}
|
||||
|
||||
ui->m_lpDetailsOverview->setText(lpSerie->overview());
|
||||
|
||||
m_lpActorsModel->clear();
|
||||
for(int x = 0;x < lpSerie->cast().count();x++)
|
||||
{
|
||||
QList<QStandardItem*> items;
|
||||
QStringList str = lpSerie->cast().at(x).split(",");
|
||||
|
||||
items.append(new QStandardItem(str.at(0)));
|
||||
items.append(new QStandardItem(str.at(1)));
|
||||
m_lpActorsModel->appendRow(items);
|
||||
}
|
||||
ui->m_lpDetailsActors->resizeColumnToContents(0);
|
||||
|
||||
m_lpGenreModel->clear();
|
||||
for(int x = 0;x < lpSerie->genre().count();x++)
|
||||
m_lpGenreModel->appendRow(new QStandardItem(lpSerie->genre().at(x)));
|
||||
|
||||
ui->m_lpDetailsGenre->resizeColumnToContents(0);
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
#ifndef CSERIEDETAILS_H
|
||||
#define CSERIEDETAILS_H
|
||||
|
||||
|
||||
#include "cserie.h"
|
||||
|
||||
#include <QWidget>
|
||||
#include <QStandardItemModel>
|
||||
|
||||
|
||||
namespace Ui {
|
||||
class cSerieDetails;
|
||||
}
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\class cSerieDetails cseriedetails.h "cseriedetails.h"
|
||||
*/
|
||||
class cSerieDetails : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn cSerieDetails
|
||||
\param parent
|
||||
*/
|
||||
explicit cSerieDetails(QWidget *parent = 0);
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn ~cSerieDetails
|
||||
*/
|
||||
~cSerieDetails();
|
||||
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn setSerie
|
||||
\param lpSerie
|
||||
*/
|
||||
void setSerie(cSerie* lpSerie);
|
||||
private:
|
||||
Ui::cSerieDetails* ui; /*!< TODO: describe */
|
||||
QStandardItemModel* m_lpActorsModel; /*!< TODO: describe */
|
||||
QStandardItemModel* m_lpGenreModel; /*!< TODO: describe */
|
||||
};
|
||||
|
||||
#endif // CSERIEDETAILS_H
|
||||
@@ -0,0 +1,175 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>cSerieDetails</class>
|
||||
<widget class="QWidget" name="cSerieDetails">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>860</width>
|
||||
<height>516</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_6" stretch="3,1">
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QLineEdit" name="m_lpName">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Year:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QDateEdit" name="m_lpFirstAired">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</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>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpDetailsBanner">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>310</width>
|
||||
<height>200</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>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QScrollArea" name="scrollArea">
|
||||
<property name="widgetResizable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QWidget" name="scrollAreaWidgetContents">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>840</width>
|
||||
<height>288</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="QTreeView" name="m_lpDetailsActors">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</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="QTreeView" name="m_lpDetailsGenre">
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>cVerticalLabel</class>
|
||||
<extends>QLabel</extends>
|
||||
<header>cverticallabel.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
+59
-2
@@ -140,15 +140,62 @@ QList<cSerie*> cTheMovieDBV3::searchSerie(const QString& szSerie, const qint16&
|
||||
QJsonDocument jsonResponse = QJsonDocument::fromJson(strReply.toUtf8());
|
||||
QJsonObject jsonObj = jsonResponse.object();
|
||||
QJsonArray jsonArray = jsonObj["results"].toArray();
|
||||
QJsonArray tmpArray;
|
||||
QStringList tmpList;
|
||||
|
||||
for(int z = 0;z < jsonArray.count();z++)
|
||||
{
|
||||
QJsonObject serie = jsonArray[z].toObject();
|
||||
cSerie* lpSerie = new cSerie;
|
||||
lpSerie->setSeriesName(serie["name"].toString());
|
||||
|
||||
lpSerie->setSeriesID(serie["id"].toInt());
|
||||
lpSerie->setOriginalName(serie["original_name"].toString());
|
||||
lpSerie->setBackdropPath(serie["backdrop_path"].toString());
|
||||
tmpArray = serie["created_by"].toArray();
|
||||
for(int x = 0;x < tmpArray.count();x++)
|
||||
tmpList.append(tmpArray.at(x).toObject()["name"].toString());
|
||||
lpSerie->setCreatedBy(tmpList);
|
||||
tmpList.clear();
|
||||
lpSerie->setFirstAired(serie["first_air_date"].toString());
|
||||
tmpArray = serie["genres"].toArray();
|
||||
for(int x = 0;x < tmpArray.count();x++)
|
||||
tmpList.append(tmpArray.at(x).toObject()["name"].toString());
|
||||
lpSerie->setGenre(tmpList);
|
||||
tmpList.clear();
|
||||
lpSerie->setHomepage(serie["homepage"].toString());
|
||||
lpSerie->setLastAired(serie["last_air_date"].toString());
|
||||
tmpArray = serie["languages"].toArray();
|
||||
for(int x = 0;x < tmpArray.count();x++)
|
||||
tmpList.append(tmpArray.at(x).toString());
|
||||
lpSerie->setLanguages(tmpList);
|
||||
tmpList.clear();
|
||||
lpSerie->setSeriesName(serie["name"].toString());
|
||||
tmpArray = serie["networks"].toArray();
|
||||
for(int x = 0;x < tmpArray.count();x++)
|
||||
tmpList.append(tmpArray.at(x).toObject()["name"].toString());
|
||||
lpSerie->setNetworks(tmpList);
|
||||
tmpList.clear();
|
||||
lpSerie->setEpisodes(serie["number_of_episodes"].toInt());
|
||||
lpSerie->setSeasons(serie["number_of_seasons"].toInt());
|
||||
tmpArray = serie["origin_country"].toArray();
|
||||
for(int x = 0;x < tmpArray.count();x++)
|
||||
tmpList.append(tmpArray.at(x).toString());
|
||||
lpSerie->setOriginCountries(tmpList);
|
||||
tmpList.clear();
|
||||
lpSerie->setOriginalLanguage(serie["original_language"].toString());
|
||||
lpSerie->setOriginalName(serie["original_name"].toString());
|
||||
lpSerie->setOverview(serie["overview"].toString());
|
||||
lpSerie->setPopularity(serie["popularity"].toDouble());
|
||||
lpSerie->setPosterPath(serie["poster_path"].toString());
|
||||
tmpArray = serie["production_companies"].toArray();
|
||||
for(int x = 0;x < tmpArray.count();x++)
|
||||
tmpList.append(tmpArray.at(x).toObject()["name"].toString());
|
||||
lpSerie->setProductionCompanies(tmpList);
|
||||
tmpList.clear();
|
||||
lpSerie->setStatus(serie["status"].toString());
|
||||
lpSerie->setType(serie["type"].toString());
|
||||
lpSerie->setVoteAverage(serie["vote_average"].toDouble());
|
||||
lpSerie->setVoteCount(serie["vote_count"].toInt());
|
||||
|
||||
serieList.append(lpSerie);
|
||||
}
|
||||
if(jsonObj["total_pages"].toInt() == page)
|
||||
@@ -920,3 +967,13 @@ QList<cSerie*> cTheMovieDBV3::discoverSerie(const QString& szText, const qint16&
|
||||
|
||||
return(serieList);
|
||||
}
|
||||
|
||||
void cTheMovieDBV3::loadCastSerie(cSerie* lpSerie)
|
||||
{
|
||||
cSerie* lpSerie1 = loadSerie(lpSerie->seriesID(), "DE-de");
|
||||
|
||||
lpSerie->setCast(lpSerie1->cast());
|
||||
lpSerie->setCrew(lpSerie1->crew());
|
||||
|
||||
delete lpSerie1;
|
||||
}
|
||||
|
||||
@@ -124,6 +124,13 @@ public:
|
||||
\return QList<cSerie *>
|
||||
*/
|
||||
QList<cSerie*> discoverSerie(const QString& szText, const qint16& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage = "all");
|
||||
/*!
|
||||
\brief
|
||||
|
||||
\fn loadCastSerie
|
||||
\param lpSerie
|
||||
*/
|
||||
void loadCastSerie(cSerie* lpSerie);
|
||||
private:
|
||||
QString m_szToken; /*!< TODO: describe */
|
||||
QMap<qint32, QString> m_genres; /*!< TODO: describe */
|
||||
|
||||
+6
-3
@@ -44,7 +44,8 @@ SOURCES += main.cpp\
|
||||
cmoviediscover.cpp \
|
||||
qxtspanslider.cpp \
|
||||
ccheckboxitemdelegate.cpp \
|
||||
cmoviedetails.cpp
|
||||
cmoviedetails.cpp \
|
||||
cseriedetails.cpp
|
||||
|
||||
HEADERS += cmainwindow.h \
|
||||
cserie.h \
|
||||
@@ -78,7 +79,8 @@ HEADERS += cmainwindow.h \
|
||||
qxtspanslider.h \
|
||||
qxtspanslider_p.h \
|
||||
ccheckboxitemdelegate.h \
|
||||
cmoviedetails.h
|
||||
cmoviedetails.h \
|
||||
cseriedetails.h
|
||||
|
||||
FORMS += cmainwindow.ui \
|
||||
csearch.ui \
|
||||
@@ -92,7 +94,8 @@ FORMS += cmainwindow.ui \
|
||||
cexportdialog.ui \
|
||||
cdiscover.ui \
|
||||
cmoviediscover.ui \
|
||||
cmoviedetails.ui
|
||||
cmoviedetails.ui \
|
||||
cseriedetails.ui
|
||||
|
||||
DISTFILES += \
|
||||
qtMovies.ico \
|
||||
|
||||
Reference in New Issue
Block a user