MythTV master
editvideometadata.cpp
Go to the documentation of this file.
1// C++
2#include <algorithm>
3
4// Qt
5#include <QImageReader>
6#include <QUrl>
7
8// MythTV
33
34// MythFrontend
35#include "editvideometadata.h"
36
37//static const QString _Location = QObject::tr("Metadata Editor");
38
40 const QString& lname, VideoMetadata *source_metadata,
41 const VideoMetadataListManager &cache) : MythScreenType(lparent, lname),
42 m_origMetadata(source_metadata),
43 m_metaCache(cache),
44 m_query(new MetadataDownload(this)),
45 m_imageDownload(new MetadataImageDownload(this))
46{
48 m_popupStack = GetMythMainWindow()->GetStack("popup stack");
49}
50
52{
53 delete m_workingMetadata;
54}
55
57{
58 if (!LoadWindowFromXML("video-ui.xml", "edit_metadata", this))
59 return false;
60
61 bool err = false;
62 UIUtilE::Assign(this, m_titleEdit, "title_edit", &err);
63 UIUtilE::Assign(this, m_subtitleEdit, "subtitle_edit", &err);
64 UIUtilE::Assign(this, m_playerEdit, "player_edit", &err);
65
66 UIUtilE::Assign(this, m_seasonSpin, "season", &err);
67 UIUtilE::Assign(this, m_episodeSpin, "episode", &err);
68
69
70 UIUtilE::Assign(this, m_categoryList, "category_select", &err);
71 UIUtilE::Assign(this, m_levelList, "level_select", &err);
72 UIUtilE::Assign(this, m_childList, "child_select", &err);
73
74 UIUtilE::Assign(this, m_browseCheck, "browse_check", &err);
75 UIUtilE::Assign(this, m_watchedCheck, "watched_check", &err);
76
77 UIUtilE::Assign(this, m_doneButton, "done_button", &err);
78
79 if (err)
80 {
81 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'edit_metadata'");
82 return false;
83 }
84
85 UIUtilW::Assign(this, m_coverartText, "coverart_text");
86 UIUtilW::Assign(this, m_screenshotText, "screenshot_text");
87 UIUtilW::Assign(this, m_bannerText, "banner_text");
88 UIUtilW::Assign(this, m_fanartText, "fanart_text");
89 UIUtilW::Assign(this, m_trailerText, "trailer_text");
90
91 UIUtilW::Assign(this, m_coverartButton, "coverart_button");
92 UIUtilW::Assign(this, m_bannerButton, "banner_button");
93 UIUtilW::Assign(this, m_fanartButton, "fanart_button");
94 UIUtilW::Assign(this, m_screenshotButton, "screenshot_button");
95 UIUtilW::Assign(this, m_trailerButton, "trailer_button");
96
97 UIUtilW::Assign(this, m_netBannerButton, "net_banner_button");
98 UIUtilW::Assign(this, m_netFanartButton, "net_fanart_button");
99 UIUtilW::Assign(this, m_netScreenshotButton, "net_screenshot_button");
100 UIUtilW::Assign(this, m_netCoverartButton, "net_coverart_button");
101
102 UIUtilW::Assign(this, m_taglineEdit, "tagline_edit");
103 UIUtilW::Assign(this, m_ratingEdit, "rating_edit");
104 UIUtilW::Assign(this, m_directorEdit, "director_edit");
105 UIUtilW::Assign(this, m_inetrefEdit, "inetref_edit");
106 UIUtilW::Assign(this, m_homepageEdit, "homepage_edit");
107 UIUtilW::Assign(this, m_plotEdit, "description_edit");
108 UIUtilW::Assign(this, m_yearSpin, "year_spin");
109 UIUtilW::Assign(this, m_userRatingSpin, "userrating_spin");
110 UIUtilW::Assign(this, m_lengthSpin, "length_spin");
111
112 UIUtilW::Assign(this, m_coverart, "coverart");
113 UIUtilW::Assign(this, m_screenshot, "screenshot");
114 UIUtilW::Assign(this, m_banner, "banner");
115 UIUtilW::Assign(this, m_fanart, "fanart");
116
117 fillWidgets();
118
120
126 if (m_taglineEdit)
127 {
130 }
131 if (m_ratingEdit)
132 {
135 }
136 if (m_directorEdit)
137 {
140 }
141 if (m_inetrefEdit)
143 if (m_homepageEdit)
144 {
147 }
148 if (m_plotEdit)
149 {
152 }
153
156 if (m_yearSpin)
160 if (m_lengthSpin)
162
164
165 // Find Artwork locally
168 if (m_bannerButton)
170 if (m_fanartButton)
174
175 // Find Artwork on the Internet
184
185 if (m_trailerButton)
187
190
199
200 return true;
201}
202
203namespace
204{
205 template <typename T>
207 {
208 bool operator()(const T &lhs, const T &rhs)
209 {
210 return StringUtil::naturalSortCompare(lhs.second, rhs.second);
211 }
212 };
213
215 {
216 QStringList ret;
217
218 QList<QByteArray> exts = QImageReader::supportedImageFormats();
219 for (const auto & ext : std::as_const(exts))
220 ret.append(QString("*.").append(ext));
221 return ret;
222 }
223
224 void FindImagePopup(const QString &prefix, const QString &prefixAlt,
225 QObject &inst, const QString &returnEvent)
226 {
227 QString fp;
228
229 if (prefix.startsWith("myth://"))
230 fp = prefix;
231 else
232 fp = prefix.isEmpty() ? prefixAlt : prefix;
233
234 MythScreenStack *popupStack =
235 GetMythMainWindow()->GetStack("popup stack");
236
237 auto *fb = new MythUIFileBrowser(popupStack, fp);
238 fb->SetNameFilter(GetSupportedImageExtensionFilter());
239 if (fb->Create())
240 {
241 fb->SetReturnEvent(&inst, returnEvent);
242 popupStack->AddScreen(fb);
243 }
244 else
245 {
246 delete fb;
247 }
248 }
249
250 void FindVideoFilePopup(const QString &prefix, const QString &prefixAlt,
251 QObject &inst, const QString &returnEvent)
252 {
253 QString fp;
254
255 if (prefix.startsWith("myth://"))
256 fp = prefix;
257 else
258 fp = prefix.isEmpty() ? prefixAlt : prefix;
259
260 MythScreenStack *popupStack =
261 GetMythMainWindow()->GetStack("popup stack");
262 QStringList exts;
263
266 for (const auto & fa : fa_list)
267 exts << QString("*.%1").arg(fa.extension.toUpper());
268
269 auto *fb = new MythUIFileBrowser(popupStack, fp);
270 fb->SetNameFilter(exts);
271 if (fb->Create())
272 {
273 fb->SetReturnEvent(&inst, returnEvent);
274 popupStack->AddScreen(fb);
275 }
276 else
277 {
278 delete fb;
279 }
280 }
281
282 const QString CEID_COVERARTFILE = "coverartfile";
283 const QString CEID_BANNERFILE = "bannerfile";
284 const QString CEID_FANARTFILE = "fanartfile";
285 const QString CEID_SCREENSHOTFILE = "screenshotfile";
286 const QString CEID_TRAILERFILE = "trailerfile";
287 const QString CEID_NEWCATEGORY = "newcategory";
288}
289
290void EditMetadataDialog::createBusyDialog(const QString& title)
291{
292 if (m_busyPopup)
293 return;
294
295 const QString& message = title;
296
298 "mythvideobusydialog");
299
300 if (m_busyPopup->Create())
302}
303
305{
308
309 m_seasonSpin->SetRange(0,9999,1,5);
311 m_episodeSpin->SetRange(0,999,1,10);
313 if (m_yearSpin)
314 {
315 m_yearSpin->SetRange(0,9999,1,100);
317 }
319 {
320 m_userRatingSpin->SetRange(0,10,1,2);
322 }
323 if (m_lengthSpin)
324 {
325 m_lengthSpin->SetRange(0,999,1,15);
327 }
328
329 // No memory leak. MythUIButtonListItem adds the new item into
330 // m_categoryList.
332 const VideoCategory::entry_list &vcl =
334 for (const auto & vc : vcl)
335 {
336 // No memory leak. MythUIButtonListItem adds the new item into
337 // m_categoryList.
338 auto *button = new MythUIButtonListItem(m_categoryList, vc.second);
339 button->SetData(vc.first);
340 }
342
344 i <= ParentalLevel::plHigh && i.good(); ++i)
345 {
346 // No memory leak. MythUIButtonListItem adds the new item into
347 // m_levelList.
348 auto *button = new MythUIButtonListItem(m_levelList,
349 tr("Level %1").arg(i.GetLevel()));
350 button->SetData(i.GetLevel());
351 }
353
354 //
355 // Fill the "always play this video next" option
356 // with all available videos.
357 //
358
359 // No memory leak. MythUIButtonListItem adds the new item into
360 // m_childList.
361 new MythUIButtonListItem(m_childList,tr("None"));
362
363 // TODO: maybe make the title list have the same sort order
364 // as elsewhere.
365 using title_list = std::vector<std::pair<unsigned int, QString> >;
367 title_list tc;
368 tc.reserve(mdl.size());
369 for (const auto & md : mdl)
370 {
371 QString title;
372 if (md->GetSeason() > 0 || md->GetEpisode() > 0)
373 {
374 title = QString("%1 %2x%3").arg(md->GetTitle(),
375 QString::number(md->GetSeason()),
376 QString::number(md->GetEpisode()));
377 }
378 else
379 {
380 title = md->GetTitle();
381 }
382 tc.emplace_back(md->GetID(), title);
383 }
384 std::sort(tc.begin(), tc.end(), title_sort<title_list::value_type>());
385
386 for (const auto & t : tc)
387 {
388 if (t.first != m_workingMetadata->GetID())
389 {
390 auto *button = new MythUIButtonListItem(m_childList,t.second);
391 button->SetData(t.first);
392 }
393 }
394
395 if (m_workingMetadata->GetChildID() > 0)
396 {
399 }
400
405 if (m_coverartText)
409 if (m_bannerText)
411 if (m_fanartText)
413 if (m_trailerText)
415
417 if (m_taglineEdit)
419 if (m_ratingEdit)
421 if (m_directorEdit)
423 if (m_inetrefEdit)
425 if (m_homepageEdit)
427 if (m_plotEdit)
429
430 if (m_coverart)
431 {
432 if (!m_workingMetadata->GetHost().isEmpty() &&
433 !m_workingMetadata->GetCoverFile().isEmpty() &&
434 !m_workingMetadata->GetCoverFile().startsWith("/"))
435 {
439 }
440 else
441 {
443 }
444
445 if (!m_workingMetadata->GetCoverFile().isEmpty())
446 m_coverart->Load();
447 }
448 if (m_screenshot)
449 {
450 if (!m_workingMetadata->GetHost().isEmpty() &&
451 !m_workingMetadata->GetScreenshot().isEmpty() &&
452 !m_workingMetadata->GetScreenshot().startsWith("/"))
453 {
457 }
458 else
459 {
461 }
462
463 if (!m_workingMetadata->GetScreenshot().isEmpty())
465 }
466 if (m_banner)
467 {
468 if (!m_workingMetadata->GetHost().isEmpty() &&
469 !m_workingMetadata->GetBanner().isEmpty() &&
470 !m_workingMetadata->GetBanner().startsWith("/"))
471 {
475 }
476 else
477 {
479 }
480
481 if (!m_workingMetadata->GetBanner().isEmpty())
482 m_banner->Load();
483 }
484 if (m_fanart)
485 {
486 if (!m_workingMetadata->GetHost().isEmpty() &&
487 !m_workingMetadata->GetFanart().isEmpty() &&
488 !m_workingMetadata->GetFanart().startsWith("/"))
489 {
493 }
494 else
495 {
497 }
498
499 if (!m_workingMetadata->GetFanart().isEmpty())
500 m_fanart->Load();
501 }
502}
503
505{
506 QString message = tr("Enter new category");
507
508 MythScreenStack *popupStack = GetMythMainWindow()->GetStack("popup stack");
509
510 auto *categorydialog = new MythTextInputDialog(popupStack,message);
511
512 if (categorydialog->Create())
513 {
514 categorydialog->SetReturnEvent(this, CEID_NEWCATEGORY);
515 popupStack->AddScreen(categorydialog);
516 }
517
518}
519
520void EditMetadataDialog::AddCategory(const QString& category)
521{
522 int id = VideoCategory::GetCategory().add(category);
524 new MythUIButtonListItem(m_categoryList, category, id);
526}
527
529{
532
533 emit Finished();
534 Close();
535}
536
538{
540}
541
543{
545}
546
548{
549 m_workingMetadata->SetCategoryID(item->GetData().toInt());
550}
551
553{
555}
556
558{
560}
561
563{
565}
566
568{
570}
571
573{
575}
576
578{
580}
581
583{
585}
586
588{
590}
591
593{
595}
596
598{
600}
601
603{
604 m_workingMetadata->SetLength(m_lengthSpin->GetDuration<std::chrono::minutes>());
605}
606
608{
610}
611
613{
615 SetShowLevel(ParentalLevel(item->GetData().toInt()).GetLevel());
616}
617
619{
620 m_cachedChildSelection = item->GetData().toInt();
622}
623
625{
628}
629
631{
634}
635
637{
638 if (!m_workingMetadata->GetHost().isEmpty())
639 {
640 QString url = StorageGroup::generate_file_url("Coverart",
642 "");
643 FindImagePopup(url, "", *this, CEID_COVERARTFILE);
644 }
645 else
646 {
647 FindImagePopup(gCoreContext->GetSetting("VideoArtworkDir"),
648 GetConfDir() + "/MythVideo", *this, CEID_COVERARTFILE);
649 }
650}
651
653{
654 if (!lookup)
655 return;
656
657 if (m_busyPopup)
658 {
660 m_busyPopup = nullptr;
661 }
662
663 auto type = lookup->GetData().value<VideoArtworkType>();
664 ArtworkList list = lookup->GetArtwork(type);
665
666 if (list.isEmpty())
667 {
668 MythWarningNotification n(tr("No image found"), tr("Metadata Editor"));
670 return;
671 }
672 auto *resultsdialog = new ImageSearchResultsDialog(m_popupStack, list, type);
673
674 connect(resultsdialog, &ImageSearchResultsDialog::haveResult,
676
677 if (resultsdialog->Create())
678 m_popupStack->AddScreen(resultsdialog);
679}
680
682{
683 QString msg = tr("Downloading selected artwork...");
684 createBusyDialog(msg);
685
686 auto *lookup = new MetadataLookup();
687 lookup->SetType(kMetadataVideo);
688
689 lookup->SetSubtype(GuessLookupType(m_workingMetadata));
690 lookup->SetHost(m_workingMetadata->GetHost());
691 lookup->SetAutomatic(true);
692 lookup->SetData(QVariant::fromValue<VideoArtworkType>(type));
693
694 DownloadMap downloads;
695 downloads.insert(type, info);
696 lookup->SetDownloads(downloads);
697 lookup->SetAllowOverwrites(true);
698 lookup->SetTitle(m_workingMetadata->GetTitle());
699 lookup->SetSubtitle(m_workingMetadata->GetSubtitle());
700 lookup->SetSeason(m_workingMetadata->GetSeason());
701 lookup->SetEpisode(m_workingMetadata->GetEpisode());
702 lookup->SetInetref(m_workingMetadata->GetInetRef());
703
705}
706
708{
709 if (!lookup)
710 return;
711
712 if (m_busyPopup)
713 {
715 m_busyPopup = nullptr;
716 }
717
718 auto type = lookup->GetData().value<VideoArtworkType>();
719 DownloadMap map = lookup->GetDownloads();
720
721 if (map.count() >= 1)
722 {
723 ArtworkInfo info = map.value(type);
724 QString filename = info.url;
725
726 if (type == kArtworkCoverart)
728 else if (type == kArtworkFanart)
730 else if (type == kArtworkBanner)
732 else if (type == kArtworkScreenshot)
734 }
735}
736
738{
739 QString msg = tr("Searching for available artwork...");
740 createBusyDialog(msg);
741
742 auto *lookup = new MetadataLookup();
743 lookup->SetStep(kLookupSearch);
744 lookup->SetType(kMetadataVideo);
745 lookup->SetAutomatic(true);
746 if (m_workingMetadata->GetSeason() > 0 ||
748 lookup->SetSubtype(kProbableTelevision);
749 else if (m_workingMetadata->GetSubtitle().isEmpty())
750 lookup->SetSubtype(kProbableMovie);
751 else
752 lookup->SetSubtype(kUnknownVideo);
753 lookup->SetData(QVariant::fromValue<VideoArtworkType>(type));
754
755 lookup->SetTitle(m_workingMetadata->GetTitle());
756 lookup->SetSubtitle(m_workingMetadata->GetSubtitle());
757 lookup->SetSeason(m_workingMetadata->GetSeason());
758 lookup->SetEpisode(m_workingMetadata->GetEpisode());
759 lookup->SetInetref(m_workingMetadata->GetInetRef());
760
761 m_query->addLookup(lookup);
762}
763
765{
767}
768
770{
772}
773
775{
777}
778
780{
782}
783
785{
786 if (file.isEmpty())
787 return;
788
789 QString origfile = file;
790
791 if (file.startsWith("myth://"))
792 {
793 QUrl url(file);
794 file = url.path();
795 file = file.right(file.length() - 1);
796 if (!file.endsWith("/"))
798 else
800 }
801 else
802 {
804 }
805
807
808 if (m_coverart)
809 {
810 m_coverart->SetFilename(origfile);
811 m_coverart->Load();
812 }
813}
814
816{
817 if (!m_workingMetadata->GetHost().isEmpty())
818 {
819 QString url = StorageGroup::generate_file_url("Banners",
821 "");
822 FindImagePopup(url, "", *this, CEID_BANNERFILE);
823 }
824 else
825 {
826 FindImagePopup(gCoreContext->GetSetting("mythvideo.bannerDir"),
827 GetConfDir() + "/MythVideo/Banners", *this, CEID_BANNERFILE);
828 }
829}
830
832{
833 if (file.isEmpty())
834 return;
835
836 QString origfile = file;
837
838 if (file.startsWith("myth://"))
839 {
840 QUrl url(file);
841 file = url.path();
842 file = file.right(file.length() - 1);
843 if (!file.endsWith("/"))
845 else
846 m_workingMetadata->SetBanner(QString());
847 }
848 else
849 {
851 }
852
854
855 if (m_banner)
856 {
857 m_banner->SetFilename(origfile);
858 m_banner->Load();
859 }
860}
861
863{
864 if (!m_workingMetadata->GetHost().isEmpty())
865 {
866 QString url = StorageGroup::generate_file_url("Fanart",
868 "");
869 FindImagePopup(url, "", *this, CEID_FANARTFILE);
870 }
871 else
872 {
873 FindImagePopup(gCoreContext->GetSetting("mythvideo.fanartDir"),
874 GetConfDir() + "/MythVideo/Fanart", *this, CEID_FANARTFILE);
875 }
876}
877
879{
880 if (file.isEmpty())
881 return;
882
883 QString origfile = file;
884
885 if (file.startsWith("myth://"))
886 {
887 QUrl url(file);
888 file = url.path();
889 file = file.right(file.length() - 1);
890 if (!file.endsWith("/"))
892 else
893 m_workingMetadata->SetFanart(QString());
894 }
895 else
896 {
898 }
899
901
902 if (m_fanart)
903 {
904 m_fanart->SetFilename(origfile);
905 m_fanart->Load();
906 }
907}
908
910{
911 if (!m_workingMetadata->GetHost().isEmpty())
912 {
913 QString url = StorageGroup::generate_file_url("Screenshots",
915 "");
916 FindImagePopup(url, "", *this, CEID_SCREENSHOTFILE);
917 }
918 else
919 {
920 FindImagePopup(gCoreContext->GetSetting("mythvideo.screenshotDir"),
921 GetConfDir() + "/MythVideo/Screenshots",
922 *this, CEID_SCREENSHOTFILE);
923 }
924}
925
927{
928 if (file.isEmpty())
929 return;
930
931 QString origfile = file;
932
933 if (file.startsWith("myth://"))
934 {
935 QUrl url(file);
936 file = url.path();
937 file = file.right(file.length() - 1);
938 if (!file.endsWith("/"))
940 else
942 }
943 else
944 {
946 }
947
949
950 if (m_screenshot)
951 {
952 m_screenshot->SetFilename(origfile);
954 }
955}
956
958{
959 if (!m_workingMetadata->GetHost().isEmpty())
960 {
961 QString url = StorageGroup::generate_file_url("Trailers",
963 "");
964 FindVideoFilePopup(url, "", *this, CEID_TRAILERFILE);
965 }
966 else
967 {
968 FindVideoFilePopup(gCoreContext->GetSetting("mythvideo.TrailersDir"),
969 GetConfDir() + "/MythVideo/Trailers", *this, CEID_TRAILERFILE);
970 }
971}
972
974{
975 if (file.isEmpty())
976 return;
977
978 if (file.startsWith("myth://"))
979 {
980 QUrl url(file);
981 file = url.path();
982 file = file.right(file.length() - 1);
983 if (!file.endsWith("/"))
985 else
986 m_workingMetadata->SetTrailer(QString());
987 }
988 else
989 {
991 }
993}
994
996{
997 if (levent->type() == DialogCompletionEvent::kEventType)
998 {
999 auto *dce = (DialogCompletionEvent*)(levent);
1000
1001 const QString resultid = dce->GetId();
1002
1003 if (resultid == CEID_COVERARTFILE)
1004 SetCoverArt(dce->GetResultText());
1005 else if (resultid == CEID_BANNERFILE)
1006 SetBanner(dce->GetResultText());
1007 else if (resultid == CEID_FANARTFILE)
1008 SetFanart(dce->GetResultText());
1009 else if (resultid == CEID_SCREENSHOTFILE)
1010 SetScreenshot(dce->GetResultText());
1011 else if (resultid == CEID_TRAILERFILE)
1012 SetTrailer(dce->GetResultText());
1013 else if (resultid == CEID_NEWCATEGORY)
1014 AddCategory(dce->GetResultText());
1015 }
1016 else if (levent->type() == MetadataLookupEvent::kEventType)
1017 {
1018 auto *lue = (MetadataLookupEvent *)levent;
1019
1020 MetadataLookupList lul = lue->m_lookupList;
1021
1022 if (lul.isEmpty())
1023 return;
1024
1025 // There should really only be one result here.
1026 // If not, USER ERROR!
1027 if (lul.count() == 1)
1028 {
1029 OnArtworkSearchDone(lul[0]);
1030 }
1031 else
1032 {
1033 if (m_busyPopup)
1034 {
1035 m_busyPopup->Close();
1036 m_busyPopup = nullptr;
1037 }
1038 }
1039 }
1040 else if (levent->type() == MetadataLookupFailure::kEventType)
1041 {
1042 auto *luf = (MetadataLookupFailure *)levent;
1043
1044 MetadataLookupList lul = luf->m_lookupList;
1045
1046 if (m_busyPopup)
1047 {
1048 m_busyPopup->Close();
1049 m_busyPopup = nullptr;
1050 }
1051
1052 if (!lul.empty())
1053 {
1054 MetadataLookup *lookup = lul[0];
1055 LOG(VB_GENERAL, LOG_INFO,
1056 QString("No results found for %1 %2 %3").arg(lookup->GetTitle())
1057 .arg(lookup->GetSeason()).arg(lookup->GetEpisode()));
1058 }
1059 }
1060 else if (levent->type() == ImageDLEvent::kEventType)
1061 {
1062 auto *ide = (ImageDLEvent *)levent;
1063
1064 MetadataLookup *lookup = ide->m_item;
1065
1066 if (!lookup)
1067 return;
1068
1069 handleDownloadedImages(lookup);
1070 }
1071 else if (levent->type() == ImageDLFailureEvent::kEventType)
1072 {
1073 MythErrorNotification n(tr("Failed to retrieve image"),
1074 tr("Metadata Editor"),
1075 tr("Check logs"));
1077 }
1078}
Event dispatched from MythUI modal dialogs to a listening class containing a result of some form.
Definition: mythdialogbox.h:41
static const Type kEventType
Definition: mythdialogbox.h:56
MetadataImageDownload * m_imageDownload
MetadataDownload * m_query
void AddCategory(const QString &category)
MythUISpinBox * m_userRatingSpin
MythUIText * m_trailerText
MythUIText * m_coverartText
void SetLevel(MythUIButtonListItem *item)
void customEvent(QEvent *levent) override
void createBusyDialog(const QString &title)
MythUIButton * m_trailerButton
MythUITextEdit * m_taglineEdit
void SetBanner(QString file)
void OnSearchListSelection(const ArtworkInfo &info, VideoArtworkType type)
MythScreenStack * m_popupStack
void OnArtworkSearchDone(MetadataLookup *lookup)
void SetCoverArt(QString file)
MythUITextEdit * m_playerEdit
MythUIButton * m_netCoverartButton
MythUICheckBox * m_browseCheck
MythUIText * m_bannerText
MythUISpinBox * m_episodeSpin
void SetScreenshot(QString file)
const VideoMetadataListManager & m_metaCache
MythUITextEdit * m_inetrefEdit
MythUITextEdit * m_titleEdit
MythUIButton * m_bannerButton
MythUICheckBox * m_watchedCheck
MythUITextEdit * m_ratingEdit
bool Create() override
MythUITextEdit * m_directorEdit
void SetTrailer(QString file)
MythUIImage * m_fanart
EditMetadataDialog(MythScreenStack *lparent, const QString &lname, VideoMetadata *source_metadata, const VideoMetadataListManager &cache)
MythUIButton * m_screenshotButton
MythUIButton * m_netFanartButton
void SetFanart(QString file)
MythUIButton * m_fanartButton
VideoMetadata * m_workingMetadata
MythUITextEdit * m_subtitleEdit
void SetChild(MythUIButtonListItem *item)
MythUIImage * m_banner
MythUIButton * m_netScreenshotButton
MythUIButton * m_coverartButton
MythUIBusyDialog * m_busyPopup
~EditMetadataDialog() override
MythUIButtonList * m_categoryList
MythUIImage * m_screenshot
void SetCategory(MythUIButtonListItem *item)
MythUISpinBox * m_seasonSpin
MythUIButtonList * m_levelList
MythUITextEdit * m_plotEdit
MythUIButtonList * m_childList
MythUITextEdit * m_homepageEdit
MythUIButton * m_netBannerButton
MythUIText * m_fanartText
MythUIButton * m_doneButton
MythUIImage * m_coverart
void handleDownloadedImages(MetadataLookup *lookup)
MythUISpinBox * m_yearSpin
MythUIText * m_screenshotText
VideoMetadata * m_origMetadata
MythUISpinBox * m_lengthSpin
void FindNetArt(VideoArtworkType type)
static FileAssociations & getFileAssociation()
Definition: dbaccess.cpp:836
const association_list & getList() const
Definition: dbaccess.cpp:811
std::vector< file_association > association_list
Definition: dbaccess.h:154
static const Type kEventType
static const Type kEventType
void haveResult(ArtworkInfo, VideoArtworkType)
void addLookup(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_lookupList takes ownership of the gi...
void addDownloads(MetadataLookup *lookup)
addLookup: Add lookup to bottom of the queue MetadataDownload::m_downloadList takes ownership of the ...
static const Type kEventType
static const Type kEventType
uint GetSeason() const
QVariant GetData() const
ArtworkList GetArtwork(VideoArtworkType type) const
QString GetTitle() const
DownloadMap GetDownloads() const
uint GetEpisode() const
QString GetSetting(const QString &key, const QString &defaultval="")
MythScreenStack * GetStack(const QString &Stackname)
bool Queue(const MythNotification &notification)
Queue a notification Queue() is thread-safe and can be called from anywhere.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
Screen in which all other widgets are contained and rendered.
void BuildFocusList(void)
virtual void Close()
Dialog prompting the user to enter a text string.
bool Create(void) override
void itemClicked(MythUIButtonListItem *item)
void SetValueByData(const QVariant &data)
void itemSelected(MythUIButtonListItem *item)
void Clicked()
void SetCheckState(MythUIStateType::StateType state)
bool GetBooleanCheckState(void) const
void valueChanged()
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
void SetRange(int low, int high, int step, uint pageMultiple=5)
Set the lower and upper bounds of the spinbox, the interval and page amount.
void SetValue(int val) override
Definition: mythuispinbox.h:32
std::enable_if_t< std::chrono::__is_duration< T >::value, T > GetDuration()
Definition: mythuispinbox.h:49
int GetIntValue(void) const override
Definition: mythuispinbox.h:39
QString GetText(void) const
void SetText(const QString &text, bool moveCursor=true)
void SetMaxLength(int length)
void valueChanged()
virtual void SetText(const QString &text)
Definition: mythuitext.cpp:115
void LosingFocus(void)
Level GetLevel() const
const entry_list & getList()
Definition: dbaccess.cpp:241
int add(const QString &name)
Definition: dbaccess.cpp:216
std::vector< entry > entry_list
Definition: dbaccess.h:16
static QString generate_file_url(const QString &storage_group, const QString &host, const QString &path)
static VideoCategory & GetCategory()
Definition: dbaccess.cpp:489
std::list< VideoMetadataPtr > metadata_list
const metadata_list & getList() const
const QString & GetHost() const
void SetTrailer(const QString &trailer)
void SetInetRef(const QString &inetRef)
const QString & GetCoverFile() const
void SetCoverFile(const QString &coverFile)
int GetYear() const
bool GetWatched() const
const QString & GetTitle() const
int GetCategoryID() const
void SetSubtitle(const QString &subtitle, const QString &sortSubtitle="")
void SetTagline(const QString &tagline)
void SetFanart(const QString &fanart)
void SetUserRating(float userRating)
void SetYear(int year)
unsigned int GetID() const
void SetSeason(int season)
const QString & GetFanart() const
ParentalLevel::Level GetShowLevel() const
void SetEpisode(int episode)
void SetPlot(const QString &plot)
std::chrono::minutes GetLength() const
int GetChildID() const
const QString & GetInetRef() const
void SetChildID(int childID)
const QString & GetBanner() const
const QString & GetTrailer() const
const QString & GetRating() const
void SetTitle(const QString &title, const QString &sortTitle="")
const QString & GetDirector() const
void SetCategoryID(int id)
void SetLength(std::chrono::minutes length)
bool GetBrowse() const
const QString & GetScreenshot() const
void SetDirector(const QString &director)
const QString & GetSubtitle() const
void SetScreenshot(const QString &screenshot)
const QString & GetTagline() const
int GetSeason() const
void SetRating(const QString &rating)
void SetHomepage(const QString &homepage)
const QString & GetPlayCommand() const
const QString & GetHomepage() const
void SetBanner(const QString &banner)
void SetPlayCommand(const QString &playCommand)
const QString & GetPlot() const
int GetEpisode() const
float GetUserRating() const
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
const QString VIDEO_CATEGORY_UNKNOWN
Definition: globals.cpp:7
@ kLookupSearch
@ kProbableTelevision
@ kUnknownVideo
@ kProbableMovie
@ kMetadataVideo
QMap< VideoArtworkType, ArtworkInfo > DownloadMap
LookupType GuessLookupType(ProgramInfo *pginfo)
QList< ArtworkInfo > ArtworkList
VideoArtworkType
@ kArtworkScreenshot
@ kArtworkFanart
@ kArtworkBanner
@ kArtworkCoverart
MythCoreContext * gCoreContext
This global variable contains the MythCoreContext instance for the app.
QString GetConfDir(void)
Definition: mythdirs.cpp:263
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
Definition: mythlogging.h:39
MythNotificationCenter * GetNotificationCenter(void)
MythMainWindow * GetMythMainWindow(void)
bool naturalSortCompare(const QString &a, const QString &b, Qt::CaseSensitivity caseSensitivity=Qt::CaseSensitive)
naturalCompare as a std::sort compatible function (ignoring the third parameter, which is never used)...
Definition: stringutil.h:57
void FindImagePopup(const QString &prefix, const QString &prefixAlt, QObject &inst, const QString &returnEvent)
void FindVideoFilePopup(const QString &prefix, const QString &prefixAlt, QObject &inst, const QString &returnEvent)
dictionary info
Definition: azlyrics.py:7
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
Definition: mythuiutils.h:27
void CheckedSet(MythUIStateType *uiItem, const QString &value)
Definition: videoutils.cpp:40