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 
22 };
23 
27 };
28 
29 enum CastFilter {
32 };
33 
37 };
38 
39 enum YearFilter {
42 };
43 
47 };
48 
51 };
52 
55 };
56 
59 };
60 
64 };
65 
69 };
70 
72  const QString& _prefix) :
73  category(kCategoryFilterAll), genre(kGenreFilterAll),
74  country(kCountryFilterAll), cast(kCastFilterAll),
75  year(kYearFilterAll), runtime(kRuntimeFilterAll),
76  userrating(kUserRatingFilterAll), browse(kBrowseFilterAll),
77  watched(kWatchedFilterAll), m_inetref(kInetRefFilterAll),
78  m_coverfile(kCoverFileFilterAll), orderby(kOrderByTitle),
79  m_parental_level(ParentalLevel::plNone), textfilter(""),
80  season(-1), episode(-1), insertdate(QDate()),
81  re_season("(\\d+)[xX](\\d*)"), re_date("-(\\d+)([dmw])"),
82  m_changed_state(0)
83 {
84  if (_prefix.isEmpty())
85  prefix = "VideoDefault";
86  else
87  prefix = _prefix + "Default";
88 
89  // do nothing yet
90  if (loaddefaultsettings)
91  {
92  category = gCoreContext->GetNumSetting(QString("%1Category").arg(prefix),
94  genre = gCoreContext->GetNumSetting(QString("%1Genre").arg(prefix),
96  country = gCoreContext->GetNumSetting(QString("%1Country").arg(prefix),
98  cast = gCoreContext->GetNumSetting(QString("%1Cast").arg(prefix),
100  year = gCoreContext->GetNumSetting(QString("%1Year").arg(prefix),
102  runtime = gCoreContext->GetNumSetting(QString("%1Runtime").arg(prefix),
104  userrating =
105  gCoreContext->GetNumSetting(QString("%1Userrating").arg(prefix),
107  browse = gCoreContext->GetNumSetting(QString("%1Browse").arg(prefix),
109  watched = gCoreContext->GetNumSetting(QString("%1Watched").arg(prefix),
111  m_inetref = gCoreContext->GetNumSetting(QString("%1InetRef").arg(prefix),
113  m_coverfile = gCoreContext->GetNumSetting(QString("%1CoverFile")
114  .arg(prefix), kCoverFileFilterAll);
115  orderby = (ordering)gCoreContext->GetNumSetting(QString("%1Orderby")
116  .arg(prefix),
117  kOrderByTitle);
118  }
119 }
120 
122  m_changed_state(0)
123 {
124  *this = rhs;
125 }
126 
129 {
130  prefix = rhs.prefix;
131 
132  if (category != rhs.category)
133  {
135  category = rhs.category;
136  }
137 
138  if (genre != rhs.genre)
139  {
141  genre = rhs.genre;
142  }
143 
144  if (country != rhs.country)
145  {
147  country = rhs.country;
148  }
149 
150  if (cast != rhs.cast)
151  {
153  cast = rhs.cast;
154  }
155 
156  if (year != rhs.year)
157  {
159  year = rhs.year;
160  }
161 
162  if (runtime != rhs.runtime)
163  {
165  runtime = rhs.runtime;
166  }
167 
168  if (userrating != rhs.userrating)
169  {
171  userrating = rhs.userrating;
172  }
173 
174  if (browse != rhs.browse)
175  {
177  browse = rhs.browse;
178  }
179 
180  if (watched != rhs.watched)
181  {
183  watched = rhs.watched;
184  }
185 
186  if (m_inetref != rhs.m_inetref)
187  {
189  m_inetref = rhs.m_inetref;
190  }
191 
192  if (m_coverfile != rhs.m_coverfile)
193  {
195  m_coverfile = rhs.m_coverfile;
196  }
197 
198  if (orderby != rhs.orderby)
199  {
201  orderby = rhs.orderby;
202  }
203 
205  {
208  }
209 
210  if (textfilter != rhs.textfilter)
211  {
212  textfilter = rhs.textfilter;
214  }
215  if (season != rhs.season || episode != rhs.episode)
216  {
217  season = rhs.season;
218  episode = rhs.episode;
220  }
221  if (insertdate != rhs.insertdate)
222  {
223  insertdate = rhs.insertdate;
225  }
226 
227  return *this;
228 }
229 
231 {
232  gCoreContext->SaveSetting(QString("%1Category").arg(prefix), category);
233  gCoreContext->SaveSetting(QString("%1Genre").arg(prefix), genre);
234  gCoreContext->SaveSetting(QString("%1Cast").arg(prefix), cast);
235  gCoreContext->SaveSetting(QString("%1Country").arg(prefix), country);
236  gCoreContext->SaveSetting(QString("%1Year").arg(prefix), year);
237  gCoreContext->SaveSetting(QString("%1Runtime").arg(prefix), runtime);
238  gCoreContext->SaveSetting(QString("%1Userrating").arg(prefix), userrating);
239  gCoreContext->SaveSetting(QString("%1Browse").arg(prefix), browse);
240  gCoreContext->SaveSetting(QString("%1Watched").arg(prefix), watched);
241  gCoreContext->SaveSetting(QString("%1InetRef").arg(prefix), m_inetref);
242  gCoreContext->SaveSetting(QString("%1CoverFile").arg(prefix), m_coverfile);
243  gCoreContext->SaveSetting(QString("%1Orderby").arg(prefix), orderby);
244  gCoreContext->SaveSetting(QString("%1Filter").arg(prefix), textfilter);
245 }
246 
248 {
249  bool matches = true;
250 
251  //textfilter
252  if (!textfilter.isEmpty())
253  {
254  matches = false;
255  matches = (matches ||
256  mdata.GetTitle().contains(textfilter, Qt::CaseInsensitive));
257  matches = (matches ||
258  mdata.GetSubtitle().contains(textfilter, Qt::CaseInsensitive));
259  matches = (matches ||
260  mdata.GetPlot().contains(textfilter, Qt::CaseInsensitive));
261  }
262  //search for season with optionally episode nr.
263  if (matches && (season != -1))
264  {
265  matches = (season == mdata.GetSeason());
266  matches = (matches && (episode == -1 || episode == mdata.GetEpisode()));
267  }
268  if (matches && insertdate.isValid())
269  {
270  matches = (mdata.GetInsertdate().isValid() &&
271  mdata.GetInsertdate() >= insertdate);
272  }
273  if (matches && (genre != kGenreFilterAll))
274  {
275  matches = false;
276 
277  const VideoMetadata::genre_list &gl = mdata.GetGenres();
278  for (VideoMetadata::genre_list::const_iterator p = gl.begin();
279  p != gl.end(); ++p)
280  {
281  if ((matches = (p->first == genre)))
282  {
283  break;
284  }
285  }
286  }
287 
288  if (matches && country != kCountryFilterAll)
289  {
290  matches = false;
291 
292  const VideoMetadata::country_list &cl = mdata.GetCountries();
293  for (VideoMetadata::country_list::const_iterator p = cl.begin();
294  p != cl.end(); ++p)
295  {
296  if ((matches = (p->first == country)))
297  {
298  break;
299  }
300  }
301  }
302 
303  if (matches && cast != kCastFilterAll)
304  {
305  const VideoMetadata::cast_list &cl = mdata.GetCast();
306 
307  if ((cast == kCastFilterUnknown) && (cl.size() == 0))
308  {
309  matches = true;
310  }
311  else
312  {
313  matches = false;
314 
315  for (VideoMetadata::cast_list::const_iterator p = cl.begin();
316  p != cl.end(); ++p)
317  {
318  if ((matches = (p->first == cast)))
319  {
320  break;
321  }
322  }
323  }
324  }
325 
326  if (matches && category != kCategoryFilterAll)
327  {
328  matches = (category == mdata.GetCategoryID());
329  }
330 
331  if (matches && year != kYearFilterAll)
332  {
333  if (year == kYearFilterUnknown)
334  {
335  matches = ((mdata.GetYear() == 0) ||
336  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
337  }
338  else
339  {
340  matches = (year == mdata.GetYear());
341  }
342  }
343 
344  if (matches && runtime != kRuntimeFilterAll)
345  {
347  {
348  matches = (mdata.GetLength() == 0);
349  }
350  else
351  {
352  matches = (runtime == (mdata.GetLength() / 30));
353  }
354  }
355 
356  if (matches && userrating != kUserRatingFilterAll)
357  {
358  matches = (mdata.GetUserRating() >= userrating);
359  }
360 
361  if (matches && browse != kBrowseFilterAll)
362  {
363  matches = (mdata.GetBrowse() == browse);
364  }
365 
366  if (matches && watched != kWatchedFilterAll)
367  {
368  matches = (mdata.GetWatched() == watched);
369  }
370 
371  if (matches && m_inetref != kInetRefFilterAll)
372  {
373  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
374  }
375 
376  if (matches && m_coverfile != kCoverFileFilterAll)
377  {
378  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
379  }
380 
381  if (matches && m_parental_level)
382  {
383  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
384  (mdata.GetShowLevel() <= m_parental_level));
385  }
386 
387  return matches;
388 }
389 
392  const VideoMetadata &rhs) const
393 {
394  bool ret = false;
395  switch (orderby)
396  {
397  case kOrderByTitle:
398  {
399  ret = lhs.sortBefore(rhs);
400  break;
401  }
402  case kOrderBySeasonEp:
403  {
404  if ((lhs.GetSeason() == rhs.GetSeason())
405  && (lhs.GetEpisode() == rhs.GetEpisode())
406  && (lhs.GetSeason() == 0)
407  && (rhs.GetSeason() == 0)
408  && (lhs.GetEpisode() == 0)
409  && (rhs.GetEpisode() == 0))
410  {
411  ret = lhs.sortBefore(rhs);
412  }
413  else if ((lhs.GetSeason() == rhs.GetSeason())
414  && (lhs.GetTitle() == rhs.GetTitle()))
415  ret = (lhs.GetEpisode() < rhs.GetEpisode());
416  else
417  ret = (lhs.GetSeason() < rhs.GetSeason());
418  break;
419  }
421  {
422  ret = (lhs.GetYear() > rhs.GetYear());
423  break;
424  }
426  {
427  ret = (lhs.GetUserRating() > rhs.GetUserRating());
428  break;
429  }
430  case kOrderByLength:
431  {
432  ret = (lhs.GetLength() < rhs.GetLength());
433  break;
434  }
435  case kOrderByFilename:
436  {
437  QString lhsfn = lhs.GetSortFilename();
438  QString rhsfn = rhs.GetSortFilename();
439  ret = naturalCompare(lhsfn, rhsfn) < 0;
440  break;
441  }
442  case kOrderByID:
443  {
444  ret = (lhs.GetID() < rhs.GetID());
445  break;
446  }
448  {
449  ret = (lhs.GetInsertdate() > rhs.GetInsertdate());
450  break;
451  }
452  default:
453  {
454  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
455  .arg(orderby));
456  }
457  }
458 
459  return ret;
460 }
461 
463 {
465  if (re_season.indexIn(val) != -1)
466  {
467  bool res;
468  QStringList list = re_season.capturedTexts();
469  season = list[1].toInt(&res);
470  if (!res)
471  season = -1;
472  if (list.size() > 2) {
473  episode = list[2].toInt(&res);
474  if (!res)
475  episode = -1;
476  }
477  else {
478  episode = -1;
479  }
480  //clear \dX\d from string for string-search in plot/title/subtitle
481  textfilter = val;
482  textfilter.replace(re_season, "");
483  textfilter = textfilter.simplified ();
484  }
485  else
486  {
487  textfilter = val;
488  season = -1;
489  episode = -1;
490  }
491  if (re_date.indexIn(textfilter) != -1)
492  {
493  QStringList list = re_date.capturedTexts();
494  int modnr = list[1].toInt();
495  QDate testdate = MythDate::current().date();
496  switch(list[2].at(0).toLatin1())
497  {
498  case 'm': testdate = testdate.addMonths(-modnr);break;
499  case 'd': testdate = testdate.addDays(-modnr);break;
500  case 'w': testdate = testdate.addDays(-modnr * 7);break;
501  }
502  insertdate = testdate;
503  textfilter.replace(re_date, "");
504  textfilter = textfilter.simplified ();
505  }
506  else
507  {
508  //reset testdate
509  insertdate = QDate();
510  }
511 }
512 
514 // VideoFilterDialog
517  VideoList *video_list) : MythScreenType(lparent, lname),
518  m_browseList(nullptr), m_watchedList(nullptr), m_orderbyList(nullptr), m_yearList(nullptr),
519  m_userratingList(nullptr), m_categoryList(nullptr), m_countryList(nullptr), m_genreList(nullptr),
520  m_castList(nullptr), m_runtimeList(nullptr), m_inetrefList(nullptr), m_coverfileList(nullptr),
521  m_saveButton(nullptr), m_doneButton(nullptr), m_numvideosText(nullptr), m_textfilter(nullptr),
522  m_videoList(*video_list)
523 {
524  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
526 }
527 
529 {
530  delete m_fsp;
531 }
532 
534 {
535  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
536  return false;
537 
538  bool err = false;
539  UIUtilE::Assign(this, m_textfilter, "textfilter_input", &err);
540  UIUtilE::Assign(this, m_yearList, "year_select", &err);
541  UIUtilE::Assign(this, m_userratingList, "userrating_select", &err);
542  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
543  UIUtilE::Assign(this, m_countryList, "country_select", &err);
544  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
545  UIUtilE::Assign(this, m_castList, "cast_select", &err);
546  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
547  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
548  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
549  UIUtilE::Assign(this, m_inetrefList, "inetref_select", &err);
550  UIUtilE::Assign(this, m_coverfileList, "coverfile_select", &err);
551  UIUtilE::Assign(this, m_orderbyList, "orderby_select", &err);
552 
553  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
554  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
555 
556  UIUtilE::Assign(this, m_numvideosText, "numvideos_text", &err);
557 
558  if (err)
559  {
560  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
561  return false;
562  }
563 
564  BuildFocusList();
565 
566  fillWidgets();
567  update_numvideo();
568 
569  connect(m_yearList, SIGNAL(itemSelected(MythUIButtonListItem*)),
570  SLOT(SetYear(MythUIButtonListItem*)));
571  connect(m_userratingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
573  connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
575  connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
577  connect(m_genreList,SIGNAL(itemSelected(MythUIButtonListItem*)),
579  connect(m_castList,SIGNAL(itemSelected(MythUIButtonListItem*)),
580  SLOT(SetCast(MythUIButtonListItem*)));
581  connect(m_runtimeList, SIGNAL(itemSelected(MythUIButtonListItem*)),
583  connect(m_browseList, SIGNAL(itemSelected(MythUIButtonListItem*)),
585  connect(m_watchedList, SIGNAL(itemSelected(MythUIButtonListItem*)),
587  connect(m_inetrefList, SIGNAL(itemSelected(MythUIButtonListItem*)),
589  connect(m_coverfileList, SIGNAL(itemSelected(MythUIButtonListItem*)),
591  connect(m_orderbyList, SIGNAL(itemSelected(MythUIButtonListItem*)),
593  connect(m_textfilter, SIGNAL(valueChanged()),
594  SLOT(setTextFilter()));
595 
596  connect(m_saveButton, SIGNAL(Clicked()), SLOT(saveAsDefault()));
597  connect(m_doneButton, SIGNAL(Clicked()), SLOT(saveAndExit()));
598 
599  return true;
600 }
601 
603 {
604  int video_count = m_videoList.TryFilter(m_settings);
605 
606  if (video_count > 0)
607  {
608  m_numvideosText->SetText(tr("Result of this filter : %n video(s)", "",
609  video_count));
610  }
611  else
612  {
613  m_numvideosText->SetText(tr("Result of this filter : No Videos"));
614  }
615 }
616 
618 {
619  bool have_unknown_year = false;
620  bool have_unknown_runtime = false;
621 
622  typedef std::set<int> int_list;
623  int_list years;
624  int_list runtimes;
625  int_list user_ratings;
626 
629  for (VideoMetadataListManager::metadata_list::const_iterator p = mdl.begin();
630  p != mdl.end(); ++p)
631  {
632  int year = (*p)->GetYear();
633  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
634  have_unknown_year = true;
635  else
636  years.insert(year);
637 
638  int runtime = (*p)->GetLength();
639  if (runtime == 0)
640  have_unknown_runtime = true;
641  else
642  runtimes.insert(runtime / 30);
643 
644  user_ratings.insert(static_cast<int>((*p)->GetUserRating()));
645  }
646 
647  // Category
648  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
650 
651  const VideoCategory::entry_list &vcl =
653  for (VideoCategory::entry_list::const_iterator p = vcl.begin();
654  p != vcl.end(); ++p)
655  {
656  new MythUIButtonListItem(m_categoryList, p->second, p->first);
657  }
658 
662 
663  // Genre
664  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
665 
667  for (VideoGenre::entry_list::const_iterator p = gl.begin();
668  p != gl.end(); ++p)
669  {
670  new MythUIButtonListItem(m_genreList, p->second, p->first);
671  }
672 
675 
676  // Cast
677  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
678 
680  for (VideoCast::entry_list::const_iterator p = cl.begin();
681  p != cl.end(); ++p)
682  {
683  new MythUIButtonListItem(m_castList, p->second, p->first);
684  }
685 
688 
689  // Country
690  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
691 
693  for (VideoCountry::entry_list::const_iterator p = cnl.begin();
694  p != cnl.end(); ++p)
695  {
696  new MythUIButtonListItem(m_countryList, p->second, p->first);
697  }
698 
702 
703  // Year
704  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
705 
706  for (int_list::const_reverse_iterator p = years.rbegin();
707  p != years.rend(); ++p)
708  {
709  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
710  }
711 
712  if (have_unknown_year)
715 
717 
718  // Runtime
719  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
720 
721  if (have_unknown_runtime)
724 
725  for (int_list::const_iterator p = runtimes.begin();
726  p != runtimes.end(); ++p)
727  {
728  QString s = QString("%1 %2 ~ %3 %4").arg(*p * 30).arg(tr("minutes"))
729  .arg((*p + 1) * 30).arg(tr("minutes"));
731  }
732 
734 
735  // User Rating
736  new MythUIButtonListItem(m_userratingList, tr("All", "User rating"),
738 
739  for (int_list::const_reverse_iterator p = user_ratings.rbegin();
740  p != user_ratings.rend(); ++p)
741  {
743  QString(">= %1").arg(QString::number(*p)),
744  *p);
745  }
746 
748 
749  // Browsable
750  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
753  QCoreApplication::translate("(Common)", "Yes"), qVariantFromValue(1));
755  QCoreApplication::translate("(Common)", "No"), qVariantFromValue(0));
757 
758  // Watched
759  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
762  QCoreApplication::translate("(Common)", "Yes"), qVariantFromValue(1));
764  QCoreApplication::translate("(Common)", "No"), qVariantFromValue(0));
766 
767  // Inet Reference
768  new MythUIButtonListItem(m_inetrefList, tr("All", "Inet reference"),
770  new MythUIButtonListItem(m_inetrefList, tr("Unknown", "Inet reference"),
773 
774  // Coverfile
775  new MythUIButtonListItem(m_coverfileList, tr("All", "Cover file"),
777  new MythUIButtonListItem(m_coverfileList, tr("None", "Cover file"),
780 
781  // Order by
783  QCoreApplication::translate("(Common)", "Title"),
786  QCoreApplication::translate("(Common)", "Season/Episode"),
789  QCoreApplication::translate("(Common)", "Year"),
792  QCoreApplication::translate("(Common)", "User Rating"),
795  QCoreApplication::translate("(Common)", "Runtime"),
798  QCoreApplication::translate("(Common)", "Filename"),
800  new MythUIButtonListItem(m_orderbyList, tr("Video ID"),
802  new MythUIButtonListItem(m_orderbyList, tr("Date Added"),
805 
806  // Text Filter
808 }
809 
811 {
813  saveAndExit();
814 }
815 
817 {
819 
820  if (m_settings.getChangedState() > 0)
821  emit filterChanged();
822  Close();
823 }
824 
826 {
827  int new_year = item->GetData().toInt();
828  m_settings.SetYear(new_year);
829  update_numvideo();
830 }
831 
833 {
834  m_settings.SetUserRating(item->GetData().toInt());
835  update_numvideo();
836 }
837 
839 {
840  m_settings.SetCategory(item->GetData().toInt());
841  update_numvideo();
842 }
843 
845 {
846  m_settings.setCountry(item->GetData().toInt());
847  update_numvideo();
848 }
849 
851 {
852  m_settings.setGenre(item->GetData().toInt());
853  update_numvideo();
854 }
855 
857 {
858  m_settings.SetCast(item->GetData().toInt());
859  update_numvideo();
860 }
861 
863 {
864  m_settings.setRuntime(item->GetData().toInt());
865  update_numvideo();
866 }
867 
869 {
870  m_settings.SetBrowse(item->GetData().toInt());
871  update_numvideo();
872 }
873 
875 {
876  m_settings.SetWatched(item->GetData().toInt());
877  update_numvideo();
878 }
879 
881 {
882  m_settings.SetInetRef(item->GetData().toInt());
883  update_numvideo();
884 }
885 
887 {
888  m_settings.SetCoverFile(item->GetData().toInt());
889  update_numvideo();
890 }
891 
893 {
894  m_settings
896  update_numvideo();
897 }
898 
900 {
902  update_numvideo();
903 }
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:150
int getRuntime() const
Definition: videofilter.h:104
int GetLength() const
const QString & GetSortFilename() const
UserRatingFilter
Definition: videofilter.cpp:49
bool GetWatched() const
CategoryFilter
Definition: videofilter.cpp:34
void SetUserRating(int luserrating)
Definition: videofilter.h:112
MythUIButton * m_saveButton
Definition: videofilter.h:271
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:273
void SetCategory(int lcategory)
Definition: videofilter.h:70
MythUIButton * m_doneButton
Definition: videofilter.h:272
int GetCoverFile() const
Definition: videofilter.h:156
const VideoMetadataListManager & getListCache() const
Definition: videolist.cpp:511
void setGenre(MythUIButtonListItem *item)
VideoFilterSettings(bool loaddefaultsettings=true, const QString &_prefix="")
Definition: videofilter.cpp:71
MythUIButtonList * m_coverfileList
Definition: videofilter.h:270
void SaveSetting(const QString &key, int newValue)
const QString VIDEO_COUNTRY_UNKNOWN
Definition: globals.cpp:13
void setGenre(int lgenre)
Definition: videofilter.h:77
void SetBrowse(int lbrowse)
Definition: videofilter.h:119
const QString VIDEO_CAST_UNKNOWN
Definition: globals.cpp:19
int getYear() const
Definition: videofilter.h:97
MythUIButtonList * m_orderbyList
Definition: videofilter.h:261
MythUIButtonList * m_genreList
Definition: videofilter.h:266
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:168
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:500
std::vector< country_entry > country_list
Definition: videometadata.h:33
void setCountry(int lcountry)
Definition: videofilter.h:91
const QRegExp re_date
Definition: videofilter.h:190
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:276
MythUITextEdit * m_textfilter
Definition: videofilter.h:274
int GetCast() const
Definition: videofilter.h:83
void BuildFocusList(void)
unsigned int GetID() const
GenreFilter
Definition: videofilter.cpp:19
unsigned int m_changed_state
Definition: videofilter.h:192
std::vector< entry > entry_list
Definition: dbaccess.h:15
MythUIButtonList * m_browseList
Definition: videofilter.h:259
int getCountry() const
Definition: videofilter.h:90
int getInteRef() const
Definition: videofilter.h:149
virtual void Close()
ParentalLevel::Level GetShowLevel() const
int GetYear() const
MythUIButtonList * m_userratingList
Definition: videofilter.h:263
bool Create() override
int GetBrowse() const
Definition: videofilter.h:118
CountryFilter
Definition: videofilter.cpp:24
static VideoCountry & getCountry()
Definition: dbaccess.cpp:514
void SetValueByData(QVariant data)
MythUIButtonList * m_runtimeList
Definition: videofilter.h:268
float GetUserRating() const
void SetCoverFile(int coverfile)
Definition: videofilter.h:157
const QString & GetPlot() const
void setRunTime(MythUIButtonListItem *item)
RuntimeFilter
Definition: videofilter.cpp:44
void SetWatched(int lwatched)
Definition: videofilter.h:126
int GetEpisode() const
void SetBrowse(MythUIButtonListItem *item)
void SetUserRating(MythUIButtonListItem *item)
YearFilter
Definition: videofilter.cpp:39
const QString VIDEO_GENRE_UNKNOWN
Definition: globals.cpp:11
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
Definition: mythdate.cpp:10
VideoFilterDialog(MythScreenStack *lparent, QString lname, VideoList *video_list)
bool sortBefore(const VideoMetadata &rhs) const
MythUIButtonList * m_yearList
Definition: videofilter.h:262
void SetYear(int lyear)
Definition: videofilter.h:98
MythUIButtonList * m_countryList
Definition: videofilter.h:265
void SetYear(MythUIButtonListItem *item)
void setRuntime(int lruntime)
Definition: videofilter.h:105
MythUIButtonList * m_inetrefList
Definition: videofilter.h:269
WatchedFilter
Definition: videofilter.cpp:57
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
CastFilter
Definition: videofilter.cpp:29
CoverFileFilter
Definition: videofilter.cpp:66
std::vector< genre_entry > genre_list
Definition: videometadata.h:32
int GetCategoryID() const
void setTextFilter(QString val)
static VideoCast & GetCast()
Definition: dbaccess.cpp:542
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:76
int TryFilter(const VideoFilterSettings &filter) const
Definition: videolist.cpp:506
int GetCategory() const
Definition: videofilter.h:69
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:257
const QString VIDEO_INETREF_DEFAULT
Definition: globals.cpp:24
const entry_list & getList()
Definition: dbaccess.cpp:246
BrowseFilter
Definition: videofilter.cpp:53
const QRegExp re_season
Definition: videofilter.h:189
MythUIButtonList * m_categoryList
Definition: videofilter.h:264
static VideoGenre & getGenre()
Definition: dbaccess.cpp:528
bool GetBrowse() const
FilterSettingsProxy * m_fsp
Definition: videofilter.h:277
void setCountry(MythUIButtonListItem *item)
const QString & GetSubtitle() const
const QString & GetCoverFile() const
int GetUserRating() const
Definition: videofilter.h:111
MythUIButtonList * m_castList
Definition: videofilter.h:267
const genre_list & GetGenres() const
unsigned int getChangedState()
Definition: videofilter.h:163
Screen in which all other widgets are contained and rendered.
const QString & GetInetRef() const
const QString & GetTitle() const
int GetWatched() const
Definition: videofilter.h:125
int naturalCompare(const QString &_a, const QString &_b, Qt::CaseSensitivity caseSensitivity)
ordering getOrderby() const
Definition: videofilter.h:132
ParentalLevel::Level m_parental_level
Definition: videofilter.h:183
void SetCast(int lcast)
Definition: videofilter.h:84
const QString VIDEO_RUNTIME_UNKNOWN
Definition: globals.cpp:17
QString getTextFilter() const
Definition: videofilter.h:139
MythUIButtonList * m_watchedList
Definition: videofilter.h:260
VideoFilterSettings & operator=(const VideoFilterSettings &rhs)
void SetWatched(MythUIButtonListItem *item)
void SetInetRef(MythUIButtonListItem *item)
QString GetText(void) const
void setOrderby(ordering lorderby)
Definition: videofilter.h:133
InetRefFilter
Definition: videofilter.cpp:61