added filter functionality, changed display procedure for movies
This commit is contained in:
+249
-4
@@ -80,13 +80,28 @@ cMainWindow::cMainWindow(QWidget *parent) :
|
||||
{
|
||||
m_timer.start();
|
||||
|
||||
QSettings settings;
|
||||
|
||||
cMessageAnimateDialog* lpDialog = new cMessageAnimateDialog(this);
|
||||
lpDialog->setTitle("Initializing");
|
||||
lpDialog->setMessage("Initializing");
|
||||
lpDialog->show();
|
||||
|
||||
ui->setupUi(this);
|
||||
|
||||
ui->m_lpMainTab->setCurrentIndex(0);
|
||||
ui->m_lpSeriesFilter->setChecked(settings.value("seriesFilter/enabled", QVariant::fromValue(false)).toBool());
|
||||
ui->m_lpSeriesFilterInitialized->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasInit", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
ui->m_lpSeriesFilterProgress->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasProgress", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
ui->m_lpSeriesFilterDone->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasDone", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
ui->m_lpSeriesFilterWithLink->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasLink", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
ui->m_lpSeriesFilterNotFinished->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/hasNotFinished", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
ui->m_lpSeriesFilterCliffhanger->setCheckState(static_cast<Qt::CheckState>(settings.value("seriesFilter/isCliffhanger", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
|
||||
ui->m_lpMoviesFilter->setChecked(settings.value("movieFilter/enabled", QVariant::fromValue(false)).toBool());
|
||||
ui->m_lpMoviesFilterInitialized->setCheckState(static_cast<Qt::CheckState>(settings.value("movieFilter/hasInit", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
ui->m_lpMoviesFilterProgress->setCheckState(static_cast<Qt::CheckState>(settings.value("movieFilter/hasProgress", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
ui->m_lpMoviesFilterDone->setCheckState(static_cast<Qt::CheckState>(settings.value("movieFilter/hasDone", (uint)Qt::PartiallyChecked).toUInt()));
|
||||
|
||||
m_lpSeriesListModel = new QStandardItemModel(0, 3);
|
||||
initDB();
|
||||
@@ -108,7 +123,6 @@ cMainWindow::cMainWindow(QWidget *parent) :
|
||||
displaySeries();
|
||||
displayMovies();
|
||||
|
||||
QSettings settings;
|
||||
qint16 iX = settings.value("main/x", QVariant::fromValue(-1)).toInt();
|
||||
qint16 iY = settings.value("main/y", QVariant::fromValue(-1)).toInt();
|
||||
qint16 iWidth = settings.value("main/width", QVariant::fromValue(-1)).toInt();
|
||||
@@ -146,6 +160,9 @@ cMainWindow::cMainWindow(QWidget *parent) :
|
||||
|
||||
m_lpShortcut = new QShortcut(QKeySequence(Qt::CTRL + Qt::SHIFT + Qt::Key_A), this, SLOT(onActionAddGlobal()));
|
||||
m_lpShortcut->setAutoRepeat(false);
|
||||
|
||||
applySeriesFilter();
|
||||
applyMoviesFilter();
|
||||
}
|
||||
|
||||
cMainWindow::~cMainWindow()
|
||||
@@ -796,6 +813,11 @@ void cMainWindow::setSeriesStyle(QList<QStandardItem*>lpItems)
|
||||
lpItems.at(2)->setToolTip(szOpen);
|
||||
}
|
||||
|
||||
void cMainWindow::setMovieStyle(QStandardItem* lpItem)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
void cMainWindow::displaySeries()
|
||||
{
|
||||
m_lpSeriesListModel->clear();
|
||||
@@ -1255,6 +1277,7 @@ void cMainWindow::onActionAdd()
|
||||
|
||||
m_szOldSelected = lpSerie->seriesName();
|
||||
displaySeries();
|
||||
applySeriesFilter();
|
||||
|
||||
delete lpDialog;
|
||||
}
|
||||
@@ -1361,6 +1384,7 @@ void cMainWindow::onActionMovieAdd()
|
||||
|
||||
loadMoviesDB();
|
||||
displayMovies();
|
||||
applyMoviesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::onActionUpdateAll()
|
||||
@@ -1511,6 +1535,7 @@ void cMainWindow::updateDone()
|
||||
|
||||
loadDB();
|
||||
displaySeries();
|
||||
applySeriesFilter();
|
||||
|
||||
if(m_lpMessageDialog)
|
||||
delete m_lpMessageDialog;
|
||||
@@ -1535,6 +1560,7 @@ void cMainWindow::onActionDelete()
|
||||
|
||||
loadDB();
|
||||
displaySeries();
|
||||
applySeriesFilter();
|
||||
|
||||
delete lpDialog;
|
||||
}
|
||||
@@ -1557,6 +1583,7 @@ void cMainWindow::onActionMovieDelete()
|
||||
|
||||
loadMoviesDB();
|
||||
displayMovies();
|
||||
applyMoviesFilter();
|
||||
|
||||
delete lpDialog;
|
||||
}
|
||||
@@ -1595,9 +1622,10 @@ void cMainWindow::onActionEdit()
|
||||
}
|
||||
|
||||
setSeriesStyle(lpItems);
|
||||
|
||||
emit m_lpSeriesListModel->layoutChanged();
|
||||
|
||||
applySeriesFilter();
|
||||
|
||||
delete lpDialog;
|
||||
}
|
||||
|
||||
@@ -1607,7 +1635,6 @@ void cMainWindow::onActionMovieEdit()
|
||||
if(!lpMovie)
|
||||
return;
|
||||
|
||||
QString szDownload;
|
||||
if(!runMovieEdit(lpMovie))
|
||||
return;
|
||||
|
||||
@@ -1618,10 +1645,17 @@ void cMainWindow::onActionMovieEdit()
|
||||
|
||||
lpMovie->del(m_db);
|
||||
lpMovie->save(m_db);
|
||||
|
||||
/*
|
||||
m_szOldSelected = lpMovie->movieTitle();
|
||||
loadMoviesDB();
|
||||
displayMovies();
|
||||
*/
|
||||
|
||||
QStandardItem* lpItem = m_lpMoviesListModel->itemFromIndex(ui->m_lpMoviesList->selectionModel()->selectedRows().at(0));
|
||||
setMovieStyle(lpItem);
|
||||
emit m_lpMoviesListModel->layoutChanged();
|
||||
|
||||
applyMoviesFilter();
|
||||
|
||||
delete lpDialog;
|
||||
}
|
||||
@@ -1868,3 +1902,214 @@ void cMainWindow::scrollbarValueChanged2(int value)
|
||||
|
||||
m_bProcessing = false;
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesFilter_clicked()
|
||||
{
|
||||
ui->m_lpSeriesFilterCliffhanger->setEnabled(ui->m_lpSeriesFilter->isChecked());
|
||||
ui->m_lpSeriesFilterDone->setEnabled(ui->m_lpSeriesFilter->isChecked());
|
||||
ui->m_lpSeriesFilterInitialized->setEnabled(ui->m_lpSeriesFilter->isChecked());
|
||||
ui->m_lpSeriesFilterNotFinished->setEnabled(ui->m_lpSeriesFilter->isChecked());
|
||||
ui->m_lpSeriesFilterProgress->setEnabled(ui->m_lpSeriesFilter->isChecked());
|
||||
ui->m_lpSeriesFilterWithLink->setEnabled(ui->m_lpSeriesFilter->isChecked());
|
||||
|
||||
applySeriesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMoviesFilter_clicked()
|
||||
{
|
||||
ui->m_lpMoviesFilterDone->setEnabled(ui->m_lpMoviesFilter->isChecked());
|
||||
ui->m_lpMoviesFilterInitialized->setEnabled(ui->m_lpMoviesFilter->isChecked());
|
||||
ui->m_lpMoviesFilterProgress->setEnabled(ui->m_lpMoviesFilter->isChecked());
|
||||
|
||||
applyMoviesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesFilterInitialized_clicked()
|
||||
{
|
||||
applySeriesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesFilterProgress_clicked()
|
||||
{
|
||||
applySeriesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesFilterDone_clicked()
|
||||
{
|
||||
applySeriesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesFilterWithLink_clicked()
|
||||
{
|
||||
applySeriesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesFilterCliffhanger_clicked()
|
||||
{
|
||||
applySeriesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpSeriesFilterNotFinished_clicked()
|
||||
{
|
||||
applySeriesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMoviesFilterInitialized_clicked()
|
||||
{
|
||||
applyMoviesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMoviesFilterProgress_clicked()
|
||||
{
|
||||
applyMoviesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::on_m_lpMoviesFilterDone_clicked()
|
||||
{
|
||||
applyMoviesFilter();
|
||||
}
|
||||
|
||||
void cMainWindow::applySeriesFilter()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
settings.setValue("seriesFilter/enabled", QVariant::fromValue(ui->m_lpSeriesFilter->isChecked()));
|
||||
settings.setValue("seriesFilter/hasInit", (uint)ui->m_lpSeriesFilterInitialized->checkState());
|
||||
settings.setValue("seriesFilter/hasProgress", (uint)ui->m_lpSeriesFilterProgress->checkState());
|
||||
settings.setValue("seriesFilter/hasDone", (uint)ui->m_lpSeriesFilterDone->checkState());
|
||||
settings.setValue("seriesFilter/hasLink", (uint)ui->m_lpSeriesFilterWithLink->checkState());
|
||||
settings.setValue("seriesFilter/hasNotFinished", (uint)ui->m_lpSeriesFilterNotFinished->checkState());
|
||||
settings.setValue("seriesFilter/isCliffhanger", (uint)ui->m_lpSeriesFilterCliffhanger->checkState());
|
||||
|
||||
for(int x = 0;x < m_lpSeriesListModel->rowCount();x++)
|
||||
{
|
||||
bool bDisplay = false;
|
||||
|
||||
if(ui->m_lpSeriesFilter->isChecked())
|
||||
{
|
||||
QStandardItem* lpItem = m_lpSeriesListModel->item(x);
|
||||
cSerie* lpSerie = lpItem->data(Qt::UserRole).value<cSerie*>();
|
||||
|
||||
bool bHasInit = lpSerie->hasInit();
|
||||
bool bHasProgress = lpSerie->hasProgress();
|
||||
bool bHasDone = lpSerie->hasDone();
|
||||
bool bHasDownloadLink = !lpSerie->download().isEmpty();
|
||||
bool bIsCliffhanger = lpSerie->cliffhanger();
|
||||
bool bNotFinished = true;
|
||||
|
||||
if(lpSerie->status().compare("Ended", Qt::CaseInsensitive) &&
|
||||
lpSerie->status().compare("canceled", Qt::CaseInsensitive))
|
||||
bNotFinished = false;
|
||||
|
||||
bHasInit = checkState(ui->m_lpSeriesFilterInitialized->checkState(), bHasInit);
|
||||
bHasProgress = checkState(ui->m_lpSeriesFilterProgress->checkState(), bHasProgress);
|
||||
bHasDone = checkState(ui->m_lpSeriesFilterDone->checkState(), bHasDone);
|
||||
bHasDownloadLink = checkState(ui->m_lpSeriesFilterWithLink->checkState(), bHasDownloadLink);
|
||||
bIsCliffhanger = checkState(ui->m_lpSeriesFilterCliffhanger->checkState(), bIsCliffhanger);
|
||||
bNotFinished = checkState(ui->m_lpSeriesFilterNotFinished->checkState(), bNotFinished);
|
||||
|
||||
if(bHasInit && bHasProgress && bHasDone && bHasDownloadLink && bIsCliffhanger && bNotFinished)
|
||||
bDisplay = true;
|
||||
}
|
||||
else
|
||||
bDisplay = true;
|
||||
|
||||
ui->m_lpSeriesList1->setRowHidden(x, m_lpSeriesListModel->invisibleRootItem()->index(), !bDisplay);
|
||||
ui->m_lpSeriesList2->setRowHidden(x, m_lpSeriesListModel->invisibleRootItem()->index(), !bDisplay);
|
||||
}
|
||||
}
|
||||
|
||||
void cMainWindow::applyMoviesFilter()
|
||||
{
|
||||
QSettings settings;
|
||||
|
||||
settings.setValue("movieFilter/enabled", QVariant::fromValue(ui->m_lpMoviesFilter->isChecked()));
|
||||
settings.setValue("movieFilter/hasInit", (uint)ui->m_lpMoviesFilterInitialized->checkState());
|
||||
settings.setValue("movieFilter/hasProgress", (uint)ui->m_lpMoviesFilterProgress->checkState());
|
||||
settings.setValue("movieFilter/hasDone", (uint)ui->m_lpMoviesFilterDone->checkState());
|
||||
|
||||
for(int x = 0;x < m_lpMoviesListModel->rowCount();x++)
|
||||
{
|
||||
QStandardItem* lpItem = m_lpMoviesListModel->item(x);
|
||||
cMovie* lpMovie = lpItem->data(Qt::UserRole).value<cMovie*>();
|
||||
|
||||
if(lpMovie)
|
||||
applyMoviesFilter(x, lpMovie);
|
||||
else
|
||||
applyMoviesFilter(lpItem);
|
||||
}
|
||||
}
|
||||
|
||||
bool cMainWindow::applyMoviesFilter(qint16 i, cMovie* lpMovie)
|
||||
{
|
||||
bool bDisplay = false;
|
||||
|
||||
if(ui->m_lpMoviesFilter->isChecked())
|
||||
{
|
||||
bool bHasInit = (lpMovie->state() == cMovie::StateInit);
|
||||
bool bHasProgress = (lpMovie->state() == cMovie::StateProgress);
|
||||
bool bHasDone = (lpMovie->state() == cMovie::StateDone);
|
||||
|
||||
bHasInit = checkState(ui->m_lpMoviesFilterInitialized->checkState(), bHasInit);
|
||||
bHasProgress = checkState(ui->m_lpMoviesFilterProgress->checkState(), bHasProgress);
|
||||
bHasDone = checkState(ui->m_lpMoviesFilterDone->checkState(), bHasDone);
|
||||
|
||||
if(bHasInit && bHasProgress && bHasDone)
|
||||
bDisplay = true;
|
||||
}
|
||||
else
|
||||
bDisplay = true;
|
||||
|
||||
ui->m_lpMoviesList->setRowHidden(i, m_lpMoviesListModel->invisibleRootItem()->index(), !bDisplay);
|
||||
|
||||
return(bDisplay);
|
||||
}
|
||||
|
||||
void cMainWindow::applyMoviesFilter(QStandardItem* lpParent)
|
||||
{
|
||||
bool bParent = false;
|
||||
bool bDisplay = false;
|
||||
|
||||
for(int x = 0;x < lpParent->rowCount();x++)
|
||||
{
|
||||
QStandardItem* lpItem = lpParent->child(x);
|
||||
cMovie* lpMovie = lpItem->data(Qt::UserRole).value<cMovie*>();
|
||||
|
||||
if(ui->m_lpMoviesFilter->isChecked())
|
||||
{
|
||||
bool bHasInit = (lpMovie->state() == cMovie::StateInit);
|
||||
bool bHasProgress = (lpMovie->state() == cMovie::StateProgress);
|
||||
bool bHasDone = (lpMovie->state() == cMovie::StateDone);
|
||||
|
||||
bHasInit = checkState(ui->m_lpMoviesFilterInitialized->checkState(), bHasInit);
|
||||
bHasProgress = checkState(ui->m_lpMoviesFilterProgress->checkState(), bHasProgress);
|
||||
bHasDone = checkState(ui->m_lpMoviesFilterDone->checkState(), bHasDone);
|
||||
|
||||
if(bHasInit && bHasProgress && bHasDone)
|
||||
bDisplay = true;
|
||||
}
|
||||
else
|
||||
bDisplay = true;
|
||||
|
||||
ui->m_lpMoviesList->setRowHidden(x, lpParent->index(), !bDisplay);
|
||||
|
||||
if(bDisplay)
|
||||
bParent = true;
|
||||
}
|
||||
|
||||
ui->m_lpMoviesList->setRowHidden(lpParent->row(), m_lpMoviesListModel->invisibleRootItem()->index(), !bParent);
|
||||
}
|
||||
|
||||
bool cMainWindow::checkState(const Qt::CheckState& state, bool bDesiredState)
|
||||
{
|
||||
if(state == Qt::PartiallyChecked)
|
||||
return(true);
|
||||
|
||||
if(state == Qt::Checked && bDesiredState)
|
||||
return(true);
|
||||
|
||||
if(state == Qt::Unchecked && !bDesiredState)
|
||||
return(true);
|
||||
|
||||
return(false);
|
||||
}
|
||||
|
||||
@@ -86,6 +86,19 @@ private slots:
|
||||
void scrollbarValueChanged1(int value);
|
||||
void scrollbarValueChanged2(int value);
|
||||
|
||||
void on_m_lpSeriesFilterInitialized_clicked();
|
||||
void on_m_lpSeriesFilterProgress_clicked();
|
||||
void on_m_lpSeriesFilterDone_clicked();
|
||||
void on_m_lpSeriesFilterWithLink_clicked();
|
||||
void on_m_lpSeriesFilterCliffhanger_clicked();
|
||||
void on_m_lpSeriesFilterNotFinished_clicked();
|
||||
void on_m_lpMoviesFilterInitialized_clicked();
|
||||
void on_m_lpMoviesFilterProgress_clicked();
|
||||
void on_m_lpMoviesFilterDone_clicked();
|
||||
|
||||
void on_m_lpSeriesFilter_clicked();
|
||||
void on_m_lpMoviesFilter_clicked();
|
||||
|
||||
private:
|
||||
Ui::cMainWindow* ui;
|
||||
cSerieList m_serieList;
|
||||
@@ -127,7 +140,14 @@ private:
|
||||
void showMoviesContextMenu(QTreeView* lpTreeView, const QPoint &pos);
|
||||
|
||||
void setSeriesStyle(QList<QStandardItem *> lpItems);
|
||||
void setMovieStyle(QStandardItem* lpItem);
|
||||
|
||||
void applySeriesFilter();
|
||||
void applyMoviesFilter();
|
||||
bool applyMoviesFilter(qint16 i, cMovie* lpMovie);
|
||||
void applyMoviesFilter(QStandardItem* lpParent);
|
||||
|
||||
bool checkState(const Qt::CheckState &state, bool bDesiredState);
|
||||
protected:
|
||||
void closeEvent(QCloseEvent *event);
|
||||
};
|
||||
|
||||
+199
-47
@@ -15,7 +15,7 @@
|
||||
</property>
|
||||
<widget class="QWidget" name="centralWidget">
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<item row="0" column="1">
|
||||
<widget class="QTabWidget" name="m_lpMainTab">
|
||||
<property name="currentIndex">
|
||||
<number>1</number>
|
||||
@@ -24,9 +24,98 @@
|
||||
<attribute name="title">
|
||||
<string>TV Shows</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<layout class="QGridLayout" name="gridLayout_5">
|
||||
<item row="0" column="0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="1,0">
|
||||
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,1,0">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="m_lpSeriesFilter">
|
||||
<property name="title">
|
||||
<string>Filter</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_4">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="m_lpSeriesFilterInitialized">
|
||||
<property name="text">
|
||||
<string>initialized</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QCheckBox" name="m_lpSeriesFilterCliffhanger">
|
||||
<property name="text">
|
||||
<string>cliffhanger</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="m_lpSeriesFilterDone">
|
||||
<property name="text">
|
||||
<string>done</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="m_lpSeriesFilterProgress">
|
||||
<property name="text">
|
||||
<string>in progress</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="m_lpSeriesFilterWithLink">
|
||||
<property name="text">
|
||||
<string>download link</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="2">
|
||||
<widget class="QCheckBox" name="m_lpSeriesFilterNotFinished">
|
||||
<property name="text">
|
||||
<string>not finished</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_3">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
@@ -167,60 +256,123 @@
|
||||
<attribute name="title">
|
||||
<string>Movies</string>
|
||||
</attribute>
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<layout class="QGridLayout" name="gridLayout_7">
|
||||
<item row="0" column="0">
|
||||
<widget class="QTreeView" name="m_lpMoviesList">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2" stretch="0,1,0">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Movies:</string>
|
||||
<widget class="QGroupBox" name="m_lpMoviesFilter">
|
||||
<property name="title">
|
||||
<string>Filter</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_6">
|
||||
<item row="0" column="0">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="1">
|
||||
<widget class="QCheckBox" name="m_lpMoviesFilterProgress">
|
||||
<property name="text">
|
||||
<string>in progress</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="m_lpMoviesFilterInitialized">
|
||||
<property name="text">
|
||||
<string>Initialized</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QCheckBox" name="m_lpMoviesFilterDone">
|
||||
<property name="text">
|
||||
<string>done</string>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<spacer name="horizontalSpacer_4">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpMoviesCount">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
<widget class="QTreeView" name="m_lpMoviesList">
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::CustomContextMenu</enum>
|
||||
</property>
|
||||
<property name="editTriggers">
|
||||
<set>QAbstractItemView::NoEditTriggers</set>
|
||||
</property>
|
||||
<property name="alternatingRowColors">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
||||
</property>
|
||||
<property name="rootIsDecorated">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="allColumnsShowFocus">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<attribute name="headerVisible">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Movies:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="m_lpMoviesCount">
|
||||
<property name="text">
|
||||
<string>0</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="horizontalSpacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
||||
+10
@@ -180,6 +180,16 @@ void cSeason::setLabel1(QLabel* lpLabel1)
|
||||
m_lpLabel1 = lpLabel1;
|
||||
}
|
||||
|
||||
bool cSeason::hasInit()
|
||||
{
|
||||
for(int x = 0;x < m_episodeList.count();x++)
|
||||
{
|
||||
cEpisode* lpEpisode = m_episodeList.at(x);
|
||||
if(lpEpisode->state() == cEpisode::StateInit)
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cSeason::hasProgress()
|
||||
{
|
||||
|
||||
@@ -66,6 +66,7 @@ public:
|
||||
void updateState();
|
||||
void deleteResources();
|
||||
|
||||
bool hasInit();
|
||||
bool hasProgress();
|
||||
bool hasDone();
|
||||
|
||||
|
||||
+14
@@ -479,6 +479,20 @@ qint16 cSerie::maxEpisode()
|
||||
return(iMax);
|
||||
}
|
||||
|
||||
bool cSerie::hasInit()
|
||||
{
|
||||
for(int x = 0;x < m_seasonList.count();x++)
|
||||
{
|
||||
cSeason* lpSeason = m_seasonList.at(x);
|
||||
if(!lpSeason->seasonNumber())
|
||||
continue;
|
||||
|
||||
if(lpSeason->hasInit())
|
||||
return(true);
|
||||
}
|
||||
return(false);
|
||||
}
|
||||
|
||||
bool cSerie::hasProgress()
|
||||
{
|
||||
for(int x = 0;x < m_seasonList.count();x++)
|
||||
|
||||
Reference in New Issue
Block a user