Preferences Dialog
This commit is contained in:
+1
-1
@@ -89,7 +89,7 @@ void cDiscover::on_m_lpDiscover_clicked()
|
|||||||
setCursor(Qt::WaitCursor);
|
setCursor(Qt::WaitCursor);
|
||||||
|
|
||||||
cTheMovieDBV3 movieDB3;
|
cTheMovieDBV3 movieDB3;
|
||||||
QList<cSerie*> serieList = movieDB3.discoverSerie(szText, iYear, genres, voteMin, voteMax, "de-DE");
|
QList<cSerie*> serieList = movieDB3.discoverSerie(m_serieList, szText, iYear, genres, voteMin, voteMax, "de-DE");
|
||||||
|
|
||||||
m_lpSeriesModel->clear();
|
m_lpSeriesModel->clear();
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -2,11 +2,11 @@
|
|||||||
#define CDISCOVER_H
|
#define CDISCOVER_H
|
||||||
|
|
||||||
|
|
||||||
#include <cserie.h>
|
|
||||||
|
|
||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
|
#include "cserie.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class cDiscover;
|
class cDiscover;
|
||||||
|
|||||||
+2
-2
@@ -13,8 +13,8 @@ cExportDialog::cExportDialog(QWidget *parent) :
|
|||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
QString szExportSerie = settings.value("exportSeriePath", QDir::homePath()).toString();
|
QString szExportSerie = settings.value("exportSeriePath", QString("%1%2series.xml").arg(QDir::homePath()).arg(QDir::separator())).toString();
|
||||||
QString szExportMovie = settings.value("exportMoviePath", QDir::homePath()).toString();
|
QString szExportMovie = settings.value("exportMoviePath", QString("%1%2movies.xml").arg(QDir::homePath()).arg(QDir::separator())).toString();
|
||||||
bool bExportSerie = settings.value("exportSerie", QDir::homePath()).toBool();
|
bool bExportSerie = settings.value("exportSerie", QDir::homePath()).toBool();
|
||||||
bool bExportMovie = settings.value("exportMovie", QDir::homePath()).toBool();
|
bool bExportMovie = settings.value("exportMovie", QDir::homePath()).toBool();
|
||||||
|
|
||||||
|
|||||||
+82
-40
@@ -50,6 +50,8 @@
|
|||||||
|
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
|
#include <cpreferences.h>
|
||||||
|
|
||||||
|
|
||||||
static bool serieSort(cSerie* s1, cSerie* s2)
|
static bool serieSort(cSerie* s1, cSerie* s2)
|
||||||
{
|
{
|
||||||
@@ -92,28 +94,31 @@ cMainWindow::cMainWindow(QWidget *parent) :
|
|||||||
m_szFindMovie(""),
|
m_szFindMovie(""),
|
||||||
m_lpFileMenu(nullptr),
|
m_lpFileMenu(nullptr),
|
||||||
m_lpFileExportAction(nullptr),
|
m_lpFileExportAction(nullptr),
|
||||||
|
m_lpFilePreferencesAction(nullptr),
|
||||||
m_lpFileExitAction(nullptr)
|
m_lpFileExitAction(nullptr)
|
||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
|
|
||||||
m_lpFileMenu = menuBar()->addMenu(tr("&File"));
|
m_lpFileMenu = menuBar()->addMenu(tr("&File"));
|
||||||
|
|
||||||
m_lpFileExportAction = m_lpFileMenu->addAction(tr("&Export"), this, &cMainWindow::onActionExport);
|
m_lpFileExportAction = m_lpFileMenu->addAction(tr("&Export"), this, &cMainWindow::onActionExport);
|
||||||
m_lpFileExportAction->setShortcut(Qt::CTRL + Qt::Key_E);
|
m_lpFileExportAction->setShortcut(Qt::CTRL + Qt::Key_E);
|
||||||
|
|
||||||
m_lpFileExportAction = m_lpFileMenu->addAction(tr("E&xit"), this, &cMainWindow::onActionExit);
|
m_lpFilePreferencesAction = m_lpFileMenu->addAction(tr("&Preferences"), this, &cMainWindow::onActionPreferences);
|
||||||
|
|
||||||
|
m_lpFileExportAction = m_lpFileMenu->addAction(tr("E&xit"), this, &cMainWindow::onActionExit);
|
||||||
m_lpFileExportAction->setShortcut(Qt::CTRL + Qt::Key_X);
|
m_lpFileExportAction->setShortcut(Qt::CTRL + Qt::Key_X);
|
||||||
|
|
||||||
ui->m_lpMainTab->setCurrentIndex(0);
|
ui->m_lpMainTab->setCurrentIndex(0);
|
||||||
ui->m_lpSeriesFilter->setChecked(settings.value("seriesFilter/enabled", QVariant::fromValue(false)).toBool());
|
ui->m_lpSeriesFilter->setChecked(settings.value("serieFilter/enabled", QVariant::fromValue(false)).toBool());
|
||||||
ui->m_lpSeriesFilterInitialized->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasInit", Qt::PartiallyChecked).toUInt()));
|
ui->m_lpSeriesFilterInitialized->setCheckState(static_cast<Qt::CheckState>(settings.value("serieFilter/hasInit", Qt::PartiallyChecked).toUInt()));
|
||||||
ui->m_lpSeriesFilterProgress->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasProgress", Qt::PartiallyChecked).toUInt()));
|
ui->m_lpSeriesFilterProgress->setCheckState(static_cast<Qt::CheckState>(settings.value("serieFilter/hasProgress", Qt::PartiallyChecked).toUInt()));
|
||||||
ui->m_lpSeriesFilterDone->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasDone", Qt::PartiallyChecked).toUInt()));
|
ui->m_lpSeriesFilterDone->setCheckState(static_cast<Qt::CheckState>(settings.value("serieFilter/hasDone", Qt::PartiallyChecked).toUInt()));
|
||||||
ui->m_lpSeriesFilterWithLink->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasLink", Qt::PartiallyChecked).toUInt()));
|
ui->m_lpSeriesFilterWithLink->setCheckState(static_cast<Qt::CheckState>(settings.value("serieFilter/hasLink", Qt::PartiallyChecked).toUInt()));
|
||||||
ui->m_lpSeriesFilterNotFinished->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasNotFinished", Qt::PartiallyChecked).toUInt()));
|
ui->m_lpSeriesFilterNotFinished->setCheckState(static_cast<Qt::CheckState>(settings.value("serieFilter/hasNotFinished", Qt::PartiallyChecked).toUInt()));
|
||||||
ui->m_lpSeriesFilterCliffhanger->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/isCliffhanger", Qt::PartiallyChecked).toUInt()));
|
ui->m_lpSeriesFilterCliffhanger->setCheckState(static_cast<Qt::CheckState>(settings.value("serieFilter/isCliffhanger", Qt::PartiallyChecked).toUInt()));
|
||||||
|
|
||||||
ui->m_lpMoviesFilter->setChecked(settings.value("movieFilter/enabled", QVariant::fromValue(false)).toBool());
|
ui->m_lpMoviesFilter->setChecked(settings.value("movieFilter/enabled", QVariant::fromValue(false)).toBool());
|
||||||
ui->m_lpMoviesFilterInitialized->setCheckState(static_cast<Qt::CheckState>(settings.value("movieFilter/hasInit", Qt::PartiallyChecked).toUInt()));
|
ui->m_lpMoviesFilterInitialized->setCheckState(static_cast<Qt::CheckState>(settings.value("movieFilter/hasInit", Qt::PartiallyChecked).toUInt()));
|
||||||
@@ -696,10 +701,13 @@ void cMainWindow::loadMoviesDB()
|
|||||||
|
|
||||||
void cMainWindow::setSeriesStyle(QList<QStandardItem*>lpItems)
|
void cMainWindow::setSeriesStyle(QList<QStandardItem*>lpItems)
|
||||||
{
|
{
|
||||||
cSerie* lpSerie = lpItems.at(0)->data(Qt::UserRole).value<cSerie*>();
|
cSerie* lpSerie = lpItems.at(0)->data(Qt::UserRole).value<cSerie*>();
|
||||||
if(!lpSerie)
|
if(!lpSerie)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
bool bDisplaySeason0 = settings.value("displaySeason0", true).toBool();
|
||||||
|
|
||||||
qint32 iMin = m_serieList.minSeason();
|
qint32 iMin = m_serieList.minSeason();
|
||||||
qint32 iEpisodes = 0;
|
qint32 iEpisodes = 0;
|
||||||
bool bHasInit = false;
|
bool bHasInit = false;
|
||||||
@@ -711,6 +719,9 @@ void cMainWindow::setSeriesStyle(QList<QStandardItem*>lpItems)
|
|||||||
QFont font = ui->m_lpSeriesList1->font();
|
QFont font = ui->m_lpSeriesList1->font();
|
||||||
QFont fontI = ui->m_lpSeriesList1->font();
|
QFont fontI = ui->m_lpSeriesList1->font();
|
||||||
|
|
||||||
|
if(!iMin && !bDisplaySeason0)
|
||||||
|
iMin = 1;
|
||||||
|
|
||||||
font.setBold(true);
|
font.setBold(true);
|
||||||
fontI.setItalic(true);
|
fontI.setItalic(true);
|
||||||
|
|
||||||
@@ -726,6 +737,10 @@ void cMainWindow::setSeriesStyle(QList<QStandardItem*>lpItems)
|
|||||||
QString szDone = "";
|
QString szDone = "";
|
||||||
|
|
||||||
cSeason* lpSeason = seasonList.at(season);
|
cSeason* lpSeason = seasonList.at(season);
|
||||||
|
|
||||||
|
if(!lpSeason->seasonNumber() && !bDisplaySeason0)
|
||||||
|
continue;
|
||||||
|
|
||||||
lpItems.at(lpSeason->seasonNumber()+3-iMin)->setData(QVariant::fromValue(lpSeason), Qt::UserRole);
|
lpItems.at(lpSeason->seasonNumber()+3-iMin)->setData(QVariant::fromValue(lpSeason), Qt::UserRole);
|
||||||
|
|
||||||
for(int y = 0;y < lpSeason->episodeList().count();y++)
|
for(int y = 0;y < lpSeason->episodeList().count();y++)
|
||||||
@@ -850,11 +865,17 @@ void cMainWindow::setMovieStyle(QStandardItem* /*lpItem*/)
|
|||||||
|
|
||||||
void cMainWindow::displaySeries()
|
void cMainWindow::displaySeries()
|
||||||
{
|
{
|
||||||
|
QSettings settings;
|
||||||
|
bool bDisplaySeason0 = settings.value("displaySeason0", true).toBool();
|
||||||
|
|
||||||
m_lpSeriesListModel->clear();
|
m_lpSeriesListModel->clear();
|
||||||
|
|
||||||
qint32 iMin = m_serieList.minSeason();
|
qint32 iMin = m_serieList.minSeason();
|
||||||
qint32 iMax = m_serieList.maxSeason();
|
qint32 iMax = m_serieList.maxSeason();
|
||||||
|
|
||||||
|
if(!iMin && !bDisplaySeason0)
|
||||||
|
iMin = 1;
|
||||||
|
|
||||||
qint32 iSeries = 0;
|
qint32 iSeries = 0;
|
||||||
qint32 iEpisodes = 0;
|
qint32 iEpisodes = 0;
|
||||||
|
|
||||||
@@ -863,7 +884,7 @@ void cMainWindow::displaySeries()
|
|||||||
QStringList header;
|
QStringList header;
|
||||||
header << "Nr" << "Serie" << "Year";
|
header << "Nr" << "Serie" << "Year";
|
||||||
|
|
||||||
for(int z = 0;z <= iMax;z++)
|
for(int z = iMin;z <= iMax;z++)
|
||||||
header.append(QString("Season %1").arg(z));
|
header.append(QString("Season %1").arg(z));
|
||||||
|
|
||||||
m_lpSeriesListModel->setHorizontalHeaderLabels(header);
|
m_lpSeriesListModel->setHorizontalHeaderLabels(header);
|
||||||
@@ -896,7 +917,8 @@ void cMainWindow::displaySeries()
|
|||||||
for(int season = 0;season < seasonList.count();season++)
|
for(int season = 0;season < seasonList.count();season++)
|
||||||
{
|
{
|
||||||
cSeason* lpSeason = seasonList.at(season);
|
cSeason* lpSeason = seasonList.at(season);
|
||||||
lpItems.at(lpSeason->seasonNumber()+3-iMin)->setData(QVariant::fromValue(lpSeason), Qt::UserRole);
|
if(lpSeason->seasonNumber() || bDisplaySeason0)
|
||||||
|
lpItems.at(lpSeason->seasonNumber()+3-iMin)->setData(QVariant::fromValue(lpSeason), Qt::UserRole);
|
||||||
}
|
}
|
||||||
|
|
||||||
m_lpSeriesListModel->appendRow(lpItems);
|
m_lpSeriesListModel->appendRow(lpItems);
|
||||||
@@ -1111,10 +1133,10 @@ bool cMainWindow::runEdit(cSerie* lpSerie, QString& szDownload)
|
|||||||
lpEdit->setSerie(lpSerie);
|
lpEdit->setSerie(lpSerie);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
qint32 iX = settings.value("edit/x", QVariant::fromValue(-1)).toInt();
|
qint32 iX = settings.value("serieEdit/x", QVariant::fromValue(-1)).toInt();
|
||||||
qint32 iY = settings.value("edit/y", QVariant::fromValue(-1)).toInt();
|
qint32 iY = settings.value("serieEdit/y", QVariant::fromValue(-1)).toInt();
|
||||||
qint32 iWidth = settings.value("edit/width", QVariant::fromValue(-1)).toInt();
|
qint32 iWidth = settings.value("serieEdit/width", QVariant::fromValue(-1)).toInt();
|
||||||
qint32 iHeight = settings.value("edit/height", QVariant::fromValue(-1)).toInt();
|
qint32 iHeight = settings.value("serieEdit/height", QVariant::fromValue(-1)).toInt();
|
||||||
|
|
||||||
if(iX != -1 && iY != -1)
|
if(iX != -1 && iY != -1)
|
||||||
lpEdit->move(iX, iY);
|
lpEdit->move(iX, iY);
|
||||||
@@ -1125,14 +1147,14 @@ bool cMainWindow::runEdit(cSerie* lpSerie, QString& szDownload)
|
|||||||
|
|
||||||
qint32 ret = lpEdit->exec();
|
qint32 ret = lpEdit->exec();
|
||||||
|
|
||||||
settings.setValue("edit/width", QVariant::fromValue(lpEdit->size().width()));
|
settings.setValue("serieEdit/width", QVariant::fromValue(lpEdit->size().width()));
|
||||||
settings.setValue("edit/height", QVariant::fromValue(lpEdit->size().height()));
|
settings.setValue("serieEdit/height", QVariant::fromValue(lpEdit->size().height()));
|
||||||
settings.setValue("edit/x", QVariant::fromValue(lpEdit->x()));
|
settings.setValue("serieEdit/x", QVariant::fromValue(lpEdit->x()));
|
||||||
settings.setValue("edit/y", QVariant::fromValue(lpEdit->y()));
|
settings.setValue("serieEdit/y", QVariant::fromValue(lpEdit->y()));
|
||||||
if(this->isMaximized())
|
if(this->isMaximized())
|
||||||
settings.setValue("edit/maximized", QVariant::fromValue(true));
|
settings.setValue("serieEdit/maximized", QVariant::fromValue(true));
|
||||||
else
|
else
|
||||||
settings.setValue("edit/maximized", QVariant::fromValue(false));
|
settings.setValue("serieEdit/maximized", QVariant::fromValue(false));
|
||||||
|
|
||||||
if(ret == QDialog::Rejected)
|
if(ret == QDialog::Rejected)
|
||||||
{
|
{
|
||||||
@@ -1226,13 +1248,13 @@ void cMainWindow::onActionAddGlobal()
|
|||||||
|
|
||||||
void cMainWindow::onActionAdd()
|
void cMainWindow::onActionAdd()
|
||||||
{
|
{
|
||||||
cSearch* lpSearch = new cSearch(this);
|
cSearch* lpSearch = new cSearch(m_serieList, this);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
qint32 iX = settings.value("search/x", QVariant::fromValue(-1)).toInt();
|
qint32 iX = settings.value("serieSearch/x", QVariant::fromValue(-1)).toInt();
|
||||||
qint32 iY = settings.value("search/y", QVariant::fromValue(-1)).toInt();
|
qint32 iY = settings.value("serieSearch/y", QVariant::fromValue(-1)).toInt();
|
||||||
qint32 iWidth = settings.value("search/width", QVariant::fromValue(-1)).toInt();
|
qint32 iWidth = settings.value("serieSearch/width", QVariant::fromValue(-1)).toInt();
|
||||||
qint32 iHeight = settings.value("search/height", QVariant::fromValue(-1)).toInt();
|
qint32 iHeight = settings.value("serieSearch/height", QVariant::fromValue(-1)).toInt();
|
||||||
|
|
||||||
if(iX != -1 && iY != -1)
|
if(iX != -1 && iY != -1)
|
||||||
lpSearch->move(iX, iY);
|
lpSearch->move(iX, iY);
|
||||||
@@ -1245,10 +1267,10 @@ void cMainWindow::onActionAdd()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
settings.setValue("search/width", QVariant::fromValue(lpSearch->size().width()));
|
settings.setValue("serieSearch/width", QVariant::fromValue(lpSearch->size().width()));
|
||||||
settings.setValue("search/height", QVariant::fromValue(lpSearch->size().height()));
|
settings.setValue("serieSearch/height", QVariant::fromValue(lpSearch->size().height()));
|
||||||
settings.setValue("search/x", QVariant::fromValue(lpSearch->x()));
|
settings.setValue("serieSearch/x", QVariant::fromValue(lpSearch->x()));
|
||||||
settings.setValue("search/y", QVariant::fromValue(lpSearch->y()));
|
settings.setValue("serieSearch/y", QVariant::fromValue(lpSearch->y()));
|
||||||
|
|
||||||
qint32 id = lpSearch->id();
|
qint32 id = lpSearch->id();
|
||||||
QString szPlaceholder = lpSearch->placeholderName();
|
QString szPlaceholder = lpSearch->placeholderName();
|
||||||
@@ -1322,7 +1344,7 @@ void cMainWindow::onActionAdd()
|
|||||||
|
|
||||||
void cMainWindow::onActionMovieAdd()
|
void cMainWindow::onActionMovieAdd()
|
||||||
{
|
{
|
||||||
cMovieSearch* lpSearch = new cMovieSearch(this);
|
cMovieSearch* lpSearch = new cMovieSearch(m_movieList, this);
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
qint32 iX = settings.value("movieSearch/x", QVariant::fromValue(-1)).toInt();
|
qint32 iX = settings.value("movieSearch/x", QVariant::fromValue(-1)).toInt();
|
||||||
@@ -1560,6 +1582,26 @@ void cMainWindow::onActionExport()
|
|||||||
QMessageBox::information(this, "Export", "export done");
|
QMessageBox::information(this, "Export", "export done");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void cMainWindow::onActionPreferences()
|
||||||
|
{
|
||||||
|
cPreferences* lpPreferencesDialog = new cPreferences(this);
|
||||||
|
|
||||||
|
if(lpPreferencesDialog->exec() == QDialog::Rejected)
|
||||||
|
{
|
||||||
|
delete lpPreferencesDialog;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(lpPreferencesDialog->displaySeason0Changed())
|
||||||
|
{
|
||||||
|
delete lpPreferencesDialog;
|
||||||
|
displaySeries();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
delete lpPreferencesDialog;
|
||||||
|
}
|
||||||
|
|
||||||
void cMainWindow::doUpdate(cSerieList& serieList)
|
void cMainWindow::doUpdate(cSerieList& serieList)
|
||||||
{
|
{
|
||||||
if(serieList.count())
|
if(serieList.count())
|
||||||
@@ -2149,13 +2191,13 @@ void cMainWindow::applySeriesFilter()
|
|||||||
{
|
{
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
settings.setValue("seriesFilter/enabled", QVariant::fromValue(ui->m_lpSeriesFilter->isChecked()));
|
settings.setValue("serieFilter/enabled", QVariant::fromValue(ui->m_lpSeriesFilter->isChecked()));
|
||||||
settings.setValue("seriesFilter/hasInit", ui->m_lpSeriesFilterInitialized->checkState());
|
settings.setValue("serieFilter/hasInit", ui->m_lpSeriesFilterInitialized->checkState());
|
||||||
settings.setValue("seriesFilter/hasProgress", ui->m_lpSeriesFilterProgress->checkState());
|
settings.setValue("serieFilter/hasProgress", ui->m_lpSeriesFilterProgress->checkState());
|
||||||
settings.setValue("seriesFilter/hasDone", ui->m_lpSeriesFilterDone->checkState());
|
settings.setValue("serieFilter/hasDone", ui->m_lpSeriesFilterDone->checkState());
|
||||||
settings.setValue("seriesFilter/hasLink", ui->m_lpSeriesFilterWithLink->checkState());
|
settings.setValue("serieFilter/hasLink", ui->m_lpSeriesFilterWithLink->checkState());
|
||||||
settings.setValue("seriesFilter/hasNotFinished", ui->m_lpSeriesFilterNotFinished->checkState());
|
settings.setValue("serieFilter/hasNotFinished", ui->m_lpSeriesFilterNotFinished->checkState());
|
||||||
settings.setValue("seriesFilter/isCliffhanger", ui->m_lpSeriesFilterCliffhanger->checkState());
|
settings.setValue("serieFilter/isCliffhanger", ui->m_lpSeriesFilterCliffhanger->checkState());
|
||||||
|
|
||||||
for(int x = 0;x < m_lpSeriesListModel->rowCount();x++)
|
for(int x = 0;x < m_lpSeriesListModel->rowCount();x++)
|
||||||
{
|
{
|
||||||
|
|||||||
+8
-1
@@ -44,7 +44,7 @@ public:
|
|||||||
\fn cMainWindow
|
\fn cMainWindow
|
||||||
\param parent
|
\param parent
|
||||||
*/
|
*/
|
||||||
explicit cMainWindow(QWidget *parent = 0);
|
explicit cMainWindow(QWidget *parent = nullptr);
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
@@ -276,6 +276,12 @@ private slots:
|
|||||||
\fn onActionExport
|
\fn onActionExport
|
||||||
*/
|
*/
|
||||||
void onActionExport();
|
void onActionExport();
|
||||||
|
/*!
|
||||||
|
\brief
|
||||||
|
|
||||||
|
\fn onActionPreferences
|
||||||
|
*/
|
||||||
|
void onActionPreferences();
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
@@ -472,6 +478,7 @@ private:
|
|||||||
|
|
||||||
QMenu* m_lpFileMenu; /*!< TODO: describe */
|
QMenu* m_lpFileMenu; /*!< TODO: describe */
|
||||||
QAction* m_lpFileExportAction; /*!< TODO: describe */
|
QAction* m_lpFileExportAction; /*!< TODO: describe */
|
||||||
|
QAction* m_lpFilePreferencesAction; /*!< TODO: describe */
|
||||||
QAction* m_lpFileExitAction; /*!< TODO: describe */
|
QAction* m_lpFileExitAction; /*!< TODO: describe */
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
+1
-3
@@ -90,7 +90,7 @@ void cMovieDiscover::on_m_lpDiscover_clicked()
|
|||||||
setCursor(Qt::WaitCursor);
|
setCursor(Qt::WaitCursor);
|
||||||
|
|
||||||
cTheMovieDBV3 movieDB3;
|
cTheMovieDBV3 movieDB3;
|
||||||
QList<cMovie*> movieList = movieDB3.discoverMovie(szText, bAdult, iYear, genres, voteMin, voteMax, "de-DE");
|
QList<cMovie*> movieList = movieDB3.discoverMovie(m_movieList, szText, bAdult, iYear, genres, voteMin, voteMax, "de-DE");
|
||||||
|
|
||||||
m_lpMoviesModel->clear();
|
m_lpMoviesModel->clear();
|
||||||
|
|
||||||
@@ -101,8 +101,6 @@ void cMovieDiscover::on_m_lpDiscover_clicked()
|
|||||||
{
|
{
|
||||||
cMovie* lpMovie = movieList[x];
|
cMovie* lpMovie = movieList[x];
|
||||||
|
|
||||||
if(m_movieList.find(lpMovie->movieID()))
|
|
||||||
continue;
|
|
||||||
QList<QStandardItem*> items;
|
QList<QStandardItem*> items;
|
||||||
|
|
||||||
items.append(new QStandardItem(lpMovie->movieTitle()));
|
items.append(new QStandardItem(lpMovie->movieTitle()));
|
||||||
|
|||||||
+2
-2
@@ -29,7 +29,7 @@ public:
|
|||||||
\param movieList
|
\param movieList
|
||||||
\param parent
|
\param parent
|
||||||
*/
|
*/
|
||||||
explicit cMovieDiscover(const cMovieList movieList, QWidget *parent = 0);
|
explicit cMovieDiscover(const cMovieList movieList, QWidget *parent = nullptr);
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ private slots:
|
|||||||
\fn on_m_lpMovies_clicked
|
\fn on_m_lpMovies_clicked
|
||||||
\param index
|
\param index
|
||||||
*/
|
*/
|
||||||
void on_m_lpMovies_clicked(const QModelIndex &index);
|
void on_m_lpMovies_clicked(const QModelIndex &index);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::cMovieDiscover* ui; /*!< TODO: describe */
|
Ui::cMovieDiscover* ui; /*!< TODO: describe */
|
||||||
|
|||||||
+4
-3
@@ -9,10 +9,11 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
|
|
||||||
cMovieSearch::cMovieSearch(QWidget *parent) :
|
cMovieSearch::cMovieSearch(const cMovieList& movieList, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::cMovieSearch),
|
ui(new Ui::cMovieSearch),
|
||||||
m_lpResultsModel(0)
|
m_lpResultsModel(nullptr),
|
||||||
|
m_movieList(movieList)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->m_lpSearchButton->setEnabled(false);
|
ui->m_lpSearchButton->setEnabled(false);
|
||||||
@@ -64,7 +65,7 @@ void cMovieSearch::on_m_lpSearchButton_clicked()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<cMovie*> movieList = theMovieDBV3.searchMovie(szSearchText, iYear, "de-DE");
|
QList<cMovie*> movieList = theMovieDBV3.searchMovie(m_movieList, szSearchText, iYear, "de-DE");
|
||||||
|
|
||||||
m_lpResultsModel->clear();
|
m_lpResultsModel->clear();
|
||||||
QStringList headerLabels = QStringList() << tr("Title") << tr("Year");
|
QStringList headerLabels = QStringList() << tr("Title") << tr("Year");
|
||||||
|
|||||||
+4
-2
@@ -5,6 +5,8 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
|
#include "cmovie.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class cMovieSearch;
|
class cMovieSearch;
|
||||||
@@ -26,7 +28,7 @@ public:
|
|||||||
\fn cMovieSearch
|
\fn cMovieSearch
|
||||||
\param parent
|
\param parent
|
||||||
*/
|
*/
|
||||||
explicit cMovieSearch(QWidget *parent = 0);
|
explicit cMovieSearch(const cMovieList& movieList, QWidget *parent = nullptr);
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
@@ -101,11 +103,11 @@ private slots:
|
|||||||
\param index
|
\param index
|
||||||
*/
|
*/
|
||||||
void on_m_lpResults_clicked(const QModelIndex &index);
|
void on_m_lpResults_clicked(const QModelIndex &index);
|
||||||
// void on_m_lpResults_doubleClicked(const QModelIndex &index);
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::cMovieSearch* ui; /*!< TODO: describe */
|
Ui::cMovieSearch* ui; /*!< TODO: describe */
|
||||||
QStandardItemModel* m_lpResultsModel;
|
QStandardItemModel* m_lpResultsModel;
|
||||||
|
cMovieList m_movieList; /*!< TODO: describe */
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|||||||
@@ -0,0 +1,74 @@
|
|||||||
|
#include "cpreferences.h"
|
||||||
|
#include "ui_cpreferences.h"
|
||||||
|
|
||||||
|
#include <QSettings>
|
||||||
|
#include <QDir>
|
||||||
|
#include <QFileDialog>
|
||||||
|
|
||||||
|
|
||||||
|
cPreferences::cPreferences(QWidget *parent) :
|
||||||
|
QDialog(parent),
|
||||||
|
ui(new Ui::cPreferences)
|
||||||
|
{
|
||||||
|
ui->setupUi(this);
|
||||||
|
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
ui->m_lpExportSeries->setChecked(settings.value("exportSerie", QDir::homePath()).toBool());
|
||||||
|
ui->m_lpExportMovies->setChecked(settings.value("exportMovie", QDir::homePath()).toBool());
|
||||||
|
ui->m_lpSeriesPath->setText(settings.value("exportSeriePath", QString("%1%2series.xml").arg(QDir::homePath()).arg(QDir::separator())).toString());
|
||||||
|
ui->m_lpMoviesPath->setText(settings.value("exportMoviePath", QString("%1%2movies.xml").arg(QDir::homePath()).arg(QDir::separator())).toString());
|
||||||
|
|
||||||
|
ui->m_lpDiscoverResultsSerie->setValue(settings.value("serieDiscover/results", 100).toInt());
|
||||||
|
ui->m_lpSearchResultsSerie->setValue(settings.value("serieSearch/results", 100).toInt());
|
||||||
|
ui->m_lpDiscoverResultsMovie->setValue(settings.value("movieDiscover/results", 100).toInt());
|
||||||
|
ui->m_lpSearchResultsMovie->setValue(settings.value("movieSearch/results", 100).toInt());
|
||||||
|
|
||||||
|
ui->m_lpDisplaySeason0->setChecked(settings.value("displaySeason0", true).toBool());
|
||||||
|
|
||||||
|
m_bDisplaySeason0 = settings.value("displaySeason0", true).toBool();
|
||||||
|
}
|
||||||
|
|
||||||
|
cPreferences::~cPreferences()
|
||||||
|
{
|
||||||
|
QSettings settings;
|
||||||
|
|
||||||
|
settings.setValue("exportSeriePath", ui->m_lpSeriesPath->text());
|
||||||
|
settings.setValue("exportMoviePath", ui->m_lpMoviesPath->text());
|
||||||
|
settings.setValue("exportSerie", ui->m_lpExportSeries->isChecked());
|
||||||
|
settings.setValue("exportMovie", ui->m_lpExportMovies->isChecked());
|
||||||
|
|
||||||
|
settings.setValue("serieDiscover/results", ui->m_lpDiscoverResultsSerie->value());
|
||||||
|
settings.setValue("serieSearch/results", ui->m_lpSearchResultsSerie->value());
|
||||||
|
settings.setValue("movieDiscover/results", ui->m_lpDiscoverResultsMovie->value());
|
||||||
|
settings.setValue("movieSearch/results", ui->m_lpSearchResultsMovie->value());
|
||||||
|
|
||||||
|
settings.setValue("displaySeason0", ui->m_lpDisplaySeason0->isChecked());
|
||||||
|
|
||||||
|
delete ui;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool cPreferences::displaySeason0Changed()
|
||||||
|
{
|
||||||
|
return(m_bDisplaySeason0 != ui->m_lpDisplaySeason0->isChecked());
|
||||||
|
}
|
||||||
|
|
||||||
|
void cPreferences::on_m_lpSeriesPathSelect_clicked()
|
||||||
|
{
|
||||||
|
QString szFile = QFileDialog::getSaveFileName(this, tr("export Serie"), ui->m_lpSeriesPath->text(), tr("XML Files (*.xml)"));
|
||||||
|
|
||||||
|
if(szFile.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
ui->m_lpSeriesPath->setText(szFile);
|
||||||
|
}
|
||||||
|
|
||||||
|
void cPreferences::on_m_lpMoviesPathSelect_clicked()
|
||||||
|
{
|
||||||
|
QString szFile = QFileDialog::getSaveFileName(this, tr("export Serie"), ui->m_lpMoviesPath->text(), tr("XML Files (*.xml)"));
|
||||||
|
|
||||||
|
if(szFile.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
|
ui->m_lpMoviesPath->setText(szFile);
|
||||||
|
}
|
||||||
@@ -0,0 +1,29 @@
|
|||||||
|
#ifndef CPREFERENCES_H
|
||||||
|
#define CPREFERENCES_H
|
||||||
|
|
||||||
|
#include <QDialog>
|
||||||
|
|
||||||
|
namespace Ui {
|
||||||
|
class cPreferences;
|
||||||
|
}
|
||||||
|
|
||||||
|
class cPreferences : public QDialog
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
explicit cPreferences(QWidget *parent = nullptr);
|
||||||
|
~cPreferences();
|
||||||
|
|
||||||
|
bool displaySeason0Changed();
|
||||||
|
private slots:
|
||||||
|
void on_m_lpSeriesPathSelect_clicked();
|
||||||
|
|
||||||
|
void on_m_lpMoviesPathSelect_clicked();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::cPreferences* ui;
|
||||||
|
bool m_bDisplaySeason0;
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // CPREFERENCES_H
|
||||||
+207
@@ -0,0 +1,207 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>cPreferences</class>
|
||||||
|
<widget class="QDialog" name="cPreferences">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>494</width>
|
||||||
|
<height>317</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>Preferences</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>General</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Series</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="m_lpSeriesPath"/>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="m_lpSeriesPathSelect">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label">
|
||||||
|
<property name="text">
|
||||||
|
<string>number of discover results</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="m_lpExportSeries">
|
||||||
|
<property name="text">
|
||||||
|
<string>enable export</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QSpinBox" name="m_lpDiscoverResultsSerie">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QCheckBox" name="m_lpDisplaySeason0">
|
||||||
|
<property name="text">
|
||||||
|
<string>display season "0"</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="label_3">
|
||||||
|
<property name="text">
|
||||||
|
<string>number of search results</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QSpinBox" name="m_lpSearchResultsMovie">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QGroupBox" name="groupBox_3">
|
||||||
|
<property name="title">
|
||||||
|
<string>Movies</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_5">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<layout class="QGridLayout" name="gridLayout_4">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QCheckBox" name="m_lpExportMovies">
|
||||||
|
<property name="text">
|
||||||
|
<string>enable export</string>
|
||||||
|
</property>
|
||||||
|
<property name="checked">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="label_2">
|
||||||
|
<property name="text">
|
||||||
|
<string>number of discover results</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QSpinBox" name="m_lpDiscoverResultsMovie">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="2">
|
||||||
|
<widget class="QPushButton" name="m_lpMoviesPathSelect">
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="m_lpMoviesPath"/>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="label_4">
|
||||||
|
<property name="text">
|
||||||
|
<string>number of search results</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QSpinBox" name="m_lpSearchResultsSerie">
|
||||||
|
<property name="maximum">
|
||||||
|
<number>9999</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="QDialogButtonBox" name="buttonBox">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<property name="standardButtons">
|
||||||
|
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<resources/>
|
||||||
|
<connections>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>accepted()</signal>
|
||||||
|
<receiver>cPreferences</receiver>
|
||||||
|
<slot>accept()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>248</x>
|
||||||
|
<y>254</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>157</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
<connection>
|
||||||
|
<sender>buttonBox</sender>
|
||||||
|
<signal>rejected()</signal>
|
||||||
|
<receiver>cPreferences</receiver>
|
||||||
|
<slot>reject()</slot>
|
||||||
|
<hints>
|
||||||
|
<hint type="sourcelabel">
|
||||||
|
<x>316</x>
|
||||||
|
<y>260</y>
|
||||||
|
</hint>
|
||||||
|
<hint type="destinationlabel">
|
||||||
|
<x>286</x>
|
||||||
|
<y>274</y>
|
||||||
|
</hint>
|
||||||
|
</hints>
|
||||||
|
</connection>
|
||||||
|
</connections>
|
||||||
|
</ui>
|
||||||
+4
-3
@@ -9,10 +9,11 @@
|
|||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
|
|
||||||
cSearch::cSearch(QWidget *parent) :
|
cSearch::cSearch(const cSerieList& serieList, QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::cSearch),
|
ui(new Ui::cSearch),
|
||||||
m_lpResultsModel(0)
|
m_lpResultsModel(nullptr),
|
||||||
|
m_serieList(serieList)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->m_lpSearchButton->setEnabled(false);
|
ui->m_lpSearchButton->setEnabled(false);
|
||||||
@@ -51,7 +52,7 @@ void cSearch::on_m_lpSearchButton_clicked()
|
|||||||
|
|
||||||
cTheMovieDBV3 theMovieDBV3;
|
cTheMovieDBV3 theMovieDBV3;
|
||||||
|
|
||||||
QList<cSerie*> serieList3 = theMovieDBV3.searchSerie(ui->m_lpSearch->text(), -1, "de-DE");
|
QList<cSerie*> serieList3 = theMovieDBV3.searchSerie(m_serieList, ui->m_lpSearch->text(), -1, "de-DE");
|
||||||
|
|
||||||
m_lpResultsModel->clear();
|
m_lpResultsModel->clear();
|
||||||
|
|
||||||
|
|||||||
@@ -5,6 +5,8 @@
|
|||||||
#include <QDialog>
|
#include <QDialog>
|
||||||
#include <QStandardItemModel>
|
#include <QStandardItemModel>
|
||||||
|
|
||||||
|
#include "cserie.h"
|
||||||
|
|
||||||
|
|
||||||
namespace Ui {
|
namespace Ui {
|
||||||
class cSearch;
|
class cSearch;
|
||||||
@@ -26,7 +28,7 @@ public:
|
|||||||
\fn cSearch
|
\fn cSearch
|
||||||
\param parent
|
\param parent
|
||||||
*/
|
*/
|
||||||
explicit cSearch(QWidget *parent = 0);
|
explicit cSearch(const cSerieList& serieList, QWidget *parent = 0);
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
@@ -112,6 +114,7 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
Ui::cSearch* ui; /*!< TODO: describe */
|
Ui::cSearch* ui; /*!< TODO: describe */
|
||||||
QStandardItemModel* m_lpResultsModel;
|
QStandardItemModel* m_lpResultsModel;
|
||||||
|
cSerieList m_serieList; /*!< TODO: describe */
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|||||||
+1
-4
@@ -27,7 +27,7 @@ void cSeasonDelegate::paint(QPainter *painter, const QStyleOptionViewItem &optio
|
|||||||
{
|
{
|
||||||
if(index.column() > 2)
|
if(index.column() > 2)
|
||||||
{
|
{
|
||||||
cSeason* lpSeason = 0;
|
cSeason* lpSeason = nullptr;
|
||||||
|
|
||||||
if(index.data(Qt::UserRole).canConvert<cSeason*>())
|
if(index.data(Qt::UserRole).canConvert<cSeason*>())
|
||||||
lpSeason = qvariant_cast<cSeason*>(index.data(Qt::UserRole));
|
lpSeason = qvariant_cast<cSeason*>(index.data(Qt::UserRole));
|
||||||
@@ -107,13 +107,10 @@ QSize cSeasonDelegate::sizeHint(const QStyleOptionViewItem &option, const QModel
|
|||||||
}
|
}
|
||||||
if(iTotal > 0 && lpSeason->seasonNumber() != 0)
|
if(iTotal > 0 && lpSeason->seasonNumber() != 0)
|
||||||
return(QSize((iTotal+1)*FIELD_STEP, HEIGHT));
|
return(QSize((iTotal+1)*FIELD_STEP, HEIGHT));
|
||||||
//return(QSize((iTotal+1)*FIELD_STEP, FIELD_HEIGHT));
|
|
||||||
else
|
else
|
||||||
return(QSize(FIELD_STEP*40, HEIGHT));
|
return(QSize(FIELD_STEP*40, HEIGHT));
|
||||||
//return(QSize(FIELD_STEP*40, FIELD_HEIGHT));
|
|
||||||
}
|
}
|
||||||
return(QSize(FIELD_STEP, HEIGHT));
|
return(QSize(FIELD_STEP, HEIGHT));
|
||||||
//return(QSize(FIELD_STEP, FIELD_HEIGHT));
|
|
||||||
}
|
}
|
||||||
return QSize(QStyledItemDelegate::sizeHint(option, index).width(), HEIGHT);
|
return QSize(QStyledItemDelegate::sizeHint(option, index).width(), HEIGHT);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-4
@@ -15,7 +15,7 @@ class cSeasonDelegate : public QStyledItemDelegate
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
cSeasonDelegate(QWidget *parent = 0) : QStyledItemDelegate(parent) {}
|
cSeasonDelegate(QWidget *parent = nullptr) : QStyledItemDelegate(parent) {}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
@@ -35,9 +35,6 @@ public:
|
|||||||
\return QSize
|
\return QSize
|
||||||
*/
|
*/
|
||||||
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
||||||
//QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
||||||
//void setEditorData(QWidget *editor, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
||||||
//void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const Q_DECL_OVERRIDE;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // CSEASONDELEGATE_H
|
#endif // CSEASONDELEGATE_H
|
||||||
|
|||||||
+50
-8
@@ -12,6 +12,8 @@
|
|||||||
|
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
|
#include <QSettings>
|
||||||
|
|
||||||
|
|
||||||
cTheMovieDBV3::cTheMovieDBV3()
|
cTheMovieDBV3::cTheMovieDBV3()
|
||||||
{
|
{
|
||||||
@@ -22,7 +24,7 @@ cTheMovieDBV3::~cTheMovieDBV3()
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<cMovie*> cTheMovieDBV3::searchMovie(const QString& szMovie, const qint32& year, const QString& szLanguage)
|
QList<cMovie*> cTheMovieDBV3::searchMovie(cMovieList& movieListOri, const QString& szMovie, const qint32& year, const QString& szLanguage)
|
||||||
{
|
{
|
||||||
if(m_genres.isEmpty())
|
if(m_genres.isEmpty())
|
||||||
m_genres = genresMovie("de-DE");
|
m_genres = genresMovie("de-DE");
|
||||||
@@ -31,6 +33,8 @@ QList<cMovie*> cTheMovieDBV3::searchMovie(const QString& szMovie, const qint32&
|
|||||||
QNetworkAccessManager networkManager;
|
QNetworkAccessManager networkManager;
|
||||||
QString szRequest = QString("https://api.themoviedb.org/3/search/movie?api_key=%1").arg(m_szToken);
|
QString szRequest = QString("https://api.themoviedb.org/3/search/movie?api_key=%1").arg(m_szToken);
|
||||||
qint32 page = 1;
|
qint32 page = 1;
|
||||||
|
QSettings settings;
|
||||||
|
qint32 iResults = settings.value("movieSearch/results", 100).toInt();
|
||||||
|
|
||||||
if(!szLanguage.contains("all"))
|
if(!szLanguage.contains("all"))
|
||||||
szRequest.append(QString("&language=%1").arg(szLanguage));
|
szRequest.append(QString("&language=%1").arg(szLanguage));
|
||||||
@@ -62,6 +66,10 @@ QList<cMovie*> cTheMovieDBV3::searchMovie(const QString& szMovie, const qint32&
|
|||||||
for(int z = 0;z < jsonArray.count();z++)
|
for(int z = 0;z < jsonArray.count();z++)
|
||||||
{
|
{
|
||||||
QJsonObject movie = jsonArray[z].toObject();
|
QJsonObject movie = jsonArray[z].toObject();
|
||||||
|
|
||||||
|
if(movieListOri.find(movie["id"].toInt()))
|
||||||
|
continue;
|
||||||
|
|
||||||
cMovie* lpMovie = new cMovie;
|
cMovie* lpMovie = new cMovie;
|
||||||
lpMovie->setMovieTitle(movie["title"].toString());
|
lpMovie->setMovieTitle(movie["title"].toString());
|
||||||
lpMovie->setMovieID(movie["id"].toInt());
|
lpMovie->setMovieID(movie["id"].toInt());
|
||||||
@@ -86,12 +94,16 @@ QList<cMovie*> cTheMovieDBV3::searchMovie(const QString& szMovie, const qint32&
|
|||||||
lpMovie->setReleaseDate(movie["release_date"].toString());
|
lpMovie->setReleaseDate(movie["release_date"].toString());
|
||||||
|
|
||||||
movieList.append(lpMovie);
|
movieList.append(lpMovie);
|
||||||
|
|
||||||
|
if(movieList.count() >= iResults)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(jsonObj["total_pages"].toInt() == page)
|
if(jsonObj["total_pages"].toInt() == page)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
page++;
|
page++;
|
||||||
if(page > 20)
|
|
||||||
|
if(movieList.count() >= iResults)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
delete reply;
|
delete reply;
|
||||||
@@ -105,12 +117,14 @@ QList<cMovie*> cTheMovieDBV3::searchMovie(const QString& szMovie, const qint32&
|
|||||||
return(movieList);
|
return(movieList);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<cSerie*> cTheMovieDBV3::searchSerie(const QString& szSerie, const qint32& year, const QString& szLanguage)
|
QList<cSerie*> cTheMovieDBV3::searchSerie(cSerieList& serieListOri, const QString& szSerie, const qint32& year, const QString& szLanguage)
|
||||||
{
|
{
|
||||||
QList<cSerie*> serieList;
|
QList<cSerie*> serieList;
|
||||||
QNetworkAccessManager networkManager;
|
QNetworkAccessManager networkManager;
|
||||||
QString szRequest = QString("https://api.themoviedb.org/3/search/tv?api_key=%1").arg(m_szToken);
|
QString szRequest = QString("https://api.themoviedb.org/3/search/tv?api_key=%1").arg(m_szToken);
|
||||||
qint32 page = 1;
|
qint32 page = 1;
|
||||||
|
QSettings settings;
|
||||||
|
qint32 iResults = settings.value("serieSearch/results", 100).toInt();
|
||||||
|
|
||||||
if(!szLanguage.contains("all"))
|
if(!szLanguage.contains("all"))
|
||||||
szRequest.append(QString("&language=%1").arg(szLanguage));
|
szRequest.append(QString("&language=%1").arg(szLanguage));
|
||||||
@@ -144,6 +158,10 @@ QList<cSerie*> cTheMovieDBV3::searchSerie(const QString& szSerie, const qint32&
|
|||||||
for(int z = 0;z < jsonArray.count();z++)
|
for(int z = 0;z < jsonArray.count();z++)
|
||||||
{
|
{
|
||||||
QJsonObject serie = jsonArray[z].toObject();
|
QJsonObject serie = jsonArray[z].toObject();
|
||||||
|
|
||||||
|
if(serieListOri.find(serie["id"].toInt()))
|
||||||
|
continue;
|
||||||
|
|
||||||
cSerie* lpSerie = new cSerie;
|
cSerie* lpSerie = new cSerie;
|
||||||
|
|
||||||
lpSerie->setSeriesID(serie["id"].toInt());
|
lpSerie->setSeriesID(serie["id"].toInt());
|
||||||
@@ -195,12 +213,16 @@ QList<cSerie*> cTheMovieDBV3::searchSerie(const QString& szSerie, const qint32&
|
|||||||
lpSerie->setVoteCount(serie["vote_count"].toInt());
|
lpSerie->setVoteCount(serie["vote_count"].toInt());
|
||||||
|
|
||||||
serieList.append(lpSerie);
|
serieList.append(lpSerie);
|
||||||
|
|
||||||
|
if(serieList.count() >= iResults)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(jsonObj["total_pages"].toInt() == page)
|
if(jsonObj["total_pages"].toInt() == page)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
page++;
|
page++;
|
||||||
if(page > 20)
|
|
||||||
|
if(serieList.count() >= iResults)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
delete reply;
|
delete reply;
|
||||||
@@ -637,7 +659,7 @@ QMap<qint32, QString> cTheMovieDBV3::genresMovie(const QString& szLanguage)
|
|||||||
return(genres);
|
return(genres);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<cMovie*> cTheMovieDBV3::discoverMovie(const QString& szText, const bool& bAdult, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage)
|
QList<cMovie*> cTheMovieDBV3::discoverMovie(cMovieList& movieListOri, const QString& szText, const bool& bAdult, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage)
|
||||||
{
|
{
|
||||||
if(m_genres.isEmpty())
|
if(m_genres.isEmpty())
|
||||||
m_genres = genresMovie("de-DE");
|
m_genres = genresMovie("de-DE");
|
||||||
@@ -646,6 +668,8 @@ QList<cMovie*> cTheMovieDBV3::discoverMovie(const QString& szText, const bool& b
|
|||||||
QNetworkAccessManager networkManager;
|
QNetworkAccessManager networkManager;
|
||||||
QString szRequest = QString("https://api.themoviedb.org/3/discover/movie?api_key=%1").arg(m_szToken);
|
QString szRequest = QString("https://api.themoviedb.org/3/discover/movie?api_key=%1").arg(m_szToken);
|
||||||
qint32 page = 1;
|
qint32 page = 1;
|
||||||
|
QSettings settings;
|
||||||
|
qint32 iResults = settings.value("movieDiscover/results", 100).toInt();
|
||||||
|
|
||||||
if(!szLanguage.contains("all"))
|
if(!szLanguage.contains("all"))
|
||||||
szRequest.append(QString("&language=%1").arg(szLanguage));
|
szRequest.append(QString("&language=%1").arg(szLanguage));
|
||||||
@@ -687,6 +711,10 @@ QList<cMovie*> cTheMovieDBV3::discoverMovie(const QString& szText, const bool& b
|
|||||||
for(int z = 0;z < jsonArray.count();z++)
|
for(int z = 0;z < jsonArray.count();z++)
|
||||||
{
|
{
|
||||||
QJsonObject movie = jsonArray[z].toObject();
|
QJsonObject movie = jsonArray[z].toObject();
|
||||||
|
|
||||||
|
if(movieListOri.find(movie["id"].toInt()))
|
||||||
|
continue;
|
||||||
|
|
||||||
cMovie* lpMovie = new cMovie;
|
cMovie* lpMovie = new cMovie;
|
||||||
lpMovie->setMovieTitle(movie["title"].toString());
|
lpMovie->setMovieTitle(movie["title"].toString());
|
||||||
lpMovie->setMovieID(movie["id"].toInt());
|
lpMovie->setMovieID(movie["id"].toInt());
|
||||||
@@ -711,12 +739,16 @@ QList<cMovie*> cTheMovieDBV3::discoverMovie(const QString& szText, const bool& b
|
|||||||
lpMovie->setReleaseDate(movie["release_date"].toString());
|
lpMovie->setReleaseDate(movie["release_date"].toString());
|
||||||
|
|
||||||
movieList.append(lpMovie);
|
movieList.append(lpMovie);
|
||||||
|
|
||||||
|
if(movieList.count() >= iResults)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(jsonObj["total_pages"].toInt() == page)
|
if(jsonObj["total_pages"].toInt() == page)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
page++;
|
page++;
|
||||||
if(page > 20)
|
|
||||||
|
if(movieList.count() >= iResults)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
delete reply;
|
delete reply;
|
||||||
@@ -845,7 +877,7 @@ void cTheMovieDBV3::loadCastMovie(cMovie* lpMovie)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<cSerie*> cTheMovieDBV3::discoverSerie(const QString& szText, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage)
|
QList<cSerie*> cTheMovieDBV3::discoverSerie(cSerieList& serieListOri, const QString& szText, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage)
|
||||||
{
|
{
|
||||||
if(m_genres.isEmpty())
|
if(m_genres.isEmpty())
|
||||||
m_genres = genresMovie("de-DE");
|
m_genres = genresMovie("de-DE");
|
||||||
@@ -854,6 +886,8 @@ QList<cSerie*> cTheMovieDBV3::discoverSerie(const QString& szText, const qint32&
|
|||||||
QNetworkAccessManager networkManager;
|
QNetworkAccessManager networkManager;
|
||||||
QString szRequest = QString("https://api.themoviedb.org/3/discover/tv?api_key=%1").arg(m_szToken);
|
QString szRequest = QString("https://api.themoviedb.org/3/discover/tv?api_key=%1").arg(m_szToken);
|
||||||
qint32 page = 1;
|
qint32 page = 1;
|
||||||
|
QSettings settings;
|
||||||
|
qint32 iResults = settings.value("serieDiscover/results", 100).toInt();
|
||||||
|
|
||||||
if(!szLanguage.contains("all"))
|
if(!szLanguage.contains("all"))
|
||||||
szRequest.append(QString("&language=%1").arg(szLanguage));
|
szRequest.append(QString("&language=%1").arg(szLanguage));
|
||||||
@@ -895,6 +929,10 @@ QList<cSerie*> cTheMovieDBV3::discoverSerie(const QString& szText, const qint32&
|
|||||||
for(int z = 0;z < jsonArray.count();z++)
|
for(int z = 0;z < jsonArray.count();z++)
|
||||||
{
|
{
|
||||||
QJsonObject serie = jsonArray[z].toObject();
|
QJsonObject serie = jsonArray[z].toObject();
|
||||||
|
|
||||||
|
if(serieListOri.find(serie["id"].toInt()))
|
||||||
|
continue;
|
||||||
|
|
||||||
cSerie* lpSerie = new cSerie;
|
cSerie* lpSerie = new cSerie;
|
||||||
|
|
||||||
lpSerie->setSeriesID(serie["id"].toInt());
|
lpSerie->setSeriesID(serie["id"].toInt());
|
||||||
@@ -946,12 +984,16 @@ QList<cSerie*> cTheMovieDBV3::discoverSerie(const QString& szText, const qint32&
|
|||||||
lpSerie->setVoteCount(serie["vote_count"].toInt());
|
lpSerie->setVoteCount(serie["vote_count"].toInt());
|
||||||
|
|
||||||
serieList.append(lpSerie);
|
serieList.append(lpSerie);
|
||||||
|
|
||||||
|
if(serieList.count() >= iResults)
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
if(jsonObj["total_pages"].toInt() == page)
|
if(jsonObj["total_pages"].toInt() == page)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
page++;
|
page++;
|
||||||
if(page > 20)
|
|
||||||
|
if(serieList.count() >= iResults)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
delete reply;
|
delete reply;
|
||||||
|
|||||||
+4
-4
@@ -36,7 +36,7 @@ public:
|
|||||||
\param szLanguage
|
\param szLanguage
|
||||||
\return QList<cMovie *>
|
\return QList<cMovie *>
|
||||||
*/
|
*/
|
||||||
QList<cMovie*> searchMovie(const QString& szMovie, const qint32& year = -1, const QString& szLanguage = "all");
|
QList<cMovie*> searchMovie(cMovieList& movieListOri, const QString& szMovie, const qint32& year = -1, const QString& szLanguage = "all");
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
@@ -67,7 +67,7 @@ public:
|
|||||||
\param szLanguage
|
\param szLanguage
|
||||||
\return QList<cMovie *>
|
\return QList<cMovie *>
|
||||||
*/
|
*/
|
||||||
QList<cMovie*> discoverMovie(const QString& szText, const bool& bAdult, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage = "all");
|
QList<cMovie*> discoverMovie(cMovieList& movieListOri, const QString& szText, const bool& bAdult, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage = "all");
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
@@ -85,7 +85,7 @@ public:
|
|||||||
\param szLanguage
|
\param szLanguage
|
||||||
\return QList<cSerie *>
|
\return QList<cSerie *>
|
||||||
*/
|
*/
|
||||||
QList<cSerie*> searchSerie(const QString& szSerie, const qint32& year = -1, const QString& szLanguage = "all");
|
QList<cSerie*> searchSerie(cSerieList& serieListOri, const QString& szSerie, const qint32& year = -1, const QString& szLanguage = "all");
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
@@ -123,7 +123,7 @@ public:
|
|||||||
\param szLanguage
|
\param szLanguage
|
||||||
\return QList<cSerie *>
|
\return QList<cSerie *>
|
||||||
*/
|
*/
|
||||||
QList<cSerie*> discoverSerie(const QString& szText, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage = "all");
|
QList<cSerie*> discoverSerie(cSerieList& serieListOri, const QString& szText, const qint32& iYear, const QList<qint32>& genres, const qreal& voteMin, const qreal& voteMax, const QString& szLanguage = "all");
|
||||||
/*!
|
/*!
|
||||||
\brief
|
\brief
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
QCoreApplication::setOrganizationName("WIN-DESIGN");
|
QCoreApplication::setOrganizationName("WIN-DESIGN");
|
||||||
QCoreApplication::setOrganizationDomain("windesign.at");
|
QCoreApplication::setOrganizationDomain("windesign.at");
|
||||||
QCoreApplication::setApplicationName("qtMovies");
|
QCoreApplication::setApplicationName("qtMultimediaDB");
|
||||||
|
|
||||||
QSettings settings;
|
QSettings settings;
|
||||||
|
|
||||||
|
|||||||
+6
-3
@@ -48,7 +48,8 @@ SOURCES += main.cpp\
|
|||||||
cseriedetails.cpp \
|
cseriedetails.cpp \
|
||||||
ctheaudiodbv1.cpp \
|
ctheaudiodbv1.cpp \
|
||||||
cartist.cpp \
|
cartist.cpp \
|
||||||
csplashscreen.cpp
|
csplashscreen.cpp \
|
||||||
|
cpreferences.cpp
|
||||||
|
|
||||||
HEADERS += cmainwindow.h \
|
HEADERS += cmainwindow.h \
|
||||||
cserie.h \
|
cserie.h \
|
||||||
@@ -86,7 +87,8 @@ HEADERS += cmainwindow.h \
|
|||||||
cseriedetails.h \
|
cseriedetails.h \
|
||||||
ctheaudiodbv1.h \
|
ctheaudiodbv1.h \
|
||||||
cartist.h \
|
cartist.h \
|
||||||
csplashscreen.h
|
csplashscreen.h \
|
||||||
|
cpreferences.h
|
||||||
|
|
||||||
FORMS += cmainwindow.ui \
|
FORMS += cmainwindow.ui \
|
||||||
csearch.ui \
|
csearch.ui \
|
||||||
@@ -101,7 +103,8 @@ FORMS += cmainwindow.ui \
|
|||||||
cdiscover.ui \
|
cdiscover.ui \
|
||||||
cmoviediscover.ui \
|
cmoviediscover.ui \
|
||||||
cmoviedetails.ui \
|
cmoviedetails.ui \
|
||||||
cseriedetails.ui
|
cseriedetails.ui \
|
||||||
|
cpreferences.ui
|
||||||
|
|
||||||
DISTFILES += \
|
DISTFILES += \
|
||||||
Doxyfile \
|
Doxyfile \
|
||||||
|
|||||||
Reference in New Issue
Block a user