Go to the documentation of this file.
10 #include <QApplication>
42 void run(
void)
override
62 bool foundtheme =
LoadWindowFromXML(
"mytharchive-ui.xml",
"recording_selector",
this);
81 LOG(VB_GENERAL, LOG_ERR,
"Cannot load screen 'recording_selector'");
109 QString message = tr(
"Retrieving Recording List.\nPlease Wait...");
113 auto *busyPopup =
new
116 if (busyPopup->Create())
125 while (thread->isRunning())
127 QCoreApplication::processEvents();
133 ShowOkPopup(tr(
"Either you don't have any recordings or "
134 "no recordings are available locally!"));
158 for (
int i = 0; i < actions.size() && !handled; i++)
160 QString
action = actions[i];
181 auto *menuPopup =
new MythDialogBox(tr(
"Menu"), popupStack,
"actionmenu");
183 if (menuPopup->Create())
186 menuPopup->SetReturnEvent(
this,
"action");
244 .toString(
"dd MMM yy (hh:mm)"));
249 ((!
p->GetSubtitle().isEmpty()) ?
p->GetSubtitle() +
"\n" :
"") +
250 p->GetDescription());
269 if (QFile::exists(
p->GetPathname() +
".png"))
286 QList<ArchiveItem *> tempAList;
293 if (a->type !=
"Recording" || a->filename ==
p->GetPlaybackURL(
false,
true))
304 for (
auto *x : qAsConst(tempAList))
308 QList<ProgramInfo *> tempSList;
313 if (a->filename ==
p->GetPlaybackURL(
false,
true))
321 for (
auto *x : qAsConst(tempSList))
328 a->
type =
"Recording";
329 a->title =
p->GetTitle();
330 a->subtitle =
p->GetSubtitle();
331 a->description =
p->GetDescription();
332 a->startDate =
p->GetScheduledStartTime()
333 .toLocalTime().toString(
"dd MMM yy");
334 a->startTime =
p->GetScheduledStartTime()
335 .toLocalTime().toString(
"(hh:mm)");
336 a->size =
p->GetFilesize();
337 a->filename =
p->GetPlaybackURL(
false,
true);
338 a->hasCutlist =
p->HasCutlist();
339 a->useCutlist =
false;
346 a->encoderProfile =
nullptr;
347 a->editedDetails =
false;
377 p->GetTitle() +
" ~ " +
378 p->GetScheduledStartTime().toLocalTime()
379 .toString(
"dd MMM yy (hh:mm)"));
380 item->setCheckable(
true);
390 QString
title =
p->GetTitle();
391 QString subtitle =
p->GetSubtitle();
393 QDateTime recstartts =
p->GetScheduledStartTime();
394 QDateTime recendts =
p->GetScheduledEndTime();
396 QString timedate = QString(
"%1 - %2")
400 uint season =
p->GetSeason();
401 uint episode =
p->GetEpisode();
405 if (season && episode)
407 seasone = QString(
"s%1e%2")
410 seasonx = QString(
"%1x%2")
415 item->SetText(
title,
"title");
416 item->SetText(subtitle,
"subtitle");
417 if (subtitle.isEmpty())
418 item->SetText(
title,
"titlesubtitle");
420 item->SetText(
title +
" - \"" + subtitle +
'"',
423 item->SetText(timedate,
"timedate");
424 item->SetText(
p->GetDescription(),
"description");
428 item->SetText(QString::number(season),
"season");
429 item->SetText(QString::number(episode),
"episode");
430 item->SetText(seasonx,
"00x00");
431 item->SetText(seasone,
"s00e00");
433 item->DisplayState(
p->HasCutlist() ?
"yes" :
"no",
"cutlist");
435 item->SetData(QVariant::fromValue(
p));
437 QCoreApplication::processEvents();
457 if (
p->GetRecordingGroup() ==
"LiveTV" ||
458 p->GetRecordingGroup() ==
"Deleted")
505 if (
p->GetPlaybackURL(
false,
true) == a->filename)
512 QCoreApplication::processEvents();
QString toString(const QDateTime &raw_dt, uint format)
Returns formatted string representing the time.
void start(QThread::Priority p=QThread::InheritPriority)
Tell MThread to start running the thread in the near future.
RecordingSelector * m_parent
void setCategory(MythUIButtonListItem *item)
bool Load(bool allowLoadInBackground=true, bool forceStat=false)
Load the image(s), wraps ImageLoader::LoadImage()
void run(void) override
Runs the Qt event loop unless we have a QRunnable, in which case we run the runnable run instead.
MPUBLIC QString format_season_and_episode(int seasEp, int digits)
void ShowMenu(void) override
MythUIButtonList * m_categorySelector
void toggleSelected(MythUIButtonListItem *item)
bool keyPressEvent(QKeyEvent *e) override
Key event handler.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
void RunProlog(void)
Sets up a thread, call this if you reimplement run().
MythUIText * m_filesizeText
MythUIType * GetFocusWidget(void) const
void getRecordingList(void)
MythUIImage * m_previewImage
bool TranslateKeyPress(const QString &Context, QKeyEvent *Event, QStringList &Actions, bool AllowJumps=true)
Get a list of actions for a keypress in the given context.
void Init(void) override
Used after calling Load() to assign data to widgets and other UI initilisation which is prohibited in...
bool SetFocusWidget(MythUIType *widget=nullptr)
void titleChanged(MythUIButtonListItem *item)
Basic menu dialog, message and a list of options.
vector< ProgramInfo * > * RemoteGetRecordedList(int sort)
QList< ProgramInfo * > m_selectedList
void BuildFocusList(void)
void updateRecordingList(void)
void RunEpilog(void)
Cleans up a thread's resources, call this if you reimplement run().
void updateSelectedList(void)
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
void updateCategorySelector(void)
MythUIButton * m_okButton
MythUIButtonList * m_recordingButtonList
Holds information on recordings and videos.
bool keyPressEvent(QKeyEvent *event) override
Key event handler.
MythUIText * m_datetimeText
friend class GetRecordingListThread
std::vector< ProgramInfo * > * m_recordingList
static bool LoadWindowFromXML(const QString &xmlfile, const QString &windowname, MythUIType *parent)
virtual void SetText(const QString &text)
~RecordingSelector(void) override
This is a wrapper around QThread that does several additional things.
MythUIImage * m_cutlistImage
MythMainWindow * GetMythMainWindow(void)
MythScreenStack * GetStack(const QString &Stackname)
MythUIText * m_descriptionText
static QString formatSize(int64_t sizeKB, int prec)
GetRecordingListThread(RecordingSelector *parent)
@ kDateTimeFull
Default local time.
@ kTime
Default local time.
void SetFilename(const QString &filename)
Must be followed by a call to Load() to load the image.
virtual void AddScreen(MythScreenType *screen, bool allowFade=true)
MythConfirmationDialog * ShowOkPopup(const QString &message, bool showCancel)
Non-blocking version of MythPopupBox::showOkPopup()
MythUIButton * m_cancelButton
QList< ArchiveItem * > * m_archiveList