00001 #include <QStringList>
00002
00003 #include "mythlogging.h"
00004
00005 #include "mythuibuttonlist.h"
00006 #include "mythuitext.h"
00007 #include "mythuibutton.h"
00008 #include "videometadata.h"
00009 #include "videoutils.h"
00010
00011 #include "videopopups.h"
00012
00013 CastDialog::CastDialog(MythScreenStack *lparent, VideoMetadata *metadata) :
00014 MythScreenType(lparent, "videocastpopup"), m_metadata(metadata)
00015 {
00016 }
00017
00018 bool CastDialog::Create()
00019 {
00020 if (!LoadWindowFromXML("video-ui.xml", "castpopup", this))
00021 return false;
00022
00023 MythUIButtonList *castList = NULL;
00024 MythUIButton *okButton = NULL;
00025
00026 bool err = false;
00027 UIUtilE::Assign(this, castList, "cast", &err);
00028
00029 if (err)
00030 {
00031 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'castpopup'");
00032 return false;
00033 }
00034
00035 UIUtilW::Assign(this, okButton, "ok");
00036
00037 if (okButton)
00038 connect(okButton, SIGNAL(Clicked()), SLOT(Close()));
00039
00040 QStringList cast = GetDisplayCast(*m_metadata);
00041 QStringListIterator castIterator(cast);
00042 while (castIterator.hasNext())
00043 {
00044 new MythUIButtonListItem(castList, castIterator.next());
00045 }
00046
00047 BuildFocusList();
00048
00049 return true;
00050 }
00051
00053
00054 PlotDialog::PlotDialog(MythScreenStack *lparent, VideoMetadata *metadata) :
00055 MythScreenType(lparent, "videoplotpopup"), m_metadata(metadata)
00056 {
00057 }
00058
00059 bool PlotDialog::Create()
00060 {
00061 if (!LoadWindowFromXML("video-ui.xml", "descriptionpopup", this))
00062 return false;
00063
00064 MythUIText *plotText = NULL;
00065 MythUIButton *okButton = NULL;
00066
00067 bool err = false;
00068 UIUtilE::Assign(this, plotText, "description", &err);
00069
00070 if (err)
00071 {
00072 LOG(VB_GENERAL, LOG_ERR, "Cannot load screen 'descriptionpopup'");
00073 return false;
00074 }
00075
00076 UIUtilW::Assign(this, okButton, "ok");
00077
00078 plotText->SetText(m_metadata->GetPlot());
00079
00080 if (okButton)
00081 connect(okButton, SIGNAL(Clicked()), SLOT(Close()));
00082
00083 BuildFocusList();
00084
00085 return true;
00086 }