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 (auto p = gl.cbegin(); p != gl.cend(); ++p)
217  {
218  if ((matches = (p->first == m_genre)))
219  {
220  break;
221  }
222  }
223  }
224 
225  if (matches && m_country != kCountryFilterAll)
226  {
227  matches = false;
228 
229  const VideoMetadata::country_list &cl = mdata.GetCountries();
230  for (auto p = cl.cbegin(); p != cl.cend(); ++p)
231  {
232  if ((matches = (p->first == m_country)))
233  {
234  break;
235  }
236  }
237  }
238 
239  if (matches && m_cast != kCastFilterAll)
240  {
241  const VideoMetadata::cast_list &cl = mdata.GetCast();
242 
243  if ((m_cast == kCastFilterUnknown) && (cl.empty()))
244  {
245  matches = true;
246  }
247  else
248  {
249  matches = false;
250 
251  for (auto p = cl.cbegin(); p != cl.cend(); ++p)
252  {
253  if ((matches = (p->first == m_cast)))
254  {
255  break;
256  }
257  }
258  }
259  }
260 
261  if (matches && m_category != kCategoryFilterAll)
262  {
263  matches = (m_category == mdata.GetCategoryID());
264  }
265 
266  if (matches && m_year != kYearFilterAll)
267  {
268  if (m_year == kYearFilterUnknown)
269  {
270  matches = ((mdata.GetYear() == 0) ||
271  (mdata.GetYear() == VIDEO_YEAR_DEFAULT));
272  }
273  else
274  {
275  matches = (m_year == mdata.GetYear());
276  }
277  }
278 
279  if (matches && m_runtime != kRuntimeFilterAll)
280  {
282  {
283  matches = (mdata.GetLength() == 0);
284  }
285  else
286  {
287  matches = (m_runtime == (mdata.GetLength() / 30));
288  }
289  }
290 
291  if (matches && m_userrating != kUserRatingFilterAll)
292  {
293  matches = (mdata.GetUserRating() >= m_userrating);
294  }
295 
296  if (matches && m_browse != kBrowseFilterAll)
297  {
298  matches = (mdata.GetBrowse() == m_browse);
299  }
300 
301  if (matches && m_watched != kWatchedFilterAll)
302  {
303  matches = (mdata.GetWatched() == m_watched);
304  }
305 
306  if (matches && m_inetref != kInetRefFilterAll)
307  {
308  matches = (mdata.GetInetRef() == VIDEO_INETREF_DEFAULT);
309  }
310 
311  if (matches && m_coverfile != kCoverFileFilterAll)
312  {
313  matches = (IsDefaultCoverFile(mdata.GetCoverFile()));
314  }
315 
316  if (matches && m_parental_level)
317  {
318  matches = ((mdata.GetShowLevel() != ParentalLevel::plNone) &&
319  (mdata.GetShowLevel() <= m_parental_level));
320  }
321 
322  return matches;
323 }
324 
327  const VideoMetadata &rhs) const
328 {
329  bool ret = false;
330  switch (m_orderby)
331  {
332  case kOrderByTitle:
333  {
334  ret = lhs.sortBefore(rhs);
335  break;
336  }
337  case kOrderBySeasonEp:
338  {
339  if ((lhs.GetSeason() == rhs.GetSeason())
340  && (lhs.GetEpisode() == rhs.GetEpisode())
341  && (lhs.GetSeason() == 0)
342  && (rhs.GetSeason() == 0)
343  && (lhs.GetEpisode() == 0)
344  && (rhs.GetEpisode() == 0))
345  {
346  ret = lhs.sortBefore(rhs);
347  }
348  else if ((lhs.GetSeason() == rhs.GetSeason())
349  && (lhs.GetTitle() == rhs.GetTitle()))
350  ret = (lhs.GetEpisode() < rhs.GetEpisode());
351  else
352  ret = (lhs.GetSeason() < rhs.GetSeason());
353  break;
354  }
356  {
357  ret = (lhs.GetYear() > rhs.GetYear());
358  break;
359  }
361  {
362  ret = (lhs.GetUserRating() > rhs.GetUserRating());
363  break;
364  }
365  case kOrderByLength:
366  {
367  ret = (lhs.GetLength() < rhs.GetLength());
368  break;
369  }
370  case kOrderByFilename:
371  {
372  const QString& lhsfn = lhs.GetSortFilename();
373  const QString& rhsfn = rhs.GetSortFilename();
374  ret = naturalCompare(lhsfn, rhsfn) < 0;
375  break;
376  }
377  case kOrderByID:
378  {
379  ret = (lhs.GetID() < rhs.GetID());
380  break;
381  }
383  {
384  ret = (lhs.GetInsertdate() > rhs.GetInsertdate());
385  break;
386  }
387  default:
388  {
389  LOG(VB_GENERAL, LOG_ERR, QString("Error: unknown sort type %1")
390  .arg(m_orderby));
391  }
392  }
393 
394  return ret;
395 }
396 
397 void VideoFilterSettings::setTextFilter(const QString& val)
398 {
400  if (m_re_season.indexIn(val) != -1)
401  {
402  bool res = false;
403  QStringList list = m_re_season.capturedTexts();
404  m_season = list[1].toInt(&res);
405  if (!res)
406  m_season = -1;
407  if (list.size() > 2) {
408  m_episode = list[2].toInt(&res);
409  if (!res)
410  m_episode = -1;
411  }
412  else {
413  m_episode = -1;
414  }
415  //clear \dX\d from string for string-search in plot/title/subtitle
416  m_textfilter = val;
417  m_textfilter.replace(m_re_season, "");
418  m_textfilter = m_textfilter.simplified ();
419  }
420  else
421  {
422  m_textfilter = val;
423  m_season = -1;
424  m_episode = -1;
425  }
426  if (m_re_date.indexIn(m_textfilter) != -1)
427  {
428  QStringList list = m_re_date.capturedTexts();
429  int modnr = list[1].toInt();
430  QDate testdate = MythDate::current().date();
431  switch(list[2].at(0).toLatin1())
432  {
433  case 'm': testdate = testdate.addMonths(-modnr);break;
434  case 'd': testdate = testdate.addDays(-modnr);break;
435  case 'w': testdate = testdate.addDays(-modnr * 7);break;
436  }
437  m_insertdate = testdate;
438  m_textfilter.replace(m_re_date, "");
439  m_textfilter = m_textfilter.simplified ();
440  }
441  else
442  {
443  //reset testdate
444  m_insertdate = QDate();
445  }
446 }
447 
449 // VideoFilterDialog
452  VideoList *video_list) : MythScreenType(lparent, lname),
453  m_videoList(*video_list)
454 {
455  m_fsp = new BasicFilterSettingsProxy<VideoList>(*video_list);
457 }
458 
460 {
461  delete m_fsp;
462 }
463 
465 {
466  if (!LoadWindowFromXML("video-ui.xml", "filter", this))
467  return false;
468 
469  bool err = false;
470  UIUtilE::Assign(this, m_textfilter, "textfilter_input", &err);
471  UIUtilE::Assign(this, m_yearList, "year_select", &err);
472  UIUtilE::Assign(this, m_userratingList, "userrating_select", &err);
473  UIUtilE::Assign(this, m_categoryList, "category_select", &err);
474  UIUtilE::Assign(this, m_countryList, "country_select", &err);
475  UIUtilE::Assign(this, m_genreList, "genre_select", &err);
476  UIUtilE::Assign(this, m_castList, "cast_select", &err);
477  UIUtilE::Assign(this, m_runtimeList, "runtime_select", &err);
478  UIUtilE::Assign(this, m_browseList, "browse_select", &err);
479  UIUtilE::Assign(this, m_watchedList, "watched_select", &err);
480  UIUtilE::Assign(this, m_inetrefList, "inetref_select", &err);
481  UIUtilE::Assign(this, m_coverfileList, "coverfile_select", &err);
482  UIUtilE::Assign(this, m_orderbyList, "orderby_select", &err);
483 
484  UIUtilE::Assign(this, m_doneButton, "done_button", &err);
485  UIUtilE::Assign(this, m_saveButton, "save_button", &err);
486 
487  UIUtilE::Assign(this, m_numvideosText, "numvideos_text", &err);
488 
489  if (err)
490  {
491  LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'filter'");
492  return false;
493  }
494 
495  BuildFocusList();
496 
497  fillWidgets();
498  update_numvideo();
499 
500  connect(m_yearList, SIGNAL(itemSelected(MythUIButtonListItem*)),
501  SLOT(SetYear(MythUIButtonListItem*)));
502  connect(m_userratingList, SIGNAL(itemSelected(MythUIButtonListItem*)),
504  connect(m_categoryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
506  connect(m_countryList, SIGNAL(itemSelected(MythUIButtonListItem*)),
508  connect(m_genreList,SIGNAL(itemSelected(MythUIButtonListItem*)),
510  connect(m_castList,SIGNAL(itemSelected(MythUIButtonListItem*)),
511  SLOT(SetCast(MythUIButtonListItem*)));
512  connect(m_runtimeList, SIGNAL(itemSelected(MythUIButtonListItem*)),
514  connect(m_browseList, SIGNAL(itemSelected(MythUIButtonListItem*)),
516  connect(m_watchedList, SIGNAL(itemSelected(MythUIButtonListItem*)),
518  connect(m_inetrefList, SIGNAL(itemSelected(MythUIButtonListItem*)),
520  connect(m_coverfileList, SIGNAL(itemSelected(MythUIButtonListItem*)),
522  connect(m_orderbyList, SIGNAL(itemSelected(MythUIButtonListItem*)),
524  connect(m_textfilter, SIGNAL(valueChanged()),
525  SLOT(setTextFilter()));
526 
527  connect(m_saveButton, SIGNAL(Clicked()), SLOT(saveAsDefault()));
528  connect(m_doneButton, SIGNAL(Clicked()), SLOT(saveAndExit()));
529 
530  return true;
531 }
532 
534 {
535  int video_count = m_videoList.TryFilter(m_settings);
536 
537  if (video_count > 0)
538  {
539  m_numvideosText->SetText(tr("Result of this filter : %n video(s)", "",
540  video_count));
541  }
542  else
543  {
544  m_numvideosText->SetText(tr("Result of this filter : No Videos"));
545  }
546 }
547 
549 {
550  bool have_unknown_year = false;
551  bool have_unknown_runtime = false;
552 
553  using int_list = std::set<int>;
554  int_list years;
555  int_list runtimes;
556  int_list user_ratings;
557 
560  for (auto p = mdl.cbegin(); p != mdl.cend(); ++p)
561  {
562  int year = (*p)->GetYear();
563  if ((year == 0) || (year == VIDEO_YEAR_DEFAULT))
564  have_unknown_year = true;
565  else
566  years.insert(year);
567 
568  int runtime = (*p)->GetLength();
569  if (runtime == 0)
570  have_unknown_runtime = true;
571  else
572  runtimes.insert(runtime / 30);
573 
574  user_ratings.insert(static_cast<int>((*p)->GetUserRating()));
575  }
576 
577  // Category
578  new MythUIButtonListItem(m_categoryList, tr("All", "Category"),
580 
581  const VideoCategory::entry_list &vcl =
583  for (auto p = vcl.cbegin(); p != vcl.cend(); ++p)
584  {
585  new MythUIButtonListItem(m_categoryList, p->second, p->first);
586  }
587 
591 
592  // Genre
593  new MythUIButtonListItem(m_genreList, tr("All", "Genre"), kGenreFilterAll);
594 
596  for (auto p = gl.cbegin(); p != gl.cend(); ++p)
597  {
598  new MythUIButtonListItem(m_genreList, p->second, p->first);
599  }
600 
603 
604  // Cast
605  new MythUIButtonListItem(m_castList, tr("All", "Cast"), kCastFilterAll);
606 
608  for (auto p = cl.cbegin(); p != cl.cend(); ++p)
609  {
610  new MythUIButtonListItem(m_castList, p->second, p->first);
611  }
612 
615 
616  // Country
617  new MythUIButtonListItem(m_countryList, tr("All", "Country"), kCountryFilterAll);
618 
620  for (auto p = cnl.cbegin(); p != cnl.cend(); ++p)
621  {
622  new MythUIButtonListItem(m_countryList, p->second, p->first);
623  }
624 
628 
629  // Year
630  new MythUIButtonListItem(m_yearList, tr("All", "Year"), kYearFilterAll);
631 
632  for (auto p = years.crbegin(); p != years.crend(); ++p)
633  {
634  new MythUIButtonListItem(m_yearList, QString::number(*p), *p);
635  }
636 
637  if (have_unknown_year)
640 
642 
643  // Runtime
644  new MythUIButtonListItem(m_runtimeList, tr("All", "Runtime"), kRuntimeFilterAll);
645 
646  if (have_unknown_runtime)
649 
650  for (auto p = runtimes.cbegin(); p != runtimes.cend(); ++p)
651  {
652  QString s = QString("%1 %2 ~ %3 %4").arg(*p * 30).arg(tr("minutes"))
653  .arg((*p + 1) * 30).arg(tr("minutes"));
655  }
656 
658 
659  // User Rating
660  new MythUIButtonListItem(m_userratingList, tr("All", "User rating"),
662 
663  for (auto p = user_ratings.crbegin(); p != user_ratings.crend(); ++p)
664  {
666  QString(">= %1").arg(QString::number(*p)),
667  *p);
668  }
669 
671 
672  // Browsable
673  new MythUIButtonListItem(m_browseList, tr("All", "Browsable"),
676  QCoreApplication::translate("(Common)", "Yes"), qVariantFromValue(1));
678  QCoreApplication::translate("(Common)", "No"), qVariantFromValue(0));
680 
681  // Watched
682  new MythUIButtonListItem(m_watchedList, tr("All", "Watched"),
685  QCoreApplication::translate("(Common)", "Yes"), qVariantFromValue(1));
687  QCoreApplication::translate("(Common)", "No"), qVariantFromValue(0));
689 
690  // Inet Reference
691  new MythUIButtonListItem(m_inetrefList, tr("All", "Inet reference"),
693  new MythUIButtonListItem(m_inetrefList, tr("Unknown", "Inet reference"),
696 
697  // Coverfile
698  new MythUIButtonListItem(m_coverfileList, tr("All", "Cover file"),
700  new MythUIButtonListItem(m_coverfileList, tr("None", "Cover file"),
703 
704  // Order by
706  QCoreApplication::translate("(Common)", "Title"),
709  QCoreApplication::translate("(Common)", "Season/Episode"),
712  QCoreApplication::translate("(Common)", "Year"),
715  QCoreApplication::translate("(Common)", "User Rating"),
718  QCoreApplication::translate("(Common)", "Runtime"),
721  QCoreApplication::translate("(Common)", "Filename"),
723  new MythUIButtonListItem(m_orderbyList, tr("Video ID"),
725  new MythUIButtonListItem(m_orderbyList, tr("Date Added"),
728 
729  // Text Filter
731 }
732 
734 {
736  saveAndExit();
737 }
738 
740 {
742 
743  if (m_settings.getChangedState() > 0)
744  emit filterChanged();
745  Close();
746 }
747 
749 {
750  int new_year = item->GetData().toInt();
751  m_settings.SetYear(new_year);
752  update_numvideo();
753 }
754 
756 {
757  m_settings.SetUserRating(item->GetData().toInt());
758  update_numvideo();
759 }
760 
762 {
763  m_settings.SetCategory(item->GetData().toInt());
764  update_numvideo();
765 }
766 
768 {
769  m_settings.setCountry(item->GetData().toInt());
770  update_numvideo();
771 }
772 
774 {
775  m_settings.setGenre(item->GetData().toInt());
776  update_numvideo();
777 }
778 
780 {
781  m_settings.SetCast(item->GetData().toInt());
782  update_numvideo();
783 }
784 
786 {
787  m_settings.setRuntime(item->GetData().toInt());
788  update_numvideo();
789 }
790 
792 {
793  m_settings.SetBrowse(item->GetData().toInt());
794  update_numvideo();
795 }
796 
798 {
799  m_settings.SetWatched(item->GetData().toInt());
800  update_numvideo();
801 }
802 
804 {
805  m_settings.SetInetRef(item->GetData().toInt());
806  update_numvideo();
807 }
808 
810 {
811  m_settings.SetCoverFile(item->GetData().toInt());
812  update_numvideo();
813 }
814 
816 {
817  m_settings
819  update_numvideo();
820 }
821 
823 {
825  update_numvideo();
826 }
void SetCategory(MythUIButtonListItem *item)
void SetCoverFile(MythUIButtonListItem *item)
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
std::vector< country_entry > country_list
Definition: videometadata.h:33
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:135
std::vector< cast_entry > cast_list
Definition: videometadata.h:34
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:488
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
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:502
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:530
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
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:240
MythUIButtonList * m_categoryList
Definition: videofilter.h:316
static VideoGenre & getGenre()
Definition: dbaccess.cpp:516
bool GetBrowse() const
std::vector< entry > entry_list
Definition: dbaccess.h:15
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)
std::list< VideoMetadataPtr > metadata_list
void setOrderby(ordering lorderby)
Definition: videofilter.h:185