MythTV  master
videofilter.cpp
Go to the documentation of this file.
1 #include <set>
2 
3 #include "mythcontext.h"
4 
5 #include "mythuibuttonlist.h"
6 #include "mythuibutton.h"
7 #include "mythuitext.h"
8 #include "mythuitextedit.h"
9 #include "mythmiscutil.h"
10 #include "globals.h"
11 #include "dbaccess.h"
13 #include "videoutils.h"
14 #include "mythdate.h"
15 
16 #include "videolist.h"
17 #include "videofilter.h"
18 
20  const QString& _prefix)
21 {
22  if (_prefix.isEmpty())
23  m_prefix = "VideoDefault";
24  else
25  m_prefix = _prefix + "Default";
26 
27  // do nothing yet
28  if (loaddefaultsettings)
29  {
30  m_category = gCoreContext->GetNumSetting(QString("%1Category").arg(m_prefix),
32  m_genre = gCoreContext->GetNumSetting(QString("%1Genre").arg(m_prefix),
34  m_country = gCoreContext->GetNumSetting(QString("%1Country").arg(m_prefix),
36  m_cast = gCoreContext->GetNumSetting(QString("%1Cast").arg(m_prefix),
38  m_year = gCoreContext->GetNumSetting(QString("%1Year").arg(m_prefix),
40  m_runtime = gCoreContext->GetNumSetting(QString("%1Runtime").arg(m_prefix),
42  m_userrating =
43  gCoreContext->GetNumSetting(QString("%1Userrating").arg(m_prefix),
45  m_browse = gCoreContext->GetNumSetting(QString("%1Browse").arg(m_prefix),
47  m_watched = gCoreContext->GetNumSetting(QString("%1Watched").arg(m_prefix),
49  m_inetref = gCoreContext->GetNumSetting(QString("%1InetRef").arg(m_prefix),
51  m_coverfile = gCoreContext->GetNumSetting(QString("%1CoverFile")
53  m_orderby = (ordering)gCoreContext->GetNumSetting(QString("%1Orderby")
54  .arg(m_prefix),
56  }
57 }
58 
60  m_changed_state(0)
61 {
62  *this = rhs;
63 }
64 
67 {
68  m_prefix = rhs.m_prefix;
69 
70  if (m_category != rhs.m_category)
71  {
73  m_category = rhs.m_category;
74  }
75 
76  if (m_genre != rhs.m_genre)
77  {
79  m_genre = rhs.m_genre;
80  }
81 
82  if (m_country != rhs.m_country)
83  {
85  m_country = rhs.m_country;
86  }
87 
88  if (m_cast != rhs.m_cast)
89  {
91  m_cast = rhs.m_cast;
92  }
93 
94  if (m_year != rhs.m_year)
95  {
97  m_year = rhs.m_year;
98  }
99 
100  if (m_runtime != rhs.m_runtime)
101  {
103  m_runtime = rhs.m_runtime;
104  }
105 
106  if (m_userrating != rhs.m_userrating)
107  {
110  }
111 
112  if (m_browse != rhs.m_browse)
113  {
115  m_browse = rhs.m_browse;
116  }
117 
118  if (m_watched != rhs.m_watched)
119  {
121  m_watched = rhs.m_watched;
122  }
123 
124  if (m_inetref != rhs.m_inetref)
125  {
127  m_inetref = rhs.m_inetref;
128  }
129 
130  if (m_coverfile != rhs.m_coverfile)
131  {
133  m_coverfile = rhs.m_coverfile;
134  }
135 
136  if (m_orderby != rhs.m_orderby)
137  {
139  m_orderby = rhs.m_orderby;
140  }
141 
143  {
146  }
147 
148  if (m_textfilter != rhs.m_textfilter)
149  {
152  }
153  if (m_season != rhs.m_season || m_episode != rhs.m_episode)
154  {
155  m_season = rhs.m_season;
156  m_episode = rhs.m_episode;
158  }
159  if (m_insertdate != rhs.m_insertdate)
160  {
163  }
164 
165  return *this;
166 }
167 
169 {
170  gCoreContext->SaveSetting(QString("%1Category").arg(m_prefix), m_category);
171  gCoreContext->SaveSetting(QString("%1Genre").arg(m_prefix), m_genre);
172  gCoreContext->SaveSetting(QString("%1Cast").arg(m_prefix), m_cast);
173  gCoreContext->SaveSetting(QString("%1Country").arg(m_prefix), m_country);
174  gCoreContext->SaveSetting(QString("%1Year").arg(m_prefix), m_year);
175  gCoreContext->SaveSetting(QString("%1Runtime").arg(m_prefix), m_runtime);
176  gCoreContext->SaveSetting(QString("%1Userrating").arg(m_prefix), m_userrating);
177  gCoreContext->SaveSetting(QString("%1Browse").arg(m_prefix), m_browse);
178  gCoreContext->SaveSetting(QString("%1Watched").arg(m_prefix), m_watched);
179  gCoreContext->SaveSetting(QString("%1InetRef").arg(m_prefix), m_inetref);
180  gCoreContext->SaveSetting(QString("%1CoverFile").arg(m_prefix), m_coverfile);
181  gCoreContext->SaveSetting(QString("%1Orderby").arg(m_prefix), m_orderby);
182  gCoreContext->SaveSetting(QString("%1Filter").arg(m_prefix), m_textfilter);
183 }
184 
186 {
187  bool matches = true;
188 
189  //textfilter
190  if (!m_textfilter.isEmpty())
191  {
192  matches = false;
193  matches = (matches ||
194  mdata.GetTitle().contains(m_textfilter, Qt::CaseInsensitive));
195  matches = (matches ||
196  mdata.GetSubtitle().contains(m_textfilter, Qt::CaseInsensitive));
197  matches = (matches ||
198  mdata.GetPlot().contains(m_textfilter, Qt::CaseInsensitive));
199  }
200  //search for season with optionally episode nr.
201  if (matches && (m_season != -1))
202  {
203  matches = (m_season == mdata.GetSeason());
204  matches = (matches && (m_episode == -1 || m_episode == mdata.GetEpisode()));
205  }
206  if (matches && m_insertdate.isValid())
207  {
208  matches = (mdata.GetInsertdate().isValid() &&
209  mdata.GetInsertdate() >= m_insertdate);
210  }
211  if (matches && (m_genre != kGenreFilterAll))
212  {
213  matches = false;
214 
215  const VideoMetadata::genre_list &gl = mdata.GetGenres();
216  for (VideoMetadata::genre_list::const_iterator p = gl.begin();
217  p != gl.end(); ++p)
218  {
219  if ((matches = (p->first == m_genre)))
220  {
221  break;
222  }
223  }
224  }
225 
226  if (matches && m_country != kCountryFilterAll)
227  {
228  matches = false;
229 
230  const VideoMetadata::country_list &cl = mdata.GetCountries();
231  for (VideoMetadata::country_list::const_iterator p = cl.begin();
232  p != cl.end(); ++p)
233  {
234  if ((matches = (p->first == m_country)))
235  {
236  break;
237  }
238  }
239  }
240 
241  if (matches && m_cast != kCastFilterAll)
242  {
243  const VideoMetadata::cast_list &cl = mdata.GetCast();
244 
245  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
246  {
247  matches = true;
248  }
249  else
250  {
251  matches = false;
252 
253  for (VideoMetadata::cast_list::const_iterator p = cl.begin();
254  p != cl.end(); ++p)
255  {
256  if ((matches = (p->first == m_cast)))
257  {
258  break;
259  }
260  }
261  }
262  }
263 
264  if (matches && m_category != kCategoryFilterAll)
265  {
266  matches = (m_category == mdata.GetCategoryID());
267  }
268 
269  if (matches && m_year != kYearFilterAll)
270  {
271  if (m_year == kYearFilterUnknown)
272  {
273  matches = ((mdata.GetYear() == 0) ||
274  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
275  }
276  else
277  {
278  matches = (m_year == mdata.GetYear());
279  }
280  }
281 
282  if (matches && m_runtime != kRuntimeFilterAll)
283  {
285  {
286  matches = (mdata.GetLength() == 0);
287  }
288  else
289  {
290  matches = (m_runtime == (mdata.GetLength() / 30));
291  }
292  }
293 
294  if (matches && m_userrating != kUserRatingFilterAll)
295  {
296  matches = (mdata.GetUserRating() >= m_userrating);
297  }
298 
299  if (matches && m_browse != kBrowseFilterAll)
300  {
301  matches = (mdata.GetBrowse() == m_browse);
302  }
303 
304  if (matches && m_watched != kWatchedFilterAll)
305  {
306  matches = (mdata.GetWatched() == m_watched);
307  }
308 
309  if (matches && m_inetref != kInetRefFilterAll)
310  {
311  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
312  }
313 
314  if (matches && m_coverfile != kCoverFileFilterAll)
315  {
316  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
317  }
318 
319  if (matches && m_parental_level)
320  {
321  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
322  (mdata.GetShowLevel() <= m_parental_level));
323  }
324 
325  return matches;
326 }
327 
330  const VideoMetadata &rhs) const
331 {
332  bool ret = false;
333  switch (m_orderby)
334  {
335  case kOrderByTitle:
336  {
337  ret = lhs.sortBefore(rhs);
338  break;
339  }
340  case kOrderBySeasonEp:
341  {
342  if ((lhs.GetSeason() == rhs.GetSeason())
343  && (lhs.GetEpisode() == rhs.GetEpisode())
344  && (lhs.GetSeason() == 0)
345  && (rhs.GetSeason() == 0)
346  && (lhs.GetEpisode() == 0)
347  && (rhs.GetEpisode() == 0))
348  {
349  ret = lhs.sortBefore(rhs);
350  }
351  else if ((lhs.GetSeason() == rhs.GetSeason())
352  && (lhs.GetTitle() == rhs.GetTitle()))
353  ret = (lhs.GetEpisode() < rhs.GetEpisode());
354  else
355  ret = (lhs.GetSeason() < rhs.GetSeason());
356  break;
357  }
359  {
360  ret = (lhs.GetYear() > rhs.GetYear());
361  break;
362  }
364  {
365  ret = (lhs.GetUserRating() > rhs.GetUserRating());
366  break;
367  }
368  case kOrderByLength:
369  {
370  ret = (lhs.GetLength() < rhs.GetLength());
371  break;
372  }
373  case kOrderByFilename:
374  {
375  const QString& lhsfn = lhs.GetSortFilename();
376  const QString& rhsfn = rhs.GetSortFilename();
377  ret = naturalCompare(lhsfn, rhsfn) < 0;
378  break;
379  }
380  case kOrderByID:
381  {
382  ret = (lhs.GetID() < rhs.GetID());
383  break;
384  }
386  {
387  ret = (lhs.GetInsertdate() > rhs.GetInsertdate());
388  break;
389  }
390  default:
391  {
392  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
393  .arg(m_orderby));
394  }
395  }
396 
397  return ret;
398 }
399 
400 void VideoFilterSettings::setTextFilter(const QString& val)
401 {
403  if (m_re_season.indexIn(val) != -1)
404  {
405  bool res;
406  QStringList list = m_re_season.capturedTexts();
407  m_season = list[1].toInt(&res);
408  if (!res)
409  m_season = -1;
410  if (list.size() > 2) {
411  m_episode = list[2].toInt(&res);
412  if (!res)
413  m_episode = -1;
414  }
415  else {
416  m_episode = -1;
417  }
418  //clear \dX\d from string for string-search in plot/title/subtitle
419  m_textfilter = val;
420  m_textfilter.replace(m_re_season, "");
421  m_textfilter = m_textfilter.simplified ();
422  }
423  else
424  {
425  m_textfilter = val;
426  m_season = -1;
427  m_episode = -1;
428  }
429  if (m_re_date.indexIn(m_textfilter) != -1)
430  {
431  QStringList list = m_re_date.capturedTexts();
432  int modnr = list[1].toInt();
433  QDate testdate = MythDate::current().date();
434  switch(list[2].at(0).toLatin1())
435  {
436  case 'm': testdate = testdate.addMonths(-modnr);break;
437  case 'd': testdate = testdate.addDays(-modnr);break;
438  case 'w': testdate = testdate.addDays(-modnr * 7);break;
439  }
440  m_insertdate = testdate;
441  m_textfilter.replace(m_re_date, "");
442  m_textfilter = m_textfilter.simplified ();
443  }
444  else
445  {
446  //reset testdate
447  m_insertdate = QDate();
448  }
449 }
450 
452 // VideoFilterDialog
455  VideoList *video_list) : MythScreenType(lparent, lname),
456  m_videoList(*video_list)
457 {
458  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
460 }
461 
463 {
464  delete m_fsp;
465 }
466 
468 {
469  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
470  return false;
471 
472  bool err = false;
473  UIUtilE::Assign(this, m_textfilter, "textfilter_input", &err);
474  UIUtilE::Assign(this, m_yearList, "year_select", &err);
475  UIUtilE::Assign(this, m_userratingList, "userrating_select", &err);
476  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
477  UIUtilE::Assign(this, m_countryList, "country_select", &err);
478  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
479  UIUtilE::Assign(this, m_castList, "cast_select", &err);
480  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
481  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
482  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
483  UIUtilE::Assign(this, m_inetrefList, "inetref_select", &err);
484  UIUtilE::Assign(this, m_coverfileList, "coverfile_select", &err);
485  UIUtilE::Assign(this, m_orderbyList, "orderby_select", &err);
486 
487  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
488  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
489 
490  UIUtilE::Assign(this, m_numvideosText, "numvideos_text", &err);
491 
492  if (err)
493  {
494  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
495  return false;
496  }
497 
498  BuildFocusList();
499 
500  fillWidgets();
501  update_numvideo();
502 
503  connect(m_yearList, SIGNAL(itemSelected(MythUIButtonListItem*)),
504  SLOT(SetYear(MythUIButtonListItem*)));
505  connect(m_userratingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
507  connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
509  connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
511  connect(m_genreList,SIGNAL(itemSelected(MythUIButtonListItem*)),
513  connect(m_castList,SIGNAL(itemSelected(MythUIButtonListItem*)),
514  SLOT(SetCast(MythUIButtonListItem*)));
515  connect(m_runtimeList, SIGNAL(itemSelected(MythUIButtonListItem*)),
517  connect(m_browseList, SIGNAL(itemSelected(MythUIButtonListItem*)),
519  connect(m_watchedList, SIGNAL(itemSelected(MythUIButtonListItem*)),
521  connect(m_inetrefList, SIGNAL(itemSelected(MythUIButtonListItem*)),
523  connect(m_coverfileList, SIGNAL(itemSelected(MythUIButtonListItem*)),
525  connect(m_orderbyList, SIGNAL(itemSelected(MythUIButtonListItem*)),
527  connect(m_textfilter, SIGNAL(valueChanged()),
528  SLOT(setTextFilter()));
529 
530  connect(m_saveButton, SIGNAL(Clicked()), SLOT(saveAsDefault()));
531  connect(m_doneButton, SIGNAL(Clicked()), SLOT(saveAndExit()));
532 
533  return true;
534 }
535 
537 {
538  int video_count = m_videoList.TryFilter(m_settings);
539 
540  if (video_count > 0)
541  {
542  m_numvideosText->SetText(tr("Result of this filter : %n video(s)", "",
543  video_count));
544  }
545  else
546  {
547  m_numvideosText->SetText(tr("Result of this filter : No Videos"));
548  }
549 }
550 
552 {
553  bool have_unknown_year = false;
554  bool have_unknown_runtime = false;
555 
556  typedef std::set<int> int_list;
557  int_list years;
558  int_list runtimes;
559  int_list user_ratings;
560 
563  for (VideoMetadataListManager::metadata_list::const_iterator p = mdl.begin();
564  p != mdl.end(); ++p)
565  {
566  int year = (*p)->GetYear();
567  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
568  have_unknown_year = true;
569  else
570  years.insert(year);
571 
572  int runtime = (*p)->GetLength();
573  if (runtime == 0)
574  have_unknown_runtime = true;
575  else
576  runtimes.insert(runtime / 30);
577 
578  user_ratings.insert(static_cast<int>((*p)->GetUserRating()));
579  }
580 
581  // Category
582  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
584 
585  const VideoCategory::entry_list &vcl =
587  for (VideoCategory::entry_list::const_iterator p = vcl.begin();
588  p != vcl.end(); ++p)
589  {
590  new MythUIButtonListItem(m_categoryList, p->second, p->first);
591  }
592 
596 
597  // Genre
598  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
599 
601  for (VideoGenre::entry_list::const_iterator p = gl.begin();
602  p != gl.end(); ++p)
603  {
604  new MythUIButtonListItem(m_genreList, p->second, p->first);
605  }
606 
609 
610  // Cast
611  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
612 
614  for (VideoCast::entry_list::const_iterator p = cl.begin();
615  p != cl.end(); ++p)
616  {
617  new MythUIButtonListItem(m_castList, p->second, p->first);
618  }
619 
622 
623  // Country
624  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
625 
627  for (VideoCountry::entry_list::const_iterator p = cnl.begin();
628  p != cnl.end(); ++p)
629  {
630  new MythUIButtonListItem(m_countryList, p->second, p->first);
631  }
632 
636 
637  // Year
638  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
639 
640  for (int_list::const_reverse_iterator p = years.rbegin();
641  p != years.rend(); ++p)
642  {
643  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
644  }
645 
646  if (have_unknown_year)
649 
651 
652  // Runtime
653  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
654 
655  if (have_unknown_runtime)
658 
659  for (int_list::const_iterator p = runtimes.begin();
660  p != runtimes.end(); ++p)
661  {
662  QString s = QString("%1 %2 ~ %3 %4").arg(*p * 30).arg(tr("minutes"))
663  .arg((*p + 1) * 30).arg(tr("minutes"));
665  }
666 
668 
669  // User Rating
670  new MythUIButtonListItem(m_userratingList, tr("All", "User rating"),
672 
673  for (int_list::const_reverse_iterator p = user_ratings.rbegin();
674  p != user_ratings.rend(); ++p)
675  {
677  QString(">= %1").arg(QString::number(*p)),
678  *p);
679  }
680 
682 
683  // Browsable
684  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
687  QCoreApplication::translate("(Common)", "Yes"), qVariantFromValue(1));
689  QCoreApplication::translate("(Common)", "No"), qVariantFromValue(0));
691 
692  // Watched
693  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
696  QCoreApplication::translate("(Common)", "Yes"), qVariantFromValue(1));
698  QCoreApplication::translate("(Common)", "No"), qVariantFromValue(0));
700 
701  // Inet Reference
702  new MythUIButtonListItem(m_inetrefList, tr("All", "Inet reference"),
704  new MythUIButtonListItem(m_inetrefList, tr("Unknown", "Inet reference"),
707 
708  // Coverfile
709  new MythUIButtonListItem(m_coverfileList, tr("All", "Cover file"),
711  new MythUIButtonListItem(m_coverfileList, tr("None", "Cover file"),
714 
715  // Order by
717  QCoreApplication::translate("(Common)", "Title"),
720  QCoreApplication::translate("(Common)", "Season/Episode"),
723  QCoreApplication::translate("(Common)", "Year"),
726  QCoreApplication::translate("(Common)", "User Rating"),
729  QCoreApplication::translate("(Common)", "Runtime"),
732  QCoreApplication::translate("(Common)", "Filename"),
734  new MythUIButtonListItem(m_orderbyList, tr("Video ID"),
736  new MythUIButtonListItem(m_orderbyList, tr("Date Added"),
739 
740  // Text Filter
742 }
743 
745 {
747  saveAndExit();
748 }
749 
751 {
753 
754  if (m_settings.getChangedState() > 0)
755  emit filterChanged();
756  Close();
757 }
758 
760 {
761  int new_year = item->GetData().toInt();
762  m_settings.SetYear(new_year);
763  update_numvideo();
764 }
765 
767 {
768  m_settings.SetUserRating(item->GetData().toInt());
769  update_numvideo();
770 }
771 
773 {
774  m_settings.SetCategory(item->GetData().toInt());
775  update_numvideo();
776 }
777 
779 {
780  m_settings.setCountry(item->GetData().toInt());
781  update_numvideo();
782 }
783 
785 {
786  m_settings.setGenre(item->GetData().toInt());
787  update_numvideo();
788 }
789 
791 {
792  m_settings.SetCast(item->GetData().toInt());
793  update_numvideo();
794 }
795 
797 {
798  m_settings.setRuntime(item->GetData().toInt());
799  update_numvideo();
800 }
801 
803 {
804  m_settings.SetBrowse(item->GetData().toInt());
805  update_numvideo();
806 }
807 
809 {
810  m_settings.SetWatched(item->GetData().toInt());
811  update_numvideo();
812 }
813 
815 {
816  m_settings.SetInetRef(item->GetData().toInt());
817  update_numvideo();
818 }
819 
821 {
822  m_settings.SetCoverFile(item->GetData().toInt());
823  update_numvideo();
824 }
825 
827 {
828  m_settings
830  update_numvideo();
831 }
832 
834 {
836  update_numvideo();
837 }
void SetCategory(MythUIButtonListItem *item)
void SetCoverFile(MythUIButtonListItem *item)
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
void setOrderby(MythUIButtonListItem *item)
void SetInetRef(int inetref)
Definition: videofilter.h:202
int getRuntime() const
Definition: videofilter.h:156
int GetLength() const
const QString & GetSortFilename() const
bool GetWatched() const
void SetUserRating(int luserrating)
Definition: videofilter.h:164
MythUIButton * m_saveButton
Definition: videofilter.h:323
void SetCast(MythUIButtonListItem *item)
const metadata_list & getList() const
QDate GetInsertdate() const
int GetSeason() const
virtual void setSettings(const VideoFilterSettings &settings)=0
MythUIText * m_numvideosText
Definition: videofilter.h:325
void SetCategory(int lcategory)
Definition: videofilter.h:122
MythUIButton * m_doneButton
Definition: videofilter.h:324
int GetCoverFile() const
Definition: videofilter.h:208
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:508
void setGenre(MythUIButtonListItem *item)
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:19
MythUIButtonList * m_coverfileList
Definition: videofilter.h:322
void SaveSetting(const QString &key, int newValue)
const QString VIDEO_COUNTRY_UNKNOWN
Definition: globals.cpp:13
void setGenre(int lgenre)
Definition: videofilter.h:129
void SetBrowse(int lbrowse)
Definition: videofilter.h:171
const QString VIDEO_CAST_UNKNOWN
Definition: globals.cpp:19
int getYear() const
Definition: videofilter.h:149
MythUIButtonList * m_orderbyList
Definition: videofilter.h:313
MythUIButtonList * m_genreList
Definition: videofilter.h:318
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:136
const QString VIDEO_CATEGORY_UNKNOWN
Definition: globals.cpp:7
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
virtual const VideoFilterSettings & getSettings()=0
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:492
std::vector< country_entry > country_list
Definition: videometadata.h:33
void setCountry(int lcountry)
Definition: videofilter.h:143
bool IsDefaultCoverFile(const QString &coverfile)
Definition: videoutils.cpp:127
const QString VIDEO_YEAR_UNKNOWN
Definition: globals.cpp:15
const VideoList & m_videoList
Definition: videofilter.h:328
const QRegExp m_re_season
Definition: videofilter.h:241
MythUITextEdit * m_textfilter
Definition: videofilter.h:326
int GetCast() const
Definition: videofilter.h:135
void BuildFocusList(void)
unsigned int GetID() const
unsigned int m_changed_state
Definition: videofilter.h:244
std::vector< entry > entry_list
Definition: dbaccess.h:15
VideoFilterDialog(MythScreenStack *lparent, const QString &lname, VideoList *video_list)
MythUIButtonList * m_browseList
Definition: videofilter.h:311
int getCountry() const
Definition: videofilter.h:142
int getInteRef() const
Definition: videofilter.h:201
virtual void Close()
ParentalLevel::Level GetShowLevel() const
int GetYear() const
void setTextFilter(const QString &val)
MythUIButtonList * m_userratingList
Definition: videofilter.h:315
bool Create() override
int GetBrowse() const
Definition: videofilter.h:170
static VideoCountry & getCountry()
Definition: dbaccess.cpp:506
MythUIButtonList * m_runtimeList
Definition: videofilter.h:320
float GetUserRating() const
void SetCoverFile(int coverfile)
Definition: videofilter.h:209
const QString & GetPlot() const
void setRunTime(MythUIButtonListItem *item)
const QRegExp m_re_date
Definition: videofilter.h:242
void SetWatched(int lwatched)
Definition: videofilter.h:178
int GetEpisode() const
void SetBrowse(MythUIButtonListItem *item)
void SetUserRating(MythUIButtonListItem *item)
const QString VIDEO_GENRE_UNKNOWN
Definition: globals.cpp:11
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
bool sortBefore(const VideoMetadata &rhs) const
MythUIButtonList * m_yearList
Definition: videofilter.h:314
void SetYear(int lyear)
Definition: videofilter.h:150
MythUIButtonList * m_countryList
Definition: videofilter.h:317
void SetYear(MythUIButtonListItem *item)
void setRuntime(int lruntime)
Definition: videofilter.h:157
MythUIButtonList * m_inetrefList
Definition: videofilter.h:321
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
int GetCategoryID() const
static VideoCast & GetCast()
Definition: dbaccess.cpp:534
bool matches_filter(const VideoMetadata &mdata) const
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
void SetText(const QString &text, bool moveCursor=true)
bool meta_less_than(const VideoMetadata &lhs, const VideoMetadata &rhs) const
Compares two VideoMetadata instances.
const cast_list & GetCast() const
int getGenre() const
Definition: videofilter.h:128
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:503
int GetCategory() const
Definition: videofilter.h:121
std::list< VideoMetadataPtr > metadata_list
int GetNumSetting(const QString &key, int defaultval=0)
const country_list & GetCountries() const
#define LOG(_MASK_, _LEVEL_, _STRING_)
Definition: mythlogging.h:41
VideoFilterSettings m_settings
Definition: videofilter.h:309
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
const entry_list & getList()
Definition: dbaccess.cpp:242
MythUIButtonList * m_categoryList
Definition: videofilter.h:316
static VideoGenre & getGenre()
Definition: dbaccess.cpp:520
bool GetBrowse() const
FilterSettingsProxy * m_fsp
Definition: videofilter.h:329
void setCountry(MythUIButtonListItem *item)
const QString & GetSubtitle() const
const QString & GetCoverFile() const
int GetUserRating() const
Definition: videofilter.h:163
MythUIButtonList * m_castList
Definition: videofilter.h:319
const genre_list & GetGenres() const
unsigned int getChangedState()
Definition: videofilter.h:215
Screen in which all other widgets are contained and rendered.
const QString & GetInetRef() const
const QString & GetTitle() const
int GetWatched() const
Definition: videofilter.h:177
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
ordering getOrderby() const
Definition: videofilter.h:184
ParentalLevel::Level m_parental_level
Definition: videofilter.h:235
void SetCast(int lcast)
Definition: videofilter.h:136
const QString VIDEO_RUNTIME_UNKNOWN
Definition: globals.cpp:17
QString getTextFilter() const
Definition: videofilter.h:191
MythUIButtonList * m_watchedList
Definition: videofilter.h:312
VideoFilterSettings & operator=(const VideoFilterSettings &rhs)
Definition: videofilter.cpp:66
void SetWatched(MythUIButtonListItem *item)
void SetInetRef(MythUIButtonListItem *item)
QString GetText(void) const
void SetValueByData(const QVariant &data)
void setOrderby(ordering lorderby)
Definition: videofilter.h:185