Go to the documentation of this file.
7 #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 const QString&
action = actions[i];
183 auto *menuPopup =
new MythDialogBox(tr(
"Menu"), popupStack,
"actionmenu");
185 if (menuPopup->Create())
188 menuPopup->SetReturnEvent(
this,
"action");
246 .toString(
"dd MMM yy (hh:mm)"));
251 ((!
p->GetSubtitle().isEmpty()) ?
p->GetSubtitle() +
"\n" :
"") +
252 p->GetDescription());
288 QList<ArchiveItem *> tempAList;
295 if (a->type !=
"Recording" || a->filename ==
p->GetPlaybackURL(
false,
true))
306 for (
auto *x : std::as_const(tempAList))
310 QList<ProgramInfo *> tempSList;
315 if (a->filename ==
p->GetPlaybackURL(
false,
true))
323 for (
auto *x : std::as_const(tempSList))
330 a->
type =
"Recording";
331 a->title =
p->GetTitle();
332 a->subtitle =
p->GetSubtitle();
333 a->description =
p->GetDescription();
334 a->startDate =
p->GetScheduledStartTime()
335 .toLocalTime().toString(
"dd MMM yy");
336 a->startTime =
p->GetScheduledStartTime()
337 .toLocalTime().toString(
"(hh:mm)");
338 a->size =
p->GetFilesize();
339 a->filename =
p->GetPlaybackURL(
false,
true);
340 a->hasCutlist =
p->HasCutlist();
341 a->useCutlist =
false;
348 a->encoderProfile =
nullptr;
349 a->editedDetails =
false;
379 p->GetTitle() +
" ~ " +
380 p->GetScheduledStartTime().toLocalTime()
381 .toString(
"dd MMM yy (hh:mm)"));
382 item->setCheckable(
true);
392 QString title =
p->GetTitle();
393 QString subtitle =
p->GetSubtitle();
395 QDateTime recstartts =
p->GetScheduledStartTime();
396 QDateTime recendts =
p->GetScheduledEndTime();
398 QString timedate = QString(
"%1 - %2")
402 uint season =
p->GetSeason();
403 uint episode =
p->GetEpisode();
407 if (season && episode)
409 seasone = QString(
"s%1e%2")
412 seasonx = QString(
"%1x%2")
417 item->SetText(title,
"title");
418 item->SetText(subtitle,
"subtitle");
419 if (subtitle.isEmpty())
420 item->SetText(title,
"titlesubtitle");
422 item->SetText(title +
" - \"" + subtitle +
'"',
425 item->SetText(timedate,
"timedate");
426 item->SetText(
p->GetDescription(),
"description");
430 item->SetText(QString::number(season),
"season");
431 item->SetText(QString::number(episode),
"episode");
432 item->SetText(seasonx,
"00x00");
433 item->SetText(seasone,
"s00e00");
435 item->DisplayState(
p->HasCutlist() ?
"yes" :
"no",
"cutlist");
437 item->SetData(QVariant::fromValue(
p));
439 QCoreApplication::processEvents();
459 if (
p->GetRecordingGroup() ==
"LiveTV" ||
460 p->GetRecordingGroup() ==
"Deleted")
506 if (
p->GetPlaybackURL(
false,
true) == a->filename)
513 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.
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.
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)
QString intToPaddedString(int n, int width=2)
Creates a zero padded string representation of an integer.
static bool Assign(ContainerType *container, UIType *&item, const QString &name, bool *err=nullptr)
void updateCategorySelector(void)
MBASE_PUBLIC QString formatKBytes(int64_t sizeKB, int prec=1)
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
GetRecordingListThread(RecordingSelector *parent)
@ kDateTimeFull
Default local time.
std::vector< ProgramInfo * > * RemoteGetRecordedList(int sort)
@ 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